:root {
  --blue: #1558d6;
  --blue-dark: #0b3f9f;
  --water: #1677e8;
  --tide: #0c9ab8;
  --dam: #0d9985;
  --weather: #e28a08;
  --facility: #6d4ed4;
  --cctv: #111827;
  --rain: #2563eb;
  --normal: #16a365;
  --watch: #f2a20b;
  --danger: #e5484d;
  --ink: #142033;
  --muted: #607086;
  --line: #dce5ee;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --shadow: 0 14px 36px rgba(20, 40, 75, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-width: 1120px;
  overflow: hidden;
  color: var(--ink);
  background: #e7edf3;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto minmax(480px, 1fr);
  align-items: center;
  gap: 22px;
  height: 62px;
  padding: 0 18px;
  background: linear-gradient(105deg, #195fd9 0%, #1354cc 55%, #0f48ba 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 55, 135, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand__mark {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
}

.brand__mark span {
  position: absolute;
  left: 7px;
  width: 22px;
  height: 7px;
  border: 2px solid #fff;
  border-top: 0;
  border-left-color: transparent;
  border-radius: 0 0 50% 50%;
  transform: rotate(-3deg);
}

.brand__mark span:nth-child(1) { top: 7px; }
.brand__mark span:nth-child(2) { top: 14px; opacity: 0.82; }
.brand__mark span:nth-child(3) { top: 21px; opacity: 0.64; }

.brand h1 {
  margin: 0 0 2px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.title-mobile {
  display: none;
}

.brand p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 9px;
  background: rgba(7, 37, 105, 0.22);
}

.view-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 31px;
  padding: 0 15px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.view-tabs a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.view-tabs a.is-active {
  color: var(--blue);
  background: #fff;
  box-shadow: 0 3px 8px rgba(6, 37, 105, 0.2);
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.refresh-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.refresh-control input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #fff;
}

.refresh-control input[type="number"] {
  width: 48px;
  height: 25px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  outline: 0;
  background: #fff;
  color: var(--blue);
  font-weight: 900;
  text-align: center;
}

.countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(5, 31, 90, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid #fff;
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
}

.refresh-btn:hover {
  background: #edf5ff;
}

.refresh-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.refresh-btn.is-loading span {
  animation: spin 0.8s linear infinite;
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 7px;
  background: rgba(7, 37, 105, 0.2);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 850;
  cursor: pointer;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.settings-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map-shell {
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr);
  height: calc(100vh - 62px);
}

.map-shell.sidebar-is-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}

.map-shell.sidebar-is-hidden .sidebar {
  visibility: hidden;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid #cad6e2;
  background: var(--surface);
  box-shadow: 5px 0 20px rgba(34, 55, 82, 0.08);
}

.sidebar__head {
  flex: 0 0 auto;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.sidebar__title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.sidebar__title-actions,
.sidebar-section-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-visibility-btn,
.sidebar-section-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid #d5e0eb;
  border-radius: 7px;
  background: #fff;
  color: #66778d;
  cursor: pointer;
}

.sidebar-visibility-btn:hover,
.sidebar-section-toggle:hover {
  border-color: #9eb9d7;
  background: #edf5ff;
  color: var(--blue);
}

.sidebar-visibility-btn svg,
.sidebar-section-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-section-toggle {
  width: 24px;
  height: 24px;
  border-color: transparent;
  background: transparent;
}

.sidebar-section-toggle svg {
  transition: transform 0.18s ease;
}

[data-sidebar-section].is-collapsed .sidebar-section-toggle svg {
  transform: rotate(-90deg);
}

.sidebar-section__content[hidden] {
  display: none !important;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.sidebar h2 {
  margin: 0;
  font-size: 1.17rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.station-count {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
}

.station-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #ccd8e4;
  border-radius: 8px;
  background: #f8fafc;
  color: #7a899c;
}

.station-search:focus-within {
  border-color: #72a7ef;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 88, 214, 0.1);
}

.station-search span {
  font-size: 1.25rem;
  line-height: 1;
  transform: rotate(-20deg);
}

.station-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
}

.overview {
  flex: 0 0 auto;
  margin: 12px 14px 0;
  padding: 13px 14px 12px;
  border: 1px solid #d5e2f0;
  border-radius: 10px;
  background: linear-gradient(140deg, #f6faff, #eef5fd);
}

.overview__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.overview__heading > div {
  display: grid;
  gap: 3px;
}

.overview__heading > div:first-child > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.overview.is-collapsed .overview__heading {
  margin-bottom: 0;
}

.overview__heading strong {
  font-size: 0.92rem;
  font-weight: 900;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.status-badge--loading {
  background: #e9eef5;
  color: #617085;
}

.status-badge--normal {
  background: #dff7ea;
  color: #08794a;
}

.status-badge--watch {
  background: #fff0c8;
  color: #a76100;
}

.status-badge--danger {
  background: #ffe4e6;
  color: #bf2932;
}

.overview__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #dae5f0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.overview__metrics div {
  display: grid;
  gap: 3px;
  padding: 8px 6px;
  border-right: 1px solid #e1e9f1;
  text-align: center;
}

.overview__metrics div:last-child { border-right: 0; }

.overview__metrics span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 750;
}

.overview__metrics strong {
  font-size: 0.9rem;
  font-weight: 950;
}

.overview__metrics div:nth-child(1) strong { color: var(--normal); }
.overview__metrics div:nth-child(2) strong { color: #c77900; }
.overview__metrics div:nth-child(3) strong { color: var(--danger); }

.operator-panel {
  flex: 0 0 auto;
  margin: 9px 14px 0;
  padding: 11px 12px 10px;
  border: 1px solid #cbdcee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(31, 65, 105, 0.06);
}

.operator-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.operator-panel__head > div {
  display: grid;
  gap: 2px;
}

.operator-panel__head > div:first-child > span {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 800;
}

.operator-panel.is-collapsed .operator-panel__head {
  margin-bottom: 0;
}

.operator-panel__head strong {
  font-size: 0.82rem;
  font-weight: 950;
}

.operator-status {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dff7ea;
  color: #08794a;
  font-size: 0.59rem;
  font-weight: 900;
}

.operator-status--watch { background: #fff0c8; color: #9b5d00; }
.operator-status--danger { background: #ffe4e6; color: #b82831; }
.operator-status--loading { background: #e9eef5; color: #617085; }

.operator-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.operator-signal {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f4f7fb;
}

.operator-signal > span,
.operator-signal small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-signal--upstream small {
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.operator-signal > span {
  margin-bottom: 2px;
  color: #6f7e92;
  font-size: 0.54rem;
  font-weight: 800;
}

.operator-signal strong {
  display: block;
  margin-bottom: 1px;
  color: #20334d;
  font-size: 0.75rem;
  font-weight: 950;
}

.operator-signal small {
  color: #78869a;
  font-size: 0.49rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

.operator-panel__note {
  margin: 7px 1px 0;
  color: #69788c;
  font-size: 0.51rem;
  font-weight: 700;
  line-height: 1.35;
}

.layers {
  flex: 0 0 auto;
  padding: 13px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.section-label h3 {
  margin: 0;
  color: #2d3a4e;
  font-size: 0.72rem;
  font-weight: 900;
}

.section-label button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 850;
  cursor: pointer;
}

.section-label .sidebar-section-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  color: #66778d;
}

.section-label .sidebar-section-toggle:hover {
  border-color: #c7d7e7;
  background: #edf5ff;
}

.layers.is-collapsed {
  padding-bottom: 4px;
}

.layers.is-collapsed .section-label {
  margin-bottom: 0;
}

.layer-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.layer-chip {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d9e2eb;
  border-radius: 7px;
  background: #fff;
  color: #425168;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.layer-chip:hover {
  border-color: #a9bfd7;
  background: #f9fbfd;
}

.layer-chip:has(input:not(:checked)) {
  opacity: 0.48;
  background: #f2f4f7;
}

.layer-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.layer-chip__dot {
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--water);
  box-shadow: 0 0 0 1px var(--water);
}

.layer-chip--tide .layer-chip__dot { background: var(--tide); box-shadow: 0 0 0 1px var(--tide); }
.layer-chip--dam .layer-chip__dot { background: var(--dam); box-shadow: 0 0 0 1px var(--dam); }
.layer-chip--weather .layer-chip__dot { background: var(--weather); box-shadow: 0 0 0 1px var(--weather); }
.layer-chip--cctv .layer-chip__dot { background: var(--cctv); box-shadow: 0 0 0 1px var(--cctv); }
.layer-chip--rain .layer-chip__dot { background: var(--rain); box-shadow: 0 0 0 1px var(--rain); }

.layer-chip strong {
  color: #8491a2;
  font-size: 0.62rem;
}

.station-section {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 12px 8px 0 14px;
}

.sidebar-section__content--fill {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.station-section.is-collapsed {
  min-height: auto;
  flex: 0 0 auto;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}

.station-section.is-collapsed .section-label {
  margin-bottom: 0;
}

.section-label--list {
  flex: 0 0 auto;
  padding-right: 6px;
}

.section-label--list span {
  color: #8a97a8;
  font-size: 0.61rem;
  font-weight: 700;
}

.station-list {
  min-height: 0;
  flex: 1;
  padding: 0 6px 12px 0;
  overflow: auto;
  scrollbar-color: #becad8 transparent;
  scrollbar-width: thin;
}

.station-group + .station-group {
  margin-top: 12px;
}

.station-group__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px 4px;
  color: #8290a2;
  font-size: 0.62rem;
  font-weight: 900;
}

.station-group__title::after {
  height: 1px;
  flex: 1;
  background: #e6ecf2;
  content: "";
}

.station-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  margin-bottom: 5px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.station-row:hover,
.station-row.is-selected {
  border-color: #cfe0f5;
  background: #f2f7fd;
}

.station-row.is-selected::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  content: "";
}

.station-row__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #e5f1ff;
  color: var(--water);
  font-size: 0.83rem;
  font-weight: 950;
}

.water-level-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cctv-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.rainfall-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.station-row--tide .station-row__icon { background: #dff8fc; color: var(--tide); }
.station-row--dam .station-row__icon { background: #def7f1; color: var(--dam); }
.station-row--weather .station-row__icon { border-radius: 50%; background: #fff1d8; color: #b96b00; }
.station-row--weather[data-raining="true"] .station-row__icon { background: #dff4ff; color: #0369a1; }
.station-row--facility .station-row__icon { background: #eee9ff; color: var(--facility); }
.station-row--cctv .station-row__icon { background: #e8edf2; color: var(--cctv); }
.station-row--cctv .cctv-icon circle { fill: #fff; }
.station-row--cctv .station-row__value span::before { background: var(--cctv); }
.station-row--rain .station-row__icon { background: #e7efff; color: var(--rain); }
.station-row--rain .station-row__value span::before { background: var(--rain); }

.station-row__body {
  min-width: 0;
}

.station-row__name {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-row__meta {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-row__value {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: #142033;
}

.station-row__value strong {
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.station-row__value span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7a8799;
  font-size: 0.58rem;
  font-weight: 800;
}

.station-row__value span::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--normal);
  content: "";
}

.station-row[data-severity="watch"] .station-row__value span::before { background: var(--watch); }
.station-row[data-severity="danger"] .station-row__value span::before { background: var(--danger); }
.station-row[data-severity="loading"] .station-row__value span::before { background: #9ba8b8; }

.station-empty {
  display: grid;
  place-items: center;
  min-height: 130px;
  color: #8190a2;
  font-size: 0.72rem;
  font-weight: 750;
  text-align: center;
}

.sidebar__footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.sidebar__footer p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #748297;
  font-size: 0.6rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--normal);
}

.live-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(22, 163, 101, 0.42);
  border-radius: 50%;
  content: "";
  animation: pulse 1.8s ease-out infinite;
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #dbe5ed;
}

.sidebar-show-btn {
  position: absolute;
  z-index: 48;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 9px;
  border: 1px solid #c5d5e5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #28405e;
  box-shadow: 0 7px 20px rgba(20, 45, 78, 0.18);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.sidebar-show-btn[hidden] {
  display: none;
}

.sidebar-show-btn:hover {
  border-color: #78a8df;
  color: var(--blue);
}

.sidebar-show-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map.is-dragging {
  cursor: grabbing;
}

.tile-layer,
.route-layer,
.marker-layer {
  position: absolute;
  inset: 0;
}

.tile-layer {
  z-index: 1;
  background: #e5ebef;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  border: 0;
  opacity: 0;
  filter: saturate(0.68) contrast(0.92) brightness(1.06);
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.map-tile.is-loaded {
  opacity: 1;
}

.route-layer {
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.rain-zone__area {
  fill: rgba(14, 165, 233, 0.17);
  stroke: rgba(2, 132, 199, 0.68);
  stroke-dasharray: 5 5;
  stroke-width: 1.5;
}

.rain-zone__pulse {
  fill: rgba(56, 189, 248, 0.1);
  stroke: rgba(14, 165, 233, 0.5);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: rain-pulse 2.2s ease-out infinite;
}

.rain-zone__drops {
  stroke: rgba(2, 132, 199, 0.72);
  stroke-linecap: round;
  stroke-width: 2.4;
  animation: rain-fall 1.1s ease-in-out infinite;
}

.rain-zone__drops--late {
  animation-delay: -0.55s;
}

.marker-layer {
  z-index: 5;
  pointer-events: none;
}

.map-marker {
  --marker-color: var(--water);
  --offset-x: 0px;
  --offset-y: 0px;
  --collision-x: 0px;
  --collision-y: 0px;
  position: absolute;
  z-index: 2;
  display: block;
  width: 40px;
  height: 47px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(
    calc(-50% + var(--offset-x) + var(--collision-x)),
    calc(-100% + var(--offset-y) + var(--collision-y))
  );
  transform-origin: 50% 100%;
}

.map-marker[hidden] {
  display: none;
}

.map-marker:hover,
.map-marker:focus-visible,
.map-marker.is-selected,
.map-marker.is-hover-pinned {
  z-index: 20;
}

.map-marker:hover .marker__pin,
.map-marker:focus-visible .marker__pin,
.map-marker.is-selected .marker__pin,
.map-marker.is-hover-pinned .marker__pin {
  transform: translateY(-3px) rotate(-45deg) scale(1.08);
  box-shadow: 0 10px 24px rgba(17, 35, 61, 0.34);
}

.marker__pin {
  position: absolute;
  top: 0;
  left: 2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 14%;
  background: var(--marker-color);
  box-shadow: 0 5px 14px rgba(19, 41, 70, 0.3);
  transform: rotate(-45deg);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.marker__icon {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  font-size: 0.73rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  transform: rotate(45deg);
}

.marker__icon .water-level-icon {
  width: 20px;
  height: 20px;
}

.marker__icon .cctv-icon {
  width: 22px;
  height: 22px;
}

.marker__icon .rainfall-icon {
  width: 22px;
  height: 22px;
}

.marker__label {
  position: absolute;
  top: 1px;
  left: 45px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 5px;
  min-width: max-content;
  min-height: 34px;
  padding: 5px 9px 5px 8px;
  border: 1px solid rgba(167, 184, 201, 0.85);
  border-left: 3px solid var(--marker-color);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 4px 13px rgba(24, 45, 71, 0.16);
  pointer-events: none;
}

.marker__label strong {
  font-size: 0.74rem;
  font-weight: 950;
}

.marker__label span {
  color: #4c5b70;
  font-size: 0.67rem;
  font-weight: 850;
}

.marker__label small {
  grid-column: 1 / -1;
  margin-top: -2px;
  color: #7a8798;
  font-size: 0.54rem;
  font-weight: 750;
}

.map-marker[data-raining="true"] {
  --marker-color: #0ea5e9;
  z-index: 14;
}

.map-marker[data-type="tide"] { --marker-color: var(--tide); }
.map-marker[data-type="dam"] { --marker-color: var(--dam); }
.map-marker[data-type="weather"] { --marker-color: var(--weather); }
.map-marker[data-type="facility"] { --marker-color: var(--facility); }
.map-marker[data-type="cctv"] { --marker-color: var(--cctv); }
.map-marker[data-type="cctv"] .cctv-icon circle { fill: var(--cctv); }
.map-marker[data-type="rain"] { --marker-color: var(--rain); }

.map-marker[data-type="weather"] .marker__pin {
  top: 3px;
  border-radius: 50%;
  transform: none;
}

.map-marker[data-type="weather"] .marker__icon {
  font-size: 0.92rem;
  transform: none;
}

.map-marker[data-type="weather"]:hover .marker__pin,
.map-marker[data-type="weather"]:focus-visible .marker__pin,
.map-marker[data-type="weather"].is-selected .marker__pin,
.map-marker[data-type="weather"].is-hover-pinned .marker__pin {
  transform: translateY(-3px) scale(1.08);
}

.map-marker[data-severity="watch"] .marker__pin {
  background: var(--watch);
}

.map-marker[data-severity="danger"] .marker__pin {
  background: var(--danger);
  animation: marker-alert 1.45s ease-in-out infinite;
}

.map-marker[data-severity="loading"] .marker__pin {
  background: #8291a3;
}

.map-marker[data-severity="watch"] .marker__label { border-left-color: var(--watch); }
.map-marker[data-severity="danger"] .marker__label { border-left-color: var(--danger); }
.map-marker[data-severity="loading"] .marker__label { border-left-color: #8291a3; }

.map-marker[data-type="facility"] {
  width: 48px;
  height: 56px;
}

.map-marker[data-type="facility"] .marker__pin {
  left: 3px;
  width: 42px;
  height: 42px;
  border-width: 4px;
}

.map-marker[data-type="facility"] .marker__icon {
  font-size: 0.82rem;
}

.map-marker[data-type="facility"] .marker__label {
  top: 4px;
  left: 53px;
}

.map-marker.label-left .marker__label {
  right: 45px;
  left: auto;
  border-right: 3px solid var(--marker-color);
  border-left-width: 1px;
}

.map-marker[data-type="facility"].label-left .marker__label {
  right: 53px;
  left: auto;
}

.map-marker.label-left[data-severity="watch"] .marker__label { border-right-color: var(--watch); }
.map-marker.label-left[data-severity="danger"] .marker__label { border-right-color: var(--danger); }
.map-marker.label-left[data-severity="loading"] .marker__label { border-right-color: #8291a3; }

.map-stage.zoom-8 .map-marker:not(.is-selected) .marker__label,
.map-stage.zoom-9 .map-marker:not(.is-selected) .marker__label,
.map-stage.zoom-10 .map-marker:not(.is-priority):not(.is-selected) .marker__label,
.map-stage.zoom-11 .map-marker:not(.is-priority):not(.is-selected) .marker__label {
  display: none;
}

.map-stage.labels-hidden .marker__label {
  display: none;
}

.map-marker.is-label-suppressed:not(:hover):not(:focus-visible):not(.is-selected) .marker__label {
  display: none;
}

.hover-card {
  position: absolute;
  z-index: 45;
  display: none;
  width: 286px;
  padding: 11px 12px 10px;
  border: 1px solid #b8c6d5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: default;
  pointer-events: auto;
  transform: scale(var(--hover-card-scale, 1));
  transform-origin: top left;
}

.hover-card.is-visible {
  display: block;
}

.hover-card[hidden] {
  display: none !important;
}

#hover-card {
  z-index: 10000;
}

.hover-card.is-pinned {
  border-color: #73b791;
  box-shadow: 0 13px 32px rgba(8, 121, 74, 0.2);
}

.hover-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 25px;
  margin-bottom: 3px;
}

.hover-card__type {
  display: block;
  color: var(--blue);
  font-size: 0.58rem;
  font-weight: 900;
}

.hover-card__pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #a9cbf4;
  border-radius: 6px;
  background: #f6faff;
  color: var(--blue);
  font-size: 0.56rem;
  font-weight: 900;
  cursor: pointer;
}

.hover-card__pin:hover,
.hover-card__pin:focus-visible {
  border-color: #6ca8ec;
  background: #e8f3ff;
  outline: 0;
}

.hover-card__pin.is-pinned {
  border-color: #84bda2;
  background: #e9f8f0;
  color: #08794a;
}

.hover-card__open-hint {
  color: #475569;
  font-size: 0.56rem;
  font-weight: 900;
}

.hover-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 950;
}

.hover-card__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #142a47;
}

.hover-card__value b {
  font-size: 1.02rem;
  font-weight: 950;
}

.hover-card__value span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.hover-card small {
  display: block;
  margin-top: 5px;
  color: #7a8798;
  font-size: 0.58rem;
  font-weight: 700;
}

.weather-rain {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #cfe3f3;
  border-radius: 8px;
  background: #f4faff;
}

.weather-rain__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #53677f;
  font-size: 0.58rem;
  font-weight: 850;
}

.weather-rain__head b {
  color: #075985;
  font-size: 0.64rem;
  font-weight: 950;
}

.weather-rain__hours {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.weather-rain__hour {
  min-width: 0;
  padding: 8px 4px 7px;
  border: 1px solid #dcebf6;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.weather-rain__hour time {
  display: block;
  margin-bottom: 5px;
  color: #718399;
  font-size: 0.55rem;
  font-weight: 800;
}

.weather-rain__hour > span {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  color: #0b4f7a;
  white-space: nowrap;
}

.weather-rain__hour b {
  font-size: 1rem;
  font-weight: 950;
}

.hover-card .weather-rain__hour small {
  display: inline;
  margin: 0;
  color: #668098;
  font-size: 0.5rem;
  font-weight: 800;
}

.hover-chart {
  margin-top: 10px;
  padding: 8px 8px 6px;
  border: 1px solid #dce5ee;
  border-radius: 7px;
  background: #f7fafc;
}

.hover-chart__head,
.hover-chart__times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hover-chart__head {
  margin-bottom: 3px;
  color: #67768a;
  font-size: 0.57rem;
  font-weight: 800;
}

.hover-chart__head b {
  color: #34445b;
  font-weight: 900;
}

.hover-chart svg {
  display: block;
  width: 100%;
  height: 62px;
  overflow: visible;
}

.hover-chart polygon {
  stroke: none;
}

.hover-chart polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.hover-chart circle {
  stroke: #fff;
  stroke-width: 1.5;
}

.hover-chart__grid {
  stroke: #dbe5ee;
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.hover-chart__times {
  margin-top: -1px;
  color: #8592a3;
  font-size: 0.52rem;
  font-weight: 750;
}

.map-toolbar {
  position: absolute;
  z-index: 35;
  display: flex;
  border: 1px solid #b9c7d5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 7px 20px rgba(23, 42, 68, 0.2);
}

.map-toolbar--left {
  top: 16px;
  left: 16px;
  flex-direction: column;
}

.map-top-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 36;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  width: calc(100% - 84px);
  pointer-events: none;
}

.map-toolbar--right {
  position: static;
  z-index: auto;
  flex: 0 0 auto;
  pointer-events: auto;
}

.rain-status {
  display: flex;
  flex: 0 1 330px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 330px;
  min-height: 40px;
  padding: 6px 11px 6px 8px;
  border: 1px solid #5fc2eb;
  border-radius: 9px;
  background: rgba(239, 249, 255, 0.97);
  color: #075985;
  box-shadow: 0 7px 20px rgba(3, 105, 161, 0.2);
  pointer-events: auto;
}

.rain-status[hidden] {
  display: none;
}

.rain-status__icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.9rem;
  animation: rain-status-bob 1.5s ease-in-out infinite;
}

.rain-status > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.rain-status strong {
  font-size: 0.68rem;
  font-weight: 950;
}

.rain-status small {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: #397697;
  font-size: 0.55rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-toolbar button {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-bottom: 1px solid #d8e1ea;
  background: #fff;
  color: #304056;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.map-toolbar button:last-child { border-bottom: 0; }
.map-toolbar--right button {
  border-right: 1px solid #d8e1ea;
  border-bottom: 0;
  font-size: 0.69rem;
}

.map-toolbar--right button:last-child { border-right: 0; }

.map-toolbar button:hover,
.map-toolbar button.is-active {
  background: #eaf3ff;
  color: var(--blue);
}

.map-toolbar button:disabled {
  background: #f3f5f7;
  color: #9ba7b5;
  cursor: not-allowed;
}

.water-graph-dock {
  position: absolute;
  top: 66px;
  right: auto;
  bottom: auto;
  left: 68px;
  z-index: 38;
  width: min(510px, calc(100% - 86px));
  height: min(270px, calc(100% - 100px));
  overflow: visible;
  border: 1px solid rgba(168, 186, 205, 0.95);
  border-radius: 11px;
  background: rgba(248, 251, 255, 0.97);
  box-shadow: 0 12px 32px rgba(16, 42, 76, 0.2);
  backdrop-filter: blur(7px);
}

.manual-backdrop {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 28, 47, 0.52);
  backdrop-filter: blur(3px);
}

.manual-backdrop[hidden] { display: none; }

.manual-dialog {
  display: flex;
  width: min(780px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #aebfd0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 28, 53, 0.38);
}

.manual-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 20px;
  border-bottom: 1px solid #dce5ee;
  background: linear-gradient(120deg, #edf5ff, #f8fbff);
}

.manual-dialog__head span {
  display: block;
  margin-bottom: 3px;
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 900;
}

.manual-dialog__head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 950;
  letter-spacing: -0.025em;
}

.manual-dialog__head button {
  width: 32px;
  height: 32px;
  border: 1px solid #cbd7e4;
  border-radius: 8px;
  background: #fff;
  color: #536379;
  font-size: 1.1rem;
  cursor: pointer;
}

.manual-dialog__body {
  display: grid;
  gap: 15px;
  padding: 18px 20px 20px;
  overflow: auto;
}

.manual-dialog__body section h3 {
  margin: 0 0 9px;
  color: #25364d;
  font-size: 0.78rem;
  font-weight: 950;
}

.manual-callout {
  padding: 12px 14px;
  border: 1px solid #cfe0f4;
  border-radius: 9px;
  background: #f3f8ff;
}

.manual-callout strong { color: var(--blue-dark); font-size: 0.72rem; }
.manual-callout p {
  margin: 4px 0 0;
  color: #5c6d82;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.55;
}

.manual-purpose {
  padding: 14px;
  border: 1px solid #bcd4ef;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f8ff, #fff);
}

.manual-purpose p {
  margin: 7px 0 0;
  color: #53657b;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.6;
}

.manual-flow {
  display: flex;
  align-items: stretch;
  gap: 5px;
  margin-top: 10px;
}

.manual-flow span {
  display: flex;
  min-height: 32px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border: 1px solid #cfdef0;
  border-radius: 7px;
  background: #fff;
  color: #29435f;
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.manual-flow i {
  align-self: center;
  color: #5289cc;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.manual-purpose__role {
  display: block;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #174f91;
  color: #fff;
  font-size: 0.65rem;
  line-height: 1.4;
  text-align: center;
}

.manual-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manual-benefits > div {
  padding: 10px 11px;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  background: #f8fafc;
}

.manual-benefits b,
.manual-benefits span {
  display: block;
}

.manual-benefits b {
  color: #26384f;
  font-size: 0.67rem;
}

.manual-benefits span {
  margin-top: 4px;
  color: #66768b;
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.5;
}

.manual-limit {
  margin: 9px 0 0;
  padding: 8px 10px;
  border-left: 3px solid #e1a541;
  background: #fff9ee;
  color: #745b31;
  font-size: 0.61rem;
  font-weight: 750;
  line-height: 1.55;
}

.manual-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: manual-step;
}

.manual-steps li {
  position: relative;
  min-height: 66px;
  padding: 10px 10px 9px 39px;
  border: 1px solid #dde6ef;
  border-radius: 8px;
  counter-increment: manual-step;
}

.manual-steps li::before {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 950;
  content: counter(manual-step);
}

.manual-steps b,
.manual-steps span { display: block; }
.manual-steps b { margin-bottom: 3px; font-size: 0.69rem; }
.manual-steps span { color: #66768b; font-size: 0.6rem; font-weight: 700; line-height: 1.45; }

.manual-keypoints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.manual-keypoints > div {
  padding: 10px 11px;
  border-left: 3px solid #75a9ed;
  border-radius: 0 7px 7px 0;
  background: #f7f9fc;
}

.manual-keypoints dt {
  color: #26384f;
  font-size: 0.68rem;
  font-weight: 900;
}

.manual-keypoints dd {
  margin: 4px 0 0;
  color: #5c6d82;
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.5;
}

.manual-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid #dce5ee;
  background: #f8fafc;
}

.manual-dialog__foot button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 900;
  cursor: pointer;
}

.water-graph-dock[hidden] {
  display: none;
}

.water-graph-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 39px;
  padding: 0 8px 0 11px;
  border-bottom: 1px solid #dce5ee;
}

.water-graph-dock__title,
.water-graph-dock__controls {
  display: flex;
  align-items: center;
}

.water-graph-dock__title {
  gap: 7px;
  min-width: 0;
}

.water-graph-dock__title strong {
  color: #20334d;
  font-size: 0.73rem;
  font-weight: 950;
  white-space: nowrap;
}

.water-graph-dock__title > span:last-child {
  color: #718096;
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
}

.water-graph-dock__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #e4f1ff;
  color: var(--water);
  font-size: 0.72rem;
  font-weight: 950;
}

.water-graph-dock__controls {
  gap: 5px;
}

.water-graph-dock__controls button {
  height: 27px;
  padding: 0 8px;
  border: 1px solid #ccd9e6;
  border-radius: 6px;
  background: #fff;
  color: #536379;
  font-size: 0.57rem;
  font-weight: 850;
  cursor: pointer;
}

.water-graph-dock__controls button:hover,
.water-graph-dock__controls button.is-active {
  border-color: #9fc8f8;
  background: #eaf4ff;
  color: var(--blue);
}

.graph-select-btn {
  min-width: 84px;
  color: var(--blue) !important;
}

.water-graph-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  height: calc(100% - 39px);
  padding: 7px 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #9eb3ca transparent;
  scrollbar-width: thin;
}

.water-graph-list::-webkit-scrollbar { width: 6px; }
.water-graph-list::-webkit-scrollbar-thumb { border-radius: 9px; background: #9eb3ca; }

.water-graph-card {
  position: relative;
  min-width: 0;
  height: 103px;
  overflow: hidden;
  border: 1px solid #d4e0eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(26, 54, 87, 0.07);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.water-graph-card:hover,
.water-graph-card:focus-within {
  border-color: #83baf5;
  box-shadow: 0 5px 14px rgba(22, 119, 232, 0.14);
  transform: translateY(-1px);
}

.water-graph-card[data-severity="watch"] { border-top: 3px solid var(--watch); }
.water-graph-card[data-severity="danger"] { border-top: 3px solid var(--danger); }
.water-graph-card[data-severity="normal"] { border-top: 3px solid var(--water); }
.water-graph-card[data-severity="loading"] { border-top: 3px solid #9aa9ba; }

.water-graph-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  height: 33px;
  padding: 5px 29px 2px 8px;
}

.water-graph-card__name {
  min-width: 0;
}

.water-graph-card__name strong,
.water-graph-card__name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.water-graph-card__name strong {
  color: #263950;
  font-size: 0.62rem;
  font-weight: 950;
}

.water-graph-card__name small {
  margin-top: 2px;
  color: #7b899b;
  font-size: 0.49rem;
  font-weight: 750;
}

.water-graph-card__value {
  flex: 0 0 auto;
  color: #145aa9;
  font-size: 0.68rem;
  font-weight: 950;
  white-space: nowrap;
}

.water-graph-card__close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8090a3;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.water-graph-card__close:hover {
  background: #edf2f7;
  color: #25374d;
}

.water-graph-card__chart {
  height: 45px;
  margin: 0 7px;
  color: var(--water);
}

.water-graph-card__chart svg {
  display: block;
  width: 100%;
  height: 45px;
  overflow: visible;
}

.water-graph-card__chart polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.water-graph-card__chart polygon {
  fill: currentColor;
  opacity: 0.1;
}

.water-graph-card__chart circle {
  fill: currentColor;
  stroke: #fff;
  stroke-width: 1.5;
}

.water-graph-card__grid {
  stroke: #dfe8f1;
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.water-graph-card__loading {
  display: grid;
  place-items: center;
  height: 43px;
  border-radius: 5px;
  background: repeating-linear-gradient(105deg, #f3f6fa 0, #f3f6fa 10px, #edf2f7 10px, #edf2f7 20px);
  color: #8290a1;
  font-size: 0.53rem;
  font-weight: 800;
}

.water-graph-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 8px 0;
  color: #758397;
  font-size: 0.49rem;
  font-weight: 750;
}

.water-graph-card__foot span:last-child {
  color: #3d6f9f;
  font-weight: 900;
}

.water-graph-empty {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  color: #63748a;
  font-size: 0.65rem;
  font-weight: 800;
}

.water-graph-empty button {
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid #a9cbf4;
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: inherit;
  font-weight: 900;
  cursor: pointer;
}

.graph-picker {
  position: absolute;
  top: 45px;
  right: 7px;
  bottom: auto;
  left: auto;
  z-index: 48;
  width: 310px;
  max-height: min(390px, calc(100vh - 285px));
  overflow: hidden;
  border: 1px solid #b9c9da;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 16px 38px rgba(18, 40, 70, 0.25);
}

.graph-picker[hidden] { display: none; }

.graph-picker__head {
  display: grid;
  gap: 2px;
  padding: 10px 11px 8px;
  border-bottom: 1px solid #e0e7ef;
  background: #f6f9fc;
}

.graph-picker__head strong {
  color: #263a53;
  font-size: 0.67rem;
  font-weight: 950;
}

.graph-picker__head span {
  color: #7b899a;
  font-size: 0.52rem;
  font-weight: 700;
}

.graph-picker__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  max-height: 315px;
  padding: 7px;
  overflow-y: auto;
}

.graph-picker__item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 31px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #384b63;
  cursor: pointer;
}

.graph-picker__item:hover { background: #edf5ff; }

.graph-picker__item input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  accent-color: var(--water);
}

.graph-picker__item span {
  min-width: 0;
  overflow: hidden;
  font-size: 0.55rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-legend {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 13px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid #becbd8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #4d5c70;
  box-shadow: 0 6px 18px rgba(22, 40, 64, 0.17);
  font-size: 0.61rem;
  font-weight: 800;
}

.map-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--normal);
  box-shadow: 0 0 0 1px var(--normal);
}

.legend-dot--watch { background: var(--watch); box-shadow: 0 0 0 1px var(--watch); }
.legend-dot--danger { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.legend-camera {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--cctv);
  color: #fff;
}

.legend-camera svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.legend-rain {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--rain);
  color: #fff;
}

.legend-rain svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.map-legend__hint {
  padding-left: 11px;
  border-left: 1px solid #d7e0e9;
  color: #768598;
}

.loading-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #b9c7d6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  color: #405066;
  box-shadow: 0 7px 20px rgba(24, 43, 67, 0.18);
  font-size: 0.68rem;
  font-weight: 850;
  transform: translateX(-50%);
}

.loading-toast.is-visible {
  display: flex;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #cddcf1;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.detail-card {
  position: absolute;
  top: 66px;
  right: 16px;
  z-index: 42;
  width: 360px;
  max-height: calc(100% - 132px);
  overflow: auto;
  border: 1px solid #b7c5d4;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 18px 44px rgba(18, 39, 70, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.detail-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.detail-card__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid #d4dde7;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #647287;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.detail-card__close:hover {
  background: #f1f5f9;
  color: #26364b;
}

.detail-head {
  padding: 15px 44px 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(125deg, #f8fbff, #eef5fd);
}

.detail-head__type {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-bottom: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e1efff;
  color: var(--water);
  font-size: 0.58rem;
  font-weight: 900;
}

.detail-head__type--tide { background: #def7fb; color: var(--tide); }
.detail-head__type--dam { background: #def7f1; color: var(--dam); }
.detail-head__type--weather { background: #fff0d7; color: #b96b00; }
.detail-head__type--facility { background: #ece7ff; color: var(--facility); }
.detail-head__type--cctv { background: #e8edf2; color: var(--cctv); }
.detail-head__type--rain { background: #e7efff; color: var(--rain); }

.detail-head h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: -0.025em;
}

.detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
}

.detail-primary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 16px 12px;
}

.detail-primary__value span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.detail-primary__value strong {
  font-size: 1.75rem;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.detail-primary__value small {
  margin-left: 4px;
  color: #617086;
  font-size: 0.72rem;
  font-weight: 850;
}

.detail-risk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 10px;
  border-radius: 999px;
  background: #dff7ea;
  color: #08794a;
  font-size: 0.66rem;
  font-weight: 900;
}

.detail-risk::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.detail-risk--watch { background: #fff0c8; color: #a76100; }
.detail-risk--danger { background: #ffe4e6; color: #bf2932; }
.detail-risk--loading { background: #e9eef5; color: #617085; }

.detail-chart {
  height: 104px;
  margin: 0 16px 12px;
  padding: 8px 8px 2px;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #f8fafc;
}

.detail-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.detail-chart__grid {
  stroke: #dce5ee;
  stroke-width: 1;
}

.detail-chart__area {
  fill: rgba(22, 119, 232, 0.12);
}

.detail-chart__line {
  fill: none;
  stroke: var(--water);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.detail-chart__dot {
  fill: var(--water);
  stroke: #fff;
  stroke-width: 1.5;
}

.detail-chart__label {
  fill: #718096;
  font-size: 8px;
  font-weight: 750;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0 16px 14px;
}

.detail-metric {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #fff;
}

.detail-metric span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 750;
}

.detail-metric strong {
  display: block;
  overflow: hidden;
  color: #233248;
  font-size: 0.73rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-forecast {
  margin: 0 16px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-forecast h4 {
  margin: 0 0 8px;
  font-size: 0.66rem;
  font-weight: 900;
}

.detail-forecast__row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.forecast-cell {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 7px 3px;
  border-radius: 7px;
  background: #f4f7fa;
  font-size: 0.6rem;
  font-weight: 800;
}

.forecast-cell b { font-size: 0.86rem; }
.forecast-cell small { color: var(--muted); font-size: 0.52rem; }

.detail-note {
  margin: 0;
  padding: 10px 16px 13px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  color: #6b798d;
  font-size: 0.59rem;
  font-weight: 700;
  line-height: 1.5;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid #bfd8f7;
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 0.58rem;
  font-weight: 900;
  text-decoration: none;
}

.map-attribution {
  position: absolute;
  bottom: 2px;
  left: 5px;
  z-index: 20;
  margin: 0;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.82);
  color: #627083;
  font-size: 9px;
}

.map-attribution a {
  color: #385c86;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 0.85; transform: scale(0.7); }
  70%, 100% { opacity: 0; transform: scale(1.5); }
}

@keyframes marker-alert {
  0%, 100% { box-shadow: 0 5px 14px rgba(19, 41, 70, 0.3), 0 0 0 0 rgba(229, 72, 77, 0.36); }
  50% { box-shadow: 0 5px 14px rgba(19, 41, 70, 0.3), 0 0 0 8px rgba(229, 72, 77, 0); }
}

@keyframes rain-pulse {
  0% { opacity: 0.7; transform: scale(0.72); }
  75%, 100% { opacity: 0; transform: scale(1.5); }
}

@keyframes rain-fall {
  0%, 100% { opacity: 0.45; transform: translateY(-3px); }
  55% { opacity: 1; transform: translateY(4px); }
}

@keyframes rain-status-bob {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(2px); }
}

@media (max-width: 1380px) {
  .topbar {
    grid-template-columns: minmax(285px, 1fr) auto minmax(410px, 1fr);
    gap: 12px;
  }

  .brand p { display: none; }
  .map-shell { grid-template-columns: 326px minmax(0, 1fr); }
  .refresh-control--check { display: none; }
  .map-legend__hint { display: none; }
}

@media (max-height: 720px) {
  .overview { display: none; }
  .layers { padding-top: 7px; padding-bottom: 7px; }
  .sidebar__head { padding-top: 9px; padding-bottom: 8px; }
  .sidebar__title-row { margin-bottom: 7px; }
  .station-search { height: 32px; }
  .layer-chip { height: 28px; }
  .station-section { padding-top: 7px; }
  .station-row { min-height: 47px; }
  .operator-panel { margin-top: 7px; padding-top: 8px; padding-bottom: 8px; }
  .operator-panel__note { display: none; }
  .operator-signal { padding-top: 5px; padding-bottom: 5px; }
}

/* Web app: touch-first phone and small-tablet map */
@media (max-width: 1024px) {
  body {
    min-width: 0;
    min-height: 100dvh;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    height: 58px;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  }

  .brand__mark,
  .brand p,
  .refresh-control,
  .countdown {
    display: none;
  }

  .brand h1 {
    max-width: 240px;
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .title-desktop {
    display: none;
  }

  .title-mobile {
    display: inline;
  }

  .view-tabs a {
    min-width: 54px;
    height: 38px;
    padding: 0 9px;
  }

  .topbar__actions {
    gap: 5px;
  }

  .refresh-btn,
  .settings-btn {
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .refresh-btn span {
    font-size: 1.05rem;
  }

  .settings-btn svg {
    width: 19px;
    height: 19px;
  }

  .settings-btn span { display: none; }

  .map-shell,
  .map-shell.sidebar-is-hidden {
    position: relative;
    display: block;
    height: calc(100dvh - 58px);
  }

  .map-stage {
    position: absolute;
    inset: 0;
  }

  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(88vw, 350px);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .map-shell.sidebar-is-hidden .sidebar {
    visibility: hidden;
    transform: translateX(-102%);
  }

  .sidebar-visibility-btn,
  .sidebar-section-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  .sidebar__head {
    padding: 11px 12px 9px;
  }

  .sidebar__title-row {
    margin-bottom: 8px;
  }

  .station-search {
    height: 44px;
  }

  .sidebar-show-btn {
    top: 9px;
    left: 9px;
    min-height: 44px;
  }

  .map-toolbar--left {
    top: 62px;
    left: 9px;
  }

  .map-toolbar button {
    min-width: 44px;
    height: 44px;
  }

  .map-top-controls {
    top: 9px;
    right: 9px;
    width: calc(100% - 70px);
  }

  .map-toolbar--right button {
    min-width: 44px;
    padding-inline: 8px;
    font-size: 0.62rem;
  }

  .rain-status {
    max-width: min(300px, 54vw);
  }

  /* 모바일 지도에서는 지도 판독 공간을 확보하기 위해 수위 그래프를 생략합니다. */
  #toggle-graphs,
  .water-graph-dock {
    display: none !important;
  }

  .graph-picker {
    right: 0;
    width: min(310px, calc(100vw - 16px));
  }

  .hover-card {
    width: min(286px, calc(100vw - 20px));
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }

  .hover-card__pin,
  .hover-card--pinned {
    display: none !important;
  }

  .map-legend {
    display: none;
  }

  .manual-backdrop {
    padding: 8px;
  }

  .manual-dialog {
    width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .manual-dialog__head,
  .manual-dialog__body,
  .manual-dialog__foot {
    padding-inline: 14px;
  }

  .manual-steps,
  .manual-keypoints,
  .manual-benefits {
    grid-template-columns: 1fr;
  }

  .manual-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manual-flow i {
    display: none;
  }

  .manual-steps li {
    min-height: 0;
  }

  .brand h1 {
    max-width: 125px;
    font-size: 0.76rem;
  }

  .view-tabs {
    gap: 1px;
    padding: 2px;
  }

  .view-tabs a {
    min-width: 48px;
    padding-inline: 7px;
    font-size: 0.7rem;
  }

  .rain-status {
    display: none;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .topbar {
    height: 54px;
  }

  .map-shell,
  .map-shell.sidebar-is-hidden {
    height: calc(100dvh - 54px);
  }

  .sidebar {
    width: min(42vw, 330px);
  }

}
