/* Udambu — a human body atlas on Kolam. Editorial, calm and clear; still easy for young children:
   large tap targets (48px+), every line can be heard, pictures before words. */
@font-face { font-family: Lato; font-weight: 400; font-display: swap; src: url(fonts/lato-400.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 700; font-display: swap; src: url(fonts/lato-700.woff2) format('woff2'); }
@font-face { font-family: Lato; font-weight: 900; font-display: swap; src: url(fonts/lato-900.woff2) format('woff2'); }

:root { --gutter: clamp(16px, 3vw, 48px); --stage: #0e1117; --stage-2: #1a2030; --art: linear-gradient(160deg, #1c2230 0%, #0f1219 100%); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/24px var(--font-sans); -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }
.k-icon { width: 22px; height: 22px; flex: none; }
.muted { color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.eyebrow { font: 700 12px/16px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.display { font: 900 34px/38px var(--font-display); letter-spacing: -.02em; }
.lede { font-size: 18px; line-height: 28px; color: var(--ink-2); max-width: 46ch; }
@media (min-width: 860px) { .display { font-size: 44px; line-height: 48px; } }

/* ---------- top bar & tab bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-2);
  padding: calc(var(--space-2) + env(safe-area-inset-top, 0px)) var(--gutter) var(--space-2); min-height: 56px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: var(--border-hairline) solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 900 18px/24px var(--font-display); letter-spacing: .01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--primary) url(icon.svg) center/cover; }
.topbar-title { display: none; flex: 1; text-align: center; font: 700 16px/22px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.deep .brand { display: none; }
body.deep .topbar-title { display: block; }
.topbar #mute { margin-left: auto; color: var(--ink-2); }
.back { color: var(--primary-text); margin-left: -10px; }
.back .k-icon { width: 26px; height: 26px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
.tabbar a { font-size: 12px; letter-spacing: .02em; }
.tabbar .k-pip .k-icon { width: 24px; height: 24px; }

main { width: 100%; max-width: none; margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-12); outline: none; }

/* ---------- Listen button ---------- */
.speak { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 14px; border-radius: var(--radius-pill); cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 700 15px/20px var(--font-sans); }
.speak .k-icon { color: var(--primary-text); }
.speak.icon-only { width: 48px; padding: 0; justify-content: center; }
.speak:hover { border-color: var(--primary); }
.speak:active { transform: scale(.97); }
.talking { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
.speak.talking { border-color: var(--primary); background: var(--primary-soft); }
.speak.talking .k-icon { animation: talk .8s ease-in-out infinite; }
@keyframes talk { 50% { opacity: .35; } }

.page-head, .home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.page-head .eyebrow, .home-head .eyebrow, .hero-text .eyebrow { margin-bottom: 6px; }
.home-head .lede { margin-top: 8px; }

/* ---------- Home ---------- */
.home { display: grid; gap: var(--space-4); }
.home-head { margin-bottom: 0; }
.layers { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); }
.layers::-webkit-scrollbar { display: none; }
.layer { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: var(--radius-pill); cursor: pointer;
  border: var(--border-hairline) solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 15px/20px var(--font-sans); }
.layer[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stage { position: relative; height: min(72vh, 680px); min-height: 420px; border-radius: var(--radius-xl); overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, var(--stage-2) 0%, var(--stage) 70%); }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.stage-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; margin: 0; pointer-events: none;
  color: #c9d1e0; font: 700 12px/16px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; opacity: .8; white-space: nowrap; }
.stage-hint .k-icon { width: 16px; height: 16px; }
.stage-pop { position: absolute; z-index: 2; transform: translate(-50%, calc(-100% - 10px)); animation: pop var(--duration-base) ease-out; }
.stage-pop a { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: var(--radius-md); text-decoration: none;
  background: #ffffff; color: #1f2433; box-shadow: var(--shadow-3); white-space: nowrap; }
.stage-pop img { width: 52px; height: 40px; object-fit: contain; border-radius: 6px; background: var(--art); }
.stage-pop small { display: block; font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: #5b6275; }
.stage-pop b { font: 700 17px/22px var(--font-sans); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)); } }
.side .eyebrow { margin-bottom: 8px; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.prow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 4px 12px 4px 4px; border-radius: var(--radius-md); text-decoration: none;
  background: var(--surface); border: var(--border-hairline) solid var(--line); font: 700 15px/20px var(--font-sans); }
.prow img { width: 60px; height: 46px; object-fit: contain; border-radius: 8px; background: var(--art); }
.prow span { flex: 1; }
.prow .k-icon { color: var(--ink-muted); width: 18px; height: 18px; }
@media (min-width: 900px) {
  .home { grid-template-columns: 1fr 300px; align-items: start; }
  .home-head, .layers { grid-column: 1 / -1; }
  .layers { margin: 0; padding: 2px 0; }
  .plist { grid-template-columns: 1fr; max-height: 640px; overflow: auto; }
}

/* ---------- Picture cards (3D renders on a dark art board) ---------- */
.sysnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) var(--space-8); padding: 2px var(--gutter); }
.sysnav a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); text-decoration: none;
  border: var(--border-hairline) solid var(--line); background: var(--surface); font: 700 14px/20px var(--font-sans); }
.sysnav i { width: 8px; height: 8px; border-radius: 50%; background: var(--sys); }
.sys { margin-bottom: var(--space-10); scroll-margin-top: 72px; }
.sys-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: var(--border-hairline) solid var(--line); }
.sys-head .muted { margin-top: 2px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
.pgrid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pcard { display: grid; border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; background: var(--surface); border: var(--border-hairline) solid var(--line);
  transition: transform var(--duration-fast), box-shadow var(--duration-fast); }
.pcard:hover { box-shadow: var(--shadow-2); }
.pcard:active { transform: scale(.98); }
.pcard-art { display: block; background: var(--art); aspect-ratio: 4 / 3; }
.pcard-art img { width: 100%; height: 100%; object-fit: contain; }
.pcard-text { display: grid; gap: 2px; padding: 10px 12px 12px; }
.pcard-sys { font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
.pcard-sys::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--sys); }
.pcard-name { font: 700 16px/22px var(--font-sans); }

/* ---------- Part page ---------- */
.part { display: grid; gap: var(--space-8); max-width: none; margin: 0 auto; }
.part-hero { display: grid; gap: var(--space-6); }
.hero-model { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-xl); overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--stage-2), var(--stage) 75%); }
.hero-model canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.hero-text { display: grid; gap: 12px; align-content: center; }
.part-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.jump a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--radius-pill); text-decoration: none;
  border: var(--border-hairline) solid var(--line); font: 700 14px/20px var(--font-sans); color: var(--ink-2); }
@media (min-width: 860px) { .part-hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }

.block { display: grid; gap: var(--space-4); scroll-margin-top: 72px; padding-top: var(--space-6); border-top: var(--border-hairline) solid var(--line); }
.block-head { display: flex; align-items: center; gap: 14px; }
.block-head h2 { flex: 1; }
.num { font: 700 13px/16px var(--font-mono); color: var(--sys, var(--primary-text)); letter-spacing: .04em; }
.prose { max-width: 62ch; color: var(--ink-2); }
.playpause { color: var(--ink-2); }
.demo-grid { display: grid; gap: var(--space-4); }
@media (min-width: 760px) { .demo-grid { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.demo-stage { border-radius: var(--radius-lg); background: var(--surface); border: var(--border-hairline) solid var(--line); padding: 8px; }
.demo-svg { width: 100%; height: auto; display: block; max-height: 340px; color: var(--ink); }
.demo-label { font: 700 11px/1 var(--font-sans); letter-spacing: .05em; text-transform: uppercase; fill: var(--ink-muted); }
.steps, .rows { list-style: none; margin: 0; padding: 0; display: grid; }
.steps button, .rows button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 8px; border: 0; background: transparent;
  text-align: left; cursor: pointer; font: 400 17px/24px var(--font-sans); border-bottom: var(--border-hairline) solid var(--line); border-radius: 0; }
.steps li:last-child button, .rows li:last-child button { border-bottom: 0; }
.steps .n { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong); font: 700 14px/1 var(--font-mono); color: var(--ink-2); }
.steps li.on button { font-weight: 700; }
.steps li.on .n { background: var(--sys, var(--primary)); border-color: var(--sys, var(--primary)); color: #fff; }
.rows button > .k-icon:first-child { color: var(--sys, var(--primary-text)); }
.rows button > span { flex: 1; }
.rows .row-say { width: 18px; height: 18px; color: var(--ink-muted); opacity: .7; }
.rows.care button > .k-icon:first-child { color: var(--success); }
.ill-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ill-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px 0 14px; border-radius: var(--radius-md); text-decoration: none;
  border: var(--border-hairline) solid var(--line); background: var(--surface); font: 700 15px/20px var(--font-sans); }
.ill-chip .k-icon:first-child { color: var(--danger); }
.ill-chip .k-icon:last-child { width: 16px; height: 16px; color: var(--ink-muted); }

.viewer { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--stage); }
.viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-start { position: absolute; inset: 0; padding: 0; border: 0; cursor: pointer; background: var(--art); }
.viewer-start img { width: 100%; height: 100%; object-fit: contain; opacity: .55; }
.viewer-cta { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: var(--radius-pill); background: #fff; color: #1f2433; font: 700 16px/20px var(--font-sans); box-shadow: var(--shadow-3); white-space: nowrap; }
.credit { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: var(--space-6); border-top: var(--border-hairline) solid var(--line); }
.prevnext a { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 12px; border-radius: var(--radius-md); text-decoration: none;
  border: var(--border-hairline) solid var(--line); background: var(--surface); font: 700 16px/22px var(--font-sans); }
.prevnext a:last-child { justify-content: flex-end; text-align: right; }
.prevnext small { display: block; font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.prevnext .k-icon { color: var(--ink-muted); }

/* ---------- Health ---------- */
.note { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: var(--space-6); border-radius: var(--radius-lg); background: var(--info-soft); }
.note > .k-icon { width: 28px; height: 28px; color: var(--info); }
.note p { flex: 1; font-size: 15px; line-height: 22px; }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--space-4); }
.seg button { flex: none; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); cursor: pointer; border: var(--border-hairline) solid var(--line); background: var(--surface);
  font: 700 14px/20px var(--font-sans); color: var(--ink-2); }
.seg button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ilist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.irow { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 6px 14px 6px 6px; border-radius: var(--radius-md); text-decoration: none;
  border: var(--border-hairline) solid var(--line); background: var(--surface); }
.irow-art { flex: none; width: 76px; height: 58px; border-radius: 8px; background: var(--art); overflow: hidden; }
.irow-art img { width: 100%; height: 100%; object-fit: contain; }
.irow-text { flex: 1; display: grid; }
.irow-text b { font: 700 16px/22px var(--font-sans); }
.irow-text small { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.irow > .k-icon:last-child { color: var(--ink-muted); width: 18px; height: 18px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--warning-soft); color: var(--warning); font: 700 12px/16px var(--font-sans); white-space: nowrap; }
.tag .k-icon { width: 14px; height: 14px; }
.ill { --sys: var(--danger); }
.ill.kind-germ { --sys: var(--success); }
.badges .k-badge { font-size: 13px; padding: 6px 10px; }
.badges .k-icon { width: 16px; height: 16px; }

/* ---------- Quiz ---------- */
.games { display: grid; gap: 10px; }
.game { display: flex; align-items: center; gap: 16px; padding: 8px 18px 8px 8px; border-radius: var(--radius-lg); text-decoration: none;
  border: var(--border-hairline) solid var(--line); background: var(--surface); }
.game.lead { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.game-art { flex: none; width: 128px; height: 96px; border-radius: var(--radius-md); background: var(--art); overflow: hidden; }
.game-art img { width: 100%; height: 100%; object-fit: contain; }
.game-text { flex: 1; display: grid; gap: 2px; }
.game-text b { font: 900 20px/26px var(--font-display); }
.game-text span { color: var(--ink-2); font-size: 15px; line-height: 22px; }
.game-text small { font: 700 12px/16px var(--font-sans); color: var(--primary-text); letter-spacing: .04em; }
.game > .k-icon { color: var(--ink-muted); }
.gamebox { display: grid; gap: var(--space-4); max-width: 760px; margin: 0 auto; }
.score { display: flex; gap: 4px; }
.score i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.score i.ok { background: var(--success); } .score i.no { background: var(--danger); } .score i.now { background: var(--ink-muted); }
.qhead { display: grid; gap: 8px; justify-items: start; }
.question { font: 900 26px/32px var(--font-display); letter-spacing: -.01em; }
.qpic { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); background: var(--art); overflow: hidden; }
.qpic img { width: 100%; height: 100%; object-fit: contain; }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts.text { grid-template-columns: 1fr; }
.opt { display: grid; padding: 0; border-radius: var(--radius-lg); overflow: hidden; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; }
.opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--art); }
.opt span { padding: 10px 6px; font: 700 15px/20px var(--font-sans); }
.opts.text .opt { text-align: left; min-height: 60px; align-items: center; }
.opts.text .opt-text { padding: 14px 18px; font-size: 17px; }
.opt:not(:disabled):hover { border-color: var(--line-strong); }
.opt.right { border-color: var(--success); background: var(--success-soft); }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.lesson { display: grid; gap: 14px; padding: 16px; border-radius: var(--radius-lg); border: var(--border-hairline) solid var(--line); background: var(--surface); animation: rise .3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.verdict { display: flex; align-items: center; gap: 8px; font: 700 15px/20px var(--font-sans); letter-spacing: .04em; text-transform: uppercase; }
.lesson.right .verdict { color: var(--success); } .lesson.wrong .verdict { color: var(--accent-text); }
.lesson-body { display: grid; gap: 16px; }
.lesson-body .body-lg { color: var(--ink-2); margin-top: 6px; }
.lesson-model { aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--stage-2), var(--stage) 75%); }
.lesson-model canvas { display: block; width: 100%; height: 100%; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.lesson-actions #next { margin-left: auto; }
@media (min-width: 640px) { .lesson-body { grid-template-columns: 240px 1fr; align-items: center; } }
.game-stage { height: min(62vh, 560px); }
.done { display: grid; justify-items: center; gap: 12px; padding: var(--space-10) 0; text-align: center; }
.done-score { font: 900 72px/1 var(--font-display); letter-spacing: -.03em; }
.done-score span { font-size: 28px; color: var(--ink-muted); }
.stars { display: flex; gap: 6px; }
.stars .k-icon { width: 36px; height: 36px; color: var(--line-strong); }
.stars .lit { color: #d99a00; fill: #f2c14e; }
.done-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.k-btn-lg { min-height: 52px; font-size: 16px; }
.k-btn .k-icon { width: 18px; height: 18px; }
.confetti { position: fixed; width: 8px; height: 12px; border-radius: 2px; z-index: 99; pointer-events: none; animation: confetti 1.1s ease-out forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* ---------- inside the phone apps ---------- */
html.app .brand-mark { display: none; }
@media (prefers-reduced-motion: reduce) { .speak.talking .k-icon { animation: none; } }

/* ================= Pro anatomy look (dark, glass, glowing accents) ================= */
:root[data-theme="dark"] {
  --bg: #06080c; --surface: rgba(255,255,255,.045); --surface-raised: #11151d; --surface-sunken: rgba(255,255,255,.03);
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.22);
  --ink: #f2f5fa; --ink-2: #b9c2d3; --ink-muted: #7f8aa0;
  --primary: #3ec6ff; --primary-hover: #7ad8ff; --on-primary: #021a26; --primary-soft: rgba(62,198,255,.14); --primary-text: #6fd4ff;
  --glow: 0 0 0 1px rgba(62,198,255,.55), 0 0 24px rgba(62,198,255,.25);
  --stage: #05070b; --stage-2: #101827; --art: radial-gradient(ellipse at 50% 40%, #182235 0%, #07090e 80%);
}
body { background: radial-gradient(1200px 600px at 50% -200px, #0f2338 0%, transparent 70%), var(--bg); background-attachment: fixed; }
.topbar { background: rgba(6,8,12,.72); border-bottom-color: rgba(255,255,255,.06); }
.tabbar { background: rgba(10,13,19,.82); border-top-color: rgba(255,255,255,.07); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.tabbar a { color: var(--ink-muted); }
.tabbar a[aria-current="page"] { color: var(--primary-text); }
.tabbar a[aria-current="page"] .k-pip { background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(62,198,255,.35); }
.eyebrow { color: var(--primary-text); }
.display { color: #fff; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.speak { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.speak:hover, .speak.talking { border-color: var(--primary); box-shadow: var(--glow); background: var(--primary-soft); }
.k-btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 24px rgba(62,198,255,.3); }
.k-btn-outline { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary-text); text-decoration: none; font: 700 14px/20px var(--font-sans); }
.link .k-icon { width: 16px; height: 16px; }
iframe.sf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* home hero: the full-body model fills the screen, words float over it */
.home { display: grid; gap: var(--space-10); }
.hero3d { position: relative; margin: calc(-1 * var(--space-6)) calc(-1 * var(--gutter)) 0; height: min(78vh, 760px); min-height: 520px; overflow: hidden;
  background: radial-gradient(ellipse at 60% 40%, #13213a 0%, #05070b 70%); }
.hero3d-model { position: absolute; inset: 0; }
.hero3d-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; justify-items: start; padding: 120px var(--gutter) var(--space-6);
  background: linear-gradient(to top, #06080c 15%, rgba(6,8,12,.85) 45%, transparent); pointer-events: none; }
.hero3d-text > * { pointer-events: auto; }
.hero3d .lede { color: var(--ink-2); }
@media (min-width: 900px) {
  .hero3d { margin: 0; border-radius: 28px; border: 1px solid var(--line); }
  .hero3d-text { right: auto; top: 0; width: 46%; align-content: end; padding: var(--space-10); background: linear-gradient(to right, #06080c 30%, transparent); }
}
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.row-head .muted { margin-top: 4px; max-width: 52ch; }
.sysrail { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; scroll-snap-type: x mandatory; }
.sysrail::-webkit-scrollbar { display: none; }
.systile { scroll-snap-align: start; position: relative; display: grid; padding: 0; border-radius: 18px; overflow: hidden; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: #0b0e14; aspect-ratio: 3 / 4; }
.systile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: transform .4s, opacity .3s; }
.systile span { position: relative; align-self: end; display: grid; gap: 2px; padding: 40px 14px 14px; background: linear-gradient(to top, rgba(4,6,10,.95) 30%, transparent); }
.systile b { font: 700 16px/20px var(--font-sans); color: #fff; }
.systile small { font: 700 11px/14px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sys); filter: brightness(1.5); }
.systile[aria-selected="true"] { border-color: var(--primary); box-shadow: var(--glow); }
.systile[aria-selected="true"] img { opacity: 1; transform: scale(1.06); }

/* glass part cards */
.pcard { background: var(--surface); border-color: var(--line); border-radius: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pcard:hover { box-shadow: var(--glow); border-color: transparent; }
.pcard-art { background: #0b0e14; aspect-ratio: 1; overflow: hidden; }
.pcard-art img { object-fit: cover; transition: transform .4s; }
.pcard:hover .pcard-art img { transform: scale(1.05); }
.pcard-sys::before { box-shadow: 0 0 8px var(--sys); }
.pcard-name { color: #fff; }
.sysnav a, .jump a, .seg button, .ill-chip, .prevnext a, .irow, .game, .opt, .lesson, .note, .demo-stage, .block { --glass: 1; }
.sysnav a, .jump a, .seg button { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.seg button[aria-selected="true"] { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary); box-shadow: var(--glow); }
.sys-head { border-bottom-color: var(--line); }

/* part page: model on top, edge to edge on phones */
.part-hero { gap: var(--space-4); }
.hero-model { aspect-ratio: auto; height: min(62vh, 560px); margin: calc(-1 * var(--space-6)) calc(-1 * var(--gutter)) 0; border-radius: 0; background: radial-gradient(ellipse at 50% 40%, #142037, #05070b 75%); }
.hero-model .hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-model .stage-hint { z-index: 1; background: rgba(0,0,0,.45); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(8px); animation: hintout 6s forwards; }
@keyframes hintout { 75% { opacity: .9; } to { opacity: 0; } }
@media (min-width: 860px) { .hero-model { margin: 0; border-radius: 24px; border: 1px solid var(--line); height: 520px; } }
.part-hero .credit { margin-top: -4px; }
.block { border-top-color: var(--line); }
.demo-stage { background: radial-gradient(ellipse at 50% 30%, #101827, #080b11 80%); border-color: var(--line); }
.demo-svg .demo-label { fill: #9aa6bd; }
.steps button, .rows button { border-bottom-color: var(--line); color: var(--ink); }
.steps .n { border-color: var(--line-strong); color: var(--ink-2); }
.steps li.on .n { box-shadow: 0 0 14px var(--sys, var(--primary)); }
.ill-chip, .prevnext a, .irow, .game { background: var(--surface); border-color: var(--line); }
.irow-art, .game-art { background: #0b0e14; }
.irow-art img, .game-art img { object-fit: cover; }
.note { background: rgba(62,198,255,.08); border: 1px solid rgba(62,198,255,.25); }
.note > .k-icon { color: var(--primary-text); }
.tag { background: rgba(242,180,74,.14); color: #f2c46b; }
.game.lead { border-color: var(--primary); box-shadow: var(--glow); }
.game-art { width: 112px; height: 112px; }
.qpic { background: #0b0e14; } .qpic img { object-fit: cover; }
.opt { background: var(--surface); border-color: var(--line); color: var(--ink); }
.opt img { background: #0b0e14; object-fit: cover; aspect-ratio: 1; }
.opt.right { border-color: #3ad29a; background: rgba(58,210,154,.12); box-shadow: 0 0 18px rgba(58,210,154,.25); }
.opt.wrong { border-color: #ff7a6b; background: rgba(255,122,107,.1); }
.lesson { background: rgba(255,255,255,.05); border-color: var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lesson.right .verdict { color: #3ad29a; } .lesson.wrong .verdict { color: #ffb36b; }
.lesson-model { position: relative; background: #0b0e14; }
.lesson-model img { width: 100%; height: 100%; object-fit: cover; }
.turn3d { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.5); color: #fff; font: 700 13px/18px var(--font-sans); cursor: pointer; backdrop-filter: blur(8px); white-space: nowrap; }
.turn3d .k-icon { width: 16px; height: 16px; }
.score i { background: rgba(255,255,255,.1); } .score i.ok { background: #3ad29a; box-shadow: 0 0 8px rgba(58,210,154,.6); } .score i.no { background: #ff7a6b; } .score i.now { background: var(--primary); }
.done-score span { color: var(--ink-muted); }
.question { color: #fff; }
@media (min-width: 900px) { .home { grid-template-columns: 1fr; } }

.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
iframe.sf { opacity: 0; transition: opacity .6s; }
iframe.sf.ready { opacity: 1; }
.hero3d-text { justify-items: stretch; }
.hero3d-text > .speak { justify-self: start; }
.hero3d-text .lede { max-width: min(46ch, 100%); }
.home > *, .part > *, .gamebox > * { min-width: 0; }

/* adult reference details */
.term { margin-top: 4px; font: 400 15px/20px var(--font-mono); color: var(--primary-text); letter-spacing: .02em; }
.part-title { align-items: flex-start; }
.where { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 15px; line-height: 22px; }
.where .k-icon { width: 18px; height: 18px; color: var(--ink-muted); margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 4px 0 0; }
.stats div { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stats dt { font: 700 11px/14px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.stats dd { margin: 4px 0 0; font: 700 18px/24px var(--font-sans); color: #fff; }
.note.warn { background: rgba(255,179,107,.08); border-color: rgba(255,179,107,.3); }
.note.warn > .k-icon { color: #ffb36b; }

/* ---------- AR ---------- */
.ar-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px; border-radius: 999px; cursor: pointer; justify-self: start;
  border: 1px solid rgba(62,198,255,.55); background: linear-gradient(135deg, rgba(62,198,255,.22), rgba(122,140,255,.18)); color: #fff; font: 700 16px/20px var(--font-sans);
  box-shadow: 0 0 24px rgba(62,198,255,.22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ar-btn .k-icon { width: 24px; height: 24px; color: var(--primary-text); }
.ar-btn:active { transform: scale(.97); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lesson-actions .ar-btn { min-height: 48px; font-size: 15px; }
body.noscroll { overflow: hidden; }
.arsheet { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(ellipse at 50% 45%, #15233a 0%, #05070b 75%); animation: rise .25s ease-out; }
.arsheet header, .arsheet footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter, 16px) 10px; }
.arsheet footer { display: grid; gap: 6px; padding: 12px var(--gutter, 16px) calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(6,8,12,.7); }
.arsheet footer .muted { display: flex; gap: 8px; align-items: flex-start; } .arsheet footer .muted .k-icon { width: 18px; height: 18px; color: var(--primary-text); flex: none; margin-top: 2px; }
.ar-stage { position: relative; min-height: 0; }
.ar-stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.ar-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-muted); font: 700 14px/20px var(--font-sans); }
.ar-open { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px;
  border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 17px/20px var(--font-sans); box-shadow: 0 10px 30px rgba(62,198,255,.35); cursor: pointer; white-space: nowrap; }
.ar-open .k-icon { width: 22px; height: 22px; }

/* ---------- Android app mode (Material Design 3) ----------
   vendor/m3/kolam-m3.css (loaded after this file) builds the app bar and navigation bar and maps the Kolam
   tokens onto M3 colour roles (Udambu stays dark). Here Udambu's own components get M3 shapes.
   Only html.k-android (inside the Android app) is touched; the website keeps its Kolam look. */
html.k-android main { padding-top: 16px; }
html.k-android body { background: var(--md-sys-color-surface); }
html.k-android .hero3d, html.k-android .hero-model { margin-top: -16px; }
html.k-android .hero3d-text { background: linear-gradient(to top, var(--md-sys-color-surface) 15%, color-mix(in srgb, var(--md-sys-color-surface) 85%, transparent) 45%, transparent); }
html.k-android .display { font: var(--md-sys-typescale-headline-large); text-shadow: none; }
html.k-android .speak, html.k-android .ar-btn { min-height: 40px; border-radius: var(--md-sys-shape-corner-full); font: var(--md-sys-typescale-label-large); backdrop-filter: none; -webkit-backdrop-filter: none; }
html.k-android .speak { background: transparent; border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-primary); box-shadow: none; }
html.k-android .speak .k-icon, html.k-android .ar-btn .k-icon { color: currentColor; }
html.k-android .ar-btn { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border: 0; box-shadow: none; }
/* filter chips */
html.k-android .sysnav a, html.k-android .jump a { height: 32px; min-height: 32px; border-radius: var(--md-sys-shape-corner-small); background: transparent; border: 1px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-label-large); box-shadow: none; }
html.k-android .ill-chip { border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); border-color: transparent; backdrop-filter: none; }
/* segmented buttons */
html.k-android .seg button { height: 40px; border-radius: var(--md-sys-shape-corner-full); background: transparent; border-color: var(--md-sys-color-outline); color: var(--md-sys-color-on-surface); box-shadow: none; font: var(--md-sys-typescale-label-large); }
html.k-android .seg button[aria-selected="true"] { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-color: var(--md-sys-color-outline); box-shadow: none; }
/* cards and list rows */
html.k-android .pcard, html.k-android .game, html.k-android .irow, html.k-android .note, html.k-android .block, html.k-android .demo-stage, html.k-android .lesson, html.k-android .prevnext a { border-radius: var(--md-sys-shape-corner-medium); border-color: transparent; background: var(--md-sys-color-surface-container-low); backdrop-filter: none; -webkit-backdrop-filter: none; }
html.k-android .block { background: transparent; border-radius: 0; border-top-color: var(--md-sys-color-outline-variant); }
html.k-android .systile { border-radius: var(--md-sys-shape-corner-large); }
html.k-android .systile[aria-selected="true"], html.k-android .game.lead { border-color: var(--md-sys-color-primary); box-shadow: inset 0 0 0 1px var(--md-sys-color-primary); }
html.k-android .opt { border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container-low); border-color: var(--md-sys-color-outline-variant); }
html.k-android .k-btn-primary { box-shadow: none; }

/* ---------- iPhone app mode (Apple HIG) ----------
   vendor/ios/kolam-ios.css (loaded after this file) builds the navigation bar and the Liquid Glass tab bar and maps
   the Kolam tokens onto iOS system colours (Udambu stays dark). Here Udambu's own components get iOS shapes.
   Only html.k-ios (inside the iPhone app, or ?app=ios) is touched; the website keeps its Kolam look. */
html.k-ios .topbar, html.k-ios .tabbar { display: none; } /* nav bar + tab bar + edge swipe replace them */
html.k-ios body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); font-family: var(--ios-font); }
html.k-ios main { padding: 8px 16px 32px; }
html.k-ios .page-head h1 { display: none; } /* shown as the navigation bar's large title */
html.k-ios .page-head { align-items: center; }
html.k-ios .hero3d, html.k-ios .hero-model { margin-top: -8px; }
html.k-ios .display { font: 700 34px/41px var(--ios-font-display); letter-spacing: .011em; }
html.k-ios .eyebrow { font: 600 13px/18px var(--ios-font); letter-spacing: 0; text-transform: none; }
html.k-ios .lede, html.k-ios .muted { font-family: var(--ios-font); }
html.k-ios .speak, html.k-ios .ar-btn { min-height: 44px; border-radius: 999px; font: 600 17px/22px var(--ios-font); letter-spacing: -.024em; }
html.k-ios .speak { background: color-mix(in srgb, var(--ios-tint) 16%, transparent); border: 0; color: var(--ios-tint); box-shadow: none; }
html.k-ios .speak .k-icon, html.k-ios .ar-btn .k-icon { color: currentColor; }
html.k-ios .ar-btn { background: var(--ios-tint-fill); color: var(--ios-on-tint); border: 0; box-shadow: none; }
html.k-ios .speak:active, html.k-ios .ar-btn:active, html.k-ios .pcard:active, html.k-ios .irow:active { opacity: .6; }
/* gray capsules for the filter rows; segmented control for .seg */
html.k-ios .sysnav a, html.k-ios .jump a { min-height: 34px; border-radius: 999px; border: 0; background: var(--ios-fill3); color: var(--ios-label); font: 500 15px/34px var(--ios-font); box-shadow: none; }
html.k-ios .sysnav a[aria-current], html.k-ios .sysnav a[aria-selected="true"] { background: var(--ios-tint-fill); color: var(--ios-on-tint); }
html.k-ios .seg { background: var(--ios-fill3); border-radius: 999px; padding: 2px; gap: 0; }
html.k-ios .seg button { min-height: 32px; border: 0; border-radius: 999px; background: transparent; box-shadow: none; font: 500 13px/1.2 var(--ios-font); color: var(--ios-label); }
html.k-ios .seg button[aria-selected="true"] { background: #636366; color: var(--ios-label); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
/* inset grouped cards */
html.k-ios .pcard, html.k-ios .game, html.k-ios .irow, html.k-ios .note, html.k-ios .demo-stage, html.k-ios .lesson, html.k-ios .prevnext a, html.k-ios .ill-chip, html.k-ios .opt { border-radius: var(--ios-radius-card, 26px); border-color: transparent; background: var(--ios-grouped2); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
html.k-ios .irow, html.k-ios .opt { border-radius: 12px; }
html.k-ios .block { background: transparent; border-top-color: var(--ios-sep); }
html.k-ios .systile { border-radius: 22px; }
html.k-ios .systile[aria-selected="true"], html.k-ios .game.lead { border-color: var(--ios-tint); box-shadow: inset 0 0 0 1px var(--ios-tint); }
html.k-ios .k-btn-primary { box-shadow: none; }

/* ================= Declutter pass: grids of four, tabs, step player, surprising facts ================= */
.pgrid, .pgrid.small, .sysrail { display: grid; grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; overflow: visible; margin: 0; padding: 0; scroll-snap-type: none; }
.sysrail .systile { aspect-ratio: 4 / 3; }
@media (max-width: 720px) { .pgrid, .pgrid.small, .sysrail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.home { gap: 56px; }
.row-head { margin-bottom: 18px; }

/* part page */
.part { gap: 28px; }
.part-hero .hero-text { gap: 10px; }
.part-hero .term { margin-top: -4px; }
.wow { display: grid; gap: 8px; width: 100%; padding: 20px 22px; border-radius: 20px; cursor: pointer; text-align: left; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--sys, var(--primary)) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--sys, var(--primary)) 22%, transparent), rgba(255,255,255,.02)); }
.wow-k { display: inline-flex; align-items: center; gap: 8px; font: 700 12px/16px var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--primary-text); }
.wow-k .k-icon { width: 18px; height: 18px; }
.wow-t { font: 700 22px/30px var(--font-display); letter-spacing: -.01em; }
@media (min-width: 860px) { .wow-t { font-size: 26px; line-height: 34px; } }
.tabs { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 5; display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(10,13,19,.85); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 700 15px/20px var(--font-sans); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--primary-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(62,198,255,.45); }
.tabpanel { display: grid; gap: 18px; min-height: 240px; animation: rise .2s ease-out; }
.tabpanel > .eyebrow { margin-top: 8px; }
.ov { display: grid; gap: 24px; }
.ov .prose { margin-bottom: 14px; }
.ov-side { display: grid; gap: 12px; align-content: start; }
.ov-where { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ov-where p:last-child { margin-top: 4px; color: var(--ink-2); }
@media (min-width: 860px) { .ov { grid-template-columns: 1.6fr 1fr; } }
.player { display: grid; gap: 18px; }
.player .demo-stage { padding: 12px; }
.player-side { display: grid; gap: 14px; align-content: center; }
.step-now { font: 700 22px/32px var(--font-display); min-height: 96px; }
.step-dots { display: flex; gap: 8px; }
.step-dots button { width: 36px; height: 6px; border: 0; border-radius: 3px; background: rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.step-dots button.on { background: var(--sys, var(--primary)); box-shadow: 0 0 10px var(--sys, var(--primary)); }
.player-ctl { display: flex; gap: 8px; align-items: center; }
.player-ctl .k-iconbtn { width: 48px; height: 48px; border: 1px solid var(--line-strong); color: #fff; }
.player-ctl .play { background: var(--primary); color: var(--on-primary); border-color: transparent; }
@media (min-width: 860px) { .player { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.factlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .factlist { grid-template-columns: 1fr; } }
.factlist button { display: grid; gap: 10px; width: 100%; height: 100%; padding: 18px; text-align: left; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 17px/26px var(--font-sans); }
.factlist li:first-child button { border-color: color-mix(in srgb, var(--sys, var(--primary)) 50%, transparent); background: color-mix(in srgb, var(--sys, var(--primary)) 14%, transparent); font-weight: 700; }
.fn { font: 700 13px/16px var(--font-mono); color: var(--sys, var(--primary-text)); }
.part .prevnext { padding-top: 20px; }

/* home: surprising facts */
.wowgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .wowgrid { grid-template-columns: 1fr; } }
.wowcard { display: grid; grid-template-rows: auto 1fr; border-radius: 18px; overflow: hidden; text-decoration: none; background: var(--surface); border: 1px solid var(--line); transition: box-shadow .2s; }
.wowcard:hover { box-shadow: var(--glow); border-color: transparent; }
.wowcard-art { display: block; aspect-ratio: 16 / 9; background: #0b0e14; overflow: hidden; }
.wowcard-art img { width: 100%; height: 100%; object-fit: cover; }
.wowcard-body { display: grid; gap: 6px; padding: 14px 16px 18px; }
.wowcard-body small { font: 700 11px/14px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sys); filter: brightness(1.5); }
.wowcard-body span { font: 700 17px/24px var(--font-sans); color: #fff; }
@media (max-width: 720px) { .wowcard { grid-template-columns: 112px 1fr; grid-template-rows: none; } .wowcard-art { aspect-ratio: auto; height: 100%; } }
@media (max-width: 480px) { .tabs { gap: 2px; } .tabs button { flex: 1 1 0; padding: 0 6px; font-size: 14px; } }

/* ================= Two levels: Explore and the Lab (shared with lab/) ================= */
/* Level switch in the top bar: Explore (this page) | Lab (lab/) */
.level { display: flex; gap: 2px; padding: 3px; margin-left: var(--space-2); border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.level a { padding: 5px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font: 700 13px/18px var(--font-sans); }
.level a:hover { color: var(--ink); }
.level a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
body.deep .level { display: none; }
#searchBtn { margin-left: auto; color: var(--ink-2); }
.topbar #mute { margin-left: 0; }
#settingsBtn { color: var(--ink-2); }
@media (max-width: 420px) { .brand-name { display: none; } .level a { padding: 5px 12px; } }

/* "See it in the Lab" next to "View in your room" */
.lab-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px; border-radius: 999px; text-decoration: none;
  border: 1.5px solid rgba(62,198,255,.45); background: rgba(62,198,255,.08); color: var(--ink); font: 700 16px/20px var(--font-sans); }
.lab-btn .k-icon { width: 22px; height: 22px; color: var(--primary-text); }
.lab-btn:hover { box-shadow: var(--glow); }
.lab-btn:active { transform: scale(.97); }

/* Home: who is learning (asked once), the Lab, progress */
.chooser { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: 24px; border: 1px solid rgba(62,198,255,.3); background: linear-gradient(160deg, rgba(62,198,255,.08), rgba(255,255,255,.02)); }
.chooser .muted { margin-top: 4px; }
.chooser-opts { display: grid; gap: 12px; }
@media (min-width: 760px) { .chooser { grid-template-columns: 1fr 2fr; align-items: center; } .chooser-opts { grid-template-columns: 1fr 1fr; } }
.chooser-opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; min-height: 88px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); color: var(--ink); font: inherit; }
.chooser-opt:hover, .chooser-opt:focus-visible { border-color: var(--primary); box-shadow: var(--glow); }
.chooser-opt > .k-icon { width: 28px; height: 28px; flex: none; color: var(--primary-text); }
.chooser-opt b { display: block; font: 900 18px/24px var(--font-display); }
.chooser-opt small { display: block; margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink-2); }

.labpromo { display: grid; gap: var(--space-6); padding: var(--space-6); border-radius: 28px; border: 1px solid var(--line);
  background: radial-gradient(700px 300px at 85% 0%, rgba(62,198,255,.12), transparent 70%), rgba(255,255,255,.025); }
.labpromo-head { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: flex-end; justify-content: space-between; }
.labpromo-head .muted { margin-top: 4px; max-width: 56ch; }
.labpromo-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.labpromo-actions .k-btn { text-decoration: none; }
.labfeats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.labfeats li { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.labfeats .k-icon { width: 24px; height: 24px; color: var(--primary-text); margin-bottom: 4px; }
.labfeats b { font: 700 16px/22px var(--font-sans); }
.labfeats span { color: var(--ink-2); font-size: 14px; line-height: 20px; }

.stats-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stats-row .k-stat { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); display: grid; gap: 2px; }
.stats-row .k-stat-value { font: 900 28px/34px var(--font-display); font-variant-numeric: tabular-nums; }
.stats-row .k-stat-value small { font-size: 16px; color: var(--ink-muted); font-weight: 700; }
.stats-row .k-stat-label { color: var(--ink-2); font-size: 13px; }

/* Search across both levels */
.searchbox { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; margin-bottom: var(--space-6); border-radius: 16px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); }
.searchbox:focus-within { border-color: var(--primary); box-shadow: var(--glow); }
.searchbox .k-icon { width: 22px; height: 22px; color: var(--ink-muted); }
.searchbox input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; color: var(--ink); font: 400 18px/24px var(--font-sans); outline: none; }
.res-h { margin: var(--space-6) 0 var(--space-3); }
.labhits a { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 8px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.labhits li:last-child a { border-bottom: 0; }
.labhits a > .k-icon:first-child { color: var(--primary-text); flex: none; }
.labhits a > .k-icon:last-child { width: 16px; height: 16px; color: var(--ink-muted); flex: none; }
.labhits span { flex: 1; min-width: 0; }
.labhits b { display: block; font-weight: 700; }
.labhits small { display: block; color: var(--ink-2); font-size: 13px; line-height: 18px; }

/* Settings */
.settings { max-width: 760px; }
.setgroup { padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.setgroup:first-of-type { border-top: 0; padding-top: 0; }
.setgroup .muted { margin: 4px 0 var(--space-4); }
.setlabel { margin: var(--space-3) 0 var(--space-2); font: 700 14px/20px var(--font-sans); color: var(--ink-2); }
.setrow { padding: 10px 0; }
.setrow b { display: block; font-weight: 700; }
.setrow small { display: block; color: var(--ink-2); font-size: 14px; line-height: 20px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-4); }

/* Five tabs on phones (Body, Parts, Health, Quiz, Lab) */
.tabbar a { min-width: 0; }

/* Native looks for the new pieces */
html.k-android .lab-btn { min-height: 40px; border-radius: var(--md-sys-shape-corner-full); border: 1px solid var(--md-sys-color-outline); background: transparent; color: var(--md-sys-color-primary); font: var(--md-sys-typescale-label-large); box-shadow: none; }
html.k-android .lab-btn .k-icon { color: currentColor; }
html.k-android :is(.chooser, .labpromo, .labfeats li, .chooser-opt, .stats-row .k-stat, .searchbox) { border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface-container-low); border-color: transparent; box-shadow: none; }
html.k-android .chooser-opt > .k-icon, html.k-android .labfeats .k-icon { color: var(--md-sys-color-primary); }
html.k-ios .lab-btn { min-height: 44px; border: 0; background: color-mix(in srgb, var(--ios-tint) 16%, transparent); color: var(--ios-tint); font: 600 17px/22px var(--ios-font); }
html.k-ios .lab-btn .k-icon { color: currentColor; }
html.k-ios :is(.chooser, .labpromo, .chooser-opt, .labfeats li, .stats-row .k-stat, .searchbox) { border-radius: var(--ios-radius-card, 26px); background: var(--ios-grouped2); border-color: transparent; box-shadow: none; }
html.k-ios .labfeats li, html.k-ios .stats-row .k-stat, html.k-ios .searchbox { border-radius: 14px; }
html.k-ios :is(.chooser-opt > .k-icon, .labfeats .k-icon) { color: var(--ios-tint); }
html.k-ios .settings .page-head, html.k-ios .search .page-head { display: none; }
html.k-android .settings .page-head h1, html.k-android .search .page-head h1 { display: none; }
