:root {
  --bg: #07090a;
  --bg-2: #0f1316;
  --steel-0: #11161a;
  --steel-1: rgba(18, 22, 25, .92);
  --steel-2: rgba(31, 38, 42, .94);
  --steel-3: #2d363a;
  --line: rgba(207, 190, 145, .22);
  --line-strong: rgba(222, 194, 126, .42);
  --brass: #c6a25a;
  --brass-soft: rgba(198, 162, 90, .16);
  --paper: #d8c8a3;
  --paper-dim: #a99c79;
  --text: #ece6d6;
  --muted: #a9a394;
  --green: #748760;
  --navy: #172436;
  --danger: #9d3532;
  --danger-bright: #e15a4f;
  --warning: #d6a33b;
  --ok: #88a45f;
  --shadow: 0 28px 80px rgba(0,0,0,.62);
  --inset: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -1px 0 rgba(0,0,0,.55);
  font-family: "Segoe UI", Georgia, ui-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(144, 52, 46, .16), transparent 38%),
    radial-gradient(circle at 12% 78%, rgba(198, 162, 90, .12), transparent 35%),
    linear-gradient(135deg, #07090a 0%, #11161a 45%, #080b0d 100%);
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mix-blend-mode: overlay;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 50%, rgba(0,0,0,.58) 100%);
}

button, input, select { font: inherit; }
button {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(53, 61, 62, .94), rgba(18, 22, 24, .96));
  color: var(--text);
  border-radius: 3px;
  padding: 10px 13px;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, filter .14s ease, background .14s ease;
  box-shadow: var(--inset), 0 9px 20px rgba(0,0,0,.28);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
  font-weight: 800;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(224, 190, 105, .72);
  filter: brightness(1.1);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary {
  border-color: rgba(225, 186, 88, .68);
  background: linear-gradient(180deg, #b78a36, #654821 55%, #312416);
  color: #fff6de;
  text-shadow: 0 1px 1px #000;
}
button.danger {
  border-color: rgba(225, 90, 79, .64);
  background: linear-gradient(180deg, #9f3a34, #4b1717 65%, #1c0b0b);
  color: #ffe6df;
}
button.full { width: 100%; margin-top: 10px; }
input, select {
  width: 100%;
  border: 1px solid rgba(216, 200, 163, .20);
  background: linear-gradient(180deg, rgba(7, 10, 12, .9), rgba(22, 27, 30, .96));
  color: var(--text);
  border-radius: 3px;
  padding: 10px;
  outline: none;
  box-shadow: inset 0 1px 9px rgba(0,0,0,.5);
}
input:focus, select:focus { border-color: rgba(198, 162, 90, .72); }
label { display: block; color: var(--paper-dim); font-size: 12px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
label input, label select { margin-top: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mini { color: var(--muted); font-size: 11px; line-height: 1.45; }
.badge, .pill, .online-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(198, 162, 90, .28);
  background: rgba(198, 162, 90, .10);
  color: #e8d7aa;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pill.strong { border-color: rgba(225, 190, 105, .58); color: #fff0c2; }
.status-good, .ok-text { color: #a8c878; font-weight: 800; }
.status-bad, .warning-text, .warn { color: #f0b15a; font-weight: 800; }
.cash-positive { color: #a8c878; }
.cash-negative { color: #f16f63; }

.boot-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 30px; }
.boot-card {
  width: min(860px, 94vw);
  padding: 34px;
  border: 1px solid rgba(218, 194, 130, .28);
  background:
    linear-gradient(180deg, rgba(45, 49, 47, .94), rgba(13, 16, 18, .96)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 1px, transparent 1px 6px);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
}
.boot-card::before, .boot-card::after {
  content: "";
  position: absolute;
  height: 5px;
  left: 16px;
  right: 16px;
  border-top: 1px solid rgba(198,162,90,.55);
  border-bottom: 1px solid rgba(0,0,0,.55);
}
.boot-card::before { top: 13px; }
.boot-card::after { bottom: 13px; }
.boot-card h1 { margin: 6px 0 12px; font-size: clamp(36px, 5vw, 72px); letter-spacing: .05em; text-transform: uppercase; color: #f6e7bd; text-shadow: 0 5px 0 rgba(0,0,0,.25); }
.boot-card p { color: #c4b99b; line-height: 1.65; }
.brand-kicker { color: var(--brass); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; font-weight: 900; }
.auth-box, .campaign-box { margin-top: 22px; padding: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.22); }
.boot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.boot-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.status-line { margin-top: 16px; color: var(--paper-dim); font-size: 12px; }

.app { position: fixed; inset: 0; z-index: 1; }
.war-room {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 82px 1fr 82px;
  background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.56));
}
.command-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(198, 162, 90, .34);
  background:
    linear-gradient(180deg, rgba(34, 39, 40, .97), rgba(13, 17, 19, .96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 7px);
  box-shadow: 0 18px 40px rgba(0,0,0,.42), inset 0 -1px 0 rgba(0,0,0,.68);
}
.nation-plate, .logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background:
    linear-gradient(145deg, #cab06a, #70542b 48%, #1d1610 100%);
  color: #fff0c9;
  border: 1px solid rgba(255,236,175,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 25px rgba(0,0,0,.46);
  font-weight: 1000;
  letter-spacing: .08em;
  text-shadow: 0 2px 1px #000;
}
.logo-mark.small { width: 42px; height: 42px; font-size: 12px; }
.topbar h2 { margin: 3px 0 0; font-size: 22px; line-height: 1.05; color: #fff1c8; letter-spacing: .035em; text-transform: uppercase; }
.command-title-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.time-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 325px; }
.bell-btn { min-width: 124px; }
.notif-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #a93833;
  color: white;
  border: 1px solid #ffb1aa;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.hud-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(98px, 1fr));
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.hud-grid .card {
  padding: 7px 9px;
  min-height: 0;
  border-color: rgba(198,162,90,.20);
  background: linear-gradient(180deg, rgba(9,13,14,.55), rgba(0,0,0,.24));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.hud-grid .value { font-size: 16px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-grid .sub { font-size: 10px; color: #bdb293; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.strategic-board {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 30vw);
  gap: 0;
  position: relative;
}
.map-panel { min-width: 0; min-height: 0; padding: 10px 0 10px 12px; }
.map-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(198, 162, 90, .35);
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(19,25,27,.55), rgba(4,7,8,.78)),
    radial-gradient(circle at 35% 35%, rgba(198,162,90,.08), transparent 45%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 20px 50px rgba(0,0,0,.38);
}
.map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(0,0,0,.45), transparent 12%, transparent 88%, rgba(0,0,0,.38)),
    linear-gradient(0deg, rgba(0,0,0,.34), transparent 14%, transparent 88%, rgba(0,0,0,.30));
}
.map-toolbar {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 162, 90, .26);
  background: linear-gradient(180deg, rgba(18,22,22,.88), rgba(7,10,11,.78));
  backdrop-filter: blur(7px);
  box-shadow: 0 14px 32px rgba(0,0,0,.34), var(--inset);
}
.map-toolbar strong { color: #fff0c2; text-transform: uppercase; letter-spacing: .09em; font-size: 13px; }
#mapHint { display: block; color: #b7ad91; font-size: 11px; margin-top: 2px; }
.segmented { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.segmented button { padding: 8px 10px; font-size: 10px; }
.segmented button.active, .mapMode.active {
  border-color: rgba(226, 190, 104, .74);
  background: linear-gradient(180deg, rgba(165, 125, 50, .82), rgba(60, 43, 22, .92));
  color: #fff3cc;
}
#worldMap {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  filter: saturate(.82) contrast(1.08) brightness(.82) sepia(.11);
}
#worldMap.dragging-map { cursor: grabbing; }
.map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 76%;
  padding: 9px 10px;
  border: 1px solid rgba(198, 162, 90, .25);
  background: rgba(11, 13, 14, .74);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(0,0,0,.32);
}
.map-legend .pill { padding: 5px 8px; }

.right-dossier {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px 10px 0;
  overflow: hidden;
  border-left: 1px solid rgba(0,0,0,.72);
}
.right-dossier::before {
  content: "COMMAND DOSSIER";
  display: block;
  height: 28px;
  line-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(198,162,90,.32);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(62,46,23,.82), rgba(22,19,15,.92));
  color: #e9d39c;
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .18em;
}
.panel, .setup-card {
  display: none;
  height: calc(100% - 28px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(198,162,90,.32);
  background:
    linear-gradient(180deg, rgba(32, 36, 35, .94), rgba(11, 13, 14, .95)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), -22px 0 60px rgba(0,0,0,.24);
}
.panel.active, .setup-card:not(.hidden) { display: block; }
.panel::-webkit-scrollbar, .setup-card::-webkit-scrollbar, .catalog::-webkit-scrollbar, .country-sheet::-webkit-scrollbar, .notification-drawer::-webkit-scrollbar { width: 9px; height: 9px; }
.panel::-webkit-scrollbar-thumb, .setup-card::-webkit-scrollbar-thumb, .catalog::-webkit-scrollbar-thumb, .country-sheet::-webkit-scrollbar-thumb, .notification-drawer::-webkit-scrollbar-thumb { background: rgba(198,162,90,.35); border-radius: 99px; }
.panel::-webkit-scrollbar-track, .setup-card::-webkit-scrollbar-track, .catalog::-webkit-scrollbar-track { background: rgba(0,0,0,.22); }

.bottom-command-strip {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) 250px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(198, 162, 90, .36);
  background:
    linear-gradient(180deg, rgba(14, 17, 18, .98), rgba(30, 34, 34, .96)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 8px);
  box-shadow: 0 -20px 48px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05);
}
.logo-block strong { display: block; color: #f6e7bd; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.logo-block span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.command-nav { display: grid; grid-template-columns: repeat(9, minmax(70px, 1fr)); gap: 7px; min-width: 0; }
.nav {
  min-height: 50px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(44,53,53,.86), rgba(16,20,21,.96));
  border-color: rgba(198,162,90,.24);
}
.nav.active {
  border-color: rgba(238, 201, 112, .76);
  background: linear-gradient(180deg, rgba(142, 104, 42, .88), rgba(37, 27, 16, .98));
  color: #fff0c2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 0 0 1px rgba(198,162,90,.16), 0 0 24px rgba(198,162,90,.12);
}
.side-footer { display: flex; gap: 8px; justify-content: flex-end; }
.side-footer button { flex: 1; min-height: 46px; }

.card, .sheet-card, .notification-item {
  border: 1px solid rgba(198, 162, 90, .24);
  background:
    linear-gradient(180deg, rgba(43, 48, 47, .86), rgba(15, 18, 19, .92)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.022) 0 1px, transparent 1px 7px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 14px 30px rgba(0,0,0,.22);
  padding: 14px;
  position: relative;
}
.card::before, .sheet-card::before {
  content: "";
  position: absolute;
  left: 10px; right: 10px; top: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(198,162,90,.35), transparent);
}
.card h3, .card h4, .panel h3, .setup-card h3, .sheet-card h3 {
  margin: 0 0 10px;
  color: #f3dfab;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 14px;
}
.panel p, .card p, .setup-card p { color: #bdb293; line-height: 1.55; }
.value { color: #fff4d2; font-size: 28px; font-weight: 1000; letter-spacing: .02em; }
.sub { color: #b8ad90; font-size: 12px; }
.hero-card { background: linear-gradient(180deg, rgba(63, 52, 32, .86), rgba(20, 23, 22, .92)); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h3, .section-title h4 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.setup-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.metric {
  padding: 10px;
  min-width: 0;
  border: 1px solid rgba(198,162,90,.16);
  background: rgba(0,0,0,.18);
}
.metric .muted { display: block; margin-bottom: 3px; }
.metric strong { display: block; color: #fff0c2; font-size: 16px; overflow-wrap: anywhere; }
.big-score { font-size: 34px; font-weight: 1000; color: #fff0c2; margin: 3px 0 12px; }
.big-score span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .09em; }
.alert-row, .bad-soft {
  padding: 10px;
  margin: 8px 0;
  border: 1px solid rgba(225,90,79,.32);
  background: rgba(112, 31, 28, .22);
  color: #ffd0ca;
}

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left;
  color: #e5c985;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid rgba(198,162,90,.26);
  padding: 8px 7px;
  background: rgba(0,0,0,.18);
}
.table td { padding: 8px 7px; border-bottom: 1px solid rgba(255,255,255,.055); color: #d6cdb5; vertical-align: top; }
.table tr:hover td { background: rgba(198,162,90,.06); }

.bar-row { margin: 9px 0; }
.bar-row > div:first-child { display: flex; justify-content: space-between; color: #c9bd9a; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.bar-track, .mini-bar {
  height: 9px;
  border: 1px solid rgba(198,162,90,.20);
  background: rgba(0,0,0,.38);
  overflow: hidden;
  box-shadow: inset 0 1px 5px rgba(0,0,0,.55);
}
.bar-track span, .mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, #667d55, #d1a952); }
.bar-track .good, .mini-bar .good { background: linear-gradient(90deg, #5f7f55, #a7c56b); }
.bar-track .bad, .mini-bar .bad { background: linear-gradient(90deg, #7b2927, #e15a4f); }
.bar-track .neutral, .mini-bar .neutral { background: linear-gradient(90deg, #344c5a, #c6a25a); }
.progress, .progress-bar { display: block; }

.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.range-line { background: rgba(0,0,0,.16); border: 1px solid rgba(198,162,90,.14); padding: 10px; }
.range-line span { display: flex; justify-content: space-between; margin-bottom: 8px; color: #d8c8a3; }
input[type="range"] { padding: 0; accent-color: var(--brass); box-shadow: none; background: transparent; border: 0; }
.action-row { display: flex; align-items: end; gap: 10px; }
.action-row > label { flex: 1; margin-bottom: 0; }
.catalog {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 6px;
}
.construction-layout, .military-layout { grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); }
.sticky-detail { position: sticky; top: 0; align-self: start; }
.catalog-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.building-line, .requirement, .detail-section {
  padding: 9px 10px;
  border: 1px solid rgba(198,162,90,.16);
  background: rgba(0,0,0,.16);
  margin: 8px 0;
}
.requirement.faded, .faded { opacity: .58; filter: grayscale(.5); }
.resource-pill { display: inline-flex; padding: 5px 8px; margin: 3px; border: 1px solid rgba(198,162,90,.20); color: #ffe3a1; background: rgba(198,162,90,.10); font-size: 11px; text-transform: uppercase; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-grid, .sheet-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); gap: 18px; }
.flag-preview { min-height: 120px; display: grid; place-items: center; border: 1px dashed rgba(198,162,90,.30); background: rgba(0,0,0,.18); }
.flag-preview img { max-width: 100%; max-height: 160px; }
.flag-preview.empty { color: var(--muted); }
.mini-flag { width: 18px; height: 12px; object-fit: cover; border: 1px solid rgba(255,255,255,.24); }

.inspector {
  position: absolute;
  z-index: 8;
  width: min(390px, 36vw);
  max-height: min(76vh, 620px);
  overflow: auto;
  border: 1px solid rgba(229, 194, 108, .48);
  background:
    linear-gradient(180deg, rgba(44,45,39,.96), rgba(14,16,17,.97)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 5px);
  padding: 12px;
  box-shadow: 0 28px 80px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
}
.inspector.hidden { display: none; }
.inspector.dragging { opacity: .92; cursor: grabbing; }
.inspector-head, .sheet-head, .notification-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.inspector-head h4, .sheet-head h2, .notification-head h4 { margin: 0; color: #f7e4b2; text-transform: uppercase; letter-spacing: .08em; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 20px; }
.country-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sheet-section { margin-top: 12px; }
.war-negotiation {
  border: 1px solid rgba(229, 90, 79, .34);
  padding: 12px;
  background: linear-gradient(180deg, rgba(72, 32, 28, .30), rgba(0,0,0,.10));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.peace-actions { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); margin-top: 10px; }
.sheet-metrics.compact { margin-top: 8px; }

.notification-drawer {
  position: fixed;
  z-index: 12;
  right: 18px;
  top: 108px;
  width: min(480px, 92vw);
  max-height: calc(100vh - 205px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(229, 194, 108, .48);
  background: linear-gradient(180deg, rgba(37, 40, 38, .98), rgba(11, 13, 14, .98));
  box-shadow: 0 32px 90px rgba(0,0,0,.65);
}
.notification-item { margin-bottom: 10px; }
.notification-item.unread { border-color: rgba(231, 177, 73, .64); background: linear-gradient(180deg, rgba(70, 54, 27, .95), rgba(17,19,18,.96)); }
.notification-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.country-sheet, .game-over {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(7px);
}
.country-sheet {
  place-items: start center;
  overflow: auto;
}
.country-sheet > .sheet-card, .game-over-card {
  width: min(920px, 96vw);
  margin-top: 20px;
}
.game-over-card {
  padding: 34px;
  border: 1px solid rgba(229, 90, 79, .55);
  background: linear-gradient(180deg, rgba(74,27,25,.96), rgba(12,12,12,.98));
  box-shadow: var(--shadow);
  text-align: center;
}
.game-over-card h1 { color: #ffd4cd; text-transform: uppercase; letter-spacing: .12em; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: min(680px, 90vw);
  padding: 13px 16px;
  border: 1px solid rgba(198,162,90,.42);
  background: linear-gradient(180deg, rgba(49,52,47,.98), rgba(13,15,16,.98));
  color: #fff0c2;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}
.toast.bad { border-color: rgba(225,90,79,.62); color: #ffd2cc; background: linear-gradient(180deg, rgba(82,34,30,.98), rgba(16,12,12,.98)); }

@media (max-width: 1380px) {
  .command-topbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; }
  .time-controls { grid-column: auto; min-width: 300px; justify-content: flex-end; }
  .hud-grid { grid-template-columns: repeat(4, minmax(92px, 1fr)); }
  .war-room { grid-template-rows: 106px 1fr 82px; }
  .strategic-board { grid-template-columns: minmax(0, 1fr) minmax(350px, 34vw); }
  .command-nav { grid-template-columns: repeat(5, minmax(70px, 1fr)); }
  .bottom-command-strip { grid-template-columns: 170px 1fr 210px; }
}
@media (max-width: 1060px) {
  body { overflow: auto; }
  .app, .war-room { position: relative; min-height: 100vh; }
  .war-room { grid-template-rows: auto minmax(620px, 1fr) auto; }
  .command-topbar, .bottom-command-strip, .strategic-board { grid-template-columns: 1fr; }
  .time-controls { min-width: 0; justify-content: stretch; flex-wrap: wrap; }
  .right-dossier { padding: 0 12px 10px; min-height: 560px; }
  .map-panel { padding: 10px 12px; min-height: 560px; }
  .map-shell { min-height: 560px; border-right: 1px solid rgba(198,162,90,.35); }
  .hud-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .construction-layout, .military-layout, .policy-grid, .settings-grid { grid-template-columns: 1fr; }
  .command-nav { grid-template-columns: repeat(3, 1fr); }
  .inspector { width: min(390px, 88vw); }
}

/* Compatibility for generated JS fragments */
.metric > div:last-child {
  color: #fff0c2;
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}
.bar-row > span { color: #c9bd9a; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.bar-row > b { color: #f1ddb0; font-size: 11px; }
.bar-track {
  grid-column: 1 / -1;
  display: block;
  height: 10px;
  border: 1px solid rgba(198,162,90,.20);
  background: rgba(0,0,0,.38);
  overflow: hidden;
  box-shadow: inset 0 1px 5px rgba(0,0,0,.55);
}
.bar-track em, .mini-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #344c5a, #c6a25a);
}
.bar-track em.good { background: linear-gradient(90deg, #5f7f55, #a7c56b); }
.bar-track em.bad { background: linear-gradient(90deg, #7b2927, #e15a4f); }
.bar-track em.neutral { background: linear-gradient(90deg, #344c5a, #c6a25a); }
.mini-bar {
  display: inline-block;
  width: min(140px, 100%);
  vertical-align: middle;
  margin-right: 6px;
}
.catalog-card {
  width: 100%;
  text-align: left;
  white-space: normal;
  min-height: 92px;
  display: block;
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  border-color: rgba(198,162,90,.20);
  background: linear-gradient(180deg, rgba(37,44,42,.92), rgba(12,15,16,.95));
}
.catalog-card strong { color: #f5e4b5; text-transform: uppercase; letter-spacing: .06em; }
.catalog-card.active {
  border-color: rgba(238, 201, 112, .76);
  background: linear-gradient(180deg, rgba(91,73,37,.95), rgba(20,18,15,.97));
}
.catalog-card.blocked {
  border-color: rgba(225,90,79,.32);
  background: linear-gradient(180deg, rgba(54,35,31,.92), rgba(14,14,14,.96));
}
.fiscal-bars { display: grid; gap: 8px; }
.sheet-card { margin-bottom: 18px; }
.requirement.missing {
  border-color: rgba(225,90,79,.34);
  background: rgba(108, 31, 28, .26);
  color: #ffd0ca;
}
.setup-card:not(.hidden) ~ .panel { display: none; }

/* --------------------------------------------------------------------------
   Tab-stage command UI patch
   Map is now a dedicated screen opened from the Map command tab. Other panels
   become full-stage command dossiers so the map and forms never stack on top
   of each other.
-------------------------------------------------------------------------- */
.strategic-board {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 10px 12px;
}
.map-panel {
  display: none;
  min-width: 0;
  min-height: 0;
  padding: 0;
}
.map-panel.active {
  display: block;
  height: 100%;
}
.map-theater-grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
  gap: 12px;
}
.map-shell {
  border: 1px solid rgba(198, 162, 90, .35);
  min-height: 0;
}
.right-dossier {
  padding: 0;
  min-height: 0;
  border-left: 0;
}
.right-dossier.stage-hidden {
  display: none;
}
.right-dossier::before {
  content: "⚙ COMMAND DOSSIER";
}
.panel, .setup-card {
  height: calc(100% - 28px);
}
.inspector.inspector-dock {
  position: relative;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  max-height: none;
  height: 100%;
  overflow: auto;
  align-self: stretch;
  border-color: rgba(229, 194, 108, .42);
  background:
    linear-gradient(180deg, rgba(43,45,40,.98), rgba(14,16,17,.98)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 5px);
}
.inspector.inspector-dock .inspector-head {
  position: sticky;
  top: -12px;
  z-index: 2;
  padding: 0 0 10px;
  background: linear-gradient(180deg, rgba(43,45,40,1), rgba(43,45,40,.94));
  border-bottom: 1px solid rgba(198,162,90,.18);
}
.inspector .action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.inspector .action-row button,
.inspector .action-row select,
.inspector .action-row label {
  min-width: 0;
}
.inspector .action-row button {
  white-space: normal;
  line-height: 1.18;
  padding: 9px 8px;
}
.inspector .unit-count-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.founding-order {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(225, 190, 105, .42);
  background:
    linear-gradient(180deg, rgba(127, 86, 33, .25), rgba(12, 14, 15, .42)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 7px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 28px rgba(0,0,0,.22);
}
.founding-order .action-row {
  margin-top: 10px;
}
.inspector .table {
  min-width: 560px;
}
.inspector .table-wrap,
.panel .table-wrap {
  overflow-x: auto;
}
.table-wrap { width: 100%; overflow-x: auto; }
.nav {
  display: grid;
  place-items: center;
  gap: 3px;
  line-height: 1.05;
}
.nav span {
  display: block;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.65));
}
.hud-grid .card .muted::first-letter,
.card h3::first-letter,
.panel h3::first-letter {
  letter-spacing: .04em;
}
.map-legend::before {
  content: "⌖";
  color: #f3dfab;
  margin-right: 2px;
}
.bell-btn { padding-left: 14px; }
@media (max-width: 1380px) {
  .strategic-board { grid-template-columns: 1fr; }
  .map-theater-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); }
}
@media (max-width: 1060px) {
  .map-theater-grid { grid-template-columns: 1fr; min-height: 980px; }
  .inspector.inspector-dock { min-height: 390px; height: auto; }
  .right-dossier { padding: 0; }
  .map-panel { min-height: 0; }
}


/* --------------------------------------------------------------------------
   Construction category + hosting-ready compact control polish
-------------------------------------------------------------------------- */
.construction-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
  margin: 0 0 10px;
}
.construction-tab {
  min-height: 36px;
  padding: 7px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: .055em;
  white-space: nowrap;
}
.construction-tab span {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(198,162,90,.24);
  background: rgba(0,0,0,.24);
  color: #f3dfab;
  font-size: 10px;
}
.construction-tab.active {
  border-color: rgba(238, 201, 112, .76);
  background: linear-gradient(180deg, rgba(142, 104, 42, .88), rgba(37, 27, 16, .98));
  color: #fff0c2;
}
#gameLogoutBtn {
  border-color: rgba(225, 90, 79, .56);
}

/* Compact control sizing retained for game-hosted screens */
button { padding: 8px 11px; font-size: 11px; line-height: 1.15; }
input, select { padding: 8px 10px; min-height: 34px; font-size: 13px; line-height: 1.2; }
label { font-size: 11px; margin-bottom: 8px; }
label input, label select { margin-top: 4px; }
.badge, .pill, .online-pill { padding: 6px 9px; font-size: 10px; }
.boot-screen { padding: 22px; }
.boot-card { width: min(760px, 92vw); padding: 24px; }
.boot-card h1 { margin: 4px 0 10px; font-size: clamp(30px, 4vw, 56px); }
.boot-card p { font-size: 13px; line-height: 1.55; }
.brand-kicker { font-size: 11px; letter-spacing: .16em; }
.auth-box, .campaign-box { margin-top: 16px; padding: 14px; }
.boot-grid { gap: 10px; }
.boot-actions { gap: 8px; margin-top: 8px; }
.boot-actions button, .boot-actions select { min-height: 36px; }
.boot-actions button { min-width: 108px; flex: 0 0 auto; }
.boot-actions select { width: auto; min-width: 170px; max-width: 260px; flex: 1 1 210px; }
.status-line { margin-top: 12px; font-size: 11px; }
.side-footer button { min-height: 40px; }
.nav { min-height: 44px; padding: 7px 9px; font-size: 11px; }
.map-toolbar .segmented button, .time-controls button, .notification-actions button, .country-actions button, .action-row button, .panel button, .setup-card button, .inspector button, .sheet-card button { padding: 8px 10px; }
.panel input, .panel select, .setup-card input, .setup-card select, .inspector input, .inspector select, .sheet-card input, .sheet-card select { padding: 7px 9px; min-height: 32px; }
.topbar .badge, .topbar .bell-btn, .map-toolbar .segmented button { min-height: 34px; }
.card, .sheet-card, .notification-item { padding: 12px; }
.card h3, .card h4, .panel h3, .setup-card h3, .sheet-card h3 { margin-bottom: 8px; font-size: 13px; }
.metric { padding: 9px; }
.metric strong { font-size: 15px; }
.value { font-size: 24px; }
.big-score { font-size: 28px; margin: 2px 0 10px; }
.table th { padding: 7px 6px; }
.table td { padding: 7px 6px; }
.resource-pill { padding: 4px 7px; font-size: 10px; }
.building-line, .requirement, .detail-section { padding: 8px 9px; margin: 7px 0; }
.icon-btn { width: 30px; height: 30px; font-size: 18px; }
.country-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.inspector { width: min(370px, 34vw); }
.inspector .action-row { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 7px; }
.catalog-card { min-height: 76px; padding: 10px 11px; font-size: 11px; }
input[type="color"] { padding: 3px; min-height: 34px; }
input[type="range"] { min-height: 0; }
button.full { margin-top: 8px; }
@media (max-width: 1060px) {
  .boot-card { width: min(92vw, 680px); padding: 20px; }
  .boot-grid { grid-template-columns: 1fr; }
  .boot-actions button, .boot-actions select { flex: 1 1 100%; max-width: none; width: 100%; }
  .construction-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspector { width: min(390px, 88vw); }
}


/* --------------------------------------------------------------------------
   Mobile battlefield layout patch
   Keeps the desktop command-center UI intact, but turns phones/tablets into a
   single-column, touch-friendly war room with horizontal HUD/nav rails.
-------------------------------------------------------------------------- */
@media (max-width: 820px) {
  html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
  }
  body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-attachment: fixed;
  }
  body::before { opacity: .11; background-size: 32px 32px, 32px 32px; }
  body::after { background: radial-gradient(circle at center, transparent 48%, rgba(0,0,0,.42) 100%); }

  button, input, select {
    font-size: 13px;
  }
  button {
    min-height: 40px;
    padding: 9px 10px;
    line-height: 1.12;
    letter-spacing: .035em;
    touch-action: manipulation;
  }
  input, select {
    min-height: 40px;
    padding: 9px 10px;
  }
  label {
    font-size: 10px;
    letter-spacing: .055em;
  }

  .boot-screen {
    position: fixed;
    place-items: start center;
    overflow: auto;
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }
  .boot-card {
    width: min(100%, 440px);
    padding: 18px 14px;
    margin: 8px 0;
  }
  .boot-card::before, .boot-card::after { left: 10px; right: 10px; }
  .boot-card h1 {
    font-size: clamp(28px, 11vw, 42px);
    line-height: .96;
    text-shadow: 0 3px 0 rgba(0,0,0,.25);
  }
  .boot-card p {
    font-size: 12px;
    line-height: 1.48;
  }
  .brand-kicker { font-size: 9px; letter-spacing: .12em; }
  .auth-box, .campaign-box { padding: 12px; margin-top: 12px; }
  .boot-grid { grid-template-columns: 1fr; gap: 8px; }
  .boot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .boot-actions button,
  .boot-actions select {
    width: 100%;
    max-width: none;
    min-width: 0;
    flex: initial;
  }
  .campaign-box .boot-actions { grid-template-columns: 1fr; }

  .app,
  .war-room {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    min-height: 100dvh;
    height: auto;
  }
  .war-room {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .command-topbar {
    position: sticky;
    top: 0;
    z-index: 14;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: max(7px, env(safe-area-inset-top)) 8px 7px;
  }
  .hud-grid {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding: 0 2px 3px;
  }
  .hud-grid::-webkit-scrollbar,
  .command-nav::-webkit-scrollbar,
  .construction-tabs::-webkit-scrollbar,
  .segmented::-webkit-scrollbar { height: 4px; }
  .hud-grid .card {
    flex: 0 0 118px;
    scroll-snap-align: start;
    padding: 7px 8px;
  }
  .hud-grid .value { font-size: 14px; }
  .hud-grid .sub { font-size: 9px; }
  .time-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: stretch;
  }
  .time-controls .badge,
  .time-controls button {
    width: 100%;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    white-space: normal;
    text-align: center;
  }
  #notificationsBtn { grid-column: 1 / -1; }

  .strategic-board {
    display: block;
    padding: 8px;
    min-height: 0;
  }
  .right-dossier {
    padding: 0;
    min-height: 0;
    border-left: 0;
  }
  .right-dossier::before {
    height: 24px;
    line-height: 24px;
    padding: 0 9px;
    font-size: 9px;
    letter-spacing: .12em;
  }
  .panel,
  .setup-card {
    height: auto !important;
    min-height: min(680px, calc(100dvh - 174px));
    max-height: none;
    overflow: visible;
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  }
  .panel p, .card p, .setup-card p { font-size: 12px; line-height: 1.48; }
  .section-title {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
  }
  .card,
  .sheet-card,
  .notification-item {
    padding: 11px;
  }
  .card h3, .card h4, .panel h3, .setup-card h3, .sheet-card h3 {
    font-size: 12px;
    line-height: 1.25;
  }
  .value { font-size: 22px; }
  .big-score { font-size: 24px; }
  .metric { padding: 8px; }
  .metric strong { font-size: 14px; }
  .grid-2, .grid-3, .construction-layout, .military-layout, .policy-grid, .settings-grid, .detail-grid, .sheet-metrics {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .action-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .action-row > label { width: 100%; }
  .country-actions { grid-template-columns: 1fr; }
  .range-line { padding: 9px; }

  .map-panel.active {
    display: block;
    height: auto;
  }
  .map-theater-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
    min-height: 0 !important;
    height: auto;
  }
  .map-shell {
    height: min(62dvh, 520px);
    min-height: 390px;
    border: 1px solid rgba(198, 162, 90, .35);
  }
  .map-toolbar {
    left: 8px;
    right: 8px;
    top: 8px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
    padding: 8px;
  }
  .map-toolbar strong { font-size: 11px; }
  #mapHint { display: none; }
  .segmented {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .segmented button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 7px 8px;
    font-size: 9px;
  }
  .map-legend {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    padding: 6px 7px;
    gap: 5px;
  }
  .map-legend .pill { padding: 4px 6px; font-size: 9px; }
  #worldMap { touch-action: none; }

  .inspector,
  .inspector.inspector-dock {
    width: 100% !important;
    min-height: 0;
    height: auto !important;
    max-height: none;
    padding: 10px;
  }
  .inspector.inspector-dock .inspector-head {
    top: -10px;
  }
  .inspector .action-row,
  .inspector .unit-count-grid {
    grid-template-columns: 1fr !important;
  }
  .inspector .table { min-width: 520px; }
  .founding-order { padding: 10px; }

  .construction-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 3px;
  }
  .construction-tab {
    flex: 0 0 auto;
    min-width: 108px;
    min-height: 34px;
    font-size: 9px;
    padding: 7px 8px;
  }
  .catalog {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .catalog-card {
    min-height: 70px;
    padding: 10px;
    font-size: 11px;
  }
  .sticky-detail {
    position: static;
  }

  .table-wrap,
  .panel .table-wrap,
  .inspector .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(198,162,90,.12);
    background: rgba(0,0,0,.12);
  }
  .table {
    min-width: 560px;
    font-size: 11px;
  }
  .table th,
  .table td {
    padding: 7px 6px;
  }

  .bottom-command-strip {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 7px 8px max(8px, env(safe-area-inset-bottom));
  }
  .logo-block {
    display: none;
  }
  .command-nav {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }
  .nav {
    flex: 0 0 72px;
    min-height: 50px;
    padding: 6px 6px;
    font-size: 9px;
  }
  .nav span { font-size: 17px; }
  .side-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .side-footer button {
    min-height: 34px;
    padding: 7px 5px;
    font-size: 9px;
  }

  .notification-drawer {
    left: 8px;
    right: 8px;
    top: calc(88px + env(safe-area-inset-top));
    width: auto;
    max-height: calc(100dvh - 170px - env(safe-area-inset-bottom));
    padding: 10px;
  }
  .country-sheet,
  .game-over {
    padding: max(10px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom));
    place-items: start center;
  }
  .country-sheet > .sheet-card,
  .game-over-card {
    width: 100%;
    margin-top: 0;
  }
  .sheet-head,
  .notification-head,
  .inspector-head {
    gap: 8px;
  }
  .toast {
    left: 8px;
    right: 8px;
    bottom: calc(102px + env(safe-area-inset-bottom));
    transform: none;
    max-width: none;
    padding: 10px 12px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .hud-grid .card { flex-basis: 112px; }
  .time-controls { grid-template-columns: 1fr; }
  .map-shell { min-height: 360px; height: 58dvh; }
  .nav { flex-basis: 66px; }
  .side-footer button { font-size: 8px; letter-spacing: .025em; }
  .boot-actions { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .command-topbar { position: relative; }
  .hud-grid .card { flex-basis: 110px; }
  .map-shell { height: 78dvh; min-height: 300px; }
  .bottom-command-strip { position: sticky; }
  .panel, .setup-card { min-height: 420px; }
}

/* Custom currency controls */
.compact-currency-row { align-items: end; }
.compact-currency-row label { min-width: 0; }
.metric small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}
@media (max-width: 720px) {
  .compact-currency-row { grid-template-columns: 1fr; }
}
