/* 될집 — docs/SPEC.md §3 브랜드. 8px 그리드, 읽기 칼럼 720px, 피드 2열(넓은 화면).
   전역 규칙: 한쪽만 굵거나 색이 다른 테두리 금지. 테두리는 사방 1px 중립색 또는 없음. */
:root {
  --bg: #FAFAF7;
  --ink: #1B1B1A;
  --ink-2: #55534E;
  --ink-3: #6B6964;
  --line: #E3E1DA;
  --surface: #FFFFFF;
  --tint: #F1F0EA;
  --accent: #E8590C;          /* 주 버튼 · "넣어볼 만함" 배지에만 */
  --ok: #2B8A3E;
  --maybe: #B7791F;
  --no: #868E96;
  --ok-bg: #EAF4EC;
  --maybe-bg: #FBF2E2;
  --no-bg: #F0F1F2;
  --radius: 8px;
  --read: 720px;
  --wide: 1040px;
  font-family: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 24px 0 48px; outline: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; margin-top: 32px; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 16px; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
table, .n, .dchip, .tab-count, .odds-ratio, .count, .step-count { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1:focus { outline: none; }
h1:focus-visible { outline: 3px solid var(--ink); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.wrap-read { max-width: var(--read); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: var(--radius); z-index: 10; }
.skip-link:focus { top: 8px; }
.muted { color: var(--ink-3); font-weight: 400; }
.fineprint { font-size: 0.8125rem; color: var(--ink-3); }
.boot { color: var(--ink-3); padding: 48px 0; }

/* 예시 데이터 띠 */
.sample-band { background: var(--ink); color: var(--bg); font-size: 0.8125rem; padding: 4px 0; text-align: center; }

/* 상단 바 */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.25rem; }
.brand-mark { width: 28px; height: 28px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; font-size: 0.9375rem; }
.site-nav a:hover { background: var(--tint); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; background: var(--tint); }
.count { background: var(--ink); color: var(--bg); border-radius: 999px; font-size: 0.75rem; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: 0.875rem; color: var(--ink-2); }
.site-footer .disclaimer { font-weight: 600; color: var(--ink); margin-bottom: 8px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--tint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: #D9500A; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1.0625rem; }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: 0.875rem; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-danger:hover { background: #000; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 24px 0 16px; }

/* 판정 배지: 색 + 모양 + 글자 */
.vb { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.875rem; white-space: nowrap; color: var(--ink); }
.vb-shape { font-size: 0.875em; line-height: 1; }
.vb-eligible { background: var(--ok-bg); } .vb-eligible .vb-shape, .vb-shape.vb-eligible { color: var(--ok); }
.vb-conditional { background: var(--maybe-bg); } .vb-conditional .vb-shape, .vb-shape.vb-conditional { color: var(--maybe); }
.vb-ineligible { background: var(--no-bg); } .vb-ineligible .vb-shape { color: var(--no); }
.vb-big { font-size: 1.125rem; padding: 6px 16px; }

/* 넣어볼 만함 — 유일한 포인트 색 배지 */
.worth { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--ink); font-weight: 800; font-size: 0.875rem; white-space: nowrap; }
.verdict-line .worth { font-size: 1.125rem; padding: 6px 16px; }
.odds-ratio, .odds-plain { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; }

/* D-day 칩 */
.dchip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
.dchip-urgent { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dchip-closed { color: var(--ink-3); background: var(--tint); font-weight: 500; }

.tag-sample { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0 6px; margin-right: 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--tint); color: var(--ink-2); vertical-align: 1px; }

/* 홈 */
.hero { padding: 24px 0 8px; max-width: var(--read); }
.hero h1 { font-size: 2rem; }
.hero .tagline { font-size: 1.125rem; font-weight: 400; color: var(--ink); margin: -8px 0 8px; }
.hero-compact h1 { font-size: 1.625rem; }
.lede { font-size: 1.0625rem; color: var(--ink-2); }
.tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); font-weight: 600; }
.tab[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab[aria-current="page"] .vb-shape { color: var(--bg); }
.tab-count { font-weight: 400; opacity: 0.8; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 8px; }
.filters label { display: flex; flex-direction: column; font-size: 0.8125rem; color: var(--ink-2); gap: 4px; }
.filters select { font: inherit; font-size: 0.9375rem; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 152px; }
.section-h { font-size: 1rem; color: var(--ink-2); margin: 24px 0 8px; }
.source-line { font-size: 0.8125rem; color: var(--ink-3); margin-top: 16px; }
.empty { color: var(--ink-2); background: var(--tint); padding: 16px; border-radius: var(--radius); }
.empty-state { background: var(--tint); padding: 24px; border-radius: var(--radius); margin: 16px 0; }

/* 피드 카드 */
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .feed:not(.feed-single) { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: relative; }
.card:hover { background: #FDFDFB; }
.card:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.card :focus-visible { outline: none; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-title { font-size: 1.0625rem; margin: 0 0 4px; }
.card-title a { text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:hover { text-decoration: underline; }
.card-meta { font-size: 0.875rem; color: var(--ink-2); margin: 0 0 4px; }
.card-dates { font-size: 0.875rem; color: var(--ink-2); margin: 0; font-variant-numeric: tabular-nums; }
.card-summary { font-size: 0.875rem; margin: 8px 0 0; }

.guides-strip { margin-top: 40px; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.guide-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; height: 100%; font-size: 0.875rem; }
.guide-list a strong { font-size: 1rem; }
.guide-list a:hover { background: var(--tint); }

/* 조건 입력 */
.onboarding h1 { font-size: 1.5rem; margin-top: 8px; }
.hint { color: var(--ink-2); }
.progress { height: 8px; background: var(--tint); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width 0.2s; }
.step-count { font-size: 0.8125rem; color: var(--ink-3); margin: 8px 0 16px; }
.choices { display: grid; gap: 8px; grid-template-columns: 1fr; margin: 24px 0 8px; }
.choices-years { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.choices-compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.choice { min-height: 52px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.choices-years .choice, .choices-compact .choice { text-align: center; padding: 8px; min-height: 48px; }
.choice:hover { background: var(--tint); }
.choice[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.choice[aria-pressed="true"]::before { content: "✓ "; }
.choice-unknown { color: var(--ink-2); background: var(--tint); }
.choices-years .choice-unknown, .choices-compact .choice-unknown { grid-column: 1 / -1; }
.consent { margin: 24px 0; display: grid; gap: 8px; }
.consent div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.consent dt { font-weight: 700; font-size: 0.875rem; color: var(--ink-2); }
.consent dd { margin: 0; }
.result-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* 공고 상세 */
.crumbs { font-size: 0.875rem; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.notice-head h1 { font-size: 1.5rem; margin: 4px 0 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; margin: 16px 0; }
.verdict-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.verdict-summary { font-size: 1.0625rem; font-weight: 600; }
.note { background: var(--maybe-bg); padding: 8px 12px; border-radius: var(--radius); font-size: 0.9375rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 8px 0 16px; }
caption { text-align: left; font-size: 0.875rem; color: var(--ink-2); padding-bottom: 8px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.8125rem; color: var(--ink-2); font-weight: 600; background: var(--tint); }
tbody th { font-weight: 600; white-space: nowrap; }
.n { text-align: right; white-space: nowrap; }
.checks .row-detail td { padding-top: 0; font-size: 0.875rem; color: var(--ink-2); }
.checks tr:has(+ .row-detail) th, .checks tr:has(+ .row-detail) td { border-bottom: 0; }
.ck { font-weight: 700; white-space: nowrap; }
.ck-pass span { color: var(--ok); }
.ck-fail span { color: var(--no); }
.ck-unknown span { color: var(--maybe); }
.row-unknown { background: #FDF9F0; }
.other-group { margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px; background: var(--surface); }
.other-group summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; gap: 8px; }
.odds-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.level { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: var(--tint); font-weight: 700; font-size: 0.875rem; }
.timeline { list-style: none; padding: 0; margin: 8px 0; }
.timeline li { display: grid; grid-template-columns: 16px 96px 1fr; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 1px solid var(--ink-3); justify-self: center; }
.timeline .past { color: var(--ink-3); }
.timeline .past .tl-dot { background: var(--ink-3); }
.timeline .today { font-weight: 700; }
.timeline .today .tl-dot { background: var(--ink); border-color: var(--ink); }
.tl-label { font-weight: 600; }
.tl-date { font-variant-numeric: tabular-nums; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 32px 0 8px; padding: 16px; background: var(--tint); border-radius: var(--radius); }
.cta .fineprint { flex-basis: 100%; margin: 8px 0 0; }
.provenance dl { display: grid; gap: 4px; margin: 8px 0 16px; }
.provenance dl div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; font-size: 0.9375rem; }
.provenance dt { color: var(--ink-2); }
.provenance dd { margin: 0; }

/* 대화상자 */
.dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: min(480px, calc(100vw - 32px)); width: 100%; background: var(--bg); color: var(--ink); }
.dialog::backdrop { background: rgba(27, 27, 26, 0.45); }
.dialog h2 { margin-top: 0; }
.dialog textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); resize: vertical; }
.counter { font-size: 0.8125rem; color: var(--ink-3); text-align: right; margin: 4px 0 0; }
.form-error, .error-box { background: var(--no-bg); padding: 12px 16px; border-radius: var(--radius); }

/* 알림함 */
.alerts-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 16px; }
.alerts-bar p { margin: 0; }
.alert-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.alert-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.alert-item.is-read { background: transparent; color: var(--ink-2); }
.alert-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.8125rem; margin-bottom: 4px; }
.kind { font-weight: 700; padding: 0 8px; border-radius: 4px; background: var(--tint); }
.kind-closes_tomorrow { background: var(--ink); color: var(--bg); }
.unread-dot { font-weight: 700; }
.alert-title { font-size: 1rem; margin: 0 0 4px; }
.alert-item p { margin: 0 0 8px; font-size: 0.9375rem; }
.notify { margin-top: 32px; }
.notify h2 { margin-top: 0; font-size: 1rem; }

/* 가이드 */
.guide-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.guide-tabs a { white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 0.875rem; background: var(--surface); }
.guide-tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.guide-table .term { color: var(--ink-2); font-size: 0.875rem; }
.faq { border-bottom: 1px solid var(--line); padding: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.faq p { margin: 8px 0; color: var(--ink-2); }
.sources { padding-left: 20px; }

/* 내 조건 */
.profile { display: grid; gap: 0; margin: 16px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.profile div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile div:last-child { border-bottom: 0; }
.profile dt { color: var(--ink-2); font-size: 0.9375rem; }
.profile dd { margin: 0; font-weight: 600; }
.src-note { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--ink-3); white-space: normal; }
.sources-status tbody th { white-space: normal; }

/* 소개 */
.about h2 { font-size: 1.125rem; }
.legend { list-style: none; padding: 0; display: grid; gap: 8px; }

/* 토스트 */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 20; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius); font-size: 0.9375rem; }

@media (max-width: 560px) {
  h1, .hero h1 { font-size: 1.5rem; }
  .site-nav a { padding: 8px 6px; font-size: 0.875rem; }
  .brand-name { font-size: 1.125rem; }
  .filters label { flex: 1 1 140px; }
  .filters select { min-width: 0; width: 100%; }
  .profile div, .provenance dl div { grid-template-columns: 1fr; gap: 0; }
  .timeline li { grid-template-columns: 16px 80px 1fr; }
  .checks th, .checks td { padding: 8px 4px; font-size: 0.875rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
thead th { white-space: nowrap; }
.sources-status table { min-width: 600px; }
.num-table td:first-child, .checks td:nth-child(2) { white-space: nowrap; }
.sources-status td { white-space: nowrap; }

/* 판정 모양(● ◐ ○)을 글꼴 대신 CSS로 그린다 — 굵은 글꼴·어두운 배경에서 ●가 네모처럼 보이는 문제 방지.
   글자는 aria-hidden이고, 의미는 옆의 글자(신청 가능·조건부·신청 불가)가 전한다. */
.vb-shape { display: inline-block; width: 10px; height: 10px; border-radius: 50%; font-size: 0 !important; line-height: 0; flex: none; vertical-align: middle; background: currentColor; }
.vb-big .vb-shape { width: 12px; height: 12px; }
.vb-conditional .vb-shape, .vb-shape.vb-conditional { background: linear-gradient(90deg, currentColor 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px currentColor; }
.vb-ineligible .vb-shape, .vb-shape.vb-ineligible { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.legend li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 실제 데이터 대응: 긴 제목 2줄 말줄임, 검수 전 안내 한 줄, 규칙 없음 블록, 경쟁률 준비 중 */
.card-title a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.review-note { margin: 0 0 16px; font-size: 0.875rem; color: var(--ink-2); }
.review-note summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.review-note summary::-webkit-details-marker { display: none; }
.review-note summary::after { content: "자세히"; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.review-note[open] summary::after { content: "접기"; }
.review-note p { background: var(--tint); padding: 8px 12px; border-radius: var(--radius); margin: 4px 0 0; }
.rn-mark { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--maybe-bg); color: var(--ink); font-weight: 800; font-size: 0.6875rem; flex: none; }
.no-rules h2 { margin-top: 0; font-size: 1.125rem; }
.odds-pending { color: var(--ink-2); background: var(--tint); padding: 12px 16px; border-radius: var(--radius); }
.dchip-unknown { background: var(--tint); color: var(--ink-2); font-weight: 600; }
.num-table td:nth-child(2) { min-width: 200px; white-space: normal; overflow-wrap: anywhere; }
.provenance dd a { overflow-wrap: anywhere; }
h1:focus, h1:focus-visible { outline: none; }
.dup-hint { font-size: 0.8125rem; color: var(--ink-2); background: var(--tint); display: inline-block; padding: 2px 8px; border-radius: 4px; margin: 0 0 4px; }

/* 출처 누락 안내 (§12.6) — 중립 배경 + 사방 1px 중립 테두리, 한쪽 강조 없음 */
.gaps { background: var(--tint); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.gaps-h { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.gaps-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gaps-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; color: var(--ink-2); }
.gaps-list a { font-weight: 600; white-space: nowrap; }
.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; }
.about h3 { font-size: 1rem; margin-top: 16px; }
.privacy-note { background: var(--tint); border-radius: var(--radius); padding: 12px 16px; color: var(--ink-2); font-size: 0.9375rem; }
