/* 물때와 바다날씨 — 웹.  시안: 웹 앱.dc.html (네이비 + 하늘색, 다크 전용) */

:root {
  --bg: #0A1628;
  --surface: #111F36;
  --surface-2: #1A2B49;
  --inset: #0D1B31;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #F1F5FB;
  --muted: #8FA3C2;
  --sky: #4FC3F7;
  --sky-soft: rgba(79, 195, 247, 0.14);
  --sky-ink: #0A1628;
  --low: #FFB74D;
  --low-soft: rgba(255, 183, 77, 0.14);
  --good: #6EE7A8;

  --font: "Pretendard", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --num: "Outfit", "Pretendard", system-ui, sans-serif;

  --r-card: 28px;
  --r-panel: 24px;
  --r-tile: 16px;
  --max: 1320px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); text-decoration: none; }
a:hover { color: #7DD3FC; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
small { font-size: 0.85em; }
b { font-weight: 700; }

:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 6px; }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sky { color: var(--sky); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 16px; border-radius: 12px; background: var(--sky); color: var(--sky-ink); font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ───────── 상단 바 ───────── */

.topbar {
  position: sticky; top: 0; z-index: 1100;
  background: rgba(10, 22, 40, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 8px; color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 10px; display: block; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 999px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.tabs a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tabs a[aria-current="page"] { background: var(--sky); color: var(--sky-ink); font-weight: 700; }

.place {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: 14px; padding: 5px 5px 5px 14px;
  font-size: 13px; color: var(--muted);
}
.place select {
  min-width: 140px; max-width: 220px;
  background: var(--surface-2); color: var(--text); border: 0; border-radius: 10px;
  padding: 8px 12px; font-size: 14px; font-weight: 600;
}
.place select:disabled { opacity: 0.6; }
.place option, .place optgroup { background: var(--surface-2); color: var(--text); }

/* ───────── 본문 ───────── */

.page { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 24px; outline: none; }
.view { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; color: var(--muted); }
h1 { margin-top: 2px; font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }

.moon-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--muted);
  background: var(--surface); padding: 8px 14px 8px 8px; border-radius: 999px;
}
.moon-chip b { color: var(--text); }

.card { background: var(--surface); border-radius: var(--r-card); padding: 24px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head h2 { font-size: 14px; font-weight: 600; }
.card-head.pad { padding: 20px 24px 12px; }
.card-head.pad h2 { font-size: 17px; font-weight: 700; }
.label { font-size: 12px; color: var(--muted); }
.value { font-family: var(--num); font-size: 28px; font-weight: 600; line-height: 1.2; }
.value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.right { text-align: right; }

.notice { color: var(--muted); }
.notice b { color: var(--text); }

/* 2열/3열 격자: 좁은 화면에서는 한 줄로 쌓는다. */
.grid-hero, .grid-obs, .grid-wx { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) {
  .grid-hero, .grid-wx { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .grid-obs { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .span-2 { grid-column: span 1; }
}
.span-all { grid-column: 1 / -1; }

/* ───────── 물때: 히어로 ───────── */

.hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: 28px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.hero > * { position: relative; }
.hero-glow {
  position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  background: rgba(79, 195, 247, 0.16); filter: blur(40px);
}
.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.hero-row.end { align-items: flex-end; gap: 16px; flex-wrap: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--sky); background: var(--sky-soft);
  padding: 6px 12px; border-radius: 999px;
}
.badge > span:first-child { display: inline-flex; }

.remain {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px;
  font-size: clamp(38px, 4vw, 64px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1;
}
.remain-value { color: var(--sky); white-space: nowrap; }
.remain-unit { font-size: 0.42em; font-weight: 600; color: var(--text); white-space: nowrap; }

.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--low), var(--sky)); }
.progress-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ───────── 물때: 곡선 ───────── */

.curve-card { display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 18px; }
.sun-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.sun-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--low); }

.chart-box { width: 100%; min-width: 0; }
.chart { display: block; overflow: visible; max-width: 100%; }
.t-time { font: 700 15px var(--num); fill: var(--text); }
.t-sub, .t-axis { font: 12px var(--num); fill: var(--muted); }
.t-temp { font: 700 13px var(--num); fill: var(--text); }

.tide-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.tide-chip { border-radius: var(--r-tile); padding: 12px; text-align: center; }
.tide-chip.up { background: var(--sky-soft); }
.tide-chip.down { background: var(--low-soft); }
.tide-chip .k { font-size: 12px; font-weight: 600; }
.tide-chip.up .k { color: var(--sky); }
.tide-chip.down .k { color: var(--low); }
.tide-chip .t { font-size: 22px; font-weight: 700; margin-top: 2px; }
.tide-chip .l { font-size: 13px; color: var(--muted); }

/* ───────── 물때: 7일 예보 ───────── */

.forecast { padding: 0; overflow: hidden; }
.date-pick { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--sky); cursor: pointer; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.date-pick:focus-within { outline: 2px solid var(--sky); outline-offset: 4px; border-radius: 6px; }

.ftable { overflow-x: auto; }
.frow {
  display: grid; grid-template-columns: 72px 130px 150px repeat(4, minmax(0, 1fr)); gap: 12px;
  padding: 12px 24px; align-items: center; border-bottom: 1px solid var(--line-soft);
}
.frow:last-child { border-bottom: 0; }
.frow.fhead { padding: 8px 24px; font-size: 12px; color: var(--muted); }
.frow.is-today { background: rgba(79, 195, 247, 0.06); }
.f-moon { display: flex; align-items: center; gap: 8px; }
.f-moon b { font-size: 13px; }
.f-date .d { font-size: 15px; font-weight: 700; }
.f-date .s { font-size: 12px; color: var(--muted); }
.f-date .s.sky { color: var(--sky); }
.f-sun { font-size: 13px; color: var(--muted); }
.f-ev { line-height: 1.2; }
.f-ev .t { font-size: 16px; font-weight: 600; }
.f-ev .l { font-size: 12px; font-weight: 600; }
.f-ev .l.up { color: var(--sky); }
.f-ev .l.down { color: var(--low); }

@media (max-width: 760px) {
  .frow.fhead { display: none; }
  .frow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; padding: 14px 16px; }
  .f-moon { grid-column: 1; flex-direction: column; align-items: flex-start; gap: 4px; }
  .f-date { grid-column: 2; }
  .f-sun { grid-column: 3 / 5; text-align: right; font-size: 12px; }
  .card-head.pad { padding: 18px 16px 10px; }
}

/* ───────── 물때: 실측 ───────── */

.obs-card { display: flex; flex-direction: column; gap: 14px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap;
  transition: color .15s;
}
.card .pill { background: var(--surface-2); }
.pill:hover { color: var(--text); }
.pill[aria-selected="true"] { background: var(--sky); color: var(--sky-ink); font-weight: 700; }
.obs-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.obs-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.stats { align-self: start; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.stat .value { font-size: 30px; font-weight: 700; }
.stat.wide { grid-column: 1 / -1; }
.stat .extra { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-foot { margin-top: 16px; font-size: 12px; color: var(--muted); }
.wind-arrow { display: inline-block; vertical-align: -2px; }

/* ───────── 낚시예보 ───────── */

.spot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.spot-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: 13px;
}
.spot-chip small { color: var(--muted); }
.spot-chip:hover { color: var(--text); }
.spot-chip[aria-selected="true"] { background: var(--surface-2); color: var(--text); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--sky); }

.summary {
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  padding: 14px 20px; border-radius: 20px; font-size: 14px; color: var(--muted);
}
.summary b { color: var(--text); }

.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fish-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.fish-top { display: flex; align-items: center; gap: 16px; }
.fish-img { width: 120px; height: 84px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: #fff; overflow: hidden; }
.fish-img img { width: 110px; height: 74px; object-fit: contain; display: block; }
.fish-name { flex: 1; min-width: 0; }
.fish-name h3 { font-size: 22px; font-weight: 700; }
.fish-name p { margin-top: 4px; font-size: 13px; color: var(--muted); }

.idx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.idx-box { background: var(--inset); border-radius: var(--r-tile); padding: 12px 14px; }
.idx-value { margin-top: 2px; font-size: 16px; font-weight: 700; }
.idx-bars { display: flex; gap: 3px; margin-top: 8px; }
.idx-bars span { flex: 1; height: 5px; border-radius: 3px; }
.boat-card { padding: 20px; }
.boat-card .idx-value { font-size: 20px; }

/* ───────── 날씨 ───────── */

.wx-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.wx-temp { font-size: clamp(60px, 6vw, 88px); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; }
.wx-temp span { font-size: 0.4em; color: var(--muted); font-weight: 500; }
.wx-desc { margin-top: 8px; font-size: 14px; }
.wx-side { display: flex; flex-direction: column; gap: 14px; text-align: right; }
.wx-side .value { font-size: 26px; }
.wx-side .value small { font-size: 13px; }
.wx-chart { display: flex; flex-direction: column; gap: 8px; }

.wx-table { padding: 0; overflow: hidden; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; background: var(--inset); border-radius: 999px; }
.segmented button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; }
.segmented button[aria-selected="true"] { background: var(--sky); color: var(--sky-ink); font-weight: 700; }

.wx-grid { overflow-x: auto; }
.wx-row {
  display: grid; grid-template-columns: 80px minmax(0, 1fr) 100px 150px 80px; gap: 12px;
  padding: 12px 24px; align-items: center; border-bottom: 1px solid var(--line-soft); font-size: 15px;
}
.wx-row.wx-head { padding: 8px 24px; font-size: 12px; color: var(--muted); }
.wx-row .t { font-weight: 600; }
.wx-row .w { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.wx-row .w .muted { font-size: 13px; }
.wx-row .p { color: var(--sky); }
.wx-row .v { display: inline-flex; align-items: center; gap: 6px; }
.wx-row .v small { font-size: 12px; }
.wx-icon { display: inline-flex; }
.wx-day { padding: 10px 24px; font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--line-soft); }
.wx-daily .wx-row { grid-template-columns: 120px minmax(0, 1fr) 100px 160px; }
.wx-daily .lo { color: var(--sky); }
.wx-daily .hi { color: var(--low); }

@media (max-width: 640px) {
  .wx-hero { padding: 22px; }
  .wx-row { grid-template-columns: 52px minmax(0, 1fr) 44px 88px; gap: 8px; padding: 12px 16px; font-size: 14px; }
  .wx-row.wx-head { padding: 8px 16px; }
  .wx-row > :nth-child(5) { display: none; }
  .wx-row .v small { display: none; }
  .wx-row .w .muted { display: none; }
  .wx-day { padding: 10px 16px; }
  .wx-daily .wx-row { grid-template-columns: 70px minmax(0, 1fr) 44px 92px; }
  .wx-daily .wx-row .w .muted { display: inline; }
}

/* ───────── 지도 ───────── */

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1000px) { .map-layout { grid-template-columns: minmax(0, 1fr) 340px; } }

.map-wrap { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--inset); isolation: isolate; }
.map, .map-skel { height: clamp(460px, 72vh, 780px); width: 100%; }
.map-skel { border-radius: var(--r-card); }
.map-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.legend { position: absolute; left: 16px; top: 16px; z-index: 1000; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 32px); }
.legend-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border: 0; border-radius: 999px;
  background: rgba(17, 31, 54, 0.92); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); transition: opacity .15s;
}
.legend-chip[aria-pressed="false"] { opacity: 0.45; }

.kind-badge { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: #0A1628; }

.map-ctrl { position: absolute; right: 16px; bottom: 28px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.map-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px;
  background: rgba(17, 31, 54, 0.92); color: var(--text); font-size: 20px; font-weight: 600;
}
.map-btn.sky { color: var(--sky); }
.map-btn:hover { background: var(--surface-2); }
.map-msg { position: absolute; left: 16px; bottom: 28px; z-index: 1000; max-width: calc(100% - 100px); padding: 10px 14px; border-radius: 14px; background: var(--surface); font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }

.pin-wrap { background: none; border: 0; }
.pin {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50% 50% 50% 4px; background: var(--c); color: #0A1628;
  border: 2px solid rgba(10, 22, 40, 0.6); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transform-origin: 3px 31px; transition: transform .12s;
}
.pin.selected { transform: scale(1.2); box-shadow: 0 0 0 3px var(--sky), 0 4px 14px rgba(0, 0, 0, 0.5); }

.leaflet-container { background: var(--inset); font-family: var(--font); }
/* OSM 표준 타일을 네이비 톤으로: 반전 + 색상 회전으로 육지는 어둡게, 바다는 짙은 파랑으로. */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }

.cluster-wrap { background: none; border: 0; }
.cluster {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%;
  background: rgba(17, 31, 54, 0.94); color: var(--text); border: 2px solid var(--sky);
  font-size: 13px; font-weight: 700; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.leaflet-container a { color: var(--sky); }
.leaflet-control-attribution { background: rgba(10, 22, 40, 0.75) !important; color: var(--muted) !important; font-size: 11px; }
.leaflet-marker-icon:focus-visible { outline: 2px solid var(--sky); border-radius: 8px; }

.sel { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-panel); }
.sel-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--c); color: #0A1628; }
.sel-text { flex: 1; min-width: 0; }
.sel-text .muted { font-size: 12px; }
.sel-name { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nearby { padding: 0; overflow: hidden; border-radius: var(--r-panel); }
.nearby-head { display: flex; justify-content: space-between; padding: 14px 20px 10px; font-size: 13px; color: var(--muted); }
.nearby-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 20px;
  border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left;
}
.nearby-row:hover { background: rgba(255, 255, 255, 0.03); }
.nearby-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nearby-name b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-name small { font-size: 12px; color: var(--muted); }
.dist { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ───────── 버튼·빈 상태 ───────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600;
}
.btn:hover { background: #22375c; color: var(--text); }
.btn.primary { background: var(--sky); color: var(--sky-ink); font-weight: 700; padding: 9px 14px; white-space: nowrap; }
.btn.primary:hover { background: #7DD3FC; color: var(--sky-ink); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 24px; text-align: center; color: var(--muted); }

.skel { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ───────── CCTV ───────── */

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-cctv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 900px) { .grid-cctv { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

.card.cctv-card { padding: 0; overflow: hidden; }
.cctv-stage { display: grid; place-items: center; aspect-ratio: 16 / 9; background: #000; }
.cctv-stage img, .cctv-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cctv-msg { padding: 24px; text-align: center; color: var(--muted); }
.cctv-open { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 24px 0; }
.cctv-about { padding: 16px 24px 24px; color: var(--muted); font-size: 14px; }
.cctv-about b { color: var(--text); }

.side-links { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.side-links h2 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 14px; color: var(--text);
}
.link-row:hover { background: var(--surface-2); color: var(--text); }
.link-main { display: flex; flex-direction: column; min-width: 0; }
.link-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-main small { color: var(--muted); }
.link-row .dist { color: var(--muted); font-size: 13px; flex: none; }
.link-row.more { justify-content: center; color: var(--sky); font-size: 13px; font-weight: 600; }

.lead { max-width: 60ch; }
.cctv-search input {
  width: min(320px, 100%); padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 14px;
}
.cctv-search input::placeholder { color: var(--muted); }
.cctv-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.cctv-group { padding: 20px; }
.cctv-group h2 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.cctv-group h2 small { margin-left: 4px; font-weight: 500; }
.cctv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cctv-list li[hidden], .cctv-group[hidden] { display: none; }
.cctv-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 4px; border-radius: 10px; color: var(--text); font-size: 14px; }
.cctv-list a:hover { background: var(--surface-2); color: var(--text); }
.live-tag { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--sky-soft); color: var(--sky); font: 700 11px var(--num); letter-spacing: 0.04em; }

.notfound { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px; }
.notfound h1 { font-size: clamp(22px, 2.5vw, 30px); }
.notfound-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ───────── 정적 본문(미리 만든 페이지: 크롤러·JS 로드 전) ───────── */

.static-tide { padding: 20px 0 8px; }
.static-tide h2 { padding: 0 24px; font-size: 17px; font-weight: 700; }
.static-tide > p { padding: 4px 24px 12px; font-size: 13px; }
.static-scroll { overflow-x: auto; }
.stable { width: 100%; border-collapse: collapse; font-size: 14px; }
.stable th, .stable td { padding: 10px 12px; text-align: left; white-space: nowrap; border-top: 1px solid var(--line-soft); }
.stable thead th { color: var(--muted); font-size: 12px; font-weight: 600; border-top: 0; }
.stable th:first-child, .stable td:first-child { padding-left: 24px; }
.stable tbody th { font-weight: 600; }

/* ───────── 푸터 ───────── */

.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 20px 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.footer nav { display: flex; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ───────── 좁은 화면 ───────── */

@media (max-width: 720px) {
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .brand { margin-right: 0; }
  .brand span { font-size: 15px; }
  .place { margin-left: auto; padding-left: 12px; }
  .place select { min-width: 0; max-width: 150px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 1; justify-content: center; padding: 9px 10px; gap: 6px; font-size: 13px; }
  .page { padding: 16px; }
  .card { padding: 20px; }
  .hero, .wx-hero { padding: 22px; }
  .hero-row.end { flex-wrap: wrap; }
  .footer-inner { padding: 18px 16px; }
  .map-ctrl { bottom: 28px; }
  /* 범례는 한 줄로 두고 옆으로 밀어 본다(세 줄이 되면 지도를 가린다). */
  .legend { flex-wrap: nowrap; right: 16px; max-width: none; overflow-x: auto; scrollbar-width: none; }
  .legend::-webkit-scrollbar { display: none; }
  .legend-chip { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
