/* 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; }
