:root {
  --bg: #F5F3EE; --surface: #FFFFFF; --surface-2: #EEEBE4; --surface-3: #E6E2D9;
  --ink: #17171A; --ink-2: #57544F; --ink-3: #98948C; --line: rgba(23,23,26,.08);
  --accent: #1F2A4D; --accent-ink: #FFFFFF; --accent-soft: rgba(31,42,77,.08); --sticky: #F4F08A;
  --gold: #A97F35; --gold-soft: rgba(169,127,53,.12);
  --good: #2E7A58; --good-soft: rgba(46,122,88,.12);
  --bad: #B9483D; --bad-soft: rgba(185,72,61,.11);
  --warn: #C08429;
  --shadow: 0 1px 2px rgba(20,20,20,.04), 0 8px 24px rgba(20,20,20,.06);
  --radius: 20px; --radius-sm: 14px;
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans Thai", "Microsoft YaHei", sans-serif;
  --thai: "Noto Serif Thai", "Sukhumvit Set", "Thonburi", serif;
  --thai-sans: "Noto Sans Thai", "Sukhumvit Set", "Thonburi", sans-serif;
  --latin: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0F11; --surface: #19191C; --surface-2: #222226; --surface-3: #2B2B30;
    --ink: #F2F0EB; --ink-2: #B4B0A8; --ink-3: #74716B; --line: rgba(255,255,255,.08);
    --accent: #EDE98A; --accent-ink: #1A1A10; --accent-soft: rgba(237,233,138,.13); --sticky: #4A4826;
    --gold: #D8AD62; --gold-soft: rgba(216,173,98,.14);
    --good: #5DBE8E; --good-soft: rgba(93,190,142,.14); --bad: #E5776B; --bad-soft: rgba(229,119,107,.14);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0F11; --surface: #19191C; --surface-2: #222226; --surface-3: #2B2B30;
  --ink: #F2F0EB; --ink-2: #B4B0A8; --ink-3: #74716B; --line: rgba(255,255,255,.08);
  --accent: #EDE98A; --accent-ink: #1A1A10; --accent-soft: rgba(237,233,138,.13); --sticky: #4A4826;
  --gold: #D8AD62; --gold-soft: rgba(216,173,98,.14);
  --good: #5DBE8E; --good-soft: rgba(93,190,142,.14); --bad: #E5776B; --bad-soft: rgba(229,119,107,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.thai { font-family: var(--thai); }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }

.view { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 18px calc(var(--safe-b) + 96px); min-height: 100vh; }
.view.full { padding-bottom: calc(var(--safe-b) + 24px); }
body.session .tabbar { display: none; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px;
  padding: 8px 12px calc(var(--safe-b) + 8px); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 11px; color: var(--ink-3); font-weight: 500; transition: color .2s; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { stroke-width: 2; }

/* Header */
.head { display: flex; align-items: flex-end; justify-content: space-between; margin: 8px 0 22px; gap: 12px; }
.head h1 { font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.head .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .02em; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip-btn svg { width: 16px; height: 16px; }
.flame { color: var(--gold); }

/* Cards & layout */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.stack > * + * { margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; margin: 28px 4px 10px; display: flex; justify-content: space-between; align-items: center; }
.section-title a, .section-title button { color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 13px; }

/* Hero (today) */
.hero { display: flex; align-items: center; gap: 20px; padding: 22px; }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .lbl b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ring .lbl span { font-size: 11px; color: var(--ink-3); }
.hero-info { flex: 1; min-width: 0; }
.hero-info .row { display: flex; gap: 18px; margin-bottom: 14px; }
.stat-num b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-num span { font-size: 12px; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 600; font-size: 16px; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; font-size: 14px; padding: 0 14px; border-radius: 11px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

/* Mode tiles */
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); text-align: left; transition: transform .12s; }
.tile:active { transform: scale(.98); }
.tile .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile .ic.gold { background: var(--gold-soft); color: var(--gold); }
.tile .ic.good { background: var(--good-soft); color: var(--good); }
.tile .ic.bad { background: var(--bad-soft); color: var(--bad); }
.tile .ic svg { width: 19px; height: 19px; }
.tile b { font-size: 15px; font-weight: 600; }
.tile span { font-size: 12px; color: var(--ink-3); margin-top: -8px; }

/* Word of day */
.wod { position: relative; overflow: hidden; padding: 22px; }
.wod .th { font-family: var(--thai); font-size: 40px; line-height: 1.3; font-weight: 500; }
.wod .tr { color: var(--gold); font-size: 15px; font-weight: 500; letter-spacing: .02em; }
.wod .mean { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.wod .spk { position: absolute; right: 18px; top: 18px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); transition: transform .12s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.on { color: var(--gold); background: var(--gold-soft); }
.icon-btn svg { width: 20px; height: 20px; }

/* Session */
.sbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.counts { display: flex; gap: 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.counts .n { color: var(--accent); } .counts .r { color: var(--good); } .counts .a { color: var(--bad); }

.flash { min-height: calc(100vh - 260px - var(--safe-t) - var(--safe-b)); display: flex; flex-direction: column; padding: 26px 22px; position: relative; }
.flash .badge { position: absolute; left: 18px; top: 16px; font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 3px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.flash .badge.review { background: var(--good-soft); color: var(--good); }
.flash .tools { position: absolute; right: 14px; top: 12px; display: flex; gap: 6px; }
.flash .front { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 0 10px; }
.flash .big { font-size: 52px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; word-break: break-word; }
.flash .big.thai { font-weight: 500; font-size: 56px; }
.flash .phon { margin-top: 8px; font-size: 17px; color: var(--gold); font-weight: 500; }
.flash .hint { margin-top: 26px; font-size: 13px; color: var(--ink-3); }
.answers { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; animation: rise .3s ease; }
.lang-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.lang-row .tag { width: 30px; height: 22px; border-radius: 6px; font-size: 10px; font-weight: 700; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); letter-spacing: .04em; flex: none; }
.lang-row .txt { flex: 1; min-width: 0; }
.lang-row .w { font-size: 20px; font-weight: 600; }
.lang-row .w.thai { font-size: 24px; font-weight: 500; }
.lang-row .p { font-size: 14px; color: var(--gold); }
.example { margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; font-size: 14px; }
.example .thai { font-size: 17px; }
.meta-line { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.grades button { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 62px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 15px; transition: transform .1s; }
.grades button:active { transform: scale(.95); }
.grades button small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.grades .g0 { color: var(--bad); } .grades .g1 { color: var(--warn); } .grades .g2 { color: var(--good); } .grades .g3 { color: var(--accent); }

/* Quiz */
.q-prompt { text-align: center; padding: 40px 18px 30px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 16px 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 17px; font-weight: 500; border: 2px solid transparent; transition: all .15s; }
.opt small { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt[disabled] { pointer-events: none; }
.spell-in { width: 100%; height: 58px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); padding: 0 18px; font-size: 22px; text-align: center; outline: none; font-weight: 500; }
.spell-in:focus { border-color: var(--accent); }
.spell-in.right { border-color: var(--good); } .spell-in.wrong { border-color: var(--bad); }
.result { text-align: center; padding: 40px 10px; }
.result .score { font-size: 64px; font-weight: 700; letter-spacing: -.03em; }

/* Lists / words */
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; height: 46px; border-radius: 14px; border: 0; background: var(--surface); box-shadow: var(--shadow); padding: 0 16px 0 44px; font-size: 16px; outline: none; }
.search svg { position: absolute; left: 14px; top: 12px; color: var(--ink-3); width: 20px; height: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 99px; background: var(--surface); font-size: 14px; color: var(--ink-2); box-shadow: var(--shadow); white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t1 { display: flex; align-items: baseline; gap: 8px; }
.row .t1 .thai { font-size: 20px; font-weight: 500; }
.row .t1 .tr { font-size: 13px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .side { text-align: right; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); flex: none; }
.dot.learning { background: var(--warn); } .dot.mastered { background: var(--good); }
.cnt { min-width: 28px; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink-2); }
.star { color: var(--gold); width: 15px; height: 15px; fill: var(--gold); stroke: none; }
.fab { position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(var(--safe-b) + 84px); width: 56px; height: 56px; border-radius: 18px; background: var(--ink); color: var(--bg); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 15; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }

/* Stats */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 16px; }
.kpi b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--ink-3); }
.chart { width: 100%; height: auto; display: block; stroke: none; fill: none; }
.chart line { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--ink-3); stroke: none; font-size: 10px; font-weight: 400; font-family: var(--font); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.heat i.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.heat i.l3 { background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); }
.heat i.l4 { background: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); margin-top: 10px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(64px, 112px) 1fr 64px; gap: 10px; align-items: center; font-size: 14px; padding: 6px 0; }
.bar-row .track { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar-row .track i { height: 100%; }
.bar-row .num { text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Settings */
.group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.set { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); min-height: 54px; width: 100%; text-align: left; }
.set:last-child { border-bottom: 0; }
.set .lab { flex: 1; min-width: 0; }
.set .lab small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.set .val { color: var(--ink-3); font-size: 15px; display: flex; align-items: center; gap: 4px; }
.set input[type=text], .set input[type=password], .set input[type=url], .set select { border: 0; background: var(--surface-2); border-radius: 10px; height: 36px; padding: 0 10px; font-size: 15px; max-width: 58%; outline: none; }
.set select { max-width: 50%; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; }
.stepper button { width: 34px; height: 34px; font-size: 18px; color: var(--ink-2); }
.stepper b { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(20px); }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 2px; }
.seg button { padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.profile { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile img { width: 58px; height: 58px; border-radius: 15px; }
.profile b { font-size: 19px; }

/* Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 18px calc(var(--safe-b) + 20px); max-height: 90vh; overflow-y: auto; animation: up .3s cubic-bezier(.2,.8,.2,1); -webkit-overflow-scrolling: touch; }
.sheet .grab { width: 38px; height: 5px; border-radius: 5px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h2 { font-size: 20px; margin: 4px 0 16px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--ink-3); margin: 0 0 5px 4px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; height: 46px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); padding: 0 14px; font-size: 16px; outline: none; }
.field textarea { height: 110px; padding: 12px 14px; resize: vertical; }
.detail-head { text-align: center; padding: 10px 0 18px; }
.detail-head .thai { font-size: 48px; line-height: 1.3; font-weight: 500; }
.detail-head .tr { color: var(--gold); font-size: 17px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.mini-stats div { background: var(--surface); border-radius: 12px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.mini-stats b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 11px; color: var(--ink-3); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble .acts { margin-top: 8px; font-size: 12px; color: var(--good); }
.composer { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(var(--safe-b) + 10px); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); z-index: 25; }
.composer form { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
.composer input { flex: 1; height: 46px; border-radius: 23px; border: 0; background: var(--surface); box-shadow: var(--shadow); padding: 0 18px; outline: none; font-size: 16px; }
.composer button { width: 46px; height: 46px; border-radius: 23px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -140%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 500; z-index: 60; transition: transform .35s cubic-bezier(.2,.8,.2,1); max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.install-tip { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--gold-soft); border-radius: var(--radius-sm); font-size: 14px; color: var(--ink-2); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.fade-in { animation: rise .35s ease both; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

/* v1.1 */
.latin { font-family: var(--latin); font-optical-sizing: auto; }
.flash .big.latin { font-weight: 600; font-size: 50px; letter-spacing: -.01em; }
.lang-row .w.latin { font-size: 22px; }
.row .t1 .latin { font-size: 19px; font-weight: 600; }
.wod .th.latin { font-family: var(--latin); font-weight: 600; }
.detail-head .latin { font-size: 44px; line-height: 1.25; font-weight: 600; }
.icon-btn.mini { display: inline-grid; width: 28px; height: 28px; vertical-align: middle; border-radius: 9px; }
.icon-btn.mini svg { width: 16px; height: 16px; }
.big-play { width: 88px; height: 88px; border-radius: 28px; margin: 10px auto; background: var(--accent-soft); color: var(--accent); }
.big-play svg { width: 40px; height: 40px; }
.book-line { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.auth-head { text-align: center; margin: 4px 0 8px; }
.auth-head img { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow); }
.auth-head h1 { font-size: 34px; margin: 12px 0 2px; letter-spacing: -.02em; }
.auth-head p { margin: 0; }
.acc-row { padding: 8px 10px 8px 6px; }
.acc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 4px 6px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sticky); color: var(--ink); font-weight: 700; flex: none; }
.avatar.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 22px; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--good-soft); color: var(--good); }
.row .t1 b { font-size: 16px; }
.seg.full { display: flex; } .seg.full button { flex: 1; padding: 9px 10px; font-size: 15px; }
.err { color: var(--bad); font-size: 14px; min-height: 18px; margin: 4px 2px 10px; }
.keyout { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.keyout code { flex: 1; min-width: 0; word-break: break-all; font-size: 12px; }
.ring .fg { stroke: var(--accent); }
