:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --series: #2a78d6;
  --series-deep: #1c5cab;
  --wash: rgba(42, 120, 214, 0.10);
  --hist: #e7e6e1;
  --hist-edge: #d6d5cd;
  --border: rgba(11, 11, 11, 0.10);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Segoe UI",
    "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.fig-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 18px 10px;
  margin: 18px 0;
}

.fig-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px;
}

.mean-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--series-deep);
  background: var(--wash);
  padding: 2px 10px;
  border-radius: 999px;
  margin-left: 9px;
  vertical-align: 2px;
  white-space: nowrap;
}

.fig-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 10px;
}

.fig-svg { display: block; width: 100%; height: auto; }

.fig-note {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 4px;
}

.viz-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
  padding: 6px 9px;
  border-radius: 6px;
  max-width: 240px;
  opacity: 0;
  transition: opacity 80ms;
}
.viz-tooltip.on { opacity: 0.96; }

.variant-h {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 28px 0 -8px;
}

a.cta {
  display: inline-block;
  background: var(--series);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 9px;
  text-decoration: none;
}
a.cta:hover { background: var(--series-deep); }
a.cta-outline {
  display: inline-block;
  background: var(--surface);
  color: var(--series-deep);
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  border: 1px solid var(--series);
  border-radius: 9px;
  text-decoration: none;
}
a.cta-outline:hover { background: var(--wash); }
.scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 520px;
  margin-top: 14px;
}
.scope-grid a { display: block; text-align: center; }
.scope-grid .full { grid-column: 1 / -1; }
a.cta:focus-visible { outline: 2px solid var(--series-deep); outline-offset: 2px; }

/* ---- item table ---- */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.item-tbl {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
  width: 100%;
}
.item-tbl th, .item-tbl td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
  text-align: left;
}
.item-tbl thead th {
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--baseline);
  white-space: nowrap;
}
.item-tbl .cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 56px;
}
.item-tbl .cell-item {
  position: sticky;
  left: 0;
  background: var(--surface);
  min-width: 240px;
  max-width: 330px;
  font-weight: 400;
  z-index: 1;
}
.item-tbl .q-text { display: block; }
.item-tbl .q-ends {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.item-tbl .domain-row th {
  background: var(--page);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 9px 8px 5px;
  position: sticky;
  left: 0;
}
.item-tbl .cell-fac { color: var(--ink-2); }
.thsub { font-size: 10.5px; color: var(--muted); margin-left: 3px; }

/* ---- intro block ---- */
.intro { font-size: 14px; line-height: 1.6; }
.intro p { margin: 6px 0; }
.intro ol, .intro ul { margin: 4px 0 10px; padding-left: 22px; }
.intro li { margin: 3px 0; }

/* ---- candidate comment popup ---- */
.cmt-btn {
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  border-bottom: 1px dotted var(--series-deep);
  color: var(--series-deep);
  cursor: pointer;
  padding: 0 1px;
}
.cmt-btn sup { font-size: 9px; }
.cmt-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(11, 11, 11, 0.35);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cmt-box {
  background: var(--surface);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  padding: 18px 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.cmt-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.cmt-body { font-size: 14px; line-height: 1.6; margin: 0 0 14px; white-space: pre-wrap; }
.cmt-close {
  font: inherit; font-size: 13px;
  background: var(--series); color: #fff;
  border: none; border-radius: 7px;
  padding: 7px 16px; cursor: pointer;
}

/* ---- flat item table: question row + 9 equal value columns ---- */
.item-tbl-flat {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}
.item-tbl-flat thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  text-align: center;
  padding: 8px 2px;
  border-bottom: 1px solid var(--baseline);
  overflow-wrap: break-word;
}
.item-tbl-flat .domain-row th {
  background: var(--page);
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  padding: 12px 6px 6px;
}
.domain-scale {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.rc-star { font-weight: 700; color: var(--series-deep); }
.item-tbl-flat .q-row th {
  text-align: left;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  padding: 10px 6px 4px;
}
.item-tbl-flat .v-row td {
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 6px 2px;
  border-bottom: 1px solid var(--grid);
}
.item-tbl-flat .cell-fac {
  background: var(--wash);
  color: var(--series-deep);
  font-weight: 700;
  border-right: 1px solid var(--baseline);
}
.item-tbl-flat thead th.cell-fac { color: var(--series-deep); }
@media (max-width: 480px) {
  .item-tbl-flat { font-size: 12px; }
  .item-tbl-flat thead th { font-size: 10.5px; padding: 6px 1px; }
  .item-tbl-flat .q-row th { font-size: 12px; }
}

/* ---- dot plot ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.chip {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--baseline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.chip.on {
  background: var(--series);
  border-color: var(--series);
  color: #fff;
  font-weight: 600;
}
.chip:focus-visible { outline: 2px solid var(--series-deep); outline-offset: 1px; }

.dots-domain {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 2px;
}
.dots-row { display: flex; align-items: center; gap: 8px; }
.dots-row + .dots-row { border-top: 1px solid var(--page); }
.dots-label {
  flex: 0 0 auto;
  width: 170px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.25;
}
.dots-value {
  flex: 0 0 auto;
  width: 40px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dots-row svg { flex: 0 0 auto; display: block; }
@media (max-width: 480px) {
  .dots-label { width: 118px; font-size: 11.5px; }
}

/* ---- segmented mode toggle ---- */
.seg {
  display: inline-flex;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
}
.seg button {
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--baseline); }
.seg button.on { background: var(--series); color: #fff; font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--series-deep); outline-offset: -2px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
