:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --ink: #1b1f1d;
  --muted: #5d6662;
  --line: #e1e5e2;
  --accent: #0f766e;
  --accent-soft: #e3f2ef;
  --open: #11795a;
  --open-soft: #e2f4ec;
  --soon: #a15c00;
  --soon-soft: #fdf0dc;
  --closed: #6b7270;
  --closed-soft: #eef0ef;
  --danger: #c2341f;
  --danger-soft: #fdebe7;
  --radius: 12px;
  --map-fill: #cde6e0;
  --map-line: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121514;
    --surface: #1b1f1e;
    --ink: #e8ece9;
    --muted: #9aa49f;
    --line: #2c3331;
    --accent: #3cc2b0;
    --accent-soft: #173431;
    --open: #4fd1a1;
    --open-soft: #163329;
    --soon: #f0b25a;
    --soon-soft: #3a2b14;
    --closed: #9aa19f;
    --closed-soft: #262b2a;
    --danger: #ff8a73;
    --danger-soft: #3b1f1a;
    --map-fill: #24524c;
    --map-line: #121514;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.call119 { order: 2; }
.search { position: relative; flex: 1 1 300px; order: 1; max-width: 420px; }
.search input { width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; background: var(--surface); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: min(70vh, 480px); overflow-y: auto; z-index: 20; }
.search-results[hidden] { display: none; }
.search-item { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.search-item:hover, .search-item[aria-selected="true"] { background: var(--accent-soft); }
.search-item strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-kind { flex: none; font-size: 11.5px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 0 5px; }
.sr-kind-p { color: var(--muted); border-color: var(--line); }
.sr-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.search-msg { padding: 9px 10px; font-size: 13.5px; color: var(--muted); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 19px; }
.logo small { font-weight: 500; font-size: 13px; color: var(--muted); }
.logo-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 20px; line-height: 1; }
.call119 { background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; text-decoration: none; }

main { padding-top: 20px; padding-bottom: 48px; }
h1 { font-size: 26px; line-height: 1.3; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 19px; margin: 32px 0 12px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs .sep { opacity: .6; }
.summary { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 14px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; color: var(--muted); }

/* home */
.hero { padding: 20px 0 8px; }
.hero h1 { font-size: 32px; }
.hero p { color: var(--muted); max-width: 560px; }
.hero .now { display: inline-block; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.hero .now:empty { display: none; }
.sido-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sido-grid a { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.sido-grid a:hover { border-color: var(--accent); }
.sido-grid strong { font-size: 17px; }
.sido-grid span { font-size: 13px; color: var(--muted); }
.emergency { background: var(--danger-soft); border-radius: var(--radius); padding: 4px 20px 8px; margin-top: 32px; }
.emergency h2 { color: var(--danger); margin-top: 16px; }
.emergency a { color: var(--danger); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 8px; }

/* korea map */
.map-section h2 { margin-bottom: 4px; }
.korea-map { position: relative; max-width: 560px; margin: 0 auto; }
.korea-map svg { display: block; width: 100%; height: auto; }
.map-region path { fill: var(--map-fill); stroke: var(--map-line); stroke-width: 1.6; stroke-linejoin: round; transition: fill .15s ease; }
.map-region:hover path, .map-region:focus-visible path, .map-region.is-active path { fill: var(--accent); }
.map-region:focus { outline: none; }
.map-region:focus-visible path { stroke: var(--ink); stroke-width: 2.5; }
.map-label { font-size: 28px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: middle; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.map-label.small { font-size: 21px; }
.map-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 13px; line-height: 1.45; }
.map-tip[hidden] { display: none; }
.map-tip strong { display: block; font-size: 15px; }
.map-tip span { display: block; color: var(--muted); }
.map-tip em { display: block; font-style: normal; color: var(--accent); font-weight: 600; margin-top: 2px; }
.map-credit { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* region list */
.region-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.region-list a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--ink); }
.region-list a:hover { border-color: var(--accent); }
.region-list span { display: block; font-size: 13px; color: var(--muted); }

/* tabs & toolbar */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 0 12px; }
.tabs a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.caution { font-size: 14px; background: var(--soon-soft); color: var(--ink); padding: 10px 14px; border-radius: 10px; margin: 0 0 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.count { font-size: 14px; color: var(--muted); }

/* cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card[hidden] { display: none; }
.card { content-visibility: auto; contain-intrinsic-size: auto 190px; }
.card.reveal { animation: card-in .28s ease-out both; }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card.reveal { animation: none; } }
.more { text-align: center; margin-top: 14px; }
.more[hidden] { display: none; }
.more-btn { background: var(--surface); cursor: pointer; font: inherit; font-weight: 600; min-width: 200px; justify-content: center; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card h3 { margin: 0; font-size: 17px; }
.badge { flex: none; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.open { background: var(--open-soft); color: var(--open); }
.badge.soon { background: var(--soon-soft); color: var(--soon); }
.badge.closed { background: var(--closed-soft); color: var(--closed); }
.addr { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.focus { margin: 6px 0 0; font-weight: 700; color: var(--accent); font-size: 15px; }
.today { margin: 4px 0 0; font-size: 14px; }
.today:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.btn-call { background: var(--accent); border-color: var(--accent); color: #fff; }
details { margin-top: 8px; font-size: 14px; }
summary { cursor: pointer; color: var(--muted); }
.hours { border-collapse: collapse; margin-top: 6px; }
.hours th, .hours td { text-align: left; padding: 3px 16px 3px 0; font-weight: 400; }
.hours th { color: var(--muted); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); padding: 20px 0 32px; }
.site-footer p { margin: 4px 0; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.site-footer a { color: var(--muted); }

.card.hit { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: hit 1.6s ease-out; }
@keyframes hit { 0%, 30% { background: var(--accent-soft); } 100% { background: var(--surface); } }
.card { scroll-margin-top: 140px; }

@media (max-width: 520px) {
  .search { flex-basis: 100%; max-width: none; }
  .logo small { display: none; }
  h1 { font-size: 23px; }
  .hero h1 { font-size: 27px; }
}
