/* LNM Viewer — Modern Nautical Chartplotter UI (Light + Night Bridge Theme) */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.94);
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: #e0f2fe;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --success: #059669;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --radius: 10px;
  --topbar-h: 54px;
  --sidebar-w: 310px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #070d19;
  --surface: #0f172a;
  --surface-elevated: rgba(15, 23, 42, 0.94);
  --surface-muted: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-faint: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --success: #34d399;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: 13px; }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.print-only { display: none; }

/* App Shell */
.app-shell { display: flex; flex-direction: column; height: 100vh; width: 100vw; }

/* Top Command Bar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
  z-index: 1200;
  flex-shrink: 0;
  min-width: 0;
}
.topbar-left, .topbar-center, .topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar-left, .topbar-right { flex-shrink: 0; }
.topbar-center { flex: 1; justify-content: center; max-width: 720px; }

.brand { display: flex; align-items: center; gap: 8px; user-select: none; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.back-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 720px) {
  .back-link .back-label { display: none; }
  .back-link { padding: 0 8px; }
}
.brand-icon { color: var(--accent); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 700; font-size: 14px; letter-spacing: -0.02em; }
.brand-sub { font-size: 10.5px; color: var(--text-faint); font-weight: 500; }

/* Buttons & Controls */
.icon-btn, .tool-btn, .mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn { width: 34px; height: 34px; padding: 0; }
.tool-btn { height: 34px; padding: 0 11px; white-space: nowrap; }
.mini-btn { height: 26px; padding: 0 9px; font-size: 11.5px; }
.icon-btn:hover, .tool-btn:hover, .mini-btn:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.tool-btn.active, .icon-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tool-btn.primary, .mini-btn.primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.tool-btn.primary:hover, .mini-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #ffffff; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.link-btn:hover { text-decoration: underline; }

/* Segmented Scope Control */
.scope-group { display: flex; align-items: center; gap: 6px; }
.segmented {
  display: inline-flex;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.top-select, .ctrl-select {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.top-select { max-width: 145px; }
.ctrl-select { height: 30px; width: 100%; font-size: 12px; }
.harbor-select { max-width: 145px; }

/* Global Search */
.search-wrap { position: relative; flex: 1; min-width: 130px; max-width: 240px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.search-wrap input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 310px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 2000;
}
.search-item {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-muted); }
.search-item-title { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.search-item-sub { font-size: 11px; color: var(--text-faint); }

/* Workspace Layout */
.workspace { display: flex; flex: 1; min-height: 0; position: relative; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 1050;
  transition: margin-left 0.2s ease, transform 0.2s ease;
}
.sidebar.collapsed { margin-left: calc(var(--sidebar-w) * -1); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.sidebar-disclaimer {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  background: var(--warn-soft);
  border-top: 1px solid var(--border-strong);
}
.sidebar-disclaimer strong { color: var(--warn); }

.panel-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 11px;
}
.telemetry-row { display: flex; align-items: center; gap: 8px; }
.telemetry-title { font-weight: 600; font-size: 12px; flex: 1; }
.telemetry-sub { margin-top: 4px; font-size: 11px; color: var(--text-faint); line-height: 1.35; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.status-dot.loading { background: var(--warn); animation: pulseDot 1s infinite; }
.status-dot.error { background: var(--danger); }
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.3); } }

.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}
.count-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.panel-section { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--border); padding-top: 12px; }
.panel-section:first-of-type { border-top: none; padding-top: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; }
.section-header h3 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 700; }
.section-actions { display: flex; gap: 4px; }

.toggle-list { display: flex; flex-direction: column; gap: 4px; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.toggle-row:hover { background: var(--surface-muted); }
.toggle-row input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.toggle-label { flex: 1; font-size: 12.5px; color: var(--text); }

.category-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.cat-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.cat-chip.active { border-color: var(--chip-color, var(--accent)); background: var(--surface-muted); color: var(--text); font-weight: 600; }
.cat-chip:not(.active) { opacity: 0.48; }

.csv-import-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.csv-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hint-text { font-size: 11px; color: var(--text-faint); line-height: 1.4; }

.field-row { display: flex; flex-direction: column; gap: 4px; }
.field-row label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.ecdis-details {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}
.ecdis-details summary { font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; user-select: none; }
.ecdis-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.ecdis-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); font-weight: 600; }
.ecdis-grid label.checkbox-inline { flex-direction: row; align-items: center; gap: 6px; }
.ecdis-grid input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Map Stage */
.map-stage { flex: 1; position: relative; min-width: 0; display: flex; flex-direction: column; }
.map-canvas { flex: 1; width: 100%; height: 100%; z-index: 1; background: #cbd5e1; }
html[data-theme="dark"] .map-canvas { background: #0b1220; }
.cursor-crosshair, .cursor-crosshair .leaflet-interactive { cursor: crosshair !important; }

/* Tool Banner */
.tool-banner {
  position: absolute;
  top: 12px;
  left: 54px;
  z-index: 950;
  background: var(--surface-elevated);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-md);
  border-radius: 99px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.tool-banner-actions { display: flex; gap: 6px; }

/* Route / GPX Passage Corridor Panel */
.route-panel {
  position: absolute;
  top: 12px;
  left: 54px;
  width: 390px;
  max-width: calc(100% - 70px);
  z-index: 960;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.route-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.route-panel-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-btn-row, .route-margin-row, .route-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.route-margin-row label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }

.route-wp-icon { background: transparent; border: none; }
.route-wp-icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.route-leg-label { background: transparent; border: none; }
.route-leg-label span {
  display: inline-block;
  background: rgba(2, 132, 199, 0.92);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.65);
}

/* Bottom-Right Collapsible Map Legend */
.map-hud-br {
  position: absolute;
  bottom: 52px;
  right: 12px;
  z-index: 910;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  transition: bottom 0.2s ease;
}
.hud-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.hud-btn:hover { background: var(--surface-muted); }
.map-legend {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  font-size: 11.5px;
}
.legend-title { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 2px; }
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--text); }
.lg-sq { width: 12px; height: 12px; border-radius: 2px; border: 1.5px solid #052e16; display: inline-block; flex-shrink: 0; }
.lg-tri { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid #dc2626; display: inline-block; flex-shrink: 0; }
.lg-dia { width: 10px; height: 10px; transform: rotate(45deg); display: inline-block; flex-shrink: 0; margin: 0 1px; }
.lg-badge { width: 15px; height: 15px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lg-corridor { width: 14px; height: 10px; border-radius: 3px; background: rgba(2, 132, 199, 0.25); border: 1.5px dashed #0284c7; display: inline-block; flex-shrink: 0; }

/* Sidebar Backdrop (Mobile) & Mode Badge & Full-Width Segmented */
.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
}
.segmented-full { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.segmented-full .seg-btn { text-align: center; padding: 4px 6px; font-size: 11.5px; }
.telemetry-mode { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(5, 150, 105, 0.14);
  color: var(--success);
}
.mode-pill.static { background: var(--surface); color: var(--text-faint); border: 1px solid var(--border); }

/* Drawer Resize Handle & Pagination */
.drawer-resize-handle {
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}
.drawer-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  width: 42px;
  height: 3px;
  border-radius: 99px;
  background: var(--border-strong);
}
.table-drawer.collapsed .drawer-resize-handle { display: none; }
.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* Merged Day/Night Variant Card & Special Notices */
.variant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.variant-item {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  font-size: 11.5px;
  line-height: 1.4;
}
.variant-item:first-of-type { border-top: none; padding-top: 0; }
.special-notices-box { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.sn-group-title { font-weight: 700; font-size: 11.5px; color: var(--text); margin-bottom: 3px; }
.drop-overlay {
  outline: 3px dashed var(--accent);
  outline-offset: -8px;
}

/* Bottom-Left HUD */
.map-hud-bl {
  position: absolute;
  bottom: 52px;
  left: 12px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: bottom 0.2s ease;
}
.hud-chip {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

/* Custom Markers & Clusters */
.ll-marker-icon, .lnm-marker-icon, .msi-marker-icon { background: transparent; border: none; }
.nautical-svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45)); }
.aton-alert-ring { animation: alertPulse 1.6s ease-out infinite; transform-origin: center; }
@keyframes alertPulse {
  0% { opacity: 1; stroke-width: 2.6; }
  70% { opacity: 0.25; stroke-width: 4; }
  100% { opacity: 1; stroke-width: 2.6; }
}

.custom-cluster-wrapper { background: transparent; border: none; }
.custom-cluster {
  border-radius: 50%;
  background: var(--cluster-color, #0284c7);
  color: #ffffff;
  font-weight: 700;
  font-size: 11.5px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.measure-leg-label { background: transparent; border: none; }
.measure-leg-label span {
  display: inline-block;
  background: rgba(15, 23, 42, 0.88);
  color: #fde68a;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

/* Right Detail Inspector */
.inspector {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 56px;
  width: 370px;
  max-width: calc(100% - 24px);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.inspector-header-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inspector-title { font-size: 14.5px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.pill-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
}
.pill-subtle {
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.copy-pill {
  cursor: pointer;
  font-family: var(--font-mono);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.copy-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.copy-pill.copied {
  border-color: var(--success);
  color: var(--success);
}
.copy-icon-slot {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.12s, color 0.12s;
}
.copy-pill:hover .copy-icon-slot,
.copy-row:hover .copy-icon-slot {
  opacity: 1;
  color: var(--accent);
}
.copy-pill.copied .copy-icon-slot,
.copy-row.copied .copy-icon-slot {
  opacity: 1;
  color: var(--success);
}
.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% + 10px);
  margin: 2px -5px 0;
  padding: 2px 5px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.copy-row:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
.copy-row.copied {
  border-color: var(--success);
  color: var(--success);
}
.copy-row-text { min-width: 0; word-break: break-word; }

.inspector-overlap-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  max-height: 168px;
  overflow-y: auto;
  flex-shrink: 0;
}
.overlap-heading {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}
.overlap-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.overlap-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.overlap-tab:hover { border-color: var(--border-strong); color: var(--text); }
.overlap-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.overlap-tab-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlap-tab-sub {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--text-faint);
}
.overlap-tab.active .overlap-tab-sub { color: var(--accent); }

.inspector-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.alert-banner {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.4;
}
.alert-banner.temp { background: rgba(168, 85, 247, 0.12); border-color: #a855f7; }
.alert-banner-title { font-weight: 700; color: var(--danger); margin-bottom: 3px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.alert-banner.temp .alert-banner-title { color: #9333ea; }

.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv-box { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
.kv-box.full { grid-column: 1 / -1; }
.kv-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 700; }
.kv-val { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--text); word-break: break-word; }

.desc-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }

/* NWS Forecast Card */
.fc-period { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; background: var(--surface); }
.fc-period-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 12.5px; margin-bottom: 4px; }
.fc-wind { font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
.fc-detail { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* Bottom Table Drawer */
.table-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 330px;
  max-height: 75vh;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.12);
  z-index: 980;
  display: flex;
  flex-direction: column;
  transition: height 0.15s ease;
}
.table-drawer.resizing { transition: none; user-select: none; }
.table-drawer.collapsed { height: 40px; }
.table-drawer.collapsed .table-bounds-bar,
.table-drawer.collapsed .table-scroll { display: none; }
.table-drawer.collapsed .chevron { transform: rotate(0deg); }
.table-drawer:not(.collapsed) .chevron { transform: rotate(180deg); }

.table-drawer-bar {
  height: 40px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}
.table-drawer-bar::-webkit-scrollbar { display: none; }
.drawer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.drawer-toggle-btn:hover { background: var(--surface-muted); }
.drawer-toggle-btn .chevron { transition: transform 0.2s; }

.drawer-tabs { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.dtab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.dtab:hover { background: var(--surface-muted); color: var(--text); }
.dtab.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(2, 132, 199, 0.25); }
.tab-badge { font-family: var(--font-mono); font-size: 10.5px; background: var(--surface); color: var(--text-muted); padding: 1px 5px; border-radius: 99px; border: 1px solid var(--border); }
.dtab.active .tab-badge { color: var(--accent); border-color: var(--accent); }

.drawer-controls { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.inline-check { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.table-filter {
  height: 26px;
  width: 120px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 11.5px;
}

.table-bounds-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.bounds-bar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.table-scroll { flex: 1; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  padding: 7px 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  z-index: 2;
}
.data-table thead th:hover { color: var(--text); }
.data-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--accent-soft); }
.data-table tbody tr.row-alert { background: var(--danger-soft); }
.data-table tbody td { padding: 6px 10px; vertical-align: top; }
.cell-nowrap { white-space: nowrap; }
.cell-truncate { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-row td { text-align: center; padding: 28px; color: var(--text-faint); cursor: default; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-wide { max-width: 660px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-muted); }

.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-field input[type="text"], .form-field select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-stack { display: flex; flex-direction: column; gap: 7px; }
.check-stack label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }

.resources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.resources-grid h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.link-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.link-list a { color: var(--accent); text-decoration: none; font-weight: 500; }
.link-list a:hover { text-decoration: underline; }
.about-box { margin-top: 14px; padding: 10px; background: var(--surface-muted); border-radius: 8px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); }
.about-box p { margin: 5px 0 0; }

/* Real-Timing Nautical Light Simulator (Inspector) */
.light-sim {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.light-sim.unavailable {
  gap: 3px;
  padding: 8px 10px;
}
.light-sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.light-sim-src {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.light-sim-warn {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
}
.light-sim-stage {
  position: relative;
  height: 82px;
  border-radius: 8px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 62%, #0e1d36 0%, #060d1c 62%, #030712 100%);
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ls-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 63%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.25) 30%, rgba(148, 163, 184, 0.35) 50%, rgba(148, 163, 184, 0.25) 70%, transparent 100%);
}
.ls-beam {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  top: calc(46% - 48px);
  left: calc(50% - 48px);
  opacity: 0;
  pointer-events: none;
}
.ls-core {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  top: calc(46% - 7px);
  left: calc(50% - 7px);
  background: #334155;
  opacity: 0.35;
}
.ls-reflect {
  position: absolute;
  width: 56px;
  height: 12px;
  border-radius: 50%;
  top: 67%;
  left: calc(50% - 28px);
  opacity: 0;
  pointer-events: none;
}
.ls-phase {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.72);
  padding: 2px 6px;
  border-radius: 5px;
}
.ls-phase.is-on { color: #f8fafc; }
.ls-pause-btn {
  position: absolute;
  right: 7px;
  top: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.ls-pause-btn:hover { border-color: #38bdf8; color: #38bdf8; }
.ls-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ls-timeline {
  position: relative;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  background: #1e293b;
  border: 1px solid var(--border-strong);
}
.ls-seg { display: block; height: 100%; }
.ls-track {
  position: relative;
  height: 8px;
}
.ls-playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid var(--text);
  transform: translateX(-5px);
  pointer-events: none;
}
.light-sim-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}
.ls-period { color: var(--text-faint); }

/* IALA-B Color Swatch, Dayboards, Range, Seasonal, Paired Range & Polar Sector Diagram */
.iala-val {
  display: flex;
  align-items: center;
  gap: 6px;
}
.iala-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.pos-diff-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.pos-diff-badge {
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.pos-diff-badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.32);
}
.pos-diff-badge.ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.eye-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
}
.eye-select {
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.range-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.range-metrics > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.range-k {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-family: var(--font-sans);
}
.range-metrics strong { font-size: 12px; color: var(--text); }
.range-note { margin-top: 6px; }
.range-limit-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}
.range-limit-pill.horizon {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(217, 119, 6, 0.35);
}
.range-limit-pill.nominal {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(2, 132, 199, 0.28);
}
.range-limit-pill.matched {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
  border: 1px solid rgba(5, 150, 105, 0.28);
}

.dayboard-list {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dayboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dayboard-art {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}
.dayboard-svg { display: block; }
.dayboard-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
.dayboard-desc {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-muted);
}

.seasonal-card {
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.seasonal-card.tone-warn { background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.45); }
.seasonal-card.tone-ok { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.35); }
.seasonal-card.tone-ice { background: var(--accent-soft); border-color: rgba(2, 132, 199, 0.35); }
.seasonal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.seasonal-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  color: #ffffff;
  background: var(--text-faint);
}
.seasonal-badge.tone-ok { background: var(--success); }
.seasonal-badge.tone-warn { background: var(--warn); }
.seasonal-badge.tone-ice { background: var(--accent); }
.seasonal-lines {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text);
}

.range-pair-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.range-pair-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.range-pair-brg { font-size: 12px; font-weight: 700; color: var(--accent); }
.range-pair-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.range-pair-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.range-pair-role { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); font-weight: 700; }
.range-pair-name { font-size: 12px; font-weight: 600; margin-top: 1px; }
.range-pair-arrow { font-size: 15px; font-weight: 700; color: var(--accent); flex-shrink: 0; }

.sector-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sector-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sector-svg {
  display: block;
  border-radius: 10px;
  background: #060d1c;
  border: 1px solid #1e293b;
}
.sector-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sector-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sector-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.sector-tag.tone-high {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.4);
}
.sector-tag.tone-night {
  background: rgba(99, 102, 241, 0.14);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.35);
}
.sector-tag.tone-warn {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
}
.sector-legend-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.sector-legend-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.sector-legend-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding-left: 17px;
}
.sec-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.sec-chip.high {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.4);
}
.sec-chip.day {
  background: rgba(234, 179, 8, 0.16);
  color: #b45309;
  border-color: rgba(234, 179, 8, 0.4);
}
html[data-theme="dark"] .sec-chip.day { color: #fde047; }
.sec-chip.night {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.38);
}
html[data-theme="dark"] .sec-chip.night { color: #a5b4fc; }
.sec-chip.obs {
  background: var(--surface-muted);
  color: var(--text-faint);
  border-style: dashed;
}
.sector-info-text {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.3;
}
.sector-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  flex-shrink: 0;
}
.sector-name { font-weight: 600; color: var(--text); flex: 1; }
.sector-arc { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.sector-caption {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.35;
}

/* Toast */
.toast {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 3500;
  background: #0f172a;
  color: #f8fafc;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Leaflet tweaks */
.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-bottom.leaflet-left { bottom: 44px; }
.leaflet-bottom.leaflet-right { bottom: 44px; }

/* Responsive */
@media (max-width: 1280px) {
  .brand-sub, .btn-label { display: none; }
  .tool-btn { padding: 0 9px; }
  .harbor-select { max-width: 125px; }
}
@media (max-width: 960px) {
  .harbor-select { display: none; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; box-shadow: var(--shadow-md); }
  .drawer-controls .table-filter { width: 95px; }
  .resources-grid, .form-row-2 { grid-template-columns: 1fr; }
}

/* Dedicated Clean Print Layout */
@media print {
  @page { size: portrait; margin: 0.45in; }
  html, body { height: auto !important; overflow: visible !important; background: #ffffff !important; color: #000000 !important; font-size: 9.5pt !important; }
  .no-print, #app { display: none !important; }
  .print-only { display: block !important; }

  .print-doc { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #111827; }
  .print-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #0f172a; padding-bottom: 8px; margin-bottom: 14px; gap: 16px; }
  .print-header h1 { margin: 0 0 4px; font-size: 16pt; }
  .print-meta { font-size: 9pt; color: #374151; }
  .print-bounds { font-family: monospace; font-size: 8.5pt; color: #1f2937; margin-top: 3px; }
  .print-disclaimer { font-size: 7.5pt; color: #4b5563; text-align: right; max-width: 240px; }

  .print-section { margin-bottom: 18px; }
  .print-section h2 { font-size: 12pt; background: #0f172a; color: #ffffff; padding: 5px 8px; margin: 0 0 8px; page-break-after: avoid; }
  .print-section h3 { font-size: 10pt; margin: 10px 0 4px; border-bottom: 1px solid #9ca3af; padding-bottom: 2px; page-break-after: avoid; }

  .print-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 8.5pt; }
  .print-table th, .print-table td { border: 1px solid #cbd5e1; padding: 4px 5px; text-align: left; vertical-align: top; }
  .print-table thead th { background: #f1f5f9; font-weight: 700; }
  .print-table tr { page-break-inside: avoid; }
  .print-table .has-alert-row { background: #fef2f2; }
  .print-alert { color: #b91c1c; margin-bottom: 3px; }
  .print-table .muted { color: #4b5563; font-size: 7.5pt; }
  .print-table .desc-cell { white-space: pre-wrap; }
}
