:root {
  --bg: #0b1622;
  --panel: #111f2e;
  --panel-2: #162839;
  --line: #22374c;
  --text: #e6edf5;
  --muted: #8ea2b8;
  --accent: #4fb3e8;
  --st-active: #2fd4a3;
  --st-planned: #5aa9ff;
  --st-overdue: #ff5f5f;
  --st-recovered: #7d8a9c;
  --st-undecided: #b48cff;
  --st-ongoing: #f2b84b;
  --radius: 10px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select { font: inherit; }

/* ---------- header */
.top {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: #0d1b29;
}
.top h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.top .wave { color: var(--accent); margin-right: 6px; }
.top .spacer { flex: 1; }
.clock { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; white-space: nowrap; }
.clock small { color: var(--muted); font-weight: 400; font-size: 14px; margin-right: 8px; }
.meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14px; margin-left: 14px; }
.top nav a:hover { color: var(--text); }

/* ---------- layout */
.board {
  display: grid; gap: 12px; padding: 12px;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "map side" "gantt gantt";
  height: calc(100vh - 53px);
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.panel h2 {
  font-size: 13px; font-weight: 600; color: var(--muted); margin: 0;
  padding: 10px 14px; border-bottom: 1px solid var(--line); letter-spacing: 0.02em;
  display: flex; justify-content: space-between; align-items: center;
}
#map-wrap { grid-area: map; position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; border-radius: var(--radius); background: #0a1520; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.gantt-panel { grid-area: gantt; max-height: 34vh; display: flex; flex-direction: column; }

/* ---------- KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--panel); padding: 12px 14px; }
.kpi .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .v small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi.alert .v { color: var(--st-overdue); }
.kpi.good .v { color: var(--st-active); }

/* ---------- events */
.events { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.events ul { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.events li {
  display: grid; grid-template-columns: 84px 70px 1fr; gap: 8px; align-items: center;
  padding: 7px 14px; border-bottom: 1px solid #172a3c; cursor: pointer;
}
.events li:hover { background: var(--panel-2); }
.events .d { font-variant-numeric: tabular-nums; font-weight: 600; }
.events .d { white-space: nowrap; }
.events .d .wd { color: var(--muted); font-weight: 400; margin-left: 3px; font-size: 13px; }
.events .d small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.events .what { font-size: 13px; overflow: hidden; }
.events .what b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.events .what span { color: var(--muted); }
.events .empty { color: var(--muted); padding: 18px 14px; cursor: default; display: block; }
.events li.today-row { background: rgba(79, 179, 232, 0.08); }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor;
}
.c-deploy, .c-planned, .c-upcoming { color: var(--st-planned); }
.c-recover, .c-active { color: var(--st-active); }
.c-overdue { color: var(--st-overdue); background: rgba(255, 95, 95, 0.12); }
.c-recovered, .c-done { color: var(--st-recovered); }
.c-ongoing { color: var(--st-ongoing); }
.c-undecided, .c-undated { color: var(--st-undecided); }
.g-nodate { position: absolute; left: 8px; top: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- gantt */
.gantt { overflow: auto; flex: 1; position: relative; }
.g-row { display: grid; grid-template-columns: 300px 1fr; min-height: 34px; border-bottom: 1px solid #172a3c; cursor: pointer; }
.g-row:hover { background: var(--panel-2); }
.g-label { padding: 6px 14px; display: flex; align-items: center; gap: 8px; min-width: 0; position: sticky; left: 0; background: inherit; z-index: 2; }
.g-row .g-label { background: var(--panel); }
.g-row:hover .g-label { background: var(--panel-2); }
.g-label .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; flex: 1; }
.g-label .a { color: var(--muted); font-size: 12px; white-space: nowrap; }
.g-track { position: relative; }
.g-head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 26px; cursor: default; }
.g-head:hover, .g-head .g-label { background: var(--panel); }
.g-month { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); padding: 4px 6px; white-space: nowrap; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #1b3045; }
.g-bar { position: absolute; top: 9px; height: 16px; border-radius: 4px; background: #24415d; }
.g-obs { position: absolute; top: 12px; height: 10px; border-radius: 3px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 1; box-shadow: 0 0 6px var(--accent); }
.g-mark { position: absolute; top: 4px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; transform: translateX(-5px); }
.g-mark.dep { border-top: 6px solid var(--st-planned); }
.g-mark.rec { top: auto; bottom: 4px; border-bottom: 6px solid var(--st-active); }
.legend { display: flex; gap: 14px; font-weight: 400; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* ---------- map */
.leaflet-container { font-family: inherit; }
.osm-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(0.92) contrast(0.9) saturate(0.6); }
.pmark { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pmark .dot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #0b1622; box-shadow: 0 0 0 2px currentColor, 0 0 12px currentColor; background: currentColor; flex: none; }
.pmark .lbl { color: var(--text); background: rgba(11, 22, 34, 0.86); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.pmark .lbl small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.map-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; background: rgba(13, 27, 41, 0.92); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.map-legend div { margin: 2px 0; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; min-width: 300px; }
.pop h3 { margin: 0 0 2px; font-size: 16px; }
.pop .sub { color: var(--muted); margin-bottom: 8px; }
.pop dl { display: grid; grid-template-columns: 72px 1fr; gap: 3px 10px; margin: 0 0 8px; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; }
.pop table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pop th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 3px 4px; }
.pop td { padding: 4px; border-bottom: 1px solid #172a3c; vertical-align: top; }
.pop .note { color: var(--muted); margin-top: 6px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(11,22,34,.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel-2); }

.banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 600; background: var(--panel); border: 1px solid var(--st-overdue); color: var(--st-overdue); padding: 6px 14px; border-radius: 8px; display: none; font-size: 13px; }

/* ---------- wall (큰 화면) */
@media (min-width: 2200px) {
  body { font-size: 18px; }
  .board { grid-template-columns: minmax(0, 1fr) 520px; }
  .kpi .v { font-size: 40px; }
  .top h1 { font-size: 26px; }
}

/* ---------- mobile */
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; }
  .top h1 { font-size: 17px; }
  .top .spacer { display: none; }
  .clock { font-size: 16px; }
  .board { display: flex; flex-direction: column; height: auto; padding: 10px; }
  #map-wrap { height: 55vh; }
  .gantt-panel { max-height: none; }
  .g-row { grid-template-columns: 150px 1fr; }
  .g-label .a { display: none; }
  .gantt { overflow-x: auto; }
  .g-track { min-width: 520px; }
  .kpi .v { font-size: 24px; }
  .leaflet-popup-content { min-width: 240px; }
  .map-legend { display: none; }
}

/* ---------- forms (login/admin) */
.page { max-width: 880px; margin: 0 auto; padding: 24px 16px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card p { margin: 0 0 10px; color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 9px 11px; background: #0c1925; border: 1px solid var(--line); color: var(--text); border-radius: 7px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { display: inline-block; background: var(--accent); color: #04121d; border: 0; padding: 9px 16px; border-radius: 7px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.danger { background: transparent; color: var(--st-overdue); border: 1px solid var(--st-overdue); font-weight: 500; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 160px; }
.row > .btn, .row > form { flex: none; min-width: 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.error { color: var(--st-overdue); border-color: var(--st-overdue); background: rgba(255, 95, 95, .08); }
.flash.ok { color: var(--st-active); border-color: var(--st-active); background: rgba(47, 212, 163, .08); }
.result ul { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; }
.result li { margin: 2px 0; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.hist th, table.hist td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.hist th { color: var(--muted); font-weight: 500; }
code.url { display: block; word-break: break-all; background: #0c1925; border: 1px solid var(--line); padding: 8px 10px; border-radius: 7px; font-size: 13px; margin: 8px 0; }
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .card { width: 100%; max-width: 360px; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); margin-bottom: 12px; }
.drop.over { border-color: var(--accent); color: var(--text); }

@media (max-width: 900px) {
  .g-label { gap: 6px; padding: 6px 10px; }
  .g-label .chip { font-size: 0; width: 10px; height: 10px; padding: 0; border: 0; background: currentColor; flex: none; }
  .g-label .n { font-size: 13px; }
}
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 2단계: 예보 상세 */
:root { --v-ok: #2fd4a3; --v-caution: #f2b84b; --v-no: #ff5f5f; --series: #4fb3e8; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.fcalert { color: var(--st-overdue); font-size: 13px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { position: absolute; inset: 0; z-index: 800; background: var(--panel); border-radius: var(--radius); overflow-y: auto; }
.detail[hidden] { display: none; }
.dt-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 18px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.dt-head h3 { margin: 0 0 2px; font-size: 19px; }
.dt-x { background: transparent; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 16px; flex: none; }
.dt-x:hover { background: var(--panel-2); }
.dt-body { padding: 12px 18px 22px; position: relative; }
.dt-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.dt-tabs button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.dt-tabs button.on { color: var(--text); border-color: var(--accent); background: rgba(79,179,232,.1); }
.outlook { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.ol { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.ol-d { font-weight: 700; margin-bottom: 5px; }
.ol-v { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.ol-v b { color: var(--text); font-variant-numeric: tabular-nums; }
.vchip { --vc: var(--muted); display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 2px 9px 2px 3px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--vc); color: var(--vc); }
.vchip b { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--vc); color: #0b1622; font-size: 11px; line-height: 1; }
.vchip.v-ok { --vc: var(--v-ok); } .vchip.v-caution { --vc: var(--v-caution); } .vchip.v-no { --vc: var(--v-no); background: rgba(255,95,95,.1); }
.vchip.v-none { padding-left: 9px; font-weight: 500; }
.ev-v { margin-top: 3px; } .ev-v .vchip { font-size: 11.5px; }

.stack { margin-top: 14px; position: relative; }
.stack svg { display: block; overflow: visible; font-family: inherit; }
.stack .work { fill: rgba(79,179,232,.045); }
.stack .dayline { stroke: var(--line); stroke-width: 1; }
.stack .daylbl { fill: var(--text); font-size: 12.5px; font-weight: 600; }
.stack .ptitle { fill: var(--text); font-size: 13px; font-weight: 700; }
.stack .punit { fill: var(--muted); font-weight: 400; }
.stack .pnote { fill: var(--muted); font-size: 11.5px; }
.stack .pnote.warn { fill: var(--v-caution); }
.stack .grid { stroke: #1a2d40; stroke-width: 1; }
.stack .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.stack .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stack .mark { fill: var(--series); stroke: var(--panel); stroke-width: 2; }
.stack .mlbl { fill: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.stack .slack { stroke: var(--muted); stroke-width: 2; }
.stack .limit { stroke: var(--v-no); stroke-width: 1.5; stroke-dasharray: 5 4; }
.stack .limitlbl { fill: var(--v-no); font-size: 11px; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.stack .now { stroke: var(--accent); stroke-width: 1.5; opacity: .8; }
.stack .nowlbl { fill: var(--accent); font-size: 11px; }
.stack .xhair { stroke: var(--text); stroke-width: 1; opacity: .5; pointer-events: none; }
.tip { position: absolute; z-index: 5; background: #0d1b29; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; pointer-events: none; min-width: 150px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.tip-t { font-weight: 700; margin-bottom: 4px; }
.tip div:not(.tip-t) { display: flex; gap: 8px; } .tip span { color: var(--muted); width: 56px; } .tip b { font-variant-numeric: tabular-nums; }
.dt-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.dt-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dt-table td { padding: 7px 8px; border-bottom: 1px solid #172a3c; vertical-align: top; }
.ev { display: inline-block; margin: 0 12px 3px 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev.low, .ev.slack { color: var(--muted); } .ev.low b, .ev.slack b { color: var(--text); }
.ev b { font-weight: 700; }
@media (max-width: 900px) {
  .detail { position: fixed; inset: 0; border-radius: 0; }
  .outlook { grid-template-columns: 1fr; }
  .fcalert { order: 10; flex-basis: 100%; white-space: normal; }
}
@media (max-width: 900px) { body.dt-open { overflow: hidden; } }
@media (max-width: 900px) {
  .dt-table { font-size: 12.5px; table-layout: fixed; }
  .dt-table th:first-child, .dt-table td:first-child { width: 62px; }
  .dt-table .ev { white-space: normal; display: block; margin-right: 0; }
}

/* ---------- 사업 위치 지정 */
.loc-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 12px; height: calc(100vh - 53px); }
.loc-side { display: flex; flex-direction: column; min-height: 0; }
.loc-help { padding: 12px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); line-height: 1.55; }
.loc-help b { color: var(--text); margin-right: 4px; }
.loc-filter { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.loc-filter button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; }
.loc-filter button.on { color: var(--text); border-color: var(--accent); }
#plist { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#plist li { padding: 9px 14px; border-bottom: 1px solid #172a3c; cursor: pointer; }
#plist li:hover { background: var(--panel-2); }
#plist li.on { background: rgba(79,179,232,.12); box-shadow: inset 3px 0 0 var(--accent); }
#plist .pn { font-weight: 600; }
#plist .ps { font-size: 12px; margin-top: 2px; }
.loc-map-wrap { position: relative; overflow: hidden; }
#lmap { position: absolute; inset: 0; border-radius: var(--radius); cursor: crosshair; }
.loc-bar { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: rgba(13,27,41,.95); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.loc-actions { display: flex; gap: 8px; flex: none; }
.loc-toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 700; background: var(--panel); border: 1px solid var(--st-active); color: var(--st-active);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; }
.loc-toast.bad { border-color: var(--st-overdue); color: var(--st-overdue); }
@media (max-width: 900px) {
  .loc-wrap { grid-template-columns: 1fr; grid-template-rows: 40vh 1fr; height: calc(100vh - 80px); }
  .loc-side { order: 2; } .loc-map-wrap { order: 1; }
  .loc-bar { flex-direction: column; align-items: stretch; }
}
select { width: 100%; padding: 9px 11px; background: #0c1925; border: 1px solid var(--line); color: var(--text); border-radius: 7px; }

.stack .line2 { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.ol-src { font-size: 11.5px; margin-top: 2px; }

/* ---------- 예보 창: 보드 전체를 덮고 한눈에 (v5) */
.board { position: relative; }
.detail { position: absolute; inset: 12px; z-index: 900; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.dt-head { position: static; flex: none; padding: 10px 16px; align-items: center; }
.dt-head h3 { font-size: 18px; display: inline; margin-right: 10px; }
.dt-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; min-width: 0; }
.dt-head .muted { font-size: 13px; }
.dt-head .dt-tabs { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
.dt-msg { padding: 24px; }
.dt-alert { margin: 8px 16px 0; flex: none; }
.dt-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.dt-left { min-height: 0; padding: 6px 8px 6px 14px; display: flex; }
.dt-left .stack { flex: 1; min-height: 0; margin: 0; }
.dt-right { border-left: 1px solid var(--line); overflow-y: auto; padding: 10px 14px 14px; }
.dt-sec { font-size: 13px; font-weight: 700; margin: 2px 0 8px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dt-sec .small { font-weight: 400; }
.ol-list { display: flex; flex-direction: column; gap: 4px; }
.ol-row { display: grid; grid-template-columns: 64px auto 1fr; gap: 8px; align-items: center; padding: 5px 8px; background: var(--panel-2); border-radius: 7px; }
.ol-row .ol-d { margin: 0; font-size: 13px; }
.ol-row .ol-v { margin: 0; text-align: right; font-size: 12.5px; white-space: nowrap; }
.ol-row .vchip { font-size: 12px; }
.tag { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; font-size: 10.5px; color: var(--muted); }
.tb { display: flex; flex-direction: column; }
.tb-day { display: grid; grid-template-columns: 58px 1fr; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid #172a3c; font-size: 12px; }
.tb-d { grid-row: span 2; font-weight: 600; font-size: 12.5px; }
.tb-tide, .tb-crnt { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.tb-crnt { color: var(--muted); }
.tb .ev { margin: 0; }
.tb .ev.max b { color: var(--text); }
.tip { position: fixed; }
.stack .daylbl tspan.dv-ok { fill: var(--v-ok); } .stack .daylbl tspan.dv-caution { fill: var(--v-caution); } .stack .daylbl tspan.dv-no { fill: var(--v-no); }
@media (max-width: 900px) {
  .detail { position: fixed; inset: 0; border-radius: 0; border: 0; }
  .dt-main { display: flex; flex-direction: column; overflow-y: auto; }
  .dt-left { flex: none; overflow-x: auto; padding: 6px 4px 6px 8px; display: block; }
  .dt-right { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}

/* 지도 컨트롤(+/−, 출처)이 예보 창 위로 올라오지 않도록 지도 영역을 별도 층으로 묶음 */
#map-wrap { z-index: 0; isolation: isolate; }
.detail { z-index: 2000; }

/* ---------- 예보 창: 사업 전환 + 미니 지도 (v6) */
.dt-head { display: flex; align-items: center; gap: 12px; }
.dt-nav { display: flex; align-items: center; gap: 6px; flex: none; }
.dt-nav button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.dt-nav button:hover { border-color: var(--accent); }
.dt-sel { width: auto; min-width: 220px; max-width: 360px; font-size: 16px; font-weight: 700; padding: 6px 10px; background: var(--panel-2); }
.dt-sub { flex: 1; min-width: 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dt-sub .dt-tabs { margin: 0 0 0 4px; }
.dtmap { height: 190px; border-radius: 8px; border: 1px solid var(--line); background: #0a1520; isolation: isolate; margin-bottom: 6px; }
.dtmap.editable { cursor: crosshair; }
.dtmap-cap { margin-bottom: 12px; line-height: 1.7; }
.dtmap-cap b { color: var(--text); font-weight: 600; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 6px; vertical-align: 0; }
.lg:first-child { margin-left: 0; }
.lg-pt { background: #2f7ed8; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.lg-cr { background: var(--muted); }
.lg-td { background: var(--v-caution); }
.dt-toast { margin: 0 0 10px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; border: 1px solid var(--st-active); color: var(--st-active); background: rgba(47,212,163,.08); }
.dt-toast.bad { border-color: var(--st-overdue); color: var(--st-overdue); background: rgba(255,95,95,.08); }
.dt-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 16px; gap: 10px; }
.dt-empty-msg { font-size: 14px; color: var(--muted); }
.dt-empty-msg b { color: var(--text); }
.dtmap.big { flex: 1; height: auto; margin: 0; }
@media (max-width: 900px) {
  .dt-head { flex-wrap: wrap; }
  .dt-nav { order: 1; flex: 1; } .dt-sel { min-width: 0; flex: 1; font-size: 15px; }
  .dt-x { order: 2; }
  .dt-sub { order: 3; flex-basis: 100%; }
  .dt-empty { min-height: 70vh; }
}
.past-tg { display: flex; align-items: center; gap: 0; margin-top: 6px !important; padding-top: 6px; border-top: 1px solid var(--line); color: var(--text); font-size: 12px; cursor: pointer; }
.past-tg input { margin: 0 6px 0 0; accent-color: var(--accent); }
.map-legend { pointer-events: auto; }

/* ---------- 하단 탭 + 과거조사 목록 (v9) */
.btabs { display: inline-flex; gap: 4px; }
.btabs button { background: transparent; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.btabs button:hover { color: var(--text); }
.btabs button.on { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.btabs button span { color: var(--muted); font-weight: 400; margin-left: 2px; }
.legend[hidden], .gantt[hidden] { display: none; }
.g-bar.past { background: #8ea2b8; opacity: .75; height: 12px; top: 11px; }
.c-region { color: var(--muted); }
#pastlist .g-row.hi { background: rgba(79,179,232,.12); }
#pastlist .g-row.hi .g-label { background: #1a3247; }
#pastlist .g-row.hi .g-bar.past { background: #4fb3e8; opacity: 1; }

/* ---------- 연안정비 (v10) */
.coastbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; cursor: pointer; flex: none; }
.coastbar:hover { border-color: var(--accent); }
.cb-t { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.cb-t span:first-child { color: var(--muted); font-weight: 600; flex: 1; }
.cb-t b { font-size: 18px; font-variant-numeric: tabular-nums; }
.cb-t .muted { font-size: 12px; }
.cb-track { height: 6px; background: #22374c; border-radius: 3px; overflow: hidden; flex: 1; }
.cb-track.big { height: 10px; border-radius: 5px; margin: 6px 0 12px; }
.cb-fill { height: 100%; background: #ff5f5f; border-radius: inherit; }
.coastwrap { padding: 0; }
.cs-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100%; }
.cs-side { padding: 12px 14px; border-right: 1px solid var(--line); position: sticky; top: 0; align-self: start; }
.cs-big { display: flex; align-items: baseline; gap: 10px; }
.cs-big b { font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1; }
.cs-big span { color: var(--muted); font-size: 13px; }
.cs-sub { color: var(--muted); font-size: 12px; margin: 8px 0 4px; }
.cs-stat { display: grid; grid-template-columns: 92px 1fr 44px 50px; gap: 8px; align-items: center; font-size: 12.5px; margin: 3px 0; }
.cs-stat b { text-align: right; font-variant-numeric: tabular-nums; }
.cs-stat .muted { font-size: 11.5px; }
.cs-main { padding: 8px 12px 12px; min-width: 0; }
.cs-filter { display: flex; gap: 6px; margin-bottom: 6px; position: sticky; top: 0; background: var(--panel); padding: 2px 0 6px; z-index: 2; }
.cs-filter button, .cs-all { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 2px 11px; font-size: 12px; cursor: pointer; }
.cs-filter button.on { color: var(--text); border-color: var(--accent); }
.cs-all { margin-left: auto; border-radius: 6px; }
.cs-all:hover { color: var(--text); border-color: #ff5f5f; }
.cs-group { margin-bottom: 8px; }
.cs-gh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 4px 2px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px; }
.cs { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; background: var(--panel-2); min-width: 0; }
.cs input { accent-color: #ff5f5f; width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; }
.cs-dot { width: 9px; height: 9px; border-radius: 50%; background: #7d8a9c; flex: none; }
.cs.done { border-color: rgba(255,95,95,.55); }
.cs.done .cs-dot { background: #ff5f5f; }
.cs-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; color: var(--muted); }
.cs-n b { color: var(--text); }
.cs-n:hover b { text-decoration: underline; }
.cs-m { color: var(--muted); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cs .tag { margin-left: 4px; }
.cs.hi { border-color: var(--accent); background: rgba(79,179,232,.12); }
@media (max-width: 900px) {
  .cs-wrap { grid-template-columns: 1fr; }
  .cs-side { position: static; border-right: 0; border-bottom: 1px solid var(--line); }
}
.cs-warn { color: var(--v-caution); margin-right: 4px; cursor: help; }

/* ---------- 지점 예보·관심 지점 (v11) */
.pick-btn { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pick-btn:hover { border-color: var(--accent); }
.pick-btn.on { background: var(--accent); color: #04121d; border-color: var(--accent); }
#map.picking, #map.picking .leaflet-interactive { cursor: crosshair !important; }
.wmark { display: flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.wmark .star { color: #ffd166; font-size: 18px; line-height: 1; text-shadow: 0 0 3px #0b1622, 0 0 6px #0b1622; }
.wmark .lbl { font-size: 12px; font-weight: 600; color: var(--text); background: rgba(11,22,34,.82); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.dt-watch { display: flex; gap: 6px; align-items: center; flex: none; }
.dt-watch input { width: 180px; padding: 6px 9px; }
.dt-watch .btn { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
.dt-pending { margin: 8px 16px 0; flex: none; padding: 7px 12px; border-radius: 7px; font-size: 13px; border: 1px solid var(--accent); color: var(--accent); background: rgba(79,179,232,.08); display: flex; align-items: center; gap: 8px; }
.dt-pending.bad { border-color: var(--v-caution); color: var(--v-caution); background: rgba(242,184,75,.08); }
.spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .dt-watch { order: 4; flex-basis: 100%; } .dt-watch input { flex: 1; width: auto; } }
