:root {
  --accent: #57b36a;
  --accent-soft: #e4f3e8;
  --ink: #16301e;
  --card: #ffffff;
  --bg: #f3f2ee;
  --muted: #6b7a70;
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: #222;
  min-height: 100%;
}
#app { max-width: 560px; margin: 0 auto; padding: 0 14px 90px; }

.hero {
  margin: 0 -14px; padding: calc(env(safe-area-inset-top, 0px) + 22px) 20px 18px;
  background: var(--hero, linear-gradient(135deg, #0f1c13, #1d3a26));
  color: #fff; border-radius: 0 0 26px 26px;
}
.hero .name { font-size: 26px; font-weight: 800; letter-spacing: .2px; }
.hero .date { opacity: .8; font-size: 14px; margin-top: 2px; }
.hero .tagline { opacity: .65; font-size: 13px; margin-top: 10px; font-style: italic; }

.meter { margin-top: 14px; background: rgba(255,255,255,.15); border-radius: 999px; height: 14px; overflow: hidden; }
.meter > div { height: 100%; background: #fff; border-radius: 999px; transition: width .35s ease; }
.meter-label { font-size: 12px; margin-top: 6px; opacity: .85; }

.tabs {
  display: flex; gap: 6px; position: sticky; top: 0; z-index: 5;
  background: var(--bg); padding: 12px 0 8px; margin-bottom: 4px;
}
.tabs button {
  flex: 1; border: 0; border-radius: 999px; padding: 10px 0;
  font: inherit; font-weight: 700; font-size: 14px;
  background: #e7e5df; color: #555; cursor: pointer;
}
.tabs button.active { background: var(--ink); color: #fff; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-top: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 8px; }

.habit {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 2px; border-bottom: 1px solid #efeee9;
}
.habit:last-child { border-bottom: 0; }
.habit .check {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px;
  border: 2.5px solid var(--accent); background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; cursor: pointer; transition: all .15s ease;
}
.habit .check.on { background: var(--accent); }
.habit .body { flex: 1; min-width: 0; }
.habit .title { font-weight: 700; font-size: 15px; }
.habit .title.done { text-decoration: line-through; opacity: .55; }
.habit .evidence { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.habit .streak {
  flex: 0 0 auto; font-size: 12px; font-weight: 800;
  background: var(--accent-soft); color: var(--ink);
  border-radius: 999px; padding: 4px 9px;
}
.habit .streak.zero { opacity: .35; }

.lesson { border-left: 4px solid var(--accent); }
.lesson .why { font-size: 13.5px; color: #444; line-height: 1.45; }

.taskrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.taskrow input[type="text"] {
  flex: 1 1 140px; font: inherit; padding: 10px 12px;
  border: 1.5px solid #ddd; border-radius: 12px;
}
.taskrow input[type="time"] {
  font: inherit; padding: 9px 10px; border: 1.5px solid #ddd; border-radius: 12px;
}
.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px;
  padding: 10px 16px; cursor: pointer;
  background: var(--accent); color: #fff;
}
.btn.ghost { background: #edece7; color: #333; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 10px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 4px 10px; margin-top: 8px;
  background: var(--accent-soft); color: var(--ink);
}
.alarm-state { font-size: 13px; color: var(--muted); margin-top: 8px; }
.pair-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 12px; }
.pair-row input {
  min-width: 0; width: 100%; padding: 10px 12px; border: 1.5px solid #ddd;
  border-radius: 12px; font: inherit; font-size: 20px; font-weight: 800;
  letter-spacing: .18em; text-align: center;
}
.pair-status { min-height: 20px; margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; }

.weekgrid { overflow-x: auto; }
.weekgrid table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.weekgrid th, .weekgrid td { padding: 6px 5px; text-align: center; min-width: 30px; }
.weekgrid th { color: var(--muted); font-weight: 600; font-size: 11px; }
.weekgrid td:first-child, .weekgrid th:first-child {
  text-align: left; font-weight: 600; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.weekgrid .cell { width: 18px; height: 18px; border-radius: 6px; margin: 0 auto; }
.weekgrid .done { background: var(--accent); }
.weekgrid .miss { background: #e3e1da; }
.weekgrid .off { background: transparent; }
.weekgrid .today-col { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.qr-wrap { display: flex; justify-content: center; margin: 12px 0; }
.qr-wrap canvas { border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
pre.json {
  font-size: 10.5px; background: #131411; color: #cdeccd;
  padding: 12px; border-radius: 12px; overflow-x: auto; max-height: 180px;
}
.muted-note { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.center { text-align: center; }
.sync-dot {
  position: fixed; bottom: 14px; right: 14px; z-index: 9;
  font-size: 11.5px; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); color: #555;
}
.sync-dot.pending { color: #b3541e; }
.sync-dot.ok { color: #2f7a3d; }
.flash {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: rgba(20, 40, 26, .92); color: #fff; font-size: 22px; font-weight: 800;
}
.flash .btn { font-size: 18px; }

.setup { max-width: 460px; margin: 12vh auto 0; text-align: center; padding: 0 18px; }
.setup h1 { font-size: 24px; }
.setup p { color: #555; line-height: 1.55; }

/* ---------- restored board charm (week chip, signal, lesson, project, ladder) ---------- */
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace; }

.week-chip {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .14em;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 10px;
}

.signal { border-left: 4px solid var(--accent); }
.signal-label { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.signal-quote { font-size: 16px; font-style: italic; margin-top: 6px; line-height: 1.4; }
.signal-by { font-size: 12px; color: var(--muted); margin-top: 4px; }

.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }

button.card { width: 100%; text-align: left; font: inherit; cursor: pointer; border: 0; }
.lesson.teaser { border-left: 4px solid var(--accent); display: block; }
.lesson.teaser:active { transform: scale(.99); }
.teaser-title { font-size: 17px; font-weight: 800; margin-top: 6px; }
.teaser-cta { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 6px; }

.lesson-full .lesson-title { font-size: 22px; margin: 6px 0 2px; }
.lesson-p { font-size: 15px; line-height: 1.55; color: #333; }
.rulebox {
  background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.rulebox .rule-text { font-size: 15.5px; font-weight: 800; margin-top: 4px; }
.debrief ol { margin: 8px 0 0; padding-left: 20px; }
.debrief li { font-size: 14px; line-height: 1.5; margin-top: 8px; }

.project .project-title { font-size: 21px; margin: 4px 0 2px; }
.proj-meter {
  height: 14px; border-radius: 999px; background: var(--accent-soft);
  overflow: hidden; margin-top: 10px;
}
.proj-meter > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.meter-line { font-size: 13px; margin-top: 6px; color: var(--muted); }
.meter-line b { color: var(--ink); }
.pips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pip {
  font: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  border: 2px solid var(--accent); color: var(--accent); background: transparent;
  border-radius: 12px; padding: 8px 14px; min-width: 52px;
}
.pip.sel { background: var(--accent); color: #fff; }
.loglist { margin-top: 14px; }
.logentry {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 2px; border-top: 1px solid #efeee9; font-size: 13.5px;
}
.logentry .log-main { flex: 1; min-width: 0; }
.log-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.log-del {
  border: 0; background: transparent; color: #b0aca2; font-size: 20px;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.idea-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.idea {
  background: var(--accent-soft); color: var(--ink);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 650;
}

.ladder .ladder-big { font-size: 20px; font-weight: 800; margin: 2px 0 4px; }
.rung { display: flex; gap: 12px; align-items: flex-start; padding: 9px 2px; border-top: 1px solid #efeee9; }
.rung-n {
  flex: 0 0 34px; height: 34px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  background: #efeee9; color: #9b968a;
}
.rung.done .rung-n { background: var(--accent); color: #fff; }
.rung.next .rung-n { background: var(--accent-soft); color: var(--ink); outline: 2px solid var(--accent); }
.rung-label { font-weight: 800; font-size: 14px; }
.rung.done .rung-label { color: var(--accent); }
.rung-flavor { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.rung-tag {
  display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 800;
  letter-spacing: .12em; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 3px 9px;
}

.footer-card { background: transparent; box-shadow: none; border: 1.5px dashed #d8d4ca; }
.footer-line { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }

/* tabs: five across on phones */
.tabs { gap: 5px; }
.tabs button { font-size: 12.5px; padding: 9px 0; }
