:root, [data-theme="light"] {
  --bg: #f4f5f7; --card: #fff; --fg: #17191c; --mute: #6b7280; --line: #e3e6ea; --soft: #f0f2f5;
  --acc: #1f4fd1; --acc-soft: #e8eefc; --ok: #13804b; --ok-soft: #e4f5ec; --warn: #b45309; --warn-soft: #fdf1e1;
  --bad: #c0352b; --bad-soft: #fbe9e7; --local: #7c3aed; --local-soft: #f1eafe;
  --r: 10px;
}
[data-theme="dark"] {
  --bg: #0f1114; --card: #181b20; --fg: #e7e9ec; --mute: #9aa3af; --line: #2a2f37; --soft: #1f2329;
  --acc: #7ea2ff; --acc-soft: #1c2640; --ok: #4ade80; --ok-soft: #12291c; --warn: #fbbf24; --warn-soft: #2d2410;
  --bad: #f87171; --bad-soft: #2f1615; --local: #c4a5ff; --local-soft: #251b3a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114; --card: #181b20; --fg: #e7e9ec; --mute: #9aa3af; --line: #2a2f37; --soft: #1f2329;
    --acc: #7ea2ff; --acc-soft: #1c2640; --ok: #4ade80; --ok-soft: #12291c; --warn: #fbbf24; --warn-soft: #2d2410;
    --bad: #f87171; --bad-soft: #2f1615; --local: #c4a5ff; --local-soft: #251b3a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 Pretendard, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; line-height: 1.35; }
h2 { font-size: 15px; margin: 0 0 10px; }
.mute { color: var(--mute); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* 상단 바 */
.top { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; color: var(--fg); white-space: nowrap; }
.brand b { color: var(--acc); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--mute); white-space: nowrap; }
.nav a.on, .nav a:hover { background: var(--soft); color: var(--fg); text-decoration: none; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); white-space: nowrap; }
.who button { background: none; border: 0; color: var(--mute); cursor: pointer; font: inherit; padding: 0; }
.theme-toggle { display: flex; background: var(--soft); border-radius: 6px; overflow: hidden; font-size: 12px; }
.theme-toggle button { padding: 4px 8px; border: 0; background: none; color: var(--mute); cursor: pointer; }
.theme-toggle button.on { background: var(--acc); color: #fff; }
[data-theme="dark"] .theme-toggle button.on { color: #0f1114; }
@media (max-width: 640px) { .who .name { display: none; } .top .in { gap: 10px; } }

main { max-width: 1080px; margin: 0 auto; padding: 16px 16px 60px; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--bad-soft); color: var(--bad); }

/* 카드·박스 */
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* 요약 타일 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; color: var(--fg); }
.stat:hover { text-decoration: none; border-color: var(--acc); }
.stat .n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--mute); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* 필터 */
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 220px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 10px; font-size: 13px; color: var(--mute); border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--acc); color: #fff; }
.seg a:hover { text-decoration: none; }
@media (prefers-color-scheme: dark) { .seg a.on, .btn:not(.line):not(.danger) { color: #0f1114; } }

input, select, textarea { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; max-width: 100%; }
textarea { width: 100%; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc-soft); border-color: var(--acc); }
.btn { display: inline-block; font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--acc); background: var(--acc); color: #fff; cursor: pointer; white-space: nowrap; }
.btn.line { background: var(--card); color: var(--acc); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.danger { border-color: var(--bad); background: var(--card); color: var(--bad); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }

/* 공고 카드 */
.bid { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; color: var(--fg); }
.bid:hover { border-color: var(--acc); text-decoration: none; }
.bid .row1 { display: flex; gap: 10px; align-items: flex-start; }
.bid .title { font-weight: 600; flex: 1; }
.bid .score { font-size: 12px; font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: 6px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.bid .meta { color: var(--mute); font-size: 13px; margin-top: 3px; }
.bid.closed { opacity: .55; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.chip { font-size: 12px; line-height: 18px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--mute); white-space: nowrap; }
.chip.local { background: var(--local-soft); color: var(--local); font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.acc { background: var(--acc-soft); color: var(--acc); }
.chip.dday { font-weight: 700; }

/* 상세 */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; word-break: break-all; }
@media (max-width: 480px) { .kv { grid-template-columns: 96px 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { width: 140px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.timeline .past { color: var(--mute); text-decoration: line-through; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.note { padding: 8px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .body { white-space: pre-wrap; margin-top: 2px; }
.verdict { border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict b { font-size: 16px; }

/* 표 */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { color: var(--mute); font-weight: 500; font-size: 13px; }
.scroll { overflow-x: auto; }

/* 일정 */
.day { margin-bottom: 14px; }
.day h2 { position: sticky; top: 52px; background: var(--bg); padding: 6px 0; margin: 0; }
.ev { display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 6px; color: var(--fg); }
.ev:hover { text-decoration: none; border-color: var(--acc); }
.ev .time { width: 48px; flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--mute); }
.ev.key { border-left: 3px solid var(--bad); }

/* 페이지 */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.pager span { color: var(--mute); }
.empty { text-align: center; color: var(--mute); padding: 48px 0; }

/* 로그인 */
.login { max-width: 360px; margin: 12vh auto 0; }
.login input { width: 100%; margin-bottom: 10px; padding: 10px 12px; }
.login .btn { width: 100%; padding: 10px; }
