/* EMOD App — design tokens from the EMOD logo (navy wordmark, blue and teal capsule) */
:root {
  --navy: #123c63; --navy-deep: #0c2a47; --blue: #1b7fb0; --teal: #12a58f; --mint: #1cc4a6;
  /* text and white-on-colour versions that pass WCAG AA 4.5:1 (accessibility audit, 6 Oct 2026). The brand teal
     stays for bars, borders, icons and focus rings; text uses --teal-ink, buttons with white text use --teal-btn. */
  --teal-ink: #0b6e60; --teal-btn: #0d7b6b; --blue-ink: #166a93; --navy-ink: #123c63;
  --ink: #14263a; --slate: #5b6b7c; --muted: #68727e; --line: #dfe8ec; --bg: #f2f7f8; --card: #ffffff;
  --teal-soft: #e3f6f2; --blue-soft: #e6f1f8; --navy-soft: #e9eff5; --grey-soft: #eef1f4;
  --green: #1e7d3c; --green-soft: #e3f3e8; --red: #b3372f; --red-soft: #fbeae8; --amber: #9c6308; --amber-soft: #fdf3e0;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(18, 60, 99, .08), 0 1px 2px rgba(18, 60, 99, .06);
  --shadow-lift: 0 14px 40px rgba(18, 60, 99, .16);
  --hero: linear-gradient(135deg, #123c63 0%, #1b7fb0 55%, #12a58f 100%);
  --tabs-h: 64px;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):root {
    --ink: #e8eef3; --slate: #a3b1c0; --muted: #8693a1; --teal-ink: #12a58f; --blue-ink: #6db3e0; --navy-ink: #cfe3f3; --line: #23313f; --bg: #0d1721; --card: #15212d;
    --teal-soft: #13302d; --blue-soft: #12283a; --navy-soft: #16273a; --grey-soft: #1c2937;
    --green-soft: #143224; --red-soft: #3a1c1a; --amber-soft: #3a2c12; --green: #4cc47a; --red: #ff8a80; --amber: #f0b354;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35); --shadow-lift: 0 14px 40px rgba(0, 0, 0, .5);
  }
}
html[data-theme="dark"]:root {
    --ink: #e8eef3; --slate: #a3b1c0; --muted: #8693a1; --teal-ink: #12a58f; --blue-ink: #6db3e0; --navy-ink: #cfe3f3; --line: #23313f; --bg: #0d1721; --card: #15212d;
    --teal-soft: #13302d; --blue-soft: #12283a; --navy-soft: #16273a; --grey-soft: #1c2937;
    --green-soft: #143224; --red-soft: #3a1c1a; --amber-soft: #3a2c12; --green: #4cc47a; --red: #ff8a80; --amber: #f0b354;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35); --shadow-lift: 0 14px 40px rgba(0, 0, 0, .5);
  }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15.5px; line-height: 1.5; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* the soft studio background from the reference screenshots: mint → cool white → peach, two blurred blobs */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 8% 6%, rgba(127, 224, 204, .38), transparent 70%),
    radial-gradient(55% 40% at 95% 88%, rgba(240, 180, 160, .32), transparent 70%),
    radial-gradient(40% 30% at 85% 15%, rgba(27, 127, 176, .14), transparent 70%),
    linear-gradient(180deg, #eef8f6 0%, #f3f7fa 50%, #f8f3ef 100%); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body::before { background:
    radial-gradient(60% 45% at 8% 6%, rgba(18, 165, 143, .22), transparent 70%),
    radial-gradient(55% 40% at 95% 88%, rgba(240, 133, 122, .12), transparent 70%),
    linear-gradient(180deg, #0d1721 0%, #0f1a25 100%); } }
html[data-theme="dark"] body::before { background:
    radial-gradient(60% 45% at 8% 6%, rgba(18, 165, 143, .22), transparent 70%),
    radial-gradient(55% 40% at 95% 88%, rgba(240, 133, 122, .12), transparent 70%),
    linear-gradient(180deg, #0d1721 0%, #0f1a25 100%); }

.top { background: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow); background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 19px; font-weight: 800; letter-spacing: .5px; color: var(--navy-ink); }
.brand-text small { font-size: 10.5px; color: var(--slate); font-weight: 600; letter-spacing: .2px; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .brand-text b { color: #dbe9f5; } }
html[data-theme="dark"] .brand-text b { color: #dbe9f5; }

.strike-chip {
  display: inline-flex; align-items: center; gap: 5px; border: none; cursor: pointer;
  background: var(--card); color: var(--navy-ink); box-shadow: var(--shadow); border-radius: 999px; padding: 7px 12px 7px 9px;
  font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px;
}
.strike-chip svg { color: var(--amber); }
.strike-chip.on { background: var(--hero); color: #fff; }
.strike-chip.on svg { color: #ffd66b; }

.view { padding: 6px 16px calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around;
  max-width: 720px; margin: 0 auto; height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 4px);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--slate); font-size: 11px; font-weight: 700; padding-top: 4px; border-radius: 12px; }
.tabs a svg, .tabs a img { width: 28px; height: 28px; object-fit: contain; filter: grayscale(1) opacity(.55); transition: filter .2s, transform .2s; }
.tabs a.active { color: var(--teal-ink); }
.tabs a.active img { filter: none; transform: translateY(-2px) scale(1.12); }
.tabs a.active svg { filter: drop-shadow(0 2px 6px rgba(18,165,143,.35)); }

/* ---------- primitives ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 2px 10px; }
.h-row h2 { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.h-row a { font-size: 13px; font-weight: 700; color: var(--teal-ink); }
.kicker { font-size: 11px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: var(--slate); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; border-radius: 14px; padding: 13px 18px; font-weight: 800; font-size: 15px; }
.btn-primary { background: var(--teal-btn); color: #fff; box-shadow: 0 8px 20px rgba(18,165,143,.3); width: 100%; }
.btn-navy { background: var(--navy); color: #fff; width: 100%; }
.btn-ghost { background: var(--navy-soft); color: var(--navy-ink); }
.btn-light { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.done { background: var(--green); color: #fff; box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--navy-soft); color: var(--navy-ink); white-space: nowrap; }
.chip.teal { background: var(--teal-soft); color: var(--teal-ink); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.grey { background: var(--navy-soft); color: var(--slate); }
.chip.light { background: rgba(255,255,255,.2); color: #fff; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-ink); font-weight: 800; font-size: 14px; padding: 8px 0 10px; }
.empty { text-align: center; color: var(--slate); padding: 28px 12px; font-size: 14px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------- today ---------- */
/* floating 3D objects (one Higgsfield image, white cut to alpha) as a band above the greeting */
.art-band { height: 132px; margin: -4px -16px -10px; overflow: hidden; position: relative; pointer-events: none; }
.art-band::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(180deg, transparent, var(--bg)); opacity: .0; }
.art-band img { width: 128%; max-width: none; margin-left: -14%; margin-top: -8px; animation: floaty 7s ease-in-out infinite; filter: drop-shadow(0 18px 24px rgba(18, 60, 99, .16)); }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-.6deg); } }
@media (min-width: 520px) { .art-band { height: 170px; } .art-band img { width: 100%; margin-left: 0; } }
.greet { padding: 8px 2px 12px; }
.greet .date { font-size: 13px; color: var(--slate); font-weight: 700; }
.greet h1 { font-size: 26px; font-weight: 850; letter-spacing: -.5px; line-height: 1.15; }
.hero { position: relative; border-radius: 24px; overflow: hidden; background: var(--hero); color: #fff; box-shadow: var(--shadow-lift); margin-bottom: 16px; }
.hero .hero-top { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; flex-wrap: wrap; }
.hero .poster { margin: 12px 16px 0; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.hero .poster img { width: 100%; height: auto; }
.hero .plate { margin: 12px 16px 0; border-radius: 14px; padding: 22px 18px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero .plate .kicker { color: rgba(255,255,255,.75); }
.hero .plate h3 { font-size: 30px; font-weight: 900; letter-spacing: -.5px; line-height: 1.05; margin-top: 6px; }
.hero .body { padding: 14px 16px 16px; }
.hero .body h2 { font-size: 21px; font-weight: 900; letter-spacing: -.3px; line-height: 1.15; }
.hero .body p { color: rgba(255,255,255,.85); font-size: 14px; margin-top: 4px; }
.hero .body .meta { display: flex; gap: 12px; color: rgba(255,255,255,.8); font-size: 12.5px; font-weight: 700; margin: 10px 0 12px; }
.hero .btn { width: 100%; background: #fff; color: #123c63; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.hero .btn.done { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); box-shadow: none; }

.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }
.tool { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; }
.tool .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.tool .ico svg { width: 24px; height: 24px; }
.tool b { font-size: 12px; font-weight: 800; line-height: 1.1; }
.tool small { font-size: 10px; color: var(--muted); font-weight: 700; }
.tool.soon { opacity: .72; }
.tool.soon .ico { background: var(--navy-soft) !important; color: var(--slate); }
.ico.teal { background: linear-gradient(135deg, var(--teal), var(--mint)); }
.ico.blue { background: linear-gradient(135deg, var(--navy), var(--blue)); }
.ico.red { background: linear-gradient(135deg, #b3372f, #e26a5f); }
.ico.amber { background: linear-gradient(135deg, #b0700a, #e6a640); }
.ico.purple { background: linear-gradient(135deg, #5b45a8, #8f7bd6); }
.ico.i3w, .num.i3w { background: linear-gradient(160deg, #ffffff, #eef6f5); box-shadow: inset 0 0 0 1px rgba(18,60,99,.06), 0 4px 10px rgba(18,60,99,.08); }
.i3 { width: 82%; height: 82%; object-fit: contain; }
.tool .ico { width: 54px; height: 54px; border-radius: 16px; }
.tool.soon .ico { background: linear-gradient(160deg, #ffffff, #eef6f5) !important; }
.tool.soon .i3 { filter: grayscale(.6) opacity(.6); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .ico.i3w, html:not([data-theme="light"]) .num.i3w, html:not([data-theme="light"]) .tool.soon .ico { background: linear-gradient(160deg, #1b2a38, #15212d) !important; } }
html[data-theme="dark"] .ico.i3w, html[data-theme="dark"] .num.i3w, html[data-theme="dark"] .tool.soon .ico { background: linear-gradient(160deg, #1b2a38, #15212d) !important; }


.strike-card { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; }
.strike-card .stat b { display: block; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--navy-ink); line-height: 1; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .strike-card .stat b, html:not([data-theme="light"]) .hero-mini b { color: #dbe9f5; } }
html[data-theme="dark"] .strike-card .stat b, html[data-theme="dark"] .hero-mini b { color: #dbe9f5; }

.strike-card .stat small { display: block; font-size: 11px; color: var(--slate); font-weight: 700; margin-top: 5px; text-transform: uppercase; letter-spacing: .5px; }
.week { display: flex; justify-content: space-between; margin-top: 14px; }
.week div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 700; }
.week i { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-soft); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.week i.taken { background: var(--teal-btn); color: #fff; }
.week i.frozen { background: var(--blue-soft); color: var(--blue-ink); }
.week i.today { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- learn ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 12px; margin: 6px 0 4px; }
.search svg { color: var(--muted); flex: none; }
.search input { flex: 1; border: none; background: none; font: inherit; font-size: 16px; padding: 10px 0; color: var(--ink); outline: none; }
.shelf { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.shelf > * { scroll-snap-align: start; flex: none; }
.series-card { width: 150px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.series-card .art { aspect-ratio: 1; background: var(--navy-soft); overflow: hidden; }
.series-card .art img { width: 100%; height: 100%; object-fit: cover; }
.series-card .t { padding: 10px 11px 12px; }
.series-card b { display: block; font-size: 14px; font-weight: 800; line-height: 1.15; }
.series-card small { display: block; font-size: 11.5px; color: var(--slate); margin-top: 3px; line-height: 1.3; }
.series-card .bar { height: 4px; border-radius: 2px; margin-top: 8px; background: var(--navy-soft); overflow: hidden; }
.series-card .bar i { display: block; height: 100%; }
.arch-card { width: 132px; }
.arch-card .art { aspect-ratio: 3/4; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; }
.row .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; flex: none; font-variant-numeric: tabular-nums; }
.row .thumb { width: 44px; height: 58px; border-radius: 8px; object-fit: cover; flex: none; background: var(--navy-soft); }
.row .txt { flex: 1; min-width: 0; }
.row .txt b { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.row .txt small { display: block; font-size: 12.5px; color: var(--slate); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .tick { color: var(--green); font-weight: 900; flex: none; }
.row .chev { color: var(--muted); flex: none; }
.series-head { border-radius: 24px; overflow: hidden; color: #fff; padding: 18px 18px 16px; margin-bottom: 14px; box-shadow: var(--shadow-lift); }
.series-head h1 { font-size: 26px; font-weight: 900; letter-spacing: -.4px; line-height: 1.1; }
.series-head p { color: rgba(255,255,255,.85); margin-top: 4px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; cursor: zoom-in; }
.gallery img { width: 100%; height: auto; }
.gallery figcaption { padding: 8px 10px 10px; font-size: 12px; font-weight: 700; line-height: 1.25; }
.gallery figcaption small { display: block; color: var(--slate); font-weight: 600; margin-top: 2px; }

/* ---------- dose reader ---------- */
.dose-poster { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lift); margin: 4px 0 14px; background: var(--card); }
.dose-plate { border-radius: 18px; padding: 26px 20px; color: #fff; margin: 4px 0 14px; box-shadow: var(--shadow-lift); }
.dose-plate .kicker { color: rgba(255,255,255,.75); }
.dose-plate h1 { font-size: 32px; font-weight: 900; letter-spacing: -.6px; line-height: 1.05; margin-top: 8px; }
.dose-plate p { color: rgba(255,255,255,.88); margin-top: 6px; font-size: 15px; }
.dose-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dose-title h1 { font-size: 24px; font-weight: 900; letter-spacing: -.4px; line-height: 1.15; }
.dose-title p { color: var(--slate); font-weight: 600; margin-top: 2px; }
.prose { margin-top: 14px; font-size: 16px; line-height: 1.62; }
.prose h2 { font-size: 17px; font-weight: 900; margin: 26px 0 8px; letter-spacing: -.2px; color: var(--navy-ink); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .prose h2, html:not([data-theme="light"]) .prose blockquote strong { color: #dbe9f5; } }
html[data-theme="dark"] .prose h2, html[data-theme="dark"] .prose blockquote strong { color: #dbe9f5; }

.prose p { margin: 0 0 12px; }
.prose blockquote { background: var(--teal-soft); border-left: 4px solid var(--teal); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 12px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--navy-soft); font-weight: 800; }
.prose img { border-radius: 12px; margin: 8px 0 14px; }
.prose strong { font-weight: 800; }

.q { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.q .qn { font-size: 11px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--teal-ink); margin-bottom: 6px; }
.q .stem { font-weight: 700; line-height: 1.45; margin-bottom: 12px; }
.opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--bg); border: 2px solid transparent; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 14.5px; line-height: 1.4; transition: transform .12s; }
.opt:active { transform: scale(.985); }
.opt .l { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 900; font-size: 12.5px; background: var(--card); color: var(--navy-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.opt.correct { background: var(--green-soft); border-color: var(--green); }
.opt.correct .l { background: var(--green); color: #fff; }
.opt.wrong { background: var(--red-soft); border-color: var(--red); }
.opt.wrong .l { background: var(--red); color: #fff; }
.q.answered .opt { cursor: default; }
.q .verdict { font-weight: 900; margin: 8px 0 6px; }
.q .verdict.ok { color: var(--green); } .q .verdict.no { color: var(--red); }
.explain { font-size: 14.5px; line-height: 1.55; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; animation: rise .25s ease both; }
.explain p { margin: 0 0 8px; } .explain p:last-child { margin: 0; }
.explain h1, .explain h2, .explain h3 { font-size: inherit; font-weight: inherit; margin: 0 0 8px; color: inherit; }
@keyframes rise { from { transform: translateY(6px); } to { transform: translateY(0); } }
.dose-done { text-align: center; padding: 20px 16px; }
.dose-done .big { font-size: 40px; }
.dose-done h3 { font-size: 19px; font-weight: 900; margin-top: 4px; }
.dose-done p { color: var(--slate); margin-top: 4px; font-size: 14px; }
.flip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 6px; }
.flip a { flex: 1; text-align: center; background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 12px; font-weight: 800; font-size: 14px; color: var(--navy-ink); }
.flip a.off { opacity: .35; pointer-events: none; }
.flip span { font-size: 12.5px; font-weight: 800; color: var(--slate); white-space: nowrap; }

/* ---------- placeholders (honest roadmap state) ---------- */
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan .row { align-items: flex-start; }
.plan .row .st { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; font-size: 12px; flex: none; background: var(--navy-soft); color: var(--slate); }
.plan .row .st.live { background: var(--teal-btn); color: #fff; }

/* ---------- me ---------- */
.about h3 { font-size: 17px; font-weight: 900; }
.about p { color: var(--slate); font-size: 14px; margin-top: 4px; }
.notice { background: var(--amber-soft); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.notice b { color: var(--amber); }

/* ---------- sheet + lightbox ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(8, 24, 40, .55); display: flex; align-items: flex-end; justify-content: center; padding: 0; backdrop-filter: blur(4px); }
.sheet .panel { width: 100%; max-width: 720px; background: var(--card); border-radius: 24px 24px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 18px); box-shadow: var(--shadow-lift); animation: up .28s cubic-bezier(.2,.8,.2,1) both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.sheet p { color: var(--slate); font-size: 14.5px; margin-bottom: 10px; line-height: 1.5; }
.sheet ul { padding-left: 20px; color: var(--slate); font-size: 14px; margin-bottom: 14px; }
.sheet li { margin-bottom: 5px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(4, 12, 20, .94); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); object-fit: contain; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; }
.fade { animation: fade .22s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.row .num svg { width: 22px; height: 22px; }

/* light / dark switch in the top bar */
.theme-btn { margin-inline-start: auto; width: 36px; height: 36px; border: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--card); color: var(--navy-ink); box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent; }
html[data-theme="dark"] .theme-btn { color: #dbe9f5; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .theme-btn { color: #dbe9f5; } }
.top .strike-chip { margin-inline-start: 8px; }

/* selected segment must stay readable in dark mode */
html[data-theme="dark"] .seg button.on { color: #e8eef3; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .seg button.on { color: #e8eef3; } }

/* search */
.top .find-btn { margin-inline-start: auto; }
.top .find-btn + .theme-btn { margin-inline-start: 8px; }
.sx-dot { color: #fff; font-weight: 900; font-size: 13px; }
.sx-g { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); flex: none; max-width: 84px; text-align: end; line-height: 1.2; }
.sx-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sx-groups span { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; font-size: 12.5px; font-weight: 700; border-inline-start: 4px solid var(--c); }
.sx-groups b { display: block; font-size: 18px; font-weight: 900; }

/* top bar fits three buttons */
.top .theme-btn { width: 34px; height: 34px; }
.top .strike-chip { padding: 6px 10px 6px 8px; }
.brand-text small { white-space: nowrap; }
@media (max-width: 400px) { .brand-text small { font-size: 10.5px; letter-spacing: 0; } }

/* usage screen (#/stats, owner only) */
.st-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.st-l { width: 84px; flex: none; font-weight: 700; color: var(--slate); text-transform: capitalize; }
.st-b { flex: 1; height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; }
.st-b i { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.st-row b { min-width: 34px; text-align: end; font-variant-numeric: tabular-nums; }

/* open practice (tools/practice.js) */
.pr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.pr-stats b { display: block; font-size: 24px; font-weight: 900; letter-spacing: -.5px; }
.pr-stats small { font-size: 12px; font-weight: 700; color: var(--slate); }
.pr-bar { display: block; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.pr-bar i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.pr-bar.big { height: 8px; margin: 4px 0 12px; }
.pr-set .txt small { white-space: normal; }
.pr-from { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: 13.5px; font-weight: 800; color: var(--teal-ink); }

/* download for offline use (tools/offline.js) */
.off-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.off-row:first-child { margin-top: 10px; }
.off-t { flex: 1; min-width: 0; }
.off-t b { display: block; font-size: 14.5px; font-weight: 800; }
.off-t small { display: block; font-size: 12.5px; color: var(--slate); line-height: 1.35; margin-top: 2px; }
.off-t .off-s { font-weight: 700; }
.off-row .btn { width: auto; flex: none; padding: 9px 14px; font-size: 13.5px; box-shadow: none; }
#off-clear { margin-top: 6px; }
