/* Flotix Datalog Lab v13 — dark analysis workstation */
html.lab-on,
html.lab-on body {
  background: #050608;
  color: #d5dae3;
  height: 100%;
  overflow: hidden;
}
html.lab-on #app { height: 100%; }

.lab-root {
  --lab-bg: #050608;
  --lab-panel: #0c0e12;
  --lab-panel-2: #11141a;
  --lab-line: #1c212b;
  --lab-line-2: #2a3140;
  --lab-text: #e6ebf2;
  --lab-dim: #9aa3b5;
  --lab-mute: #6b7384;
  --lab-accent: #3ee0c2;
  --lab-warn: #f0b429;
  --lab-hot: #ff6b4a;
  height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 26px;
  grid-template-columns: 236px minmax(0, 1fr) 300px;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  user-select: none;
}

.lab-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #080a0e;
  border-bottom: 1px solid var(--lab-line);
}
.lab-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 132px;
  flex: 0 0 auto;
}
.lab-brand .wordmark { font-size: 16px; color: #f4f6f8; }
.lab-brand em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--lab-accent);
  font-weight: 700;
}
.lab-top select, .lab-top button {
  background: #141820;
  color: var(--lab-text);
  border: 1px solid var(--lab-line-2);
  border-radius: 4px;
  height: 28px;
  padding: 0 8px;
  font: inherit;
}
.lab-top select { max-width: 260px; }
.lab-top button { cursor: pointer; white-space: nowrap; }
.lab-top button:hover, .lab-top select:hover { border-color: #3d4658; }
.lab-top button.on, .lab-btn.on {
  background: #14352f;
  border-color: #2a8f7d;
  color: var(--lab-accent);
}
.lab-sep { width: 1px; height: 18px; background: var(--lab-line-2); flex: 0 0 auto; }
.lab-grow { flex: 1; }
.lab-chip {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
  color: var(--lab-dim);
  padding: 2px 6px;
  border: 1px solid var(--lab-line);
  border-radius: 3px;
  user-select: text;
}

.lab-left, .lab-right {
  background: var(--lab-panel);
  border-right: 1px solid var(--lab-line);
  overflow: auto;
  min-height: 0;
}
.lab-right { border-right: 0; border-left: 1px solid var(--lab-line); }
.lab-side-h {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lab-mute);
  padding: 12px 12px 6px;
}
.lab-ch {
  display: grid;
  grid-template-columns: 18px 12px 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 6px 12px;
  cursor: pointer;
}
.lab-ch:hover { background: #141820; }
.lab-ch.active { background: #12201c; }
.lab-dot { width: 10px; height: 10px; border-radius: 2px; }
.lab-ch b { font-weight: 600; font-size: 12px; }
.lab-ch span { color: var(--lab-mute); font-size: 10px; font-family: ui-monospace, monospace; }

.lab-center {
  min-width: 0;
  min-height: 0;
  display: grid;
  background: #07090c;
}
.lab-center.mode-analyzer {
  grid-template-rows: minmax(180px, 34%) 100px minmax(220px, 1fr) 58px;
}
.lab-center.mode-quality {
  grid-template-rows: minmax(140px, 1.15fr) minmax(130px, 1fr) minmax(180px, 0.95fr) 58px minmax(220px, 1.25fr);
}
.lab-center.mode-map {
  grid-template-rows: 58px minmax(0, 1fr);
}

.lab-center #lab-pane-qhz,
.lab-center #lab-pane-qgps,
.lab-center #lab-pane-qjit { display: none; }
.lab-center.mode-quality #lab-pane-qhz,
.lab-center.mode-quality #lab-pane-qgps,
.lab-center.mode-quality #lab-pane-qjit { display: block; }

.lab-center.mode-analyzer #lab-dock { display: none; }
.lab-center.mode-quality #lab-pane-wf,
.lab-center.mode-quality #lab-pane-sp,
.lab-center.mode-quality #lab-pane-sc { display: none; }
.lab-center.mode-map #lab-pane-wf,
.lab-center.mode-map #lab-pane-sp,
.lab-center.mode-map #lab-pane-sc,
.lab-center.mode-map #lab-pane-qhz,
.lab-center.mode-map #lab-pane-qgps,
.lab-center.mode-map #lab-pane-qjit,
.lab-center.mode-map #lab-pane-3d { display: none; }

.lab-pane {
  position: relative;
  border-bottom: 1px solid var(--lab-line);
  min-height: 0;
  overflow: hidden;
}
.lab-pane canvas { display: block; width: 100%; height: 100%; }
.lab-pane-tag {
  position: absolute;
  top: 6px;
  right: 8px;
  left: auto;
  z-index: 4;
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--lab-dim);
  pointer-events: none;
  background: rgba(5, 6, 8, .78);
  border: 1px solid #1c212b;
  border-radius: 4px;
  padding: 2px 8px;
  max-width: calc(100% - 56px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-pane-tag b { color: var(--lab-accent); font-weight: 650; }

.lab-dock {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  min-height: 0;
  height: 100%;
}
.lab-center.mode-map .lab-dock,
.lab-dock.solo { grid-template-columns: 1fr; }

.lab-dock > .lab-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border-bottom: 0;
}

html.lab-on .lab-map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}
html.lab-on .lab-map,
html.lab-on .lab-map.leaflet-container {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0;
  background: #0b0d11;
  overflow: hidden;
}
html.lab-on .lab-map .leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.92) saturate(.85);
}
html.lab-on .lab-map .leaflet-control-attribution {
  background: rgba(8, 10, 14, .75);
  color: #8b93a3;
  font-size: 10px;
}
html.lab-on .lab-map .leaflet-control-attribution a { color: #3ee0c2; }
html.lab-on .lab-map .leaflet-control-zoom a {
  background: #141820;
  color: #e6ebf2;
  border-color: #2a3140;
  width: 28px;
  height: 28px;
  line-height: 28px;
}
html.lab-on .lab-map .leaflet-control-zoom a:hover { background: #1c2430; }
html.lab-on .lab-map .leaflet-bar { border-color: #2a3140; }

.lab-map-msg {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #9aa3b5;
  background: #0b0d11;
  z-index: 5;
  font-size: 13px;
  line-height: 1.45;
}
.lab-map-msg.on { display: flex; }
.lab-map-legend {
  position: absolute;
  left: 10px;
  bottom: 22px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(8, 10, 14, .82);
  border: 1px solid #1c212b;
  border-radius: 4px;
  color: #9aa3b5;
  font-size: 10px;
  pointer-events: none;
}
.lab-map-legend i {
  width: 42px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #22c55e, #f0b429, #ef4444);
}

.lab-3d { width: 100%; height: 100%; display: block; cursor: grab; background: #050608; flex: 1; min-height: 0; }

.lab-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  background: #07090c;
  border-top: 1px solid var(--lab-line);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
  color: var(--lab-dim);
  overflow: hidden;
  white-space: nowrap;
  user-select: text;
}
.lab-status b { color: var(--lab-text); font-weight: 600; }
.lab-keys { margin-left: auto; color: var(--lab-mute); }

.lab-insp {
  padding: 0 12px 16px;
  user-select: text;
}
.lab-insp dl {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 5px 8px;
  margin: 0 0 12px;
}
.lab-insp dt { color: var(--lab-mute); font-size: 11px; }
.lab-insp dd { margin: 0; font-family: ui-monospace, monospace; font-size: 12px; color: var(--lab-text); }
.lab-insp table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: ui-monospace, monospace;
}
.lab-insp th { text-align: left; color: var(--lab-mute); font-weight: 500; padding: 4px 4px; }
.lab-insp td { padding: 4px 4px; border-top: 1px solid var(--lab-line); }
.lab-hint {
  color: var(--lab-mute);
  font-size: 11px;
  line-height: 1.5;
  padding: 0 12px 12px;
}
.lab-chk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
  color: var(--lab-text);
  margin-bottom: 3px;
}
.lab-score {
  display: grid;
  gap: 8px;
}
.lab-score-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; }
.lab-score-row span { color: var(--lab-mute); font-size: 11px; }
.lab-score-row b { font-family: ui-monospace, monospace; font-size: 11px; }
.lab-bar {
  height: 8px;
  background: #1c212b;
  border-radius: 4px;
  overflow: hidden;
}
.lab-bar i { display: block; height: 100%; border-radius: 4px; }
.lab-inline {
  background: transparent;
  border: none;
  color: var(--lab-dim);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  pointer-events: auto;
}
.lab-inline:hover { color: var(--lab-text); }
.lab-pane-tag .lab-inline { pointer-events: auto; }

.lab-err {
  margin: 10px;
  padding: 10px 12px;
  background: #2a1212;
  border: 1px solid #6b2a2a;
  color: #ffb4b4;
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .lab-root { grid-template-columns: 200px 1fr 250px; }
  .lab-keys { display: none; }
}
@media (max-width: 860px) {
  .lab-root { grid-template-columns: 1fr; grid-template-rows: 44px auto 1fr 26px; }
  .lab-left, .lab-right { max-height: 160px; border: 0; border-top: 1px solid var(--lab-line); }
  .lab-center { grid-row: 3; }
}
