/* ============ tokens ============ */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --border: #e2e6f0;
  --text: #121731;
  --muted: #5d6585;
  --faint: #959bb4;
  --accent: #3355ff;
  --accent-2: #5b7bff;
  --accent-ink: #ffffff;
  --accent-soft: #e7ecff;
  --good: #109a5a; --good-soft: #e2f6ec;
  --bad: #e0464c; --bad-soft: #fdeaea;
  --warn: #c27400; --warn-soft: #fff1dc;
  --c1: #3355ff; --c1s: #e7ecff;   /* çıkmış */
  --c2: #8a3ffc; --c2s: #f1e8ff;   /* phrasal */
  --c3: #e86a12; --c3s: #fff0e4;   /* bağlaç */
  --c4: #0b9b8f; --c4s: #def6f3;   /* akademik */
  --shadow: 0 1px 2px rgba(18, 23, 49, .04), 0 4px 14px -6px rgba(18, 23, 49, .10);
  --shadow-lg: 0 2px 6px rgba(18, 23, 49, .05), 0 16px 40px -16px rgba(18, 23, 49, .22);
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1020; --surface: #151a2e; --surface-2: #1c2239; --border: #262d48;
    --text: #eef0fa; --muted: #a3a9c4; --faint: #6f7694;
    --accent: #7b93ff; --accent-2: #9aadff; --accent-ink: #0c1020; --accent-soft: #1f2850;
    --good: #3fd08a; --good-soft: #15302a; --bad: #ff7b7f; --bad-soft: #3a1d24; --warn: #ffb547; --warn-soft: #3a2c16;
    --c1: #7b93ff; --c1s: #1f2850; --c2: #b78aff; --c2s: #2a1f4a; --c3: #ff9b52; --c3s: #3a2617; --c4: #3fd0c2; --c4s: #12322f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.3), 0 18px 44px -16px rgba(0,0,0,.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1020; --surface: #151a2e; --surface-2: #1c2239; --border: #262d48;
  --text: #eef0fa; --muted: #a3a9c4; --faint: #6f7694;
  --accent: #7b93ff; --accent-2: #9aadff; --accent-ink: #0c1020; --accent-soft: #1f2850;
  --good: #3fd08a; --good-soft: #15302a; --bad: #ff7b7f; --bad-soft: #3a1d24; --warn: #ffb547; --warn-soft: #3a2c16;
  --c1: #7b93ff; --c1s: #1f2850; --c2: #b78aff; --c2s: #2a1f4a; --c3: #ff9b52; --c3s: #3a2617; --c4: #3fd0c2; --c4s: #12322f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.3), 0 18px 44px -16px rgba(0,0,0,.65);
  color-scheme: dark;
}

/* ============ base ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--font); display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 18px; }
main.container { flex: 1; padding-top: 22px; padding-bottom: calc(40px + var(--tabbar-h)); outline: none; overflow-x: clip; }

/* ============ top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar-in { display: flex; align-items: center; gap: 12px; height: 62px; max-width: 760px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); margin-right: auto; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 17px;
}
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-text span { color: var(--accent); }
.topnav { display: flex; gap: 2px; }
.topnav a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); padding: 8px 12px; border-radius: 12px; font-weight: 600; font-size: 14.5px; }
.topnav a svg.i { width: 18px; height: 18px; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.active { color: var(--accent); background: var(--accent-soft); }
.icon-btn { border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 12px; width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.tabbar { display: none; }

/* ============ type ============ */
h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.025em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 700; color: var(--muted); margin: 28px 0 10px; letter-spacing: -.005em; }
.lead { color: var(--muted); margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; justify-content: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ============ primitives ============ */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14.5px; font-weight: 600; margin: 0 0 12px -6px; padding: 4px 8px 4px 2px; border-radius: 10px; }
.back:hover { color: var(--text); background: var(--surface-2); }
.back svg.i { width: 18px; height: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0;
  background: var(--surface-2); color: var(--text); padding: 12px 20px; border-radius: 14px;
  font-weight: 700; font-size: 15.5px; cursor: pointer; min-height: 50px; white-space: nowrap;
  transition: transform .08s ease, filter .15s, background .15s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.lg { min-height: 58px; font-size: 17px; border-radius: 16px; padding: 14px 24px; }
.btn.block { width: 100%; }
.btn.good { background: var(--good); color: #fff; }
.btn.bad { background: var(--bad-soft); color: var(--bad); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }

/* segmented */
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: var(--surface-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ============ home ============ */
.hello { margin-bottom: 18px; }
.hello .field-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); background: var(--surface); padding: 5px 12px; border-radius: 99px; box-shadow: var(--shadow); font-weight: 600; }
.hello .field-note:hover { color: var(--text); }
.today {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: var(--accent-ink);
  border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.today::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.10); }
.today::before { content: ""; position: absolute; right: 40px; bottom: -90px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.07); }
.today .lbl { font-size: 13.5px; font-weight: 700; opacity: .85; }
.today .big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; line-height: 1.15; }
.today .sub { opacity: .85; font-size: 14.5px; margin-bottom: 18px; }
.today .btn { background: #fff; color: #1b2a8a; box-shadow: 0 8px 20px -10px rgba(0,0,0,.4); position: relative; z-index: 1; }
:root[data-theme="dark"] .today .btn { color: #1b2a8a; }
.today .meter { height: 8px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; margin-bottom: 18px; max-width: 320px; }
.today .meter i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .5s; }
.mini { display: flex; gap: 10px; margin-top: 12px; }
.mini > div { flex: 1; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.mini b { display: block; font-size: 19px; line-height: 1.1; font-weight: 800; }
.mini span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* list rows (decks, menu) */
.rows { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rowlink { display: flex; align-items: center; gap: 14px; padding: 15px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover { background: var(--surface-2); }
.rowlink .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--cs, var(--accent-soft)); color: var(--c, var(--accent)); }
.rowlink .ico svg.i { width: 22px; height: 22px; }
.rowlink .t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.rowlink .s { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.rowlink .chev { color: var(--faint); }
.rowlink .count { font-size: 13px; font-weight: 700; color: var(--c, var(--accent)); background: var(--cs, var(--accent-soft)); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.thin { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; max-width: 260px; }
.thin i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; }
.d-cikmis { --c: var(--c1); --cs: var(--c1s); }
.d-phrasal { --c: var(--c2); --cs: var(--c2s); }
.d-baglac { --c: var(--c3); --cs: var(--c3s); }
.d-akademik { --c: var(--c4); --cs: var(--c4s); }
.d-osym { --c: var(--good); --cs: var(--good-soft); }

/* ============ deck page ============ */
.deck-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.deck-top .ico { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: var(--cs); color: var(--c); flex: none; }
.deck-top .ico svg.i { width: 26px; height: 26px; }
.deck-top h1 { margin: 0; font-size: 25px; }
.progress-card { margin: 16px 0; }
.progress-card .nums { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.progress-card .nums b { font-size: 26px; font-weight: 800; }
.progress-card .nums span { color: var(--muted); font-size: 14px; font-weight: 600; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; transition: width .4s; }
.bar .b-m { background: var(--c, var(--accent)); }
.bar .b-l { background: color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.actions { display: grid; gap: 10px; }
.actions .btn.primary { background: var(--c); }
.textlink { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; color: var(--c, var(--accent)); margin-top: 6px; }

/* ============ sessions ============ */
body.session .tabbar, body.session .foot { display: none !important; }
body.session { overflow-x: hidden; }
.session-wrap { max-width: 600px; margin: 0 auto; }
.session-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.session-top .x { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--surface); box-shadow: var(--shadow); flex: none; }
.session-top .bar { flex: 1; height: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.session-top .bar i { background: var(--accent); border-radius: 99px; }
.session-top .cnt { font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

.stage { perspective: 1400px; }
.flash {
  min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 30px 20px; cursor: pointer; user-select: none; -webkit-user-select: none;
  position: relative; border-radius: 26px; touch-action: pan-y; box-shadow: var(--shadow-lg); transition: background .2s;
}
.flash .tag { font-size: 12.5px; font-weight: 700; color: var(--c, var(--accent)); background: var(--cs, var(--accent-soft)); padding: 4px 11px; border-radius: 99px; }
.flash .word { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; word-break: break-word; }
.flash .tr { font-size: 21px; font-weight: 700; color: var(--accent); line-height: 1.35; }
.flash .syn { font-size: 14.5px; color: var(--muted); }
.flash .syn b { color: var(--text); }
.flash .hint { color: var(--faint); font-size: 14px; font-weight: 600; margin-top: 10px; }
.flash .divider { width: 44px; height: 4px; border-radius: 4px; background: var(--surface-2); margin: 4px 0; }
.flash.tint-good { background: color-mix(in srgb, var(--good-soft) 70%, var(--surface)); }
.flash.tint-bad { background: color-mix(in srgb, var(--bad-soft) 70%, var(--surface)); }
.swipe-tag { position: absolute; top: 18px; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 8px; border: 2px solid; opacity: 0; }
.swipe-tag.l { left: 18px; color: var(--bad); transform: rotate(-8deg); }
.swipe-tag.r { right: 18px; color: var(--good); transform: rotate(8deg); }
.speak { border: 0; background: var(--surface-2); color: var(--muted); border-radius: 99px; height: 40px; padding: 0 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.speak:hover { color: var(--text); }
.speak svg.i { width: 18px; height: 18px; }
.example { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; text-align: left; width: 100%; }
.example .en { font-size: 16px; line-height: 1.55; font-weight: 500; }
.example .en mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; font-weight: 800; padding: 0 3px; border-radius: 5px; }
.example .tr2 { color: var(--muted); font-size: 14px; margin-top: 6px; }
.gram { font-size: 14px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 9px 12px; text-align: left; width: 100%; }
.srcs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.src { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; font-weight: 600; }
.src.ans { background: var(--good-soft); color: var(--good); }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.grade .btn { min-height: 58px; font-size: 16.5px; }

.qcard { padding: 22px; border-radius: 24px; box-shadow: var(--shadow-lg); }
.qlabel { font-size: 14px; font-weight: 700; color: var(--muted); }
.q-prompt { font-size: 30px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.q-prompt.tr-prompt { font-size: 22px; }
.q-prompt.sentence { font-size: 19px; line-height: 1.6; font-weight: 600; letter-spacing: 0; }
.q-prompt .blank { display: inline-block; min-width: 76px; height: 1.1em; vertical-align: -.15em; border-bottom: 3px solid var(--accent); margin: 0 3px; }
.qsrc { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.qsrc svg.i { width: 16px; height: 16px; }
.opts { display: grid; gap: 9px; margin-top: 18px; }
.opt {
  text-align: left; border: 2px solid var(--border); background: var(--surface); border-radius: 16px;
  padding: 13px 14px; cursor: pointer; min-height: 56px; display: flex; gap: 12px; align-items: center;
  transition: border-color .12s, background .12s; font-size: 16px; font-weight: 600;
}
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt .L { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 13.5px; }
.opt .body { display: flex; flex-direction: column; min-width: 0; }
.opt .sub { color: var(--muted); font-size: 13.5px; font-weight: 500; margin-top: 1px; }
.opt.right { background: var(--good-soft); border-color: var(--good); }
.opt.right .L { background: var(--good); color: #fff; }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.opt.wrong .L { background: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.opt.dim { opacity: .7; }
.feedback { margin-top: 16px; display: grid; gap: 12px; }
.verdict { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.verdict.ok { color: var(--good); }
.verdict.no { color: var(--bad); }
.actionbar { margin-top: 14px; }

.result { text-align: center; padding: 34px 20px; border-radius: 26px; }
.result .emoji { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.result .big { font-size: 50px; font-weight: 800; color: var(--accent); letter-spacing: -.03em; line-height: 1.1; }
.result h2 { color: var(--text); font-size: 21px; margin: 8px 0 4px; }
.result p { margin: 0 0 22px; }

/* ============ list ============ */
.toolbar {
  position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 5; padding: 8px 0 10px;
  background: var(--bg); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px;
}
.toolbar > * { min-width: 0; }
.input, select.input {
  border: 2px solid transparent; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 15.5px; min-height: 50px; width: 100%;
}
select.input { padding-right: 34px; appearance: none; -webkit-appearance: none; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23889' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.input:focus { outline: none; border-color: var(--accent); }
.searchbox { position: relative; display: block; }
.searchbox svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.searchbox .input { padding-left: 42px; }
.list-meta { font-size: 13.5px; color: var(--muted); font-weight: 600; margin: 2px 2px 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wlist { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.witem { border-bottom: 1px solid var(--border); }
.witem:last-child { border-bottom: 0; }
.witem > .top { display: flex; gap: 12px; align-items: center; padding: 13px 16px; cursor: pointer; width: 100%; border: 0; background: transparent; text-align: left; }
.witem > .top:hover, .witem.open > .top { background: var(--surface-2); }
.witem .w { font-weight: 700; font-size: 16px; white-space: nowrap; }
.witem .t { color: var(--muted); font-size: 14.5px; flex: 1; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.witem .chev { color: var(--faint); transition: transform .15s; width: 18px; height: 18px; }
.witem.open .chev { transform: rotate(90deg); }
.witem .details { display: none; padding: 4px 16px 16px; gap: 10px; flex-direction: column; }
.witem.open .details { display: flex; }
.witem .details .tr { font-weight: 700; color: var(--accent); font-size: 17px; }
.witem .details .srcs { justify-content: flex-start; }
.witem .details .meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 99px; display: inline-block; flex: none; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--border); }
.dot.l { background: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: none; }
.dot.m { background: var(--accent); box-shadow: none; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* ============ settings / prose ============ */
.prose p, .prose li { line-height: 1.65; }
.prose li { margin-bottom: 8px; }
.prose h2 { color: var(--text); font-size: 17px; }
.settings { padding: 2px 18px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.settings-row:last-child { border-bottom: 0; }
.settings-row b { display: block; font-size: 15.5px; }
.settings-row select.input { width: auto; min-width: 96px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ============ footer / toast / motion ============ */
.foot { color: var(--faint); font-size: 13px; padding-bottom: calc(22px + var(--tabbar-h)); text-align: center; }
.foot p { margin: 0; padding-top: 10px; }
.foot a { color: var(--muted); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 60; animation: toast .25s ease; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.fade-in { animation: fadein .22s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(5px); } }
@keyframes pop { 40% { transform: scale(1.02); } }
.pop { animation: pop .3s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.shake { animation: shake .3s ease; }

/* ============ responsive ============ */
@media (max-width: 720px) {
  :root { --tabbar-h: calc(66px + env(safe-area-inset-bottom)); }
  .container { padding: 0 16px; }
  main.container { padding-top: 10px; }
  .topbar-in { height: 56px; }
  .topnav { display: none; }
  .toolbar { top: calc(56px + env(safe-area-inset-top)); }
  h1 { font-size: 25px; }
  .today { padding: 20px; border-radius: 22px; }
  .today .big { font-size: 26px; }
  .mini > div { padding: 10px 12px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -1px 0 var(--border);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11.5px; font-weight: 700; }
  .tabbar a svg.i { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--accent); }
  main.container.is-session { padding-bottom: 120px; }
  .flash { min-height: 50vh; padding: 26px 18px; }
  .flash .word { font-size: 33px; }
  .q-prompt { font-size: 26px; }
  .q-prompt.sentence { font-size: 17.5px; }
  .qcard { padding: 18px; }
  .actionbar, .grade.sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
}
@media (max-width: 340px) {
  .mini { flex-direction: column; }
  .witem .w { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
