/* TOPIK Prep web: one hand-written stylesheet, no framework. Mobile first; light + dark via tokens. */
:root {
  --bg: #F8F7F2; --surface: #ffffff; --surface-2: #EAF0FA; --ink: #20273A; --ink-2: #263148; --muted: #53627B; --line: #CCD5E3;
  --primary: #0047A0; --primary-hover: #003a85; --on-primary: #ffffff; --primary-soft: #EAF0FA; --primary-ink: #003a85;
  --red: #CD2E3A; --red-soft: #fde7ea;
  --ok: #0b7a43; --ok-soft: #dff5e9; --warn: #7a4300; --warn-soft: #fdf0d3; --danger: #b42318; --danger-soft: #fde8e6;
  --pro-bg: #fcd34d; --pro-ink: #3b2a00; --focus: #f59e0b;
  --hero-a: #0047A0; --hero-b: #002f6e; --on-hero: #ffffff; --on-hero-2: #dbe2ff;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 6px 20px rgba(15,23,42,.06);
  --font: "Be Vietnam Pro", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ko: "Noto Sans KR", "Be Vietnam Pro", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --max: 1120px; --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f1e; --surface: #131830; --surface-2: #1a2040; --ink: #eef1fb; --ink-2: #d3d9f0; --muted: #a8b1cf; --line: #2b3358;
    --primary: #7BA7F2; --primary-hover: #9DBDF6; --on-primary: #0b0f1e; --primary-soft: #1b2b52; --primary-ink: #B9D0F8;
    --red: #ff7b8e; --red-soft: #3a1820;
    --ok: #55d6a0; --ok-soft: #12332a; --warn: #f5b74d; --warn-soft: #3a2b0e; --danger: #ff8d82; --danger-soft: #3b1a17;
    --pro-bg: #fcd34d; --pro-ink: #2b1f00; --focus: #fbbf24;
    --hero-a: #0a3070; --hero-b: #061a3d; --on-hero: #ffffff; --on-hero-2: #c9d3ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f1e; --surface: #131830; --surface-2: #1a2040; --ink: #eef1fb; --ink-2: #d3d9f0; --muted: #a8b1cf; --line: #2b3358;
  --primary: #7BA7F2; --primary-hover: #9DBDF6; --on-primary: #0b0f1e; --primary-soft: #1b2b52; --primary-ink: #B9D0F8;
  --red: #ff7b8e; --red-soft: #3a1820;
  --ok: #55d6a0; --ok-soft: #12332a; --warn: #f5b74d; --warn-soft: #3a2b0e; --danger: #ff8d82; --danger-soft: #3b1a17;
  --pro-bg: #fcd34d; --pro-ink: #2b1f00; --focus: #fbbf24;
  --hero-a: #0a3070; --hero-b: #061a3d; --on-hero: #ffffff; --on-hero-2: #c9d3ff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.65 var(--font); min-height: 100vh; display: flex; flex-direction: column; overflow-wrap: break-word; }
main { flex: 1 0 auto; }
:lang(ko), [lang="ko"] { font-family: var(--font-ko); }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--primary); color: var(--on-primary); padding: .75rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.nowrap { white-space: nowrap; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-bar { display: flex; align-items: center; gap: .5rem; min-height: 64px; position: relative; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.logo { display: block; height: 36px; width: auto; }
.logo-on-dark { display: none; }   /* brand kit: full-colour wordmark on light, white wordmark on dark */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-on-light { display: none; } :root:not([data-theme="light"]) .logo-on-dark { display: block; } }
:root[data-theme="dark"] .logo-on-light { display: none; } :root[data-theme="dark"] .logo-on-dark { display: block; }
.tagline { font-weight: 700; color: var(--red); letter-spacing: .01em; margin: 0 0 .35rem; }
.footer-brand .tagline { color: #fff; }
.eps-exams .grid { margin-top: .5rem; }
.eps-supporting { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.eps-exams .exam-note { color: var(--muted); font-size: .92rem; margin: .75rem 0 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: 1.4rem; }
.icon-btn:hover { background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
.site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: .5rem var(--gutter) 1rem; }
.site-nav.is-open { display: block; }
.no-js .site-nav { display: block; position: static; box-shadow: none; padding: 0; }
.no-js .header-bar { flex-wrap: wrap; }
.no-js .nav-toggle { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav li a { display: flex; align-items: center; min-height: 48px; padding: 0 .5rem; color: var(--ink); text-decoration: none; font-weight: 500; border-radius: 10px; }
.site-nav li a:hover { background: var(--surface-2); }
.site-nav li a[aria-current="page"] { color: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
.nav-account { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .75rem; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav, .no-js .site-nav { display: flex; position: static; background: transparent; border: 0; box-shadow: none; padding: 0; align-items: center; gap: .5rem; order: 2; margin-left: 1rem; }
  .site-nav ul { display: flex; gap: .15rem; }
  .site-nav li a { min-height: 44px; padding: 0 .85rem; }
  .site-nav li a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--primary); border-radius: 0; }
  .nav-account { padding: 0; margin-left: .5rem; }
  .theme-toggle { order: 3; }
  .brand { margin-right: 0; }
  .header-bar { gap: .25rem; }
  .site-nav { flex: 1; }
  .nav-account { margin-left: auto; }
}

/* ---------- buttons, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .65rem 1.4rem; border-radius: 12px; border: 2px solid transparent; font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: center; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-light { background: #fff; color: #172a94; }
.btn-light:hover { background: #eef1ff; color: #0e1f7d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 44px; padding: .4rem 1rem; font-size: .95rem; }
.btn-lg { min-height: 58px; padding: .8rem 1.8rem; font-size: 1.1rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1.5; letter-spacing: .02em; }
.badge-free { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.badge-pro { background: var(--pro-bg); color: var(--pro-ink); }
.badge-level { background: var(--primary-soft); color: var(--primary-ink); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- breadcrumbs ---------- */
.breadcrumbs { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.breadcrumbs ol { list-style: none; margin: 0 auto; padding-block: .6rem; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .5rem; color: var(--muted); }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs [aria-current] { color: var(--muted); }

/* ---------- sections ---------- */
.section { padding-block: clamp(2rem, 6vw, 4rem); }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 46rem; margin-bottom: 1.5rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: .5rem; }
.page-head { padding-block: clamp(1.5rem, 5vw, 3rem) 1rem; }
.page-head .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46rem; }
.lead { font-size: 1.15rem; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: var(--on-hero); padding-block: clamp(2.25rem, 7vw, 4.5rem); overflow: hidden; }
.hero h1 { color: var(--on-hero); margin-bottom: .6rem; }
.hero .lead { color: var(--on-hero-2); max-width: 36rem; }
.hero .eyebrow { color: #ffd966; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-points { list-style: none; padding: 0; margin: 1.25rem 0 1.5rem; display: grid; gap: .5rem; color: var(--on-hero); }
.hero-points li { padding-left: 1.7rem; position: relative; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 1rem; height: .55rem; border-left: 3px solid #ffd966; border-bottom: 3px solid #ffd966; transform: rotate(-45deg) translateY(-30%); }
.hero .btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero-note { margin-top: 1rem; font-size: .92rem; color: var(--on-hero-2); }
.mock { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 1.1rem; box-shadow: 0 20px 50px rgba(0,0,0,.28); max-width: 26rem; justify-self: center; width: 100%; }
.mock-top { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .75rem; font-weight: 600; }
.mock-timer { background: var(--primary-soft); color: var(--primary-ink); padding: .15rem .6rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.mock-q { font-size: 1.2rem; font-weight: 600; margin-bottom: .75rem; line-height: 1.5; }
.mock-opt { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin-bottom: .5rem; font-size: 1.05rem; }
.mock-opt b { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex: none; }
.mock-opt.is-on { border-color: var(--primary); background: var(--primary-soft); }
.mock-opt.is-on b { background: var(--primary); color: var(--on-primary); }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 3rem; } }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.card h2, .card h3 { margin: 0; font-size: 1.1rem; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card:hover { border-color: var(--primary); }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .88rem; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-weight: 600; font-size: .95rem; color: var(--primary); }
.card-media { margin: -1.1rem -1.2rem .25rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-link { position: static; }
.card-feature { padding: 1.4rem; }
.card-feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }

/* ---------- prose (articles, static pages) ---------- */
.prose { max-width: 46rem; font-size: 1rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose img { border-radius: var(--radius-sm); margin: 1rem auto; }
.prose li { margin-bottom: .35rem; }
.prose a { word-break: break-word; }
.prose blockquote { margin: 1rem 0; padding: .5rem 1rem; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 28rem; }
.article-head { padding-block: 1.5rem .5rem; }
.article-meta { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.article-cover { margin: 1rem 0; border-radius: var(--radius); overflow: hidden; }
.article-layout { display: grid; gap: 2rem; padding-block: 1rem 3rem; }
@media (min-width: 960px) { .article-layout { grid-template-columns: minmax(0, 1fr) 20rem; } .aside-sticky { position: sticky; top: 84px; align-self: start; } }
.toc { background: var(--surface-2); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.5rem; }
.toc ol { margin: .4rem 0 0; }

/* ---------- CTA, callouts, notices ---------- */
.cta { background: linear-gradient(135deg, var(--primary-soft), var(--surface)); border: 1px solid var(--primary); border-radius: var(--radius); padding: 1.25rem; margin: 1.75rem 0; }
.cta h2, .cta h3 { margin-bottom: .3rem; font-size: 1.25rem; }
.cta p { color: var(--ink-2); }
.cta-band { background: var(--primary); color: var(--on-primary); padding-block: 2.5rem; text-align: center; }
.cta-band h2 { color: var(--on-primary); }
.cta-band .btn { background: #fff; color: #172a94; }
:root[data-theme="dark"] .cta-band .btn { background: #0b0f1e; color: var(--primary); }
.notice { border-radius: var(--radius-sm); padding: .9rem 1.1rem; background: var(--warn-soft); color: var(--ink); border-left: 5px solid var(--warn); margin: 1rem 0; font-size: .97rem; }
.notice-info { background: var(--primary-soft); border-left-color: var(--primary); }
.notice-ok { background: var(--ok-soft); border-left-color: var(--ok); }
.notice strong { color: inherit; }
.alert { border-radius: var(--radius-sm); padding: .8rem 1rem; margin: .5rem 0; background: var(--primary-soft); color: var(--ink); border: 1px solid var(--primary); }
.alert-success { background: var(--ok-soft); border-color: var(--ok); }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: var(--danger); }
.alert-warning { background: var(--warn-soft); border-color: var(--warn); }
.messages { padding-top: 1rem; }

/* ---------- lists, filters, pagination ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip[aria-current="true"], .chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: 2rem 0 0; padding: 0; list-style: none; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 .8rem; border-radius: 10px; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); background: var(--surface); }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }

/* ---------- compare table / tiers ---------- */
.compare { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare .yes { color: var(--ok); font-weight: 700; }
.compare .no { color: var(--muted); }
.plan { position: relative; }
.plan.is-best { border: 2px solid var(--primary); }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan .ribbon { position: absolute; top: -.8rem; left: 1rem; }
.check-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.check-list li { padding-left: 1.6rem; position: relative; margin-bottom: .45rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: .8rem; height: .45rem; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }
.check-list.no li::before { border: 0; content: "–"; top: 0; color: var(--muted); transform: none; font-weight: 700; }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .6rem; }
.faq summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; min-height: 48px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 1.1rem 1rem; color: var(--ink-2); }

/* ---------- forms ---------- */
.form { display: grid; gap: 1rem; max-width: 30rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel], .field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; min-height: 52px; padding: .65rem .9rem; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 1px; }
.field .help { font-size: .9rem; color: var(--muted); margin-top: .25rem; }
.field .error, .errorlist { color: var(--danger); font-size: .95rem; margin: .3rem 0 0; padding: 0; list-style: none; font-weight: 500; }
.field-check { display: flex; gap: .7rem; align-items: flex-start; }
.field-check input { width: 24px; height: 24px; margin-top: .2rem; flex: none; accent-color: var(--primary); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 32rem; margin-inline: auto; }
.auth-wrap { padding-block: 2rem 3rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- footer ---------- */
.site-footer { background: #0e1536; color: #cdd5f4; margin-top: 3rem; padding-top: 2.5rem; font-size: .95rem; }
.site-footer a { color: #e5e9ff; }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 40px; }
.footer-grid { display: grid; gap: 2rem; }
.footer-brand p { max-width: 34rem; }
.disclaimer { font-size: .88rem; color: #aab4de; }
.footer-bottom { border-top: 1px solid #263066; margin-top: 2rem; padding-block: 1rem 6rem; color: #aab4de; font-size: .88rem; }
.footer-bottom p { margin: 0; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } .footer-bottom { padding-bottom: 1.2rem; } }

/* ---------- Android app bar ---------- */
.app-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: .75rem; align-items: center; padding: .6rem var(--gutter); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(0,0,0,.12); min-height: 64px; }
.app-bar[hidden] { display: none; }
.app-bar p { margin: 0; flex: 1; font-size: .92rem; line-height: 1.35; }

/* ---------- exam facts ---------- */
.facts { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
@media (min-width: 700px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.facts b { display: block; font-size: 1.5rem; line-height: 1.2; color: var(--ink); }
.facts span { font-size: .88rem; color: var(--muted); }
.sample-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: .9rem; }
.sample-q .q-no { font-weight: 700; color: var(--primary); margin-bottom: .25rem; }
.sample-q ol { list-style: upper-alpha; margin: .5rem 0 0; }
.sample-q li { margin-bottom: .25rem; }
.sample-q .q-img { margin: .5rem 0; max-width: min(28rem, 100%); height: auto; }
.parts { display: grid; gap: .75rem; }
.part-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.part-row h3 { margin: 0; font-size: 1.05rem; }
.part-row .meta { color: var(--muted); font-size: .92rem; }

/* ---------- error pages ---------- */
.error-page { padding-block: 4rem; text-align: center; }
.error-code { font-size: clamp(4rem, 18vw, 8rem); font-weight: 800; line-height: 1; color: var(--primary); }

@media print { .site-header, .site-footer, .app-bar, .cta, .breadcrumbs { display: none !important; } body { background: #fff; color: #000; } }

/* ---------- layout safety (no horizontal overflow, nav never wraps) ---------- */
.grid, .hero-grid, .footer-grid, .article-layout { grid-template-columns: minmax(0, 1fr); }
.hero-grid > *, .grid > *, .article-layout > * { min-width: 0; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 880px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
@media (min-width: 800px) { .footer-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 960px) { .article-layout { grid-template-columns: minmax(0, 1fr) 20rem; } }
.site-nav li a, .nav-account .btn { white-space: nowrap; }
.nav-account { flex-wrap: nowrap; }
@media (max-width: 899px) { .nav-account { flex-wrap: wrap; } }
.hero h1, .hero .lead { overflow-wrap: anywhere; }
body { overflow-x: hidden; }
.article-cover img { max-height: 420px; width: 100%; object-fit: cover; }

/* Header dropdown (EPS TOPIK) */
.site-nav li.has-sub > a .caret { margin-left: .35rem; }
.site-nav .subnav { padding-left: 1rem; }
.site-nav .subnav a { min-height: 44px; font-weight: 400; }
@media (min-width: 900px) {
  .site-nav li.has-sub { position: relative; }
  .site-nav .subnav { display: none; position: absolute; top: 100%; left: 0; min-width: 16rem; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; z-index: 30; }
  .site-nav li.has-sub:hover > .subnav, .site-nav li.has-sub:focus-within > .subnav { display: flex; }
  .site-nav .subnav a { padding: 0 .75rem; white-space: nowrap; }
  .site-nav .subnav a[aria-current="page"] { box-shadow: none; background: var(--surface-2); border-radius: 8px; }
}

/* About page: founder block */
.founder { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 2rem; }
.founder-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.founder h2 { margin-top: 0; }
.founder .meta { color: var(--muted, #5b6573); font-size: .9rem; }

/* Home: legacy blocks restored 2026-10-30 (logo strip, feature splits, quote band, footer HQ) */
.logo-strip { background: #f2f2f2; padding-block: 1.5rem; }
.logo-strip-grid { display: grid; gap: 1rem; align-items: center; }
.logo-strip h2 { margin: 0; font-size: .85rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: #555; text-align: center; }
.logo-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem 1rem; align-items: center; }
.logo-row img { display: block; width: 100%; max-width: 120px; height: auto; margin-inline: auto; filter: grayscale(1); opacity: .65; }
@media (min-width: 800px) { .logo-strip-grid { grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; } .logo-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.eyebrow-dark { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.feature-split-grid { display: grid; gap: 2rem; align-items: center; }
.feature-split-grid > img { display: block; width: 100%; height: auto; max-width: 560px; margin-inline: auto; }
.feature-phone { max-width: 240px !important; }
.feature-list dt { margin-top: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.feature-list dt a { color: var(--ink); text-decoration: none; }
.feature-list dt a::after { content: " ›"; color: var(--muted); }
.feature-list dd { margin: .35rem 0 0; color: var(--muted); }
@media (min-width: 880px) { .feature-split-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 3rem; } .feature-split-rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.feature-center { text-align: center; }
.feature-center .container > p.muted { max-width: 44rem; margin-inline: auto; }
.feature-center img { display: block; width: 100%; max-width: 900px; height: auto; margin: 2rem auto 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.quote-band { background-size: cover; background-position: left center; min-height: 340px; display: flex; align-items: center; }
.quote-band blockquote { margin: 0 0 0 auto; max-width: 26rem; padding: 1.25rem 1.4rem; background: rgba(255,255,255,.88); border-radius: var(--radius-sm); color: #333; }
.quote-band blockquote p { margin: 0 0 .5rem; font-weight: 700; font-size: .95rem; }
.quote-band blockquote p[lang="ko"] { font-weight: 500; margin: 0; }
@media (max-width: 640px) { .quote-band { background-position: 30% center; min-height: 300px; align-items: flex-end; padding-bottom: 1rem; } }
.footer-hq h3 { font-size: 1rem; color: #fff; margin: 1rem 0 .4rem; }
.footer-hq p { margin: .2rem 0; }
.footer-about { margin-top: .5rem !important; }

/* Exam text laid out like the paper (htmlutil.exam_layout): wide answer blanks, boxed (가)-(라) ordering sentences, underlined keywords */
.blank { white-space: nowrap; }
.blank-gap { display: inline-block; width: 4.5em; }
.order-box { border: 1px solid var(--line, #cfd5dd); padding: .6rem .9rem; margin: .3rem 0 .6rem; line-height: 1.8; }
.q-prompt u, .passage u, .instructions u { text-decoration-thickness: 1px; text-underline-offset: .2em; }

/* "PRO sẽ được cập nhật sớm" dialog (base.html, site.js) */
.pro-soon { border: 0; border-radius: 14px; padding: 1.4rem 1.5rem; max-width: min(420px, calc(100vw - 32px)); background: var(--surface, #fff); color: inherit; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.pro-soon::backdrop { background: rgba(15, 20, 35, .55); }
.pro-soon h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.pro-soon p { margin: 0 0 1.1rem; line-height: 1.6; }
.pro-soon .pro-soon-actions { margin: 0; text-align: right; }
