:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6877;
  --line: #e2e6eb;
  --brand: #1f5f8b;
  --brand-soft: #e6f0f7;
  --hot: #c8412b;
  --hot-soft: #fbe9e5;
  --ok: #1d7a4f;
  --ok-soft: #e3f3ea;
  --soon: #8a5a00;
  --soon-soft: #fbf0d9;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161b; --surface: #1b2128; --text: #e6eaef; --muted: #9aa5b1; --line: #2b333d;
    --brand: #6fb0de; --brand-soft: #1d2f3d; --hot: #ff8a73; --hot-soft: #3a211c;
    --ok: #6fd3a0; --ok-soft: #173326; --soon: #f1c56b; --soon-soft: #352a14;
  }
}
:root[data-theme="dark"] {
  --bg: #12161b; --surface: #1b2128; --text: #e6eaef; --muted: #9aa5b1; --line: #2b333d;
  --brand: #6fb0de; --brand-soft: #1d2f3d; --hot: #ff8a73; --hot-soft: #3a211c;
  --ok: #6fd3a0; --ok-soft: #173326; --soon: #f1c56b; --soon-soft: #352a14;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--brand); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 14px; }

.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand) url("/favicon.svg") center/cover; }
.head-nav { display: flex; gap: 16px; }
.head-nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.head-nav a:hover { color: var(--text); }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 26px; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.02em; }
.lede { color: var(--muted); margin: 0 0 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--text); }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.hot b { color: var(--hot); }
.today-box { margin-top: 14px; background: var(--hot-soft); border-radius: var(--radius); padding: 14px 16px; }
.today-box h2 { font-size: 15px; margin: 0 0 6px; color: var(--hot); }
.today-box ul { list-style: none; margin: 0; padding: 0; }
.today-box li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 15px; }
.today-box li a { color: var(--text); text-decoration: none; }
.today-box li span { color: var(--muted); flex: none; }

.filters { position: sticky; top: 56px; z-index: 4; background: var(--bg); padding: 12px 0 6px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { border: 0; background: none; padding: 6px 16px; border-radius: 999px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--brand); color: #fff; }
.filter-row { display: flex; gap: 8px; margin: 10px 0 8px; }
.filter-row select, .filter-row input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 0; }
.filter-row input { flex: 1; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.count { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 8px 0 24px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--brand); }
.card[hidden] { display: none; }
.card h3 { font-size: 17px; line-height: 1.4; margin: 8px 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 14px; margin: 0; }
.sub { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.status, .tag { font-size: 12.5px; line-height: 1; padding: 5px 8px; border-radius: 6px; font-weight: 700; }
.status { background: var(--ok-soft); color: var(--ok); }
.status.st-today { background: var(--hot); color: #fff; }
.status.st-soon, .status.st-posted { background: var(--soon-soft); color: var(--soon); }
.status.st-closed, .status.st-unknown { background: var(--line); color: var(--muted); }
.tag { background: var(--brand-soft); color: var(--brand); }
.tag.ghost { background: none; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }

.crumbs { font-size: 14px; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--muted); }
.list-head h1 { font-size: 24px; margin: 8px 0 4px; }

.detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin: 12px 0 20px; }
.detail h1 { font-size: 23px; line-height: 1.35; margin: 10px 0 6px; letter-spacing: -0.01em; }
.detail h2 { font-size: 18px; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail h3 { font-size: 15px; margin: 16px 0 4px; color: var(--muted); }
.detail p { margin: 0 0 8px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
@media (min-width: 640px) { .facts { grid-template-columns: 1fr 1fr; } }
.facts div { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.facts dt { flex: none; width: 84px; color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 600; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 700; font-size: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.warn { background: var(--soon-soft); color: var(--soon); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note { color: var(--muted); font-size: 13.5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg); color: var(--muted); font-weight: 600; font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--bg); }
.gallery figcaption { font-size: 13px; color: var(--muted); }
.files { padding-left: 18px; font-size: 14.5px; }
.source { color: var(--muted); font-size: 13px; margin-top: 24px !important; }
.related h2 { font-size: 18px; }

.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin: 16px 0 24px; }
.prose h1 { font-size: 24px; margin-top: 0; }
.prose h2 { font-size: 18px; margin-top: 24px; }

.ad { margin: 16px 0; min-height: 100px; }
.ad.in-list { grid-column: 1 / -1; margin: 4px 0; min-height: 0; }
.ad.in-article { min-height: 0; }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.detail .ad { margin: 20px 0; }
/* 애드센스가 채우지 못한 자리는 접는다 (구글 공식 안내 방식) */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.site-foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 20px 0 40px; font-size: 14px; color: var(--muted); }
.site-foot strong { color: var(--text); }
.foot-links a { color: var(--muted); }
@media (max-width: 420px) {
  .hero h1 { font-size: 22px; }
  .stat b { font-size: 22px; }
  .head-nav { gap: 12px; }
}
