/* Global Data — Intelligence Briefing Dashboard */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100vw; height: 100vh; overflow: hidden;
  background: var(--bg1);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

html.auth-locked,
body.auth-locked {
  overflow: hidden;
}

body.auth-locked #root {
  pointer-events: none;
  filter: blur(3px) brightness(0.55);
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(3,10,20,0.78), rgba(3,10,20,0.92)),
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(59,141,245,0.07) 4px);
}

.password-panel {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--edge);
  background: rgba(4,13,27,0.96);
  padding: 28px;
  box-shadow: 0 0 0 1px rgba(115,255,154,0.08), 0 24px 80px rgba(0,0,0,0.5);
}

.password-kicker {
  color: #73ff9a;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  margin-bottom: 10px;
}

.password-panel h1 {
  margin: 0 0 22px;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.password-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-row input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--edge);
  background: rgba(0,0,0,0.34);
  color: var(--text);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}

.password-row input:focus {
  border-color: #73ff9a;
}

.password-row button {
  height: 38px;
  border: 1px solid var(--accent-warm);
  background: rgba(245,177,66,0.08);
  color: var(--accent-warm);
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.password-error {
  min-height: 16px;
  margin-top: 12px;
  color: #ff4b4b;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
}
:root {
  --bg1: #050b17; --bg2: #08142a; --panel: #0a1930; --edge: #1a3153;
  --text: #cfe2ff; --text-dim: #7a94b8; --accent: #3b8df5; --accent-warm: #f5b142;
  --classif: #f5b142;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
}
.mono, code { font-family: var(--mono); }

#root { width: 100%; height: 100%; }
.app {
  width: 100%; height: 100%;
  display: grid;
  grid-template-rows: 56px 1fr 28px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(59,141,245,0.07), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(245,177,66,0.04), transparent 60%),
    linear-gradient(to bottom, var(--bg1), var(--bg2));
}

/* ============ TOP BAR ============ */
.top-bar {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.1));
  backdrop-filter: blur(6px);
  padding: 0 14px;
  gap: 16px;
  z-index: 20;
}
.tb-left { flex: 1 1 auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-center { flex: 1; display: flex; justify-content: center; }
.tb-right { flex: 0 1 auto; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-t {
  font-weight: 700; letter-spacing: 0.15em; font-size: 13px; color: var(--text);
}
.logo-st {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--text-dim);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 4px;
}
.top-links a {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border: 1px solid var(--edge);
  background: rgba(0,0,0,0.22);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-radius: 1px;
  white-space: nowrap;
}
.top-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(59,141,245,0.10);
}

.class-banner {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.25em; font-weight: 600;
  padding: 4px 14px;
  border: 1px solid var(--classif);
  border-radius: 1px;
  background: rgba(245,148,49,0.07);
  text-transform: uppercase;
}

.dtg { display: flex; flex-direction: column; align-items: flex-end; }
.dtg-lbl { font-size: 8.5px; letter-spacing: 0.2em; color: var(--text-dim); }
.dtg-val { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--accent); }

.iconbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--edge); padding: 4px 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  cursor: pointer; border-radius: 1px;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); }

.op-badge {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em;
  color: var(--text-dim); padding: 4px 10px; border: 1px solid var(--edge);
}
.op-badge span { color: var(--accent-warm); margin-left: 6px; }

.perf-toggle {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--edge);
  background: rgba(0,0,0,0.24);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  border-radius: 1px;
}
.perf-toggle:hover,
.perf-toggle.on {
  color: #73ff9a;
  border-color: #73ff9a;
  background: rgba(115,255,154,0.10);
}

.tb-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  flex: 0 1 auto;
}
.tb-actions > * {
  flex: 0 0 auto;
}
.tb-right .dtg,
.tb-right .op-badge {
  flex-shrink: 0;
  white-space: nowrap;
}
.tb-link {
  display: inline-flex;
  align-items: center;
  color: #73ff9a;
  border-color: #73ff9a;
  text-decoration: none;
  white-space: nowrap;
}

/* ============ MAIN LAYOUT ============ */
.main {
  display: grid;
  grid-template-columns: 288px 1fr 316px;
  overflow: hidden;
  gap: 1px;
  background: var(--edge);
}

.rail-left, .rail-right, .globe-wrap {
  background: linear-gradient(to bottom, var(--bg1), var(--bg2));
  min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}

/* ============ LEFT RAIL ============ */
.rail-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--edge);
  background: rgba(0,0,0,0.2);
}
.rail-hd-count { color: var(--accent); }

.layers { flex: 1; overflow-y: auto; padding: 6px 0; }
.layers::-webkit-scrollbar { width: 6px; }
.layers::-webkit-scrollbar-thumb { background: var(--edge); }

.layer-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(26,49,83,0.4);
  transition: background .15s;
}
.layer-row:hover { background: rgba(255,255,255,0.02); }
.layer-row.active { background: rgba(59,141,245,0.05); }

.layer-head { display: flex; align-items: center; gap: 10px; }
.layer-idx {
  font-family: var(--mono); font-size: 10px;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--edge); color: var(--text-dim);
  border-radius: 1px;
}
.layer-row.active .layer-idx { color: var(--accent); border-color: var(--accent); }
.layer-label {
  font-weight: 600; letter-spacing: 0.18em; font-size: 11.5px;
  color: var(--text);
}
.layer-row.active .layer-label { color: var(--accent); }
.layer-sub {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.15em;
  color: var(--text-dim); margin-top: 2px;
}
.layer-slider { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-left: 28px; }
.sl-lbl { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.15em; color: var(--text-dim); width: 22px; }
.sl-val { font-family: var(--mono); font-size: 9px; color: var(--text-dim); width: 24px; text-align: right; }

.opSlider { -webkit-appearance: none; appearance: none; flex: 1; height: 2px; background: var(--edge); outline: none; cursor: pointer; }
.opSlider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px; background: var(--sc, var(--accent));
  border-radius: 1px; cursor: pointer;
}
.opSlider::-moz-range-thumb { width: 10px; height: 10px; background: var(--sc, var(--accent)); border: none; border-radius: 1px; }

.rail-ft { padding: 10px 14px; border-top: 1px solid var(--edge); background: rgba(0,0,0,0.2); }
.rail-btn {
  width: 100%; padding: 8px;
  background: transparent; border: 1px solid var(--edge); color: var(--text-dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; cursor: pointer; border-radius: 1px;
}
.rail-btn:hover { color: var(--accent); border-color: var(--accent); }

.legend { margin-top: 12px; }
.legend-hd { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.15em; color: var(--text-dim); margin-bottom: 6px; }
.legend-bar { display: flex; height: 6px; }
.lg-seg { flex: 1; }
.legend-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8px; color: var(--text-dim); margin-top: 3px; }

/* ============ GLOBE ============ */
.globe-wrap { position: relative; }
.globe { position: absolute; inset: 0; }
.globe canvas { cursor: grab; }
.globe canvas:active { cursor: grabbing; }

.xh { position: absolute; pointer-events: none; color: var(--accent); opacity: .5; }
.xh span { position: absolute; background: currentColor; }
.xh span:first-child { width: 1px; height: 16px; }
.xh span:last-child { height: 1px; width: 16px; }
.xh-tl { top: 14px; left: 14px; }
.xh-tl span:first-child { top: 0; left: 0; } .xh-tl span:last-child { top: 0; left: 0; }
.xh-tr { top: 14px; right: 14px; }
.xh-tr span:first-child { top: 0; right: 0; } .xh-tr span:last-child { top: 0; right: 0; }
.xh-bl { bottom: 14px; left: 14px; }
.xh-bl span:first-child { bottom: 0; left: 0; } .xh-bl span:last-child { bottom: 0; left: 0; }
.xh-br { bottom: 14px; right: 14px; }
.xh-br span:first-child { bottom: 0; right: 0; } .xh-br span:last-child { bottom: 0; right: 0; }

.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(59,141,245,0.02) 3px, rgba(59,141,245,0.02) 4px);
  mix-blend-mode: overlay;
}

.zoom-controls {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 5;
}
.zoom-controls button {
  width: 26px; height: 26px; background: rgba(0,0,0,0.4); color: var(--text);
  border: 1px solid var(--edge); font-size: 14px; cursor: pointer; border-radius: 1px;
  font-family: var(--mono);
}
.zoom-controls button:hover { color: var(--accent); border-color: var(--accent); }
.iconbtn.on { color: var(--accent); border-color: var(--accent); background: rgba(59,141,245,0.10); }
.zoom-rail { width: 2px; height: 80px; background: var(--edge); position: relative; }
.zoom-tick { position: absolute; left: -3px; width: 8px; height: 2px; background: var(--accent); transition: top 0.2s; }

.bearing {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  color: var(--text-dim); z-index: 5; pointer-events: none;
}

/* Floating inspector over globe when something is picked */
.picked-wrap {
  position: absolute; left: 20px; bottom: 20px; z-index: 10;
  width: 300px;
}

/* ============ RIGHT RAIL ============ */
.rail-right { display: flex; flex-direction: column; }

.inspector {
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--edge);
  max-height: 45%; overflow: hidden;
  display: flex; flex-direction: column;
}
.inspector.empty { flex: 0 0 auto; }
.picked-wrap .inspector {
  background: rgba(5,11,23,0.92);
  border: 1px solid var(--accent);
  backdrop-filter: blur(8px);
  max-height: unset;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.insp-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--edge);
  background: rgba(0,0,0,0.3);
}
.insp-close {
  background: transparent; color: var(--text-dim); border: none; cursor: pointer;
  font-size: 14px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}
.insp-close:hover { color: var(--accent); }
.insp-body { padding: 12px 14px; overflow-y: auto; }
.insp-body::-webkit-scrollbar { width: 4px; }
.insp-body::-webkit-scrollbar-thumb { background: var(--edge); }
.insp-title {
  font-weight: 600; font-size: 14px; letter-spacing: 0.03em;
  color: var(--text); margin-bottom: 12px;
}
.insp-row {
  display: grid;
  grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 3px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: 0.06em;
}
.insp-row span {
  color: var(--text-dim);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.insp-row b {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.kv {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px dotted rgba(26,49,83,0.5);
  font-size: 10.5px; letter-spacing: 0.1em;
}
.kv .k { font-family: var(--mono); color: var(--text-dim); text-transform: uppercase; }
.kv .v { font-family: var(--mono); color: var(--text); }

.heat-bar { height: 4px; background: var(--edge); margin-bottom: 12px; position: relative; }
.heat-fill { height: 100%; transition: width .3s; }

.insp-empty {
  padding: 24px 14px; text-align: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--text-dim);
}
.insp-empty .reticle { margin-bottom: 12px; }
.insp-empty .sub { font-size: 9px; color: var(--text-dim); opacity: 0.6; margin-top: 4px; }

/* ============ FEED ============ */
.feed { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.feed-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--text-dim);
  border-bottom: 1px solid var(--edge);
  background: rgba(0,0,0,0.2);
}
.feed-count { color: var(--accent); }
.feed-list { flex: 1; overflow-y: auto; }
.feed-list::-webkit-scrollbar { width: 4px; }
.feed-list::-webkit-scrollbar-thumb { background: var(--edge); }

.feed-empty {
  padding: 40px 14px; text-align: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  color: var(--text-dim);
}
.feed-empty span { font-size: 9px; opacity: 0.6; }

.feed-item {
  width: 100%;
  display: flex; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid rgba(26,49,83,0.3);
  border-left: 0; border-right: 0; border-top: 0;
  background: transparent; color: inherit; text-align: left;
  font: inherit;
  transition: background .15s;
}
.feed-item:disabled { cursor: default; }
.feed-item.clickable { cursor: pointer; }
.feed-item:hover { background: rgba(255,255,255,0.02); }
.feed-item.clickable:hover { background: rgba(59,141,245,0.08); }
.feed-item.selected { background: rgba(245,138,66,0.10); box-shadow: inset 2px 0 0 var(--accent-warm); }
.feed-tag {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.15em;
  padding: 2px 4px; border: 1px solid; border-radius: 1px;
  align-self: flex-start; flex-shrink: 0;
}
.feed-body { flex: 1; min-width: 0; }
.feed-title {
  font-size: 11.5px; line-height: 1.3; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-meta {
  display: flex; gap: 4px; align-items: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  color: var(--text-dim); margin-top: 3px;
}
.feed-dot { opacity: 0.5; }

.news-actions {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  margin: 12px 0 10px;
}
.news-link {
  display: block; padding: 7px 8px;
  border: 1px solid var(--edge);
  color: var(--text); text-decoration: none; text-align: center;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
}
.news-link:hover { color: var(--accent-warm); border-color: var(--accent-warm); }
/* ============ BOTTOM BAR ============ */
.bottom-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 14px;
  border-top: 1px solid var(--edge);
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  z-index: 20;
}
.bottom-bar .spacer { flex: 1; }
.stat { display: flex; align-items: center; gap: 6px; }
.st-lbl { color: var(--text-dim); }
.st-val { color: var(--text); font-weight: 500; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff3040; display: inline-block; margin-right: 4px;
  box-shadow: 0 0 8px #ff3040;
}
.blink { animation: blink 1.5s infinite; color: #ff3040; }
@keyframes blink { 50% { opacity: 0.6; } }

/* ============ TWEAKS ============ */
.tweaks-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
.tweaks {
  background: var(--panel); border: 1px solid var(--accent);
  min-width: 380px; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.tweaks-hd {
  padding: 12px 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em;
  color: var(--accent); border-bottom: 1px solid var(--edge);
  background: rgba(0,0,0,0.3);
}
.tweaks-body { padding: 16px; }
.tw-section { margin-bottom: 18px; }
.tw-lbl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--text-dim); margin-bottom: 8px; }
.tw-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tw-opt {
  flex: 1; min-width: 0; padding: 8px 10px;
  background: transparent; border: 1px solid var(--edge); color: var(--text-dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em;
  cursor: pointer; border-radius: 1px; white-space: nowrap;
}
.tw-opt:hover { color: var(--text); }
.tw-opt.on { background: rgba(59,141,245,0.12); border-color: var(--accent); color: var(--accent); }
.tw-row { display: flex; gap: 16px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--text); }
.tw-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tw-row input { accent-color: var(--accent); }

/* ============ PERFORMANCE MODE ============ */
html.performance-mode *,
html.performance-mode *::before,
html.performance-mode *::after {
  animation: none !important;
  transition-duration: 0s !important;
  filter: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html.performance-mode .app,
html.performance-mode .rail-left,
html.performance-mode .rail-right,
html.performance-mode .globe-wrap,
html.performance-mode .local-map-overlay,
html.performance-mode .ameripro-tanks-visual {
  background-image: none !important;
}

html.performance-mode .scanlines,
html.performance-mode .xh,
html.performance-mode .local-city-orbit,
html.performance-mode .local-city-label,
html.performance-mode .local-county-label,
html.performance-mode .local-restaurant-label,
html.performance-mode .opportunity-label,
html.performance-mode .opportunity-hub-label,
html.performance-mode .ameripro-marker-label {
  display: none !important;
}

html.performance-mode .local-map-overlay {
  background-color: #07111f !important;
}

html.performance-mode .local-map-stage,
html.performance-mode .restaurant-selected-card,
html.performance-mode .city-selected-card,
html.performance-mode .county-drilldown-summary,
html.performance-mode .opportunity-selected-card,
html.performance-mode .ameripro-tank-card,
html.performance-mode .inspector,
html.performance-mode .feed-head,
html.performance-mode .rail-hd {
  background: #07111f !important;
}

html.performance-mode .local-map-svg {
  transition: none !important;
}

/* ============ MOBILE LAYOUT ============ */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: auto;
  }

  #root {
    width: 100%;
    min-height: 100dvh;
    height: auto;
  }

  .app {
    min-height: 100dvh;
    height: auto;
    display: grid;
    grid-template-rows: auto auto;
  }

  .top-bar {
    min-height: 0;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 8px 10px;
    gap: 8px 10px;
  }

  .tb-left,
  .tb-center,
  .tb-right {
    flex: 1 1 100%;
    min-width: 0;
  }

  .tb-center {
    justify-content: flex-start;
    order: 3;
  }

  .tb-right {
    justify-content: space-between;
    gap: 8px;
    order: 2;
  }

  .logo {
    gap: 8px;
    min-width: 0;
  }

  .logo svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
  }

  .logo-t {
    font-size: clamp(11px, 3.7vw, 13px);
    letter-spacing: 0.1em;
    overflow-wrap: anywhere;
  }

  .logo-st,
  .dtg-val {
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .class-banner,
  .op-badge,
  .perf-toggle {
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .class-banner {
    width: 100%;
    padding: 5px 8px;
    text-align: center;
  }

  .main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .rail-left,
  .rail-right,
  .globe-wrap {
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .rail-left {
    order: 1;
    max-height: none;
  }

  .layers {
    max-height: 34dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .layer-row {
    padding: 9px 10px;
  }

  .layer-sub {
    white-space: normal;
    line-height: 1.3;
  }

  .rail-ft {
    padding: 8px 10px;
  }

  .globe-wrap {
    order: 2;
    height: 64dvh;
    min-height: 430px;
    overflow: hidden;
  }

  .local-map-overlay {
    padding: 12px !important;
    gap: 8px !important;
  }

  .local-map-top,
  .local-map-foot {
    flex-wrap: wrap !important;
    gap: 6px 10px !important;
    letter-spacing: 0.12em !important;
  }

  .local-map-title {
    flex: 1 1 100%;
    font-size: 10px !important;
  }

  .local-map-status,
  .local-map-foot {
    font-size: 8px !important;
  }

  .local-map-stage {
    min-height: 0 !important;
  }

  .local-zoom-controls {
    right: 8px !important;
    gap: 5px !important;
  }

  .local-zoom-controls button {
    width: 30px !important;
    height: 30px !important;
  }

  .local-zoom-rail {
    height: 64px !important;
  }

  .ameripro-tanks-visual {
    inset: 8px !important;
    padding: 10px !important;
    gap: 10px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .ameripro-tanks-visual-head {
    display: grid !important;
    gap: 5px !important;
    letter-spacing: 0.12em !important;
  }

  .ameripro-tanks-visual-head strong {
    font-size: 11px !important;
  }

  .ameripro-tanks-visual-head span {
    font-size: 8px !important;
    line-height: 1.35 !important;
  }

  .ameripro-tank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    align-items: start !important;
  }

  .ameripro-tank-card {
    min-height: 260px !important;
    grid-template-rows: auto 150px auto !important;
    padding: 10px 8px !important;
    gap: 8px !important;
  }

  .ameripro-tank-card-title strong {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }

  .ameripro-tank-card-title span,
  .ameripro-tank-card-metrics {
    font-size: 7.5px !important;
    line-height: 1.35 !important;
  }

  .ameripro-tank-vessel {
    min-height: 108px !important;
    max-height: 150px !important;
  }

  .picked-wrap {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .rail-right {
    order: 3;
    min-height: 52dvh;
  }

  .inspector {
    max-height: none;
    overflow: visible;
  }

  .insp-body {
    max-height: 42dvh;
    overflow-y: auto;
  }

  .feed {
    min-height: 44dvh;
  }

  .feed-title {
    white-space: normal;
  }

  .feed-meta {
    flex-wrap: wrap;
  }

  .bottom-bar {
    flex-wrap: wrap;
    height: auto;
    min-height: 28px;
    gap: 6px 12px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 7px 8px;
  }

  .tb-right {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .dtg {
    align-items: flex-start;
  }

  .op-badge {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
  }

  .globe-wrap {
    height: 68dvh;
    min-height: 460px;
  }

  .ameripro-tank-grid {
    grid-template-columns: 1fr !important;
  }

  .ameripro-tank-card {
    min-height: 250px !important;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .password-row button {
    width: 100%;
  }
}
