:root {
  color-scheme: light;
  --bg: #f7f6ef;
  --card: #fffefb;
  --ink: #1d342e;
  --muted: #52665d;
  --line: #d7ddd0;
  --accent: #dbec9a;
  --green: #294a3c;
  --warm: #8b4233;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .53; cursor: default; }
:focus-visible { outline: 3px solid #457c70; outline-offset: 4px; }
h1, h2, p { margin: 0; }
.frame { width: min(100% - 64px, 1120px); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { background: none; border: 0; padding: 0; display: inline-flex; gap: 10px; align-items: center; font-size: 1.12rem; font-weight: 800; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: white; font-size: 1.32rem; }
.topbar-note { color: var(--muted); font-size: .9rem; }
.hero { display: grid; grid-template-columns: 1fr .96fr; gap: clamp(28px, 6vw, 86px); align-items: center; padding: 62px 0 40px; }
.hero-copy { padding: 6px 0; }
.eyebrow { color: var(--green); font-weight: 800; font-size: .87rem; line-height: 1.5; }
.eyebrow-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: #698748; }
.hero h1 { margin-top: 13px; font-size: clamp(2.85rem, 6vw, 5.5rem); line-height: 1.1; letter-spacing: -.075em; }
.hero-description { color: var(--muted); margin: 24px 0 25px; line-height: 1.75; font-size: 1.03rem; word-break: keep-all; }
.button { min-height: 47px; display: inline-flex; gap: 16px; align-items: center; justify-content: center; padding: 10px 19px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; line-height: 1.4; }
.button-primary { background: var(--accent); border-color: #c8db86; }
.button-primary:not(:disabled):hover { background: #cfe482; }
.button-secondary { background: var(--card); border-color: var(--line); }
.button-secondary:not(:disabled):hover { border-color: #7f9986; background: #f3f7ed; }
.hero .button { min-height: 56px; padding-inline: 21px; }
.hero-visual { padding: clamp(22px, 4.2vw, 55px); display: grid; place-items: center; border-radius: 24px; border: 1px solid #d8dfca; background: #e9eddd; }
.sheet { width: 100%; background: var(--card); padding: 19px; border: 1px solid #ccd3c2; border-radius: 13px; box-shadow: 0 10px 22px #233e3020; }
.sheet-top, .sheet-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-top { color: var(--green); font-weight: 800; padding-bottom: 13px; font-size: .93rem; }
.sheet-top span:last-child { border-radius: 5px; background: #edf1e5; padding: 3px 7px; font-variant-numeric: tabular-nums; }
.sheet-drawing { display: block; width: 100%; }
.sheet-bottom { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 13px; font-size: .71rem; color: var(--muted); }
.sheet-bottom span:last-child { white-space: nowrap; font-weight: 800; }
.overview { margin: 0 0 58px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 1px solid var(--line); padding-top: 22px; }
.overview dt { font-size: .82rem; color: var(--muted); }
.overview dd { margin: 5px 0 0; font-size: 1rem; font-weight: 800; }
.work-area { max-width: 800px; margin: 35px auto 56px; }
.work-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.work-header h1, .score-card h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.055em; line-height: 1.25; }
.status-pill { background: #e6edda; color: var(--green); border: 1px solid #d5dfc9; border-radius: 999px; padding: 8px 12px; font-size: .84rem; font-weight: 800; white-space: nowrap; }
.exam-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.exam-status:has(#exam-timer:not([hidden])) { position: sticky; top: 0; z-index: 2; background: var(--bg, #f6f5ee); padding-block: 6px; }
#exam-time { font-variant-numeric: tabular-nums; }
#exam-timer.ending { background: #fce9dd; border-color: #f0c6ad; color: #802f17; }
#exam-save-status { flex-basis: 100%; margin: 0; }
.question-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.nav-number { min-width: 44px; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 800; }
.nav-number.answered { background: #e9efdd; }
.nav-number[aria-current="step"] { background: var(--green); border-color: var(--green); color: white; }
.question-card, .review { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: clamp(17px, 4vw, 29px); }
.question-card h2, .review h3 { margin: 5px 0 14px; font-size: 1.13rem; line-height: 1.65; overflow-wrap: anywhere; word-break: keep-all; }
.figure { background: #f5f7ee; border-radius: 9px; margin: 0 0 15px; text-align: center; }
.figure svg { width: min(100%, 290px); height: auto; display: block; margin: auto; }
.figure svg text { fill: var(--ink); font-size: 14px; font-family: inherit; }
.question-illustration { background: #eff6f8; border: 1px solid #dce9ee; padding: 6px 7px 9px; }
.question-illustration svg { width: min(100%, 430px); }
.question-illustration figcaption { color: var(--muted); font-size: .81rem; font-weight: 700; }
.table-wrap { margin-bottom: 16px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .83rem; text-align: center; }
caption { text-align: left; padding-bottom: 7px; color: var(--muted); font-weight: 800; }
th, td { border: 1px solid var(--line); padding: 8px 5px; overflow-wrap: anywhere; }
th { background: #edf2e5; }
.option-list { margin: 0; padding: 0; display: grid; gap: 7px; border: 0; min-width: 0; }
.option { display: flex; align-items: center; gap: 11px; min-height: 45px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.option:has(input:checked) { border-color: #507561; background: #eef5e4; }
.option:hover { border-color: #7f9986; }
.option input { margin: 0; width: 17px; height: 17px; accent-color: var(--green); flex: none; }
.option-letter { color: var(--muted); font-weight: 800; }
.actions, .actions-pair { display: flex; gap: 9px; align-items: center; }
.home-quiz-actions { flex-wrap: wrap; }
.actions { justify-content: space-between; margin-top: 15px; }
.message { color: var(--warm); line-height: 1.6; font-size: .91rem; }
.message:not(:empty) { margin-top: 9px; }
.score-card { border: 1px solid #d2dfbd; border-radius: 15px; background: #eaf0da; padding: clamp(18px, 4vw, 32px); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.score-card h1 { margin: 3px 0 9px; }
#score-count { color: var(--muted); }
.score { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 800; white-space: nowrap; letter-spacing: -.07em; }
.score small { font-size: .28em; letter-spacing: 0; }
.review-header { margin: 23px 0 12px; }
.review-header h2 { font-size: 1.12rem; }
.reviews { display: grid; gap: 11px; }
.review { padding-block: 17px; }
.review-meta { font-size: .83rem; color: var(--muted); font-weight: 800; }
.review-correct { color: var(--green); }
.review-incorrect { color: var(--warm); }
.review-answers { display: flex; gap: 7px 20px; flex-wrap: wrap; font-size: .92rem; margin-bottom: 8px; }
.review-explanation { color: var(--muted); font-size: .94rem; line-height: 1.7; word-break: keep-all; }
.result-rank { margin-top: 9px; font-size: 1.1rem; font-weight: 800; }
.answer-rate, .question-report { margin-top: 12px; }
.report-form { display: grid; gap: 8px; justify-items: start; margin-top: 8px; }
.report-form label, .report-form textarea { width: 100%; }
.report-form textarea { display: block; margin-top: 4px; resize: vertical; }
.question-report .message:empty { display: none; }
.admin-reports { margin-bottom: 12px; }
.admin-reports .reviews:not(:empty), .report-reason { margin-top: 12px; }
.report-reason { white-space: pre-wrap; overflow-wrap: anywhere; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; padding: 17px 0; }
.footer span { margin-inline: 4px; }
.footer a, .topbar-note { color: var(--muted); }
.brand-link { color: var(--ink); text-decoration: none; }
.admin-hint, .admin-note { margin: 8px 0 12px; line-height: 1.6; font-size: .91rem; }
.admin-note { color: var(--warm); }
.admin-controls, .admin-summary, .admin-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.admin-summary, .admin-line { justify-content: space-between; }
.admin-summary { margin: 14px 0; }
.admin-input { min-width: 0; min-height: 45px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.course-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 12px; }
.course-controls label { display: grid; gap: 4px; min-width: min(100%, 125px); max-width: 100%; font-size: .9rem; }
.course-controls select { width: 100%; max-width: 100%; background: var(--card); color: inherit; }
.question-prompt { white-space: pre-line; }
.passage-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-block: 10px 14px; padding: 12px; }
.passage-panel summary { cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.passage-byline { font-size: .85rem; margin: 9px 0 0; line-height: 1.55; }
.passage-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; max-height: 42vh; overflow: auto; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.passage-notes { margin-top: 9px; font-size: .92rem; }
.passage-notes p { margin: 6px 0; }
.admin-line { cursor: pointer; padding-block: 4px; }
.admin-line strong { font-size: .97rem; }
.admin-question[open] .admin-line { margin-bottom: 12px; }
.admin-options { font-size: .93rem; line-height: 1.6; }
.student-hint { margin-top: 10px; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.student-hint:not(:empty) { margin-bottom: 10px; }
.account-switch [aria-pressed="true"] { color: white; background: var(--green); }
.account-form { display: grid; gap: 9px; max-width: 370px; margin-top: 20px; }
.account-form label { font-weight: 800; }
.account-form .button { justify-self: start; margin-top: 4px; }
.history-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.history-row p { margin-top: 5px; color: var(--muted); font-size: .85rem; }
.study-empty { color: var(--muted); line-height: 1.6; }
.wrong-summary { cursor: pointer; font-weight: 800; line-height: 1.55; }
.wrong-summary + article { margin-top: 14px; }
.review-header .actions-pair { flex-wrap: wrap; }
.family-actions, .family-link, .invite-box { margin-block: 12px; }
.family-actions a { color: var(--ink); text-decoration: none; }
.invite-box { background: #eaf0da; border-radius: 8px; padding: 12px; }
.invite-box output { display: block; font-family: monospace; letter-spacing: .09em; font-size: 1.12rem; font-weight: 800; overflow-wrap: anywhere; }
.family-link { border-top: 1px solid var(--line); padding-top: 10px; }
.parent-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 15px 0 0; }
.parent-metrics > div { background: #edf2e5; border-radius: 9px; padding: 11px; }
.parent-metrics dt { color: var(--muted); font-size: .86rem; }
.parent-metrics dd { margin: 6px 0 0; font-size: 1.23rem; font-weight: 800; }
.child-button[aria-pressed="true"] { color: white; background: var(--green); }
.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list li { border-top: 1px solid var(--line); padding-block: 10px; }
.study-actions { flex-wrap: wrap; justify-content: flex-end; }
.study-actions a { color: var(--ink); text-decoration: none; }
.billing-banner { padding: 12px 15px; border: 1px solid #e2d8b3; border-radius: 10px; background: #f7f0d9; margin-bottom: 14px; line-height: 1.55; }
.billing-checkout { margin-top: 14px; }
.message-success { color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 690px) {
  .frame { width: calc(100% - 34px); }
  .topbar-inner { min-height: 60px; }
  .hero { grid-template-columns: 1fr; padding: 31px 0 23px; gap: 23px; }
  .hero h1 { font-size: clamp(2.75rem, 10vw, 4rem); }
  .hero-description { margin-block: 16px 19px; }
  .desktop-break { display: none; }
  .hero-visual { padding: 21px; }
  .sheet { max-width: 340px; }
  .overview { gap: 14px; margin-bottom: 34px; padding-top: 15px; }
  .overview dd { font-size: .83rem; word-break: keep-all; }
  .work-area { margin-block: 24px 39px; }
  .question-card h2, .review h3 { font-size: 1.03rem; }
  table { font-size: .75rem; }
  th, td { padding-inline: 3px; }
  .actions .button { padding-inline: 10px; }
}

.dashboard-theme {
  --bg: #f1f4fc;
  --card: #fff;
  --ink: #132443;
  --muted: #4c6083;
  --line: #d7e0f4;
  --accent: #294ac7;
  --green: #2647bc;
}
.dashboard-theme .frame { width: min(100% - 36px, 850px); }
.dashboard-theme .topbar { background: #f1f4fc; }
.dashboard-theme .brand-icon { background: #294ac7; }
.dashboard-theme .button-primary { background: #294ac7; border-color: #294ac7; color: white; }
.dashboard-theme .button-primary:hover:not(:disabled) { background: #1e399f; }
.dashboard-theme .button-secondary, .dashboard-theme .admin-input { background: #fff; }
.dashboard-theme :focus-visible { outline-color: #395cd3; }
.dashboard-theme .eyebrow { color: #2848a7; }
.dashboard-theme .eyebrow-dot { background: #294ac7; }
.dashboard-theme .admin-input { color: var(--ink); border-color: var(--line); }
.student-theme #home-view { padding-block: 20px 32px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.dashboard-heading > span, .dashboard-heading label { color: var(--muted); font-size: .84rem; font-weight: 700; }
.dashboard-heading select { min-height: 37px; margin-inline-start: 5px; }
.student-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
  background: linear-gradient(120deg, #ecf1ff, #e0e9fe); border: 1px solid #d0ddfb;
  border-radius: 24px; padding: clamp(18px, 5vw, 44px); margin-top: 12px;
}
.student-hero h1 { margin-top: 8px; font-size: clamp(2rem, 6vw, 3.8rem); line-height: 1.1; letter-spacing: -.065em; }
.student-hero h1 + p { color: var(--muted); margin: 13px 0 20px; line-height: 1.55; word-break: keep-all; }
.recent-score-card {
  width: clamp(90px, 18vw, 144px); border-radius: 18px; background: #fff; color: #233e8d;
  text-align: center; padding: 12px 5px; display: grid; justify-items: center; gap: 8px; box-shadow: 0 12px 30px #203e8a12;
}
.recent-score-card span, .recent-score-card small { font-size: .71rem; font-weight: 700; }
.recent-score-ring { display: grid; place-items: center; width: clamp(52px, 11vw, 76px); aspect-ratio: 1; }
.recent-score-ring > * { grid-area: 1 / 1; }
.recent-score-ring svg { width: 100%; fill: none; stroke: #e2eaff; stroke-width: 7; transform: rotate(-90deg); }
.recent-score-ring svg circle:last-child { stroke: #4a64da; }
.recent-score-ring strong { color: var(--ink); font-size: clamp(1.25rem, 4vw, 1.75rem); }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 12px 0 23px; }
.dashboard-shortcut {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 9px; align-content: center; align-items: center;
  text-align: left; min-height: 76px; padding: 12px; border: 1px solid var(--line); background: white; border-radius: 15px;
}
.dashboard-shortcut > span { grid-row: span 2; color: #294ac7; background: #eaf0ff; border-radius: 9px; padding: 5px 8px; font-weight: 800; }
.dashboard-shortcut small { color: var(--muted); font-size: .75rem; }
.dashboard-shortcut:hover:not(:disabled), .subject-tile:hover:not(:disabled) { border-color: #4a64da; }
.course-panel .course-controls { margin-top: 12px; }
.course-panel .dashboard-heading h2, .parent-panel h2, .parent-link-card h2 { font-size: 1.08rem; }
.subject-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.subject-tile {
  display: grid; place-items: center; gap: 5px; min-height: 64px; padding: 5px;
  border-radius: 11px; border: 1px solid var(--line); background: #fff; font-size: .85rem;
}
.subject-tile span { display: grid; place-items: center; width: 29px; height: 27px; border-radius: 7px; background: #e4e9ff; color: #2944ae; font-weight: 800; }
.subject-tile[data-subject="korean"] span { background: #f9e6e3; color: #8f3123; }
.subject-tile[data-subject="social"] span { background: #faeedc; color: #785115; }
.subject-tile[data-subject="science"] span { background: #e0f2e9; color: #175b44; }
.subject-tile[data-subject="english"] span { background: #eee4fa; color: #654193; }
.subject-tile[aria-pressed="true"] { border-color: #294ac7; box-shadow: inset 0 0 0 1px #294ac7; }
.mock-card { display: grid; gap: 12px; }
.mock-card .student-hint { margin: 0; }
.mock-card progress { width: 100%; accent-color: #294ac7; }
.premium-stack { display: grid; gap: 14px; }
.premium-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.premium-stack h3 { margin: 12px 0 6px; }
.premium-stack .course-controls { margin-top: 0; }
.premium-stack details { margin-top: 12px; }
.premium-stack details summary { cursor: pointer; }
#premium-locked .button { margin-top: 12px; }
#referral-invite { background: #eaf0ff; }
#referral-url { width: 100%; margin-top: 8px; }

.parent-theme .frame { width: min(100% - 36px, 720px); }
.parent-badge { border-radius: 100px; background: #e4ebff; color: #2544a0; padding: 7px 13px; font-size: .78rem; font-weight: 800; }
.parent-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 10px; }
.parent-heading h1 { margin-top: 6px; font-size: clamp(1.85rem, 5vw, 2.8rem); letter-spacing: -.055em; }
.parent-heading .admin-input { max-width: 160px; border-radius: 100px; }
.parent-score-grid { margin: 0; gap: 10px; }
.parent-score-grid > div { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 14px; }
.parent-score-grid > div:first-child { background: #2647bc; border-color: #2647bc; color: white; }
.parent-score-grid dt, .parent-metric-detail { font-size: .79rem; color: var(--muted); }
.parent-score-grid > div:first-child :is(dt, .parent-metric-detail) { color: #e3ebff; }
.parent-score-grid dd { font-size: clamp(1.35rem, 5vw, 2.1rem); margin: 6px 0; }
.parent-metric-detail { display: block; margin-top: 5px; font-weight: 400; }
.parent-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-top: 10px; }
.parent-panel h2 { margin-bottom: 8px; }
.parent-bar {
  display: grid; grid-template-columns: 2.1em minmax(0, 1fr) 2.6em; align-items: center;
  gap: 9px; text-align: left; width: 100%; border: 0; border-radius: 8px; padding: 6px 3px; background: #fff; font-size: .83rem;
}
.parent-bar[aria-pressed="true"] { background: #eef2ff; }
.parent-bar span { text-align: right; }
.parent-bar progress { width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; accent-color: #3659ce; }
.parent-bar progress::-webkit-progress-bar { background: #e5ebf9; border-radius: 8px; }
.parent-bar progress::-webkit-progress-value { background: #3659ce; border-radius: 8px; }
.parent-bar progress::-moz-progress-bar { background: #3659ce; border-radius: 8px; }
.parent-units li p { color: var(--muted); font-size: .78rem; margin-top: 3px; }
.parent-units li.history-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
.unit-badge { background: #e9eeff; color: #2945a3; font-size: .78rem; font-weight: 800; padding: 7px; border-radius: 8px; }
.parent-manage, .parent-account-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.parent-link-card { margin-top: 22px; }
.parent-nav {
  position: sticky; bottom: 0; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-top: 16px; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 7px;
}
.parent-nav a { display: grid; justify-items: center; gap: 2px; color: var(--muted); text-decoration: none; border-radius: 8px; padding: 5px; font-size: .78rem; }
.parent-nav a span { font-size: 1.12rem; }
.parent-nav a[aria-current] { color: #2747ab; background: #e6edff; font-weight: 800; }
@media (max-width: 500px) {
  .dashboard-theme .frame { width: calc(100% - 28px); }
  .dashboard-theme .topbar-inner { min-height: 58px; }
  .dashboard-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-shortcut:last-child { grid-column: 1 / -1; min-height: 57px; }
  .dashboard-shortcut { padding: 9px; }
  .dashboard-shortcut small { font-size: .7rem; }
}
.public-service a[href="/billing"],
.signup-paused #signup-mode,
.signup-paused #parent-signup-mode {
  display: none;
}
