/* ==========================================================================
   Large Print Daily — stylesheet
   Large type, high contrast, generous targets, calm palette.
   Base: 20px root, body 24px (18pt) — "Extra large" raises root to 23px.
   ========================================================================== */

:root {
  --cream: #f7f1e4;
  --paper: #fffdf8;
  --paper-2: #fdf9f0;
  --ink: #12233d;
  --ink-soft: #40536f;
  --ink-faint: #63748c;
  --line: #ded3bf;
  --line-strong: #b9aa90;
  --teal: #0d5c51;
  --teal-dark: #08443c;
  --teal-tint: #e4f0ec;
  --amber: #e8a92c;
  --amber-tint: #fdf0d2;
  --green: #1d6b45;
  --green-tint: #e6f3ea;
  --rose: #9c3527;
  --rose-tint: #fbe9e5;
  --shadow: 0 1px 2px rgba(18, 35, 61, .05), 0 14px 30px -22px rgba(18, 35, 61, .45);
  --radius: 22px;
  --radius-sm: 14px;
  --tabbar-h: 90px;
  --focus: #1b4fd8;
}

html {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html[data-size="xlarge"] { font-size: 23px; }

html[data-contrast="high"] {
  --cream: #ffffff;
  --paper: #ffffff;
  --paper-2: #ffffff;
  --ink: #000000;
  --ink-soft: #141414;
  --ink-faint: #1f1f1f;
  --line: #000000;
  --line-strong: #000000;
  --teal: #003b33;
  --teal-dark: #00251f;
  --teal-tint: #dcefe9;
  --amber: #8a5a00;
  --amber-tint: #fff2cf;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  font-size: 1.2rem;
  line-height: 1.55;
  letter-spacing: .002em;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 750; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- layout */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
}

.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
}
.brand-mark {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 14px;
  background: var(--teal);
  color: #fffdf8;
  display: grid;
  place-items: center;
}
.brand-mark svg { width: 28px; height: 28px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 1.06rem; letter-spacing: -.015em; }
.brand-sub { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }

.topnav { margin-left: auto; display: none; gap: 4px; }
.topnav button {
  min-height: 54px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.topnav button[aria-current="page"] { background: var(--teal-tint); color: var(--teal-dark); border-color: var(--teal); }
.topnav button:hover { background: var(--paper-2); color: var(--ink); }

.size-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 16px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
}
.size-toggle .aa { font-size: 1.35rem; line-height: 1; }
.size-toggle:hover { border-color: var(--teal); }

@media (min-width: 860px) {
  .topnav { display: flex; }
  .size-toggle { margin-left: 8px; }
}

main {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px 20px calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom));
  outline: none;
}

main:focus, main:focus-visible { outline: none; }

.wrap-wide { max-width: 1000px; margin: 0 auto; }

@media (min-width: 860px) {
  main { padding-bottom: 56px; }
}

.wrap-narrow { max-width: 720px; margin: 0 auto; }

/* ----------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px -20px rgba(18, 35, 61, .5);
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--tabbar-h);
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  padding: 8px 4px;
}
.tabbar button svg { width: 30px; height: 30px; }
.tabbar button[aria-current="page"] { color: var(--teal-dark); background: var(--teal-tint); }
.tabbar button[aria-current="page"]::after {
  content: ""; position: absolute; top: 0; width: 56%; height: 4px; background: var(--teal);
  border-radius: 0 0 4px 4px;
}
.tabbar button { position: relative; }

@media (min-width: 860px) {
  .tabbar { display: none; }
}

body.no-tabs .tabbar,
body.no-tabs main { display: none; }
body.no-tabs main { display: block; } /* only nav hidden */
body.onboarding .tabbar { display: none; }
body.onboarding main { padding-bottom: 40px; }
body.onboarding .topnav { display: none; }
body.onboarding .site-foot { display: none; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-tint { background: var(--teal-tint); border-color: #cfe3dd; }
.card-amber { background: var(--amber-tint); border-color: #f0dba6; }
.card-flat { box-shadow: none; }

.card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .head-icon {
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  background: var(--cream); display: grid; place-items: center; color: var(--teal);
}
.card-head .head-icon svg { width: 26px; height: 26px; }
.card-head .head-text { flex: 1; min-width: 0; }
.card-head .head-note { font-size: .95rem; color: var(--ink-soft); margin-top: 2px; }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 6px;
}

.muted { color: var(--ink-soft); }
.small { font-size: .95rem; }
.tiny { font-size: .82rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 62px;
  padding: 14px 24px;
  border-radius: 16px;
  border: 2px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 24px; height: 24px; flex: none; }
.btn-primary { --btn-bg: var(--teal); --btn-fg: #fffdf8; --btn-bd: var(--teal); }
.btn-primary:hover { --btn-bg: var(--teal-dark); --btn-bd: var(--teal-dark); }
.btn-secondary:hover { --btn-bg: var(--cream); }
.btn-quiet { --btn-bg: var(--teal-tint); --btn-fg: var(--teal-dark); --btn-bd: #c9ded8; }
.btn-quiet:hover { --btn-bg: #d6e8e3; }
.btn-danger { --btn-bg: #fff; --btn-fg: var(--rose); --btn-bd: var(--rose); }
.btn-danger:hover { --btn-bg: var(--rose-tint); }
.btn-block { width: 100%; }
.btn-lg { min-height: 74px; font-size: 1.18rem; padding: 18px 26px; }
.btn-sm { min-height: 52px; padding: 10px 16px; font-size: .95rem; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row > .btn { flex: 1 1 200px; }

.link-btn {
  background: none; border: 0; padding: 10px 4px; color: var(--teal);
  font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
  min-height: 48px;
}

/* ------------------------------------------------------------------- home */
.hero {
  background: var(--teal);
  color: #fffdf8;
  border: 0;
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 18px 40px -28px rgba(13, 92, 81, .8);
}
.hero .eyebrow { color: #bfe0d8; }
.hero h1 { color: #fffdf8; font-size: 1.9rem; margin-bottom: 6px; }
.hero .hero-date { color: #d6ece6; font-weight: 600; }
.hero .hero-sub { color: #e6f4f0; margin-top: 10px; font-size: 1.02rem; }
.hero .btn-primary { --btn-bg: #fffdf8; --btn-fg: var(--teal-dark); --btn-bd: #fffdf8; }
.hero .btn-primary:hover { --btn-bg: #f2ece0; }
.hero .btn-secondary { --btn-bg: transparent; --btn-fg: #fffdf8; --btn-bd: #a9cfc7; }
.hero .btn-secondary:hover { --btn-bg: rgba(255,255,255,.12); }

.hero-progress { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 2px solid rgba(255,255,255,.34);
  color: #fffdf8;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: .9rem;
}
.pill.done { background: #fffdf8; color: var(--teal-dark); border-color: #fffdf8; }
.pill svg { width: 20px; height: 20px; }

.grid-2 { display: grid; gap: 18px; }
@media (min-width: 820px) {
  .grid-2 { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .grid-2 > .card + .card { margin-top: 0; }
}

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-top: 2px solid var(--line);
}
.checklist li:first-child { border-top: 0; }
.checklist .tick {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center; color: transparent;
  background: var(--paper);
}
.checklist .tick svg { width: 24px; height: 24px; }
.checklist li.done .tick { background: var(--teal); border-color: var(--teal); color: #fff; }
.checklist li.done .item-title { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 2px; }
.checklist .item-title { display: block; font-weight: 700; }
.checklist .item-note { display: block; font-size: .92rem; color: var(--ink-soft); }
.checklist.summary li.done .item-title { text-decoration: none; color: var(--ink); }
.checklist.feature-list .tick { background: var(--teal-tint); border-color: #c9ded8; color: var(--teal); }
.checklist.feature-list li { border-top: 0; padding: 10px 0; }

.streak {
  display: flex; align-items: center; gap: 14px;
  background: var(--amber-tint);
  border: 2px solid #efd79d;
  border-radius: 18px;
  padding: 14px 18px;
}
.streak .flame { font-size: 1.6rem; line-height: 1; display: grid; place-items: center; flex: none; }
.streak .flame svg { width: 34px; height: 34px; }
.streak strong { font-size: 1.05rem; }

/* ------------------------------------------------------------------ trial */
.trialbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: var(--paper);
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: .95rem;
}
.trialbar strong { color: var(--ink); }
.trialbar .btn { margin-left: auto; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 18px; }
.field > label, .label {
  display: block;
  font-weight: 750;
  margin-bottom: 8px;
  font-size: 1rem;
}
.field .hint { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; }
.input, .select {
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  font-size: 1.05rem;
}
.input:focus, .select:focus { border-color: var(--teal); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312233d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 22px; padding-right: 48px; }
.field-row { display: grid; gap: 14px; }
@media (min-width: 640px) { .field-row.cols-2 { grid-template-columns: 1fr 1fr; } }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0;
  border-top: 2px solid var(--line);
}
.switch-row:first-of-type { border-top: 0; }
.switch-row .label { margin: 0; }
.switch {
  flex: none;
  width: 82px; height: 46px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: var(--cream);
  position: relative;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.switch::after {
  content: "";
  position: absolute; top: 4px; left: 4px;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line-strong);
  transition: transform .15s ease;
}
.switch[aria-checked="true"] { background: var(--teal); border-color: var(--teal); }
.switch[aria-checked="true"]::after { transform: translateX(36px); border-color: var(--teal); }

.choice-group { display: grid; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  min-height: 76px;
  padding: 16px 18px;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-weight: 650;
  font-size: 1.05rem;
}
.choice .demo { pointer-events: none; }
.choice .choice-label { flex: 1; }
.choice[aria-checked="true"] { border-color: var(--teal); background: var(--teal-tint); box-shadow: inset 0 0 0 2px var(--teal); }
.choice .radio {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-strong);
  flex: none; display: grid; place-items: center;
}
.choice[aria-checked="true"] .radio { border-color: var(--teal); }
.choice[aria-checked="true"] .radio::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--teal); }

/* --------------------------------------------------------------- word game */
.game-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 16px; }

.word-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 18px; padding: 0; list-style: none; }
.word-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: var(--paper);
  font-weight: 800;
  letter-spacing: .12em;
  font-size: .95rem;
}
.word-chip.found { background: var(--teal); border-color: var(--teal); color: #fffdf8; text-decoration: line-through; }

.letter-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  max-width: 460px;
  margin: 0 auto;
  touch-action: manipulation;
}
.letter-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(1rem, 4.4vw, 1.3rem);
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  padding: 0;
  transition: background .1s ease, border-color .1s ease, transform .08s ease;
  touch-action: manipulation;
}
.letter-cell:hover { border-color: var(--teal); }
.letter-cell.path { background: var(--amber-tint); border-color: var(--amber); transform: scale(.96); }
.letter-cell.found { background: var(--teal); border-color: var(--teal); color: #fffdf8; }
.letter-cell.hint { animation: pulse 1s ease-in-out 3; border-color: var(--amber); }
.letter-cell.wrong { animation: shake .3s ease; border-color: var(--rose); background: var(--rose-tint); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,169,44,.9); } 50% { box-shadow: 0 0 0 10px rgba(232,169,44,0); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.path-readout {
  min-height: 40px;
  margin: 14px auto 0;
  text-align: center;
  font-weight: 800;
  letter-spacing: .2em;
  color: var(--teal-dark);
  font-size: 1.1rem;
}

/* ------------------------------------------------------------------- quiz */
.progress-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .3s ease; }
.step-dots { display: flex; gap: 8px; }
.step-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.step-dots span.on { background: var(--teal); }

.question { font-size: 1.35rem; font-weight: 750; line-height: 1.35; margin: 8px 0 20px; }
.options { display: grid; gap: 12px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 16px 18px;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--teal); background: var(--paper-2); }
.option .letter {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  background: var(--cream); display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
}
.option.correct { border-color: var(--green); background: var(--green-tint); }
.option.correct .letter { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--rose); background: var(--rose-tint); }
.option.wrong .letter { background: var(--rose); color: #fff; }
.option:disabled { cursor: default; opacity: 1; }

.feedback {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  font-size: 1rem;
}
.feedback.good { border-color: var(--green); background: var(--green-tint); }
.feedback.miss { border-color: var(--rose); background: var(--rose-tint); }
.feedback strong { display: block; margin-bottom: 4px; font-size: 1.1rem; }

/* ------------------------------------------------------------------- math */
.math-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
}
.math-question { font-size: 2.6rem; font-weight: 800; letter-spacing: .02em; margin: 6px 0 12px; }
.math-answer {
  min-width: 3.4ch;
  display: inline-block;
  border-bottom: 6px solid var(--teal);
  padding: 0 12px 4px;
  color: var(--teal-dark);
}
.math-answer.empty { color: var(--line-strong); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 380px; margin: 20px auto 0; }
.key {
  min-height: 72px;
  border-radius: 16px;
  border: 2px solid var(--line-strong);
  background: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}
.key:hover { border-color: var(--teal); background: var(--paper-2); }
.key.key-fn { font-size: 1.05rem; background: var(--cream); }
.key.key-enter { background: var(--teal); border-color: var(--teal); color: #fff; font-size: 1.1rem; }
.key.key-enter:hover { background: var(--teal-dark); }

/* ------------------------------------------------------------------ check */
.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.session-top .progress-bar { flex: 1; }
.session-title { font-size: .95rem; font-weight: 750; color: var(--ink-soft); white-space: nowrap; }
.close-x {
  width: 56px; height: 56px; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--paper);
  display: grid; place-items: center; cursor: pointer;
}
.close-x svg { width: 24px; height: 24px; }

.score-ring {
  width: 132px; height: 132px; margin: 0 auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--teal) var(--pct, 0%), var(--line) 0);
  position: relative;
}
.score-ring::before {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--paper);
}
.score-ring span { position: relative; font-size: 1.9rem; font-weight: 800; color: var(--teal-dark); }

.prompt-card {
  background: var(--amber-tint);
  border: 2px solid #efd79d;
  border-radius: 18px;
  padding: 20px;
  margin-top: 18px;
}
.prompt-card .prompt-q { font-size: 1.2rem; font-weight: 750; }

/* ------------------------------------------------------------------- meds */
.slot-head {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 10px;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
}
.slot-head:first-child { margin-top: 0; }
.slot-head .slot-count { margin-left: auto; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink-soft); font-size: .95rem; }
.med-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  margin-bottom: 10px;
}
.med-row.taken { background: var(--teal-tint); border-color: var(--teal); }
.med-toggle {
  width: 64px; height: 64px; flex: none;
  border-radius: 16px;
  border: 3px solid var(--teal);
  background: #fff; color: var(--teal);
  display: grid; place-items: center; cursor: pointer;
}
.med-toggle svg { width: 32px; height: 32px; }
.med-row.taken .med-toggle { background: var(--teal); color: #fff; }
.med-name { font-weight: 750; font-size: 1.06rem; }
.med-dose { font-size: .92rem; color: var(--ink-soft); }
.med-time { margin-left: auto; font-size: .85rem; color: var(--teal-dark); font-weight: 700; text-align: right; white-space: nowrap; }
.med-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 12px;
  border: 2px solid transparent; background: none; color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--cream); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------- progress */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--teal-dark); line-height: 1.1; }
.stat .lbl { font-size: .88rem; color: var(--ink-soft); margin-top: 4px; }

.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (min-width: 640px) { .day-strip { grid-template-columns: repeat(14, 1fr); } }
.day-cell {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 8px 4px 6px;
  text-align: center;
}
.day-cell .dow { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-weight: 800; }
.day-cell .dom { font-size: .95rem; font-weight: 800; }
.day-cell .meter { height: 8px; border-radius: 4px; background: var(--line); margin-top: 6px; overflow: hidden; }
.day-cell .meter i { display: block; height: 100%; background: var(--teal); }
.day-cell.today { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.day-cell.blank { opacity: .45; }

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--ink-soft); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }

/* ----------------------------------------------------------------- report */
.report-sheet {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 30px;
}
.report-sheet h2 { font-size: 1.6rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-soft); font-size: .95rem; margin-bottom: 18px; }
.report-lines { margin: 0; padding-left: 1.2em; }
.report-lines li { margin-bottom: 8px; }
.report-table { width: 100%; max-width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; table-layout: fixed; }
.report-table th, .report-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.report-table th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.report-table td.c, .report-table th.c { text-align: center; }

@media (max-width: 560px) {
  .report-table, .report-table tbody, .report-table tr, .report-table td { display: block; width: 100%; }
  .report-table thead { display: none; }
  .report-table { margin: 14px 0; font-size: 1rem; }
  .report-table tr { border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; }
  .report-table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .report-table td.c { text-align: right; }
  .report-table td::before { content: attr(data-l); font-weight: 700; color: var(--ink-soft); text-align: left; }
  .report-table td:first-child { font-weight: 800; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
  .report-table td:first-child::before { content: ""; }
}

/* ----------------------------------------------------------------- dialog */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 24, 40, .55);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-radius: 22px;
  border: 2px solid var(--line);
  padding: 26px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
  margin: auto;
}
.modal h2 { font-size: 1.35rem; }
.modal .btn-row { margin-top: 22px; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar-h) + 24px);
  transform: translate(-50%, 20px);
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: .98rem;
  max-width: min(560px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 860px) { .toast { bottom: 28px; } }

/* ----------------------------------------------------------------- footer */
.site-foot {
  border-top: 2px solid var(--line);
  background: var(--paper);
  padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
  margin-top: 10px;
}
.site-foot-inner {
  max-width: 1060px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center;
  font-size: .82rem; color: var(--ink-faint);
}
.site-foot strong { color: var(--ink-soft); }
@media (max-width: 859px) { .site-foot { padding-bottom: calc(var(--tabbar-h) + 26px); } }

/* ------------------------------------------------------------- onboarding */
.onboard-shell { max-width: 720px; margin: 0 auto; }
.onboard-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.onboard-steps { display: flex; gap: 6px; flex: 1; }
.onboard-steps i { height: 8px; flex: 1; border-radius: 999px; background: var(--line); }
.onboard-steps i.on { background: var(--teal); }
.welcome-art {
  width: 92px; height: 92px; border-radius: 26px;
  background: var(--teal); color: #fffdf8;
  display: grid; place-items: center; margin-bottom: 18px;
}
.welcome-art svg { width: 52px; height: 52px; }

/* ------------------------------------------------------------------- misc */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--teal-tint);
  color: var(--teal-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge.amber { background: var(--amber-tint); color: #7a4f00; }
.badge.rose { background: var(--rose-tint); color: var(--rose); }

.plan {
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan.featured { border-color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.plan .price { font-size: 2.1rem; font-weight: 800; color: var(--teal-dark); line-height: 1; white-space: nowrap; }
.plan .price small { display: block; font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin-top: 6px; white-space: normal; }
.plan ul { margin: 6px 0 0; padding-left: 1.1em; font-size: .95rem; color: var(--ink-soft); }
.plan ul li { margin-bottom: 6px; }
.plans-grid { display: grid; gap: 16px; align-items: stretch; }
@media (min-width: 760px) { .plans-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; } }
.plan .btn { margin-top: auto; }

.notice {
  border-left: 8px solid var(--amber);
  background: var(--amber-tint);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: .95rem;
}
.notice.info { border-color: var(--teal); background: var(--teal-tint); }
.notice.warn { border-color: var(--rose); background: var(--rose-tint); }

hr.sep { border: 0; border-top: 2px solid var(--line); margin: 22px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 480px) {
  .card { padding: 18px; border-radius: 18px; }
  .hero { padding: 22px 18px; border-radius: 20px; }
  .hero h1 { font-size: 1.55rem; }
  h1 { font-size: 1.7rem; }
  .med-row { flex-wrap: wrap; }
  .med-time { margin-left: 0; width: 100%; text-align: left; }
  .report-sheet { padding: 20px; }
  .btn { padding: 12px 18px; }
  .btn-row > .btn { flex: 1 1 100%; }
}

@media (max-width: 600px) {
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  .brand { gap: 9px; padding: 2px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand-name { font-size: .92rem; white-space: nowrap; }
  .brand-sub { display: none; }
  .size-toggle { padding: 0 12px; gap: 6px; min-height: 50px; }
  .size-toggle #size-label { display: none; }
  .size-toggle .aa { font-size: 1.25rem; }
  main { padding-left: 14px; padding-right: 14px; }
}

/* ------------------------------------------------------------------- print */
@media print {
  :root { --cream: #fff; --paper: #fff; --ink: #000; --ink-soft: #222; --line: #999; }
  html { font-size: 12pt; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .topbar, .tabbar, .site-foot, .no-print, .toast, .modal-backdrop { display: none !important; }
  main { padding: 0; max-width: none; }
  .report-sheet { border: 0; padding: 0; border-radius: 0; }
  .report-table th, .report-table td { border-bottom: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.print-head { display: none; }
@media print { .print-head { display: flex; } }
.print-head { justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #000; padding-bottom: 10px; margin-bottom: 18px; }
.print-head .ph-brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.print-head .ph-sub { font-size: .8rem; color: #444; }

/* ------------------------------------------------------------ preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html[data-motion="calm"] *, html[data-motion="calm"] *::before, html[data-motion="calm"] *::after {
  animation-duration: .001ms !important; transition-duration: .001ms !important;
}
