/* Seep on the web and desktop: the phone's look, measured from its code (Ui.kt, TodayPage.kt, WordsPage.kt,
   MePage.kt). Colours are set from themes.json by app.js; these are the plain day values until then.
   Headings: Noto Serif bold (the phone's serif). Text: Roboto (the phone's sans). */
:root {
  --bg: #F5F0E6; --card: #FFFFFF; --quiet: #FFFFFF; --line: #D9D2C3; --text: #1C1B18; --soft: #5C5850;
  --accent: #B8371F; --primary: #1C1B18; --on-primary: #FFFFFF; --right: #3F6B58; --on-right: #FFFFFF;
  --good: #2E5E4A; --bad: #B8371F; --warn: #8A5A0B; --tea: #3F6B58; --tea-soft: #DCE8E1; --tea-line: #B8371F; --on-tea: #FFFFFF;
  --card-edge: transparent; --divider: #F1EDE5; --track: #ECE8E0; --seg: #ECE8E0; --steep: #E3EDE7; --rest-chip: #F3EEE4;
  --shadow: 0 2px 6px rgba(107, 90, 58, .12); --tab-pill: rgba(63, 107, 88, .14);
  --heading: "Noto Serif", "Songti SC", Georgia, serif;
  --body: "Roboto", -apple-system, "Segoe UI", "PingFang SC", "PingFang HK", "Microsoft YaHei UI", sans-serif;
  --cjk: "Noto Serif SC", "Songti SC", "Noto Serif", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--body); -webkit-font-smoothing: antialiased; }
#scene { position: fixed; inset: 0 0 auto 0; height: 300px; width: 100%; z-index: 0; pointer-events: none; }
#scene.faint { height: 230px; } /* The phone's faint backdrop behind Bank, Friends and Me. */
main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 16px max(20px, env(safe-area-inset-left, 0px)) 120px max(20px, env(safe-area-inset-right, 0px)); }
.title { font: 700 30px/1.2 var(--heading); letter-spacing: -.01em; margin: 0; }
.label { font: 500 12px var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--soft); padding: 18px 2px 8px; }
.label.accent { color: var(--accent); }
.soft { color: var(--soft); }
.card { background: var(--card); border: 1px solid var(--card-edge); border-radius: 22px; padding: 14px 16px; box-shadow: var(--shadow); }
.gap8 { margin-top: 8px; } .gap10 { margin-top: 10px; } .gap12 { margin-top: 12px; } .gap14 { margin-top: 14px; } .gap18 { margin-top: 18px; }
.group { background: var(--card); border: 1px solid var(--card-edge); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.row { display: flex; align-items: center; min-height: 52px; padding: 8px 12px 8px 16px; gap: 8px; color: inherit; text-decoration: none; }
.group > .row + .row { border-top: 1px solid var(--divider); }
.row .texts { flex: 1; min-width: 0; }
.row .texts > div:first-child { font-size: 16px; }
.row .detail { font-size: 13px; color: var(--soft); }
.row .value { font-size: 15px; color: var(--soft); padding: 0 4px 0 8px; text-align: right; }
.row .chev { font-size: 20px; color: var(--soft); }
.row[role="button"] { cursor: pointer; }
.row[role="button"]:hover { background: color-mix(in srgb, var(--line) 30%, transparent); }
.pill-button { font: 500 14px var(--body); background: var(--primary); color: var(--on-primary); border: 0; border-radius: 20px; height: 40px; padding: 0 18px; cursor: pointer; }
.big-button { font: 500 16px var(--body); background: var(--primary); color: var(--on-primary); border: 0; border-radius: 28px; height: 56px; width: 100%; cursor: pointer; }
.flag { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.25); font-size: 24px; line-height: 1; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--track); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: left .15s; }
.switch:checked { background: var(--right); }
.switch:checked::after { left: 19px; background: var(--on-right); }
input.search { font: 15px var(--body); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 22px; min-height: 46px; padding: 0 16px; width: 100%; }
button:focus-visible, input:focus-visible, select:focus-visible, .row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Today. */
.top { position: relative; height: 236px; padding-top: 14px; }
.chip { display: inline-block; font: 500 12px var(--body); letter-spacing: .04em; padding: 4px 10px; border-radius: 14px; }
.greet { font: 700 38px/1.15 var(--heading); padding-top: 10px; }
.greet.long { font-size: 30px; }
.say { font: 500 15px var(--body); opacity: .9; }
.top .flag { position: absolute; right: 0; top: 14px; }
.streak-top { display: flex; align-items: center; }
.streak-top .flame { width: 52px; height: 64px; flex: none; }
.streak-top .days { flex: 1; font: 700 22px var(--heading); padding-left: 8px; }
.rest { font: 500 12px var(--body); color: var(--soft); background: var(--rest-chip); border-radius: 12px; padding: 4px 10px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 12px; height: 52px; }
.week div { display: grid; justify-items: center; align-content: start; gap: 6px; font: 500 12px var(--body); color: var(--soft); }
.week svg { width: 26px; height: 26px; }
.goal { display: flex; margin-top: 10px; font-size: 14px; }
.goal b { flex: 1; font-weight: 500; }
.track { height: 8px; border-radius: 4px; background: var(--track); margin-top: 8px; overflow: hidden; }
.track span { display: block; height: 100%; border-radius: 4px; background: var(--right); }
.practise { display: flex; align-items: center; min-height: 80px; padding: 16px 16px 16px 22px; border-radius: 24px; border: 0; width: 100%; text-align: left;
  color: var(--on-primary); background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 84%, var(--mix-to))); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 35%, transparent); cursor: pointer; }
.practise .t { flex: 1; }
.practise .t b { display: block; font: 700 19px var(--heading); }
.practise .t span { font-size: 13px; opacity: .88; }
.practise .arrow { width: 44px; height: 44px; border-radius: 22px; background: var(--on-primary); color: var(--primary); display: grid; place-items: center; font-size: 22px; }
.newword { display: flex; align-items: center; padding: 10px 14px; }
.newword .en { flex: 1; font-size: 15px; padding: 0 8px 0 14px; }
.steeped { position: relative; overflow: hidden; border-radius: 22px; background: var(--steep); min-height: 88px; display: flex; align-items: center; padding: 14px 18px; box-shadow: var(--shadow); }
.steeped .fill { position: absolute; inset: 0 auto 0 0; background: var(--tea); }
.steeped .pct { position: relative; font: 700 38px var(--heading); }
.steeped .what { position: relative; font-size: 14px; padding-left: 12px; }

/* Words with their tones written under them, in tone colours (the phone's syllable row). */
.syl { display: inline-flex; }
.syl span { display: inline-flex; flex-direction: column; align-items: center; }
.syl b { font-family: var(--cjk); font-weight: 700; line-height: 1.1; }
.syl small { font: 500 12px var(--body); padding-top: 1px; }

/* Bank. */
.bank-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.modes { display: flex; align-items: center; gap: 22px; margin-top: 4px; min-height: 40px; }
.modes button { background: none; border: 0; padding: 0; font: 500 17px var(--body); color: var(--soft); cursor: pointer; }
.modes button[aria-pressed="true"] { color: var(--text); text-decoration: underline; text-underline-offset: 5px; }
.modes .count { margin-left: auto; font-size: 14px; color: var(--soft); }
.seg { display: flex; background: var(--seg); border-radius: 22px; padding: 4px; margin-top: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 19px; background: none; color: var(--soft); font: 14px var(--body); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--quiet); color: var(--text); font-weight: 500; }
.word { display: flex; align-items: center; padding: 10px 14px; }
.word .syl-box { width: 92px; flex: none; }
.word .en { flex: 1; font-size: 15px; }
.word .stage { text-align: right; font: 500 12px var(--body); }
.word .dots { font-size: 15px; letter-spacing: .05em; padding-top: 2px; color: var(--right); }
.empty { padding: 16px 2px; color: var(--soft); font-size: 15px; }

/* Practise. */
.tone-shape { width: 54px; height: 40px; flex: none; }
.badge { font: 500 12px var(--body); text-align: right; white-space: pre-line; }
.pairs { display: grid; gap: 4px; }
.pairs .cell, .sounds .cell { display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font: 500 14px var(--body); color: var(--text); min-height: 44px; text-align: center; }
.sounds { display: flex; flex-wrap: wrap; gap: 6px; }
.sounds .cell { width: 62px; height: 58px; white-space: pre-line; line-height: 1.25; }

/* Me. */
.me-head { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--right); color: var(--on-right); display: grid; place-items: center; font: 700 24px var(--heading); flex: none; }
.me-head .who { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.tiles .card { padding: 12px 14px; }
.tiles b { display: block; font: 700 24px var(--heading); }
.tiles span { font-size: 13px; color: var(--soft); }
.pro { background: var(--primary); color: var(--on-primary); border-radius: 22px; padding: 14px 16px; margin-top: 14px; box-shadow: var(--shadow); }
.pro b { font: 500 16px var(--body); }
.pro div { font-size: 14px; opacity: .92; }

/* Friends. */
.together { background: var(--tea); color: var(--on-tea); border-radius: 22px; padding: 14px 16px; box-shadow: var(--shadow); }
.together .n { font: 700 34px var(--heading); }
.together .track { background: color-mix(in srgb, var(--on-tea) 25%, transparent); }
.together .track span { background: var(--accent); }
.board .row { gap: 12px; }
.board .you { border: 2px solid var(--accent); border-radius: 20px; }
.avatar.sm { width: 40px; height: 40px; font-size: 18px; }

/* Welcome. */
.error { color: var(--bad); font-size: 14px; }

/* The floating tab bar (Ui.TabBar). */
nav#tabs { position: fixed; inset: auto 0 0 0; z-index: 5; display: flex; justify-content: center; padding: 6px max(14px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-right, 0px)); pointer-events: none; }
nav#tabs[hidden] { display: none; }
nav#tabs .bar { pointer-events: auto; display: flex; width: 100%; max-width: 520px; padding: 6px; border-radius: 30px; background: var(--card); border: 1px solid var(--card-edge); box-shadow: 0 10px 24px rgba(0,0,0,.28); }
nav#tabs button { flex: 1; min-height: 52px; border: 0; background: none; color: var(--soft); font: 12px var(--body); display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 26px; cursor: pointer; }
nav#tabs button[aria-current="page"] { background: var(--tab-pill); color: var(--accent); }
nav#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) { main > * { animation: rise .35s ease backwards; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Welcome and signing in (OnboardingActivity, SignInActivity) ---------- */
.setup { position: relative; padding-top: 8px; min-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.setup-body { flex: 1; }
.setup-actions { display: grid; gap: 4px; padding-top: 24px; }
.setup .back { position: absolute; left: -10px; top: 0; width: 44px; height: 44px; border: 0; background: none; color: var(--text); font-size: 20px; cursor: pointer; border-radius: 22px; }
.setup .steps { display: flex; gap: 6px; margin: 16px 0 0 40px; }
.setup .steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.setup .steps span.on { background: var(--right); }
.setup-title { font: 700 30px/1.2 var(--heading); margin: 0; padding: 22px 0 8px; }
.signin .setup-title { font-size: 32px; padding-top: 52px; }
.setup-text { font-size: 16px; color: var(--soft); margin: 0; }
.center { text-align: center; }
.hello { display: flex; flex-direction: column; align-items: center; padding-top: 48px; }
.hello .logo { margin: 40px 0 36px; }
.hello .setup-title { font-size: 32px; padding: 8px 0 10px; }
.hello .setup-text { font-size: 17px; }
.quiet { font: 15px var(--body); color: var(--soft); background: none; border: 0; min-height: 44px; border-radius: 22px; cursor: pointer; }
.big-button:disabled { opacity: .6; }
.option, .lang-card, .chips button, .known button { font: inherit; color: var(--text); text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line); transition: transform .12s; }
.option:active, .lang-card:active, .chips button:active, .known button:active { transform: scale(.98); }
.option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border-radius: 16px; }
.option .texts { flex: 1; display: grid; gap: 2px; }
.option b { font-size: 16px; font-weight: 500; }
.option .texts span { font-size: 13px; color: var(--soft); }
.option .trail { font: 700 20px var(--heading); color: var(--soft); }
.option.on, .chips button.on, .known button.on { background: var(--steep); border: 2px solid var(--right); }
.lang-card { display: block; width: 100%; padding: 0; margin-top: 14px; border-radius: 18px; overflow: hidden; }
.lang-card.on { border: 2px solid var(--right); }
.lang-card .preview { display: block; width: 100%; height: 118px; }
.lang-card .texts { display: grid; gap: 2px; padding: 12px 16px 14px; }
.lang-card b { font-size: 18px; font-weight: 500; }
.lang-card .texts span { font-size: 13px; color: var(--soft); }
.demo { display: grid; justify-items: start; gap: 8px; }
.bubble { font: 19px var(--body); color: var(--text); background: var(--divider); border: 0; border-radius: 16px; padding: 10px 14px; cursor: pointer; text-align: left; }
.bubble mark { background: var(--right); color: var(--on-right); border-radius: 4px; }
.meaning { padding-top: 6px; }
.meaning div { font: 700 26px var(--heading); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips button { min-height: 56px; border-radius: 14px; text-align: center; font-size: 16px; font-weight: 500; }
.known { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.known button { min-height: 84px; border-radius: 14px; display: grid; justify-items: center; align-content: center; gap: 1px; padding: 8px 4px; }
.known b { font: 700 22px var(--cjk); }
.known i { font-style: normal; font-size: 12px; font-weight: 500; }
.known span { font-size: 12px; color: var(--soft); }
.good-note { color: var(--good); font-size: 14px; font-weight: 500; margin: 0; padding-top: 10px; }
.promise { display: flex; gap: 0; padding-top: 10px; font-size: 15px; }
.promise span:first-child { width: 24px; flex: none; color: var(--good); font-weight: 500; font-size: 16px; }
.fields { display: grid; gap: 10px; margin-top: 18px; }
.fields input { font: 16px var(--body); color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-height: 52px; padding: 0 16px; width: 100%; }
.fields input:focus { outline: 2px solid var(--right); outline-offset: 1px; }
.error { color: var(--bad); font-size: 14px; margin: 0; min-height: 0; }
.error:empty { display: none; }
.outline-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 54px; border-radius: 27px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 16px var(--body); cursor: pointer; }
.outline-button .g { font: 700 18px var(--body); width: 20px; }
.gap22 { margin-top: 22px; }
@media (prefers-reduced-motion: no-preference) {
  .setup-body[data-dir="1"], .setup-body[data-dir="1"] + .setup-actions { animation: from-right .3s cubic-bezier(.05,.7,.1,1) both; }
  .setup-body[data-dir="-1"], .setup-body[data-dir="-1"] + .setup-actions { animation: from-left .3s cubic-bezier(.05,.7,.1,1) both; }
}
@keyframes from-right { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes from-left { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.google-slot { display: flex; justify-content: center; min-height: 44px; }

/* ---------- Transitions (Intro.kt): loading with the plain logo, and the language's opening ---------- */
.seep-busy { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--bg); opacity: 0; transition: opacity .18s; }
.seep-busy.on { opacity: 1; }
.seep-busy p { margin: 0; color: var(--soft); font-size: 15px; }
@media (prefers-reduced-motion: no-preference) { .seep-busy .logo { animation: steep 1.2s ease-in-out infinite; } }
@keyframes steep { 50% { transform: scale(1.04); opacity: .85; } }
.seep-opening { position: fixed; inset: 0; z-index: 60; background: var(--bg); cursor: pointer; transition: opacity .45s; }
.seep-opening canvas { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: circle(0% at 50% 45%); transition: clip-path 1.1s cubic-bezier(.65,0,.35,1) .35s; }
.seep-opening.open canvas { clip-path: circle(150% at 50% 45%); }
.seep-opening .mark { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; transition: transform 1.4s cubic-bezier(.65,0,.35,1) .35s, opacity .6s 1.3s; }
.seep-opening .mark p { margin: 0; font: 600 16px var(--body); color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.5); opacity: 0; transition: opacity .4s .9s; }
.seep-opening.open .mark { transform: translateY(-22vh) scale(.8); opacity: 0; }
.seep-opening.open .mark p { opacity: 1; }
.seep-opening.leave { opacity: 0; }

/* ---------- Practice (QuizActivity): full screen, the word, the choices, the pitch card, the microphone ---------- */
.lesson { position: fixed; inset: 0; z-index: 40; background: var(--bg); color: var(--text); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
@media (min-width: 561px) { .lesson { box-shadow: 0 0 0 100vmax var(--bg); } }
.lesson-top { display: flex; align-items: center; gap: 6px; padding: 8px 20px 4px 8px; }
.lesson-top .x { width: 48px; height: 48px; border: 0; background: none; color: var(--text); font-size: 20px; border-radius: 24px; cursor: pointer; }
.lesson-top .track { flex: 1; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.lesson-top .track span { display: block; height: 100%; background: var(--right); border-radius: 4px; transition: width .3s; }
.lesson-top .count { width: 40px; text-align: right; color: var(--soft); font-size: 14px; }
.lesson-mid { flex: 1; overflow-y: auto; padding: 12px 20px; }
.lesson-card { padding: 18px 20px; text-align: center; }
.lesson-label { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.lesson-label .label { padding: 0; }
.lesson-label .hear { height: 40px; background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: 14px; }
.lesson-headline { font: 700 26px var(--heading); padding-top: 14px; }
.lesson-word { display: flex; justify-content: center; gap: 22px; padding-top: 14px; }
.lesson-word span { display: grid; justify-items: center; }
.lesson-word b { font: 700 64px/1.1 var(--cjk); }
.lesson-word small { font-size: 20px; font-weight: 500; }
.lesson-meaning { font-size: 17px; padding-top: 10px; }
.lesson-status { font-size: 16px; color: var(--soft); padding: 16px 2px 10px; margin: 0; }
.lesson-status.good, .result.good { color: var(--good); }
.lesson-status.bad, .result.bad { color: var(--bad); }
.lesson-status.warn, .result.warn { color: var(--warn); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 15px var(--body); cursor: pointer; padding: 6px 10px; }
.choice.right { background: var(--right); color: var(--on-right); border-color: var(--right); }
.choice.wrong { border: 2px solid var(--bad); }
.pitch { margin-top: 4px; padding: 14px 16px; }
.pitch .legend { display: flex; justify-content: space-between; font-size: 13px; color: var(--soft); }
.pitch canvas { display: block; width: 100%; height: 140px; margin-top: 8px; }
.pitch .heard { font-size: 17px; margin: 10px 0 0; }
.pitch .result { font-size: 15px; margin: 8px 0 0; }
.quiet.underline { text-decoration: underline; width: 100%; }
.lesson-bottom { display: grid; justify-items: center; gap: 4px; padding: 8px 20px 16px; }
.lesson-bottom .big-button { width: 100%; }
.mic { width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.mic svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mic.on { background: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .mic.on { animation: pulse 1s ease-in-out infinite; } .pitch.shake { animation: shake .35s; } .pitch.pop { animation: pop .3s; } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { 50% { transform: scale(1.03); } }
.mic:disabled { opacity: .5; cursor: default; }
.meter { width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); }
.mic-label { font: 500 15px var(--body); text-align: center; padding-top: 4px; }
.lesson.complete { background: var(--tea); color: var(--on-tea); }
@media (min-width: 561px) { .lesson.complete { box-shadow: 0 0 0 100vmax var(--tea); } }
.done-title { font: 700 36px var(--heading); text-align: center; margin: 28px 0 0; }
.done-sub { text-align: center; color: var(--tea-soft); font-size: 16px; margin: 8px 0 0; }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.done-stats div { background: color-mix(in srgb, var(--on-tea) 12%, transparent); border-radius: 16px; padding: 12px; display: grid; }
.done-stats b { font: 700 26px var(--heading); }
.done-stats span { font-size: 13px; color: var(--tea-soft); }
.done-list { margin-top: 16px; color: var(--text); }
.done-list p { margin: 8px 0 0; font-size: 16px; }
.done-list .hard { font-weight: 500; margin-top: 14px; }
.lesson.complete .big-button { background: var(--on-tea); color: var(--tea); }
.lesson.complete .quiet { color: var(--on-tea); }

/* ---------- Desktop: a wide window gets a sidebar instead of the floating tab bar, and room to breathe ---------- */
nav#tabs .brand { display: none; }
@media (min-width: 900px) {
  nav#tabs { inset: 0 auto 0 0; width: 232px; padding: 16px 0 16px 16px; display: block; }
  nav#tabs .bar { flex-direction: column; height: 100%; max-width: none; gap: 4px; padding: 14px 10px; border-radius: 26px; box-shadow: var(--shadow); }
  nav#tabs .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font: 700 22px var(--heading); color: var(--text); }
  nav#tabs button { flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 14px; min-height: 48px; padding: 0 16px; font-size: 15px; border-radius: 24px; }
  #scene { left: 248px; width: calc(100% - 248px); }
  main { max-width: 760px; margin-left: calc(248px + max(0px, (100vw - 248px - 760px) / 2)); margin-right: auto; padding: 24px 32px 48px; }
  .setup, .welcome { max-width: 520px; margin: 0 auto; }
  nav#tabs[hidden] ~ main, body:has(nav#tabs[hidden]) main { margin-left: auto; }
  #list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  #list > .card { margin-top: 0; }
  .top { height: 260px; }
  .greet { font-size: 46px; }
}
@media (min-width: 1200px) {
  #list { grid-template-columns: 1fr 1fr 1fr; }
}

/* Drill cells are buttons: tried and mastered show, as on the phone's charts. */
button.cell { font: inherit; color: inherit; border: 0; cursor: pointer; white-space: pre-line; }
button.cell.tried { box-shadow: inset 0 0 0 2px var(--line); }
button.cell.mastered { background: var(--right); color: var(--on-right); }
.group .row[data-drill] { cursor: pointer; }

/* ---------- Cards over the page and short messages (sheet.js), Save to Seep (save.js) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); display: grid; place-items: end center; padding: 12px; animation: fade .16s ease-out; }
.sheet-back.leaving { opacity: 0; transition: opacity .15s; }
@media (min-width: 640px) { .sheet-back { place-items: center; } }
.sheet { width: 100%; max-width: 480px; max-height: calc(100vh - 24px); overflow-y: auto; background: var(--bg); color: var(--text); border-radius: 24px; padding: 18px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.3); animation: rise .2s ease-out backwards; }
@keyframes fade { from { opacity: 0; } }
.sheet-title { font: 700 22px/1.25 var(--heading); margin: 0 0 6px; }
.sheet-text { margin: 6px 0 0; font-size: 15px; }
.sheet-text.long { white-space: pre-line; max-height: 60vh; overflow-y: auto; color: var(--soft); }
.sheet-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.sheet-actions .quiet { padding: 0 14px; }
.pill-button.danger { background: var(--bad); color: #fff; }
.pill-button:disabled, .big-button:disabled { opacity: .5; cursor: default; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translate(-50%, 12px); max-width: min(440px, calc(100vw - 32px)); background: var(--text); color: var(--bg); font: 15px var(--body); padding: 12px 18px; border-radius: 14px; box-shadow: 0 6px 22px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.save-head { display: flex; align-items: center; justify-content: space-between; font-size: 20px; }
.save-body { padding-top: 10px; }
.save-q { font: 500 18px var(--body); }
.save-quote { color: var(--soft); font-size: 16px; margin: 12px 0 0; }
.save-en { font-size: 16px; margin: 8px 0 0; }
.save-note { font-size: 14px; color: var(--soft); margin: 8px 0 0; }
.save-note.warn { color: var(--warn); }
.save-note.small { font-size: 12px; text-align: center; }
.save-word { padding-top: 4px; }
.save-parts { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.save-parts .part { display: grid; justify-items: center; }
.save-parts .part small { font-size: 11px; color: var(--soft); padding-top: 2px; text-align: center; }
.save-parts .punct { font: 700 28px var(--cjk); }
.save-wait { display: flex; align-items: center; gap: 10px; color: var(--soft); padding-top: 14px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--right); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentence { position: relative; padding-right: 44px !important; }
.remove { flex: none; width: 34px; height: 34px; border-radius: 17px; border: 0; background: none; color: var(--soft); font-size: 20px; line-height: 1; cursor: pointer; }
.remove:hover { background: color-mix(in srgb, var(--line) 40%, transparent); color: var(--text); }
.sentence .remove { position: absolute; top: 8px; right: 8px; }
header .outline-button, .outline-button.sm { width: auto; height: 40px; padding: 0 16px; font-size: 14px; border-radius: 20px; flex: none; }
.pill-button.sm { height: 40px; font-size: 13px; padding: 0 16px; flex: none; }
.pick { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; margin-top: 8px; }
.pick .row { background: none; border: 0; border-radius: 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pick .row:hover, .pick .row:focus-visible { background: color-mix(in srgb, var(--line) 30%, transparent); }
@media (prefers-reduced-motion: reduce) { .sheet-back, .sheet, .toast { animation: none; transition: none; } }
@media (max-width: 639px) { .board .remove { display: none; } .board .row { gap: 8px; } }

/* Sentence practice (SentenceActivity) */
.sp-words { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.sp-part { display: grid; justify-items: center; gap: 2px; position: relative; }
.sp-part small { font-size: 12px; color: var(--soft); text-align: center; max-width: 9em; }
.sp-part.punct { font: 700 26px var(--cjk); align-self: center; }
.sp-part.new { padding-bottom: 2px; border-bottom: 3px solid var(--accent); }
.sp-part em { font-style: normal; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card.sentence[role=button] { cursor: pointer; }
.say-one { cursor: pointer; border-radius: 8px; }
.say-one:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.say-one:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
