:root {
  --bg: #FFF8F1;
  --surface: #FFFFFF;
  --surface-2: #FBEFE6;
  --ink: #3B2F2A;
  --muted: #8C7A72;
  --line: #F1DFD4;
  --line-strong: #DCC3B5;
  --primary: #E8705C;
  --primary-hover: #D65C48;
  --primary-ink: #FFFFFF;
  --primary-soft: #FDE4DE;
  --accent: #FFD166;
  --accent-soft: #FFF3C9;
  --accent-ink: #5A4300;
  --mint: #BFE8DD;
  --sky: #CFE5FA;
  --good: #3A9C7A;
  --warn: #C77B2B;
  --bad: #C94A4A;
  --shadow: 0 1px 2px rgba(80, 50, 40, .06), 0 10px 28px -14px rgba(80, 50, 40, .25);
  --radius: 16px;
  --font-body: "IBM Plex Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-display: "Gowun Dodum", "Nanum Gothic", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #211B19; --surface: #2B2321; --surface-2: #362C29; --ink: #F5EBE4; --muted: #B29E95;
    --line: #443733; --line-strong: #5E4D47; --primary: #F28B77; --primary-hover: #F7A392; --primary-ink: #2A1512;
    --primary-soft: #4A2A25; --accent: #FFD166; --accent-soft: #4A3B18; --accent-ink: #FFE7A8; --mint: #2F4F47; --sky: #2C3F52;
    --good: #6FCFAF; --warn: #E7A35A; --bad: #E97F7F;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #211B19; --surface: #2B2321; --surface-2: #362C29; --ink: #F5EBE4; --muted: #B29E95;
  --line: #443733; --line-strong: #5E4D47; --primary: #F28B77; --primary-hover: #F7A392; --primary-ink: #2A1512;
  --primary-soft: #4A2A25; --accent: #FFD166; --accent-soft: #4A3B18; --accent-ink: #FFE7A8; --mint: #2F4F47; --sky: #2C3F52;
  --good: #6FCFAF; --warn: #E7A35A; --bad: #E97F7F;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.stack { display: grid; gap: 14px; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  font-feature-settings: "tnum";
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; margin: 0; text-wrap: balance; word-break: keep-all; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 헤더 / 푸터 ---------- */
.site-header { background: var(--surface); border-bottom: 2px dashed var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.brand .mark em { font-style: normal; color: var(--primary); }
.brand .mark::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 2px; box-shadow: -3px 3px 0 0 var(--primary-soft); }
.brand .tag { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.site-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.site-nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap; font-size: 14px; }
.site-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.site-nav a.active { color: var(--primary); background: var(--primary-soft); }
.site-footer { border-top: 2px dashed var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 600; }
.site-footer .links a { color: var(--ink); }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
main.wrap { padding-top: 32px; }

@media (max-width: 700px) {
  .site-header .wrap { flex-wrap: wrap; gap: 2px 12px; padding: 8px 0; min-height: 0; }
  .brand { white-space: nowrap; }
  .brand .tag { display: none; }
  .site-nav { margin-left: -8px; width: calc(100% + 16px); padding: 0 8px; }
}

/* ---------- 페이지 머리 ---------- */
.page-head { display: grid; gap: 8px; margin-bottom: 24px; max-width: 70ch; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); font-weight: 600; }
.page-head p { color: var(--muted); }
.basis { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; width: fit-content; }
.basis b { color: var(--ink); font-weight: 600; }

/* ---------- 도구 레이아웃 ---------- */
.tool { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.tool.wide { grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); }
.tool > * { min-width: 0; }
@media (max-width: 860px) { .tool, .tool.wide { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.panel .panel-head > * { min-width: 0; }
.panel .panel-head h2 { font-size: 16px; }
.panel .panel-body { padding: 18px; display: grid; gap: 14px; }
.inputs { position: sticky; top: 76px; }
@media (max-width: 860px) { .inputs { position: static; } }

.field { display: grid; gap: 5px; min-width: 0; }
.field > *, .row > *, .row-3 > * { min-width: 0; }
select { max-width: 100%; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.field input[type=number], .field input[type=text], .field input[type=date], .field input[type=month], .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.field textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.check .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 4px; }
details.more { border-top: 1px dashed var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-size: 13px; color: var(--primary); font-weight: 600; }
details.more > div { display: grid; gap: 12px; padding-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.danger { color: var(--bad); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 결과 ---------- */
.results { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.results > * { min-width: 0; }
.hero-figure { background: var(--primary); color: var(--primary-ink); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.hero-figure::before { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero-figure::after { content: ""; position: absolute; right: 40px; bottom: -50px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero-figure .lbl { font-size: 13px; opacity: .85; }
.hero-figure .num { font-family: var(--font-display); font-size: clamp(28px, 8vw, 40px); overflow-wrap: anywhere; line-height: 1.1; letter-spacing: -.01em; }
.hero-figure .num small { font-size: 18px; margin-left: 4px; }
.hero-figure .sub { font-size: 13px; opacity: .85; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.tile .lbl { font-size: 12px; color: var(--muted); }
.tile .num { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.tile .num.neg { color: var(--bad); }
.tile .num.pos { color: var(--good); }

table.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sheet th, table.sheet td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.sheet th { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; background: var(--surface-2); }
table.sheet td.num, table.sheet th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sheet tr.total td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--surface-2); }
table.sheet tr.sub td { color: var(--muted); }
table.sheet .neg { color: var(--bad); }
table.sheet .pos { color: var(--good); }
table.sheet tr.hl td { background: var(--accent-soft); font-weight: 700; }
.scroll { overflow-x: auto; }
.note { font-size: 13px; color: var(--muted); line-height: 1.6; }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.6; }
.callout b { font-weight: 700; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.good { background: var(--primary-soft); color: var(--primary); }
.pill.warn { background: var(--accent-soft); color: var(--accent-ink); }
.pill.bad { background: rgba(178,58,58,.12); color: var(--bad); }

/* ---------- 광고 자리 ---------- */
.ad-slot { margin: 24px 0; min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 12px; background: transparent; }
.ad-slot.live { border: 0; min-height: 0; }

/* ---------- 홈 ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 24px 0 8px; }
@media (max-width: 860px) { .home-hero { grid-template-columns: 1fr; } }
.home-hero h1 { font-size: clamp(28px, 4vw, 40px); }
.home-hero .lede { color: var(--muted); font-size: 16px; max-width: 46ch; margin-top: 12px; }
.chalk { background: var(--accent-soft); color: var(--ink); border-radius: 6px 6px 18px 6px; padding: 26px 22px 22px; display: grid; gap: 12px; box-shadow: var(--shadow); position: relative; transform: rotate(-1.2deg); }
.chalk::before { content: ""; position: absolute; top: -12px; left: 50%; width: 90px; height: 24px; margin-left: -45px; background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.05); transform: rotate(2deg); }
.chalk .t { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; }
.chalk ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chalk li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px dashed rgba(0,0,0,.15); padding-bottom: 6px; }
.chalk li b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary-hover); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; margin-top: 32px; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 10px; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:nth-child(4n+1) { border-top: 4px solid var(--primary-soft); } .tool-card:nth-child(4n+2) { border-top: 4px solid var(--accent-soft); } .tool-card:nth-child(4n+3) { border-top: 4px solid var(--mint); } .tool-card:nth-child(4n) { border-top: 4px solid var(--sky); }
.tool-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow); }
.tool-card .k { font-size: 12px; color: var(--primary); font-weight: 600; letter-spacing: .04em; }
.tool-card h2 { font-size: 18px; }
.tool-card p { color: var(--muted); font-size: 14px; }
.tool-card .go { margin-top: auto; font-size: 13px; font-weight: 600; color: var(--primary); }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 14px; }
.section-title h2 { font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* ---------- 지도안 ---------- */
.lesson-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; overflow-x: auto; }
@media (max-width: 600px) { .lesson-doc { padding: 14px; } .doc { min-width: 560px; } }
.doc { font-family: "Malgun Gothic", "Apple SD Gothic Neo", var(--font-body); font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.doc h2 { font-family: var(--font-body); font-size: 20px; text-align: center; margin-bottom: 14px; letter-spacing: .1em; }
.doc h3 { font-family: var(--font-body); font-size: 14px; margin: 18px 0 6px; }
.doc table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.doc th, .doc td { border: 1px solid var(--ink); padding: 5px 7px; vertical-align: top; text-align: left; }
.doc th { background: var(--surface-2); font-weight: 700; text-align: center; white-space: nowrap; }
.doc td.c { text-align: center; }
.doc .stage { text-align: center; font-weight: 700; }
.doc .act { white-space: pre-wrap; }
.doc .tip { white-space: pre-wrap; }
.stage-editor { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 10px; background: var(--surface); }
.stage-editor .stage-head { display: flex; align-items: center; justify-content: space-between; }
.stage-editor .stage-head b { font-size: 14px; }
.act-row { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--line); border-radius: 6px; background: var(--bg); }
.act-row .top { display: flex; gap: 6px; align-items: center; }
.act-row .top input { flex: 1; }
.act-row textarea { min-height: 54px; }
.act-row .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.act-row .tools { display: flex; gap: 6px; justify-content: flex-end; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.plan-row { display: grid; grid-template-columns: 56px 1fr 1fr 32px; gap: 6px; align-items: center; }
.plan-row > *, .budget-row > *, .basis-builder > * { min-width: 0; }
.plan-row select { width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }
.plan-row input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 예산 ---------- */
.budget-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 32px; gap: 6px; align-items: center; }
.budget-row input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.budget-row input.num { text-align: right; font-variant-numeric: tabular-nums; }
.budget-row .del, .plan-row .del, .act-row .del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px; }
.budget-row .del:hover, .plan-row .del:hover, .act-row .del:hover { color: var(--bad); }
.basis-builder { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 6px; align-items: center; font-size: 13px; }
.basis-builder input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.basis-builder span { color: var(--muted); text-align: center; }
.basis-out { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; word-break: break-all; }
.item-block { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; background: var(--surface); }
.item-block .hd { display: flex; align-items: center; gap: 8px; }
.item-block .hd input { flex: 1; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 600; }
.item-block .money { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.item-block .money label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.item-block .money input { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: right; width: 100%; }
.delta { font-size: 13px; display: flex; justify-content: space-between; color: var(--muted); }
.delta b { color: var(--ink); }
.delta b.neg { color: var(--bad); }
.delta b.pos { color: var(--good); }

/* ---------- 봉급표 ---------- */
.salary-table td.step { font-weight: 600; }
.salary-table tr.me td { background: var(--accent-soft); }
.salary-table tr.me td.step::after { content: " ◀ 내 호봉"; font-size: 11px; color: var(--accent-ink); font-weight: 600; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
@media (max-width: 600px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 인쇄 ---------- */
@media print {
  .site-header, .site-footer, .inputs, .ad-slot, .no-print, .toast, .btn-row { display: none !important; }
  body { background: #fff; color: #000; }
  main.wrap { width: 100%; padding: 0; }
  .tool { display: block; }
  .lesson-doc { border: 0; padding: 0; }
  .doc th, .doc td { border-color: #000; }
  .doc th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .panel { border: 0; }
  @page { margin: 15mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 그룹 내비게이션 ---------- */
.site-nav { overflow: visible; }
.nav-item { position: relative; }
.nav-group { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; }
.nav-group:hover, .nav-item.open .nav-group { background: var(--surface-2); color: var(--ink); }
.nav-group.active { color: var(--primary); background: var(--primary-soft); }
.nav-group .caret { font-size: 11px; opacity: .7; }
.nav-item .menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.nav-item.open .menu { display: grid; }
.nav-item .menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; }
.nav-item .menu a:hover { background: var(--surface-2); text-decoration: none; }
.nav-item .menu a.active { color: var(--primary); background: var(--primary-soft); }
@media (max-width: 700px) {
  .site-nav { overflow: visible; flex-wrap: wrap; position: relative; }
  .nav-group { padding: 7px 10px; font-size: 13px; }
  .nav-item { position: static; }
  .nav-item .menu { left: 8px; right: 8px; min-width: 0; }
  .nav-item .menu .fav-empty { max-width: none; }
}
/* 체크리스트 */
.steps { display: grid; gap: 10px; counter-reset: step; }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.step-card .no { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step-card.done .no { background: var(--good); }
.step-card h3 { font-family: var(--font-body); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-card .due { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.step-card .due.over { background: rgba(178,58,58,.12); color: var(--bad); }
.step-card ul { list-style: none; margin: 6px 0 0; padding-left: 0; font-size: 14px; color: var(--muted); display: grid; gap: 3px; }
.step-card label.check { font-size: 14px; margin-top: 8px; }
/* 자리 배치 */
.room { display: grid; gap: 8px; justify-content: center; overflow-x: auto; max-width: 100%; }
.room .board { text-align: center; background: var(--ink); color: var(--bg); color: var(--primary-ink); border-radius: 6px; padding: 6px; font-size: 13px; letter-spacing: .1em; }
.room .grid { display: grid; gap: 8px; }
.seat { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 4px; text-align: center; font-size: 14px; min-height: 44px; display: grid; place-items: center; }
.seat.empty { border-style: dashed; color: var(--muted); background: transparent; }
.seat .tag { font-size: 10px; color: var(--muted); }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 10px; }
.group-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.group-card b { display: block; color: var(--primary); margin-bottom: 4px; }
.group-card span { display: block; font-size: 14px; }
/* 생기부 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.counter { font-size: 13px; color: var(--muted); display: flex; gap: 12px; justify-content: flex-end; }
.counter b.over { color: var(--bad); }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); }
.bar i.over { background: var(--bad); }
/* 시수 */
.hours-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.dday { font-family: var(--font-display); font-size: 48px; line-height: 1; }

/* ---------- 개인정보 안내 ---------- */
.privacy-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--mint); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin: 0 0 20px; }
.privacy-note .lock { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; flex: none; }
.privacy-note .lock i { display: block; width: 8px; height: 10px; border: 2px solid var(--primary); border-radius: 3px 3px 2px 2px; border-top-width: 4px; }
.privacy-note b { font-weight: 700; }
.privacy-note button { margin-left: auto; }
.doc-page { max-width: 72ch; display: grid; gap: 18px; }
.doc-page h2 { font-size: 19px; margin-top: 10px; }
.doc-page p, .doc-page li { color: var(--ink); line-height: 1.75; }
.doc-page ul { margin: 0; padding-left: 20px; }
.doc-page .meta { color: var(--muted); font-size: 13px; }

/* ---------- 즐겨찾기 ---------- */
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line-strong); background: var(--surface); color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.fav-btn:hover { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.fav-btn .star { font-size: 14px; line-height: 1; color: var(--accent); }
.fav-btn.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.nav-group.fav { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.nav-group.fav:hover, .nav-item.open .nav-group.fav { background: var(--accent); color: var(--accent-ink); }
.nav-group.fav .cnt { display: inline-block; min-width: 17px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: var(--surface); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.nav-item .menu .fav-row { display: flex; align-items: center; gap: 2px; }
.nav-item .menu .fav-row a { flex: 1; min-width: 0; }
.nav-item .menu .fav-row button { border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: 12px; line-height: 1; padding: 6px 7px; border-radius: 6px; cursor: pointer; }
.nav-item .menu .fav-row button:hover { background: var(--primary-soft); color: var(--bad); }
.nav-item .menu .fav-empty { padding: 10px 10px; font-size: 13px; color: var(--muted); max-width: 220px; line-height: 1.5; }
.tool-card { position: relative; }
.tool-card.fav { border-top-color: var(--accent) !important; }
.tool-card.fav .fav-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 1px; opacity: .45; transition: opacity .15s; }
.tool-card.fav:hover .fav-tools, .tool-card.fav:focus-within .fav-tools { opacity: 1; }
.tool-card.fav .fav-tools button { border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: 12px; line-height: 1; padding: 4px 5px; border-radius: 6px; cursor: pointer; }
.tool-card.fav .fav-tools button:hover { background: var(--surface-2); color: var(--ink); }
.tool-card.fav .k { padding-right: 72px; }
#fav-section .tool-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
@media print { .fav-btn, .fav-tools { display: none !important; } }

/* ---------- 다른 사이트 링크 (상단 띠) ---------- */
.sites { background: var(--surface-2); border-bottom: 1px dashed var(--line); }
.sites .wrap { display: flex; align-items: baseline; gap: 6px 14px; padding: 9px 0 10px; flex-wrap: wrap; min-width: 0; }
.sites-head { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; letter-spacing: .02em; flex: none; }
.sites-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1; }
.site-link { display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 9px;
  font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap;
  transition: border-color .15s, transform .15s, box-shadow .15s, color .15s; }
.site-link:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.site-link .emo { font-size: 14px; line-height: 1; }
@media (max-width: 700px) {
  /* 좁은 화면에서는 한 줄로 두고 옆으로 넘겨 보게 — 위쪽 공간을 많이 잡아먹지 않도록 */
  .sites .wrap { gap: 5px; padding: 7px 0 8px; flex-wrap: nowrap; }
  .sites-head { display: none; }
  .sites-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 1px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent); }
  .sites-row::-webkit-scrollbar { display: none; }
  .site-link { font-size: 12.5px; padding: 4px 10px 4px 8px; gap: 4px; scroll-snap-align: start; }
}
@media print { .sites { display: none !important; } }

/* ---------- 도구 찾기 ---------- */
.nav-search { border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 14px; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.nav-search:hover { border-color: var(--primary); color: var(--primary); }
.nav-search span { font-size: 13px; }
.ts-wrap { display: none; position: fixed; inset: 0; background: rgba(40,25,20,.42); z-index: 90; padding: 10vh 16px 16px; }
.ts-wrap.open { display: block; }
.ts-panel { width: min(560px, 100%); margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.ts-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
#ts-input { flex: 1; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font-size: 16px; background: var(--bg); color: var(--ink); }
#ts-input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.ts-close { border: 0; background: transparent; font-size: 16px; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.ts-close:hover { background: var(--surface-2); color: var(--ink); }
.ts-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.ts-item { display: grid; gap: 2px; padding: 9px 11px; border-radius: 8px; color: var(--ink); }
.ts-item:hover, .ts-item:focus { background: var(--surface-2); text-decoration: none; }
.ts-item b { font-size: 14.5px; }
.ts-item span { font-size: 12.5px; color: var(--muted); }
.ts-none { padding: 18px 12px; color: var(--muted); font-size: 14px; text-align: center; }
.ts-hint { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }

/* ---------- 홈 시작 버튼 ---------- */
.start-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; margin-top: 22px; }
.start-btn { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px 16px; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.start-btn:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.start-btn .ico { font-size: 22px; line-height: 1; flex: none; }
.start-btn .tx { display: grid; gap: 2px; min-width: 0; }
.start-btn .tx b { font-size: 15px; }
.start-btn .tx span { font-size: 12px; color: var(--muted); }

/* ---------- 예시 값 배지 ---------- */
.sample-badge { display: inline-block; align-self: start; background: rgba(255,255,255,.9); color: var(--primary-hover); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; position: relative; z-index: 1; }

/* ---------- 모바일 결과 띠 ---------- */
.sticky-result { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; cursor: pointer;
  background: var(--primary); color: var(--primary-ink); padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
  align-items: baseline; justify-content: space-between; gap: 12px; box-shadow: 0 -3px 14px -6px rgba(80,50,40,.5); }
.sticky-result.on { display: flex; }
.sticky-result .sr-lbl { font-size: 11.5px; opacity: .9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-result .sr-num { font-family: var(--font-display); font-size: 17px; font-weight: 700; white-space: nowrap; }

/* ---------- 개인정보 안내 접기 ---------- */
.privacy-toggle { display: none; }
.docx-warn { font-size: 12.5px; color: var(--bad); margin-top: 6px; line-height: 1.6; }

/* ---------- 용어 풀이 ---------- */
.glossary { margin-top: 28px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 16px; }
.glossary > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--primary); }
.gloss-body { display: grid; gap: 9px; margin-top: 12px; }
.gloss-row { display: grid; grid-template-columns: minmax(90px, 130px) 1fr; gap: 10px; font-size: 13.5px; align-items: baseline; }
.gloss-row b { color: var(--ink); }
.gloss-row span { color: var(--muted); line-height: 1.6; }
@media (max-width: 560px) { .gloss-row { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- 기준 칩: '기 / 준'처럼 두 글자로 쪼개지지 않게 ---------- */
.basis { flex-wrap: wrap; word-break: keep-all; }

@media (max-width: 860px) {
  .privacy-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--mint); color: var(--ink);
    border: 0; border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-bottom: 14px; }
  .privacy-toggle .car { transition: transform .15s; }
  .privacy-toggle[aria-expanded="true"] .car { transform: rotate(180deg); }
  .privacy-note.collapsible { display: none; }
  .privacy-note.collapsible.open { display: flex; }
}
@media print { .ts-wrap, .sticky-result, .nav-search, .privacy-toggle, .glossary { display: none !important; } }

/* ---------- 홈 검색 버튼 / FAQ 링크 ---------- */
.home-search { display: flex; align-items: center; gap: 9px; width: 100%; max-width: 46ch; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 12px 18px;
  font-family: inherit; font-size: 14px; color: var(--muted); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.home-search:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--ink); }
.home-search span { font-size: 15px; }
.faq-go { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; }
.num-echo { display: block; font-size: 11.5px; color: var(--primary); font-weight: 600; margin-top: 3px; min-height: 14px; letter-spacing: -.01em; }
.item-block .money .num-echo, .budget-row .num-echo { text-align: right; }
