:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1b1f2a; --muted: #6b7280; --line: #e5e7eb;
  --brand: #1d4ed8; --brand-ink: #ffffff; --ok: #15803d; --ok-bg: #ecfdf5; --bad: #b91c1c; --bad-bg: #fef2f2;
  --warn-bg: #fffbeb; --warn: #b45309; --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --card: #171b24; --ink: #e8eaf0; --muted: #9aa3b2; --line: #2a3140; --brand: #4f7df6; --ok: #34d399; --ok-bg: #0f2a1f; --bad: #f87171; --bad-bg: #2a1414; --warn-bg: #2a2410; --warn: #fbbf24; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 -apple-system, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.topbar .brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.topbar .brand small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; }
.topbar nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.topbar nav a.on { background: var(--bg); color: var(--ink); font-weight: 700; }
.topbar .user { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.card h1, .card h2 { margin: 0 0 8px; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; margin: 16px 0 6px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s; }
.q-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.q-text { font-size: 17px; font-weight: 600; white-space: pre-wrap; line-height: 1.55; margin: 0 0 14px; }
.choices { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.choice { width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); cursor: pointer; display: flex; gap: 10px; line-height: 1.5; }
.choice b { flex: 0 0 22px; color: var(--muted); font-weight: 700; }
.choice:hover:not(:disabled) { border-color: var(--brand); }
.choice.correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.picked b { color: var(--ink); }
.explain { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--bg); white-space: pre-wrap; font-size: 15px; }
.explain .verdict { font-weight: 800; margin-bottom: 6px; }
.explain .verdict.ok { color: var(--ok); } .explain .verdict.bad { color: var(--bad); }
.explain .basis { color: var(--muted); font-size: 13px; margin-top: 8px; }
.tiny { font-size: 12px; color: var(--muted); }
.tiny a { color: var(--muted); text-decoration: underline; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.bar { display: grid; grid-template-columns: 1fr 120px 44px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.bar:last-child { border-bottom: 0; }
.bar .track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--brand); }
.bar .track i.low { background: var(--bad); }
.bar .pct { text-align: right; font-variant-numeric: tabular-nums; }
details.subj summary { cursor: pointer; padding: 8px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.subj summary::-webkit-details-marker { display: none; }
details.subj .bar { font-size: 13px; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.funnel { border: 2px solid var(--brand); }
.ad { margin: 16px 0; min-height: 0; text-align: center; }
.ad .adsbygoogle { display: block; }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field label { font-size: 14px; font-weight: 600; }
.field input[type=date], .field input[type=number], .field input[type=email], .field textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); width: 100%; }
.field input[type=range] { width: 100%; }
.kbd { font-size: 12px; color: var(--muted); }
.spinner { padding: 40px; text-align: center; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cert-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); box-shadow: var(--shadow); }
.cert-card:hover { border-color: var(--brand); }
.cert-card .lvl { font-size: 12px; color: var(--muted); }
.cert-card h2 { margin: 2px 0 8px; font-size: 18px; }
.cert-card .meta { font-size: 13px; color: var(--muted); }
.cert-card.soon { opacity: .6; }
.hero { padding: 36px 0 12px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th, table.plain td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.plain th { color: var(--muted); font-weight: 600; }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 0; }
@media (max-width: 480px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } .bar { grid-template-columns: 1fr 80px 40px; } .topbar nav a { padding: 6px 8px; } }

/* 연상 암기 (2026-10-27) */
.explain .mnemonic { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--card); border: 1px dashed var(--line); white-space: normal; }
.explain .mn-title { font-weight: 800; font-size: 13px; color: var(--brand); margin-bottom: 4px; }
.explain .mn-text { font-size: 15px; line-height: 1.55; }
.explain .mnemonic img { display: block; width: 100%; max-width: 360px; margin: 10px auto 0; border-radius: 8px; aspect-ratio: 1 / 1; object-fit: cover; }
