:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --ink: #191b1f;
  --ink-2: #3d424a;
  --muted: #74797f;
  --line: #e3e1db;
  --line-2: #cdcac3;
  --accent: #c9303d;
  --accent-ink: #ffffff;
  --accent-soft: #fbeef0;
  --accent-text: #ac1f2c;
  --link: #2f5f95;
  --good-text: #1d6b3d;
  --warn-text: #7a5410;
  --shadow: 0 1px 2px rgba(25, 27, 31, .04), 0 12px 32px rgba(25, 27, 31, .06);
  --r: 14px;
  --wrap: 960px;
  --read: 740px;
  --font: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121315;
    --surface: #1b1d20;
    --surface-2: #24262a;
    --ink: #f1f1ef;
    --ink-2: #cdd0d4;
    --muted: #979ca3;
    --line: #313438;
    --line-2: #474b51;
    --accent: #e5717c;
    --accent-ink: #2a0c10;
    --accent-soft: #35211f;
    --accent-text: #efa2aa;
    --link: #8fb6e4;
    --good-text: #9be0b5;
    --warn-text: #f0cf7e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--font); font-size: 16px; line-height: 1.75;
  letter-spacing: 0; overflow-wrap: anywhere;
}
body, button, input, textarea, select { font-family: inherit; letter-spacing: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
strong { color: var(--ink); font-weight: 700; }
em { font-style: normal; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 50; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--surface); transform: translateY(-200%); text-decoration: none; }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 28px); } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.brand em { color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; }
.topnav { display: flex; gap: 20px; margin-left: auto; }
.topnav a { color: var(--muted); font-size: 14px; text-decoration: none; padding: 6px 0; }
.topnav a:hover { color: var(--ink); }
@media (max-width: 640px) { .topnav { display: none; } }
.engine-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; margin-left: auto; }
.topnav + .engine-badge { margin-left: 0; }
.engine-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.engine-badge.is-live { color: var(--good-text); }
.engine-badge.is-limited { color: var(--warn-text); }
.engine-badge.is-checking::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Hero */
.hero { display: grid; grid-template-columns: 1.02fr .98fr; gap: 40px; align-items: center; padding: 60px 0 32px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 34px; } .hero > * { min-width: 0; } }
.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(27px, 3.4vw, 36px); font-weight: 700; letter-spacing: -.02em; line-height: 1.38; }
.lede { margin-top: 16px; font-size: 16px; color: var(--ink-2); max-width: 48ch; }

.search-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.field-label { display: block; font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; height: 50px; padding: 0 15px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; }
.input-row input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field-help { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.65; }
.field-error { margin-top: 8px; font-size: 14px; color: var(--accent-text); }
.supplement { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.supplement summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
.supplement textarea { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 1.7; resize: vertical; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.chip-label { font-size: 13px; color: var(--muted); }
.chip { padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font-size: 15px; font-weight: 700; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-text); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); height: 38px; padding: 0 14px; font-size: 14px; font-weight: 500; }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); height: 36px; padding: 0 10px; font-size: 14px; font-weight: 500; }
.btn-ghost:hover { color: var(--ink); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }
.linkbtn.is-strong { color: var(--link); }

/* Work area: one sheet of paper, nothing nested inside it */
.work-area { padding: 8px 0 16px; max-width: var(--read); margin-inline: auto; }
.work-area:empty { display: none; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 34px 38px 30px; }
@media (max-width: 640px) { .sheet { padding: 24px 20px 22px; } }

/* Progress */
.progress-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.progress-head h2 { font-size: 19px; }
.progress-url { font-size: 13px; color: var(--muted); word-break: break-all; }
.progress-time { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.stepper { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; }
.step { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.step .dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; flex-shrink: 0; }
.step.is-active { color: var(--accent-text); }
.step.is-active .dot { background: var(--accent); color: #fff; animation: pulse 1.1s ease-in-out infinite; }
.step.is-done { color: var(--good-text); }
.step.is-done .dot { background: var(--good-text); color: #fff; }
.progress-label { margin-top: 16px; font-size: 15px; color: var(--ink-2); }
.progress-actions { margin-top: 16px; display: flex; gap: 10px; }
.skeleton { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.sk { border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s linear infinite; }
.sk.sk-title { height: 24px; width: 46%; }
.sk.sk-line { height: 11px; width: 92%; }
.sk.sk-line.is-short { width: 62%; }
.sk.sk-box { height: 60px; width: 100%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Notice */
.notice { display: grid; gap: 10px; }
.notice h2 { font-size: 19px; }
.notice-chips { margin-top: 2px; }
.notice-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--muted); }

/* ---------- Report: answer first, evidence below ----------
   여백은 4의 배수 한 가지 스케일(4·8·12·16·20·24·28·40)만 쓴다.
   섹션 사이(40+28) > 섹션 안(≤28) 이 언제나 성립해야 한다.
   강조 색은 한 화면에 한 곳 — 결론의 가격 차액 줄뿐이다. */
.rhead .rmeta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.rmeta a { color: var(--link); text-decoration: none; }
.rmeta a:hover { text-decoration: underline; }
.rmeta .sep { color: var(--line-2); }
.tag { font-size: 12px; color: var(--warn-text); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; line-height: 1.6; }
.rtitle { margin-top: 12px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.rlead { margin-top: 8px; font-size: 16px; color: var(--ink-2); }

/* Conclusion: the answer, in the largest type on the page */
.rconc { margin-top: 24px; }
.rconc-lbl { font-size: 13px; color: var(--muted); }
.rconc-amt { margin-top: 4px; font-size: 40px; font-weight: 900; line-height: 1.1; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rconc-amt.is-quiet { font-size: 24px; font-weight: 700; color: var(--muted); }
.rconc-delta { margin-top: 8px; font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rconc-delta.is-up { color: var(--accent-text); }
.rconc-delta.is-down { color: var(--good-text); }
.rconc-delta.is-none { font-size: 15px; font-weight: 400; color: var(--muted); }
.rconc-sub { margin-top: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .rconc-amt { font-size: 32px; } .rconc-delta { font-size: 16px; } }

/* Key facts: short label/value pairs, never a paragraph */
.kf { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 28px; }
.kf-i { min-width: 0; }
.kf-k { font-size: 12px; color: var(--muted); }
.kf-v { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ractions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Sections: the label is quiet, the content carries the weight */
.rsec { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.rsec-t { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.rsec-lead { margin-top: 8px; font-size: 14px; color: var(--muted); }
.rsec-body { margin-top: 12px; font-size: 16px; color: var(--ink-2); }
.rsec-body.is-quiet { color: var(--muted); font-size: 15px; }
.rsub { margin-top: 28px; font-size: 15px; color: var(--ink); }
.rsec-t + .rsub, .rsec-lead + .rsub { margin-top: 16px; }
.rnote { margin-top: 12px; font-size: 13px; color: var(--muted); }
.rnotes { margin-top: 12px; }
.rnotes li { position: relative; padding-left: 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.rnotes li::before { content: "·"; position: absolute; left: 2px; }
.plain { margin-top: 12px; }
.plain li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.plain li:first-child { border-top: 0; padding-top: 0; }

/* Definition list: label left, value right */
.spec { margin-top: 12px; }
.spec-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0 20px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.spec-row:first-child { border-top: 0; padding-top: 0; }
.spec dt { font-size: 14px; color: var(--muted); }
.spec dd { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.spec dd.is-unknown { font-size: 14px; color: var(--muted); }
.spec .dd-note { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .spec-row { grid-template-columns: 1fr; } }

/* Price table: seller / product / price, one steady rhythm */
.ptable { margin-top: 12px; }
.prow {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; column-gap: 16px; row-gap: 4px;
  align-items: baseline; padding: 12px; margin-inline: -12px; border-top: 1px solid var(--line);
}
.prow:first-child { border-top: 0; }
.p-seller { grid-column: 1; font-size: 13px; color: var(--muted); }
.p-name { grid-column: 2; min-width: 0; font-size: 15px; color: var(--ink); }
.p-name a { color: var(--ink); text-decoration: none; }
.p-name a:hover { color: var(--link); text-decoration: underline; }
.p-price { grid-column: 3; text-align: right; font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-price.is-unknown { font-size: 14px; font-weight: 400; color: var(--muted); }
.p-meta { grid-column: 2 / -1; font-size: 12px; color: var(--muted); line-height: 1.6; }
.prow.is-target { background: var(--surface-2); border-radius: 8px; }
.prow.is-target .p-seller { color: var(--ink); font-weight: 700; }
.prow.is-target .p-name, .prow.is-target .p-price { font-weight: 700; }
@media (max-width: 560px) {
  .prow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .p-seller { grid-row: 1; grid-column: 1; }
  .p-price { grid-row: 1; grid-column: 2; }
  .p-name { grid-row: 2; grid-column: 1 / -1; }
  .p-meta { grid-row: 3; grid-column: 1 / -1; }
}

/* Folded detail */
.fold { margin-top: 16px; }
.fold > summary { cursor: pointer; font-size: 14px; color: var(--link); }
.fold > summary::marker { color: var(--muted); }
.opt-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.opt-row .opt-p { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.claim { padding: 12px 0; border-top: 1px solid var(--line); }
.claim:first-of-type { border-top: 0; }
.claim-t { font-size: 15px; color: var(--ink); }
.claim-n { margin-top: 4px; font-size: 13px; color: var(--muted); }
.src { padding: 8px 0; border-top: 1px solid var(--line); }
.src:first-of-type { border-top: 0; }
.src-t { font-size: 14px; }
.src-t a { color: var(--link); text-decoration: none; }
.src-t a:hover { text-decoration: underline; }
.src-m { font-size: 13px; color: var(--muted); }
.src-x { font-size: 13px; color: var(--muted); }
.report-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Landing sections */
.how { padding: 48px 0 8px; }
.how h2, .examples h2, .safety h2 { font-size: 21px; letter-spacing: -.01em; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 40px; margin-top: 12px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; padding: 16px 0 16px 24px; border-top: 1px solid var(--line); }
.step-no { position: absolute; left: 0; top: 16px; font-size: 14px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps h3 { font-size: 15px; }
.steps p { font-size: 14px; color: var(--ink-2); }
.examples { padding: 40px 0 8px; }
.section-head { display: grid; gap: 6px; }
.section-head p { font-size: 14px; max-width: 62ch; }
.case-groups { display: grid; gap: 26px; margin-top: 20px; }
.case-cat { display: flex; align-items: baseline; gap: 8px; }
.case-cat .cc-name { font-size: 14px; color: var(--ink); }
.case-cat .cc-n { font-size: 13px; color: var(--muted); }
.case-list { margin-top: 4px; }
.case {
  width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line);
  padding: 11px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline;
}
.case:hover .ct { color: var(--accent-text); text-decoration: underline; }
.case .ct { font-size: 15px; color: var(--ink); }
.case .ck { grid-column: 1; font-size: 13px; color: var(--muted); }
.case .cu { grid-row: 1; grid-column: 2; font-size: 13px; color: var(--muted); white-space: nowrap; }
.safety { padding: 40px 0 56px; }
.principles { margin-top: 12px; max-width: 74ch; }
.principles li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.footer { border-top: 1px solid var(--line); padding: 20px 0 32px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 13px; color: var(--muted); }
.footer em { color: var(--accent); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 140%); padding: 11px 18px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease; max-width: calc(100% - 28px); text-align: center; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* Narrow phones */
@media (max-width: 420px) {
  .search-card { padding: 18px 16px; min-width: 0; }
  .input-row { flex-wrap: wrap; }
  .input-row input, .input-row .btn-primary { flex: 1 1 100%; }
  .rtitle { font-size: 20px; }
  .kf { gap: 12px 20px; }
  .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
  .case { grid-template-columns: 1fr; }
  .case .cu { grid-row: auto; grid-column: 1; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .step .dot, .engine-badge::before, .sk { animation: none; } .toast { transition: none; } }

/* Print: the report only */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --muted: #555; --line: #ccc; --line-2: #999; --link: #000; --shadow: none; }
  html, body { background: #fff; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .hero, .how, .examples, .safety, .footer, .skip-link, .toast, .ractions, .progress-actions, #live-region, .engine-badge { display: none !important; }
  main { padding: 0; }
  .wrap { width: 100%; }
  .work-area { padding: 0; max-width: 100%; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
  .rsec { break-inside: avoid; page-break-inside: avoid; }
  .prow { break-inside: avoid; page-break-inside: avoid; }
  /* 접힌 부분은 펼친 그대로 인쇄된다. 닫혀 있으면 "읽은 자료 N건" 한 줄만 남는다. */
  .fold > summary { color: #000; }
  .rconc-delta, .rconc-delta.is-up, .rconc-delta.is-down { color: #000; }
  .prow.is-target { background: #f0f0f0 !important; }
  a { text-decoration: none; color: #000; }
  .report-foot { font-size: 11px; color: #333; }
}
