* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: 'Malgun Gothic', '맑은 고딕', 'Segoe UI', sans-serif;
  background: #c0d4e8;
  color: #1a2640;
}
#container {
  position: absolute; inset: 0;
}

.overlay {
  position: absolute; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border: 1.1px solid rgba(60, 90, 160, 0.25);
  border-radius: 6.63px;
  padding: 4.42px 7.73px;
  backdrop-filter: blur(8.84px);
  box-shadow: 0 2.21px 6.63px rgba(0, 0, 30, 0.12);
}
.top-left { top: 6.63px; left: 6.63px; max-width: 254.15px; }
.top-left h1 { margin: 0 0 1.1px 0; font-size: 9.39px; font-weight: 700; color: #1a2640; }
.subtitle { font-size: 7.73px; color: #5a7090; }

/* "bottom-right" class name kept for HTML compatibility, but actually
   positioned bottom-LEFT to avoid overlap with right-column panels (rain/sim/flow). */
.bottom-right {
  bottom: 55.25px; left: 6.63px; right: auto;
  width: 132.6px; font-size: 7.73px;
}
.info-row { display: flex; justify-content: space-between; padding: 1.1px 0; }
.lbl { color: #5a7090; font-weight: 600; }
.val { color: #1a2640; font-weight: 700; }
.red-line { color: #d63838; }
.yellow-line { color: #c89a18; }
.red-dot { color: #d63838; }
#camera-info {
  margin-top: 3.31px; padding-top: 3.31px; border-top: 1.1px solid #ccd; font-size: 7.73px; color: #889;
  font-family: 'Consolas', monospace;
}

#loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(20, 35, 70, 0.92); color: white;
  padding: 9.94px 18.79px; border-radius: 5.52px; font-size: 11.05px; z-index: 100;
}

#hint {
  position: absolute; bottom: 57.46px; left: 50%; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  padding: 3.31px 8.84px; border-radius: 13.26px;
  font-size: 8.29px; color: #5a7090; z-index: 10;
  border: 1.1px solid rgba(60, 90, 160, 0.2);
}

#data-attribution {
  position: absolute; bottom: 39.95px; right: 6.63px; z-index: 10;   /* above the (wider) time bar */
  font-size: 6.63px; color: rgba(60,70,90,0.6);
  background: rgba(255,255,255,0.5); padding: 1.1px 6.63px; border-radius: 3.31px;
  pointer-events: none;
}

/* B-2 time bar (bottom) — compact */
#time-bar {
  position: absolute; bottom: 6.63px; left: 50%; transform: translateX(-50%);
  z-index: 12;
  display: flex; align-items: center; gap: 5.52px;
  background: rgba(15, 25, 45, 0.92);
  padding: 3.31px 8.84px; border-radius: 14.36px;
  box-shadow: 0 2.21px 9.94px rgba(0,0,30,0.25);
  border: 1.1px solid rgba(80, 130, 200, 0.4);
  width: 38.7%; max-width: 519.35px;
  font-family: inherit; color: white;
}
.tc-btn {
  background: #2a6fc6; border: none; color: white;
  width: 19.89px; height: 19.89px; border-radius: 50%;
  font-size: 8.29px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tc-btn:hover { background: #3a8fdc; }
.tc-btn.playing { background: #d63838; }
.tc-btn.small { width: 15.47px; height: 15.47px; font-size: 7.18px; background: #455a80; }
.tc-btn.small:hover { background: #5a7090; }
#time-slider {
  flex: 1; cursor: pointer; height: 3.31px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.18); border-radius: 2.21px;
}
#time-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 9.94px; height: 9.94px; background: #ffd060; border-radius: 50%;
  border: 1.1px solid white; cursor: pointer;
}
#time-readout { min-width: 55.25px; text-align: center; }
.tc-time { font-size: 9.39px; font-weight: 700; color: #ffd060; line-height: 1; }
.tc-step { font-size: 6.63px; color: #aabbdd; font-family: monospace; margin-top: 1.1px; }
#speed-sel {
  background: rgba(255,255,255,0.1); color: white;
  border: 1.1px solid rgba(150,170,210,0.4);
  border-radius: 3.31px; padding: 0 2.21px; font-family: inherit; font-size: 8.84px;
  height: 17.68px; line-height: 15.47px; box-sizing: border-box;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
#speed-sel option { background: #2a3247; color: white; }

/* B-2 rainfall info panel — extra compact (30% smaller) */
#rain-panel {
  position: absolute; top: 6.63px; right: 6.63px;
  width: 154.7px; padding: 4.42px 6.63px;
  background: rgba(255,255,255,0.92);
  border: 1.1px solid rgba(60, 90, 160, 0.25);
  border-radius: 6.63px;
  box-shadow: 0 2.21px 6.63px rgba(0,0,30,0.12);
  font-size: 7.73px; color: #1a2640;
  z-index: 11;
}
.rp-row { display: flex; justify-content: space-between; padding: 0.55px 0; align-items: baseline; }
.rp-row.small { font-size: 7.18px; color: #6a7a90; }
.rp-lbl { color: #5a7090; font-weight: 600; }
.rp-val { font-weight: 700; }
.rp-big { font-weight: 700; font-size: 9.39px; color: #2855aa; }
#rain-mini { display: block; margin-top: 3.31px; border-radius: 3.31px; width: 141.44px; height: 39.78px; }

/* (info-block moved to bottom-left — see .bottom-right rule above) */

/* B-4 시뮬레이션 정보 패널 — extra compact (30% smaller) */
#sim-panel {
  position: absolute; top: 143.65px; right: 6.63px;
  width: 165.75px; padding: 4.42px 6.63px;
  background: rgba(255,255,255,0.92);
  border: 1.1px solid rgba(60, 90, 160, 0.25);
  border-radius: 6.63px;
  box-shadow: 0 2.21px 6.63px rgba(0,0,30,0.12);
  font-size: 7.18px; color: #1a2640;
  z-index: 11;
}
.sp-header {
  font-weight: 700; font-size: 7.73px;
  color: #1a2640; margin-bottom: 2.21px;
  border-bottom: 1.1px solid #ccd; padding-bottom: 2.21px;
}
.sp-row { display: flex; justify-content: space-between; padding: 0.55px 0; }
.sp-row.small { font-size: 7.18px; color: #6a7a90; }
.sp-row.small.note { font-style: italic; color: #4a90a4; padding-top: 3.31px; border-top: 1.1px dotted #ccd; margin-top: 3.31px; }
.sp-lbl { color: #5a7090; font-weight: 600; }
.sp-val { font-weight: 700; }
.sp-val.red { color: #d63838; font-family: monospace; font-size: 6.63px; }
.sp-live { background: rgba(60, 130, 220, 0.08); padding: 2.21px 0; }
.sp-live .sp-val { color: #1a5fbb; font-family: monospace; }
/* #sp-peak-node — now defined later with .sp-analogy block */

/* C-4: live block enhancement */
.sp-divider { height: 1.1px; background: linear-gradient(90deg, transparent, #ccd, transparent); margin: 3.31px 0; }
.sp-live-block {
  background: linear-gradient(180deg, rgba(60, 130, 220, 0.08), rgba(60, 130, 220, 0.02));
  border-radius: 4.42px;
  padding: 3.31px 5.52px;
  margin-top: 2.21px;
}
.sp-live-header {
  font-size: 7.18px; font-weight: 700; color: #1a5fbb;
  margin-bottom: 2.21px;
  text-transform: uppercase; letter-spacing: 0.33px;
}
.sp-row.sp-big { padding: 1.1px 0; }
.sp-big-num {
  font-family: 'Consolas', monospace;
  font-weight: 700; font-size: 8.29px;
  transition: color 0.3s ease;
}

/* E-3/E-4 — pipe hover tooltip — 30% smaller */
#pipe-tooltip {
  position: fixed; z-index: 200;
  background: rgba(255,255,255,0.97);
  border: 1.1px solid rgba(60, 90, 160, 0.35);
  border-radius: 6.63px;
  padding: 7.73px 9.94px;
  font-size: 9.39px; color: #1a2640;
  box-shadow: 0 4.42px 14.36px rgba(0,0,30,0.25);
  pointer-events: none;
  width: 182.32px;
}
.pt-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #ccd; padding-bottom: 3.31px; margin-bottom: 4.42px;
}
.pt-id { font-weight: 700; font-size: 9.94px; color: #1a2640; font-family: monospace; }
.pt-shape { font-size: 7.73px; padding: 1.1px 4.42px; border-radius: 3.31px; font-weight: 600; }
.pt-shape.circle { background: rgba(80, 140, 220, 0.18); color: #1a5fbb; }
.pt-shape.box    { background: rgba(220, 140, 60, 0.18); color: #aa5a10; }
.pt-row { display: flex; justify-content: space-between; padding: 1.1px 0; }
.pt-lbl { color: #5a7090; font-weight: 600; }
.pt-val { font-weight: 700; font-family: monospace; }
.pt-divider { height: 1.1px; background: #ccd; margin: 4.42px 0; }
.pt-fill .pt-fill-num { font-size: 11.6px; }
#pt-canvas {
  display: block; margin: 6.63px auto 0;
  border-radius: 3.31px;
  background: #f5f8fc;
  border: 1.1px solid #ccd;
}

/* boundary tooltip (yellow theme) — 30% smaller */
#boundary-tooltip {
  position: fixed; z-index: 200;
  background: rgba(255, 251, 235, 0.97);
  border: 1.66px solid rgba(220, 160, 30, 0.65);
  border-radius: 6.63px;
  padding: 7.73px 9.94px;
  font-size: 9.39px; color: #4a3010;
  box-shadow: 0 4.42px 14.36px rgba(60, 40, 0, 0.25);
  pointer-events: none;
  width: 182.32px;
}
.bt-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #d8c890; padding-bottom: 3.31px; margin-bottom: 4.42px;
}
.bt-title { font-weight: 700; color: #a06010; font-size: 9.94px; }
.bt-id { font-family: monospace; font-size: 7.73px; color: #6a4810; }
.bt-row { display: flex; justify-content: space-between; padding: 1.1px 0; }
.bt-row.small { font-size: 8.29px; color: #7a5820; }
.bt-lbl { color: #7a5820; font-weight: 600; }
.bt-val { font-weight: 700; font-family: monospace; }
.bt-divider { height: 1.1px; background: #d8c890; margin: 3.31px 0; }
.bt-live-header {
  font-size: 7.73px; color: #a06010;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.44px; margin: 1.1px 0 3.31px;
}
.bt-big-num { font-size: 12.16px; color: #1a5fbb; }

/* B-3 흐름 분류 패널 (sim-panel 아래) */
#flow-panel {
  position: absolute; top: 508.3px; right: 15.47px;
  width: 320.45px; padding: 12.16px 15.47px;
  background: rgba(255,255,255,0.92);
  border: 1.1px solid rgba(60, 90, 160, 0.25);
  border-radius: 11.05px;
  box-shadow: 0 4.42px 15.47px rgba(0,0,30,0.12);
  font-size: 13.26px; color: #1a2640;
  z-index: 11;
}
.fp-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #ccd; padding-bottom: 6.63px; margin-bottom: 8.84px;
}
.fp-title { font-weight: 700; font-size: 14.36px; color: #1a2640; display: inline-flex; align-items: center; gap: 4.42px; }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17.68px; height: 17.68px; border-radius: 50%;
  background: #5a7090; color: white;
  font-size: 11.05px; font-weight: 700;
  cursor: help; position: relative;
  font-family: 'Segoe UI', sans-serif;
}
.info-icon:hover::after {
  content: attr(data-tip);
  position: absolute; top: 100%; right: 0;
  margin-top: 6.63px;
  background: rgba(0,0,0,0.85); color: white;
  padding: 6.63px 11.05px; border-radius: 4.42px;
  font-size: 13.26px; font-weight: 400;
  white-space: normal; min-width: 221px; max-width: 309.4px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 2.21px 8.84px rgba(0,0,0,0.3);
}
.fp-sub {
  display: block; font-size: 11.05px; color: #888;
  font-weight: 400; margin-top: 1.1px;
}

/* F-2: sp-analogy — 일상 비유 + small-row inline values (sized to match sp-row) */
.sp-analogy {
  font-size: 7.18px; color: #5a7090; font-weight: 400;
}
#sp-peak-node { font-family: monospace; font-size: 7.18px; color: #5a7090; }
.fp-toggle {
  display: flex; align-items: center; gap: 4.42px;
  font-size: 12.16px; color: #5a7090; cursor: pointer;
}
.fp-toggle input { cursor: pointer; }
.fp-row {
  display: flex; align-items: center; padding: 3.31px 0;
  font-size: 13.26px;
}
.fp-dot {
  display: inline-block; width: 15.47px; height: 15.47px;
  border-radius: 3.31px; margin-right: 8.84px;
  border: 1.1px solid rgba(0,0,0,0.2);
}
.fp-num {
  margin-left: auto; font-weight: 700; color: #2855aa;
  font-family: monospace; font-size: 12.16px;
}

/* Hover checklist panel (좌측, 통합 토글) — 30% smaller */
#hover-checklist {
  position: absolute; top: 55.25px; left: 6.63px; z-index: 12;
  background: rgba(255,255,255,0.94);
  border: 1.1px solid rgba(60,90,160,0.3);
  border-radius: 6.63px;
  padding: 4.42px 7.73px;
  font-size: 8.29px; color: #1a2640;
  box-shadow: 0 2.21px 6.63px rgba(0,0,30,0.12);
  width: 132.6px;
}
#hover-checklist .hc-title {
  font-weight: 700; font-size: 7.73px;
  color: #5a7090; padding-bottom: 3.31px;
  border-bottom: 1.1px solid #ddd; margin-bottom: 3.31px;
}
#hover-checklist .hc-row {
  display: flex; align-items: center; gap: 4.42px;
  padding: 1.1px 0; cursor: pointer;
  user-select: none;
}
#hover-checklist .hc-row:hover { color: #1a4f8c; }
#hover-checklist input[type=checkbox] {
  width: 9.94px; height: 9.94px; margin: 0;
  accent-color: #2855aa;
}
#hover-checklist .hc-cn-dot {
  display: inline-block; width: 6.63px; height: 6.63px; border-radius: 50%;
  background: linear-gradient(135deg, #2ea043 0%, #e8c93c 50%, #d62828 100%);
  border: 1.1px solid rgba(0,0,0,0.25);
}
#cn-legend { top: 154.7px !important; }

/* Satellite overlay toggle */
#sat-toggle {
  position: absolute; top: 163.54px; left: 6.63px; z-index: 12;
  background: rgba(255,255,255,0.94);
  border: 1.1px solid rgba(60,90,160,0.3);
  border-radius: 6.63px;
  padding: 4.42px 8.84px;
  font-size: 8.84px; font-weight: 600;
  color: #1a2640;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2.21px 6.63px rgba(0,0,30,0.12);
  transition: background 0.2s, border-color 0.2s;
  display: flex; align-items: center; gap: 4.42px;
}
#sat-toggle:hover { background: rgba(235,245,255,0.97); border-color: rgba(40,85,170,0.5); }
#sat-toggle.active {
  background: rgba(30,80,180,0.12);
  border-color: rgba(30,80,180,0.6);
  color: #1a4f8c;
}
#sat-toggle.loading {
  opacity: 0.5; cursor: wait;
}
#sat-toggle.error {
  opacity: 0.4; text-decoration: line-through; cursor: not-allowed;
}
.sat-icon { font-size: 11.05px; }

/* Flood node tooltip — 30% smaller */
#flood-tooltip {
  position: fixed; z-index: 200;
  background: rgba(240, 248, 255, 0.97);
  border: 1.66px solid rgba(50, 110, 200, 0.55);
  border-radius: 6.63px;
  padding: 7.73px 9.94px;
  font-size: 9.39px; color: #0a2040;
  box-shadow: 0 4.42px 14.36px rgba(0, 30, 80, 0.25);
  pointer-events: none;
  width: 204.42px;
}
.ft-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #b0c4e0; padding-bottom: 3.31px; margin-bottom: 4.42px;
}
.ft-title { font-weight: 700; color: #1a4f8c; font-size: 9.94px; }
.ft-id    { font-family: monospace; font-size: 7.73px; color: #4a6090; }
.ft-badge-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2.21px;
}
.ft-badge {
  font-size: 8.29px; font-weight: 700; padding: 1.1px 6.63px;
  border-radius: 3.31px; letter-spacing: 0.33px;
}
.ft-badge.severe  { background: rgba(214, 16, 16, 0.15); color: #d61010; }
.ft-badge.warning { background: rgba(204, 136, 0, 0.15); color: #cc8800; }
.ft-badge.minor   { background: rgba(26, 95, 187, 0.15); color: #1a5fbb; }
.ft-badge.safe    { background: rgba(40, 160, 80, 0.15); color: #28a050; }
.ft-rank { font-size: 7.73px; color: #5a7090; font-weight: 600; }
.ft-section-label {
  font-size: 7.73px; color: #1a4f8c; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.44px; margin: 1.1px 0 2.21px;
}
.ft-row   { display: flex; justify-content: space-between; padding: 1.1px 0; }
.ft-row.small { font-size: 8.29px; color: #5a7090; }
.ft-lbl   { color: #5a7090; font-weight: 600; }
.ft-val   { font-weight: 700; font-family: monospace; }
.ft-val.red  { color: #d63838; }
.ft-val.live { color: #1a5fbb; }
.ft-live-header {
  font-size: 7.73px; color: #1a4f8c;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.44px; margin: 1.1px 0 3.31px;
}
.ft-big-num { font-size: 12.16px; }
.ft-depth { font-size: 13.26px; }
.ft-divider  { height: 1.1px; background: #ccd; margin: 3.31px 0 2.21px; }
.ft-spark-label {
  font-size: 7.73px; color: #5a7090; font-weight: 600; margin-bottom: 2.21px;
}
#ft-canvas {
  display: block; margin: 0 auto;
  border-radius: 3.31px;
  background: #f0f5fc;
  border: 1.1px solid #ccd;
}

/* CN overlay toggle button — compact */
#cn-toggle {
  position: absolute; top: 55.25px; left: 6.63px; z-index: 12;
  background: rgba(255,255,255,0.92);
  border: 1.1px solid rgba(60,90,160,0.35);
  padding: 2.21px 6.63px; border-radius: 4.42px;
  cursor: pointer; font-size: 7.73px; font-weight: 700;
  color: #1a2640;
  box-shadow: 0 1.1px 4.42px rgba(0,0,30,0.15);
  display: inline-flex; align-items: center; gap: 3.31px;
  transition: all 0.15s;
}
#cn-toggle:hover { background: rgba(240,245,255,0.97); }
#cn-toggle.active {
  background: linear-gradient(135deg, #d62828, #e88d2a);
  color: white; border-color: #c66f15;
}
#cn-toggle.active:hover { filter: brightness(1.08); }
#cn-toggle .cn-dot {
  width: 6.63px; height: 6.63px; border-radius: 50%;
  background: linear-gradient(135deg, #2ea043 0%, #e8c93c 50%, #d62828 100%);
  border: 1.1px solid rgba(0,0,0,0.25);
}

#cn-legend {
  position: absolute; top: 77.35px; left: 6.63px; z-index: 12;
  width: 132.6px; padding: 4.42px 6.63px;
  background: rgba(255,255,255,0.94);
  border: 1.1px solid rgba(60,90,160,0.3);
  border-radius: 6.63px;
  box-shadow: 0 2.21px 6.63px rgba(0,0,30,0.12);
  font-size: 7.18px; color: #1a2640;
  display: none;
}
#cn-legend.visible { display: block; }
.cn-leg-title { font-weight: 700; font-size: 7.73px; margin-bottom: 3.31px; }
.cn-leg-bar {
  height: 6.63px; border-radius: 2.21px;
  background: linear-gradient(to right,
    rgb(46,166,69) 0%,
    rgb(173,209,74) 22%,
    rgb(232,201,60) 54%,
    rgb(232,141,42) 80%,
    rgb(214,40,40) 100%);
  border: 1.1px solid rgba(0,0,0,0.15);
}
.cn-leg-ticks {
  display: flex; justify-content: space-between;
  font-size: 7.18px; color: #5a7090;
  font-family: 'Consolas', monospace; margin-top: 2.21px;
}
.cn-leg-labels {
  display: flex; justify-content: space-between;
  font-size: 7.18px; color: #5a7090;
  margin-top: 2.21px;
}
.cn-leg-hint {
  margin-top: 3.31px; padding-top: 3.31px;
  border-top: 1.1px dotted #ccd;
  font-size: 7.18px; color: #5a7090; font-style: italic;
}

/* CN L3 matrix hover tooltip — 30% smaller */
#cn-tooltip {
  position: fixed; z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  border: 1.1px solid rgba(60, 90, 160, 0.4);
  border-radius: 7.73px;
  padding: 7.73px 9.94px;
  font-size: 8.84px; color: #1a2640;
  box-shadow: 0 4.42px 14.36px rgba(0, 0, 30, 0.25);
  pointer-events: none;
  width: 353.6px;
}
.cn-tt-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #ccd; padding-bottom: 3.31px; margin-bottom: 4.42px;
}
.cn-tt-title { font-weight: 700; font-size: 9.94px; color: #1a2640; }
.cn-tt-cnval {
  font-family: 'Consolas', monospace; font-size: 9.94px;
  color: #1a2640;
}
.cn-tt-cnval b { font-size: 12.16px; color: #d62828; }
.cn-tt-row {
  display: flex; justify-content: space-between;
  padding: 1.66px 0; align-items: center;
}
.cn-tt-lbl { color: #5a7090; font-weight: 600; font-size: 8.29px; }
.cn-tt-val { font-weight: 700; font-family: monospace; padding: 0.55px 6.63px; border-radius: 3.31px; font-size: 8.29px; }
.cn-tt-val.hsg-A { background: #4eb070; color: white; }
.cn-tt-val.hsg-B { background: #b5b34a; color: white; }
.cn-tt-val.hsg-C { background: #d68f33; color: white; }
.cn-tt-val.hsg-D { background: #c33232; color: white; }
.cn-tt-lu { font-size: 7.73px; color: #1a2640; text-align: right; max-width: 143.65px; }
.cn-tt-divider { height: 1.1px; background: #ccd; margin: 4.42px 0 3.31px; }

/* CN L3 matrix grid */
table.cn-tt-matrix {
  width: 100%; border-collapse: collapse;
  font-family: 'Consolas', monospace; font-size: 8.29px;
  margin-top: 2.21px;
  table-layout: fixed;
}
.cn-tt-matrix th, .cn-tt-matrix td {
  padding: 2.21px 1.1px; text-align: center;
  border: 1.1px solid #e0e6f0;
  color: #1a2640;
}
.cn-tt-matrix thead th {
  background: #eef2fa; font-weight: 700;
  color: #5a7090; font-size: 7.73px;
}
.cn-tt-matrix th.cn-tt-code   { width: 29.84px; font-family: monospace; font-weight: 600; color: #5a7090; font-size: 7.73px; }
.cn-tt-matrix th.cn-tt-name   { font-weight: 600; text-align: left; padding-left: 3.31px; font-size: 8.29px; }
.cn-tt-matrix td.cn-tt-pct    { width: 34.25px; font-family: monospace; color: #2855aa; font-weight: 700; }
.cn-tt-matrix th.cn-tt-pct    { width: 34.25px; font-family: monospace; color: #2855aa; font-weight: 700; }
.cn-hsg-pill {
  display: inline-block; padding: 0.55px 4.42px; border-radius: 6.63px;
  font-family: monospace; font-weight: 700; font-size: 7.73px; color: white;
}
.cn-hsg-pill.hsg-A { background: #4eb070; }
.cn-hsg-pill.hsg-B { background: #b5b34a; }
.cn-hsg-pill.hsg-C { background: #d68f33; }
.cn-hsg-pill.hsg-D { background: #c33232; }
.cn-hsg-pill.hsg-X { background: #888; color: #fff; }
.cn-tt-val.hsg-X   { background: #888; color: #fff; padding: 1.1px 7.73px; border-radius: 9.94px; }
.cn-tt-matrix tbody th        { background: rgba(255, 220, 100, 0.08); }
.cn-tt-matrix th.cn-mat-hsghl { background: #d6e1f5; color: #1a5fbb; }
.cn-tt-matrix td.cn-mat-pick {
  font-weight: 700;
  box-shadow: inset 0 0 0 2.21px white;
  /* background and color set inline per CN value (see cn_overlay.js) */
}
/* Grid-style matrix layout — 30% smaller */
.cn-tt-matrix.cn-tt-mat-grid td,
.cn-tt-matrix.cn-tt-mat-grid th { padding: 1.66px 2.21px; vertical-align: middle; }
.cn-tt-mat-grid .cn-tt-code { width: 28.73px; }
.cn-tt-mat-grid .cn-tt-name { width: 70.72px; }
.cn-tt-mat-grid td { width: 46.41px; line-height: 1.1; }
.cn-tt-mat-grid .cn-mat-cn  { font-size: 10.5px; font-weight: 700; font-family: monospace; line-height: 1.0; }
.cn-tt-mat-grid .cn-mat-pct { font-size: 7.18px; opacity: 0.9; font-family: monospace; }
.cn-tt-mat-grid .cn-mat-dim {
  background: #f4f6fa; color: #b0b8c5;
  opacity: 0.6;
}
.cn-tt-mat-grid .cn-mat-dim .cn-mat-cn { font-size: 9.39px; font-weight: 600; }
.cn-tt-matrix tr.cn-tt-rest th,
.cn-tt-matrix tr.cn-tt-rest td {
  background: #f5f6f9; font-size: 7.18px;
  color: #6a7090; font-style: italic; font-weight: 400;
}
.cn-tt-calc {
  margin-top: 5.52px; padding-top: 4.42px;
  border-top: 1.1px dotted #ccd;
  font-size: 8.29px; font-family: monospace;
  color: #5a7090; line-height: 1.3;
}
.cn-tt-calc b { color: #d62828; font-size: 9.39px; }
.cn-tt-diff { font-size: 7.73px; color: #5a7090; margin-left: 4.42px; font-style: italic; }

/* Place-name labels (덕양구 / 한강 / 창릉천) */
.place-label {
  background: rgba(255, 255, 255, 0.78);
  color: #1a2640;
  font-weight: 700; font-size: 9.94px;
  padding: 2.21px 7.73px;
  border-radius: 3.31px;
  border: 1.1px solid rgba(60, 90, 160, 0.35);
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 0 2.21px white;
}
.place-label[data-kind="한강"], .place-label[data-kind="창릉천"] {
  color: #1a4f8c;
  background: rgba(220, 240, 255, 0.85);
  border-color: rgba(40, 90, 180, 0.5);
  font-style: italic;
}
.place-label[data-kind="덕양구"] {
  background: rgba(245, 245, 245, 0.85);
  color: #4a5060;
  font-size: 11.05px;
  border: 1.1px dashed #6a7080;
}

/* Hotspot CSS2D label */
.hotspot-label {
  background: rgba(214, 56, 56, 0.95);
  color: white; font-weight: 700;
  padding: 3.31px 7.73px; border-radius: 11.05px;
  font-size: 9.39px;
  border: 1.66px solid white;
  box-shadow: 0 1.1px 4.42px rgba(0,0,0,0.35);
  pointer-events: none;
  white-space: nowrap;
}
/* F-3: 위험 라벨 (M_24080069) — 컴팩트 빨간 칩 */
.hotspot-label.danger {
  background: rgba(220, 38, 38, 0.94);
  font-size: 8.84px; font-weight: 700;
  padding: 2.21px 6.63px; border-radius: 9.94px;
  border: 1.1px solid white;
  box-shadow: 0 1.1px 4.42px rgba(0,0,0,0.4);
  text-align: center;
  line-height: 1.2;
}
.hotspot-label.danger .hs-sub {
  font-size: 6.63px; font-weight: 400;
  opacity: 0.85; margin-top: 1.1px;
  font-family: monospace; letter-spacing: 0.11px;
}
.hotspot-label.minor {
  background: rgba(70, 110, 180, 0.92);
  border-color: rgba(255,255,255,0.85);
  font-weight: 600; font-size: 8.29px;
  padding: 2.21px 6.63px;
  display: none;
}
.hotspot-label.minor.visible {
  display: inline-block;
}

/* Pipe recommendation panel */
/* ── 관로 확장 추천: right side panel (Naver-map style) ──────────────────
   body.rec-open narrows the page; the map (#container) and every
   absolutely-positioned overlay follow, the panel fills the freed space. */
body { position: relative; width: 100%; transition: width 0.25s ease; }
body.rec-open { width: calc(100% - 364px); }

#rec-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 364px; box-sizing: border-box;
  display: flex; flex-direction: column;
  background: #f4f6f9;
  border-left: 1.3px solid rgba(60, 90, 160, 0.25);
  box-shadow: -3px 0 12px rgba(0, 0, 30, 0.10);
  font-size: 11.7px; color: #1a2640;
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
body.rec-open #rec-panel { transform: none; }

.rp2-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15.6px; background: #fff;
  border-bottom: 1.3px solid #e3e8ef;
}
.rp2-title { font-size: 16.9px; font-weight: 800; color: #1a2640; }
.rp2-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 15.6px; color: #5a7090; padding: 2.6px 6.5px; border-radius: 5.2px;
}
.rp2-close:hover { background: #eef2f7; color: #1a2640; }

.rp2-scroll { flex: 1; overflow-y: auto; }
.rp2-scroll::-webkit-scrollbar { width: 6.5px; }
.rp2-scroll::-webkit-scrollbar-thumb { background: #c4cfdc; border-radius: 3.9px; }

.rp2-overview { background: #fff; padding: 13px 15.6px 10.4px; border-bottom: 1.3px solid #e3e8ef; }
.rp2-stats { display: flex; gap: 7.8px; }
.rp2-stat {
  flex: 1; text-align: center; padding: 7.8px 0;
  background: #f4f6f9; border-radius: 7.8px;
}
.rp2-stat b { display: block; font-size: 20.8px; font-weight: 800; line-height: 1.2; }
.rp2-stat span { font-size: 10.4px; color: #5a7090; font-weight: 600; }
.rp2-summary {
  margin-top: 9.1px; padding: 6.5px 0;
  font-size: 11.7px; color: #1a5fbb; text-align: center;
  background: rgba(26, 95, 187, 0.07); border-radius: 6.5px;
}
.rp2-summary b { font-weight: 800; }
.rp2-legend {
  display: flex; flex-wrap: wrap; gap: 3.9px 11.7px;
  padding-top: 7.8px; font-size: 10.4px; color: #5a7090;
}
.rp2-leg { display: flex; align-items: center; gap: 3.9px; }
.rp2-dot { display: inline-block; width: 13px; height: 6.5px; border-radius: 1.3px; }

.rp2-list-hd {
  padding: 13px 15.6px 6.5px;
  font-size: 13px; font-weight: 800; color: #1a2640;
}
.rp2-list-hd span { font-size: 10.4px; font-weight: 600; color: #7a8a9a; margin-left: 5.2px; }
.rp2-list { padding: 0 10.4px 15.6px; }
.rp2-empty { font-size: 11px; color: #888; text-align: center; padding: 20px 0; }

.rp2-card {
  background: #fff; border-radius: 10.4px;
  border: 1.3px solid #e3e8ef;
  padding: 11.7px 13px 9.1px; margin-bottom: 7.8px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.rp2-card:hover { border-color: #9db8e0; box-shadow: 0 2.6px 9px rgba(26, 95, 187, 0.12); }
.rp2-card.selected { border-color: #1a5fbb; box-shadow: 0 0 0 1.3px #1a5fbb inset; }

.rp2-card-hd { display: flex; align-items: center; gap: 6.5px; }
.rp2-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20.8px; height: 20.8px; border-radius: 50%;
  font-size: 11.7px; font-weight: 800; color: #fff;
}
.rp2-pid { font-family: monospace; font-weight: 700; font-size: 12.35px; color: #e06000; }
.rp2-flood { margin-left: auto; font-size: 11px; font-weight: 700; color: #1a5fbb; }

.rp2-size { margin: 7.8px 0 6.5px; font-size: 14.3px; font-weight: 600; color: #4a6080; }
.rp2-size b { font-size: 20.8px; font-weight: 800; color: #1a2640; }
.rp2-arrow { margin: 0 5.2px; color: #9aa8b8; }
.rp2-mult {
  margin-left: 7.8px; font-size: 11px; font-weight: 700; color: #1a5fbb;
  background: rgba(26, 95, 187, 0.08); padding: 1.3px 6.5px; border-radius: 9px;
  vertical-align: 2px;
}

.rp2-bars { display: flex; flex-direction: column; gap: 3.9px; }
.rp2-bar-row { display: flex; align-items: center; gap: 6.5px; }
.rp2-bar-lbl { width: 39px; font-size: 10.4px; color: #5a7090; font-weight: 600; }
.rp2-bar {
  position: relative; flex: 1; height: 10.4px;
  background: #edf1f6; border-radius: 5.2px; overflow: hidden;
}
.rp2-bar-fill { height: 100%; border-radius: 5.2px; }
.rp2-bar i {                               /* 100 % fill tick (bar spans 0–200 %) */
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 1.3px; background: rgba(26, 38, 64, 0.45);
}
.rp2-bar-val { width: 40px; text-align: right; font-size: 11px; font-weight: 800; font-family: monospace; }
.rp2-after { background: #3d86e0; }

.rp2-meta { margin-top: 6.5px; font-size: 10.4px; color: #7a8a9a; }
.rp2-detail-btn { margin-top: 5.2px; font-size: 10.4px; font-weight: 700; color: #1a5fbb; }
.rp2-card.selected .rp2-detail-btn { display: none; }
.rp2-detail { display: none; }
.rp2-card.selected .rp2-detail {
  display: block; margin-top: 7.8px; padding-top: 7.8px;
  border-top: 1.3px dashed #d7dee8; cursor: default;
}
.rp2-detail .rt-xsec { margin: 3.9px auto; }

.rp2-sev-red { background: #ff2200; }
.rp2-sev-org { background: #ff7700; }
.rp2-sev-ylw { background: #ffaa00; }
.rp2-orange { color: #e06000; }
.rp2-red { color: #d62828; }
.rp2-blue { color: #1a5fbb; }

/* Recommendation 3D labels */
.rec-label {
  font-size: 9.1px; font-weight: 700;
  padding: 2.6px 6.5px; border-radius: 10.4px;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 1.3px 3.9px rgba(0,0,0,0.3);
  text-align: center; line-height: 1.3;
}
.rec-expand {
  background: rgba(224, 0, 0, 0.92); color: white;
  border: 1.3px solid rgba(255,255,255,0.7);
}

.rec-sub {
  font-size: 7.15px; font-weight: 400; opacity: 0.85;
  font-family: monospace;
}

/* Recommendation hover tooltip (before / after) */
#rec-tooltip {
  position: fixed; z-index: 200;
  background: rgba(255,255,255,0.97);
  border: 1.95px solid rgba(60, 90, 160, 0.45);
  border-radius: 7.8px;
  padding: 9.1px 11.7px;
  font-size: 11.05px; color: #1a2640;
  box-shadow: 0 5.2px 16.9px rgba(0,0,30,0.25);
  pointer-events: none;
  width: 240.5px;
}
.rt-hd {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.3px solid #ccd; padding-bottom: 3.9px; margin-bottom: 5.2px;
}
.rt-title { font-weight: 700; font-size: 10.4px; color: #1a2640; }
.rt-badge {
  font-size: 8.45px; font-weight: 700; padding: 1.3px 6.5px;
  border-radius: 3.9px; font-family: monospace;
}
.rt-b-orange { background: rgba(255,140,0,0.15); color: #d06000; }
.rt-sec {
  font-size: 9.1px; font-weight: 700; color: #5a7090;
  text-transform: uppercase; letter-spacing: 0.52px;
  margin: 2.6px 0 2.6px;
}
.rt-row { display: flex; justify-content: space-between; padding: 1.3px 0; }
.rt-row.small { font-size: 9.75px; color: #6a7a90; }
.rt-lbl { color: #5a7090; font-weight: 600; }
.rt-val { font-weight: 700; font-family: monospace; }
.rt-red   { color: #d63838; }
.rt-blue  { color: #1a5fbb; }

.rt-div { height: 1.3px; background: linear-gradient(90deg, transparent, #ccd, transparent); margin: 5.2px 0; }
.rt-xsec {
  display: block; margin: 3.9px auto 0;
  border-radius: 3.9px;
  background: #f5f8fc;
  border: 1.3px solid #e0e6f0;
}

/* Cross-section tool */
#xsec-btn {
  position: absolute; bottom: 55.25px; left: 50%; transform: translateX(132.6px);
  z-index: 15; padding: 3.31px 11.05px; border: 1.1px solid rgba(60,90,160,0.3);
  border-radius: 15.47px; background: rgba(255,255,255,0.88);
  font-size: 8.84px; font-weight: 700; color: #1a2640; cursor: pointer;
  backdrop-filter: blur(6.63px); box-shadow: 0 1.1px 4.42px rgba(0,0,30,0.12);
  transition: background 0.15s, border-color 0.15s;
}
#xsec-btn:hover { background: rgba(240,245,255,0.95); border-color: rgba(60,90,160,0.5); }
#xsec-btn.xsec-btn-active { background: #ff3366; color: white; border-color: #ff3366; }

#xsec-panel {
  position: absolute; bottom: 88.4px; left: 50%; transform: translateX(-50%);
  z-index: 100; width: 596.7px;
  background: rgba(255,255,255,0.97); border: 1.66px solid rgba(60,90,160,0.35);
  border-radius: 8.84px; padding: 6.63px 8.84px 8.84px;
  box-shadow: 0 6.63px 22.1px rgba(0,0,30,0.25); backdrop-filter: blur(11.05px);
}
.xsec-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1.1px solid #dde; padding-bottom: 3.31px; margin-bottom: 3.31px;
}
.xsec-title { font-size: 9.94px; font-weight: 700; color: #1a2640; }
.xsec-close {
  background: none; border: none; font-size: 12.16px; cursor: pointer;
  color: #888; padding: 0 2.21px; line-height: 1;
}
.xsec-close:hover { color: #d63838; }
#xsec-hint {
  position: absolute; bottom: 90.61px; left: 50%; transform: translateX(-50%);
  z-index: 101; background: rgba(20,25,38,0.9); color: #ffd84a;
  font-size: 9.94px; font-weight: 700; padding: 5.52px 15.47px; border-radius: 17.68px;
  border: 1.1px solid #5a6285; box-shadow: 0 2.21px 8.84px rgba(0,0,0,0.3);
  pointer-events: none; white-space: nowrap;
}
.xsec-info {
  font-size: 8.29px; color: #5a7090; text-align: center; padding: 2.21px 0;
  font-weight: 600;
}
#xsec-canvas {
  display: block; width: 100%; height: 221px;
  border-radius: 4.42px; background: #f8fafe; border: 1.1px solid #e4e8f0;
}
.xsec-legend {
  display: flex; gap: 13.26px; justify-content: center; padding: 4.42px 0 0;
  font-size: 7.73px; color: #5a7090;
}
.xsec-leg-item { display: flex; align-items: center; gap: 3.31px; }
.xsec-leg-swatch { display: inline-block; width: 15.47px; height: 6.63px; border-radius: 2.21px; }
.xsec-terrain-sw { background: linear-gradient(to bottom, rgba(139,119,90,0.7), rgba(169,149,110,0.3)); border: 0.55px solid #8b775a; }
.xsec-flood-sw { background: rgba(50,130,220,0.4); border: 0.55px solid #2266cc; }

/* Hover checklist — recommendation row */
#hover-checklist .hc-divider {
  height: 1.1px; background: #ddd; margin: 3.31px 0;
}
#hover-checklist .hc-rec-dot {
  display: inline-block; width: 7.8px; height: 7.8px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8c00 0%, #00cc66 100%);
  border: 1.3px solid rgba(0,0,0,0.25);
}

/* Rain audio toggle (time bar) */
#sound-btn {
  background: rgba(255,255,255,0.1); color: white;
  border: 1.1px solid rgba(150,170,210,0.4); border-radius: 3.31px;
  height: 17.68px; min-width: 22.1px; padding: 0 3.31px; box-sizing: border-box;
  font-size: 9.94px; line-height: 15.47px; cursor: pointer;
}
#sound-btn:hover { background: rgba(255,255,255,0.2); }
#sound-btn.on { background: #2a6fc6; border-color: #5a9ae6; }
#sound-btn:disabled { opacity: 0.4; cursor: not-allowed; }
