:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #15181e;
  --muted: #545b68;
  --line: #d9dee7;
  --accent: #0a5ad4;
  --accent-soft: #e6effd;
  --open: #0b7a3e;
  --open-soft: #e3f5ea;
  --soon: #b45309;
  --soon-soft: #fdf1e1;
  --closed: #7a808c;
  --radius: 14px;
  --base: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318; --card: #1b1e25; --text: #eceef2; --muted: #a8afbc; --line: #303540;
    --accent: #6ea4ff; --accent-soft: #1d2a44; --open: #4fd08a; --open-soft: #163223;
    --soon: #f2a54a; --soon-soft: #362812; --closed: #8a909c;
    color-scheme: dark;
  }
}
html.big { --base: 22px; }

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--base)/1.6 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { font-weight: 800; font-size: 1.25em; color: var(--accent); text-decoration: none; }
.text-size { font: inherit; font-size: 0.85em; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }

h1 { font-size: 1.5em; line-height: 1.3; margin: 24px 0 6px; }
h2 { font-size: 1.2em; margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0 0 16px; }

.toolbar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0; display: grid; gap: 10px; }
.toolbar .row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.toolbar .row.regions { grid-template-columns: 1fr 1fr; }
.toolbar .row.regions select { width: 100%; min-width: 0; }
.toolbar input[type="search"], .toolbar select {
  font: inherit; width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.toolbar select { width: auto; min-width: 120px; }
.toolbar label { display: grid; gap: 6px; font-weight: 700; }
.toolbar textarea, .toolbar input[type="email"] {
  font: inherit; width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 400;
}
.toolbar label select { width: 100%; font-weight: 400; }
.toolbar input:focus, .toolbar select:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 0.85em; min-height: 42px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 20px; }
.result-head h2 { margin: 0; }
.star { margin-left: auto; font-size: 1.4em; line-height: 1; background: none; border: none; color: var(--soon); cursor: pointer; padding: 4px 8px; min-width: 44px; min-height: 44px; }
.event-top .gu { text-decoration: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 0.9em; transition: 0.2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
button.btn { font: inherit; font-size: 0.95em; cursor: pointer; }

.event { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.event.open { border-left-color: var(--open); }
.event.upcoming { border-left-color: var(--soon); }
.event.closed { opacity: 0.6; }
.event-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.badge { font-size: 0.8em; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.badge.open { background: var(--open-soft); color: var(--open); }
.badge.upcoming { background: var(--soon-soft); color: var(--soon); }
.badge.closed { background: var(--bg); color: var(--closed); }
.badge.rule { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.rule-box { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; }
.rule-box p { margin: 4px 0; }
.gu { color: var(--muted); font-size: 0.9em; }
.event h3 { margin: 2px 0 6px; font-size: 1.15em; }
.event h3 a { color: var(--text); text-decoration: none; }
.event .label { color: var(--accent); font-weight: 800; }
.when { font-size: 1.1em; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.meta { margin: 2px 0; color: var(--muted); }
.meta b { color: var(--text); }
.note { margin: 8px 0 0; padding: 10px 12px; background: var(--soon-soft); border-radius: 10px; font-size: 0.95em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 12px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 0.95em; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.empty { color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }

.tips { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.tips li { margin: 6px 0; }
.facility-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.facility-list a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; text-decoration: none; color: var(--text); font-weight: 700; }
.facility-list span { color: var(--muted); font-weight: 400; font-size: 0.9em; }
.warn { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0; }
.ad-slot { margin: 24px 0; min-height: 100px; }
.ad-slot:empty { display: none; }
@media print {
  .site-header, .toolbar, .actions, .star, .ad-slot, .site-footer, .text-size { display: none !important; }
  body { background: #fff; color: #000; font-size: 14pt; }
  .event { break-inside: avoid; border: 1px solid #999; }
  .event.closed { display: none; }
}
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--card); }
.site-footer p { color: var(--muted); font-size: 0.8em; margin: 12px 0; }
