/* Sổ từ vựng. Một cuốn từ điển in: giấy kem, mực đen, hai mực riso (xanh cobalt, hồng huỳnh quang).
   Fraunces cho từ đầu mục và tiêu đề, Literata cho phần đọc. */
:root {
  --paper: oklch(97.2% 0.013 85);
  --paper-2: oklch(94.6% 0.017 85);
  --card: oklch(99.2% 0.006 90);
  --ink: oklch(22% 0.028 265);
  --ink-2: oklch(38% 0.026 265);
  --ink-3: oklch(51% 0.02 265);
  --rule: oklch(87% 0.018 85);
  --rule-2: oklch(78% 0.02 85);
  --blue: oklch(46% 0.17 264);
  --blue-2: oklch(80% 0.07 264);
  --pink: oklch(66% 0.21 358);
  --pink-ink: oklch(52% 0.2 358);
  --ok: oklch(50% 0.13 155);
  --bad: oklch(54% 0.18 27);
  --line: oklch(82% 0.05 240);
  --margin: oklch(66% 0.15 22);
  --hl: oklch(86% 0.13 358 / 0.55);
  --shadow: 0 1px 0 oklch(0% 0 0 / 0.04), 0 14px 34px -20px oklch(25% 0.05 265 / 0.45);
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --text: 'Literata', 'Iowan Old Style', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --paper: oklch(19% 0.03 265); --paper-2: oklch(23% 0.032 265); --card: oklch(25% 0.03 265);
    --ink: oklch(94% 0.014 85); --ink-2: oklch(82% 0.02 85); --ink-3: oklch(68% 0.025 265);
    --rule: oklch(32% 0.035 265); --rule-2: oklch(42% 0.04 265);
    --blue: oklch(75% 0.12 258); --blue-2: oklch(42% 0.09 264); --pink: oklch(74% 0.17 358); --pink-ink: oklch(80% 0.14 358);
    --ok: oklch(76% 0.13 155); --bad: oklch(75% 0.15 27); --line: oklch(36% 0.05 250); --margin: oklch(62% 0.13 22); --hl: oklch(55% 0.16 358 / 0.45);
    --shadow: 0 14px 34px -18px oklch(0% 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="night"] {
  --paper: oklch(19% 0.03 265); --paper-2: oklch(23% 0.032 265); --card: oklch(25% 0.03 265);
  --ink: oklch(94% 0.014 85); --ink-2: oklch(82% 0.02 85); --ink-3: oklch(68% 0.025 265);
  --rule: oklch(32% 0.035 265); --rule-2: oklch(42% 0.04 265);
  --blue: oklch(75% 0.12 258); --blue-2: oklch(42% 0.09 264); --pink: oklch(74% 0.17 358); --pink-ink: oklch(80% 0.14 358);
  --ok: oklch(76% 0.13 155); --bad: oklch(75% 0.15 27); --line: oklch(36% 0.05 250); --margin: oklch(62% 0.13 22); --hl: oklch(55% 0.16 358 / 0.45);
  --shadow: 0 14px 34px -18px oklch(0% 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--text); font-optical-sizing: auto; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration-color: color-mix(in oklch, var(--blue) 60%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0 0 .7em; text-wrap: pretty; }
mark { background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%); color: inherit; padding: 0 .05em; }
.muted { color: var(--ink-3); }
.empty { color: var(--ink-3); font-style: italic; padding: 28px 0; }
.kick { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 46em; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 80; border-radius: 4px; }
.skip:focus { top: 8px; }
kbd { font: 500 12px/1 ui-monospace, Consolas, monospace; border: 1px solid currentColor; border-radius: 4px; padding: 2px 5px; opacity: .7; margin-right: 4px; }

/* nút */
.btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rule-2); background: var(--card); border-radius: 999px; padding: 8px 18px; cursor: pointer; font-size: 16px; text-decoration: none; color: var(--ink); line-height: 1.2; }
.btn:hover { border-color: var(--blue); color: var(--ink); }
.btn-p { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.btn-p:hover { filter: brightness(1.08); color: var(--paper); }
.btn-s { padding: 6px 14px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: default; }
.act { border: 0; background: none; padding: 2px 0; cursor: pointer; font-size: 15px; color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.act:hover { color: var(--blue); }
.act svg { flex: none; }
.act.danger { color: var(--bad); }
.act-star[aria-pressed="true"] { color: var(--pink-ink); }

/* thanh trên cùng */
.top { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 22px; padding: 12px 32px; background: color-mix(in oklch, var(--paper) 93%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-m { position: relative; width: 38px; height: 34px; font: 700 30px/1 var(--display); }
.brand-m b { position: absolute; left: 0; top: 0; color: var(--blue); mix-blend-mode: multiply; }
.brand-m i { position: absolute; left: 15px; top: 3px; font-style: normal; color: var(--pink); mix-blend-mode: multiply; }
:root[data-theme="night"] .brand-m b, :root[data-theme="night"] .brand-m i { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .brand-m b, :root:not([data-theme="day"]) .brand-m i { mix-blend-mode: screen; } }
.brand-t { font: 600 22px/1 var(--display); letter-spacing: -0.01em; }
.search input { width: 100%; max-width: 440px; border: 1px solid var(--rule-2); background: var(--card); border-radius: 999px; padding: 9px 18px; font-size: 16px; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in oklch, var(--blue) 20%, transparent); }
.nav { display: flex; gap: 22px; }
.nav-a { text-decoration: none; color: var(--ink-2); padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav-a:hover { color: var(--ink); }
.nav-a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--pink); }
.tools { display: flex; align-items: center; gap: 10px; }
.tb-ic { border: 1px solid transparent; background: none; border-radius: 999px; font-size: 19px; padding: 3px 9px; cursor: pointer; color: var(--ink-2); }
.tb-ic:hover { border-color: var(--rule-2); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px 96px; }
.back { margin: 26px 0 0; font-size: 15px; }
.back a { text-decoration: none; color: var(--ink-3); }
.back a:hover { color: var(--blue); }

/* tranh in riso có dấu cắt ở bốn góc */
.print { position: relative; margin: 0; padding: 12px; }
.print img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.print::before, .print::after, .print .crop::before, .print .crop::after { content: ''; position: absolute; width: 14px; height: 14px; border-color: var(--ink-3); border-style: solid; border-width: 0; opacity: .7; }
.print::before { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.print::after { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.print .crop::before { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.print .crop::after { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

/* từ của hôm nay */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 56px; align-items: center; padding: 52px 0 40px; }
.hero-w { font: 600 clamp(48px, 7.4vw, 100px)/0.98 var(--display); letter-spacing: -0.025em; margin: 0 0 14px; overflow-wrap: anywhere; }
.hero-w.l { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.02; }
.hero-w.xl { font-size: clamp(34px, 4.2vw, 54px); line-height: 1.06; }
.hero-p { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; color: var(--ink-3); margin-bottom: 14px; }
.hero-p a { text-decoration-color: color-mix(in oklch, var(--c) 70%, transparent); text-decoration-thickness: 2px; }
.hero-v { display: block; font-size: clamp(22px, 2.6vw, 29px); line-height: 1.35; margin-bottom: 12px; }
.hero-d { color: var(--ink-2); max-width: 36em; }
.hero-x { font-style: italic; color: var(--ink-2); max-width: 36em; padding-left: 16px; border-left: 2px solid color-mix(in oklch, var(--c) 60%, transparent); }
.hero-act { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; }
.en { font-style: italic; }
.none { font-style: italic; color: var(--ink-3); }
.sugg { display: inline-block; font: 500 11px/1.5 var(--text); letter-spacing: .06em; text-transform: uppercase; color: oklch(48% 0.12 70); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; vertical-align: 2px; font-style: normal; }
:root[data-theme="night"] .sugg { color: oklch(82% 0.12 80); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="day"]) .sugg { color: oklch(82% 0.12 80); } }
.e-sugg { font-size: 14px; color: var(--ink-2); }
.strip-sugg { margin-left: 14px; color: var(--pink-ink); }
.f-sugg { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--ink-2); }
.f-sugg input { width: auto !important; }
.review { list-style: none; margin: 0; padding: 0; max-width: 900px; counter-reset: rv; }
.review li { position: relative; padding: 16px 0 16px 44px; border-bottom: 1px solid var(--rule); counter-increment: rv; }
.review li::before { content: counter(rv); position: absolute; left: 0; top: 18px; font: 600 15px/1 var(--display); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.review li.ok { opacity: .6; }
.rv-w { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rv-ctx { margin: 4px 0 4px; font-size: 15px; color: var(--ink-3); }
.rv-note { margin: 0 0 6px; font-size: 14.5px; color: oklch(48% 0.12 70); }
.rv-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; }
.rv-act input { flex: 1 1 320px; min-width: 0; border: 1px solid var(--rule-2); background: var(--card); border-radius: 6px; padding: 8px 10px; font: 17px/1.4 var(--text); }
.rv-act input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in oklch, var(--blue) 20%, transparent); }
.rv-done { color: var(--ok); font-weight: 600; }

/* tiến độ */
.strip { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; gap: 8px 28px; align-items: center; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.strip-n b { font: 600 34px/1 var(--display); }
.strip-n span { color: var(--ink-2); }
.strip-bar, .toc-bar, .sbar { display: flex; height: 6px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.strip-bar i, .toc-bar i, .sbar i { display: block; height: 100%; background: var(--blue); }
.strip-bar i.b2, .toc-bar i.b2 { background: var(--blue-2); }
.strip-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.strip-note { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--ink-3); }

/* mục lục */
.contents { padding: 46px 0 0; }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 18px; }
.sec-h h2 { font-size: 34px; margin: 0; }
.sec-h p { margin: 0; }
.toc { list-style: none; margin: 0; padding: 0; columns: 2 420px; column-gap: 56px; }
.toc li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.toc a { display: grid; grid-template-columns: 72px minmax(0, max-content) minmax(24px, 1fr) auto; align-items: end; gap: 0 14px; padding: 12px 0; text-decoration: none; }
.toc a:hover .toc-n { color: var(--blue); }
.toc-img { width: 72px; height: 54px; object-fit: cover; border-radius: 2px; }
.toc-t { display: grid; gap: 2px; min-width: 0; }
.toc-n { font: 600 20px/1.2 var(--display); }
.toc-en { font-size: 13.5px; font-style: italic; color: var(--ink-3); }
.toc-bar { width: 120px; height: 3px; margin-top: 6px; }
.toc-dots { border-bottom: 2px dotted var(--rule-2); margin-bottom: 9px; }
.toc-c { text-align: right; font: 600 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.toc-c small { display: block; font: 400 12.5px/1.3 var(--text); color: var(--pink-ink); }
.toc-all a { grid-template-columns: minmax(0, max-content) minmax(24px, 1fr) auto; }
.toc-all .toc-n { font-style: italic; }

/* một chủ đề */
.th { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: 44px; align-items: center; padding: 18px 0 26px; }
.th h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.02; margin: 0 0 8px; }
.th-en { font-style: italic; font-size: 19px; color: var(--ink-2); margin-bottom: 10px; }
.th-note { color: var(--ink-2); }
.th-s { color: var(--ink-3); font-size: 15.5px; }
.th-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 22px; border-top: 1px solid var(--rule); }
.chip { border: 1px solid var(--rule-2); background: none; border-radius: 999px; padding: 5px 14px; font-size: 15px; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.plain-h { padding: 26px 0 22px; }
.plain-h h1 { font-size: clamp(36px, 5vw, 58px); margin: 0 0 8px; line-height: 1.04; overflow-wrap: anywhere; }

/* từ điển */
.dict { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 28px; }
.cols { columns: 2 340px; column-gap: 52px; column-rule: 1px solid var(--rule); }
.letter { font: 700 46px/1 var(--display); color: color-mix(in oklch, var(--c, var(--blue)) 80%, var(--ink)); margin: 0 0 6px; padding-top: 10px; break-after: avoid; border-bottom: 1px solid var(--rule); }
.letter:not(:first-child) { margin-top: 20px; }
.e { break-inside: avoid; border-radius: 6px; margin: 0 -10px; }
.e-h { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px 10px; cursor: pointer; border-radius: 6px; }
.e-h:hover .e-t { text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--c) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.e-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 9px; }
.e-t { font: 600 21px/1.25 var(--display); letter-spacing: -0.005em; }
.e-p { font-style: italic; font-size: 14.5px; color: var(--ink-3); }
.e-hi { color: var(--pink); font-size: 11px; transform: translateY(-3px); margin-right: -3px; }
.e-star { color: var(--pink-ink); font-size: 14px; }
.e-v { display: block; color: var(--ink-2); font-size: 16.5px; line-height: 1.45; margin-top: 1px; }
.e-topic { display: inline-block; margin-top: 4px; font-size: 12.5px; letter-spacing: .04em; color: color-mix(in oklch, var(--c) 75%, var(--ink)); }
.e.open { background: color-mix(in oklch, var(--c) 8%, var(--paper)); }
.e-more { padding: 0 10px 14px; font-size: 16px; }
.e-more p { margin: 0 0 8px; }
.e-d { color: var(--ink-2); }
.e-x { font-style: italic; color: var(--ink-2); padding-left: 12px; border-left: 2px solid color-mix(in oklch, var(--c) 55%, transparent); }
.e-s a { text-decoration-style: dotted; }
.lbl { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-style: normal; }
.e-meta, .e-note { font-size: 14px; color: var(--ink-3); }
.e-act { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.e.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--pink); } 100% { box-shadow: 0 0 0 3px transparent; } }
.results { max-width: 760px; }
.rail { position: sticky; top: 86px; align-self: start; display: flex; flex-direction: column; font: 600 12.5px/1.45 var(--display); text-align: center; }
.rail a { text-decoration: none; color: var(--ink-2); border-radius: 3px; }
.rail a:hover { background: var(--ink); color: var(--paper); }
.rail span { color: var(--rule-2); }

/* hộp Leitner: ô ngăn kéo nhỏ */
.pips { display: inline-flex; gap: 2px; margin-left: 2px; }
.pips i { width: 6px; height: 6px; border: 1px solid var(--blue); border-radius: 1px; }
.pips i.on { background: var(--blue); }
.pips-m i.on { background: var(--pink); border-color: var(--pink); }
.pips-new { font-size: 12.5px; color: var(--pink-ink); letter-spacing: .05em; }

/* Thích & ghét */
.poles { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); gap: 0 18px; align-items: stretch; }
.pole h2 { font-size: 36px; margin: 0; }
.pole > .muted { margin: 0 0 12px; font-size: 14px; }
.pole-pos h2 { color: var(--pink-ink); }
.pole-neg h2 { color: var(--blue); }
.pole-axis { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.pole-axis span { font: 600 26px/1 var(--display); }
.pole-axis span:first-child { color: var(--pink-ink); }
.pole-axis span:last-child { color: var(--blue); }
.pole-axis i { flex: 1; width: 3px; margin: 8px 0; border-radius: 2px; background: linear-gradient(var(--pink), var(--blue)); }
.pw { padding: 14px 0 12px; border-top: 1px solid var(--rule); }
.pw-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
.pw-v { display: block; color: var(--ink-2); margin: 2px 0 6px; }
.pw-x { font-style: italic; color: var(--ink-2); font-size: 15.5px; }
.pw-f { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 14px; margin: 0; }

/* học thẻ */
.sub-h { font-size: 26px; margin: 40px 0 12px; }
.drawers { list-style: none; margin: 8px 0 30px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 760px; }
.drawers li { position: relative; background: var(--card); border: 1px solid var(--rule-2); border-radius: 6px; padding: 22px 10px 12px; text-align: center; display: grid; gap: 2px; }
.drawers li::before { content: ''; position: absolute; left: 50%; top: 8px; width: 30px; height: 6px; transform: translateX(-50%); border: 1px solid var(--rule-2); border-radius: 0 0 6px 6px; border-top: 0; }
.drawers .dn { font: 600 30px/1 var(--display); }
.drawers .dl { font-size: 14px; color: var(--ink-2); }
.drawers .dg { font-size: 12px; color: var(--ink-3); }
.drawers li.m .dn { color: var(--pink-ink); }
.decks { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.decks li { display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--rule); }
.deck { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); padding: 14px 0; text-decoration: none; }
.deck b { font: 600 20px/1.25 var(--display); }
.deck .muted { font-size: 14.5px; }
a.deck:hover b { color: var(--blue); }
.deck-n { font: 600 22px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.decks li.off { opacity: .55; }
.decks-t .deck { grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; }
.decks-t .deck img { grid-row: span 2; width: 64px; height: 48px; object-fit: cover; border-radius: 2px; align-self: center; }

.study { max-width: 720px; margin: 18px auto 0; }
.study-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.auto { font-size: 14px; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.sbar { margin: 4px 0 18px; height: 4px; }
.card { position: relative; background-color: var(--card); background-image: linear-gradient(var(--margin), var(--margin)), repeating-linear-gradient(transparent 0 33px, var(--line) 33px 34px); background-size: 100% 2px, 100% 100%; background-position: 0 70px, 0 70px; background-repeat: no-repeat, repeat-y; border-radius: 4px; box-shadow: var(--shadow); padding: 18px 34px 30px 34px; min-height: 360px; cursor: pointer; outline: none; }
.card:focus-visible { box-shadow: var(--shadow), 0 0 0 3px var(--blue); }
.card::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 1px; background: var(--margin); opacity: .5; }
.card-top { display: flex; align-items: center; gap: 10px; height: 44px; font-size: 14px; }
.card-top .pips, .card-top .pips-new { margin-left: auto; }
.stamp { width: 52px; height: 39px; object-fit: cover; border: 3px solid var(--card); outline: 1px dashed var(--rule-2); transform: rotate(-3deg); }
.card-front { text-align: center; padding: 46px 0 6px; }
.card-w { font: 600 clamp(34px, 6vw, 60px)/1.08 var(--display); letter-spacing: -0.02em; margin: 0 0 6px; overflow-wrap: anywhere; }
.card-p { font-style: italic; color: var(--ink-3); margin-bottom: 10px; }
.card-hint { text-align: center; color: var(--ink-3); font-size: 14px; margin-top: 54px; }
.card-back { border-top: 1px dashed var(--rule-2); margin-top: 18px; padding-top: 16px; animation: rise .22s ease-out; }
.card-v { display: block; font-size: 25px; line-height: 1.35; margin-bottom: 10px; }
.card-d { color: var(--ink-2); }
.card-x { font-style: italic; color: var(--ink-2); }
.card-s { font-size: 15px; color: var(--ink-3); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card-act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 18px; margin-top: 22px; }
.btn-no { border-color: color-mix(in oklch, var(--bad) 60%, var(--rule-2)); }
.btn-no:hover { border-color: var(--bad); }
.btn-yes { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.btn-yes:hover { color: var(--paper); filter: brightness(1.06); }
.done { max-width: 680px; margin: 40px auto 0; text-align: center; }
.done h1 { font-size: clamp(36px, 5vw, 56px); margin: 0 0 10px; }
.done-n { font-size: 20px; }
.done-n b { font: 600 30px/1 var(--display); }
.done .th-act { justify-content: center; }

/* trắc nghiệm */
.qsetup { display: grid; gap: 18px; max-width: 520px; padding: 22px 24px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; }
.qsetup fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.qsetup legend, .f-l > span:first-child { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.qsetup select { width: 100%; padding: 8px 10px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--paper); }
.opt { display: inline-flex; gap: 6px; align-items: center; }
.qsetup .btn { justify-self: start; }
.quiz { max-width: 720px; margin: 18px auto 0; }
.q-prompt { font: 600 clamp(34px, 5.6vw, 58px)/1.08 var(--display); letter-spacing: -0.02em; margin: 18px 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; overflow-wrap: anywhere; }
.q-prompt.vi { font: 400 clamp(26px, 3.6vw, 38px)/1.3 var(--text); }
.q-pos { font-style: italic; color: var(--ink-3); }
.opts { list-style: none; margin: 18px 0 8px; padding: 0; display: grid; gap: 8px; }
.opt-b { display: flex; align-items: baseline; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--rule-2); border-radius: 8px; padding: 13px 16px; cursor: pointer; font-size: 18px; line-height: 1.4; }
.opt-b:hover:not(:disabled) { border-color: var(--blue); }
.opt-b:disabled { cursor: default; }
.opt-b.right { border-color: var(--ok); background: color-mix(in oklch, var(--ok) 12%, var(--card)); }
.opt-b.wrong { border-color: var(--bad); background: color-mix(in oklch, var(--bad) 10%, var(--card)); }
.opt-b.dim { opacity: .55; }
.mk { margin-left: auto; font-weight: 700; }
.right .mk { color: var(--ok); }
.wrong .mk { color: var(--bad); }
.q-fb { min-height: 1.6em; color: var(--ink-2); }
.score { font-family: var(--display); margin: 8px 0 4px; }
.score b { font-size: clamp(90px, 14vw, 150px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.score span { font-size: 42px; color: var(--ink-3); }
.missed { list-style: none; padding: 0; margin: 12px auto 18px; max-width: 520px; text-align: left; }
.missed li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.missed a { font: 600 18px/1.3 var(--display); }

/* thêm / sửa từ */
.wdlg { border: 0; padding: 0; border-radius: 10px; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -30px oklch(0% 0 0 / .6); }
.wdlg::backdrop { background: oklch(20% 0.03 265 / .45); backdrop-filter: blur(2px); }
.wform { padding: 20px 24px 22px; display: grid; gap: 12px; }
.wform-h { display: flex; justify-content: space-between; align-items: center; }
.wform-h h2 { margin: 0; font-size: 24px; }
.wform input, .wform textarea, .wform select { width: 100%; border: 1px solid var(--rule-2); background: var(--paper); border-radius: 6px; padding: 8px 10px; font-size: 16px; }
.f-big input { font: 600 22px/1.3 var(--display); }
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; }
.f-stack { display: grid; gap: 6px; }
.f-err { color: var(--bad); margin: 0; }
.f-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

.foot { max-width: 1180px; margin: 0 auto; padding: 24px 32px 48px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: var(--paper); padding: 9px 18px; border-radius: 999px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .16s ease-out, transform .16s ease-out; z-index: 90; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* màn hình hẹp */
@media (max-width: 900px) {
  .top { grid-template-columns: auto 1fr; padding: 10px 16px; gap: 10px 14px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .search input { max-width: none; }
  .nav { grid-column: 1 / -1; grid-row: 3; gap: 20px; overflow-x: auto; }
  .tools { justify-content: flex-end; }
  .wrap { padding: 0 16px 72px; }
  .hero { grid-template-columns: 1fr; gap: 10px; padding: 24px 0 28px; }
  .hero-art { order: -1; max-width: 300px; }
  .strip { grid-template-columns: 1fr; }
  .th { grid-template-columns: 1fr; gap: 6px; }
  .th-art { max-width: 300px; }
  .dict { grid-template-columns: 1fr; }
  .rail { display: none; }
  .poles { grid-template-columns: 1fr; }
  .pole-axis { display: none; }
  .pole-neg { margin-top: 26px; }
  .drawers { grid-template-columns: repeat(5, minmax(56px, 1fr)); gap: 6px; }
  .drawers li { padding: 20px 4px 10px; }
  .drawers .dg { display: none; }
  .card { padding: 14px 18px 24px 30px; min-height: 320px; }
  .card::before { left: 16px; }
  .foot { padding: 24px 16px 40px; }
}
@media (max-width: 520px) {
  .toc a { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .toc-img { width: 56px; height: 42px; }
  .toc-dots { display: none; }
  .brand-t { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .rail, .chips, .e-act, .foot, .toast, .hero-act, .strip, .th-act { display: none !important; }
  body { background: #fff; color: #000; }
  .cols { column-rule: 0; }
}
