:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #1f2328;
  --ink-2: #57606a;
  --line: #e2ddd2;
  --accent: #b7791f;
  --accent-ink: #7a4f0e;
  --accent-soft: #fbf1df;
  --ok: #1a7f4b;
  --ok-soft: #e3f4ea;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --warn: #8a5a00;
  --warn-soft: #fdf0d5;
  --muted-soft: #eceae4;
  --mark: rgba(229, 166, 36, .32);
  --ins: rgba(26, 127, 75, .16);
  --del: rgba(180, 35, 24, .14);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .05), 0 4px 16px rgba(31, 35, 40, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --surface: #1d2024; --surface-2: #24282d; --ink: #e8e6e1; --ink-2: #a3a9b0;
    --line: #33383e; --accent: #e0a644; --accent-ink: #f0c27a; --accent-soft: #3a2f1c;
    --ok: #6fd19a; --ok-soft: #1c3428; --bad: #ff9a8f; --bad-soft: #3d2220; --warn: #f2c464; --warn-soft: #3b311a;
    --muted-soft: #2b2f34; --mark: rgba(224, 166, 68, .30); --ins: rgba(111, 209, 154, .18); --del: rgba(255, 154, 143, .18);
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --surface: #1d2024; --surface-2: #24282d; --ink: #e8e6e1; --ink-2: #a3a9b0;
  --line: #33383e; --accent: #e0a644; --accent-ink: #f0c27a; --accent-soft: #3a2f1c;
  --ok: #6fd19a; --ok-soft: #1c3428; --bad: #ff9a8f; --bad-soft: #3d2220; --warn: #f2c464; --warn-soft: #3b311a;
  --muted-soft: #2b2f34; --mark: rgba(224, 166, 68, .30); --ins: rgba(111, 209, 154, .18); --del: rgba(255, 154, 143, .18);
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
a { color: var(--accent-ink); }
code { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.brand h1 { font-size: 19px; letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.switch button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* replay banner */
.replay { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.replay p { margin: 0; }
.replay p + p { margin-top: 6px; }
.replay .disclaimer { color: var(--ink-2); font-size: 13px; }

/* summary */
.summary { margin: 18px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 12.5px; color: var(--ink-2); }
.tile.bad .n { color: var(--bad); }
.tile.warn .n { color: var(--warn); }
.tile.ok .n { color: var(--ok); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 2px 0; font-size: 13px; color: var(--ink-2); }
.meta b { color: var(--ink); font-weight: 600; }
.bytype { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bytype > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.bytype h3 { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--muted-soft); color: var(--ink); white-space: nowrap; }
.chip b { font-variant-numeric: tabular-nums; }

/* tabs */
.tabs { display: flex; gap: 4px; margin: 22px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 10px 14px; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .badge { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; background: var(--bad-soft); color: var(--bad); }
.panel { padding: 16px 0 8px; }

/* toolbar */
.toolbar { margin-bottom: 12px; }
.filters { display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-row .lab { font-size: 12.5px; color: var(--ink-2); margin-right: 4px; min-width: 52px; }
.fbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.fbtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.fbtn[aria-pressed="false"] { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-2) 50%, transparent); }
.fbtn .k { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.toolbar-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.toolbar-row input { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.btn.ghost { background: var(--surface); color: var(--accent-ink); }
.count { margin: 10px 2px 0; font-size: 13px; color: var(--ink-2); }

/* product cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 14px; overflow: hidden; }
.card-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head .sku { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.card-head h3 { font-size: 15.5px; flex: 1 1 auto; min-width: 0; }
.card-head .n { font-size: 12px; color: var(--ink-2); }
.field { padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.field-label { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.diff { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.diff del { background: var(--del); color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; border-radius: 3px; padding: 0 1px; }
.diff ins { background: var(--ins); color: var(--ok); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.diff del + ins, .diff ins + del { margin-left: 3px; }
.ba { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: baseline; margin-top: 4px; }
.ba .k { font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.claims { list-style: none; margin: 0; padding: 0; }
.claim { padding: 12px 16px; border-top: 1px solid var(--line); }
.claim:first-child { border-top: 0; }
.claim-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
.quote { font-weight: 600; overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.contradicted { background: var(--bad-soft); color: var(--bad); }
.pill.no_evidence { background: var(--warn-soft); color: var(--warn); }
.pill.supported { background: var(--ok-soft); color: var(--ok); }
.pill.not_checked { background: var(--muted-soft); color: var(--ink-2); }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.where { font-size: 12px; color: var(--ink-2); }
.reason { margin: 6px 0 0; overflow-wrap: anywhere; }
.reason .rule { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.reason .rule b { font-weight: 600; }
.cites { margin-top: 8px; display: grid; gap: 6px; }
.cite { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; font-size: 13.5px; }
.cite.contradicted { border-left-color: var(--bad); }
.cite.supported { border-left-color: var(--ok); }
.cite .src { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.cite .line { margin-top: 1px; overflow-wrap: anywhere; }
.nocite { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.related { margin-top: 6px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.fix { margin-top: 8px; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); overflow-wrap: anywhere; }
.fix .k { font-size: 12px; color: var(--ink-2); margin-right: 6px; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.catalog td { min-width: 110px; }
.catalog td.copy { min-width: 240px; }
.catalog td.sku { font-family: var(--mono); white-space: nowrap; }
.doc { margin-top: 18px; }
.doc h3 { font-size: 14px; margin-bottom: 6px; }
.doc ol { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.doc li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.doc li:last-child { border-bottom: 0; }
.doc .ln { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.section-intro { margin: 0 0 12px; max-width: 760px; }

/* citation check */
.guard-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.steps { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.steps li { font-size: 13.5px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.steps .ok { color: var(--ok); font-weight: 700; margin-right: 6px; }
.steps .fail { color: var(--bad); font-weight: 700; margin-right: 6px; }

/* how it works */
.how { display: grid; gap: 14px; }
.how .step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.how .step h3 { font-size: 15px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; }
.how .num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; }
.how p { margin: 6px 0 0; }
.how ul { margin: 6px 0 0; padding-left: 20px; }
pre { margin: 8px 0 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font: 13px/1.5 var(--mono); }

.foot { padding-top: 18px; padding-bottom: 36px; color: var(--ink-2); font-size: 12.5px; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top { position: static; }
  .logo { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
  .brand h1 { font-size: 17px; }
  .top-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .switch { align-self: flex-start; }
  .tagline { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bytype { grid-template-columns: 1fr; }
  .guard-sum { grid-template-columns: 1fr; }
  .card-head, .field, .claim { padding-left: 12px; padding-right: 12px; }
  .downloads { width: 100%; }
  .downloads .btn { flex: 1 1 auto; }
}
