:root {
  color-scheme: dark;
  --command-bg: #101e28;
  --command-deep: #0a1721;
  --command-border: #334b55;
  --command-text: #eff3ef;
  --command-muted: #aebec1;
  --command-gold: #ebc97f;
  --command-mint: #8bd7b8;
  background: var(--command-deep);
  color: var(--command-text);
}

body { min-width: 300px; }
.command-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 290px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  isolation: isolate;
  overflow: hidden;
}
.command-shell .button { line-height: 1.25; }
.command-hud {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(178px, 1fr) auto minmax(178px, 1fr);
  align-items: center;
  gap: clamp(8px, 1.35vw, 24px);
  padding: 10px clamp(13px, 1.75vw, 28px);
  background: #101e28;
  border-bottom: 1px solid #415661;
  box-shadow: 0 7px 25px #0007;
}
.command-brand,
.hud-metric {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--command-text);
  padding: 0;
  text-align: left;
}
.command-brand { justify-self: start; }
.command-emblem {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: none;
  background: #273541;
  color: var(--command-gold);
  border: 1px solid #8d7953;
  border-radius: 8px;
}
.command-brand strong,
.command-brand small {
  display: block;
  white-space: nowrap;
}
.command-brand strong {
  font-size: 1.22rem;
  letter-spacing: -.042em;
  line-height: 1;
}
.command-brand small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--command-muted);
  font-size: .76rem;
  margin-top: 6px;
  font-weight: 750;
}
.command-brand .flag-ar { width: 15px; height: 10px; }
.command-brand .flag-ar i { width: 3px; height: 3px; }
.command-metrics {
  display: grid;
  grid-auto-flow: column;
  gap: clamp(6px, .85vw, 14px);
}
.hud-metric {
  gap: 8px;
  min-height: 44px;
  padding: 5px 10px 5px 6px;
  border: 1px solid #31434c;
  border-radius: 8px;
  background: #182a35;
  transition: background 150ms, border-color 150ms;
}
.hud-metric:hover { background: #233c48; border-color: #6e9996; }
.hud-metric > .iconbox { width: 28px; height: 28px; flex-basis: 28px; border-radius: 5px; }
.hud-metric > .iconbox svg { width: 16px; height: 16px; }
.hud-metric .mint { background: #294938; color: #9fe5b9; }
.hud-metric .amber { background: #4b382b; color: #f3c68e; }
.hud-metric .blue { background: #2b4253; color: #a1cae9; }
.hud-metric .violet { background: #40384d; color: #dbc3f4; }
.hud-metric small,
.hud-metric strong {
  display: block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hud-metric small { font-size: .72rem; line-height: 1.2; color: var(--command-muted); }
.hud-metric strong { font-size: 1rem; letter-spacing: -.025em; line-height: 1.18; margin-top: 2px; }
.hud-controls { display: flex; align-items: center; gap: 9px; justify-self: end; }
.hud-date { display: grid; gap: 3px; text-align: right; white-space: nowrap; }
.hud-date strong { font-size: .81rem; color: #e3e9e5; }
.hud-date small { font-size: .72rem; color: var(--command-muted); }
.command-primary {
  background: var(--command-gold);
  color: #14222a;
  border-color: #f6dca5;
  box-shadow: inset 0 1px #ffffff36;
  font-weight: 800;
}
.command-primary:hover { background: #f8dca4; }
.icon-control {
  display: grid;
  place-items: center;
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  padding: 0;
  border-radius: 8px;
  color: var(--command-muted);
  border: 1px solid #48606a;
  background: #1a2d37;
}
.icon-control:hover { color: var(--command-text); background: #2b4652; }

.command-map {
  isolation: isolate;
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: #0a222e;
  outline: none;
  --atlas-inspector-offset: 0px;
}
.command-map > .atlas-stage { position: absolute; inset: 0; min-height: 0; }
.map-overlays { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.map-card {
  pointer-events: auto;
  position: absolute;
  width: clamp(222px, 19vw, 283px);
  overflow: hidden;
  border: 1px solid #6e857d88;
  border-radius: 12px;
  background: #10212aed;
  color: var(--command-text);
  box-shadow: 0 16px 37px #030e16b3;
}
.presidency { top: 25px; left: clamp(14px, 1.75vw, 29px); }
.atlas-inspector { top: 25px; right: clamp(14px, 1.75vw, 29px); }
.map-card-content { position: relative; padding: 15px; }
.presidency-photo {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 102px;
  background: linear-gradient(0deg, #111e29 1%, #111e2911 60%), url('./assets/casa-rosada.webp') right 55% / cover no-repeat;
  color: #fff2d8;
  padding: 9px 15px;
  font-size: .83rem;
  font-weight: 800;
}
.presidency-photo .flag-ar { width: 18px; height: 12px; box-shadow: 0 0 8px #111; }
.map-card-mark {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  color: var(--command-gold);
  font-size: .83rem;
  font-weight: 800;
}
.map-card h1, .map-card h2 {
  color: #f6f3e9;
  font-size: clamp(1.33rem, 1.7vw, 1.72rem);
  font-weight: 800;
  margin: 3px 0 7px;
  line-height: 1.13;
  letter-spacing: -.046em;
  overflow-wrap: anywhere;
}
.map-card p {
  color: var(--command-muted);
  font-size: .86rem;
  line-height: 1.51;
}
.command-start {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.command-start input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #66808a;
  border-radius: 7px;
  background: #0b1821;
  color: var(--command-text);
  font-size: .91rem;
}
.command-start input::placeholder { color: #b5c4c6; }
.command-start .button { min-height: 40px; }
.command-seed { display: block; margin-top: 8px; font-size: .75rem; color: var(--command-mint); }
.command-term { margin: 13px 0 12px; }
.command-term > div:first-child { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; }
.command-term span { display: inline-flex; gap: 5px; align-items: center; color: #b9cacc; }
.command-term strong { color: #fff9e9; }
.command-progress {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  margin-top: 8px;
}
.command-progress i { height: 4px; border-radius: 4px; background: #3a515b; }
.command-progress .election-mark { background: #ac9e6c; }
.command-progress .done { background: #9ddabc; }
.map-secondary {
  width: 100%;
  min-height: 38px;
  background: #263d46;
  color: #edf3f0;
  border-color: #5b777d;
  white-space: normal;
}
.map-secondary:hover { background: #3d5963; }
.inspector-close { position: absolute; top: 10px; right: 10px; width: 29px; height: 29px; border-radius: 6px; }
.atlas-inspector.has-selection .map-card-mark { padding-right: 32px; }
.inspector-countries { display: flex; gap: 5px; margin-top: 12px; }
.inspector-countries button {
  display: grid;
  place-items: center;
  min-height: 36px;
  flex: 1;
  background: #213641;
  border: 1px solid #48636c;
  border-radius: 7px;
  font-size: 1rem;
  padding: 2px;
}
.inspector-countries button:hover { background: #39545f; border-color: var(--command-mint); }
.inspector-data { display: grid; gap: 8px; margin: 12px 0 13px; }
.inspector-data div { padding-top: 7px; border-top: 1px solid #3c5661; }
.inspector-data dt { color: var(--command-muted); font-size: .75rem; }
.inspector-data dd { color: #eff4ee; margin: 2px 0 0; font-weight: 800; font-size: .83rem; }
.command-map.has-panel .map-overlays { opacity: .38; pointer-events: none; }
.command-map.has-panel .map-overlays .map-card { pointer-events: none; visibility: hidden; }

.command-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: absolute;
  z-index: 4;
  inset: clamp(10px, 3.25vh, 30px) auto;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 35px, 1035px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #71867f;
  border-radius: 15px;
  background: #10212bfa;
  color: var(--command-text);
  box-shadow: 0 23px 64px #000c;
}
.command-panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(12px, 2vw, 23px);
  background: linear-gradient(95deg, #23394a, #192c38);
  border-bottom: 1px solid #526369;
}
.command-panel-heading > .iconbox { width: 40px; height: 40px; flex-basis: 40px; }
.command-panel-heading h2 {
  color: #fff3da;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  letter-spacing: -.045em;
  line-height: 1.1;
}
.command-panel-heading h2:focus { outline: none; }
.command-panel-heading p { margin-top: 4px; font-size: .84rem; color: #c0ced0; line-height: 1.4; }
.panel-close { margin-left: auto; align-self: flex-start; }
.command-panel-body {
  min-height: 0;
  min-width: 0;
  padding: clamp(9px, 1.65vw, 20px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #68818b #162630;
}
.command-panel-body > .chart-panel { margin-block: 13px; }
.production-tools { align-items: end; }
.production-tools > div > span { color: #b9c8cc; font-size: .82rem; display: block; margin-top: 4px; }
.production-tools .field { width: max(180px, 31%); }
.field-report .report-lead { grid-column: 1 / -1; }
.field-report .report-lead h4 { font-size: clamp(1.25rem, 3.1vw, 2rem); }

.command-dock {
  display: grid;
  place-items: center;
  z-index: 5;
  background: #101e28;
  border-top: 1px solid #455b65;
  box-shadow: 0 -7px 25px #0007;
  padding: 7px 10px max(7px, env(safe-area-inset-bottom));
}
.command-dock nav {
  width: min(100%, 930px);
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(3px, .7vw, 10px);
}
.dock-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  padding: 3px;
  color: #c1d0d4;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: .79rem;
  font-weight: 790;
  line-height: 1.2;
}
.dock-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 29px;
  background: #223744;
  border: 1px solid #3d5660;
  border-radius: 6px;
  color: #d4e5e3;
}
.dock-item:hover { border-color: #4c6d75; background: #1d323d; }
.dock-item.selected { border-color: #997d4c; background: #3b372b; color: #ffe7b9; }
.dock-item.selected .dock-icon { border-color: #917845; background: #534a35; color: var(--command-gold); }
.toast { z-index: 10; bottom: 83px; background: #e7c783; color: #12232e; border-color: #f0d7a2; }
.skip-link { border-radius: 7px; color: #10212b; }

@media (max-width: 1150px) {
  .hud-date { display: none; }
  .command-hud { grid-template-columns: minmax(142px, 1fr) auto minmax(142px, 1fr); }
}
@media (max-width: 850px) {
  .command-hud { grid-template-columns: 1fr auto; gap: 7px 9px; padding-block: 7px; }
  .command-metrics { grid-row: 2; grid-column: 1 / -1; grid-auto-columns: 1fr; gap: 5px; }
  .command-brand strong { font-size: 1.05rem; }
  .command-emblem { width: 35px; height: 35px; }
  .command-emblem svg { width: 22px; }
  .command-brand small { margin-top: 3px; }
  .hud-controls { grid-row: 1; grid-column: 2; }
  .hud-date { display: grid; margin-right: 3px; }
  .hud-metric { min-height: 35px; padding: 4px; }
  .hud-metric strong { font-size: .89rem; }
  .presidency, .atlas-inspector { top: 13px; }
  .map-card { width: min(224px, 35vw); }
  .presidency-photo { min-height: 77px; }
  .command-dock { padding-inline: 4px; }
}
@media (max-width: 620px) {
  .command-hud { padding-inline: 7px; }
  .command-brand { gap: 6px; }
  .hud-controls { gap: 5px; }
  .hud-date { display: none; }
  .hud-help { width: 34px; height: 34px; flex-basis: 34px; }
  .hud-controls .button { min-height: 34px; font-size: .74rem; padding-inline: 6px; gap: 4px; }
  .hud-metric { gap: 4px; }
  .hud-metric > .iconbox { width: 21px; height: 21px; flex-basis: 21px; border-radius: 4px; }
  .hud-metric > .iconbox svg { width: 13px; height: 13px; }
  .hud-metric small { font-size: .64rem; }
  .hud-metric strong { font-size: .76rem; }
  .presidency {
    inset: auto 49px 13px 8px;
    width: auto;
    max-width: 330px;
  }
  .presidency-photo { display: none; }
  .presidency .map-card-content { padding: 10px; }
  .presidency p { font-size: .78rem; }
  .command-start { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-top: 8px; }
  .command-start input { min-height: 36px; font-size: 1rem; padding-inline: 6px; }
  .command-start .button { min-height: 36px; font-size: .75rem; gap: 4px; padding-inline: 6px; }
  .command-start .button svg { display: none; }
  .presidency-active {
    inset: 8px auto auto 8px;
    width: min(170px, 47vw);
  }
  .map-overlays:has(.atlas-inspector.has-selection) .presidency-active { inset: auto auto 14px 8px; }
  .presidency-active .map-card-mark { font-size: .72rem; }
  .presidency-active h1 { font-size: 1.1rem; }
  .presidency-active .map-secondary { display: none; }
  .command-term { margin: 7px 0 0; }
  .atlas-inspector { display: none; }
  .atlas-inspector.has-selection {
    display: block;
    top: 8px;
    right: 8px;
    width: min(213px, 55vw);
    max-height: calc(100% - 16px);
    overflow: auto;
  }
  .atlas-inspector .map-card-content { padding: 9px; }
  .atlas-inspector p { font-size: .78rem; }
  .atlas-inspector .map-secondary { font-size: .75rem; min-height: 33px; }
  .inspector-close { top: 5px; right: 5px; }
  .command-panel { width: calc(100% - 9px); inset-block: 5px; border-radius: 9px; }
  .command-panel-heading { gap: 6px; padding: 8px; }
  .command-panel-heading > .iconbox { display: none; }
  .command-panel-heading p { display: none; }
  .panel-close { width: 33px; height: 33px; flex-basis: 33px; }
  .dock-item { min-height: 45px; font-size: .58rem; gap: 3px; padding: 2px 0; }
  .dock-icon { width: 27px; height: 24px; }
  .dock-icon svg { width: 16px; }
  .toast { bottom: 63px; }
}
@media (max-width: 360px) {
  .hud-metric { gap: 2px; }
  .hud-metric > .iconbox { display: none; }
  .dock-item { font-size: .53rem; }
}
@media (max-height: 530px) and (min-width: 621px) {
  .command-hud { grid-template-columns: 1fr auto 1fr; padding-block: 4px; }
  .command-metrics { grid-row: 1; grid-column: auto; }
  .hud-date { display: none; }
  .hud-controls { grid-column: auto; }
  .command-dock { padding-block: 3px; }
  .dock-item { min-height: 39px; gap: 2px; }
  .dock-icon { height: 22px; width: 26px; }
  .dock-icon svg { width: 16px; }
  .map-card { top: 8px; max-height: calc(100% - 16px); overflow: auto; }
  .presidency-photo { min-height: 51px; }
  .map-card-content { padding: 9px; }
  .command-panel { inset-block: 5px; }
}

.inspector-select { margin: 11px 0; }
.inspector-select select {
  background-color: #1d3540;
  border-color: #5b777d;
  color: #eff4ee;
}
.inspector-links { display: grid; gap: 6px; }
.atlas-inspector { max-height: calc(100% - 47px); overflow: auto; }
.command-dock .dock-icon { position: relative; }
.dock-unread {
  position: absolute;
  inset: -5px -6px auto auto;
  border-radius: 20px;
  min-width: 15px;
  padding: 1px 4px;
  background: #ebc97f;
  color: #182620;
  font-style: normal;
  font-size: .63rem;
}
.dock-unread[hidden] { display: none; }

@media (max-width: 620px) {
  .command-dock nav { gap: 2px; }
  .atlas-inspector.has-selection { max-height: calc(100% - 70px); }
}

.trade-currency { display: grid; justify-items: start; gap: 5px; flex: 0 0 auto; }
.trade-currency strong { color: var(--command-gold); font-variant-numeric: tabular-nums; }
.trade-currency small, .inspector-sources { color: var(--command-muted); font-size: .8rem; }
.inspector-sources { margin-top: 11px; }
.inspector-sources ul { padding-left: 1.15rem; line-height: 1.5; }
.inspector-sources a:focus-visible { outline-offset: 2px; }

.command-panel .system-tabs { margin-bottom: 15px; }
.command-panel .section-body > form.section-body { padding: 0; }
.command-panel :is(.finance-evidence, .finance-rollover, .scandal-option, [data-company-preview]) {
  padding: 10px;
  border: 1px solid #3e5a67;
  border-radius: 8px;
  background: #0c202b;
}
.command-panel .finance-rollover { margin-top: 7px; }
.command-panel .finance-rollover form { padding-inline: 0; }
.command-panel :is(summary, .inspector-sources summary) { cursor: pointer; }
.command-panel .scandal-option { display: grid; gap: 6px; justify-items: start; }
.command-panel .scandal-option .button { white-space: normal; }
