/* css/app.css — layout grid + all component styling.
   Philosophy: "looks like hardware" — 1px lines, 4px radius, no card shadows,
   glass only on panels that float over the map. */

/* ============================== LOGIN ================================= */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #0d1c30 0%, #060b14 80%);
}
.login-screen[hidden] { display: none; }
.login-map-dim {
  position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 38px, var(--line-soft) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 38px, var(--line-soft) 38px 39px);
}
.login-card {
  position: relative; z-index: 1; width: 380px; padding: 40px 36px;
  background: rgba(15, 26, 46, .85); border: 1px solid var(--line); border-radius: 6px;
  text-align: center; backdrop-filter: blur(6px);
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.login-lockup { width: 300px; max-width: 100%; height: auto; margin-bottom: 22px; }
.login-title { font-family: var(--font-display); font-size: 30px; letter-spacing: 4px; margin: 0; color: var(--text-0); }
.login-field { text-align: left; margin-bottom: 18px; }
.login-field label { display: block; font-size: 11px; color: var(--text-1); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.login-field input {
  width: 100%; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-0); font-family: var(--font-mono); font-size: 13px; border-radius: var(--radius);
}
.btn-primary {
  width: 100%; padding: 12px; background: var(--c-cyan); color: #001018; border: none;
  font-family: var(--font-ui); font-weight: 600; font-size: 13px; letter-spacing: .5px;
  border-radius: var(--radius); cursor: pointer; transition: filter var(--dur-fast);
}
.btn-primary:hover { filter: brightness(1.1); }
.login-note { margin-top: 20px; font-size: 11px; color: var(--text-1); }
.login-note b { color: var(--c-warning); letter-spacing: 1px; }

/* ============================== APP SHELL ============================== */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg-0); }
.app[hidden] { display: none; }
.body { flex: 1; display: flex; min-height: 0; }

/* ---- header ------------------------------------------------------------ */
.header {
  height: var(--header-h); flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--bg-1); border-bottom: 1px solid var(--line); gap: 16px;
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; flex-direction: row; align-items: center; gap: 12px; line-height: 1.15; }
/* Logo concept A: the mark IS the "O" of OTOLITH, immediately followed by
   the "TOLITH" wordmark — same cap height, no gap (aneks — polish pass). */
.brand-name { display: flex; align-items: baseline; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .06em; color: var(--text-0); }
/* mark sized to the wordmark's cap height, not an arbitrary pixel box
   (owner review 12.09, item 5 — "O" was reading small vs "TOLITH"). */
.brand-name .logo-mark { height: .74em; width: auto; flex: 0 0 auto; margin-right: .05em; margin-bottom: -.04em; display: inline-block; vertical-align: baseline; }
.brand-tag { font-size: 10px; color: var(--text-1); letter-spacing: 1.2px; padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.3; max-width: 230px; }

.header-center { display: flex; align-items: center; gap: 18px; flex: 1; justify-content: center; min-width: 0; overflow: hidden; }
.sector-select {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-0); font-family: var(--font-mono);
  font-size: 11px; padding: 6px 8px; border-radius: var(--radius); letter-spacing: .5px;
}
.subsystems { display: flex; gap: 14px; font-size: 11px; color: var(--text-1); flex-shrink: 0; }
.subsys { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); }
.subsys b { color: var(--text-0); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--c-ok); }
.dot.warning { background: var(--c-warning); }
.dot.alarm { background: var(--c-alarm); }
.dot.lost { background: var(--c-lost); }
.dot.pulse { animation: pulseDot 2s ease-in-out infinite; }
.dot.pulse.warning { animation-duration: 1s; }
.dot.pulse.alarm { animation-duration: .5s; }

.header-right { display: flex; align-items: center; gap: 12px; }
.clock-block { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); }
.clock-utc { font-size: 15px; font-weight: 700; color: var(--c-cyan); }
.clock-label { font-size: 9px; color: var(--text-2); }
.clock-local { font-size: 12px; color: var(--text-1); }

.speed-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.speed-switch button {
  background: transparent; border: none; color: var(--text-1); font-family: var(--font-mono); font-size: 11px;
  padding: 6px 9px; cursor: pointer; border-right: 1px solid var(--line);
}
.speed-switch button:last-child { border-right: none; }
.speed-switch button.active { background: var(--c-cyan); color: #001018; font-weight: 700; }

.icon-btn {
  position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--text-1); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { color: var(--text-0); border-color: var(--line); }
.icon-btn[aria-pressed="true"] { color: var(--c-cyan); border-color: var(--c-cyan); }
.icon-btn .icon { width: 17px; height: 17px; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--c-alarm); color: #fff; font-size: 9px; font-family: var(--font-mono); font-weight: 700;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.badge[hidden] { display: none; }
.badge.pulse { animation: pulseDot 1.4s ease-in-out infinite; }

/* ---- full-width ALARM toast (item 1d) ----------------------------------- */
.alarm-toast {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 18px; background: var(--c-alarm); color: #1a0006; font-family: var(--font-ui);
  font-weight: 700; font-size: 12.5px; letter-spacing: .3px;
}
.alarm-toast[hidden] { display: none; }
.alarm-toast-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alarm-toast-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.alarm-toast-actions button {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px; padding: 6px 12px; border-radius: 3px;
  cursor: pointer; border: 1px solid #1a0006; background: transparent; color: #1a0006;
}
.alarm-toast-actions button:hover { background: rgba(26,0,6,.15); }
.alarm-toast-actions button.toast-open { background: #1a0006; color: var(--c-alarm); }

.operator-chip { position: relative; }
.op-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: 16px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text-0); }
.op-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--c-cyan); color: #001018; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.op-name { font-size: 11px; font-family: var(--font-mono); white-space: nowrap; }
.op-menu {
  position: absolute; right: 0; top: 40px; width: 230px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.op-menu-label { font-size: 10px; color: var(--text-1); text-transform: uppercase; letter-spacing: 1px; padding: 4px 6px; }
.op-menu-item { display: block; width: 100%; text-align: left; background: transparent; border: none; color: var(--text-0); padding: 8px 6px; font-size: 12px; cursor: pointer; border-radius: var(--radius); font-family: var(--font-mono); }
.op-menu-item:hover { background: var(--bg-1); }
.op-logout { display: block; width: 100%; text-align: center; margin-top: 6px; padding: 8px; background: transparent; border: 1px solid var(--c-alarm); color: var(--c-alarm); border-radius: var(--radius); cursor: pointer; font-size: 11px; }

/* ============================== RAIL ==================================== */
.rail {
  width: var(--rail-w); flex: 0 0 auto; background: var(--bg-1); border-right: 1px solid var(--line);
  position: relative; overflow: hidden; transition: width var(--dur-med);
}
.rail.collapsed { width: 14px; }
.rail.collapsed .rail-inner { display: none; }
.rail-inner { height: 100%; overflow-y: auto; padding: 12px 14px 24px; }
.collapse-btn {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; z-index: 2;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); cursor: pointer; border-radius: 3px; font-size: 11px; line-height: 1;
}
.rail.collapsed .collapse-btn { right: -2px; transform: rotate(180deg); }

.rail-section { margin-bottom: 20px; }
.rail-section h2 { font-family: var(--font-ui); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-1); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
/* station "card" title row + Kalibracja entry point (item 4b) */
.sensor-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sensor-title-row h2 { margin: 0; padding: 0; border: 0; }
.calib-open-btn { flex: 0 0 auto; background: transparent; border: 1px solid var(--line); color: var(--text-1); font-size: 9.5px; letter-spacing: .5px; padding: 4px 7px; border-radius: 3px; cursor: pointer; white-space: nowrap; }
.calib-open-btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); }

.station-list { list-style: none; margin: 0; padding: 0; }
.station-row { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: var(--radius); cursor: pointer; font-size: 11.5px; }
.station-row:hover { background: var(--bg-2); }
.station-row.selected { background: var(--bg-2); outline: 1px solid var(--c-cyan); }
.station-row .dot { flex: 0 0 auto; }
.station-row .st-name { font-family: var(--font-mono); font-weight: 700; flex: 0 0 86px; width: 86px; white-space: nowrap; }
.station-row .st-meta { color: var(--text-1); font-size: 10px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sensor-block { margin-bottom: 10px; }
.sensor-label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-1); margin-bottom: 3px; }
.sensor-label b { color: var(--c-cyan); font-family: var(--font-mono); font-size: 12px; }
.sensor-block canvas { width: 100%; display: block; background: var(--bg-0); border: 1px solid var(--line); border-radius: 3px; }
.sensor-row { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.sensor-corr { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--text-1); }
.sensor-corr b { display: block; color: var(--c-cyan); font-family: var(--font-mono); font-size: 13px; }
.sensor-transients { font-size: 10.5px; color: var(--text-1); }
.sensor-transients[hidden] { display: none; }
.sensor-transients b { display: block; font-family: var(--font-mono); color: var(--text-0); font-size: 15px; }

.water-numbers { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.water-numbers > div { flex: 1; min-width: 54px; font-size: 10px; color: var(--text-1); }
.water-numbers > div[hidden] { display: none; }
.water-numbers b { display: block; font-family: var(--font-mono); color: var(--text-0); font-size: 12.5px; }
.water-numbers i { font-style: normal; }
.trend { font-size: 10px; }
.trend.up { color: var(--c-warning); }
.trend.down { color: var(--c-cyan); }
.trend.flat { color: var(--text-2); }

.layer-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 2px; cursor: pointer; color: var(--text-0); }
.layer-toggle input { accent-color: var(--c-cyan); }

.legend-grid { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; font-size: 10.5px; color: var(--text-1); }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.legend-swatch.round { border-radius: 50%; }

/* ============================== MAP ===================================== */
.map-wrap { flex: 1; position: relative; min-width: 0; background: #04070c; }
#map { position: absolute; inset: 0; }
.leaflet-container { background: #04070c; font-family: var(--font-ui); }
.leaflet-control-attribution { background: rgba(6,10,16,.7) !important; color: var(--text-2) !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: var(--text-1) !important; }
.leaflet-control-layers {
  background: var(--bg-1) !important; border: 1px solid var(--line) !important; color: var(--text-0) !important;
  border-radius: var(--radius) !important; font-size: 11px !important;
}
.leaflet-control-layers-toggle { filter: invert(1) hue-rotate(180deg); }
.leaflet-bar a { background: var(--bg-1) !important; color: var(--text-0) !important; border-bottom: 1px solid var(--line) !important; }
.leaflet-bar a:hover { background: var(--bg-2) !important; }

.map-statusbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px; display: flex; align-items: center; gap: 16px;
  padding: 0 12px; background: rgba(11, 18, 32, .82); backdrop-filter: blur(4px); border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-1); z-index: 1200;
}
.map-statusbar .sim-badge { margin-left: auto; color: var(--c-warning); letter-spacing: 1px; font-weight: 700; }
.map-statusbar > * { white-space: nowrap; }
@media (max-width: 1450px) { .map-statusbar { gap: 10px; } .map-statusbar #status-scale { display: none; } }
@media (max-width: 1250px) { .map-statusbar #status-latlon { display: none; } }
.history-btn { background: transparent; border: 1px solid var(--line); color: var(--text-1); font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: 3px; cursor: pointer; }
.history-btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); }

.live-indicator {
  position: absolute; top: 90px; left: 12px; z-index: 1200; display: flex; align-items: center; gap: 6px;
  background: rgba(11,18,32,.82); border: 1px solid var(--line); padding: 5px 10px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--c-ok);
}
.app.replay-mode .live-indicator { display: none; }

.replay-banner {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1201; display: flex; align-items: center; gap: 10px;
  justify-content: center; padding: 7px; background: #3a2400; border-bottom: 1px solid var(--c-warning);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--c-warning); letter-spacing: 1px;
}
.replay-banner[hidden] { display: none; }
.replay-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-warning); animation: pulseDot 1s infinite; }
.replay-exit-x { margin-left: 12px; background: transparent; border: 1px solid var(--c-warning); color: var(--c-warning); border-radius: 3px; padding: 3px 8px; font-size: 10px; cursor: pointer; }

.replay-bar {
  position: absolute; left: 12px; right: 12px; bottom: 34px; z-index: 1201; display: flex; flex-direction: column; gap: 4px;
  background: rgba(15,26,46,.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; backdrop-filter: blur(6px);
}
.replay-bar[hidden] { display: none; }
.replay-markers { position: relative; height: 10px; margin: 0 13px; }
.replay-marker { position: absolute; top: 0; width: 3px; height: 10px; border-radius: 1px; cursor: pointer; transform: translateX(-1.5px); }
.replay-controls { display: flex; align-items: center; gap: 10px; }
.replay-play { width: 26px; height: 26px; background: var(--c-cyan); color: #001018; border: none; border-radius: 50%; cursor: pointer; font-size: 11px; flex: 0 0 auto; }
.replay-controls input[type="range"] { flex: 1; accent-color: var(--c-cyan); }
.replay-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-1); width: 46px; flex: 0 0 auto; }
.replay-time-input { width: 70px; flex: 0 0 auto; background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0); font-family: var(--font-mono); font-size: 11px; padding: 4px 6px; border-radius: 3px; }
.replay-speed { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.replay-speed button { background: transparent; border: none; color: var(--text-1); font-family: var(--font-mono); font-size: 10px; padding: 4px 7px; cursor: pointer; }
.replay-speed button.active { background: var(--c-warning); color: #1a1200; font-weight: 700; }
.btn-ghost { background: transparent; border: 1px solid var(--c-cyan); color: var(--c-cyan); border-radius: 3px; padding: 5px 10px; font-size: 11px; cursor: pointer; }

.demo-btn {
  position: absolute; right: 12px; bottom: 34px; z-index: 1200; background: rgba(15,26,46,.9); border: 1px solid var(--line);
  color: var(--text-1); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; padding: 7px 12px; border-radius: 3px; cursor: pointer;
}
.demo-btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); }
.demo-menu {
  position: absolute; right: 12px; bottom: 68px; z-index: 1201; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; min-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.demo-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--text-0); padding: 10px 12px; font-size: 11.5px; cursor: pointer; }
.demo-menu button:last-child { border-bottom: none; }
.demo-menu button:hover { background: var(--bg-1); color: var(--c-cyan); }

/* app.map-fullscreen: collapse side panels */
.app.map-fullscreen .rail, .app.map-fullscreen .panel-right, .app.map-fullscreen .dock { display: none; }

/* ---- Leaflet vessel / station markers ----------------------------------- */
.vessel-icon-wrap { display: flex; align-items: center; justify-content: center; pointer-events: none; }
.vessel-icon { transition: transform 200ms linear; filter: drop-shadow(0 0 2px rgba(0,0,0,.7)); }
.vessel-icon.stale { opacity: .4; }
.vessel-label {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-0); background: rgba(6,10,16,.75);
  padding: 1px 4px; border-radius: 2px; white-space: nowrap; pointer-events: none;
}
.vessel-stale-tag { font-family: var(--font-mono); font-size: 8.5px; color: var(--c-warning); background: rgba(6,10,16,.85); padding: 1px 3px; border-radius: 2px; }

.station-icon { position: relative; display: flex; align-items: center; justify-content: center; }
.station-core { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #04070c; z-index: 2; }
.station-core.ok { background: var(--c-ok); }
.station-core.warning { background: var(--c-warning); }
.station-core.alarm { background: var(--c-alarm); }
.station-core.lost { background: var(--c-lost); }
.station-pulse-ring {
  position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c-alarm); opacity: 0;
  animation: pulseRing 1.6s ease-out infinite;
}
.station-pulse-ring.r2 { animation-delay: .8s; }
.station-pulse-ring.warning { border-color: var(--c-warning); }

/* ---- hazard site overview markers (aneks §2) ---------------------------- */
.site-icon { position: relative; display: flex; flex-direction: column; align-items: center; }
.site-core { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #04070c; cursor: pointer; }
.site-core.ok { background: var(--c-ok); }
.site-core.warning { background: var(--c-warning); }
.site-core.alarm { background: var(--c-alarm); }
.site-core.lost { background: var(--c-lost); }
.site-label {
  margin-top: 2px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--text-0);
  background: rgba(6,10,16,.78); padding: 1px 6px; border-radius: 2px; white-space: nowrap; pointer-events: none;
}

/* ---- Model skutków impact-plume legend ---------------------------------- */
.impact-legend {
  /* below the Leaflet zoom control AND the LIVE indicator (both anchored
     top-left) — was overlapping "+/-" before this fix. */
  position: absolute; left: 12px; top: 132px; z-index: 1200; background: rgba(15,26,46,.92);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; font-family: var(--font-mono);
  font-size: 10px; color: var(--text-1); backdrop-filter: blur(4px);
}
.impact-legend[hidden] { display: none; }
.impact-legend-title { color: var(--text-0); font-weight: 700; margin-bottom: 4px; letter-spacing: .5px; }
.impact-legend-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.impact-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.impact-legend-note { margin-top: 4px; color: var(--text-2); font-size: 9px; max-width: 160px; }

.sonar-sweep-wrap { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 50%; }
.sonar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0,212,255,.28), transparent 35%);
  animation: sonarSweep 4s linear infinite; opacity: .8;
}

.correlation-line-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--c-alarm); background: rgba(6,10,16,.85);
  padding: 1px 5px; border-radius: 2px; font-weight: 700;
}

.patrol-icon { filter: drop-shadow(0 0 4px rgba(179,104,255,.9)); }

/* ---- temporary archive-incident marker (item 2) ------------------------- */
.incident-pin { position: relative; display: flex; flex-direction: column; align-items: center; }
.incident-pin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-warning); border: 2px solid #04070c; box-shadow: 0 0 0 3px rgba(255,214,0,.3); }
.incident-pin-label {
  margin-top: 3px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; color: #04070c;
  background: var(--c-warning); padding: 1px 6px; border-radius: 2px; white-space: nowrap; pointer-events: none;
}

/* ============================== PANEL RIGHT ============================= */
.panel-right {
  width: var(--panel-w); flex: 0 0 auto; background: rgba(15,26,46,.92); backdrop-filter: blur(6px);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.panel-tab { flex: 1; background: transparent; border: none; color: var(--text-1); padding: 10px; font-size: 11px; letter-spacing: 1px; cursor: pointer; font-family: var(--font-ui); font-weight: 600; }
.panel-tab.active { color: var(--c-cyan); box-shadow: inset 0 -2px 0 var(--c-cyan); }
.panel-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-view[hidden] { display: none; }

.alerts-header { padding: 12px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.alerts-counts { display: flex; gap: 8px; margin-bottom: 10px; }
.count-chip { flex: 1; text-align: center; padding: 6px 4px; border-radius: var(--radius); font-size: 9.5px; letter-spacing: .5px; color: var(--text-1); background: var(--bg-2); border: 1px solid var(--line); }
.count-chip b { display: block; font-family: var(--font-mono); font-size: 16px; color: var(--text-0); }
.count-chip.alarm b { color: var(--c-alarm); }
.count-chip.warning b { color: var(--c-warning); }
.count-chip.info b { color: var(--c-info); }
.count-chip.nowe b { color: var(--c-cyan); }
/* Status filter + type dropdown share one row (polish round 2 — type chips
   used to take ~5 rows and push the alert list below the fold). */
.filter-row { display: flex; gap: 6px; align-items: center; }
.alerts-filter { display: flex; gap: 4px; flex: 1; min-width: 0; }
.alerts-filter button { flex: 1; background: transparent; border: 1px solid var(--line); color: var(--text-1); font-size: 10px; padding: 5px 4px; border-radius: 3px; cursor: pointer; }
.alerts-filter button.active { background: var(--c-cyan); border-color: var(--c-cyan); color: #001018; font-weight: 700; }

.type-select-wrap { position: relative; flex: 0 0 auto; }
.type-select-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text-1); font-size: 10px;
  padding: 5px 8px; border-radius: 3px; cursor: pointer; white-space: nowrap;
}
.type-select-btn:hover { color: var(--c-cyan); border-color: var(--c-cyan); }
.type-select-btn.has-filter { color: var(--c-cyan); border-color: var(--c-cyan); }
/* the chip list becomes a floating popover, closed by default — never the
   ~5-row wall of chips that used to sit inline under the status filter. */
.type-select-wrap .type-filter {
  position: absolute; top: 32px; right: 0; z-index: 30; width: 280px; max-height: 320px;
  overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.type-select-wrap .type-filter[hidden] { display: none; }

/* sticky "N NOWYCH ALERTÓW" banner (item 1c) — sits above the scrollable
   list as a normal flex child, so no position:sticky plumbing is needed. */
.nowy-banner {
  flex: 0 0 auto; margin: 4px 4px 0; padding: 7px 10px; border-radius: 3px; cursor: pointer;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: .4px;
  text-align: center; color: #04070c;
}
.nowy-banner[hidden] { display: none; }

.alert-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; }
.alert-row {
  position: relative; padding: 9px 10px 9px 12px; margin-bottom: 3px; border-radius: 3px; cursor: pointer;
  border-left: 4px solid var(--sev-color, var(--text-2)); background: var(--bg-2);
}
.alert-row:hover { background: #1a2c4a; }
.alert-row.selected { outline: 1px solid var(--c-cyan); }
.alert-row.new { animation: slideIn var(--dur-med) ease-out; }
.alert-row.new::after { content: ''; position: absolute; inset: 0; border-radius: 3px; border: 1px solid var(--sev-color); animation: softBlink 1.2s ease-in-out 2; pointer-events: none; }
/* unopened (NOWY) alert must "hit the eyes" — filled severity tint, thinner
   3px bar, bold title, slow breathing pulse until it's opened (item 1a). */
.alert-row.status-NOWY { border-left-width: 3px; font-weight: 700; animation: breathePulse 2.6s ease-in-out infinite; }
.alert-row.status-NOWY .alert-row-title { font-weight: 700; }
.alert-row.status-NOWY[data-severity="ALARM"] { background: rgba(255, 61, 90, .18); }
.alert-row.status-NOWY[data-severity="WARNING"] { background: rgba(255, 214, 0, .14); }
.alert-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.alert-row-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-1); }
.alert-row-title { font-size: 12px; line-height: 1.3; }
.alert-row-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: 10px; color: var(--text-1); }
.status-chip { padding: 2px 7px; border-radius: 8px; font-size: 9px; letter-spacing: .5px; font-family: var(--font-mono); border: 1px solid var(--chip-color, var(--text-2)); color: var(--chip-color, var(--text-2)); }
/* NOWY chip becomes a solid filled badge in the severity colour, not just an
   outline (item 1b) — background/color set inline per-row from severity. */
.status-chip.nowy-badge { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px; border: none; padding: 2px 8px; }
.alert-row.status-ZIGNOROWANY { opacity: .55; }
.alert-row.status-ZARCHIWIZOWANY { opacity: .7; }
.alert-empty { padding: 30px 10px; text-align: center; color: var(--text-2); font-size: 12px; }
.sensor-badge { font-size: 8.5px; color: var(--c-ok); border: 1px solid var(--c-ok); border-radius: 8px; padding: 1px 5px; letter-spacing: .5px; }

.panel-right.flash-alarm { animation: glowAlarm 2s ease-in-out; }
.panel-right.flash-warning { animation: flashBorder .8s ease-out; --flash-color: var(--c-warning); }
.alert-type-label { display: flex; align-items: center; gap: 5px; font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-1); margin-top: 2px; }
.alert-type-label svg { width: 12px; height: 12px; flex: 0 0 auto; color: var(--sev-color, var(--text-1)); }
.type-filter { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 14px 0; }
.type-filter button { display: flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); font-size: 9px; padding: 4px 7px; border-radius: 10px; cursor: pointer; }
.type-filter button svg { width: 11px; height: 11px; }
.type-filter button.active { background: var(--c-cyan); border-color: var(--c-cyan); color: #001018; }
.type-filter button.active svg { color: #001018; }

/* ---- drawer -------------------------------------------------------------- */
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 0; }
.drawer-back { background: transparent; border: none; color: var(--text-1); font-size: 11px; cursor: pointer; }
.drawer-back:hover { color: var(--c-cyan); }
.drawer-severity-chip { font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 3px; font-weight: 700; }
.drawer-title { font-size: 13.5px; padding: 6px 14px 10px; margin: 0; line-height: 1.35; }
.drawer-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.drawer-tabs button { background: transparent; border: none; color: var(--text-1); font-size: 10.5px; padding: 8px 8px; cursor: pointer; }
.drawer-tabs button.active { color: var(--c-cyan); box-shadow: inset 0 -2px 0 var(--c-cyan); }
.drawer-content { flex: 1; overflow-y: auto; padding: 12px 14px; font-size: 12px; }
.drawer-content .kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; }
.drawer-content .kv b { font-family: var(--font-mono); color: var(--text-0); }
.drawer-content .flag-chip { display: inline-block; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-1); font-size: 10px; padding: 3px 7px; border-radius: 10px; margin: 2px 4px 2px 0; }
.drawer-content .rule-expr { font-family: var(--font-mono); color: var(--c-cyan); background: var(--bg-0); padding: 8px; border-radius: 3px; border: 1px solid var(--line); font-size: 11px; margin: 6px 0; }
.drawer-content table { width: 100%; border-collapse: collapse; font-size: 11px; }
.drawer-content th { text-align: left; color: var(--text-1); font-weight: 500; font-size: 10px; padding: 4px; border-bottom: 1px solid var(--line); }
.drawer-content td { padding: 5px 4px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); }
.drawer-content .hist-row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.drawer-content .hist-t { font-family: var(--font-mono); color: var(--text-1); width: 56px; flex: 0 0 auto; }
.drawer-canvas { width: 100%; height: 90px; background: var(--bg-0); border: 1px solid var(--line); border-radius: 3px; margin: 6px 0 12px; }

.drawer-actions { flex: 0 0 auto; padding: 10px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-actions button { font-family: var(--font-ui); font-size: 11px; font-weight: 600; padding: 9px 10px; border-radius: 3px; cursor: pointer; border: 1px solid transparent; }
.act-ignore { flex: 1; background: transparent; border-color: var(--c-muted); color: var(--c-muted); }
.act-observe { flex: 1; background: transparent; border-color: var(--c-warning); color: var(--c-warning); }
.act-react-wrap { position: relative; flex: 1; }
.act-react { width: 100%; background: var(--c-alarm); color: #1a0006; border: none; }
.act-react-menu { position: absolute; bottom: 40px; left: 0; right: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; z-index: 20; }
.act-react-menu button { display: block; width: 100%; background: transparent; color: var(--text-0); border: none; border-bottom: 1px solid var(--line); text-align: left; padding: 9px 10px; }
.act-react-menu button:last-child { border-bottom: none; }
.act-react-menu button:hover { background: var(--bg-1); color: var(--c-alarm); }
.act-secondary { display: flex; gap: 6px; width: 100%; }
.act-archive, .act-replay { flex: 1; background: transparent; border-color: var(--line); color: var(--text-1); }
.act-note { display: flex; gap: 6px; width: 100%; }
.act-note input { flex: 1; background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0); padding: 8px; border-radius: 3px; font-size: 11px; }
.act-note button { background: var(--bg-2); border-color: var(--line); color: var(--text-1); }
.act-disabled { opacity: .35; pointer-events: none; }

/* ---- archive -------------------------------------------------------------- */
.archive-header { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.archive-header h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: 1px; color: var(--text-1); text-transform: uppercase; }
.archive-hint { margin: 0 0 8px; font-size: 10.5px; color: var(--text-1); }
.archive-strip { display: flex; gap: 2px; align-items: flex-end; height: 46px; }
.strip-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; cursor: pointer; padding: 2px 0; border-radius: 2px; }
.strip-day:hover { background: var(--bg-2); }
.strip-day.active { background: var(--bg-2); outline: 1px solid var(--c-cyan); }
.strip-day.today .strip-label { color: var(--c-cyan); font-weight: 700; }
.strip-bar { width: 100%; min-height: 2px; border-radius: 1px; }
.strip-label { font-size: 8px; color: var(--text-2); font-family: var(--font-mono); }
.archive-filters { flex: 0 0 auto; padding: 8px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.archive-search { background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0); padding: 7px 8px; border-radius: 3px; font-size: 11px; }
.archive-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.archive-filter-row select { flex: 1 1 120px; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-0); padding: 5px; border-radius: 3px; font-size: 10.5px; }
/* the type dropdown drops to its own full-width line if the two selects
   already fill the row at panel width — one extra row, never a chip wall. */
.archive-filter-row .type-select-wrap { flex: 1 1 100%; }
.archive-filter-row .type-select-btn { width: 100%; text-align: left; }
.archive-filter-row .type-filter { left: 0; right: 0; width: auto; }
.archive-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.archive-row { position: relative; background: var(--bg-2); border-left: 4px solid var(--sev-color, var(--text-2)); border-radius: 3px; padding: 9px 10px; margin-bottom: 6px; font-size: 11.5px; cursor: pointer; }
.archive-row:hover { background: #1a2c4a; }
.archive-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.archive-row-id { font-family: var(--font-mono); color: var(--text-1); font-size: 10px; }
.archive-row-play {
  flex: 0 0 auto; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--c-cyan); color: var(--c-cyan); border-radius: 3px;
  font-size: 9px; line-height: 1; cursor: pointer;
}
.archive-row-play:hover { background: var(--c-cyan); color: #001018; }
.archive-row-title { font-size: 12px; line-height: 1.3; }
.archive-row-meta { color: var(--text-1); font-size: 10.5px; margin-top: 5px; }
.archive-files { font-family: var(--font-mono); font-size: 10px; color: var(--text-1); }
.archive-files div { display: flex; justify-content: space-between; padding: 2px 0; }
.archive-verify { margin-top: 8px; width: 100%; background: transparent; border: 1px solid var(--c-ok); color: var(--c-ok); padding: 6px; border-radius: 3px; cursor: pointer; font-size: 10.5px; }
.integrity-ok { color: var(--c-ok); font-weight: 700; }
.record-card { background: var(--bg-0); border: 1px solid var(--line); border-radius: 3px; padding: 10px; margin-top: 12px; }
.record-card-id { font-family: var(--font-mono); color: var(--c-cyan); font-weight: 700; margin-bottom: 6px; }
.drawer-actions.readonly .act-ignore, .drawer-actions.readonly .act-observe, .drawer-actions.readonly .act-react-wrap,
.drawer-actions.readonly .act-archive, .drawer-actions.readonly .act-note { display: none; }

/* ---- vessel panel ---------------------------------------------------------- */
.vessel-card { padding: 14px; overflow-y: auto; }
.vessel-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.vessel-card-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.vessel-card-flag { font-size: 11px; color: var(--text-1); }
.vessel-type-chip { display: inline-block; font-size: 9.5px; padding: 2px 7px; border-radius: 8px; margin-top: 4px; font-family: var(--font-mono); }
.vessel-close { background: transparent; border: none; color: var(--text-1); font-size: 18px; cursor: pointer; line-height: 1; }
.vessel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin: 14px 0; }
.vessel-grid .kv { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.vessel-grid .kv b { font-family: var(--font-mono); }
.vessel-otolith { background: var(--bg-2); border: 1px solid var(--c-cyan); border-radius: 3px; padding: 10px; margin-bottom: 14px; }
.vessel-otolith h3 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: 1px; color: var(--c-cyan); text-transform: uppercase; }
.vessel-actions { display: flex; gap: 6px; }
.vessel-actions button { flex: 1; padding: 9px; font-size: 11px; border-radius: 3px; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--text-0); }
.vessel-actions button.primary { background: var(--c-cyan); color: #001018; border: none; font-weight: 700; }
.stale-banner { background: rgba(255,214,0,.1); border: 1px solid var(--c-warning); color: var(--c-warning); padding: 8px; border-radius: 3px; font-size: 11px; margin-bottom: 12px; }

/* ============================== DOCK ===================================== */
.dock { height: var(--dock-h); flex: 0 0 auto; background: var(--bg-1); border-top: 1px solid var(--line); display: flex; flex-direction: column; transition: height var(--dur-med); }
.dock.collapsed { height: var(--dock-collapsed-h); }
.dock.collapsed .dock-columns { display: none; }
.dock-header { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); height: 36px; }
.dock-tabs { display: flex; gap: 2px; }
.dock-tabs button { background: transparent; border: 1px solid var(--line); color: var(--text-1); font-size: 10.5px; padding: 5px 10px; border-radius: 3px; cursor: pointer; }
.dock-tabs button.active { background: var(--c-cyan); border-color: var(--c-cyan); color: #001018; font-weight: 700; }
.dock-filter { flex: 1; max-width: 260px; background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0); padding: 6px 8px; border-radius: 3px; font-size: 11px; }
.dock-date { background: var(--bg-2); border: 1px solid var(--line); color: var(--text-0); padding: 5px 6px; border-radius: 3px; font-size: 10.5px; max-width: 150px; }
.dock-tail, .dock-collapse { background: transparent; border: 1px solid var(--line); color: var(--text-1); font-size: 10.5px; padding: 5px 9px; border-radius: 3px; cursor: pointer; margin-left: auto; }
.dock-collapse { margin-left: 6px; }
.dock.collapsed .dock-collapse { transform: rotate(180deg); }

/* three-column body (item 3): logs ~50% / telemetry ~27% / alerts-24h ~23% —
   was logs-only-on-the-left with the right 60% empty (owner review 12.09). */
.dock-columns { flex: 1; display: flex; min-height: 0; }
.dock-col { min-width: 0; display: flex; flex-direction: column; }
.dock-col-logs { flex: 0 0 50%; }
.dock-col-telemetry { flex: 0 0 27%; border-left: 1px solid var(--line); padding: 6px 10px; overflow-y: auto; }
.dock-col-alerts24 { flex: 0 0 23%; border-left: 1px solid var(--line); padding: 6px 10px; overflow-y: auto; }
.dock-col-title { flex: 0 0 auto; font-family: var(--font-ui); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-1); margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }

.dock-body { flex: 1; overflow-y: auto; padding: 4px 0; }
.log-row { display: flex; gap: 10px; padding: 3px 14px; font-family: var(--font-mono); font-size: 11px; cursor: pointer; align-items: baseline; }
.log-row:hover { background: var(--bg-2); }
.log-t { color: var(--text-2); width: 68px; flex: 0 0 auto; }
.log-level { width: 42px; flex: 0 0 auto; font-weight: 700; }
.log-level.INFO { color: var(--c-info); }
.log-level.WARN { color: var(--c-warning); }
.log-level.ERR { color: var(--c-alarm); }
.log-source { width: 90px; flex: 0 0 auto; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-msg { flex: 1; color: var(--text-0); }
.log-detail { padding: 4px 14px 8px 92px; font-size: 10.5px; color: var(--text-1); background: var(--bg-0); white-space: pre-wrap; }

/* ---- telemetry table (middle column) ------------------------------------ */
.telemetry-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11px; }
.telemetry-table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 9px; text-transform: uppercase; letter-spacing: .4px; padding: 2px 5px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); }
.telemetry-table th:last-child, .telemetry-table td:last-child { border-right: none; }
/* fixed 20px rows (owner review 12.09: taller rows + the old 170px dock
   height together clipped the 5th station row) */
.telemetry-table td { height: 20px; padding: 0 5px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); color: var(--text-0); cursor: pointer; }
.telemetry-table tr:hover td { background: var(--bg-2); }
.telemetry-table .dot { width: 7px; height: 7px; }
@media (max-width: 1400px) {
  .telemetry-table .t-rssi { display: none; }
}

/* ---- alerts · ostatnie 24h (right column) -------------------------------- */
.hour-strip { display: flex; align-items: flex-end; gap: 0; height: 40px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hour-col { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; height: 100%; border-right: 1px solid var(--line-soft); }
.hour-col:last-child { border-right: none; }
.hour-col.now { background: rgba(0,212,255,.08); }
.hour-bar { width: 60%; min-height: 1px; border-radius: 1px 1px 0 0; }
/* one compact line instead of 4 stacked rows (owner review 12.09 — the
   stacked version got clipped by the dock's fixed height). */
.dock-counters-line { margin-top: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-1); line-height: 1.6; }
.dock-counters-line b { font-weight: 700; }
.dock-counters-line .cnt-alarm { color: var(--c-alarm); }
.dock-counters-line .cnt-warning { color: var(--c-warning); }
.dock-counters-line .cnt-info { color: var(--c-info); }
.dock-counters-line .cnt-sep { color: var(--text-2); padding: 0 2px; }

/* ============================== KALIBRACJA ================================ */
.calib-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(4,7,12,.65); backdrop-filter: blur(2px); }
.calib-modal[hidden] { display: none; }
.calib-panel { width: min(720px, 94vw); height: min(88vh, 780px); background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.calib-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.calib-head h2 { margin: 0; font-size: 15px; font-family: var(--font-display); font-weight: 600; }
.calib-tabs { flex: 0 0 auto; display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.calib-tabs button { background: transparent; border: none; color: var(--text-1); font-size: 11.5px; padding: 10px; cursor: pointer; font-family: var(--font-ui); font-weight: 600; }
.calib-tabs button.active { color: var(--c-cyan); box-shadow: inset 0 -2px 0 var(--c-cyan); }
.calib-content { flex: 1; overflow-y: auto; padding: 16px 18px; }
.calib-row { margin-bottom: 20px; }
.calib-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-1); margin-bottom: 6px; }
.calib-num { width: 72px; background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0); font-family: var(--font-mono); padding: 4px 6px; border-radius: 3px; }
.calib-unit { color: var(--text-2); font-size: 10.5px; }
.calib-slider-wrap { position: relative; height: 30px; }
.calib-hist { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.calib-slider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.calib-slider::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.calib-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 30px; background: var(--c-cyan); border-radius: 0; box-shadow: 0 0 4px var(--c-cyan); }
.calib-slider::-moz-range-track { background: transparent; height: 100%; border: none; }
.calib-slider::-moz-range-thumb { width: 2px; height: 30px; background: var(--c-cyan); border: none; border-radius: 0; }
.calib-preview { margin-top: 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-1); }
.calib-hw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; color: var(--text-1); }
.calib-hw-row b { font-family: var(--font-mono); color: var(--text-0); font-weight: 700; }
.calib-test { flex: 0 0 auto; min-width: 96px; background: transparent; border: 1px solid var(--c-cyan); color: var(--c-cyan); border-radius: 3px; padding: 5px 10px; font-size: 10.5px; cursor: pointer; }
.calib-test.integrity-ok { border-color: var(--c-ok); color: var(--c-ok); }
.calib-test:disabled { opacity: .7; cursor: default; }
.calib-learn-status { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--c-cyan); min-height: 14px; }
.calib-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.calib-version { font-family: var(--font-mono); color: var(--text-1); font-size: 11px; }
.calib-footer-actions { display: flex; gap: 8px; }

/* ============================== SCROLLBARS ================================ */
.rail-inner::-webkit-scrollbar, .alert-list::-webkit-scrollbar, .drawer-content::-webkit-scrollbar,
.dock-body::-webkit-scrollbar, .archive-list::-webkit-scrollbar, .vessel-card::-webkit-scrollbar { width: 8px; }
.rail-inner::-webkit-scrollbar-thumb, .alert-list::-webkit-scrollbar-thumb, .drawer-content::-webkit-scrollbar-thumb,
.dock-body::-webkit-scrollbar-thumb, .archive-list::-webkit-scrollbar-thumb, .vessel-card::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* ============================== RESPONSIVE ================================= */
@media (max-width: 1500px) {
  .brand-tag { display: none; }
  .header-center { gap: 8px; }
  .sector-select { max-width: 160px; }
  .subsystems > .subsys:not(#subsys-boye):not(#subsys-water) { display: none; } /* keep the indicators that actually change during the demo */
}
@media (max-width: 1100px) {
  :root { --rail-w: 220px; --panel-w: 320px; }
  .subsystems { display: none; }
}
