/* ============================================================
   집에서 대치동 스타일
   ============================================================ */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5d6880;
  --line: #e3e8f2;
  --brand: #2f6fde;
  --brand-soft: #e8f0ff;
  --sun: #ffb84d;
  --sun-soft: #fff5e5;
  --green: #16924a;
  --green-soft: #e6f6ec;
  --red: #d33a3a;
  --red-soft: #fdecec;
  --teal: #0f8f8a;
  --teal-soft: #e2f5f4;
  --coral: #e0583a;
  --coral-soft: #fdeee9;
  --shadow: 0 6px 24px rgba(29, 36, 51, 0.06);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1626;
    --surface: #172036;
    --ink: #e8eefc;
    --muted: #9eabc8;
    --line: #28344f;
    --brand: #79a8ff;
    --brand-soft: #1f2d4d;
    --sun: #ffb84d;
    --sun-soft: #33291a;
    --green: #4ccf7f;
    --green-soft: #15301f;
    --red: #ff7b7b;
    --red-soft: #3a1c1f;
    --teal: #4fd1c9;
    --teal-soft: #123030;
    --coral: #ff8a6e;
    --coral-soft: #3a211b;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;          /* 한글이 단어 중간에서 끊기지 않게 */
  overflow-wrap: break-word;
}
a { color: var(--brand); }
button { font: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
main.wrap { padding-top: 24px; padding-bottom: 56px; min-height: 60vh; outline: none; }

/* ---------- 상단 바 ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { font-family: "Jua", sans-serif; font-size: 26px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav > a, .topnav > span, .nav-drop-btn { font-size: 15px; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topnav > a:hover, .nav-drop-btn:hover { background: var(--brand-soft); }
.topnav > a.active, .nav-drop-btn.active { background: var(--brand); color: #fff; }
.topnav > span { color: var(--muted); }
.topnav span small { font-size: 11px; margin-left: 4px; }
/* 학년 펼침 메뉴 */
.nav-drop { position: relative; display: flex; }
.nav-drop-btn { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 15px; line-height: inherit; }
.nav-drop-btn .caret { font-style: normal; font-size: 11px; margin-left: 4px; }
.nav-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 20; min-width: 150px; padding: 6px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.nav-drop.open .nav-menu, .nav-drop:focus-within .nav-menu { display: grid; }
@media (hover: hover) { .nav-drop:hover .nav-menu { display: grid; } }
.nav-drop:hover .nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-menu a, .nav-menu span { display: block; padding: 6px 12px; border-radius: 10px; font-size: 15px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav-menu a:hover { background: var(--brand-soft); }
.nav-menu span { color: var(--muted); }

/* ---------- 공통 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: var(--brand); color: #fff; border-radius: 12px;
  padding: 10px 18px; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.big { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.tag.sci { background: var(--green-soft); color: var(--green); }
.tag.soc { background: var(--sun-soft); color: #a76200; }
.tag.env { background: var(--teal-soft); color: var(--teal); }
@media (prefers-color-scheme: dark) { .tag.soc { color: var(--sun); } }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--sun); color: #4a2f00; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.section-title { font-family: "Jua", sans-serif; font-weight: 400; font-size: 26px; margin: 40px 0 14px; }

/* ---------- 홈 ---------- */
.hero { padding: 40px 30px; display: grid; gap: 18px; background:
  radial-gradient(circle at 92% 8%, var(--sun-soft), transparent 45%),
  radial-gradient(circle at 0% 100%, var(--brand-soft), transparent 50%), var(--surface); }
.hero h1 { font-family: "Jua", sans-serif; font-weight: 400; font-size: clamp(32px, 6.5vw, 52px); line-height: 1.22; margin: 0; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 600px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.values { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 16px; }
.value { padding: 20px; }
.value .icon { font-size: 30px; line-height: 1; }
.value b { display: block; font-size: 17px; margin: 8px 0 2px; }
.value p { margin: 0; color: var(--muted); font-size: 15px; }
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.series-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: transform 0.15s ease; }
a.series-card:hover { transform: translateY(-3px); }
.series-card .emoji { font-size: 40px; line-height: 1; }
.series-card h3 { font-family: "Jua", sans-serif; font-weight: 400; font-size: 24px; margin: 0; }
.series-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.series-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.series-card.soon { opacity: 0.75; box-shadow: none; border-style: dashed; }
.series-card.blue { border-top: 5px solid var(--brand); }
.series-card.green { border-top: 5px solid var(--green); }
.series-card.coral { border-top: 5px solid var(--coral); }
.series-card.teal { border-top: 5px solid var(--teal); }
.series-card.sun { border-top: 5px solid var(--sun); }
.level-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.soon-pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; counter-reset: step; }
.step { padding: 20px; }
.step b { display: block; font-size: 17px; margin-bottom: 4px; }
.step b::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; margin-right: 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- 시리즈 ---------- */
.series-head { padding: 26px; display: grid; gap: 14px; }
.series-head h1 { font-family: "Jua", sans-serif; font-weight: 400; font-size: clamp(28px, 5vw, 38px); margin: 0; line-height: 1.25; }
.series-head p { margin: 0; color: var(--muted); }
.series-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.unit-card { padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; transition: transform 0.15s ease, border-color 0.15s ease; }
.unit-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.unit-card .top { display: flex; align-items: center; justify-content: space-between; }
.unit-card .emoji { font-size: 34px; line-height: 1; }
.unit-card .num { font-size: 13px; font-weight: 700; color: var(--muted); }
.unit-card h3 { font-size: 18px; margin: 4px 0 0; line-height: 1.4; }
.unit-card .en { font-size: 14px; color: var(--muted); }

/* ---------- 유닛 ---------- */
.unit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.unit-head { padding: 26px 24px; }
.unit-head .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.unit-head h1 { font-family: "Jua", sans-serif; font-weight: 400; font-size: clamp(26px, 5.5vw, 38px); line-height: 1.3; margin: 12px 0 4px; }
.unit-head .subtitle { margin: 0; color: var(--muted); }
.download { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--sun-soft); border-color: transparent; box-shadow: none; }
.download strong { margin-right: auto; }
.download .hint { flex-basis: 100%; }
.block { padding: 24px; }
.block h2 { font-family: "Jua", sans-serif; font-weight: 400; font-size: 24px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.story p { font-size: 18px; margin: 0 0 14px; }
.story-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.translation { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: var(--brand-soft); }
.translation p { margin: 0 0 8px; }
.fact { padding: 18px 20px; border-radius: 14px; background: var(--sun-soft); border-left: 5px solid var(--sun); margin: 0; }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.word-card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.word-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.word { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; color: var(--brand); overflow-wrap: anywhere; }
.speak { border: 0; background: var(--brand-soft); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; flex: 0 0 auto; }
.meaning { font-weight: 700; margin: 2px 0 6px; }
.example { margin: 0; font-style: italic; }
.example-ko { margin: 0; color: var(--muted); font-size: 14px; }
.quiz-item { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.question { font-weight: 700; margin: 0 0 10px; }
.options { display: grid; gap: 8px; }
.option { text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.option:hover:not(:disabled) { border-color: var(--brand); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--green); background: var(--green-soft); }
.option.wrong { border-color: var(--red); background: var(--red-soft); }
.explain { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); font-size: 15px; }
.score { text-align: center; font-family: "Jua", sans-serif; font-size: 22px; padding: 16px; border-radius: 16px; background: var(--green-soft); }
.blanks { display: grid; gap: 10px; }
.blank-item { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.blank-item .gap { display: inline-block; min-width: 90px; border-bottom: 2px solid var(--muted); text-align: center; color: var(--green); font-weight: 700; }
.word-bank { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 14px; }
.word-bank span { font-weight: 700; font-size: 14px; background: var(--brand-soft); color: var(--brand); padding: 2px 10px; border-radius: 8px; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pager .btn { max-width: 100%; }
.empty { padding: 48px 24px; text-align: center; }
.empty .emoji { font-size: 48px; }
.empty h1 { font-family: "Jua", sans-serif; font-weight: 400; margin: 8px 0; }
.empty p { color: var(--muted); }

/* ---------- 레벨 표시 ---------- */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag.level { background: #ede7ff; color: #6a43d6; }
.tag.words { background: var(--line); color: var(--muted); }
@media (prefers-color-scheme: dark) { .tag.level { background: #2b2350; color: #b9a4ff; } }
.filter-rows { display: grid; gap: 0; margin: 22px 0 14px; }
.filter-rows .filters { margin: 0 0 8px; }

/* ---------- 수학 누적테스트 ---------- */
.points { margin: 0; padding-left: 20px; color: var(--ink); }
.points li { margin-bottom: 2px; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.test-card { padding: 20px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; border-top: 5px solid var(--green); transition: transform 0.15s ease; }
.test-card:hover { transform: translateY(-3px); }
.test-card .grade-num { font-family: "Jua", sans-serif; font-size: 34px; line-height: 1.1; color: var(--green); }
.test-card .test-when { font-weight: 700; }
.test-card p { margin: 0; color: var(--muted); font-size: 14px; }
.howto p { margin: 0; }
.problem { padding: 20px 22px; }
.problem.is-wrong { border-color: var(--red); }
.p-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.p-no { font-weight: 700; font-size: 15px; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 1px 10px; }
.p-tag { font-size: 13px; color: var(--muted); background: var(--line); border-radius: 999px; padding: 1px 10px; }
.p-status { margin-left: auto; font-weight: 700; font-size: 14px; }
.p-status.right { color: var(--green); }
.p-status.wrong { color: var(--red); }
.p-q { margin: 0 0 12px; font-size: 17px; white-space: pre-line; }
.figure { margin: 4px 0 14px; overflow-x: auto; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.choice { text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.choice:hover:not(:disabled) { border-color: var(--brand); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice.correct { border-color: var(--green); background: var(--green-soft); }
.choice.wrong { border-color: var(--red); background: var(--red-soft); }
.choice:disabled { cursor: default; }
.cnum { font-weight: 700; }
.short { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.answer-input { flex: 0 1 220px; min-width: 0; font: inherit; font-weight: 500; padding: 9px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.answer-input:focus { outline: none; border-color: var(--brand); }
.p-feedback { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); font-size: 15px; }
.p-feedback p { margin: 0 0 4px; }
.grade-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.result { padding: 24px; }
.result h2 { font-family: "Jua", sans-serif; font-weight: 400; font-size: 26px; margin: 0 0 10px; }
.result h3 { font-size: 17px; margin: 22px 0 10px; }
.score-big { font-family: "Jua", sans-serif; font-size: 44px; line-height: 1.1; color: var(--brand); }
.score-big small { font-size: 22px; color: var(--muted); }
.rates { display: grid; gap: 8px; }
.rate { display: grid; grid-template-columns: 120px 1fr 110px; align-items: center; gap: 10px; font-size: 15px; }
.rate-bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.rate-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.rate.low .rate-bar i { background: var(--red); }
.rate.low .rate-num, .rate.low .rate-label { color: var(--red); font-weight: 700; }
.rate-num { text-align: right; color: var(--muted); }
.weak { margin: 0; padding-left: 20px; }
.weak li { margin-bottom: 3px; font-weight: 500; }
.perfect { font-weight: 700; color: var(--green); }
@media (max-width: 560px) {
  .problem, .result { padding: 18px 16px; }
  .rate { grid-template-columns: 92px 1fr 86px; font-size: 13px; }
}

/* ---------- 그림 ---------- */
.fig { max-width: 100%; height: auto; color: var(--ink); overflow: visible; }
.fig-line { stroke: currentColor; stroke-width: 1.6; fill: none; }
.fig-thin { stroke: currentColor; stroke-width: 0.8; opacity: 0.6; fill: none; }
.fig-face { stroke: currentColor; stroke-width: 1.6; fill: var(--surface); }
.fig-shade { fill: var(--brand); fill-opacity: 0.35; }
.fig-grid { stroke: var(--line); stroke-width: 1; }
.fig-grid.minor { stroke-dasharray: 2 3; }
.fig-axis { stroke: currentColor; stroke-width: 1.3; }
.fig-bar { fill: var(--brand); fill-opacity: 0.75; }
.fig-poly { stroke: var(--brand); stroke-width: 2.2; fill: none; }
.fig-poly-shape { fill: var(--brand); fill-opacity: 0.08; }
.fig-text { fill: currentColor; font-size: 13px; }
.fig-small { font-size: 12px; }
.fig-title { font-weight: 700; }
.fig-hand { stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.fig-hand.hour { stroke-width: 4.5; }
.fig-dot { fill: currentColor; }
.fig-mark { fill: var(--red); }
.fig-tiny { font-size: 10.5px; }
.fig-curve { stroke: var(--brand); stroke-width: 2.2; fill: none; }
.fig-curve-label { fill: var(--brand); font-weight: 700; }
.fig-dashed { stroke-dasharray: 5 4; }
.fig-angle { stroke-width: 1.3; }
.fig-hist { stroke: currentColor; stroke-width: 1; }
.fig-box { fill: var(--brand-soft); }
.fig-median { stroke-width: 2.4; }
.also { margin-top: 6px !important; font-size: 14px; color: var(--muted); }
.test-card.mid { border-top-color: var(--brand); }
.test-card.mid .grade-num { color: var(--brand); }
/* 저학년 그림 */
.fig-objects { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.obj-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.obj-box { display: grid; gap: 2px 6px; padding: 8px 10px; min-width: 44px; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.obj { font-size: 26px; line-height: 1.15; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.obj-label { font-weight: 700; font-size: 15px; }
.fig-cube { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1; }
.fig-cube.one { fill: var(--sun-soft); stroke: #c47d00; }
.fig-rod { fill: none; stroke: var(--brand); stroke-width: 2; }
.fig-len { stroke: currentColor; stroke-width: 1; fill-opacity: 0.55; }
.fig-len.c0 { fill: var(--brand); }
.fig-len.c1 { fill: var(--sun); }
.fig-len.c2 { fill: var(--green); }
.fig-len.c3 { fill: var(--coral); }
.fig-len-sep { stroke: currentColor; stroke-width: 0.8; opacity: 0.55; }
.fig-seq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seq-item { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 24px; font-weight: 700; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Noto Sans KR", sans-serif; }
.seq-item.blank { border: 2px dashed var(--brand); color: var(--brand); background: var(--brand-soft); }
@media (max-width: 560px) {
  .obj { font-size: 18px; }
  .obj-box { gap: 2px 3px; padding: 6px 8px; }
  .fig-seq { gap: 6px; }
  .seq-item { min-width: 38px; height: 38px; font-size: 20px; padding: 0 6px; }
}
.fig-table { border-collapse: collapse; font-size: 15px; }
.fig-table th, .fig-table td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; }
.fig-table th { background: var(--brand-soft); }

/* ---------- 초등 단원평가 ---------- */
.test-card.ut { border-top-color: var(--sun); }
.test-card.ut .grade-num { color: #b86e00; }
.test-card.ut.soon { opacity: 0.7; box-shadow: none; border-style: dashed; border-top-style: solid; }
.test-card.ut.soon:hover { transform: none; }
@media (prefers-color-scheme: dark) { .test-card.ut .grade-num { color: var(--sun); } }
.grade-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip { text-decoration: none; }
.chip.off { color: var(--muted); border-style: dashed; cursor: default; }
.ut-card .ut-no { font-family: "Jua", sans-serif; font-size: 22px; color: #b86e00; line-height: 1.2; }
@media (prefers-color-scheme: dark) { .ut-card .ut-no { color: var(--sun); } }
.ut-card .ut-sum { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-kind { font-size: 13px; font-weight: 700; color: #a76200; background: var(--sun-soft); border-radius: 999px; padding: 1px 10px; }
@media (prefers-color-scheme: dark) { .p-kind { color: var(--sun); } }
.p-status.pending { color: #a76200; }
.essay-input { display: block; width: 100%; font: inherit; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); resize: vertical; }
.essay-input:focus { outline: none; border-color: var(--brand); }
.self-mark { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 700; }
.self-mark span { margin-right: 4px; }
.self-btn { padding: 7px 14px; }
.self-btn.btn:not(.line) { background: var(--surface); color: var(--green); border: 2px solid var(--green); }
.self-btn.btn.line { border: 2px solid var(--line); color: var(--red); }
.self-btn.btn:not(.line).on { background: var(--green); color: #fff; }
.self-btn.btn.line.on { background: var(--red); border-color: var(--red); color: #fff; }
.pending-note { font-weight: 700; color: #a76200; margin: 8px 0 0; }
.verdict { font-weight: 700; margin: 8px 0 0; }
.rates.wide .rate { grid-template-columns: minmax(120px, 210px) 1fr 110px; }
@media (max-width: 560px) { .rates.wide .rate { grid-template-columns: 1fr 86px; } .rates.wide .rate-bar { grid-column: 1 / -1; grid-row: 2; } }
.official-list { margin: 0; padding-left: 20px; }
.official-list li { margin-bottom: 4px; }
.official .hint { margin-top: 10px; }

/* ---------- 소개·안내 페이지 ---------- */
.legal { padding: 30px 28px; max-width: 760px; }
.legal h1 { font-family: "Jua", sans-serif; font-weight: 400; font-size: clamp(26px, 5vw, 36px); line-height: 1.3; margin: 0 0 10px; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 20px; margin: 0; }
.legal li { margin-bottom: 4px; }
.legal .lead { font-size: 17px; color: var(--muted); margin: 0; }
.legal .muted { color: var(--muted); font-size: 14px; margin-top: 24px; }
.legal .cta { margin-top: 28px; }

/* ---------- 하단 ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.site-foot .wrap { padding-top: 22px; padding-bottom: 30px; }
.site-foot p { margin: 3px 0; }
.site-foot a { color: var(--muted); }
.site-foot .foot-note { font-size: 12px; margin-top: 8px; }

@media (max-width: 560px) {
  .hero { padding: 28px 20px; }
  .block, .unit-head, .series-head, .legal { padding: 20px 18px; }
  .story p { font-size: 17px; }
  .logo { font-size: 23px; }
  .topnav > a, .topnav > span, .nav-drop-btn { padding: 5px 9px; font-size: 14px; }
}

/* ============================================================
   학습지 인쇄 (PDF 저장)
   ============================================================ */
#print-root { display: none; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body.is-printing > *:not(#print-root) { display: none !important; }
  body.is-printing #print-root { display: block; }
  body { background: #fff; color: #111; }
}

.ws { color: #111; background: #fff; font-size: 11.5pt; line-height: 1.6; }
.ws + .ws { break-before: page; page-break-before: always; }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 12px; }
.ws-brand { font-weight: 700; font-size: 10pt; }
.ws-brand span { color: #555; font-weight: 400; }
.ws-name { font-size: 10.5pt; white-space: nowrap; }
.ws-teacher { font-size: 10pt; font-weight: 700; border: 1.5px solid #111; border-radius: 6px; padding: 1px 8px; }
.ws-title { font-family: "Jua", sans-serif; font-weight: 400; font-size: 20pt; line-height: 1.3; margin: 0; }
.ws-sub { margin: 2px 0 10px; color: #444; font-size: 10.5pt; }
.ws h2 { font-size: 12.5pt; margin: 16px 0 6px; padding: 3px 10px; background: #eef2f8; border-radius: 6px; break-after: avoid; page-break-after: avoid; }
.ws-story p { margin: 0 0 7px; font-size: 12pt; }
.ws-trans { margin-top: 6px; padding: 8px 12px; border: 1px solid #ccd3df; border-radius: 6px; font-size: 10.5pt; }
.ws-trans p { margin: 0 0 4px; }
.ws-fact { margin-top: 8px; padding: 8px 12px; border-left: 4px solid #f0a33a; background: #fff7ea; font-size: 10.5pt; }
.ws table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.ws th, .ws td { border: 1px solid #bfc7d4; padding: 5px 8px; text-align: left; vertical-align: top; }
.ws th { background: #f3f5f9; }
.ws td.write { height: 26px; }
.ws-q { margin: 0 0 8px; break-inside: avoid; page-break-inside: avoid; }
.ws-q p { margin: 0; }
.ws-opts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 2px 0 0 18px; }
.ws-opts .right { font-weight: 700; text-decoration: underline; }
.ws-exp { margin: 3px 0 0 18px; font-size: 10pt; color: #333; }
.ws-bank { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 1px dashed #999; border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; font-weight: 700; font-size: 10.5pt; }
.ws-blank { margin: 0 0 6px; }
.ws-blank .gap { display: inline-block; min-width: 80px; border-bottom: 1px solid #111; text-align: center; font-weight: 700; }
.ws-foot { margin-top: 14px; padding-top: 6px; border-top: 1px solid #ccc; font-size: 9pt; color: #666; display: flex; justify-content: space-between; }

/* 수학 시험지 */
.mws .ws-sub { margin-bottom: 8px; }
.mws-problems { column-count: 2; column-gap: 9mm; column-rule: 1px solid #ddd; }
.mws-p { break-inside: avoid; page-break-inside: avoid; padding: 0 0 5mm; }
.mws-q { margin: 0 0 3px; font-size: 10.5pt; white-space: pre-line; }
.mws-fig { margin: 2px 0 4px; }
.mws-fig .fig { max-width: 78mm; max-height: 42mm; width: auto; height: auto; }
.mws-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; font-size: 10pt; margin-left: 12px; }
.mws-ans { margin: 4px 0 0 12px; font-size: 10pt; }
.mws-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px 8px; font-size: 10pt; border: 1px solid #ccd3df; border-radius: 6px; padding: 6px 10px; }
.mws-tag { font-weight: 400; color: #555; font-size: 9.5pt; }
.ws .fig { color: #111; }
/* 단원평가 시험지 */
.uws-box { margin: 4px 0 0 12px; height: 30mm; border: 1px solid #999; border-radius: 4px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 7mm, #ddd 7mm, #ddd 7.3mm); }
.ws .fig-objects { gap: 2mm 3mm; }
.ws .obj-box { padding: 1mm 2mm; min-width: 0; min-height: 0; border-color: #999; border-radius: 4px; background: #fff; gap: 0 1.5mm; }
.ws .obj { font-size: 13pt; }
.ws .obj-label { font-size: 9.5pt; }
.ws .seq-item { min-width: 9mm; height: 9mm; font-size: 13pt; border-color: #999; border-radius: 4px; }
.ws .seq-item.blank { border-color: #111; background: #fff; color: #111; }
.ws .fig-table { font-size: 9.5pt; }
.ws .fig-table th, .ws .fig-table td { padding: 2px 6px; border-color: #999; }
.ws .fig-table th { background: #f3f5f9; }
.ws .fig-face { fill: #fff; }
.ws .fig-grid { stroke: #ccc; }
.ws .fig-bar, .ws .fig-shade { fill: #8fb0ea; fill-opacity: 1; }
.ws .fig-poly { stroke: #2f6fde; }
.ws .fig-poly-shape { fill: #eef3fd; fill-opacity: 1; }
.ws .fig-mark { fill: #d33a3a; }
.ws .fig-curve { stroke: #2f6fde; }
.ws .fig-curve-label { fill: #2f6fde; }
.ws .fig-box { fill: #eef3fd; }
.ws .fig-table { font-size: 9.5pt; }
.ws .fig-table th, .ws .fig-table td { border-color: #bfc7d4; padding: 3px 8px; }
.ws .fig-table th { background: #f3f5f9; }
