/* สอบครู.com — สไตล์หลัก */
:root {
  --accent: #1E66E0;
  --accent-dark: #174FAF;
  --accent-soft: #E6EEFF;
  --navy: #12357A;
  --ink: #24324D;
  --ink-strong: #172033;
  --muted: #4A5468;
  --muted-2: #5A6378;
  --line: #E4E9F2;
  --line-2: #EDF0F6;
  --bg: #F7F9FC;
  --card: #FFFFFF;
  --yellow: #FFD54A;
  --yellow-soft: #FFF4CC;
  --yellow-ink: #5C4500;
  --green: #12805C;
  --green-ink: #0F6B4B;
  --green-soft: #E3F6EE;
  --orange: #D2691E;
  --orange-ink: #A1420A;
  --orange-soft: #FFF1E6;
  --danger: #B42318;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(23, 32, 51, .06);
  --font: 'Anuphan', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-q: 'IBM Plex Sans Thai Looped', 'Anuphan', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #9DBDF7; outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.narrow { max-width: 860px; }
@media (max-width: 600px) { .wrap { padding-left: 16px; padding-right: 16px; } body { font-size: 16px; } }

/* header */
.site-header { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; gap: 10px 28px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.logo span { font-size: 24px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.logo b { color: var(--ink); font-weight: 700; }
.main-nav { display: flex; gap: 4px 22px; font-weight: 600; font-size: 16px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 3px solid transparent; }
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.auth-slot { display: flex; align-items: center; gap: 10px; margin-left: auto; }
@media (max-width: 800px) { .main-nav { order: 3; flex-basis: 100%; } }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.avatar { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-decoration: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.md { width: 38px; height: 38px; font-size: 15px; }
.avatar.lg { width: 112px; height: 112px; font-size: 44px; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--yellow); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; line-height: 1.3; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-yellow { background: var(--yellow); color: var(--ink-strong); }
.btn-yellow:hover { background: #F5C82E; color: var(--ink-strong); }
.btn-ghost { background: #fff; border-color: #CBD2E1; color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-white { background: #fff; color: var(--navy); }
.btn-danger { background: #fff; border-color: #F1B5AE; color: var(--danger); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.btn-lg { padding: 15px 28px; font-size: 18px; border-radius: 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 2px; }

/* cards & chips */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card.shadow { box-shadow: var(--shadow); border: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 36px; text-decoration: none; }
.chip[aria-pressed="true"], .chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--navy); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #F1F4FA; color: var(--muted); }
.tag.blue { background: var(--accent-soft); color: var(--navy); }
.tag.green { background: var(--green-soft); color: var(--green-ink); }
.tag.orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.badge-teacher { background: var(--green-soft); color: var(--green-ink); }
.badge-helper { background: var(--yellow-soft); color: var(--yellow-ink); }
.muted { color: var(--muted-2); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.section { padding-top: 64px; }
.section-title { font-size: clamp(26px, 3.4vw, 38px); }
.eyebrow { font-size: 18px; font-weight: 600; color: var(--muted-2); }
.tablist { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tablist button { padding: 8px 18px; border-radius: 8px; border: 0; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 40px; }
.tablist button[aria-selected="true"] { background: var(--accent); color: #fff; }
.empty { border: 1.5px dashed #CBD2E1; border-radius: var(--radius); padding: 36px; text-align: center; background: #fff; color: var(--muted-2); }
.skeleton { background: linear-gradient(90deg, #EEF1F6 25%, #F6F8FB 50%, #EEF1F6 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; min-height: 80px; }
@keyframes sk { to { background-position: -200% 0; } }

/* forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.input, select.input, textarea.input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid #CBD2E1; background: #fff; font-weight: 400; min-height: 44px; }
textarea.input { resize: vertical; min-height: 110px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px #D7E4FF; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; border-radius: 999px; background: #CBD2E1; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
[aria-pressed="true"] .switch, [aria-checked="true"] .switch { background: var(--accent); }
[aria-pressed="true"] .switch::after, [aria-checked="true"] .switch::after { left: 21px; }

/* toast & modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink-strong); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 200; transition: transform .25s, opacity .25s, visibility .25s; max-width: calc(100% - 32px); opacity: 0; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(23, 32, 51, .45); }
.modal-body { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* promo + hero */
.promo { background: var(--ink-strong); color: #fff; font-size: 15px; }
.promo .wrap { display: flex; justify-content: center; align-items: center; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; text-align: center; }
.promo a { background: var(--yellow); color: var(--ink-strong); padding: 3px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; }
.hero { background: radial-gradient(70% 90% at 50% 0%, #DCE7FF 0%, var(--bg) 72%); }
.hero-in { max-width: 900px; margin: 0 auto; padding: 64px 24px 56px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hero-lead { font-size: 24px; font-weight: 600; color: var(--muted-2); }
.hero h1 { font-size: clamp(38px, 6vw, 68px); min-height: 1.3em; line-height: 1.3; }
.caret { color: var(--accent); font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.search-wrap { position: relative; width: 100%; max-width: 640px; margin-top: 46px; }
.mascot { position: absolute; right: 54px; top: -66px; z-index: 0; display: flex; align-items: flex-start; gap: 6px; }
.mascot .bubble { margin-top: 6px; background: #fff; border: 1.5px solid var(--ink-strong); border-radius: 12px 12px 2px 12px; padding: 3px 10px; font-size: 13px; font-weight: 700; color: var(--ink-strong); white-space: nowrap; }
.mascot svg { transition: transform .3s; }
.search-wrap:focus-within .mascot svg { transform: translateY(-8px) rotate(-4deg); }
.search { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid #CBD2E1; border-radius: 999px; padding: 6px 8px 6px 22px; box-shadow: 0 10px 30px rgba(30, 102, 224, .12); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; min-height: 44px; }
.search-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(23,32,51,.14); text-align: left; overflow: hidden; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.search-results a:hover, .search-results a:focus { background: var(--accent-soft); }
.ai-toggle { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 0; background: #F4F6FA; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 44px; }
.ai-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--navy); }
.popular { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; font-size: 15px; }
.popular a { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
@media (max-width: 600px) { .mascot { right: 18px; } .mascot .bubble { display: none; } .ai-toggle .lbl { display: none; } }

/* category tabs */
.cat-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 26px 26px 30px; display: flex; flex-direction: column; gap: 22px; }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cat-tab { flex: 0 0 auto; width: 128px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px 0; border: 0; background: transparent; cursor: pointer; text-align: center; color: var(--muted); }
.cat-tab .ic { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: #F4F6FA; color: #6B7590; transition: transform .2s; }
.cat-tab:hover .ic { transform: translateY(-3px); }
.cat-tab .nm { font-size: 15px; font-weight: 600; line-height: 1.35; }
.cat-tab .bar { margin-top: 4px; width: 80%; height: 4px; border-radius: 999px; background: transparent; }
.cat-tab[aria-selected="true"] { color: var(--navy); }
.cat-tab[aria-selected="true"] .ic { background: var(--accent-soft); color: var(--accent); }
.cat-tab[aria-selected="true"] .bar { background: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tile { min-height: 120px; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,32,51,.1); }
.tile .sub { font-size: 13px; font-weight: 600; opacity: .85; }
.tile .ttl { font-size: 19px; font-weight: 700; line-height: 1.35; }
.tile .go { margin-top: auto; font-size: 14px; font-weight: 600; }
.t0 { background: #E6EEFF; color: var(--navy); } .t1 { background: #FFF4CC; color: #5C4500; } .t2 { background: #E3F6EE; color: #0F5A40; } .t3 { background: #F0EAFF; color: #3F2A8A; }

/* banner */
.banner-row { display: flex; flex-wrap: wrap; gap: 20px; }
.banner { flex: 999 1 560px; min-width: 0; position: relative; overflow: hidden; border-radius: 20px; background: var(--accent); color: #fff; padding: 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; min-height: 300px; }
.banner h2 { color: #fff; font-size: clamp(26px, 3.4vw, 40px); }
.banner p { color: #E1EAFF; }
.omr-card { flex: 0 1 230px; background: #fff; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transform: rotate(3deg); box-shadow: 0 16px 36px rgba(0,0,0,.2); color: var(--muted); font-size: 13px; }
.omr-row { display: flex; gap: 10px; align-items: center; }
.omr-row i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9AA6C0; display: inline-block; }
.omr-row i.f { background: var(--ink-strong); border-color: var(--ink-strong); }
.omr-row i.y { background: var(--yellow); border-color: #C9A21E; }
.countdown-card { flex: 1 1 320px; min-width: 0; background: #fff; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.cd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.cd-grid div { background: #EEF3FF; border-radius: 12px; padding: 10px 4px; }
.cd-grid b { display: block; font-size: 30px; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-grid span { font-size: 13px; color: var(--muted); }

/* features / steps */
.feature .ic { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.step { display: flex; gap: 16px; }
.step .n { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* set cards carousel */
.hscroll { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.hscroll > * { scroll-snap-align: start; }
.set-card { flex: 0 0 260px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.set-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(23,32,51,.1); color: var(--ink); }
.set-cover { height: 110px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.set-cover .sec { font-size: 13px; font-weight: 700; opacity: .9; }
.set-cover .subj { font-size: 22px; font-weight: 700; line-height: 1.2; }
.set-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.set-body .ttl { font-size: 16px; font-weight: 700; line-height: 1.4; }
.price-free { margin-top: auto; align-self: flex-end; font-weight: 700; color: var(--green-ink); }
.price-member { margin-top: auto; align-self: flex-end; font-weight: 700; color: var(--accent); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.set-grid .set-card { flex: none; }

/* pricing */
.plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.plan.best { border: 2px solid var(--accent); }
.plan .flag { position: absolute; top: 18px; right: 18px; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #fff; }
.plan .art { height: 120px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.plan li { display: flex; gap: 8px; }
.plan li::before { content: '✓'; color: var(--accent); font-weight: 700; }
.plan .btn { margin-top: auto; }

/* announcements */
.ann-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--line-2); }

/* footer */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 72px; }
.footer-grid { padding-top: 48px; padding-bottom: 24px; display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 28px; font-size: 15px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid nav b { color: var(--navy); }
.footer-grid nav a { color: var(--muted); text-decoration: none; }
.footer-grid nav a:hover { color: var(--accent); }
.footer-brand { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.footer-note { padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted-2); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* page header band */
.band { background: radial-gradient(70% 120% at 20% 0%, #DCE7FF 0%, var(--bg) 70%); }
.band-in { padding-top: 36px; padding-bottom: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.band h1 { font-size: clamp(28px, 4vw, 44px); }
.band.dark { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.band.dark h1 { color: #fff; }
.band.dark p { color: #C9D6F2; }
.crumbs { font-size: 14px; color: var(--muted-2); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted-2); }

/* layout two-col */
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding-top: 16px; }
.two-col > .main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.two-col > aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* question UI */
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.q-stem { font-family: var(--font-q); font-size: 19px; line-height: 1.75; font-weight: 500; white-space: pre-line; color: var(--ink-strong); }
.q-choices { display: flex; flex-direction: column; gap: 10px; font-family: var(--font-q); font-size: 17px; }
.choice { text-align: left; display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; border: 2px solid #D5DAE6; background: #fff; cursor: pointer; min-height: 52px; color: var(--ink-strong); line-height: 1.6; transition: border-color .12s, background .12s; }
.choice:hover:not([disabled]) { border-color: #9DBDF7; }
.choice .b { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #8A96B3; display: flex; align-items: center; justify-content: center; font-family: var(--font); font-size: 15px; font-weight: 700; margin-top: -1px; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #EEF3FF; }
.choice[aria-pressed="true"] .b { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.right { border-color: var(--green); background: #EAF7F1; }
.choice.right .b { background: var(--green); border-color: var(--green); color: #fff; }
.choice.wrong { border-color: #E07A3B; background: #FFF3EA; }
.choice.wrong .b { background: #E07A3B; border-color: #E07A3B; color: #fff; }
.choice[disabled] { cursor: default; }
.explain { border-radius: 14px; background: #F2FAF6; padding: 16px 18px; font-size: 16px; color: #24324D; display: flex; flex-direction: column; gap: 8px; }
.explain.bad { background: #FFF6EE; }
.explain h3 { font-size: 17px; color: var(--green-ink); }
.explain.bad h3 { color: var(--orange-ink); }
.hint-box { background: #FFF8DB; border: 1px solid #F2DC86; border-radius: 14px; padding: 14px 18px; color: #4A3A00; }
.open-card .answer-guide { background: #F7F9FC; border-radius: 12px; padding: 16px; white-space: pre-line; }

/* exam runner */
.exam-top { background: var(--ink-strong); color: #fff; position: sticky; top: 0; z-index: 40; }
body:has(.exam-top) .site-header { position: static; }
.exam-top .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.timer { display: flex; align-items: center; gap: 8px; background: #24304A; padding: 8px 14px; border-radius: 12px; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; }
.timer.low { background: #7A1E12; }
.navgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.navgrid button { height: 40px; border-radius: 10px; border: 1px solid #D5DAE6; background: #F1F3F8; color: var(--muted); font-weight: 600; cursor: pointer; font-size: 15px; padding: 0; }
.navgrid button.ans { background: var(--accent); border-color: var(--accent); color: #fff; }
.navgrid button.flag { border: 2.5px solid #E0A800; }
.navgrid button.cur { box-shadow: 0 0 0 3px var(--ink-strong); }
.progress { height: 6px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }
.subj-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.subj-pills span { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.subj-pills span.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* result */
.meter { position: relative; padding-top: 22px; }
.meter .track { height: 14px; background: #E9ECF4; border-radius: 999px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 999px; }
.meter .line { position: absolute; left: 60%; top: 0; bottom: -4px; width: 2px; background: var(--ink-strong); }
.meter .lbl { position: absolute; left: 60%; top: -2px; transform: translateX(-50%); font-size: 13px; font-weight: 600; white-space: nowrap; }
.big-score { font-size: 48px; font-weight: 700; line-height: 1; color: var(--ink-strong); }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.review-item { border-top: 1px solid var(--line-2); padding-top: 18px; }

/* board */
.thread { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.vote { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--muted); }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.thread-title { font-size: 18px; font-weight: 700; color: var(--ink-strong); text-decoration: none; line-height: 1.4; }
.thread-title:hover { color: var(--accent); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post { display: flex; gap: 12px; }
.post-body { white-space: pre-line; overflow-wrap: anywhere; }
.pinned { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 20px; border-radius: 16px; background: var(--ink-strong); color: #fff; text-decoration: none; }
.pinned:hover { color: #fff; }
.dist-row { position: relative; overflow: hidden; border-radius: 10px; padding: 10px 14px; border: 1.5px solid var(--line); background: #fff; }
.dist-row .fill { position: absolute; inset: 0 auto 0 0; background: #F1F4FA; }
.dist-row.right { border-color: var(--green); }
.dist-row.right .fill { background: #DDF3E8; }
.dist-row > span { position: relative; display: flex; gap: 10px; align-items: center; }

/* leaderboard */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.podium .p { flex: 0 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.podium .ped { margin-top: 6px; width: 100%; border-radius: 14px 14px 0 0; display: flex; justify-content: center; padding-top: 10px; font-size: 34px; font-weight: 700; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.lb-row .rk { width: 32px; text-align: center; font-weight: 700; color: var(--muted-2); font-size: 17px; }
.me-bar { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-radius: 16px; background: var(--ink-strong); color: #fff; box-shadow: 0 12px 30px rgba(23,32,51,.25); }
.league { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted-2); }
.league span { display: block; margin: 0 auto 4px; width: 34px; height: 34px; border-radius: 50%; }
.league .on { color: var(--navy); }
.league .on span { outline: 3px solid var(--accent); outline-offset: 2px; }
.share-card { aspect-ratio: 1 / 1; border-radius: 16px; background: var(--navy); color: #fff; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }

/* profile */
.cover { height: 170px; background: var(--accent); position: relative; overflow: hidden; }
.profile-head { margin-top: -70px; position: relative; background: #fff; border-radius: 20px; padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 24px; box-shadow: 0 10px 30px rgba(23,32,51,.08); }
.stat-tile { border-radius: 16px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-tile b { display: block; font-size: 28px; line-height: 1.1; }
.heat { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 4px; }
.heat span { width: 14px; height: 14px; border-radius: 4px; background: #EEF1F6; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.badge-grid div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; }
.badge-grid .c { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.badge-grid .locked .c { background: #F4F6FA; color: #B3BCCD; border: 1.5px dashed #CBD2E1; }
.badge-grid .locked { color: var(--muted-2); }

/* admin */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table th { font-size: 13px; color: var(--muted-2); font-weight: 700; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }

/* prose */
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { margin-top: 18px; font-size: 24px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose table { border-collapse: collapse; width: 100%; background: #fff; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
