/* Letteree Web — palette from the Flutter app (primary #FFC7C7, secondary #FFE2E2, dark #8785A2). */
:root {
  --bg: #fff7f6;
  --bg-accent: radial-gradient(1200px 500px at 85% -10%, #ffe2e2 0, transparent 60%), radial-gradient(900px 400px at -10% 10%, #f1eefe 0, transparent 55%);
  --surface: #ffffff;
  --surface-2: #fff1f1;
  --surface-3: #f6f4fb;
  --ink: #23202e;
  --muted: #6f6a7d;
  --line: #f0e3e4;
  --primary: #ffc7c7;
  --primary-strong: #f28b98;
  --primary-ink: #4a2730;
  --secondary: #ffe2e2;
  --violet: #8785a2;
  --violet-soft: #eceaf6;
  --ok: #2f9e74;
  --ok-soft: #e3f6ee;
  --bad: #d9505f;
  --bad-soft: #fde8ea;
  --warn: #d58a1d;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgb(35 32 46 / 4%), 0 8px 24px rgb(35 32 46 / 6%);
  --shadow-lg: 0 2px 6px rgb(35 32 46 / 6%), 0 24px 48px rgb(35 32 46 / 12%);
  --sidebar: 252px;
  --tabbar: 68px;
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Dark palette: follows the OS unless the theme toggle stored an explicit choice (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15131c;
    --bg-accent: radial-gradient(1200px 500px at 85% -10%, #3a2330 0, transparent 60%), radial-gradient(900px 400px at -10% 10%, #262340 0, transparent 55%);
    --surface: #201d2a;
    --surface-2: #2b2433;
    --surface-3: #262333;
    --ink: #f3eff6;
    --muted: #aaa3b8;
    --line: #342f40;
    --primary: #ff9fab;
    --primary-strong: #ff9fab;
    --primary-ink: #2a1319;
    --secondary: #3a2730;
    --violet: #a9a6c9;
    --violet-soft: #2e2b40;
    --ok: #5fd0a3; --ok-soft: #1f3a31;
    --bad: #ff8592; --bad-soft: #43242a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    --shadow-lg: 0 24px 48px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15131c;
  --bg-accent: radial-gradient(1200px 500px at 85% -10%, #3a2330 0, transparent 60%), radial-gradient(900px 400px at -10% 10%, #262340 0, transparent 55%);
  --surface: #201d2a;
  --surface-2: #2b2433;
  --surface-3: #262333;
  --ink: #f3eff6;
  --muted: #aaa3b8;
  --line: #342f40;
  --primary: #ff9fab;
  --primary-strong: #ff9fab;
  --primary-ink: #2a1319;
  --secondary: #3a2730;
  --violet: #a9a6c9;
  --violet-soft: #2e2b40;
  --ok: #5fd0a3; --ok-soft: #1f3a31;
  --bad: #ff8592; --bad-soft: #43242a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  --shadow-lg: 0 24px 48px rgb(0 0 0 / 45%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* No pinch/double-tap zoom and no pull-down-to-reload on mobile. */
html { -webkit-text-size-adjust: 100%; touch-action: pan-x pan-y; overscroll-behavior-y: none; }
body {
  overscroll-behavior-y: none; margin: 0; min-height: 100dvh; background: var(--bg); background-image: var(--bg-accent); background-attachment: fixed;
  color: var(--ink); font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.015em; color: var(--ink); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 10px; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-xl { width: 56px; height: 56px; stroke-width: 1.5; color: var(--primary-strong); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; justify-content: center; }
.text-link { color: var(--primary-strong); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--surface); border-radius: 10px; }
.skip-link:focus { top: 12px; }

/* ---------- layout ---------- */
.layout { min-height: 100dvh; }
.page { min-width: 0; overflow-x: clip; display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
.content { width: 100%; max-width: 800px; margin: 0 auto; padding: 8px 16px 32px; flex: 1; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 22px; font-weight: 750; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar p { margin: 0; color: var(--muted); font-size: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: block; width: 38px; height: 38px; border-radius: 12px; background: #fff; object-fit: contain; box-shadow: 0 6px 16px rgb(242 139 152 / 35%); }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 8px 16px 20px; color: var(--muted); font-size: 13px; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 0; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { margin: 0; font-size: 16px; font-weight: 650; }
.faq-item summary:hover h3, .faq-item summary:focus-visible h3 { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.faq-chevron { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.faq-item[open] .faq-chevron { transform: rotate(90deg); }
.faq-item p { margin: 0 0 16px; color: var(--muted); }
.footer-copyright { flex-basis: 100%; margin: 4px 0 0; text-align: center; font-size: 12px; }
.offline-banner { margin: 0 16px 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--violet-soft); color: var(--ink); font-size: 14px; text-align: center; }

.tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); 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: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tab-icon { position: relative; display: grid; place-items: center; width: 56px; height: 32px; border-radius: 16px; transition: background .2s; }
.tab-icon .icon { width: 22px; height: 22px; }
.tabbar a[aria-current] { color: var(--ink); font-weight: 700; }
.tabbar a[aria-current] .tab-icon { background: var(--secondary); color: var(--primary-strong); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.badge[hidden] { display: none; }
.tab-icon .badge { position: absolute; top: -4px; right: 6px; }

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 28px 18px;
    border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted); font-weight: 550; text-decoration: none; transition: background .15s, color .15s; }
  .side-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .side-nav a[aria-current] { background: var(--secondary); color: var(--ink); font-weight: 700; }
  .side-nav a[aria-current] .icon { color: var(--primary-strong); }
  .side-nav .badge { margin-left: auto; }
  .sidebar-foot { margin-top: auto; font-size: 13px; color: var(--muted); }
  .page { padding-bottom: 0; }
  /* Collapsible sidebar: an icon rail when collapsed (html[data-sidebar], remembered per browser). */
  .layout { transition: grid-template-columns .2s ease; }
  .sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .sidebar-toggle { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; color: var(--muted); }
  .sidebar-toggle:hover, .sidebar-toggle:focus-visible { color: var(--ink); }
  [data-sidebar="collapsed"] { --sidebar: 80px; }
  [data-sidebar="collapsed"] .sidebar { padding-inline: 12px; align-items: center; }
  [data-sidebar="collapsed"] .sidebar-head { flex-direction: column; gap: 14px; }
  [data-sidebar="collapsed"] .brand-name, [data-sidebar="collapsed"] .side-nav a > span,
  [data-sidebar="collapsed"] .free-card, [data-sidebar="collapsed"] .sidebar-foot p,
  [data-sidebar="collapsed"] .sidebar-foot .lang-menu summary span, [data-sidebar="collapsed"] .sidebar-foot .lang-menu summary::after { display: none; }
  [data-sidebar="collapsed"] .side-nav { align-self: stretch; }
  [data-sidebar="collapsed"] .side-nav a { position: relative; justify-content: center; padding: 11px 0; }
  [data-sidebar="collapsed"] .side-nav .badge { position: absolute; top: 2px; right: 4px; margin: 0; }
  [data-sidebar="collapsed"] .sidebar-foot .lang-menu summary { padding: 8px; }
  .tabbar, .brand-mobile { display: none; }
  .topbar { padding: 28px 32px 12px; }
  .topbar h1 { font-size: 30px; }
  .content { padding: 8px 32px 48px; }
  .site-footer { display: flex; gap: 8px; justify-content: center; padding: 24px; color: var(--muted); font-size: 13px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 14px; font: 600 16px/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s; color: var(--ink); background: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px rgb(242 139 152 / 28%); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, var(--primary-strong)); color: var(--primary-ink); }
.btn-soft { background: var(--secondary); color: var(--ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--secondary) 75%, var(--primary)); }
/* Save word: a filled star once saved. */
[data-save][aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--primary-strong); }
[data-save][aria-pressed="true"] .icon { fill: var(--primary-strong); stroke: var(--primary-strong); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-icon:hover { border-color: var(--primary); }
.btn-label { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.btn-label small { font-size: 12px; font-weight: 500; opacity: .75; }
.grow { flex: 1; }
.link-button { display: block; margin: 12px auto 0; padding: 8px 12px; border: 0; background: none; color: var(--muted); font: 500 15px var(--font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel p:last-child { margin-bottom: 0; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.notice { background: linear-gradient(135deg, var(--surface) 0, var(--surface-2) 100%); }
.section-title { font-size: 19px; font-weight: 750; margin: 26px 4px 12px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); }
.lead { font-size: 17px; }

.search-bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.search-bar:focus-within { border-color: var(--primary-strong); }
.search-bar > .icon { color: var(--muted); }
.search-bar input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 16px var(--font); padding: 8px 0; }
.search-bar .btn { min-height: 42px; }

.quick-start { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .quick-start { grid-template-columns: 1fr 1fr; } }
.feature-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--radius); text-decoration: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.feature-learn { background: linear-gradient(135deg, var(--secondary), var(--violet-soft)); border-color: transparent; }
.feature-card:hover, .list-card:hover, .word-tile:hover, .action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.feature-card img { width: 64px; height: 64px; object-fit: contain; }
.feature-card span { display: flex; flex-direction: column; }
.feature-card strong { font-size: 18px; }
.feature-card small { color: var(--muted); font-size: 14px; }
.feature-card .badge { position: absolute; top: 14px; right: 14px; }

.card-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.list-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.list-card img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.list-card > span:not(.topic-avatar) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-card strong { font-weight: 650; }
.list-card small { color: var(--muted); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chevron { color: var(--muted); }
.topic-avatar { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px; background: var(--violet-soft); color: var(--violet); font-weight: 800; font-size: 20px; }

/* ---------- word pages ---------- */
.word-hero { padding: 8px 4px 18px; }
.word-title { font-size: clamp(34px, 7vw, 48px); font-weight: 800; margin: 0; line-height: 1.1; }
.phonetic { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.rank-chip { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.card-word .rank-chip { font-size: 14px; }
.rank-avatar { font-size: 15px; letter-spacing: .02em; }
.word-hero .actions { margin-top: 16px; flex-wrap: nowrap; gap: 8px; }
/* Save / Note / Translate: one row, each button sized to its label; Translate always shows the short label (the full Google wording is its title). */
.word-hero .actions > .btn { flex: 1 1 auto; min-width: 0; padding-inline: 12px; gap: 6px; white-space: nowrap; }
.word-hero .actions > .btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.word-hero [data-translate] .tr-google { display: none; }
.word-hero [data-translate] .tr-inline { display: inline !important; }
@media (max-width: 379px) {
  .word-hero .actions { gap: 6px; }
  .word-hero .actions > .btn { padding-inline: 8px; gap: 5px; font-size: 15px; }
  .word-hero .actions > .btn .icon { width: 18px; height: 18px; }
}
.audio-error { font-size: 13px; color: var(--bad); }
.textarea, .file-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink); font: 16px var(--font); }
.textarea:focus { outline: 0; border-color: var(--primary-strong); }

.word-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 560px) { .word-grid { grid-template-columns: 1fr 1fr; } }
.word-tile { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.word-thumb { position: relative; flex-shrink: 0; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.word-thumb img { width: 100%; height: 100%; object-fit: cover; }
.word-thumb .media-fallback { font-size: 26px; }
.word-tile-text { display: flex; flex-direction: column; min-width: 0; }
.word-tile-text strong { font-size: 17px; }
.word-tile-text small { color: var(--muted); font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.segmented-nav { display: flex; gap: 6px; padding: 5px; margin: 6px 0 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.segmented-nav a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: 12px; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 15px; color: var(--muted); }
.segmented-nav a[aria-current] { background: var(--secondary); color: var(--ink); }

/* ---------- learning cards ---------- */
.card-stage { position: relative; }
.word-card { overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.card-media { position: relative; aspect-ratio: 16 / 10; max-height: 340px; width: 100%; background: linear-gradient(135deg, var(--secondary), var(--violet-soft)); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.media-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-size: clamp(30px, 8vw, 46px); font-weight: 800; color: var(--primary-strong); }
.media-fallback[hidden] { display: none; }
.card-label { position: absolute; left: 14px; bottom: 14px; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); font-size: 13px; font-weight: 700; color: var(--violet); }
.card-body { padding: 18px 20px 20px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card-word { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.15; }
.definition-text { margin: 0 0 10px; font-size: 18px; }
blockquote { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--primary); border-radius: 0 12px 12px 0; background: var(--surface-2); color: var(--muted); font-style: italic; font-size: 16px; }
.audio-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-3); color: var(--ink); font: 600 13px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--primary-strong); }
.chip[aria-pressed="true"] { background: var(--secondary); border-color: var(--primary-strong); }
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reader-tools .chip { text-decoration: none; }
[data-speak], .tr-inline { display: none !important; }
.reader-speak [data-speak] { display: inline-flex !important; }
.reader-translate [data-translate] .tr-inline { display: inline !important; }
.reader-translate [data-translate] .tr-google { display: none; }
.translation { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--violet-soft); color: var(--ink); font-size: 16px; }
.translation p { margin: 0; }
.translation .translation-example { margin-top: 6px; color: var(--muted); font-style: italic; }
.translation.is-error { background: var(--bad-soft); }
[data-translate][aria-busy="true"] { opacity: .6; pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: var(--line); cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-selected="true"] { width: 22px; background: var(--primary-strong); }

.swipe-card { position: relative; touch-action: pan-y; transition: transform .25s ease, opacity .25s ease; animation: card-in .3s ease; }
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card[data-lean="left"] .word-card { box-shadow: 0 0 0 3px var(--primary), var(--shadow-lg); }
.swipe-card[data-lean="right"] .word-card { box-shadow: 0 0 0 3px var(--ok), var(--shadow-lg); }
.swipe-card.fly-left { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.swipe-card.fly-right { transform: translateX(120%) rotate(12deg); opacity: 0; }
@keyframes card-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.card-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.hint { margin-top: 14px; text-align: center; color: var(--muted); font-size: 14px; }

.session-progress { margin: 0 0 16px; }
.session-progress-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-weight: 650; font-size: 15px; }
.goal-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font-size: 13px; font-weight: 600; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); transition: width .4s ease; }

.challenge { overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.challenge .card-media { aspect-ratio: 16 / 9; max-height: 260px; }
.question { margin: 14px 0 0; text-align: center; font-weight: 700; color: var(--muted); }
.find-meaning-word { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 8px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option { min-height: 58px; padding: 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-3); color: var(--ink); font: 650 17px/1.3 var(--font); cursor: pointer; transition: border-color .15s, background .15s, transform .12s; }
.option:hover:not(:disabled) { border-color: var(--primary-strong); background: var(--surface-2); }
.option:active:not(:disabled) { transform: scale(.98); }
.option-meaning { font-size: 14.5px; font-weight: 500; text-align: left; line-height: 1.4; }
.option:disabled { cursor: default; opacity: .65; }
.option.is-correct { opacity: 1; border-color: var(--ok); background: var(--ok-soft); }
.option.is-wrong { opacity: 1; border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 420px) { .option-meaning { grid-column: span 2; } .options:has(.option-meaning) { grid-template-columns: 1fr; } }
.hint-box { margin: 10px auto 0; max-width: 520px; text-align: center; }
.hint-box summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--violet); font-weight: 600; font-size: 15px; list-style: none; }
.hint-box summary::-webkit-details-marker { display: none; }
.hint-box p { margin: 8px 0 0; color: var(--muted); font-style: italic; }
.result { margin: 0 20px 20px; padding: 16px; border-radius: 16px; animation: card-in .25s ease; }
.result.ok { background: var(--ok-soft); }
.result.bad { background: var(--bad-soft); }
.result-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-weight: 800; font-size: 18px; }
.result.ok .result-title { color: var(--ok); }
.result.bad .result-title { color: var(--bad); }
.result blockquote { background: color-mix(in srgb, var(--surface) 60%, transparent); }

/* ---------- dashboard ---------- */
.hero-card { display: flex; align-items: center; gap: 20px; padding: 22px; margin-bottom: 16px; border-radius: 24px; background: linear-gradient(135deg, var(--secondary) 0, var(--violet-soft) 100%); box-shadow: var(--shadow); }
.hero-card h2 { margin: 0; font-size: 21px; font-weight: 750; }
.ring { --pct: 0; flex-shrink: 0; display: grid; place-items: center; align-content: center; width: 104px; height: 104px; border-radius: 50%; background: radial-gradient(closest-side, var(--surface) 78%, transparent 79%), conic-gradient(var(--primary-strong) calc(var(--pct) * 1%), color-mix(in srgb, var(--surface) 55%, transparent) 0); }
.ring strong { font-size: 28px; line-height: 1; font-weight: 800; }
.ring small { color: var(--muted); font-size: 13px; }
.streak { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--warn); font-weight: 650; font-size: 15px; }
.tile-list { display: grid; gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .tile-list { grid-template-columns: repeat(3, 1fr); } .action-tile { flex-direction: column; align-items: flex-start; } .action-tile .tile-count, .action-tile .chevron { position: absolute; top: 16px; right: 16px; } }
.action-tile { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.action-tile.is-hot { border-color: var(--primary); background: linear-gradient(160deg, var(--surface) 30%, var(--surface-2)); }
.tile-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--secondary); color: var(--primary-strong); flex-shrink: 0; }
.tile-icon .icon { width: 24px; height: 24px; }
.tile-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tile-text strong { font-size: 17px; }
.tile-text small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.tile-count { min-width: 40px; padding: 4px 12px; border-radius: 999px; background: var(--surface-3); font-weight: 800; text-align: center; }
.is-hot .tile-count { background: var(--primary); color: var(--primary-ink); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid.four { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 560px) { .stat-grid.four { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 16px; background: var(--surface-3); text-decoration: none; text-align: center; }
.stat strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.c-new strong { color: var(--violet); }
.stat.c-ok strong { color: var(--ok); }
.stat.c-bad strong { color: var(--bad); }
.stat.c-known strong { color: var(--primary-strong); }

.mini-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 8px; height: 120px; }
.mini-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.mini-fill { width: 100%; max-width: 34px; min-height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--primary-strong), var(--primary)); }
.mini-value { font-size: 12px; font-weight: 700; }
.mini-bar small, .chart-col small { color: var(--muted); font-size: 12px; }

.chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 180px; margin-top: 30px; border-bottom: 1px solid var(--line); }
.chart-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.chart-col small { position: relative; top: 22px; }
.chart-stack { display: flex; flex-direction: column-reverse; width: 100%; max-width: 36px; height: 100%; justify-content: flex-start; }
.seg { display: block; width: 100%; }
.seg.c-new { background: var(--violet); border-radius: 0; }
.seg.c-ok { background: var(--ok); }
.seg.c-bad { background: var(--bad); }
.chart-stack .seg:last-child { border-radius: 8px 8px 0 0; }
.chart-goal { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--primary-strong); font-size: 11px; color: var(--primary-strong); font-weight: 700; text-align: right; line-height: 1.6; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; font-size: 13px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: currentColor; vertical-align: -1px; }
.legend .c-new { color: var(--violet); } .legend .c-ok { color: var(--ok); } .legend .c-bad { color: var(--bad); }

/* ---------- progress panel, lists, settings ---------- */
.progress-panel { padding: 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.progress-head .menu-list { bottom: auto; top: calc(100% + 8px); }
.progress-status { display: flex; flex-direction: column; gap: 6px; }
.progress-panel .card-actions { margin-top: 12px; }
/* Word detail: the progress panel docks to the bottom of the screen (in place of the tabbar on small
   screens, beside the sidebar on wide ones). app.js measures the dock and writes its height into
   --tabbar so page padding follows. */
body.has-word-dock { --tabbar: 132px; }
body.has-word-dock .tabbar { display: none; }
body.has-word-dock .learn-root[data-learn="word"] {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 8px 16px max(12px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgb(35 32 46 / 6%);
}
body.has-word-dock .learn-root[data-learn="word"] > * { max-width: 768px; margin: 0 auto; }
body.has-word-dock .learn-root[data-learn="word"] .skeleton { height: 48px; margin-bottom: 0; }
/* A small status note on top, then one row: primary action · ⋮ menu. The "Your progress" eyebrow stays for screen readers only. */
body.has-word-dock .progress-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0; margin-bottom: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
body.has-word-dock .progress-head { display: contents; }
body.has-word-dock .progress-status { order: 1; flex: 1 0 100%; min-width: 0; }
body.has-word-dock .progress-panel:not(:has(.card-actions)) .progress-status { flex-basis: 0; }
body.has-word-dock .progress-status .eyebrow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.has-word-dock .progress-status .status-chip { padding: 0; background: none; font-size: 13px; font-weight: 600; color: var(--muted); }
body.has-word-dock .progress-status .status-chip.ok { color: var(--ok); }
body.has-word-dock .progress-status .status-chip.hot { color: var(--bad); }
body.has-word-dock .progress-status .status-chip.info { color: var(--violet); }
body.has-word-dock .progress-status .status-chip .icon { width: 15px; height: 15px; flex: none; }
body.has-word-dock .progress-panel .card-actions { order: 2; flex: 1 1 0; min-width: 0; margin-top: 0; }
body.has-word-dock .progress-panel .card-actions .btn { min-height: 44px; padding-inline: 14px; white-space: nowrap; }
body.has-word-dock .progress-panel .card-actions .btn small { display: none; }
body.has-word-dock .progress-panel .card-actions .btn-label { overflow: hidden; text-overflow: ellipsis; }
body.has-word-dock .progress-head > :not(.progress-status) { order: 3; flex: none; position: relative; }
body.has-word-dock .progress-head .menu-list { top: auto; bottom: calc(100% + 8px); }
@media (min-width: 960px) {
  body.has-word-dock .learn-root[data-learn="word"] { left: var(--sidebar); padding-inline: 32px; }
  body.has-word-dock .page { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
}
.status-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface-3); font-size: 14px; font-weight: 650; }
.status-chip.ok { background: var(--ok-soft); color: var(--ok); }
.status-chip.hot { background: var(--bad-soft); color: var(--bad); }
.status-chip.info { background: var(--violet-soft); color: var(--violet); }
.setting + .setting { margin-top: 22px; }
.setting h3 { font-size: 16px; margin: 0 0 10px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); }
.segmented label, .segmented a { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span, .segmented a { display: block; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none; }
.segmented input:checked + span, .segmented a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid var(--violet); }

.menu { position: relative; }
.menu-list { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 40; min-width: 230px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: card-in .15s ease; }
.menu-list[hidden] { display: none; }
.menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 550 15px var(--font); text-align: left; cursor: pointer; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface-2); }
.menu-list button.danger { color: var(--bad); }

.sheet { width: min(420px, calc(100% - 32px)); padding: 22px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.sheet::backdrop { background: rgb(20 16 28 / 45%); backdrop-filter: blur(3px); }
.sheet-title { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; font-weight: 650; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast { position: fixed; z-index: 60; right: 16px; top: calc(16px + env(safe-area-inset-top)); transform: translateY(-20px); display: flex; align-items: center; gap: 14px; max-width: min(420px, calc(100% - 32px)); padding: 10px 8px 10px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-message { flex: 1; min-width: 0; }
.toast a { color: var(--primary); font-weight: 700; text-decoration: none; white-space: nowrap; }
.toast-undo { flex: none; padding: 4px 6px; border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.toast-undo:hover, .toast-undo:focus-visible { text-decoration: underline; }
.toast-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-left: -4px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; opacity: .7; cursor: pointer; }
.toast-close:hover, .toast-close:focus-visible { opacity: 1; background: color-mix(in srgb, var(--bg) 14%, transparent); }
.toast-close .icon { width: 18px; height: 18px; }
@media (min-width: 960px) { .toast { top: 24px; right: 24px; } }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 20px; border-radius: 24px; background: var(--surface); border: 1px dashed var(--line); text-align: center; }
/* Card mode on small screens: the tabbar stays, the footer goes, and the session card stretches to fill
   the remaining height. Extra space goes to the card image; taller content scrolls as usual. */
@media (max-width: 959px) {
  body.card-mode .site-footer { display: none; }
  body.card-mode .content { display: flex; flex-direction: column; padding-bottom: 14px; }
  body.card-mode .hint { margin-bottom: 0; }
  body.card-mode #storage-status:empty { display: none; }
  body.card-mode .learn-root, body.card-mode .card-stage, body.card-mode .swipe-card,
  body.card-mode .swipe-card > .word-card, body.card-mode .challenge > :first-child { flex: 1 0 auto; display: flex; flex-direction: column; }
  body.card-mode .learn-root > .skeleton { flex: 1; min-height: 260px; }
  body.card-mode .swipe-card .card-media { flex: 1 1 200px; aspect-ratio: auto; min-height: 200px; max-height: none; }
  body.card-mode .swipe-card .card-media img { position: absolute; inset: 0; }
  body.card-mode .swipe-card .card-body { flex: none; } /* Bootstrap gives .card-body flex: 1 1 auto */
  body.card-mode .challenge > .card-body:first-child { flex: 1 0 auto; justify-content: center; }
}
.empty-state h2 { font-size: 21px; margin: 0 0 6px; }
.empty-state p { margin: 0 0 4px; color: var(--muted); }
.empty-state .actions { margin-top: 8px; }
.skeleton { height: 260px; border-radius: 24px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; border: 1px solid var(--line); }
.learn-root:not([aria-busy]) > .skeleton { display: none; }
.skeleton { display: grid; place-items: center; }

/* Loading spinner: in page skeletons, while a session fetches its next card, and in pull-to-refresh. */
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid color-mix(in srgb, var(--primary-strong) 22%, transparent); border-top-color: var(--primary-strong); border-radius: 50%; animation: spin .8s linear infinite; }
.skeleton .spinner { width: 24px; height: 24px; }
.card-loading { flex: 1 0 auto; display: grid; place-items: center; min-height: 260px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pull to refresh (pages.js): a round chip slides down from the top while the main content is pulled;
   past the threshold it turns solid and spins, then the page reloads. */
.ptr { position: fixed; z-index: 50; left: 50%; top: env(safe-area-inset-top, 0px); display: grid; place-items: center; width: 42px; height: 42px; margin-left: -21px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); pointer-events: none; opacity: 0; transform: translateY(-50px); }
.ptr.is-settling { transition: transform .2s ease, opacity .2s ease; }
.ptr .spinner { width: 22px; height: 22px; animation: none; border-width: 2.5px; }
.ptr.is-ready .spinner { border-color: var(--primary-strong); border-top-color: transparent; }
.ptr.is-loading .spinner { border-color: color-mix(in srgb, var(--primary-strong) 22%, transparent); border-top-color: var(--primary-strong); animation: spin .8s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.learn-root[data-learn="word"] .skeleton, .learn-root[data-learn="lists"] .skeleton, .learn-root[data-learn="settings"] .skeleton { height: 96px; margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* Loading spinners keep turning (slowly): they are the only sign that something is happening. */
  .spinner { animation-duration: 1.6s !important; }
}

/* ---------- topic header ---------- */
.topic-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 14px; color: var(--muted); font-weight: 600; font-size: 15px; line-height: 1.4; min-height: 1.4em; } /* keeps its row while counts load, so the tabs below do not move */
.topic-meta [data-topic-explored]:not(:empty)::before { content: "·"; margin-right: 14px; }

/* ---------- swipeable definition carousel ---------- */
/* The track runs the full width of the page area (beside the sidebar on desktop): the current card is centred
   and the cards on either side peek in, faded, so the eye stays on the middle one. */
/* The current card is exactly as wide as the other sections (.content: max 800px, side padding 10/16/32px). */
.carousel { --page-w: 100vw; --pad: 16px; --slide-gap: 8px; --slide-w: calc(min(800px, var(--page-w)) - 2 * var(--pad)); margin-bottom: 18px; }
@media (max-width: 599px) { .carousel { --pad: 10px; --slide-gap: 5px; } }
@media (min-width: 960px) { .carousel { --page-w: calc(100vw - var(--sidebar)); --pad: 32px; --slide-gap: 18px; } }
.carousel-track {
  position: relative; display: flex; gap: var(--slide-gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab;
  margin-inline: calc(50% - var(--page-w) / 2); padding: 4px calc((var(--page-w) - var(--slide-w)) / 2); scroll-padding-inline: calc((var(--page-w) - var(--slide-w)) / 2);
}
.carousel-track:has(> :only-child) { margin-inline: 0; padding-inline: 0; }
.carousel-track > :only-child { flex-basis: 100%; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.carousel-track:focus-visible { outline-offset: 4px; }
.definition-card { flex: 0 0 var(--slide-w); scroll-snap-align: center; box-shadow: none; transition: opacity .3s ease, transform .3s ease; }
.carousel.is-ready .definition-card:not(.is-current) { opacity: .4; transform: scale(.94); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .definition-card { transition: none; } }
.carousel-track .card-media img { pointer-events: none; }
.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.carousel-controls .btn-icon:disabled { opacity: .35; cursor: default; }
.carousel-controls .dots { margin: 0; }
.dots button[aria-current="true"] { width: 22px; background: var(--primary-strong); }
.chip-audio { position: relative; z-index: 2; padding: 7px; }
.chip-audio .icon { width: 18px; height: 18px; }
.word-tile .audio-row { margin-left: auto; flex-shrink: 0; flex-wrap: nowrap; }
/* Server-rendered pages print both accents; show the one chosen in Settings (US by default), or whichever exists. */
html:not([data-accent="uk"]) .audio-row > .chip-audio[data-accent="uk"]:not(:only-child),
html[data-accent="uk"] .audio-row > .chip-audio[data-accent="us"]:not(:only-child) { display: none; }
.stretched { text-decoration: none; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
mark { padding: 0 2px; border-radius: 4px; background: var(--secondary); color: inherit; font-weight: 650; }

/* ---------- word detail sections ---------- */
.detail-section p { margin: 0 0 10px; }
.synonym-panel { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-3); }
.chip[aria-selected="true"] { background: var(--secondary); border-color: var(--primary-strong); }
.video-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm); background: #000; margin-bottom: 12px; }
.video-frame iframe, .video-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { padding: 0; cursor: pointer; background: #000; }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .2s; }
.video-play:hover img { opacity: 1; }
.play-badge { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 68px; height: 48px; transform: translate(-50%, -50%); border-radius: 14px; background: rgb(255 0 0 / 88%); }
.play-badge svg { width: 26px; height: 26px; fill: #fff; }
.transcript { color: var(--muted); font-style: italic; }
.quote-card { position: relative; margin: 0 0 16px; padding: 22px 22px 18px 58px; background: linear-gradient(135deg, var(--surface), var(--violet-soft)); }
.quote-mark { position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; fill: var(--primary-strong); }
.quote-card blockquote { margin: 0 0 10px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 18px; font-style: normal; line-height: 1.5; }
.quote-card figcaption { color: var(--muted); font-size: 14px; }

/* ---------- CSV import preview ---------- */
.csv-guide { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.csv-guide summary { cursor: pointer; font-weight: 650; }
.csv-guide dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; }
.csv-guide dt { font-weight: 400; }
.csv-guide dd { margin: 0; }
.csv-guide code { color: var(--primary-strong); }
.csv-guide p { margin: 0; }
@media (max-width: 480px) { .csv-guide dl { grid-template-columns: 1fr; gap: 2px; } .csv-guide dd { margin-bottom: 6px; } }
.import-preview { margin-top: 16px; }
.import-preview:empty { display: none; }
.preview-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.preview-list li { padding: 8px 12px; border-radius: 10px; background: var(--surface-3); font-size: 15px; }
.preview-list li.ok { background: var(--ok-soft); }
.preview-list li.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.error-list { margin: 8px 0 14px; font-size: 14px; color: var(--bad); }
.error-list summary { cursor: pointer; font-weight: 650; }
.error-list ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.import-preview .result { margin: 0; }
.conflict-sheet { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); flex-direction: column; }
.conflict-sheet[open] { display: flex; }
.conflict-sheet .sheet-title { margin-bottom: 6px; }
.conflict-all { margin: 10px 0; }
.conflict-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; overflow-y: auto; min-height: 0; }
.conflict-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.conflict-word { margin: 0 0 8px; font-weight: 650; overflow-wrap: anywhere; }
.conflict-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.conflict-choice { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 14px; }
.conflict-choice:has(input:checked) { background: var(--violet-soft); outline: 2px solid var(--primary); }
.conflict-choice input { margin-top: 3px; accent-color: var(--primary); }
.conflict-side { display: grid; gap: 2px; min-width: 0; }
.conflict-label { font-weight: 650; }
.conflict-note { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 480px) { .conflict-sides { grid-template-columns: 1fr; } }

/* ---------- free-resource message ---------- */
.free-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, var(--secondary), var(--violet-soft)); text-decoration: none; color: var(--ink); }
.free-card .icon { color: var(--primary-strong); margin-top: 2px; }
.free-card span { display: flex; flex-direction: column; }
.free-card strong { font-size: 14px; }
.free-card small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.free-strip { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 650; font-size: 14.5px; text-decoration: none; }
.free-strip span { flex: 1; }
.free-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 14px; }
.free-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: var(--ok); font-weight: 650; font-size: 14.5px; }

/* ---------- about ---------- */
.about-hero { padding: 26px 24px; margin-bottom: 16px; border-radius: 28px; background: linear-gradient(135deg, var(--secondary) 0, var(--violet-soft) 100%); box-shadow: var(--shadow); }
.about-hero h2 { margin: 14px 0 10px; font-size: clamp(28px, 5vw, 40px); font-weight: 800; line-height: 1.15; }
.about-hero .lead { max-width: 60ch; color: var(--ink); opacity: .85; }
.about-hero .actions { margin-top: 18px; }
.lang-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.lang-switch a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s; }
.lang-switch a:hover, .lang-switch a:focus-visible { background: var(--surface); border-color: var(--primary); }
.lang-switch a[aria-current="true"] { background: var(--surface); border-color: var(--primary-strong); box-shadow: 0 0 0 1px var(--primary-strong); }
.lang-flag { font-size: 18px; line-height: 1; }
.promise-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
@media (min-width: 900px) { .promise-grid { grid-template-columns: repeat(4, 1fr); } }
.promise { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.promise h3 { margin: 12px 0 4px; font-size: 16px; font-weight: 750; }
.promise p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.about-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .about-stats { grid-template-columns: repeat(3, 1fr); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-number { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; }
.steps h3 { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: 16px; }
.steps p { margin: 0; color: var(--muted); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 700px) { .check-list { grid-template-columns: 1fr 1fr; } }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--ok); margin-top: 3px; }
.cta-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 20px; margin-bottom: 16px; border-radius: 28px; background: var(--ink); color: var(--bg); text-align: center; }
.cta-card h2 { margin: 0; color: var(--bg); font-size: 22px; }
.prose p { max-width: 70ch; }

/* ---------- 404 ---------- */
.notfound { max-width: 640px; margin: 8px auto 0; text-align: center; }
.notfound-art { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 8px 0 18px; font-size: 96px; font-weight: 800; line-height: 1; color: var(--primary-strong); letter-spacing: -0.04em; }
.notfound-art .brand-mark { width: 84px; height: 84px; border-radius: 26px; font-size: 44px; animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-4px); } }
.notfound h2 { margin: 0 0 8px; font-size: 26px; font-weight: 800; }
.notfound .search-bar { margin: 20px 0 22px; text-align: left; }
.notfound .card-grid { text-align: left; }
.notfound .list-card > .tile-icon { flex: 0 0 40px; width: 40px; height: 40px; }

/* ---------- language menu ---------- */
.lang-menu { position: relative; display: inline-block; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: "▾"; font-size: 11px; color: var(--muted); }
.lang-list { position: absolute; left: 0; z-index: 50; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.lang-up .lang-list { bottom: calc(100% + 6px); }
.lang-footer .lang-list { left: 50%; transform: translateX(-50%); }
.lang-list a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; }
.lang-list a:hover, .lang-list a:focus-visible { background: var(--surface-2); }
.lang-list a[aria-current="true"] { background: var(--secondary); font-weight: 700; }
.site-footer .lang-menu summary { padding: 4px 10px; font-size: 13px; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Personal notes and custom cards */
.note-panel { border-color: color-mix(in srgb, var(--primary) 60%, var(--line)); background: linear-gradient(160deg, var(--surface) 40%, var(--surface-2)); }
.note-panel[hidden] { display: none; }
.note-panel .textarea { resize: vertical; min-height: 96px; }
.btn.has-note { position: relative; }
.btn.has-note::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-strong); }
.btn[data-note-open][aria-expanded="true"] { background: color-mix(in srgb, var(--secondary) 75%, var(--primary)); }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-head .panel-title { margin: 0; }
.note-panel .note-text { margin: 12px 0 0; font-size: 17px; }
.note-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; animation: slide-down .22s ease; transform-origin: top; }
.note-form[hidden] { display: none; }
.note-form .small { margin: 0; }
.note-actions { justify-content: flex-end; }
.note-panel [data-note-status]:empty { display: none; }
.note-panel [data-note-status] { margin: 8px 0 0; }
.btn-sm { padding: 6px 12px; font-size: 14px; min-height: 0; }
.btn-sm .icon { width: 16px; height: 16px; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-6px) scaleY(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .note-form { animation: none; } }
.note-block { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--primary-strong) 45%, var(--line)); margin-bottom: 10px; }
.note-eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--primary-strong); }
.note-eyebrow .icon { width: 16px; height: 16px; }
.note-block.is-collapsible .note-eyebrow { justify-content: space-between; margin: 0; }
.note-block.is-collapsible .note-text { margin-top: 8px; }
.note-eyebrow-label { display: inline-flex; align-items: center; gap: 6px; }
.note-toggle { display: inline-flex; align-items: center; gap: 4px; margin: -6px -8px -6px 0; padding: 6px 8px; text-decoration: none; color: var(--primary-strong); font-weight: 600; font-size: 14px; text-transform: none; letter-spacing: 0; }
.note-toggle .icon { width: 18px; height: 18px; transform: rotate(90deg); transition: transform .2s; }
.note-toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.result .note-block { text-align: left; }
.card-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.card-pager .dots { margin: 0; }
.card-pager .link-button { display: inline-flex; align-items: center; gap: 4px; margin: 0; text-decoration: none; color: var(--primary-strong); font-weight: 600; }
.card-pager .link-button .icon { width: 18px; height: 18px; }
/* Saved page toolbar: count · Add all to learn · Knew all · Add card (own line first on phones). */
.saved-toolbar { margin-top: 0; }
.saved-toolbar > .btn-primary { margin-left: 4px; }
@media (max-width: 559px) { .bulk-actions.saved-toolbar > .btn-primary { order: -1; flex: 1 0 100%; margin: 0 0 2px; } }
.show-more { justify-content: center; margin-top: 12px; }
.show-more:empty { display: none; }
.recent-row .section-head { margin-top: 4px; margin-bottom: 8px; }
.recent-row + .recent-row .section-head { margin-top: 18px; }
.recent { margin-bottom: 8px; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: var(--secondary); color: inherit; text-decoration: none; font-size: 14px; font-weight: 600; }
.recent-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-chip .icon { width: 16px; height: 16px; flex: none; opacity: .7; }
.recent-chip:hover { filter: brightness(.96); }
.vocab-sort { margin: -4px 4px 12px; }
/* Search: the learner's own matches sit above the dictionary results with a clear gap. */
.learn-root[data-learn="searchlocal"]:not(:empty) { margin-bottom: 28px; }
.learn-root[data-learn="searchlocal"] > .section-head:first-child { margin-top: 4px; }
.section-head.search-dict-head { display: none; margin-top: 0; }
.learn-root[data-learn="searchlocal"]:not(:empty):not([aria-busy]) + .section-head.search-dict-head { display: flex; }
.segmented-sm span { padding: 5px 12px; font-size: 14px; }
.word-tile.is-custom { border-style: dashed; border-color: color-mix(in srgb, var(--primary-strong) 45%, var(--line)); }
.word-tile.is-custom .media-fallback .icon { width: 28px; height: 28px; }
.tile-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tile-note { display: flex; gap: 4px; align-items: flex-start; }
.word-tile-text small.tile-note { display: -webkit-box; }
.tile-note .icon { width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px; margin-right: 4px; color: var(--primary-strong); }
.card-sheet { width: min(480px, calc(100% - 32px)); }
.card-form { display: flex; flex-direction: column; gap: 8px; }
.card-form .sheet-title { margin-bottom: 8px; }
.field-label { font-weight: 650; font-size: 14px; }
.form-error { margin: 0; color: var(--bad); font-size: 14px; }
.form-error[hidden] { display: none; }
.danger-text { color: var(--bad); }
/* Settings → Delete data: one row per action (title + what it removes, button on the right). */
.erase-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.erase-row + .erase-row { border-top: 1px solid var(--line); }
.erase-row p { margin: 4px 0 0; font-size: 14px; }
.erase-row .btn { flex: none; }
.cache-row { margin-top: 16px; border-top: 1px solid var(--line); padding-bottom: 0; }
@media (max-width: 520px) { .erase-row { flex-direction: column; align-items: stretch; } }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--bad); }
.sheet-form .card-form { margin-bottom: 18px; }
.text-primary { color: var(--primary-strong) !important; }

/* Account: sign in / register / change PIN */
.auth-form .segmented { align-self: flex-start; margin-bottom: 6px; }
.pin-input { letter-spacing: .35em; font-variant-numeric: tabular-nums; max-width: 14ch; }
.sync-status { color: var(--muted); margin: 0 0 12px; }

/* ---------- word tiles: progress badge and quick actions ---------- */
/* Thumb and text on top; a footer row with the progress badge on the left, pronunciation and quick actions on the right. */
.word-tile[data-word-tile] { flex-wrap: wrap; row-gap: 10px; }
.word-tile[data-word-tile] > .word-tile-text { flex: 1; }
.tile-footer { flex-basis: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.tile-footer:not(:has(.chip-audio, .btn-tile, .learn-badge)) { display: none; }
.tile-footer .audio-row { margin-left: 0; }
.word-tile .tile-actions { display: flex; gap: 6px; position: relative; z-index: 2; }
.word-tile .tile-actions:empty { display: none; }
.btn-tile { width: 36px; min-height: 36px; }
.btn-tile .icon { width: 18px; height: 18px; }
.btn-tile:hover { background: var(--secondary); color: var(--primary-strong); }
.tile-progress:empty { display: none; }
.tile-progress { display: flex; min-width: 0; margin-right: auto; }
.learn-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-badge .icon { width: 13px; height: 13px; flex: none; }
.learn-badge-bar { flex: none; width: 28px; height: 5px; border-radius: 3px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.learn-badge-bar > span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: currentColor; }
.learn-badge.is-new { background: var(--secondary); color: var(--primary-strong); }
.learn-badge.is-learning { background: var(--violet-soft); color: var(--violet); }
.learn-badge.is-due { background: var(--bad-soft); color: var(--bad); }
.learn-badge.is-mastered { background: var(--ok-soft); color: var(--ok); }

/* Topic Browse: act on every word of the page at once. */
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 14px; }
.bulk-actions[hidden] { display: none; }
/* Paired action buttons stay one line and the same width in every language; long labels end in an ellipsis. */
.bulk-actions .btn, .card-actions .grow { min-width: 0; white-space: nowrap; }
.bulk-actions .btn > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Card buttons keep their two-line label (text, then a small note such as the next review date); each line ends in an ellipsis if too long. */
.card-actions .grow .btn-label { min-width: 0; max-width: 100%; }
.card-actions .grow .btn-label > * { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.card-actions .grow { flex: 1 1 0; }
.bulk-actions > span { margin-right: auto; }
@media (max-width: 559px) { .bulk-actions > span { flex-basis: 100%; } .bulk-actions .btn { flex: 1 1 0; } }

/* Topbar sound toggle: off stops automatic pronunciation; sound buttons still play on tap. */
.sound-toggle .sound-off, [data-sound="off"] .sound-toggle .sound-on { display: none; }
[data-sound="off"] .sound-toggle .sound-off { display: inline; }
[data-sound="off"] .sound-toggle { color: var(--muted); }

/* Five tabs on small phones. */
@media (max-width: 380px) { .tab-icon { width: 48px; } .tabbar a { font-size: 11px; } }

/* ---------- Account: personal lists as topic cards ---------- */
.list-avatar .icon { width: 24px; height: 24px; }
.list-avatar.is-learning { background: var(--secondary); color: var(--primary-strong); }
.list-avatar.is-known { background: color-mix(in srgb, #2fa36b 16%, transparent); color: #2fa36b; }
.list-avatar.is-ignored { background: var(--surface-3); color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 4px 12px; }
.section-head .section-title { margin: 0; }
.learn-root[data-learn="lists"] .section-head { margin-top: 4px; }
.learn-root[data-learn="lists"] { margin-bottom: 18px; }
.account-links { margin-top: 16px; }

/* Account, signed out: progress lives only in this browser. */
.guest-warning { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); }
.guest-warning > .icon { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--warn); }
.guest-warning strong { display: block; margin-bottom: 4px; }
.guest-warning p { margin: 0 0 10px; color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.guest-warning p:last-child { margin-bottom: 0; }
/* Settings shortcut in the Account page header; the desktop sidebar already links to Settings. */
@media (min-width: 960px) { .topbar-settings { display: none; } }

/* Installable app (PWA): footer button and install sheet (assets/js/install.js) */
.footer-install { display: inline-flex; gap: 8px; align-items: center; }
.footer-install[hidden] { display: none; }
.footer-link { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.footer-link:hover, .footer-link:focus-visible { color: var(--ink); }
.footer-link .icon { width: 15px; height: 15px; }
.install-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.install-head .brand-mark { width: 48px; height: 48px; }
.install-head .sheet-title { margin: 0; font-size: 18px; }
.install-ios { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.install-ios[hidden] { display: none; }
.install-sheet [data-install-confirm] { display: inline-flex; align-items: center; gap: 6px; }
.install-sheet [data-install-confirm][hidden] { display: none; }

/* Compact layout on phones, on every page: trim the chrome (header, tabs, progress, panels, padding)
   so the content gets the room. */
@media (max-width: 599px) {
  .topbar { padding: max(6px, env(safe-area-inset-top)) 12px 6px; gap: 8px; }
  .topbar h1 { font-size: 18px; }
  .topbar p { font-size: 13px; }
  .topbar .btn-icon { width: 38px; min-height: 38px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .content { padding: 2px 10px 16px; }
  .offline-banner { margin: 0 10px 6px; padding: 6px 12px; font-size: 13px; }
  .panel, .progress-panel { padding: 14px; margin-bottom: 12px; border-radius: 18px; }
  .panel-title { margin-bottom: 10px; font-size: 17px; }
  .section-title { margin: 18px 2px 8px; font-size: 17px; }
  .search-bar { margin-bottom: 12px; }
  .hero-card { padding: 16px; margin-bottom: 12px; gap: 14px; border-radius: 20px; }
  .tile-list { gap: 8px; margin-bottom: 12px; }
  .stat-grid.four { margin-bottom: 12px; }
  .empty-state { padding: 24px 16px; border-radius: 20px; }
  .segmented-nav { gap: 4px; padding: 3px; margin: 0 0 8px; border-radius: 12px; }
  .segmented-nav a { padding: 6px 10px; border-radius: 9px; font-size: 14px; }
  .segmented-nav a .icon { width: 16px; height: 16px; }
  .session-progress { margin-bottom: 8px; }
  .session-progress-label { margin-bottom: 4px; font-size: 13.5px; }
  .goal-chip { padding: 1px 8px; font-size: 12px; }
  .bar { height: 6px; }
  .word-card, .challenge { border-radius: 18px; }
  .card-label { left: 10px; bottom: 10px; padding: 2px 10px; font-size: 12px; }
  .card-body { padding: 12px 14px 14px; }
  .card-heading { margin-bottom: 4px; }
  .card-word { font-size: 25px; }
  .definition-text { margin-bottom: 6px; font-size: 16.5px; line-height: 1.4; }
  blockquote { margin-top: 6px; padding: 7px 11px; font-size: 15px; }
  .card-actions { gap: 8px; margin-top: 8px; }
  .card-actions .btn { min-height: 44px; padding-inline: 12px; }
  .hint { margin-top: 6px; font-size: 12.5px; }
  .question { margin-top: 8px; }
  .guest-warning { margin-bottom: 12px; padding: 12px 14px; }
  .site-footer { padding: 6px 12px 14px; }
  /* Topic and Saved pages: the blurb is cut to two lines on every tab, so Browse/Explore/Learn/Review keep the tabs at the same height. */
  body.section-topic .content > .lead, body.section-saved .content > .lead { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  /* Card sessions: the image keeps whatever height is left, down to 120px. */
  body.card-mode .swipe-card .card-media { flex-basis: 150px; min-height: 120px; }
}
