:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15181e;
  --muted: #5b6370;
  --line: #e3e6eb;
  --accent: #2f5bea;
  --accent-weak: #eaf0ff;
  --closing: #c5281c;
  --closing-weak: #fdecea;
  --open: #0d7a4c;
  --open-weak: #e6f5ed;
  --upcoming: #6941c6;
  --upcoming-weak: #f1ecfd;
  --always: #475467;
  --always-weak: #eef0f3;
  --new: #b54708;
  --new-weak: #fef0c7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e8eaee;
    --muted: #9aa3b2;
    --line: #2a2f3a;
    --accent: #7b9bff;
    --accent-weak: #1d2640;
    --closing: #ff8a7f;
    --closing-weak: #3a1d1b;
    --open: #5fd4a0;
    --open-weak: #15302a;
    --upcoming: #b9a2ff;
    --upcoming-weak: #29213f;
    --always: #b7c0ce;
    --always-weak: #262b34;
    --new: #fdb022;
    --new-weak: #3a2a0f;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; letter-spacing: -0.01em; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; }

.sample-banner {
  background: var(--new-weak); color: var(--new); text-align: center;
  font-size: 14px; font-weight: 600; padding: 8px 16px;
}

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 18px; }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--bg); text-decoration: none; }

/* hero */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(26px, 5vw, 36px); margin: 0 0 8px; }
.hero .num { color: var(--accent); }
.lead { color: var(--muted); margin: 0; font-size: 17px; }
.stat-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.stat {
  display: flex; align-items: baseline; gap: 8px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  box-shadow: var(--shadow);
}
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat strong { font-size: 22px; }
.stat span { color: var(--muted); font-size: 14px; }
.stat-closing strong { color: var(--closing); }

/* filters */
.filters {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center;
  padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  position: sticky; top: 68px; z-index: 5; box-shadow: var(--shadow);
}
.field input, .field select {
  width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 42px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; white-space: nowrap; padding: 0 4px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--closing); }
.result-count { color: var(--muted); font-size: 14px; margin: 16px 2px 8px; }
.result-count span { color: var(--text); font-weight: 700; }

/* cards */
.cards { display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card[hidden] { display: none; }
.card-link { display: block; padding: 16px 18px; color: var(--text); }
.card-link:hover { text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-title { font-size: 17px; margin: 10px 0 4px; }
.card-summary { margin: 0 0 6px; color: var(--text); opacity: 0.85; font-size: 15px; }
.card-meta { margin: 0; color: var(--muted); font-size: 13px; }

.badge, .tag {
  display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; line-height: 1;
  padding: 5px 8px; border-radius: 999px; white-space: nowrap;
}
.badge-closing { background: var(--closing); color: #fff; }
.badge-open { background: var(--open-weak); color: var(--open); }
.badge-upcoming { background: var(--upcoming-weak); color: var(--upcoming); }
.badge-always, .badge-unknown { background: var(--always-weak); color: var(--always); }
.badge-closed { background: var(--always-weak); color: var(--muted); text-decoration: line-through; }
@media (prefers-color-scheme: dark) { .badge-closing { color: #1b0b09; } }
.tag { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
a.tag:hover { text-decoration: none; filter: brightness(0.97); }
.tag-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.tag-new { background: var(--new-weak); color: var(--new); }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ad */
.ad { margin: 16px 0; min-height: 90px; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--bg) 8px, var(--bg) 16px);
}

/* page / notice */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin: 20px 0 0; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.page-head { padding: 12px 0 16px; }
.page-head h1 { font-size: clamp(24px, 4.5vw, 32px); margin: 8px 0; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 12px; box-shadow: var(--shadow); }
.notice-head h1 { font-size: clamp(22px, 4.2vw, 30px); margin: 12px 0 16px; }
.facts { display: grid; margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.facts dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px;
  border-radius: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--text); background: var(--surface);
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0b1020; } }

.summary-box { background: var(--accent-weak); border-radius: var(--radius); padding: 20px; margin: 8px 0 20px; }
.summary-box h2 { margin: 0 0 6px; font-size: 15px; color: var(--accent); letter-spacing: 0.02em; }
.one-line { font-size: 19px; font-weight: 700; margin: 0 0 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.summary-box h3 { font-size: 14px; margin: 0 0 4px; color: var(--muted); }
.summary-box ul { margin: 0; padding-left: 18px; }
.summary-box p { margin: 0; }
.check-before { margin-top: 14px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.check-before h3 { color: var(--closing); }
.good-for { margin-top: 12px !important; }
.good-for strong { margin-right: 6px; }
.summary-box .fine { margin-top: 12px; }

.section { margin: 28px 0; }
.section h2 { font-size: 19px; margin: 0 0 10px; }
.source-text { white-space: pre-line; background: var(--bg); border-radius: 10px; padding: 14px 16px; font-size: 15px; }
.files { margin: 0; padding-left: 18px; }
.source-line { margin: 20px 0 0; }

/* posts */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.post-list-lg li p { margin: 4px 0; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 24px 24px; margin: 12px 0; }
.prose { font-size: 17px; line-height: 1.8; }
.prose h2 { font-size: 21px; margin: 32px 0 8px; }
.prose h3 { font-size: 18px; margin: 24px 0 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; background: var(--surface); }
.footer-links { display: grid; gap: 10px; margin-bottom: 16px; }
.footer-links div { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; }
.footer-links strong { width: 100%; font-size: 13px; color: var(--muted); }
.footer-links a { color: var(--text); }

@media (max-width: 720px) {
  .filters { grid-template-columns: 1fr 1fr; top: 0; position: static; }
  .field-search { grid-column: 1 / -1; }
  .check { grid-column: 1 / -1; }
  .notice, .post { padding: 18px 16px; }
  .summary-grid { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 76px 1fr; }
  .site-header { position: static; }
}
