/* Swoop Lab — canopy-swoop telemetry console.
   Black canvas. Hairlines. Inter Tight. No wash, glow, card, or glass. */

:root {
  --bg: #07080A;
  --surface: #0E1014;
  --hair: #1C2128;
  --rule: #1C2128;
  --ink: #E8EDF2;
  --mute: #8B93A0;
  --faint: #8B93A0;
  --empty: #8B93A0;
  --ghost: #1C2128;
  --num: #E8EDF2;
  --play: #F5A623;
  --path: #3DDCFF;
  --v: #FF4D8D;
  --h: #B6FF3B;
  --tot: #FFFFFF;
  --dive: #7C5CFF;
  --turn: #FF7A45;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --pad: clamp(16px, 3.2vw, 36px);
  --max: 1440px;
  --ease: 120ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: #1C2128;
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; font-variant-numeric: tabular-nums; }

/* —— header —— */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  width: 100%;
  margin: 0;
  padding: 0 max(var(--pad), calc(50% - var(--max) / 2));
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: min(220px, 52vw);
  object-fit: contain;
}

.wordmark {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 6px 1px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--mute);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-left: 12px;
  min-width: 0;
}

.tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0 14px;
  height: 56px;
  color: var(--mute);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
}

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

.tab:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: -3px;
}

.tab.is-on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tab[hidden] { display: none !important; }

.panel[hidden] { display: none !important; }

.top-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.unit-toggle {
  display: flex;
  border: 1px solid var(--hair);
}

.unit-btn,
.seg {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.unit-btn.is-on,
.seg.is-on {
  color: var(--ink);
  background: var(--surface);
}

.unit-btn:disabled,
.seg:disabled {
  opacity: 0.35;
  cursor: default;
}

.account-wrap { position: relative; }

.account-chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--mute);
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 220px;
  display: grid;
  background: var(--bg);
  border: 1px solid var(--hair);
}

.account-menu[hidden] { display: none; }

.account-item {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hair);
  height: 40px;
  padding: 0 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

.account-item:last-of-type { border-bottom: 0; }
.account-item:hover { background: var(--surface); }

.account-note {
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 12px;
  color: var(--mute);
  line-height: 1.4;
}

.account-note[hidden] { display: none; }

/* —— page —— */

main {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.dev-warn {
  margin: 0;
  padding: 10px max(var(--pad), calc(50% - var(--max) / 2));
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--play);
  border-bottom: 1px solid var(--hair);
  background: var(--bg);
}

.panel {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--pad) 64px;
  display: grid;
  gap: 20px;
  min-width: 0;
}

.kicker,
.section-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* —— command strip —— */

.command {
  display: grid;
  gap: 0;
  min-width: 0;
}

.command-strip {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--hair);
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-cluster {
  display: none;
}

.paywall-note {
  margin: 0;
  padding: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--mute);
}

.paywall-note:empty,
.paywall-note[hidden] { display: none; }

body.is-empty .command { display: none; }

.btn {
  appearance: none;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink);
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: border-color var(--ease), color var(--ease), background-color var(--ease);
}

.btn.ghost {
  color: var(--ink);
  border-color: var(--hair);
  background: transparent;
}

.btn.amber {
  background: var(--play);
  border-color: var(--play);
  color: #07080A;
}

.btn.amber:hover {
  background: #ffb53c;
  border-color: #ffb53c;
  color: #07080A;
}

.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn.amber:hover { color: #07080A; }

.btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.text-act {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px 6px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
}

.text-act:hover { color: var(--ink); }
.text-act:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  height: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
}

.import-btn.text-act {
  padding: 8px 6px;
}

.import-btn input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

body:not(.is-entitled) .import-btn input { pointer-events: none; }

[hidden] { display: none !important; }

.gate-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px 10px;
  min-height: 38px;
  padding: 0 0 0 12px;
  border: 0;
  border-left: 1px solid var(--hair);
  color: var(--mute);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gate-chip .btn,
.gate-chip .text-act {
  height: auto;
  min-height: 44px;
  border: 0;
}

/* —— empty —— */

.empty-hero {
  display: grid;
  gap: 16px;
  padding: 28px 0 12px;
  min-width: 0;
}

.empty-hero h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.empty-actions .btn,
.empty-actions .import-btn { min-height: 44px; }

.empty-quiet {
  margin: 0;
  font-size: 13px;
  color: var(--mute);
}

body:not(.is-empty) .empty-hero { display: none; }

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-top: 8px;
  padding: 36px 16px;
  min-height: 220px;
  background: transparent;
  border: 1px dashed var(--hair);
  cursor: pointer;
}

body:not(.is-empty) .dropzone {
  display: none;
}

.dropzone:hover,
.dropzone.is-over,
.dropzone.dragover {
  border-style: solid;
  border-color: var(--ink);
}

.dropzone strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dropzone small {
  color: var(--mute);
  font-size: 13px;
}

.dropzone.is-locked { cursor: default; }
.dropzone.is-locked:hover {
  border-style: dashed;
  border-color: var(--hair);
}

@media (hover: none) and (pointer: coarse) {
  .dropzone { display: none; }
}

/* —— jump —— */

.jump-select {
  display: grid;
  gap: 6px;
  min-width: min(100%, 360px);
}

.jump-select select {
  appearance: none;
  background: transparent
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238B93A0' d='M1 1l5 5 5-5'/></svg>")
    no-repeat right 4px center;
  border: none;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  padding: 6px 28px 6px 0;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.jump-select select:focus {
  outline: none;
  border-color: var(--ink);
}

.jump-meta {
  margin: 0 0 6px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  max-width: 62ch;
}

.hop-banner {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  color: var(--mute);
}

.hop-banner[hidden] { display: none; }

body.is-hop .telemetry,
body.is-hop .metric-strip,
body.is-hop .inspector { display: none; }

/* —— metric strip —— */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 0;
  border-bottom: 1px solid var(--hair);
  gap: 0;
}

.strip-cell {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 0;
  text-align: left;
  padding: 8px 10px 10px 0;
  cursor: pointer;
  min-width: 0;
  color: inherit;
}

.strip-cell:last-child { border-right: 0; }

.strip-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.strip-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.strip-value .unit {
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strip-cell.is-empty .strip-value { color: var(--mute); }
.strip-cell.is-on { color: var(--play); }

/* —— telemetry / one swoop graph —— */

.telemetry { min-width: 0; display: grid; gap: 8px; }

.xmode, .rates, .map-modes {
  display: flex;
  border: 0;
  width: max-content;
  max-width: 100%;
  gap: 2px;
  flex-wrap: wrap;
}

.xmode .seg,
.rates .seg,
.map-modes .seg {
  border-bottom: 1px solid transparent;
  background: transparent;
}

.xmode .seg.is-on,
.rates .seg.is-on,
.map-modes .seg.is-on {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.metric-chip {
  appearance: none;
  background: transparent;
  border: 0;
  height: 28px;
  padding: 0 6px 0 2px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--chip, var(--mute));
}

.metric-chip[data-series="dive"] { --chip: #7C5CFF; }
.metric-chip[data-series="vertical"] { --chip: #FF4D8D; }
.metric-chip[data-series="horizontal"] { --chip: #B6FF3B; }
.metric-chip[data-series="total"] { --chip: #FFFFFF; }
.metric-chip[data-series="altitude"] { --chip: #3DDCFF; }

.metric-chip.is-on {
  color: var(--chip);
  border-color: transparent;
}

.swoop-graph-wrap {
  position: relative;
  border: 1px solid var(--hair);
  background: var(--surface);
  min-width: 0;
}

.graph-in {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.graph-in-btn {
  pointer-events: auto;
  appearance: none;
  background: var(--bg);
  border: 0;
  color: var(--mute);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  height: 22px;
  padding: 0 7px;
  cursor: pointer;
}

.graph-in-btn:hover { color: var(--ink); }

#swoopGraph,
#chartSide,
#compareLanes,
#comparePaths {
  display: block;
  width: 100%;
  height: 100%;
}

#swoopGraph {
  height: 420px;
  touch-action: none;
  cursor: crosshair;
}

.graph-tip {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  min-width: 148px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 11px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.graph-tip[hidden] { display: none; }

.graph-tip .tip-time {
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.graph-tip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.graph-tip .tip-k { color: var(--mute); }
.graph-tip .tip-v { color: var(--ink); }

.graph-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.event-rail {
  display: none;
}

.event-chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--mute);
  height: 28px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.event-chip.is-on { color: var(--play); border-color: var(--play); }

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-left: 0;
}

.graph-controls .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 11px;
}

.graph-controls .btn.amber { min-width: 72px; }

.rate-wrap { position: relative; }

.rate-now {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  min-height: 44px;
  padding: 0 6px;
  cursor: pointer;
}

.rate-menu {
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 6;
  display: grid;
  min-width: 72px;
  background: var(--bg);
  border: 1px solid var(--hair);
}

.rate-menu[hidden] { display: none; }

.rate-opt {
  appearance: none;
  background: transparent;
  border: 0;
  height: 36px;
  padding: 0 10px;
  text-align: left;
  color: var(--mute);
  font-size: 12px;
  cursor: pointer;
}

.rate-opt.is-on,
.rate-opt:hover { color: var(--ink); background: var(--surface); }

.measure-btn.is-on,
#measureBtn.is-on {
  color: var(--play);
  border-color: var(--play);
}

#swoopGraph.is-measure {
  cursor: crosshair;
  touch-action: none;
}

#clearMeasureBtn[hidden] { display: none !important; }

/* —— stage —— */

.stage-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--hair);
}

.stage-tab {
  appearance: none;
  background: transparent;
  border: 0;
  height: 44px;
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.stage-tab.is-on {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 0;
  min-height: 0;
}

.stage-pane {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: auto 1fr auto;
}

.stage-pane.is-on { display: grid; }

.stage-pane + .stage-pane { border-left: 0; }

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hair);
}

#mapPane .pane-head { display: none; }

.pane-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pane-head span { font-size: 11px; color: var(--mute); }

.pane-body {
  position: relative;
  min-height: 360px;
  background: var(--bg);
}

.pane-body canvas { height: 360px; }

#chartSide { height: 360px; }

.sat-frame {
  position: relative;
  width: 100%;
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--hair);
  overflow: hidden;
}

.sat-map {
  width: 100%;
  height: 520px;
  background: #000;
}

.sat-frame.is-gate-place .sat-map,
.sat-frame.is-gate-place .leaflet-container,
.sat-frame.is-course-place .sat-map,
.sat-frame.is-course-place .leaflet-container {
  cursor: crosshair;
}

.sat-map.leaflet-container {
  background: #000;
  font-family: var(--sans);
}

.sat-empty {
  position: absolute;
  inset: 0;
  z-index: 400;
  margin: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 8, 10, 0.45);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  pointer-events: none;
}

.sat-empty[hidden] { display: none; }

.sat-caption,
.winds-meta {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--mute);
  line-height: 1.3;
}

.sat-caption {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sat-caption[hidden] { display: none !important; }

.gate-overlay {
  position: absolute;
  left: 8px;
  right: 56px;
  top: 8px;
  bottom: auto;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  max-width: calc(100% - 64px);
}

.gate-overlay .btn,
.gate-overlay .seg,
.gate-overlay .text-act,
.gate-overlay input,
.gate-prompt { pointer-events: auto; }

.gate-prompt {
  margin: 0;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--hair);
  font-size: 11px;
  color: var(--ink);
  max-width: 100%;
  line-height: 1.3;
}

.gate-prompt:empty { display: none; }

.gate-overlay-actions,
.map-gate-idle,
.map-gate-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  pointer-events: auto;
  background: var(--bg);
  border: 1px solid var(--hair);
}

.map-gate-idle[hidden],
.map-gate-edit[hidden],
.course-chrome [hidden],
.gate-overlay [hidden],
#gateChipMap { display: none !important; }

.map-gate-idle .text-act,
.map-gate-edit .text-act {
  background: transparent;
  padding: 0 10px;
  min-height: 32px;
  height: 32px;
  border: 0;
}

.map-gate-edit .btn.amber {
  height: 32px;
  min-height: 32px;
  border: 0;
  padding: 0 12px;
}

.course-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
}

.course-type {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--hair);
  max-width: 100%;
}

.course-type .kicker {
  display: none;
  margin: 0;
  padding: 0 8px;
  align-self: center;
}

.course-type .seg {
  padding: 0 8px;
  min-height: 32px;
  height: 32px;
  font-size: 10px;
  letter-spacing: 0.08em;
  border-right: 1px solid var(--hair);
}

.course-type .seg:last-child { border-right: 0; }

.course-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--hair);
}

.course-tools[hidden] { display: none !important; }

.course-placed {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.course-placed[hidden] { display: none !important; }

.course-fine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 6px 0 0;
  background: var(--bg);
  border: 1px solid var(--hair);
  max-width: 100%;
}

.course-fine[hidden] { display: none !important; }

.course-fine .text-act {
  background: transparent;
  padding: 0 8px;
  min-height: 32px;
  height: 32px;
  border: 0;
}

.course-hdg-lab,
.course-opac-lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mute);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 8px;
  min-height: 32px;
}

.course-hdg-input {
  width: 56px;
  height: 28px;
  padding: 0 6px;
  background: var(--bg);
  border: 1px solid var(--hair);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.course-opac-lab input[type="range"] {
  width: 72px;
  height: 28px;
  accent-color: var(--play);
}

.course-chrome .text-act {
  background: transparent;
  padding: 0 8px;
  min-height: 32px;
  height: 32px;
  border: 0;
}

.course-estimate {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.course-estimate[hidden],
#courseCaption[hidden],
#courseFineTools[hidden] { display: none !important; }

.leaflet-div-icon.course-label {
  background: transparent !important;
  border: 0 !important;
}

.course-label-text {
  display: inline-block;
  padding: 1px 4px;
  background: var(--bg);
  border: 1px solid var(--hair);
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.3;
}

.leaflet-div-icon.gate-handle.is-course {
  background: rgba(61, 220, 255, 0.14) !important;
  border: 1px solid rgba(61, 220, 255, 0.55) !important;
}

.gate-handle.is-course .gate-handle-dot {
  border-color: var(--path);
}

.gate-handle.is-course.is-rotate .gate-handle-dot {
  border-left-color: transparent;
  border-right-color: transparent;
  border-bottom-color: var(--path);
}

.sat-frame.is-gate-edit .leaflet-overlay-pane,
.sat-frame.is-gate-edit .leaflet-overlay-pane svg,
.sat-frame.is-gate-edit .leaflet-overlay-pane canvas {
  pointer-events: none;
}

.leaflet-div-icon.gate-handle,
.gate-handle {
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  background: rgba(245, 166, 35, 0.14) !important;
  border: 1px solid rgba(245, 166, 35, 0.55) !important;
  pointer-events: auto !important;
  touch-action: none;
  cursor: grab;
  box-sizing: border-box;
}

.leaflet-marker-icon.gate-handle {
  pointer-events: auto !important;
}

.leaflet-marker-draggable,
.leaflet-marker-draggable.gate-handle {
  touch-action: none;
  cursor: grab;
  pointer-events: auto !important;
}

.leaflet-marker-draggable:active {
  cursor: grabbing;
}

.gate-handle-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 14px auto;
  border: 2px solid var(--play);
  background: var(--bg);
  pointer-events: none;
}

.gate-handle.is-rotate .gate-handle-dot {
  width: 0;
  height: 0;
  margin: 12px auto;
  border: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid var(--play);
  background: transparent;
  transform: rotate(var(--hdg, 0deg));
  transform-origin: 50% 70%;
}

.sat-frame .leaflet-top.leaflet-left {
  left: auto;
  right: 8px;
  top: 8px;
}

.sat-frame .leaflet-control-zoom {
  border: 1px solid var(--hair) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.sat-frame .leaflet-bar a,
.sat-frame .leaflet-control-zoom a {
  background: var(--bg) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--hair) !important;
  border-radius: 0 !important;
}

.sat-frame .leaflet-control-attribution {
  background: rgba(7, 8, 10, 0.72) !important;
  color: var(--mute);
  font-family: var(--sans);
  font-size: 10px;
  max-width: calc(100% - 16px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sat-frame .leaflet-control-attribution a { color: var(--ink); }

/* —— inspector —— */

.inspector {
  display: none;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 0;
  border-top: 1px solid var(--hair);
}

.insp-cell {
  padding: 8px 10px 8px 0;
  border-right: 0;
  min-width: 0;
}

.insp-cell:nth-child(8n) { border-right: 0; }

.insp-cell.is-gate { background: transparent; }

.insp-val {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.insp-val.is-v { color: var(--v); }
.insp-val.is-h { color: var(--h); }
.insp-val.is-tot { color: var(--tot); }
.insp-val.is-dive { color: var(--dive); }
.insp-val.is-turn { color: var(--turn); }
.insp-val.is-gatec { color: var(--play); }

.insp-cell .unit {
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.measure-out {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.measure-out[hidden] { display: none !important; }

.quality {
  margin: 0;
  font-size: 12px;
  color: var(--mute);
}

/* —— metrics instrument grid —— */

.inst-group { margin-top: 18px; }
.inst-group:first-of-type { margin-top: 0; }

.inst-group-label {
  margin: 0;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--hair);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.detail-rows {
  display: grid;
  gap: 0;
  padding: 8px 0 16px;
}

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
  min-width: 0;
}

.detail-k {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.detail-v {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--num);
}

.detail-row.is-empty .detail-v { color: var(--empty); }

.detail-v .unit {
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px 12px 16px 0;
  border-bottom: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
}

.metric:nth-child(4n) { border-right: none; }

.metric h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.25;
}

.metric .value {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 20px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--num);
}

.metric.is-primary .value { font-size: 32px; }

.metric.is-empty .value > span:first-child { color: var(--empty); }

.metric .unit {
  font-size: 11px;
  color: var(--mute);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric .cap {
  display: none;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--mute);
}
.metric:hover .cap,
.metric:focus-within .cap,
.metric.is-cap-on .cap { display: block; }

/* —— winds —— */

.winds-table {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.winds-table th,
.winds-table td {
  height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid var(--hair);
  text-align: right;
  white-space: nowrap;
}

.winds-table th:first-child,
.winds-table td:first-child { text-align: left; }

.winds-table thead th {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

.winds-empty {
  margin: 0;
  padding: 8px 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.winds-empty[hidden] { display: none; }

.wind-barb {
  display: inline-block;
  width: 12px;
  height: 12px;
  position: relative;
  vertical-align: middle;
}

.wind-barb::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 1px;
  width: 1px;
  height: 10px;
  background: var(--ink);
  transform: translateX(-50%);
}

.wind-barb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 1px;
  width: 5px;
  height: 5px;
  border-left: 1px solid var(--ink);
  border-top: 1px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

/* —— tables / details —— */

.table-panel { overflow: hidden; min-width: 0; }

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
  text-align: right;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: right;
}

th:first-child,
td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
  padding-left: 0;
}

tbody tr.is-active th,
tbody tr.is-active td,
tbody tr.active th,
tbody tr.active td {
  background: var(--surface);
  color: var(--ink);
}

.detected { padding: 10px 0 4px; }

.detected pre {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--mute);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.more-block {
  border-top: 1px solid var(--hair);
  padding: 2px 0;
  min-width: 0;
  max-width: 100%;
}

.more-block summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 8px 0;
}

.more-block summary::-webkit-details-marker { display: none; }
.more-block summary::after {
  content: " +";
  color: var(--mute);
}
.more-block[open] summary::after { content: " –"; }

/* —— compare —— */

.compare-lead { margin: 0; color: var(--mute); font-size: 13px; }

.compare-empty {
  margin: 0;
  color: var(--mute);
  font-size: 14px;
}

.compare-empty[hidden],
.compare-lead[hidden],
.compare-align[hidden],
.compare-charts[hidden],
.compare-scrub[hidden] { display: none; }

.compare-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
}

.compare-picks:empty { display: none; }

.compare-picks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.compare-align { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.compare-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hair);
}

.compare-charts canvas { height: 280px; background: var(--bg); }

.compare-scrub { padding: 8px 0; }
.compare-scrub input { width: 100%; accent-color: var(--play); }

/* —— weights / coaches —— */

.coaches-panel,
.weights-panel { min-height: 48vh; }

.coaches-empty {
  padding: 8px 0 16px;
  display: grid;
  gap: 10px;
}

.coaches-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.coaches-empty p {
  margin: 0;
  max-width: 62ch;
  color: var(--mute);
  font-size: 14px;
  line-height: 1.55;
}

.weights-tool {
  padding: 4px 0 20px;
  display: grid;
  gap: 24px;
}

.weights-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}

.weights-field {
  display: grid;
  gap: 8px;
  min-width: min(100%, 240px);
}

.weights-field .kicker { margin: 0; }

.weights-field #dwipeInput {
  width: 100%;
  max-width: 240px;
  min-height: 44px;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: none;
}

.weights-field #dwipeInput:focus {
  outline: none;
  border-color: var(--ink);
}

.weights-unit { display: flex; align-items: center; }

.weights-unit-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 6px 14px 8px;
  color: var(--mute);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.weights-unit-btn.is-on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.weights-results { margin: 0; display: grid; gap: 0; }

.weights-row {
  display: grid;
  grid-template-columns: minmax(12ch, 1fr) minmax(9ch, auto) minmax(9ch, auto);
  gap: 12px 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
  align-items: baseline;
}

.weights-row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

.weights-row dd {
  margin: 0;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-align: right;
  color: var(--num);
}

.weights-row dd .unit {
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 6px;
}

.weights-row.is-row-label dd {
  grid-column: 2 / -1;
  font-size: 14px;
}

.weights-note {
  margin: 0;
  max-width: 62ch;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.55;
}


/* —— feedback CTA —— */
.feedback-cta {
  max-width: none;
  margin: 0;
  padding: 28px max(var(--pad), calc(50% - var(--max) / 2)) 8px;
  display: grid;
  gap: 12px;
  justify-items: start;
  border-top: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.06), transparent 70%);
}
.feedback-cta h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.feedback-cta p {
  margin: 0;
  max-width: 42ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mute);
}
.feedback-cta .btn {
  margin-top: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
}

/* —— footer —— */

footer {
  max-width: none;
  margin: 0;
  padding: 24px max(var(--pad), calc(50% - var(--max) / 2)) 40px;
  display: grid;
  gap: 10px;
  font-size: 12px;
  color: var(--mute);
  border-top: 1px solid var(--hair);
}

.foot-brand {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.foot-legal {
  margin: 0;
  font-size: 11px;
  color: var(--mute);
}

.foot-legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
}

.foot-legal a:hover,
.foot-legal a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.legal-page {
  max-width: 72ch;
  margin: 0 auto;
  padding: 32px var(--pad) 64px;
}

.legal-page h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.legal-page h2 {
  margin: 28px 0 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.legal-page p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.legal-page a {
  color: var(--play);
}

.foot-support {
  margin: 0;
  font-size: 12px;
}

.coffee-link {
  color: var(--play);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 166, 35, 0.45);
  padding-bottom: 1px;
}

.coffee-link:hover,
.coffee-link:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.disclaimer {
  margin: 0;
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mute);
}

.full-disclaimer {
  margin: 0;
}

.full-disclaimer > summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 4px 0;
}

.full-disclaimer > summary::-webkit-details-marker { display: none; }

@media (min-width: 721px) {
  .full-disclaimer > summary { display: none; }
  .full-disclaimer .disclaimer { display: block; }
}

/* —— tablet / phone —— */

@media (max-width: 1100px) {
  .inspector { display: none; }
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(4n) { border-right: 1px solid var(--hair); }
  .metric:nth-child(2n) { border-right: none; }
  .metric-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compare-charts { grid-template-columns: 1fr; }
}



/* —— map + details split (desktop) —— */
/* Map stays primary; Detail Metrics sit in a compact right rail. Mobile keeps tabs. */

@media (min-width: 960px) {
  body.stage-map .stage-tabs {
    grid-template-columns: 1fr 1fr;
  }

  body.stage-map .stage-tab[data-stage="details"] {
    display: none;
  }

  body.stage-map .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    align-items: stretch;
    gap: 0;
  }

  body.stage-map #mapPane {
    display: grid;
    grid-column: 1;
    min-width: 0;
  }

  body.stage-map #detailsPane {
    display: grid;
    grid-column: 2;
    grid-template-rows: auto 1fr;
    border-left: 1px solid var(--hair);
    min-width: 0;
    max-height: min(64vh, 640px);
    overflow: auto;
    background: var(--bg);
    padding: 0 12px 12px;
  }

  body.stage-map #sidePane {
    display: none;
  }

  body.stage-map .sat-frame,
  body.stage-map .sat-map {
    height: min(56vh, 560px);
    min-height: 420px;
  }

  body.stage-map #detailsPane .detail-rows {
    padding: 10px 0 8px;
  }

  body.stage-map #detailsPane .section-label {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding: 10px 0 6px;
    z-index: 1;
  }

  body.stage-map #detailsPane .detail-row {
    padding: 7px 0;
  }

  body.stage-map #detailsPane .detail-v {
    font-size: 15px;
  }

  body.stage-map #detailsPane .detail-k {
    font-size: 10px;
  }

  body.stage-map #detailsPane .inst-group-label {
    margin-top: 10px;
    font-size: 10px;
  }

  body.stage-map #detailsPane .more-block {
    display: none;
  }
}

@media (min-width: 960px) {
  body.stage-side .stage {
    grid-template-columns: 1fr;
  }

  body.stage-side #detailsPane {
    display: none;
  }
}

@media (max-width: 720px) {
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand tools"
      "tabs tabs";
    align-items: center;
    height: auto;
    min-height: 56px;
    column-gap: 8px;
    padding-top: 10px;
    padding-bottom: 0;
  }

  .brand { grid-area: brand; padding-bottom: 8px; }
  .brand-logo { height: 32px; }

  .tabs {
    grid-area: tabs;
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    padding: 0 6px;
    letter-spacing: 0.08em;
  }

  .top-tools { grid-area: tools; }

  .command-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .command-actions { justify-content: stretch; }

  .btn, .gate-chip { min-height: 40px; }
  .import-btn { min-height: 44px; }

  .dropzone { display: none; }

  .stage-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border: 0;
    border-bottom: 1px solid var(--hair);
  }

  .stage-pane {
    display: none;
    border: 0;
    min-height: 0;
  }

  .stage-pane.is-on { display: grid; }

  .below { display: none; }
  body.stage-details .inspector { display: none; }

  .sat-map, .sat-frame {
    height: min(112vw, 450px);
    min-height: 380px;
  }

  .gate-overlay {
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
  }

  .sat-frame .leaflet-top.leaflet-left {
    top: auto;
    bottom: 28px;
    right: 8px;
    left: auto;
  }

  .pane-body, .pane-body canvas {
    height: min(100vw, 360px);
    min-height: 240px;
  }

  #chartSide {
    height: min(100vw, 360px);
    min-height: 240px;
  }

  #swoopGraph { height: 320px; }

  .inspector { display: none; }

  .transport { margin-left: 0; width: 100%; }
  .graph-controls .btn.amber {
    min-height: 44px;
    height: 44px;
  }
}

@media (min-width: 1100px) {
  .sat-frame,
  .sat-map {
    height: min(64vh, 640px);
    min-height: 520px;
  }

  .course-type .kicker {
    display: inline-flex;
  }
}

@media (max-width: 430px) {
  #swoopGraph { height: 310px; }

  .course-chrome {
    width: 100%;
    align-items: flex-start;
  }

  .course-type {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .course-type .kicker { display: none; }

  .course-type .seg,
  .course-chrome .text-act,
  .map-gate-idle .text-act,
  .map-gate-edit .text-act,
  .map-gate-edit .btn.amber,
  .course-hdg-lab,
  .course-opac-lab {
    min-height: 44px;
    height: 44px;
  }

  .course-type .seg {
    padding: 0 2px;
    font-size: 10px;
    letter-spacing: 0.04em;
    min-width: 0;
    border-right: 1px solid var(--hair);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .course-hdg-input {
    height: 36px;
    width: 58px;
  }

  .course-opac-lab input[type="range"] {
    height: 44px;
    width: 88px;
  }

  .course-tools,
  .map-gate-idle,
  .map-gate-edit {
    width: auto;
    max-width: 100%;
  }

  .course-chrome .text-act,
  .map-gate-idle .text-act,
  .map-gate-edit .text-act,
  .map-gate-edit .btn.amber,
  .course-fine .text-act {
    min-width: 44px;
  }

  .course-fine {
    width: 100%;
  }

  .course-fine .text-act,
  .course-hdg-lab,
  .course-opac-lab {
    min-height: 44px;
    height: 44px;
  }
}

@media (max-width: 390px) {
  #swoopGraph { height: 300px; }
}

@media (max-width: 520px) {
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-value { font-size: 22px; }
  .metric .value { font-size: 18px; }
  .metric.is-primary .value { font-size: 24px; }
  .weights-row { grid-template-columns: 1fr auto; }
  .weights-row dd:nth-of-type(2) { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

main,
.panel,
section,
.metrics,
.stage,
.more-block,
.table-panel,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}
