@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@600;700;900&family=IBM+Plex+Sans+KR:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ---------- 디자인 토큰 ---------- */
:root {
  --paper: #FBFAF6;
  --paper-2: #F3F0E8;
  --ink: #1A1A1A;
  --ink-2: #33302B;
  --muted: #555048;
  --muted-2: #6B655B;
  --rule: #D8D3C8;
  --accent: #1F3A5F;
  --warn: #8A2B1F;
  --stage-review: #8F8A80;
  --stage-progress: #B7791F;
  --stage-done: #1F3A5F;
  --stage-live: #2F6B3A;
  --serif: 'Noto Serif KR', serif;
  --sans: 'IBM Plex Sans KR', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 72px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted-2); }
.hidden { display: none !important; }

/* ---------- 머리 ---------- */
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-top: 22px; font-size: 13px; color: var(--muted); }
.topbar .user { display: flex; gap: 14px; align-items: center; }
.topbar .user a { min-height: 44px; display: inline-flex; align-items: center; }
.badge { color: var(--accent); font-weight: 600; }
.masthead { text-align: center; padding: 14px 0 12px; }
.masthead a.logo { font-family: var(--serif); font-size: clamp(40px, 7vw, 56px); font-weight: 900; letter-spacing: -1.5px; line-height: 1; text-decoration: none; }
.masthead p { margin: 10px 0 0; font-size: 13px; letter-spacing: 3px; color: var(--muted); }
@media (max-width: 600px) { .masthead p { letter-spacing: 1px; font-size: 12px; } }
.double-rule { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); height: 3px; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 26px; border-bottom: 1px solid var(--rule); }
.nav a { padding: 12px 0; font-size: 15px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); text-decoration: none; }

/* ---------- 레이아웃 ---------- */
.cols { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 28px; }
.main { flex: 999 1 600px; min-width: 0; }
.side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.section-rule { border-top: 2px solid var(--ink); padding-top: 14px; }
.box { border: 1px solid var(--ink); padding: 20px; background: #fff; }

h1, h2, h3 { font-family: var(--serif); letter-spacing: -0.5px; margin: 0; }
.kicker { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--accent); }
.h-lead { font-size: clamp(28px, 4vw, 38px); font-weight: 900; line-height: 1.3; letter-spacing: -1px; margin-bottom: 14px; }
.h-sec { font-size: 22px; font-weight: 700; }
.h-side { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 10px; }
.lead-p { font-size: 17px; line-height: 1.75; color: var(--ink-2); margin: 0 0 18px; }

/* ---------- 머리기사 ---------- */
.lead { display: flex; flex-wrap: wrap; gap: 40px; padding: 32px 0; border-bottom: 1px solid var(--ink); }
.lead article { flex: 999 1 560px; min-width: 0; }
.lead aside { flex: 1 1 260px; min-width: 0; border-left: 1px solid var(--rule); padding-left: 32px; }
@media (max-width: 700px) { .lead aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 20px; } }
.facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 10px 12px; border-left: 1px solid var(--rule); }
.facts > div:first-child { border-left: 0; padding-left: 0; }
.facts dt { font-size: 11px; letter-spacing: 1px; color: var(--muted-2); }
.facts dd { margin: 4px 0 0; font-size: 14px; }
@media (max-width: 600px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .facts > div:nth-child(3) { border-left: 0; padding-left: 0; } }

/* ---------- 대장 표 ---------- */
.table-wrap { overflow-x: auto; border-top: 2px solid var(--ink); }
table.ledger { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 14px; }
.ledger th { white-space: nowrap; text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 1px; color: var(--muted-2); padding: 10px 12px; border-bottom: 1px solid var(--ink); }
.ledger td { padding: 16px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; text-align: right; }
.ledger .t { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.45; }
.ledger .sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.nowrap { white-space: nowrap; }
.sample { white-space: nowrap; display: inline-block; font-size: 11px; color: var(--muted-2); border: 1px solid var(--rule); padding: 1px 6px; margin-left: 6px; font-family: var(--sans); font-weight: 400; vertical-align: middle; }

.stage::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--stage-review); vertical-align: middle; }
.stage[data-s="개정 추진"]::before, .stage[data-s="입법예고"]::before { background: var(--stage-progress); }
.stage[data-s="확정·공표"]::before, .stage[data-s="판결 선고"]::before { background: var(--stage-done); }
.stage[data-s="시행"]::before { background: var(--stage-live); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted-2); margin-top: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 8px; }
.filters button { min-height: 40px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 14px; }
.filters button[aria-pressed="true"] { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); }

/* ---------- 목록 ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.55; }
.list li:last-child { border-bottom: 1px solid var(--rule); }
.dday { display: flex; gap: 14px; }
.dday .d { flex: none; width: 60px; font-family: var(--mono); font-size: 18px; color: var(--warn); }

/* ---------- 상세 ---------- */
table.info { width: 100%; border-collapse: collapse; font-size: 14px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); margin-bottom: 20px; }
.info th { width: 88px; text-align: left; font-weight: 500; font-size: 12px; letter-spacing: 1px; color: var(--muted-2); padding: 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.info td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule); }
.info tr:last-child th, .info tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) { .info tr { display: grid; grid-template-columns: 88px 1fr; } }

.stepper { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 13px; }
.stepper li { padding-top: 8px; border-top: 3px solid var(--ink); }
.stepper li.now { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }
.stepper li.todo { border-top-color: var(--rule); color: var(--muted-2); }

.points { margin: 0; padding-left: 22px; font-size: 17px; line-height: 1.85; color: var(--ink-2); }
.impacts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
@media (max-width: 600px) { .impacts { grid-template-columns: 1fr; } }
.impacts > div { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.impacts dt { font-size: 12px; letter-spacing: 1px; color: var(--accent); font-weight: 600; }
.impacts dd { margin: 4px 0 0; font-size: 15px; }
.block { margin-bottom: 32px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- 투표 ---------- */
.vote-btns { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.vote-btns button { min-height: 48px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: left; padding: 0 4px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 15px; }
.vote-btns button[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
.bar { height: 4px; background: #E8E3D8; margin: 6px 0 12px; }
.bar > span { display: block; height: 4px; background: var(--accent); }

/* ---------- 폼 ---------- */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
input[type=text], input[type=email], input[type=date], input[type=url], select, textarea {
  border: 1px solid var(--ink); background: #fff; padding: 10px 12px; font-size: 15px; min-height: 44px; border-radius: 0; color: var(--ink);
}
textarea { resize: vertical; min-height: 88px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.btn { min-height: 44px; padding: 0 22px; border: 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { color: #fff; text-decoration: none; filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.danger { background: var(--warn); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 6px 0; min-height: 32px; cursor: pointer; color: var(--muted); font-size: 13px; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.warn { font-size: 12px; color: var(--warn); margin: 0; }
.notice { padding: 12px 14px; background: var(--paper-2); font-size: 14px; margin: 12px 0; }
.notice.err { background: #F6E3DF; color: var(--warn); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { width: 18px; height: 18px; margin-top: 2px; }
.ts { margin: 8px 0; min-height: 0; }

/* ---------- 댓글 ---------- */
.comments h2 { font-size: 26px; font-weight: 900; margin-bottom: 18px; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.comment .meta { font-size: 13px; margin: 0 0 6px; }
.comment .body { margin: 0; font-size: 16px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.comment .acts { display: flex; gap: 16px; }
.replies { margin: 8px 0 0 24px; padding-left: 16px; border-left: 1px solid var(--rule); }
.replies .comment { border-bottom: 0; padding: 10px 0; }
.accepted { border-left: 3px solid var(--accent); background: var(--paper-2); padding: 16px 18px; }

/* ---------- Q&A ---------- */
.q-row { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.q-count { flex: none; width: 64px; text-align: center; border: 1px solid var(--rule); padding: 8px 0; align-self: flex-start; }
.q-count.done { border-color: var(--accent); color: var(--accent); }
.q-count b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 400; }
.q-count span { font-size: 11px; }
.q-row h2 { font-size: 19px; font-weight: 700; line-height: 1.45; margin: 0 0 6px; }
.q-meta { margin: 0; font-size: 13px; color: var(--muted); }

footer.site { margin-top: 64px; padding-top: 16px; border-top: 3px double var(--ink); font-size: 12px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer.site a { color: var(--muted-2); }
