/**
 * base.css
 * Shared design tokens + shell/widget styles for GWG radar viewers
 * (l2genppi, l2genxc, ...). Load before the app's own styles.css so
 * app-specific rules can override.
 *
 * GWG-brand theme (2026-09-05): tokens pulled from gansonweathergroup.com /
 * dev.gansonweathergroup.com + the GWG logo (blue #2077B4 + green #309546
 * accent, sampled directly from logo pixels). The radar/map canvas stage
 * (--canvas-*) deliberately stays a soft dark grey rather than following
 * the light chrome — reflectivity/velocity color tables are designed
 * against a dark neutral backdrop, same reasoning GRLevelX/RadarScope/
 * Lightroom use a dark stage regardless of the surrounding app theme.
 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:         #FFFFFF;
  --surface:    #F0F0F0;
  --surface2:   #E4E6E8;
  --border:     #CCCCCC;
  --accent:          #2077B4;
  --accent-dim:      #15597F;
  --accent-contrast: #FFFFFF;
  --accent-green:    #2E9E52;
  --text:       #212121;
  --text-dim:   #6B6E72;
  --text-faint: #9AA0A6;
  --danger:     #D9363E;
  --success:    #2E9E52;
  --warn:       #C77700;
  --font: 'Open Sans', system-ui, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;

  --canvas-bg:     #242424;
  --canvas-panel:  #2E2E2E;
  --canvas-border: #3A3A3A;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; }

/* ── App shell ── */
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Tab bar (links between viewer SPAs) ── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 6px 10px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-link {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 4px 4px 0 0;
}

.tab-link:hover { color: var(--accent); }

.tab-link.active {
  color: var(--accent);
  background: var(--bg);
  border-color: var(--border) var(--border) var(--accent);
}

/* ── Tab bar groups (e.g. "Level 2", "Algorithms" — click-to-open dropdown
   of several tab-links, added 2026-08-26 once the flat tab count made the
   bar too crowded to scan at a glance; see viewers/shared/apps.js NAV) ── */
.tab-group { position: relative; }

.tab-group-btn {
  background: none;
  font: inherit;
  cursor: pointer;
}

.tab-group-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: max-content;
  padding: 4px;
  gap: 2px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(33, 33, 33, 0.15);
}

.tab-group-menu .tab-link {
  border-radius: 4px;
  border: 1px solid transparent;
}

.tab-group-menu .tab-link.active {
  border-color: var(--border);
}

/* ── Landing page (viewers/index.html) ── */
.landing {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  gap: 6px;
}

.landing h1 {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.landing .hint { margin-bottom: 30px; }

.app-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 760px;
}

.app-card {
  display: block;
  width: 220px;
  padding: 18px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
}

.app-card:hover { border-color: var(--accent); color: var(--accent); }

.app-card .app-card-title {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}

.app-card .app-card-id {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ── Toolbar ── */
#toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Global busy bar (GwgBusy in gwg-common.js) — injected right after
   #toolbar. Height always reserved; data-state drives the look. ── */
.busy-bar {
  position: relative;
  height: 3px;
  flex-shrink: 0;
  overflow: hidden;
  background: transparent;
  transition: background-color 0.3s;
}
.busy-bar-fill {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s, background-color 0.2s;
}

.busy-bar[data-state="working"] { background: rgba(32, 119, 180, 0.15); }
.busy-bar[data-state="working"] .busy-bar-fill {
  opacity: 1;
  right: auto;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent) 65%, transparent);
  animation: busy-sweep 1.2s ease-in-out infinite;
}

.busy-bar[data-state="pending"] .busy-bar-fill {
  opacity: 0.55;
  background: var(--accent);
  transform-origin: left center;
  animation: busy-fill var(--busy-pending-ms, 750ms) linear forwards;
}

.busy-bar[data-state="ok"]    .busy-bar-fill { opacity: 1; background: var(--success); }
.busy-bar[data-state="warn"]  .busy-bar-fill { opacity: 1; background: var(--warn); }
.busy-bar[data-state="error"] .busy-bar-fill { opacity: 1; background: var(--danger); }

@keyframes busy-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(250%); }
}
@keyframes busy-fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes busy-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .busy-bar[data-state="working"] .busy-bar-fill {
    width: auto;
    right: 0;
    background: var(--accent);
    animation: busy-pulse 1.6s ease-in-out infinite;
  }
  .busy-bar[data-state="pending"] .busy-bar-fill { animation: none; }
}

/* Active-project chip next to the app title (GwgProjects.renderProjectChip)
   — read-only; links to the Project Manager tab, where switching happens. */
.project-chip {
  flex-shrink: 1;
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}
.project-chip strong { color: var(--text); font-weight: 600; }
.project-chip:hover { border-color: var(--accent); color: var(--accent); }

.app-title {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.dim { color: var(--text-dim); font-size: 12px; font-family: var(--font); }
.toolbar-spacer { flex: 1; }

.auth-status {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Inputs / buttons (shared) ── */
input[type="text"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
}

input[type="text"] { width: 68px; font-family: var(--mono); }
/* `.field-wide` alone (0,1,0) can't beat the bare `input[type="text"]` rule
   above (0,1,1) — every `<input type="text" class="field-wide">` in the
   suite was silently stuck at 68px regardless of this class. This compound
   selector matches that specificity so it actually wins (`.wide` was
   already here for the same reason; `.field-wide` — the one every viewer
   actually uses — just wasn't listed alongside it). Selects/datetime-local/
   number/date inputs given `field-wide` aren't affected by this rule (it's
   scoped to `input[type="text"]`) and don't need it: `.field-wide` alone
   already works for them since base.css has no competing width default for
   those types. */
input[type="text"].wide,
input[type="text"].field-wide { width: 100%; }

/* Opt-in only (e.g. #icao, wwa's VTEC types-input) — applying this to every
   text input by default previously misled users typing lowercase into
   free-form fields like l2survey's timestep ("20m"): CSS text-transform only
   changes what's rendered, not the underlying value, so the field looked
   like it silently rejected/mangled lowercase input it had actually accepted
   fine, and typing the displayed uppercase literally produced a value the
   (case-sensitive, matches the CLI) parser then rejected. */
.input-uppercase { text-transform: uppercase; }

input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
input:disabled, select:disabled { opacity: 0.4; }

/* hide number spinners */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

button {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.12s, color 0.12s, background-color 0.12s;
  white-space: nowrap;
}

button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.35; cursor: default; }

/* ── Layout ── */
#layout { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

section { display: flex; flex-direction: column; gap: 5px; }

.section-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.section-label[hidden] { display: none; }

/* Full-width fields inside the sidebar (datetime, elevation, coordinates, ...) */
.field-wide { width: 100%; }

/* ── Coord row (paired lat/lon inputs) ── */
.coord-row { display: flex; gap: 4px; }
.coord-row input[type="number"],
.coord-row input[type="datetime-local"] { flex: 1; min-width: 0; width: 0; font-family: var(--mono); }

/* ── Zoom row ── */
.zoom-row { display: flex; align-items: center; gap: 6px; }
.zoom-row button { width: 28px; padding: 3px 0; font-size: 15px; font-weight: bold; text-align: center; flex-shrink: 0; }
#zoom-display { flex: 1; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--accent); }

/* ── Font size row (also used for grid font size, etc.) ── */
.fontsize-row { display: flex; align-items: center; gap: 8px; }
.fontsize-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.fontsize-row .fontsize-display { width: 34px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--accent); flex-shrink: 0; }

/* ── Locations / freeform textarea ── */
textarea {
  resize: vertical;
  width: 100%;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Checkbox / radio list items ── */
.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 1px 0;
  user-select: none;
}

.check-item input[type="checkbox"],
.check-item input[type="radio"] { accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }

/* A checkbox/radio .check-item paired with an .info-icon help button — the
   icon must be a sibling, not nested inside the <label>, so clicking it
   can't also forward-activate the checkbox. */
.check-item-row { display: flex; align-items: center; gap: 4px; }
.check-item-row .check-item { flex-shrink: 0; }

.hint { font-size: 11px; color: var(--text-faint); font-family: var(--font); }
.hint.error { color: var(--danger); }

/* ── Info-icon tooltip (sidebar control help — shared/gwg-tooltip.js) ── */
.required-mark { color: var(--danger); font-weight: 700; margin-left: 2px; }

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: var(--text-faint);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  margin-left: 5px;
  cursor: help;
  flex-shrink: 0;
}
.info-icon:hover, .info-icon:focus-visible { background: var(--accent); outline: none; }

.gwg-tooltip-bubble {
  position: fixed;
  z-index: 1001;
  max-width: 240px;
  background: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(33, 33, 33, 0.2);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s;
  pointer-events: none;
}
.gwg-tooltip-bubble.visible { opacity: 1; visibility: visible; }

/* ── Variable add control ── */
.var-add-row { display: flex; gap: 4px; }
.var-add-row select { flex: 1; min-width: 0; }

#variable-list { display: flex; flex-direction: column; gap: 3px; }

.var-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: var(--font);
  font-size: 11px;
}

.var-chip-order { color: var(--accent); flex-shrink: 0; font-family: var(--mono); }
.var-chip-name  { flex: 1; }

.var-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
}

.var-chip-remove:hover { color: var(--danger); }

/* Pinned to the bottom of the scrolling sidebar so it's always reachable.
   The two shadows mask sidebar content scrolling around/under it (the
   second reaches down over the sidebar's bottom padding), and the disabled
   state is opaque (not the generic button opacity) for the same reason. */
#btn-generate {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: auto;
  box-shadow: 0 0 0 10px var(--surface), 0 14px 0 10px var(--surface);
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 700;
  padding: 7px 11px;
}

/* ── Annotation toolbar (gwg-annotate.js) ── */
.annotate-toolbar { display: flex; flex-direction: column; gap: 6px; }
.annotate-tool-row { display: flex; flex-wrap: wrap; gap: 4px; }
.annotate-tool-row .annotate-tool-btn { flex: 1 1 auto; padding: 4px 6px; font-size: 11px; }
.annotate-tool-btn.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.annotate-color-row { display: flex; gap: 6px; }
.annotate-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
}
.annotate-swatch.active { border-color: var(--text); }
.annotate-action-row { display: flex; gap: 6px; }
.annotate-action-row button { flex: 1; }
.annotate-size-row { display: flex; align-items: center; gap: 6px; }
.annotate-size-label { font-size: 11px; color: var(--text-dim); width: 28px; flex: none; }
.annotate-size-btn { padding: 2px 8px; font-size: 12px; line-height: 1.2; }
.annotate-size-value { font-size: 11px; font-family: var(--mono); flex: 1; text-align: center; }
.annotate-mirror-row { display: flex; align-items: center; gap: 6px; font-size: 11px; cursor: pointer; }

/* Toolbar-launched floating panels (gwg-dialog.js): Annotate, Locations,
   Map. Launchers sit at the far left of the geocode toolbar row. No
   backdrop, so the canvases stay interactive. z-index 15 (16 for the
   front-most panel) sits under the tab-group menu (20), the text-entry
   input (500), tooltips and modals. */
.gwg-dialog-launcher { flex: none; }
.gwg-dialog-launcher.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.gwg-dialog-launcher.active:hover { color: var(--accent-contrast); }
.gwg-dialog {
  position: fixed;
  z-index: 15;
  width: 240px;
  max-height: calc(100vh - 12px);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(33, 33, 33, 0.2);
  display: flex;
  flex-direction: column;
}
.gwg-dialog[hidden] { display: none; }
.gwg-dialog.gwg-dialog-wide { width: 300px; }
.gwg-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  cursor: move;
  user-select: none;
  touch-action: none;
}
.gwg-dialog-title { display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent); }
.gwg-dialog-close { padding: 0 6px; border: none; background: none; font-size: 14px; line-height: 1.4; color: var(--text-dim); }
.gwg-dialog-body { padding: 10px 12px 12px; overflow-y: auto; }
/* Sidebar sections moved in by initSidebarDialogs(). */
.gwg-dialog-sections .gwg-dialog-body { display: flex; flex-direction: column; gap: 14px; }
.gwg-dialog-sections textarea { width: 100%; }
/* Hidden until initSidebarDialogs() moves them out, so they never flash. */
#sidebar [data-dialog] { display: none; }

/* Floating text-entry input placed at the click point on the canvas while
   the Text tool is armed (gwg-annotate.js startTextInput) — positioned via
   inline left/top in screen space, not part of the normal sidebar flow.
   Kept dark (matches --canvas-bg) since it sits on top of the canvas, not
   the light chrome. */
.annotate-text-input {
  position: fixed;
  z-index: 500;
  font-family: var(--font);
  font-size: 13px;
  padding: 2px 5px;
  background: var(--canvas-bg);
  color: #fff;
  border: 1px solid var(--accent);
  min-width: 120px;
}

#btn-generate:disabled { opacity: 1; background: #A6C8E1; border-color: #A6C8E1; }
#btn-generate:hover:not(:disabled) { background: var(--accent-dim); border-color: var(--accent-dim); color: var(--accent-contrast); }

/* Status strip: full-width line under the toolbar (and the busy bar
   GwgBusy injects between them), so a Generate's result message sits next
   to the bar that signals it rather than at the bottom of the sidebar. */
#status {
  font-size: 12px;
  font-family: var(--font);
  color: var(--text-dim);
  line-height: 1.5;
  min-height: calc(1.5em + 8px);
  padding: 4px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  flex-shrink: 0;
}

#status.error { color: var(--danger); }
#status.ok    { color: var(--success); }
#status.warn  { color: var(--warn); }

/* ── About modal (viewer + backend server versions) ── */
.about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 33, 33, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.about-dialog {
  width: 320px;
  max-width: calc(100vw - 40px);
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(33, 33, 33, 0.2);
}

.about-dialog h2 {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.about-section-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.about-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font);
  font-size: 12px;
  padding: 2px 0;
}

.about-label { color: var(--text); }
.about-version { color: var(--accent); flex-shrink: 0; font-family: var(--mono); }
.about-version.dim { color: var(--text-dim); }
.about-version-error { color: var(--danger); }

.about-close { align-self: flex-end; margin-top: 4px; }

/* Primary/CTA button — every other button in the suite is intentionally
   neutral/identical (Cancel/Close/Save are reversible, symmetric actions),
   but the trial consent dialog's "I Agree, Start Trial" creates a
   persistent server-side record and deserves visual distinction from
   Back/Cancel. Reuses #btn-generate's existing filled-accent look rather
   than inventing a new style. */
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--accent-contrast);
}

/* ── Geocode toolbar (persistent row below the tab bar) ── */
.geocode-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.geocode-address-input { flex: 1 1 auto; width: auto; min-width: 0; }

.geocode-status {
  font-size: 11px;
  font-family: var(--font);
  color: var(--text-dim);
}

.geocode-status.error { color: var(--danger); }
.geocode-status.ok    { color: var(--success); }

.geocode-dialog { width: 360px; }

.geocode-map-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.geocode-map-img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas-bg);
}

.geocode-save-map-btn { align-self: flex-end; }

.geocode-replace-item { padding-left: 20px; }

.geocode-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ── Zoom overlay: floating +/- over the top-right of the render area
   (sibling of #panels inside #layout, so it doesn't scroll with the
   panels). Dark to sit on the stage. ── */
#layout { position: relative; }
.zoom-overlay {
  position: absolute;
  top: 10px;
  right: 24px;
  z-index: 5;
  padding: 4px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--canvas-border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.zoom-overlay .zoom-row { gap: 4px; }
.zoom-overlay button {
  width: 28px;
  padding: 2px 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  background: #2E2E2E;
  color: #EEEEEE;
  border-color: #555555;
}
.zoom-overlay button:hover:not(:disabled) { background: #3A3A3A; color: #FFFFFF; border-color: #777777; }
.zoom-overlay #zoom-display {
  min-width: 84px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: #DDDDDD;
}

/* ── Panels area — this is the "stage": stays a soft dark grey regardless
   of the light chrome around it, so radar/map color tables keep the
   contrast they're designed against (see file header). ── */
#panels {
  flex: 1;
  position: relative;
  overflow: auto;
  background: var(--canvas-bg);
}

#panels-empty {
  width: 100%;
  padding-top: 60px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font);
  font-size: 12px;
  pointer-events: none;
}

/* ── Panel grid: layout mirrors the CLIs' --composite arrangement
   (1 = single, 2 = side-by-side, 4 = 2x2, left-to-right/top-to-bottom in the
   order variables were added). ── */
#panel-grid {
  display: grid;
  gap: 20px;
  padding: 20px;
  width: 100%;
  height: 100%;
  justify-items: center;
  align-items: center;
}

#panel-grid.layout-1 { grid-template-columns: 1fr; }
#panel-grid.layout-2 { grid-template-columns: 1fr 1fr; }
#panel-grid.layout-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* ── Individual panel ── */
.panel-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
  min-height: 0;
}

.panel-row {
  display: flex;
  background: var(--canvas-panel);
  border: 1px solid var(--canvas-border);
}

.radar-canvas {
  display: block;
  /* width/height set by JS to fill available panel space */
  image-rendering: auto;
}

.colorbar-canvas {
  display: block;
  width: 80px;
  /* height set by JS to match radar canvas */
}

.panel-label {
  font-family: var(--font);
  font-size: 11px;
  color: #B8BCC2;
  text-align: center;
  letter-spacing: 0.02em;
}
