:root{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#171717;
  background:#f7f7f5;
  font-synthesis:none;
  --surface:#ffffff;
  --surface-soft:#f0f0ed;
  --border:#deded8;
  --text:#171717;
  --muted:#6b6b65;
  --accent:#171717;
  --radius:18px;
  --rail:220px;
  --content:1040px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{background:#f7f7f5}
body{margin:0;min-height:100vh;background:#f7f7f5;color:var(--text)}
button,input,a{font:inherit}
a{color:inherit}
button,.button{
  min-height:44px;border:1px solid var(--border);border-radius:12px;background:var(--surface);
  color:var(--text);padding:11px 14px;font-weight:700;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer
}
button.primary,.button.primary{background:var(--accent);color:white;border-color:var(--accent)}
button.ghost,.button.ghost{background:transparent}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #6b6b65;outline-offset:2px}
.app-nav{position:fixed;inset:0 auto 0 0;width:var(--rail);padding:24px 16px;background:var(--surface);border-right:1px solid var(--border);z-index:20}
.brand{display:flex;flex-direction:column;gap:3px;padding:6px 10px 22px}
.brand strong{font-size:1.05rem}.brand span{font-size:.78rem;color:var(--muted)}
.nav-links{display:grid;gap:5px}
.nav-link{min-height:46px;border-radius:11px;padding:0 12px;display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--muted);font-weight:650}
.nav-link[aria-current="page"]{background:var(--surface-soft);color:var(--text)}
.nav-dot{width:8px;height:8px;border-radius:50%;border:1.5px solid currentColor}
.nav-link[aria-current="page"] .nav-dot{background:currentColor}
.app-main{margin-left:var(--rail);min-height:100vh}
.page{width:min(var(--content),calc(100% - 48px));margin:0 auto;padding:40px 0 64px}
.page-header{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:28px}
.eyebrow{margin:0 0 7px;color:var(--muted);font-size:.82rem;font-weight:750;text-transform:uppercase;letter-spacing:.06em}
h1{font-size:clamp(2rem,3vw,3rem);line-height:1.05;letter-spacing:-.035em;margin:0}
h2{font-size:1.15rem;margin:0 0 8px}
p{line-height:1.55}
.muted{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:22px}
.card.large{padding:28px}
.metric{font-size:2.4rem;line-height:1;font-weight:800;letter-spacing:-.04em;margin:12px 0 6px}
.card-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
.stack{display:grid;gap:16px}
.kicker{font-size:.82rem;color:var(--muted);font-weight:700}
.route-placeholder{min-height:360px;display:grid;place-items:center;text-align:center}
.route-placeholder>div{max-width:520px}
.prototype-link{font-size:.85rem;color:var(--muted);text-decoration:underline;text-underline-offset:3px}
.mobile-topbar{display:none}
.mobile-nav{display:none}
.status-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);border-radius:999px;padding:6px 10px;font-size:.8rem;font-weight:700;color:var(--muted);background:var(--surface)}
.status-dot{width:7px;height:7px;border-radius:50%;background:currentColor}
.hero-copy{max-width:700px}
.hero-copy p{font-size:1.05rem;color:var(--muted);margin:12px 0 0}
.quick-row{display:grid;grid-template-columns:1.4fr 1fr;gap:16px}
.quick-row .card:first-child{min-height:250px}
@media(max-width:900px){
  :root{--rail:190px}
  .page{width:min(100% - 32px,820px);padding-top:28px}
  .grid,.quick-row{grid-template-columns:1fr}
}
@media(max-width:700px){
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
  .app-nav{display:none}
  .app-main{margin-left:0}
  .mobile-topbar{display:flex;position:sticky;top:0;z-index:15;align-items:center;justify-content:space-between;padding:calc(12px + env(safe-area-inset-top)) 16px 12px;background:color-mix(in srgb,var(--surface) 94%,transparent);border-bottom:1px solid var(--border);backdrop-filter:blur(14px)}
  .mobile-topbar strong{font-size:.98rem}
  .page{width:100%;padding:24px 16px 28px}
  .page-header{display:block;margin-bottom:20px}
  h1{font-size:2rem}
  .hero-copy p{font-size:1rem}
  .card,.card.large{padding:18px;border-radius:16px}
  .metric{font-size:2.15rem}
  .mobile-nav{display:grid;position:fixed;z-index:30;left:0;right:0;bottom:0;grid-template-columns:repeat(4,1fr);background:color-mix(in srgb,var(--surface) 96%,transparent);border-top:1px solid var(--border);padding:7px 8px calc(7px + env(safe-area-inset-bottom));backdrop-filter:blur(18px)}
  .mobile-nav a{min-height:52px;border-radius:11px;display:grid;place-items:center;text-decoration:none;color:var(--muted);font-size:.72rem;font-weight:700;gap:2px}
  .mobile-nav a[aria-current="page"]{color:var(--text);background:var(--surface-soft)}
  .mobile-nav .nav-dot{width:7px;height:7px}
  .card-actions{display:grid;grid-template-columns:1fr}
  .card-actions .button,.card-actions button{width:100%}
  .route-placeholder{min-height:55vh}
}
@media(max-width:430px){
  .page{padding-left:14px;padding-right:14px}
  .card,.card.large{padding:17px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.review-page{max-width:760px}
.review-card{padding:34px;display:grid;gap:24px;text-align:center}
.review-copy{display:grid;gap:8px;justify-items:center;padding:8px 0}
.review-phrase{font-size:clamp(3rem,8vw,5.4rem);font-weight:800;letter-spacing:-.035em;line-height:1.05}
.review-jyutping{font-size:1.3rem;font-weight:700;color:var(--muted)}
.review-meaning{font-size:1.05rem;max-width:560px;line-height:1.5}
.review-play{justify-self:center;min-width:180px}
.review-question{margin:2px 0 -6px;font-weight:700}
.review-actions{display:grid;gap:10px;max-width:420px;width:100%;justify-self:center}
.review-skip{justify-self:center;border-color:transparent}
.review-notice{margin:0 auto;padding:12px 14px;max-width:520px;border-radius:12px;background:var(--surface-soft);color:var(--muted)}
.review-summary{margin-top:16px;text-align:center}
.review-summary .card-actions{justify-content:center}
@media(max-width:700px){
  .review-card{padding:24px 18px;gap:20px}
  .review-phrase{font-size:3.4rem}
  .review-jyutping{font-size:1.15rem}
  .review-actions{max-width:none}
  .review-actions button,.review-play{width:100%}
  .review-summary{text-align:left}
}

.correction-card{padding:30px;display:grid;gap:20px}
.correction-audio{width:100%}
.boundary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.boundary-card{display:grid;gap:10px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft);text-align:left}
.boundary-card strong{font-size:1.35rem}
@media(max-width:700px){.correction-card{padding:22px 18px}.boundary-grid{grid-template-columns:1fr}.boundary-card button{width:100%}}
