:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --ink: #1d1f23;
  --muted: #6b7078;
  --line: #e7e7e3;
  --accent: #2f5bd3;
  --warn: #c2410c;
  --warn-bg: #fff4ec;
  --radius: 14px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.demo-banner {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; justify-content: center;
  padding: 8px 16px;
  background: #fff8db; border-bottom: 1px solid #f0e2a6;
  font-size: 12.5px; color: #6b5300; text-align: center;
}
.demo-banner strong { background: #f5c518; color: #3d2f00; padding: 1px 8px; border-radius: 999px; }

.shell { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }

/* 목록 */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 4px 0 14px; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.record-paging { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.record-paging button:disabled { opacity: .45; cursor: default; }
.president-record { overflow-wrap: anywhere; }
.items .party-average { background: color-mix(in srgb, var(--party-color) 12%, white); border-left: 5px solid var(--party-color); color: #111827; }
.party-average .hint, .party-average small { color: #4b5563; }
.party-average h2 { font-size: 17px; }
@media (max-width: 560px) { .top { flex-wrap: wrap; } .top-actions { width: 100%; justify-content: flex-start; } }
.top h1 { font-size: 22px; letter-spacing: -0.02em; }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sort {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 12px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.sort span { color: var(--accent); font-size: 15px; }
.sort:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tools { display: grid; gap: 8px; margin-bottom: 12px; }
.search input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 15px; color: var(--ink);
}
.period { display: flex; align-items: center; gap: 4px; opacity: .65; }
.seg { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.seg.on { color: var(--ink); font-weight: 600; }
.tag { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.president {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--card); border: 1px dashed #d4d5d0; border-radius: var(--radius);
}
.president .who span { font-size: 12.5px; }
.na { flex: none; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.president-score { flex: none; min-width: 44px; text-align: center; font-weight: 700; font-size: 18px; color: #374151; border: 1px dashed var(--line); border-radius: 10px; padding: 2px 6px; }

.count { font-size: 12px; color: var(--muted); margin: 0 2px 8px; }
.list, .items, .other, .evidence { list-style: none; margin: 0; padding: 0; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.row { position: relative; border-top: 1px solid var(--line); }
.row-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 18px; color: inherit; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.row-link:hover, .row-link:active { background: #f6f7fa; }
.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row:first-child { border-top: 0; }
.row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: var(--party); }
.avatar { flex: none; display: block; }
.who { min-width: 0; flex: 1; display: grid; }
.who b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
.who span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.score {
  flex: none; min-width: 64px; text-align: right;
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  padding: 2px 4px; border-radius: 10px; line-height: 1.1; display: grid; justify-items: end;
}
.score.withheld { font-size: 15px; font-weight: 600; color: var(--muted); }
.deduct { font-style: normal; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 0 5px; letter-spacing: 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.foot { margin-top: 16px; font-size: 11.5px; color: var(--muted); }

/* 상세 */
.back a { display: inline-block; text-decoration: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 4px 0 12px; }
.profile { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.profile > div { min-width: 0; }
.profile h1 { font-size: 22px; }
.profile p { font-size: 13px; color: var(--muted); }
.profile .meta { font-size: 11.5px; margin-top: 4px; }
.demo-chip { font-size: 11px; font-weight: 600; vertical-align: middle; background: #fff1b8; color: #6b5300; border-radius: 999px; padding: 2px 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.summary { margin-bottom: 22px; }
.calc { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; }
.calc > div { display: grid; gap: 2px; }
.calc > div + div { border-left: 1px solid var(--line); }
.calc span, .summary .final span { font-size: 12px; color: var(--muted); }
.calc b { font-size: 20px; font-variant-numeric: tabular-nums; }
.calc .minus b { color: var(--warn); }
.calc .final b, .summary > .final b { font-size: 28px; color: var(--accent); }
.summary > .final { display: grid; gap: 2px; margin-bottom: 8px; }
.summary > .final b { color: var(--muted); font-size: 22px; }
.hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }

h2 { font-size: 16px; margin: 0 0 10px; }
h2 small { font-size: 12px; font-weight: 500; color: var(--warn); margin-left: 4px; }
.items { display: grid; gap: 10px; margin-bottom: 24px; }
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item-head h3 { font-size: 15px; }
.item-head b { font-size: 20px; font-variant-numeric: tabular-nums; flex: none; }
.item-head small { font-size: 12px; color: var(--muted); font-weight: 500; }
.bar { height: 6px; background: #eef0f3; border-radius: 99px; margin: 8px 0 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.reason { font-size: 13.5px; }
.reason em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-right: 6px; }
.evidence { margin-top: 8px; display: grid; gap: 4px; }
.evidence li { font-size: 12.5px; color: var(--muted); }
.kind { display: inline-block; font-size: 11px; color: var(--ink); background: #f1f2f4; border-radius: 6px; padding: 0 6px; margin-right: 6px; }
time { font-variant-numeric: tabular-nums; white-space: nowrap; }

.other { display: grid; gap: 10px; }
.other-item { border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); background: var(--card); }
.other-item.applied { border-color: #f6cfb3; background: var(--warn-bg); }
.other-item.applied .item-head b { color: var(--warn); }
.other-item.pending .item-head b { font-size: 14px; color: var(--muted); }
.other-item.none { color: var(--muted); font-size: 13.5px; }
.status { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }

/* 실제 명단 모드 */
.real-banner {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; justify-content: center;
  padding: 8px 16px; background: #eef3ff; border-bottom: 1px solid #d5e0fb;
  font-size: 12.5px; color: #26407f; text-align: center;
}
.real-banner strong { background: #2f5bd3; color: #fff; padding: 1px 8px; border-radius: 999px; }
.real-banner a { color: inherit; }
.real-chip { font-size: 11px; font-weight: 600; vertical-align: middle; background: #e3ebff; color: #26407f; border-radius: 999px; padding: 2px 8px; }
.president { padding: 0; }
.president-link { flex: 1; padding: 10px 12px; border-radius: var(--radius); }
.president-link .who b small { margin-left: 4px; }
h2 small.muted { color: var(--muted); }
.na-score { font-size: 14px !important; color: var(--muted); }
.basis { margin-bottom: 22px; }
.principles { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 6px; }
ul.card.principles { padding-left: 30px; margin-bottom: 22px; }
.steps { margin: 0 0 22px; padding-left: 30px; font-size: 13.5px; display: grid; gap: 6px; }
.page-title { font-size: 22px; margin-bottom: 14px; }
.procedure-link { margin: 0 0 22px; font-size: 14px; }
.procedure-link a, .foot a { color: var(--accent); font-weight: 600; }
.sources { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.sources ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.sources a { color: var(--accent); font-weight: 600; }
.sources .url { display: block; font-size: 11.5px; color: var(--muted); word-break: break-all; }
.sources .meta { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
code { font-size: 12px; background: #f1f2f4; border-radius: 4px; padding: 0 4px; }
img.avatar.photo { object-fit: cover; border-radius: 50%; border: 3px solid var(--party, #9aa0a6); background: #f3f4f6; }
.factor.null, .factor.value-only { background: #fbfbfa; }
.factor .reason + .reason { margin-top: 4px; }
.evidence a { color: var(--accent); }
.reason.warn em { color: var(--warn); }
/* 뉴스·광고 */
.news h2 small { font-weight: 400; font-size: 12px; }
.news-list .news-item { line-height: 1.45; }
.news-list .news-item a { color: var(--accent); word-break: keep-all; overflow-wrap: anywhere; }
.news-list .news-item.today a { font-weight: 600; }
.ad-slot { margin: 16px 0; padding: 8px; border: 1px dashed var(--line); border-radius: var(--radius); }
.ad-label { display: inline-block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.brand small { display: block; font-size: 13px; font-weight: 500; color: var(--muted, #6b7280); margin-top: 2px; }
.sub a { color: var(--accent); font-weight: 600; }
.guide { margin-bottom: 16px; }
.guide h2 { margin-top: 0; }
.guide summary { cursor: pointer; font-weight: 600; }
.correction-form { display: grid; gap: 12px; margin-top: 10px; }
.correction-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.correction-form small { font-weight: 400; color: var(--muted, #6b7280); }
.correction-form select, .correction-form textarea, .correction-form input { font: inherit; font-size: 16px; font-weight: 400; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; width: 100%; box-sizing: border-box; background: #fff; }
.correction-form button { justify-self: start; }
.correction-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.reason.ok { color: #166534; font-weight: 600; }
