:root {
  --bg: #ffffff;
  --surface: #f6f5fb;
  --border: #e3e0ef;
  --text: #1d1b2e;
  --muted: #6b6787;
  --accent: #6d4aff;
  --accent-ink: #ffffff;
  --danger: #c62f4b;
  --ok: #1f8a5b;
  --learn: #c2410c;
  --review: #1f8a5b;
  --new: #2563eb;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151f;
    --surface: #211e2c;
    --border: #34304a;
    --text: #f1effa;
    --muted: #a19cc0;
    --accent: #9b85ff;
    --accent-ink: #120f1c;
    --danger: #ff7189;
    --ok: #58d39c;
    --learn: #fb923c;
    --review: #58d39c;
    --new: #7aa7ff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; min-height: 100vh; }
h1, h2 { margin: 0 0 8px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
p { margin: 0 0 10px; }
.ko { font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
/* Kanji and hanzi are drawn differently per language: Japanese and Chinese fonts for them. */
:lang(ja) { font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif; }
:lang(zh) { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 650; }
a { color: var(--accent); }
code { background: var(--surface); padding: 1px 5px; border-radius: 4px; }
kbd { font: 11px system-ui; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: 0.6; margin-left: 6px; }

button, .button-like {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-block;
}
button:hover, .button-like:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.big { padding: 12px 22px; font-size: 16px; font-weight: 600; }
button.link { background: none; border: none; color: var(--accent); padding: 4px 6px; }
button:disabled { opacity: 0.5; cursor: default; }
select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; max-width: 100%;
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

main { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.narrow { max-width: 560px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.hero { max-width: 620px; margin: 40px auto; text-align: center; }
.hero h1 { font-size: 32px; line-height: 1.2; margin-bottom: 14px; }
.lead { font-size: 17px; color: var(--muted); margin-bottom: 24px; }
.fine { margin-top: 18px; }

.try { margin-top: 28px; }
.link-btn { background: none; border: none; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 6px; }
#tryLevels { margin-top: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.center-row { justify-content: center; }
.choice { min-width: 150px; }
.lang-choice span { margin-left: 6px; color: var(--muted); }
.lang-switch select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 5px 8px; font: inherit; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 22px 0 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
#emptyStarter .row { margin-top: 10px; }

.banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px;
}

.steps { padding-left: 20px; margin: 12px 0 18px; }
.steps li { margin-bottom: 6px; }
.drop {
  display: grid; place-items: center; min-height: 120px; padding: 16px; text-align: center;
  border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; background: var(--bg);
}
.drop.over, .drop:hover { border-color: var(--accent); }

.study-card { text-align: center; }
.counts { display: flex; justify-content: center; gap: 36px; margin-bottom: 18px; }
.counts div { display: flex; flex-direction: column; }
.num { font-size: 30px; font-weight: 700; }
.num.learn { color: var(--learn); }
.num.review { color: var(--review); }
.num.new { color: var(--new); }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.lookups { list-style: none; padding: 0; margin: 0; }
.lookups li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.lookups li:last-child { border-bottom: none; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 12px; }

.type { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; background: var(--bg); }
.type-name { grid-column: 1 / -1; }
.type label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.study-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.flash {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 20px; text-align: center;
}
.flash.is-new { border-color: var(--new); }
.say { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.say svg { width: 22px; height: 22px; }
.sound { color: var(--muted); font-size: 16px; margin-top: -8px; }
.sound .ko { color: var(--text); }
.front { font-size: 56px; font-weight: 600; line-height: 1.2; word-break: keep-all; }
.back { font-size: 22px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 18px; width: 100%; max-width: 480px; }
.mined { width: 100%; max-width: 480px; margin-top: -6px; padding: 12px 14px; border-radius: 12px; background: var(--bg); text-align: left; font-size: 15px; line-height: 1.5; }
.mined mark { background: transparent; color: var(--text); font-weight: 700; border-bottom: 2px solid var(--new); }
.mined .tr { color: var(--muted); font-size: 14px; margin-top: 4px; }
.mined .src { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.mined .src a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mined .src button { flex: none; padding: 2px 8px; font-size: 12px; }
.mined .mined-item + .mined-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mined > .link { margin-top: 10px; }
.answer-bar { display: flex; justify-content: center; margin-top: 18px; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 560px; }
.rate button { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; font-weight: 600; }
.rate .ivl { font-size: 12px; font-weight: 500; color: var(--muted); }
.rate .again { border-color: var(--danger); }
.rate .good { border-color: var(--ok); }

.status { min-height: 1.5em; margin-top: 12px; }
.status.center { text-align: center; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

@media (max-width: 520px) {
  .front { font-size: 42px; }
  .counts { gap: 20px; }
  .hero h1 { font-size: 26px; }
  .type { grid-template-columns: 1fr; }
  .brand { white-space: nowrap; }
  .rate kbd, .answer-bar kbd { display: none; }
}

/* Legal pages and footer */
.legal { max-width: 720px; }
.legal h2 { margin-top: 24px; }
.legal h3 { margin: 16px 0 6px; font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
a.brand.plain { color: var(--text); text-decoration: none; }
.foot { text-align: center; padding: 24px 16px 32px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); margin: 0 8px; }
.foot div { margin-top: 8px; }
.renew-terms { max-width: 640px; margin: 16px auto 0; color: var(--text); line-height: 1.5; }

/* Pricing */
.pricing-hero { margin-bottom: 24px; }
.period { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.period button { border: none; background: none; padding: 6px 14px; border-radius: 9px; }
.period button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.save { font-size: 12px; font-weight: 600; margin-left: 4px; opacity: 0.9; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 760px; margin: 0 auto; }
.plan { display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan.premium { border: 2px solid var(--accent); }
.badge { position: absolute; top: -12px; right: 16px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.price .amount { font-size: 34px; font-weight: 700; }
.features { padding-left: 20px; margin: 4px 0 8px; flex: 1; }
.features li { margin-bottom: 6px; }
.button-like.full { text-align: center; text-decoration: none; }
.button-like.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-like.disabled { opacity: 0.55; cursor: default; }
.center { text-align: center; }
.faq { max-width: 620px; margin: 36px auto 0; }

/* ---------- Navigation ---------- */
.nav { display: flex; align-items: center; gap: 4px; }
.nav .sync { margin-right: 8px; }
.nav-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 9px; }
.nav-btn:hover { color: var(--text); border-color: var(--border); }
.nav-btn[aria-current] { color: var(--text); background: var(--surface); border-color: var(--border); font-weight: 600; }

/* ---------- Home ---------- */
.today { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; }
.today h1 { font-size: 26px; margin-bottom: 4px; }
.today p { margin-bottom: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 0 0 6px !important; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.pill b { font-weight: 700; }
.pill.learn b { color: var(--learn); }
.pill.review b { color: var(--review); }
.pill.new b { color: var(--new); }
.today .big { flex-shrink: 0; min-width: 160px; }

.checklist { margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.check li { display: flex; gap: 12px; align-items: flex-start; }
.check li div { display: flex; flex-direction: column; gap: 2px; }
.tick { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); margin-top: 1px; display: grid; place-items: center; }
.check li.done .tick { background: var(--ok); border-color: var(--ok); }
.check li.done .tick::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.check li.done b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.stat b { font-size: 24px; font-weight: 700; }
.stat span { font-size: 13px; color: var(--muted); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.actions { display: grid; gap: 8px; margin-top: 4px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; }
.action:hover { border-color: var(--accent); }

/* ---------- Settings ---------- */
.settings { max-width: 680px; margin: 0 auto; }
.settings-head { margin-bottom: 16px; }
.group { margin-bottom: 16px; padding: 4px 20px 12px; }
.group h2 { margin: 16px 0 4px; }
.group-note { margin: 0 0 4px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.group h2 + .field, .group-note + .field { border-top: none; }
.field > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field small { color: var(--muted); font-size: 13px; }
.field.column { flex-direction: column; align-items: stretch; }
.field input[type="number"] { width: 90px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; text-align: right; }
.field select { flex-shrink: 0; }
.value { color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.seg { display: inline-flex; flex-shrink: 0; padding: 3px; gap: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.seg button small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button[aria-checked="true"] small { color: inherit; opacity: 0.85; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.export-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.export-actions button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; }
.export-actions small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .export-actions { grid-template-columns: 1fr; } }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg); }
a.button-like { text-decoration: none; flex-shrink: 0; }

@media (max-width: 640px) {
  .today { flex-direction: column; align-items: stretch; text-align: left; }
  .today .big { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .field { flex-direction: column; align-items: stretch; gap: 8px; }
  .field input[type="number"] { width: 100%; text-align: left; }
  .seg { align-self: flex-start; }
  .value { text-align: left; }
  .nav .sync { display: none; }
}
.today h1 { word-break: keep-all; }

/* Words looked up (settings) */
.look-table { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 14px; }
.look-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); }
.look-table td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.look-table tr:last-child td { border-bottom: none; }
.look-table .num { text-align: right; white-space: nowrap; }

/* Decks */
.decks-card { margin-top: 16px; }
.add-deck { color: var(--accent); cursor: pointer; }
.deck-list { list-style: none; padding: 0; margin: 8px 0 0; }
.deck { border-top: 1px solid var(--border); padding: 12px 0; }
.deck:first-child { border-top: none; }
.deck-main { display: flex; align-items: center; gap: 14px; }
.deck-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.deck-title { overflow-wrap: anywhere; }
.deck.paused .deck-title { color: var(--muted); }
.deck-actions { display: flex; gap: 6px; flex-shrink: 0; }
.deck-actions button { padding: 6px 12px; }
button.ghost { background: none; letter-spacing: 1px; }
button.danger { color: var(--danger); border-color: var(--danger); }
.deck-opts { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.check-list { display: grid; gap: 2px; }
.switch-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex-shrink: 0; color: var(--muted); }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.15s; flex-shrink: 0; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform 0.15s; }
.switch-row input:checked + .switch-ui { background: var(--accent); }
.switch-row input:checked + .switch-ui::after { transform: translateX(14px); }
.switch-row input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row input:checked ~ .small { color: var(--text); }
@media (max-width: 640px) {
  .deck-main { flex-wrap: wrap; }
  .deck-text { flex-basis: 100%; }
  .deck-actions { margin-left: auto; }
}
.deck-switches { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) { .deck-switches { flex-direction: row; gap: 14px; } }
.with-unit { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.with-unit input[type="number"] { width: 70px; }
@media (max-width: 640px) { .with-unit input[type="number"] { width: 100%; } .with-unit { width: 100%; } }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
@media (max-width: 640px) { .plan-actions { justify-content: flex-start; } }
.plans.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-width: 1000px; }
.plans.three + .center { margin-top: 14px; }

/* First sync after signing in: shown instead of the import steps until Drive answers. */
.syncing { display: flex; gap: 16px; align-items: center; }
.syncing[hidden] { display: none; }
.syncing h1 { margin: 0 0 4px; font-size: 20px; }
.syncing p { margin: 0; }
.spinner { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: kf-spin 0.9s linear infinite; }
@keyframes kf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Guest sign-in reminder */
.nudge { border: 1px solid var(--border); border-radius: 16px; padding: 24px; max-width: 420px; width: calc(100% - 32px); background: var(--bg); color: var(--text); text-align: center; }
.nudge::backdrop { background: rgba(10, 6, 30, 0.45); }
.nudge h2 { margin: 0 0 8px; }
.nudge p { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.nudge button { display: block; width: 100%; margin-top: 8px; }

/* Settings while not signed in */
.lock-card { display: grid; gap: 14px; margin-bottom: 16px; }
.lock-card .google-btn { width: 100%; padding: 12px 18px; }
.lock-card h2 { margin: 0 0 4px; }
.lock-card p { margin: 0; }
.settings.locked .group:not(.account-group) { opacity: 0.45; pointer-events: none; user-select: none; }

/* In the phone app: no website header (the app has its own top bar and tabs). */
.in-app header.top { display: none; }

/* Not signed in: save-your-progress card on the home page */
.save-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 16px; }
.save-card .save-text { flex: 1; display: grid; gap: 2px; }
.save-card .save-text b { font-size: 16px; }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 999px; padding: 10px 18px; font-weight: 600; white-space: nowrap; }
.google-btn:hover { border-color: #c4c7c5; background: #f8f9fa; }
@media (max-width: 560px) {
  .save-card { flex-direction: column; align-items: stretch; gap: 12px; }
  .google-btn { width: 100%; padding: 12px 18px; }
}

/* Pricing: yearly and monthly side by side */
.price-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 6px; }
.price-option { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 4px; background: var(--bg); }
.price-option.best { border: 2px solid var(--accent); }
.price-option .amount { font-size: 26px; font-weight: 800; }
.price-option .save { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: middle; }
.lang-warn { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg, rgba(240, 180, 60, .14)); font-size: 14px; }

/* ---------- Dapple's look (as the app's Premium sheet): the purple header card with soft
   dapples of light, white cards with a soft border, tinted stat tiles, pill buttons ---------- */
:root { --brand: #6d4aff; }
.logo { width: 30px; height: 30px; border-radius: 9px; font-size: 0; color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect width='512' height='512' rx='120' fill='%236D4AFF'/%3E%3Crect x='300' y='104' width='68' height='304' rx='34' fill='%23fff'/%3E%3Ccircle cx='226' cy='318' r='92' fill='none' stroke='%23fff' stroke-width='68'/%3E%3Ccircle cx='176' cy='148' r='34' fill='%23fff' fill-opacity='.6'/%3E%3C/svg%3E") center / cover; }
.card { background: var(--bg); border: 2px solid var(--border); border-radius: 18px; }
button, .button-like { border-radius: 999px; }
button.primary, .button-like.primary { box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
button.big { padding: 14px 26px; font-weight: 700; }

/* Today: the header card. */
.card.today { position: relative; overflow: hidden; background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 8px 24px rgba(109, 74, 255, .25); }
.card.today::before, .card.today::after { content: ""; position: absolute; border-radius: 50%; background: #fff; pointer-events: none; }
.card.today::before { width: 180px; height: 180px; right: -50px; top: -80px; opacity: .14; }
.card.today::after { width: 90px; height: 90px; right: 120px; bottom: -40px; opacity: .1; }
.card.today > * { position: relative; }
.card.today .eyebrow { color: rgba(255, 255, 255, .8); }
.card.today .muted { color: rgba(255, 255, 255, .86); }
.card.today .pill { background: rgba(255, 255, 255, .16); border-color: transparent; color: rgba(255, 255, 255, .9); }
.card.today .pill b { color: #fff; }
.card.today button.primary { background: #fff; color: var(--brand); border-color: #fff; box-shadow: 0 4px 14px rgba(20, 10, 60, .2); }
.card.today button.primary:disabled { opacity: .7; }

/* Stats: tinted tiles, numbers in the accent colour. */
.stat { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); border: 0; border-radius: 16px; }
.stat b { color: var(--accent); font-weight: 800; }
.eyebrow { font-weight: 750; }
.card.today { border: 0; }
.save-card { background: var(--bg); border: 2px solid var(--border); border-radius: 18px; }

/* ---------- Study tab, round two: a calmer header, lighter cards, icon rows ---------- */
.top { padding: 10px 16px; gap: 10px; background: var(--bg); position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.brand { font-size: 17px; font-weight: 800; gap: 10px; }
.nav { gap: 8px; }
/* The language: a pill. */
.lang-switch select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; font-weight: 700; font-size: 14px;
  padding: 8px 30px 8px 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg))
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236d4aff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 14px no-repeat; }
/* Home / Settings: one segmented control. */
#navHome, #navSettings { border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 650; color: var(--muted); background: none; }
#navHome[aria-current], #navSettings[aria-current] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
@media (max-width: 520px) {
  .brand { font-size: 0; gap: 0; }                 /* phones: just the logo */
  .nav .sync { display: none; }
  #navSettings { font-size: 0; padding: 8px 10px; } /* phones: the gear only */
  #navSettings svg { width: 20px; height: 20px; }
}
main { padding: 16px 16px 48px; }
h2 { font-size: 17px; font-weight: 800; }

/* Save your progress: an icon row with the sign-in button under it. */
.save-card { flex-wrap: wrap; gap: 12px 14px; padding: 16px; }
.save-card::before { content: ""; width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 18a5 5 0 0 1-.6-10A6 6 0 0 1 18 9a4.5 4.5 0 0 1-.5 9z' fill='none' stroke='%236d4aff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.save-card .save-text { min-width: 0; flex: 1; }
@media (max-width: 520px) { .save-card .google-btn { flex-basis: 100%; padding: 12px 18px; } }

/* Decks: each deck is a tinted tile. */
.deck-list { display: grid; gap: 10px; margin-top: 12px; }
.deck, .deck:first-child { border: 0; border-radius: 14px; padding: 14px; background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.deck-title { font-size: 15.5px; font-weight: 750; }
.deck-actions button { padding: 8px 16px; font-weight: 650; }
.add-deck { font-weight: 650; text-decoration: none; }

/* Shortcuts: rows with an icon and a chevron. */
.action { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; }
.action .action-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.action .action-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg)); color: var(--accent); }
.action::after { content: "›"; font-size: 22px; color: var(--muted); line-height: 1; }

/* Settings: section titles in the accent colour; locked settings stay readable. */
.settings-head h1 { font-size: 28px; font-weight: 800; }
.group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.field b { font-weight: 700; }
.settings.locked .group:not(.account-group) { opacity: 1; }
.settings.locked .group:not(.account-group):not(.open-group) :is(.seg, input, select, .switch-row, .chips) { opacity: .5; }
/* The language can change before sign-in (it's remembered in this browser), like the header's picker. */
.settings.locked .group.open-group { pointer-events: auto; user-select: auto; }
.seg { border: 0; border-radius: 999px; padding: 4px; background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.seg button { border-radius: 999px; padding: 7px 14px; }
.field input[type="number"], .field select, .field input[type="text"] { border: 2px solid var(--border); border-radius: 12px; padding: 8px 10px; }
.lock-card { background: color-mix(in srgb, var(--accent) 5%, var(--bg)); border-color: var(--accent); }
.save-card .save-text { flex: 1 1 0; min-width: 0; }
@media (max-width: 640px) { .save-card { flex-direction: row; align-items: center; } }

/* Premium promo (the same card as the app's home page). */

/* Premium: its own colours (purple into magenta), so it never reads as just another card. */
.promo { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none;
         background: linear-gradient(135deg, #6d4aff 0%, #b23ddb 100%); border-radius: 20px; padding: 16px 16px 16px 18px;
         box-shadow: 0 8px 22px rgba(160, 70, 230, .3); margin: 0 0 22px; border: 0; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.promo::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: #fff; opacity: .12; right: -30px; top: -50px; pointer-events: none; }
.promo .spark { width: 40px; height: 40px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 20px; }
.promo .txt { flex: 1; min-width: 0; display: grid; gap: 2px; position: relative; }
.promo b { font-size: 16px; }
.promo small { font-size: 13px; color: rgba(255, 255, 255, .88); }
.promo .go { position: relative; flex: none; background: #fff; color: #7a3fe8; font-weight: 750; font-size: 14px; padding: 9px 14px; border-radius: 999px; }
.promo { margin: 16px 0 0; }
.promo:hover { filter: brightness(1.05); }

/* Flashcards: the app's card look; a new card gets a soft accent edge, not a hard blue line. */
.flash { background: var(--bg); border: 2px solid var(--border); border-radius: 22px; box-shadow: 0 6px 20px rgba(20, 10, 60, .06); }
.flash.is-new { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.rate button { border-radius: 16px; border-width: 2px; }

.empty-promo { margin: 18px 0 6px; }
.empty-promo .promo { margin: 0; }

.promo .kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }
