:root {
  color-scheme: dark;
  font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif;
  --navy-950: #020a11;
  --navy-900: #06131f;
  --navy-850: #081b2a;
  --navy-800: #0a2234;
  --steel-600: #395267;
  --steel-400: #718b9d;
  --cyan: #75d8f4;
  --cyan-muted: #3993ae;
  --gold: #e0bb66;
  --gold-muted: #8c723c;
  --green: #91cb38;
  --warning: #f0a521;
  --danger: #d0524f;
  --text: #edf7ff;
  --muted: #91a9ba;
  --header-height: 86px;
  --footer-height: 48px;
  --panel-edge: rgba(129, 179, 204, 0.44);
  --panel-fill: rgba(3, 19, 31, 0.9);
  --focus: #ffe298;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  /*
   * Scrolls by default. The sim-pit stylesheets clamp this to a fixed
   * non-scrolling panel, but only on displays large enough for the fixed
   * layout - see simpit-layout.css. Hiding overflow here as well put the
   * clamp back on every small screen.
   */
  overflow-x: hidden;
  background: var(--navy-950);
  color: var(--text);
  letter-spacing: 0.025em;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, rgba(0, 11, 20, 0.52), rgba(3, 20, 31, 0.12) 36%, rgba(3, 20, 31, 0.12) 64%, rgba(0, 11, 20, 0.55)),
    linear-gradient(180deg, rgba(1, 11, 19, 0.12), rgba(1, 10, 17, 0.32)),
    url("/static/assets/backgrounds/aegean-home-two-f16-armed-left-v3-4k.webp") center / cover no-repeat;
}

body::after {
  background:
    radial-gradient(circle at 50% 38%, transparent 34%, rgba(0, 6, 12, 0.14) 72%, rgba(0, 4, 9, 0.48) 100%),
    repeating-linear-gradient(0deg, rgba(111, 192, 222, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.minimum-resolution {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  place-items: center;
  padding: 32px;
  background: #03101a;
  text-align: center;
}

.minimum-resolution > div {
  width: min(620px, 100%);
  padding: 38px;
  border: 1px solid var(--gold-muted);
  background: #071a28;
  box-shadow: 0 0 80px #000;
}

.minimum-resolution__mark {
  color: var(--gold);
  font-size: 64px;
}

.minimum-resolution h1 {
  color: var(--gold);
}

.minimum-resolution p {
  color: var(--muted);
  line-height: 1.6;
}

/* Authentication shell */
.auth-view {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  align-items: center;
  justify-items: center;
  overflow: auto;
  padding: 104px clamp(24px, 4vw, 76px) 64px;
}

.auth-view::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(90deg, rgba(1, 10, 17, 0.88) 0 32%, rgba(1, 10, 17, 0.18) 58%, rgba(1, 10, 17, 0.76) 100%),
    linear-gradient(180deg, rgba(0, 7, 12, 0.2), rgba(0, 7, 12, 0.7));
}

.auth-command-layout {
  display: grid;
  width: min(1760px, 100%);
  min-height: min(790px, calc(100vh - 180px));
  grid-template-columns: minmax(0, 1.15fr) minmax(520px, 0.85fr);
  align-items: stretch;
  border: 1px solid rgba(117, 216, 244, 0.5);
  background: rgba(1, 12, 20, 0.48);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.auth-brief {
  display: grid;
  align-content: end;
  gap: 22px;
  min-height: 680px;
  border-right: 1px solid rgba(117, 216, 244, 0.34);
  padding: clamp(42px, 5vw, 92px);
  background: linear-gradient(180deg, rgba(1, 12, 20, 0.04), rgba(1, 12, 20, 0.86));
}

.auth-brief__code {
  color: var(--cyan);
  font-size: clamp(14px, 0.9vw, 18px);
  font-weight: 900;
  letter-spacing: 0.2em;
}

.auth-brief h1 {
  max-width: 860px;
  margin: 0;
  color: white;
  font-size: clamp(58px, 5.2vw, 104px);
  line-height: 0.86;
  letter-spacing: 0.025em;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.9);
}

.auth-brief > p {
  max-width: 760px;
  margin: 0;
  color: #d5e9f2;
  font-size: clamp(19px, 1.2vw, 24px);
  font-weight: 700;
  line-height: 1.55;
}

.auth-capabilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-capabilities span {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(117, 216, 244, 0.3);
  padding: 12px 16px;
  background: rgba(3, 20, 31, 0.82);
  font-size: 16px;
  font-weight: 900;
}

.auth-capabilities b {
  color: var(--gold);
}

.auth-brief .auth-brief__notice {
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  background: rgba(2, 13, 21, 0.82);
  color: #b7cad4;
  font-size: 15px;
}

.auth-brand {
  position: fixed;
  top: 24px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand div {
  display: flex;
  flex-direction: column;
}

.auth-brand strong {
  font-size: 36px;
  font-style: italic;
  letter-spacing: 0.1em;
}

.auth-brand span:last-child {
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.18em;
}

.brand-emblem {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--steel-400);
  clip-path: polygon(50% 0, 96% 35%, 80% 100%, 20% 100%, 4% 35%);
  color: var(--gold);
  font-size: 24px;
  background: rgba(4, 22, 34, 0.92);
}

.auth-language {
  position: fixed;
  top: 24px;
  right: 28px;
  display: flex;
  border: 1px solid var(--steel-600);
}

.auth-language button,
.language-selector button {
  min-width: 56px;
  min-height: 52px;
  border: 0;
  border-right: 1px solid var(--steel-600);
  padding: 8px 10px;
  background: rgba(5, 22, 34, 0.9);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-language button:last-child,
.language-selector button:last-child {
  border-right: 0;
}

.auth-language button.active,
.language-selector button.active {
  background: var(--gold);
  color: #061019;
}

.panel {
  border: 1px solid var(--panel-edge);
  background: rgba(4, 19, 30, 0.95);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
}

.auth-panel {
  display: grid;
  width: 100%;
  align-content: center;
  padding: clamp(34px, 4vw, 70px);
  clip-path: none;
  box-shadow: none;
}

.auth-panel label {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.auth-panel input,
.auth-panel select {
  min-height: 58px;
  font-size: 20px;
  padding: 14px 16px;
}

.auth-heading {
  margin-bottom: 22px;
  text-align: center;
}

.auth-heading h2 {
  margin: 8px 0 6px;
  color: var(--gold);
  letter-spacing: 0.12em;
  font-size: clamp(34px, 2.4vw, 48px);
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 14px;
  letter-spacing: 0.2em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
}

.auth-tabs button,
.workbench-nav button,
.actions button,
.library-filters > button,
.primary,
.danger {
  border: 1px solid var(--steel-600);
  border-radius: 0;
  padding: 10px 14px;
  background: #0b2638;
  color: var(--text);
  cursor: pointer;
}

.auth-tabs button {
  min-height: 60px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-panel .primary.full-width {
  min-height: 62px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.auth-status-strip {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  min-height: 42px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(117, 216, 244, 0.35);
  background: rgba(1, 10, 17, 0.94);
}

.auth-status-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(117, 216, 244, 0.2);
  color: #9fb7c3;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-status-strip i {
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(145, 203, 56, 0.8);
}

.auth-tabs button.active,
.auth-tabs button:hover,
.workbench-nav button.active,
.workbench-nav button:hover {
  border-color: var(--gold);
  background: #17384a;
  color: var(--gold);
}

.primary,
button.primary {
  border-color: #5faec7;
  background: #0e536c;
}

.danger,
button.danger {
  border-color: #9a4a48;
  background: #522124;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
  color: #b4c9d8;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

label.inline {
  flex-direction: row;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #355369;
  border-radius: 0;
  padding: 10px;
  background: #061521;
  color: white;
}

textarea {
  min-height: 105px;
  resize: vertical;
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

.status-message {
  min-height: 22px;
  margin-top: 14px;
  color: #83dd9d;
}

/* Authenticated header */
.app-header {
  position: relative;
  z-index: 20;
  display: grid;
  height: var(--header-height);
  grid-template-columns: minmax(260px, 0.9fr) minmax(510px, 1.25fr) minmax(330px, 0.9fr);
  align-items: stretch;
  gap: 14px;
  border-bottom: 1px solid rgba(98, 151, 181, 0.55);
  padding: 7px 14px;
  background: linear-gradient(180deg, rgba(4, 19, 31, 0.98), rgba(3, 16, 27, 0.9));
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.38);
}

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

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  font-size: clamp(25px, 2vw, 38px);
  font-style: italic;
  letter-spacing: 0.1em;
  line-height: 0.95;
}

.brand-copy > span {
  overflow: hidden;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  overflow: hidden;
  color: #6e8b9d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-tab {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #315168;
  padding: 8px 18px;
  background: linear-gradient(180deg, rgba(9, 34, 51, 0.94), rgba(3, 19, 31, 0.95));
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  cursor: pointer;
}

.mode-tab::after {
  position: absolute;
  right: 28%;
  bottom: 3px;
  left: 28%;
  height: 2px;
  content: "";
  background: transparent;
}

.mode-tab.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(49, 55, 52, 0.96), rgba(12, 30, 38, 0.96));
  box-shadow: inset 0 0 24px rgba(223, 185, 100, 0.14), 0 0 12px rgba(223, 185, 100, 0.2);
}

.mode-tab.active::after {
  background: var(--gold);
  box-shadow: 0 0 7px var(--gold);
}

.mode-tab__icon {
  color: var(--gold);
  font-size: 22px;
}

.mode-tab > span:last-child {
  display: grid;
  min-width: 0;
  text-align: left;
}

.mode-tab strong {
  overflow: hidden;
  font-size: clamp(16px, 1.1vw, 20px);
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-tab small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.language-selector {
  display: flex;
  border: 1px solid var(--steel-600);
}

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

.user-area > div {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.user-area strong {
  overflow: hidden;
  max-width: 120px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge,
.badge {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(34, 89, 112, 0.58);
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 0.09em;
}

.exit-button {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: clamp(98px, 7vw, 132px);
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  border: 2px solid #d3a52d;
  padding: 10px 16px;
  background: repeating-linear-gradient(
    135deg,
    #e0b536 0 11px,
    #151917 11px 22px
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 135, 0.28),
    0 0 12px rgba(216, 169, 47, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.45);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  color: #fff3c5;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.exit-button::before {
  position: absolute;
  z-index: -1;
  inset: 5px 7px;
  border: 1px solid rgba(245, 196, 67, 0.46);
  background: linear-gradient(180deg, rgba(15, 24, 25, 0.9), rgba(5, 10, 12, 0.94));
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  content: "";
}

.exit-button::after {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffd759;
  box-shadow: 0 0 7px #ffc82f;
  content: "";
}

.exit-button__icon,
.exit-button__label {
  position: relative;
  z-index: 1;
}

.exit-button__icon {
  color: #f1bd36;
  font-size: 1.05em;
}

.exit-button:hover,
.exit-button:focus-visible {
  border-color: #ffe07a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 235, 164, 0.5),
    0 0 18px rgba(237, 190, 67, 0.48),
    0 7px 16px rgba(0, 0, 0, 0.52);
}

.exit-button:active {
  transform: translateY(1px);
}

/* Three-column command center */
.command-dashboard {
  display: grid;
  /*
   * min-height, not height, and scrolling rather than hidden.
   *
   * A fixed viewport height with overflow:hidden made anything taller
   * than the screen unreachable rather than merely below the fold - on a
   * 13-inch laptop that clipped 177px of the dashboard and the whole
   * right-hand edge of the third column, with no way to scroll to
   * either.
   */
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  grid-template-columns: minmax(228px, 0.72fr) minmax(620px, 1.8fr) minmax(248px, 0.8fr);
  gap: clamp(8px, 0.75vw, 16px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 9px clamp(8px, 0.75vw, 16px);
  background:
    linear-gradient(90deg, rgba(0, 11, 20, 0.5), rgba(3, 20, 31, 0.08) 34%, rgba(3, 20, 31, 0.08) 66%, rgba(0, 11, 20, 0.52)),
    linear-gradient(180deg, rgba(1, 11, 19, 0.08), rgba(1, 10, 17, 0.3)),
    url("/static/assets/backgrounds/aegean-home-two-f16-left-v2-4k.webp") center / cover no-repeat;
}

.dashboard-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(99, 158, 185, 0.48) transparent;
  scrollbar-width: thin;
}

.dashboard-column--left .profile-panel {
  flex: 1.15;
}

.dashboard-column--left .simulator-panel {
  flex: 1;
}

.dashboard-column--left .access-panel {
  flex: 0.82;
}

.data-panel {
  position: relative;
  min-height: 0;
  border: 1px solid var(--panel-edge);
  background:
    linear-gradient(135deg, rgba(31, 86, 111, 0.1), transparent 35%),
    var(--panel-fill);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  box-shadow: inset 0 0 28px rgba(16, 82, 108, 0.12);
}

.data-panel::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  content: "";
  background: linear-gradient(transparent, rgba(92, 186, 220, 0.62), transparent);
}

.data-panel > header {
  display: flex;
  min-height: 33px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(100, 149, 174, 0.38);
  margin: 0 10px;
}

.data-panel h2 {
  margin: 0;
  color: #dbeef7;
  font-size: clamp(13px, 0.72vw, 16px);
  letter-spacing: 0.075em;
}

.panel-code {
  color: #668ba0;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}

.panel-body {
  padding: 8px 11px 10px;
  color: #bdd0dc;
  font-size: clamp(13px, 0.66vw, 15px);
}

.panel-body p {
  margin: 4px 0;
}

.state-loading,
.state-empty,
.state-error {
  display: grid;
  min-height: 52px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.state-error {
  color: #ffada8;
}

.status-light {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(145, 203, 56, 0.74);
}

.profile-summary {
  display: grid;
  grid-template-columns: minmax(84px, 0.9fr) 1.2fr;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  display: grid;
  overflow: hidden;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(100, 190, 224, 0.55);
  border-radius: 50%;
  background: radial-gradient(circle, #16384d, #030c13 72%);
  box-shadow: inset 0 0 18px rgba(72, 182, 219, 0.22);
  color: #a8d8ea;
  font-size: clamp(24px, 2.6vw, 48px);
}

.profile-avatar img,
.commander-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.profile-avatar img {
  object-position: 50% 34%;
}

.profile-facts {
  display: grid;
  gap: 4px;
}

.profile-facts small {
  display: block;
  color: #718fa1;
  font-size: 12px;
}

.profile-facts strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-stars {
  color: var(--gold);
  letter-spacing: 0.14em;
}

.experience-track {
  height: 4px;
  margin-top: 5px;
  background: #153247;
}

.experience-track span {
  display: block;
  width: 72%;
  height: 100%;
  background: var(--cyan);
}

.agent-heading,
.access-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hex-icon {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--gold-muted);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: rgba(22, 53, 68, 0.76);
  color: var(--gold);
  font-size: 20px;
}

.agent-apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}

.agent-app {
  min-width: 0;
  border-left: 1px solid rgba(117, 169, 192, 0.3);
  padding-left: 5px;
  text-align: center;
}

.agent-app span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-app small {
  color: var(--green);
  font-size: 11px;
}

.access-badge {
  color: var(--gold);
  font-size: clamp(18px, 1.45vw, 25px);
  letter-spacing: 0.08em;
}

.panel-action,
.panel-link,
.mission-row-button {
  border: 1px solid rgba(102, 156, 181, 0.58);
  padding: 5px 8px;
  background: rgba(7, 30, 44, 0.8);
  color: #dcecf4;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.07em;
}

.panel-action {
  width: 100%;
  margin-top: 8px;
}

.panel-link {
  border: 0;
  padding: 4px;
  background: transparent;
  color: var(--muted);
}

.activity-list,
.notification-list,
.recent-mission-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li,
.notification-list li {
  display: grid;
  grid-template-columns: 17px 1fr auto;
  align-items: start;
  gap: 6px;
  border-bottom: 1px solid rgba(99, 145, 167, 0.2);
  padding: 5px 0;
}

.activity-list li:last-child,
.notification-list li:last-child {
  border-bottom: 0;
}

.activity-list time {
  color: #668396;
  font-size: 11px;
}

.notification-list .warning-icon {
  color: var(--warning);
}

.notification-list button {
  border: 0;
  padding: 2px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
}

.count-badge {
  display: grid;
  min-width: 19px;
  min-height: 19px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #07101a;
  font-size: 14px;
  font-weight: 900;
}

.recent-mission-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(99, 145, 167, 0.2);
  padding: 5px 0;
}

.recent-mission-list li:last-child {
  border-bottom: 0;
}

.recent-mission-copy {
  min-width: 0;
}

.recent-mission-copy strong,
.recent-mission-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-mission-copy small {
  color: #738fa1;
  font-size: 12px;
}

.mission-status {
  color: var(--green);
  font-size: 12px;
}

.right-panel-pair {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 8px;
}

.compatibility-state {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
}

.compatibility-state span:first-child {
  color: var(--green);
  font-size: 27px;
}

/* Pentagon workspace and icon-only military controls */
.pentagon-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 25px clamp(116px, 12vh, 140px) 1fr;
}

.workspace-heading {
  display: grid;
  grid-template-columns: minmax(14px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  color: #b7cbd8;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.workspace-heading p {
  margin: 0;
}

.workspace-heading__line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(104, 167, 195, 0.66));
}

#menuDepthIndicator {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.pentagon-control-rail {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(82px, 1fr) auto minmax(82px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 2px clamp(54px, 6.48vh, 81px) 5px;
}

.military-nav-button {
  position: relative;
  top: 0px;
  display: grid;
  width: clamp(108px, 12.96vh, 162px);
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.62));
  transition: filter 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.military-nav-button--home {
  justify-self: start;
  top: 107px;
  left: 87px;
}

.military-nav-button--back {
  justify-self: end;
  top: 107px;
  left: -21px;
}

.military-nav-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.military-nav-button:hover:not(:disabled),
.military-nav-button:focus-visible:not(:disabled) {
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 7px rgba(223, 186, 98, 0.58));
  transform: translateY(-1px);
}

.military-nav-button:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
}

.military-nav-button:disabled {
  opacity: 0.4;
  filter: grayscale(0.58) drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
}

.control-rail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(126, 169, 190, 0.62);
  font-size: 11px;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.control-rail-status span {
  width: clamp(18px, 3vw, 52px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105, 169, 197, 0.66));
}

.control-rail-status span:last-child {
  transform: scaleX(-1);
}

.pentagon-stage {
  position: relative;
  width: min(100%, 1180px);
  height: 100%;
  min-height: 0;
  justify-self: center;
  isolation: isolate;
  transform: scale(0.75);
  transform-origin: 62% 4%;
}

.pentagon-stage::before {
  position: absolute;
  inset: 4% 4% 1%;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 50% 46%, rgba(222, 187, 102, 0.16), transparent 42%),
    radial-gradient(circle at 50% 49%, rgba(8, 45, 63, 0.82), rgba(1, 12, 20, 0.14) 64%, transparent 76%);
  clip-path: polygon(50% 0, 98% 38%, 79% 100%, 21% 100%, 2% 38%);
}

.pentagon-geometry {
  position: absolute;
  inset: 0 0 18px;
  z-index: -1;
  width: 100%;
  height: calc(100% - 18px);
  overflow: visible;
  pointer-events: none;
}

.outer-perimeter-shadow {
  fill: rgba(2, 15, 24, 0.48);
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 15;
}

.outer-perimeter {
  fill: rgba(2, 17, 27, 0.18);
  stroke: url("#perimeterGlow");
  stroke-width: 4.5;
  vector-effect: non-scaling-stroke;
}

.inner-perimeter {
  fill: rgba(1, 13, 22, 0.72);
  stroke: rgba(226, 195, 128, 0.78);
  stroke-width: 2.75;
  vector-effect: non-scaling-stroke;
}

.geometry-trace {
  fill: none;
  stroke: rgba(130, 184, 208, 0.36);
  stroke-width: 2;
  stroke-dasharray: 3 6;
  vector-effect: non-scaling-stroke;
}

.pentagon-vertex-lights circle {
  fill: url("#vertexGlow");
  opacity: 0.7;
}

.pentagon-sector-layer {
  position: absolute;
  inset: 0 0 18px;
  z-index: 1;
}

.pentagon-sector {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: clamp(16px, 2vw, 30px);
  background:
    linear-gradient(145deg, rgba(18, 57, 77, 0.93), rgba(2, 20, 32, 0.94) 64%),
    rgba(4, 26, 40, 0.94);
  color: var(--text);
  cursor: pointer;
  filter: drop-shadow(0 0 1px rgba(143, 204, 226, 0.9)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.54));
  transition: color 140ms ease, filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.pentagon-sector::before {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(129, 178, 201, 0.32);
  content: "";
  clip-path: inherit;
  pointer-events: none;
}

.pentagon-sector[data-slot="1"] {
  top: 1.74%;
  left: 50%;
  width: 47%;
  height: 46.52%;
  clip-path: polygon(0% 0%, 100% 79.44%, 42.55% 100%, 0% 65.89%);
}

.pentagon-sector[data-slot="1"] .sector-content {
  position: absolute;
  top: 61.33%;
  left: 35.64%;
  transform: translate(-50%, -50%);
}

.pentagon-sector[data-slot="2"] {
  top: 38.7%;
  left: 62.4%;
  width: 34.6%;
  height: 59.57%;
  clip-path: polygon(100% 0%, 47.98% 100%, 0% 58.76%, 21.97% 16.06%);
}

.pentagon-sector[data-slot="2"] .sector-content {
  position: absolute;
  top: 43.71%;
  left: 42.49%;
  transform: translate(-50%, -50%);
}

.pentagon-sector[data-slot="3"] {
  top: 73.7%;
  left: 21%;
  width: 58%;
  height: 24.57%;
  align-items: flex-end;
  padding-bottom: clamp(10px, 1.4vh, 20px);
  clip-path: polygon(100% 100%, 0% 100%, 28.62% 0%, 71.38% 0%);
}

.pentagon-sector[data-slot="3"] .sector-content {
  position: absolute;
  top: 96%;
  left: 50%;
  transform: translate(-50%, -100%);
  gap: 2px;
}

.pentagon-sector[data-slot="3"] .sector-number {
  display: none;
}

.pentagon-sector[data-slot="3"] .sector-icon {
  width: clamp(24px, 2.1vw, 36px);
  min-height: 14px;
}

.pentagon-sector[data-slot="3"] .sector-description {
  display: none;
}

.pentagon-sector[data-slot="4"] {
  top: 38.7%;
  left: 3%;
  width: 34.6%;
  height: 59.57%;
  clip-path: polygon(52.02% 100%, 0% 0%, 78.03% 16.06%, 100% 58.76%);
}

.pentagon-sector[data-slot="4"] .sector-content {
  position: absolute;
  top: 43.71%;
  left: 57.51%;
  transform: translate(-50%, -50%);
}

.pentagon-sector[data-slot="5"] {
  top: 1.74%;
  left: 3%;
  width: 47%;
  height: 46.52%;
  clip-path: polygon(0% 79.44%, 100% 0%, 100% 65.89%, 57.45% 100%);
}

.pentagon-sector[data-slot="5"] .sector-content {
  position: absolute;
  top: 61.33%;
  left: 64.36%;
  transform: translate(-50%, -50%);
}

.pentagon-sector:hover:not(:disabled),
.pentagon-sector:focus-visible:not(:disabled),
.pentagon-sector.selected {
  z-index: 2;
  color: #fff9e8;
  filter: drop-shadow(0 0 2px var(--gold)) drop-shadow(0 0 12px rgba(222, 185, 101, 0.4)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}

.pentagon-sector:hover:not(:disabled) .sector-icon,
.pentagon-sector:focus-visible:not(:disabled) .sector-icon,
.pentagon-sector.selected .sector-icon {
  color: var(--gold);
  transform: scale(1.04);
}

.pentagon-sector:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.48));
  opacity: 0.55;
}

.sector-content {
  display: grid;
  min-width: 0;
  width: 52%;
  max-width: 52%;
  justify-items: center;
  gap: clamp(3px, 0.7vh, 8px);
  text-align: center;
  pointer-events: none;
}

.sector-number {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: clamp(18px, 1.45vw, 26px);
  font-weight: 800;
}

.sector-icon {
  display: grid;
  min-height: 18px;
  width: clamp(34px, 3.1vw, 54px);
  aspect-ratio: 1;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(158, 205, 224, 0.4);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(94, 160, 190, 0.28), rgba(4, 18, 28, 0.2) 72%);
  box-shadow: 0 0 12px rgba(94, 178, 210, 0.16), inset 0 0 10px rgba(0, 0, 0, 0.35);
  color: #dce9ef;
  font-size: clamp(16px, 1.55vw, 27px);
  line-height: 1;
  transition: inherit;
}

.pentagon-sector:hover:not(:disabled) .sector-icon,
.pentagon-sector:focus-visible:not(:disabled) .sector-icon,
.pentagon-sector.selected .sector-icon {
  border-color: rgba(224, 187, 102, 0.75);
  box-shadow: 0 0 18px rgba(224, 187, 102, 0.32), inset 0 0 10px rgba(0, 0, 0, 0.35);
}

.sector-title {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1.16;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.sector-description {
  display: -webkit-box;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  color: #9eb4c1;
  font-size: clamp(13px, 0.78vw, 17px);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.wing-commander-center {
  position: absolute;
  top: 37.42%;
  left: 50%;
  z-index: 4;
  display: flex;
  height: 29.4%;
  aspect-ratio: 1 / 1;
  width: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.72));
  transform: translateX(-50%);
  text-align: center;
}

.commander-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  overflow: hidden;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #34586d, #06121c 60%, #01070b);
  color: var(--gold);
  font-size: clamp(21px, 2.4vw, 42px);
}

.commander-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.wing-commander-label {
  position: absolute;
  top: 67.5%;
  left: 17%;
  z-index: 4;
  display: flex;
  width: 66%;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
  pointer-events: none;
}

.commander-stars {
  color: white;
  font-size: clamp(9px, 0.6vw, 12px);
  letter-spacing: 0.1em;
}

.wing-commander-label h2 {
  margin: 1px 0;
  font-size: clamp(14px, 1vw, 18px);
  letter-spacing: 0.05em;
}

.wing-commander-label > strong {
  overflow: hidden;
  max-width: 100%;
  color: var(--gold);
  font-size: clamp(13px, 0.85vw, 17px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wing-commander-label > span {
  color: #7f9bad;
  font-size: clamp(11px, 0.66vw, 14px);
}

.wing-commander-label p {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 0;
  color: var(--green);
  font-size: clamp(10px, 0.6vw, 13px);
}

.pentagon-stage-caption {
  position: absolute;
  right: 33%;
  bottom: 0;
  left: 33%;
  z-index: 6;
  display: flex;
  height: 21px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gold-muted);
  background: rgba(4, 18, 27, 0.9);
  color: var(--gold);
  font-size: clamp(11px, 0.62vw, 14px);
  letter-spacing: 0.12em;
}

/* Persistent system footer */
.status-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  height: var(--footer-height);
  grid-template-columns: repeat(5, minmax(120px, 1fr)) minmax(130px, 0.8fr);
  border-top: 1px solid rgba(87, 142, 169, 0.52);
  padding: 4px 14px;
  background: rgba(3, 16, 27, 0.95);
}

.status-footer > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border-right: 1px solid rgba(78, 123, 145, 0.28);
  padding: 0 12px;
}

.status-footer > div > span {
  color: #c9dce7;
  font-size: 20px;
}

.status-footer p {
  display: grid;
  min-width: 0;
  margin: 0;
}

.status-footer small {
  overflow: hidden;
  color: #728b9b;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-footer strong {
  overflow: hidden;
  color: var(--green);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-footer .footer-version {
  justify-content: flex-end;
  border-right: 0;
  color: #7891a0;
  font-size: 13px;
}

/* Existing authenticated mission/admin workbench */
.workbench-dialog {
  position: fixed;
  inset: 0;
  z-index: var(--cpms-z-overlay);
  display: none;
  place-items: center;
  padding: var(--cpms-space-3) var(--cpms-space-4);
  background: rgb(0 5 9 / 82%);
}

.workbench-dialog.open {
  display: grid;
}

.workbench-surface {
  display: grid;
  width: 96vw;
  max-width: none;
  height: 94vh;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  border: var(--cpms-border-default);
  background: var(--cpms-color-surface-1);
  box-shadow: var(--cpms-shadow-raised);
}

.workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--cpms-border-default);
  padding: var(--cpms-space-4) var(--cpms-space-6);
  background: var(--cpms-color-surface-2);
}

.workbench-header h2 {
  margin: 3px 0 0;
  color: var(--cpms-color-focus);
  font-size: clamp(24px, 1.55vw, 31px);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.workbench-close {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--cpms-color-danger);
  background: var(--cpms-color-surface-readonly);
  color: var(--cpms-color-text-primary);
  cursor: pointer;
  font-size: 24px;
}

.workbench-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--cpms-space-2);
  border-bottom: var(--cpms-border-default);
  padding: var(--cpms-space-3) var(--cpms-space-4);
  background: var(--cpms-color-surface-1);
}

.workbench-content {
  overflow: auto;
  padding: var(--cpms-space-6);
  font-size: var(--cpms-font-size-lg);
  line-height: var(--cpms-line-height-default);
}

.workbench-nav button {
  min-height: max(58px, var(--cpms-target-preferred));
  padding: var(--cpms-space-3) var(--cpms-space-4);
  font-size: var(--cpms-font-size-lg);
  font-weight: 900;
  letter-spacing: 0.045em;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workbench-content .panel {
  padding: 28px;
}

.workbench-content h2 {
  font-size: clamp(27px, 1.7vw, 34px);
}

.workbench-content h3 {
  font-size: clamp(22px, 1.35vw, 28px);
}

.workbench-content label,
.workbench-content table {
  font-size: 17px;
}

.workbench-content input,
.workbench-content select,
.workbench-content textarea,
.workbench-content button {
  min-height: 48px;
  font-size: 17px;
}

.workbench-content .small {
  min-height: 42px;
  padding: 9px 12px;
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.warning {
  border: 1px solid #be8123;
  margin: 12px 0;
  padding: 10px;
  background: #4b3211;
  color: #ffdda0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 15px;
}

th,
td {
  border-bottom: 1px solid #294052;
  padding: 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--cyan);
}

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

.small {
  border: 1px solid #3d5f76;
  margin: 2px;
  padding: 6px 8px;
  background: #102c3f;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

.inactive-user {
  background: #6a2228;
}

.active-user {
  background: #185d3d;
}

.deleted {
  opacity: 0.58;
}

.muted,
.library-count {
  color: #89a1b7;
}

.library-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 8px 14px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: calc(var(--footer-height) + 18px);
  z-index: 90;
  width: min(390px, calc(100vw - 44px));
  border-left: 3px solid var(--gold);
  padding: 12px 15px;
  background: rgba(4, 19, 29, 0.97);
  box-shadow: 0 12px 35px #0009;
  color: #e9f3f8;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast-region.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1599px) {
  :root {
    --header-height: 76px;
    --footer-height: 42px;
  }

  .auth-view {
    padding: 88px 26px 54px;
  }

  .auth-command-layout {
    min-height: min(620px, calc(100vh - 150px));
    grid-template-columns: minmax(0, 1fr) minmax(470px, 0.82fr);
  }

  .auth-brief {
    min-height: 600px;
    gap: 15px;
    padding: 38px;
  }

  .auth-brief h1 {
    font-size: clamp(52px, 5.1vw, 76px);
  }

  .auth-brief > p {
    font-size: 17px;
  }

  .auth-panel {
    padding: 30px 38px;
  }

  .auth-panel input,
  .auth-panel select {
    min-height: 52px;
  }

  .app-header {
    grid-template-columns: minmax(238px, 0.82fr) minmax(500px, 1.36fr) minmax(300px, 0.82fr);
    gap: 8px;
    padding: 6px 9px;
  }

  .brand-emblem {
    width: 40px;
  }

  .command-dashboard {
    grid-template-columns: minmax(215px, 0.72fr) minmax(590px, 1.82fr) minmax(230px, 0.8fr);
    gap: 7px;
    padding: 7px;
  }

  .data-panel > header {
    min-height: 29px;
    margin: 0 8px;
  }

  .panel-body {
    padding: 6px 8px 8px;
  }

  .pentagon-workspace {
    grid-template-rows: 22px clamp(108px, 14vh, 126px) 1fr;
  }

  .pentagon-control-rail {
    padding-right: clamp(54px, 6.48vh, 81px);
    padding-left: clamp(54px, 6.48vh, 81px);
  }

  .status-footer {
    padding-right: 7px;
    padding-left: 7px;
  }

  .status-footer > div {
    gap: 5px;
    padding: 0 7px;
  }
}

@media (min-width: 3000px) {
  :root {
    --header-height: 132px;
    --footer-height: 72px;
  }

  body {
    font-size: 1.45rem;
  }

  .app-header {
    grid-template-columns: minmax(480px, 0.9fr) minmax(900px, 1.25fr) minmax(570px, 0.9fr);
    gap: 24px;
    padding: 12px 24px;
  }

  .brand-emblem {
    width: 72px;
    font-size: 34px;
  }

  .brand-copy > span {
    font-size: 17px;
  }

  .brand-copy small {
    font-size: 15px;
  }

  .mode-tab small {
    font-size: 16px;
  }

  .command-dashboard {
    grid-template-columns: minmax(430px, 0.72fr) minmax(1220px, 1.8fr) minmax(470px, 0.8fr);
    gap: 24px;
    padding: 16px 24px;
  }

  .pentagon-workspace {
    grid-template-rows: 42px 144px 1fr;
  }

  .panel-code,
  .eyebrow {
    font-size: 16px;
  }

  .panel-body {
    padding: 15px 20px 18px;
  }

  .commander-avatar {
    width: clamp(104px, 3.25vw, 128px);
  }

  .data-panel > header {
    min-height: 52px;
    margin: 0 18px;
  }

  .status-footer small {
    font-size: 15px;
  }

  .status-footer strong,
  .status-footer .footer-version {
    font-size: 17px;
  }
}

/*
 * Responsive command dashboard.
 *
 * The three columns are sized for a wide desktop. On anything narrower
 * they no longer fit: at 1512px they measured 320 + 808 + 355 plus gaps,
 * which is wider than the viewport, so the third column was pushed out
 * and clipped. Below each threshold the layout reflows rather than
 * overflowing.
 */
/*
 * Column reflow is NOT attempted here.
 *
 * A first attempt remapped the three columns onto grid-template-areas so
 * the pentagon would sit above the two side panels. It collapsed the
 * pentagon into a strip and overlapped the panels, because the centre
 * cell holds several sibling elements rather than one, and naming them
 * all "centre" stacked them on top of each other.
 *
 * The reflow needs the pentagon's own markup read first. What is fixed
 * below and in the sim-pit stylesheets is the part that made content
 * genuinely unreachable: the page could not scroll at all.
 */

/*
 * Below this the interface genuinely cannot be operated - it is a
 * mission planner, not a phone app. The previous floor was 1279px wide
 * or 719px tall, which refused to run on a 13-inch laptop in a shorter
 * window and on every tablet, while the manual promised both.
 */
@media (max-width: 599px) {
  .minimum-resolution {
    display: grid;
  }

  #authView,
  #appShell,
  .toast-region {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* BUILD 0.6.0H — Mission Workflow editor forms (Mission Setup,        */
/* Objectives/Threats/Flights/Loadout entity cards, Route Planner,     */
/* Timing, Validation & Export) merged onto the Codex pentagon shell.  */
/* Ported from the pre-merge 0.6.0G workflow CSS — verified no rule    */
/* below uses a negative margin.                                      */
/* ------------------------------------------------------------------ */
.workflow-shell {
  position: relative;
  border: 1px solid rgba(117, 216, 244, 0.28);
  background:
    linear-gradient(135deg, rgba(117, 216, 244, 0.035), transparent 28%),
    linear-gradient(180deg, #07151d, #030b10);
  margin: 0 0 18px;
  padding: 18px;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 18px 46px rgba(0, 0, 0, 0.26);
}
.workflow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(113, 139, 157, 0.18);
  padding: 0 2px 14px;
  color: #9ecfd3;
}
.workflow-heading > div {
  display: grid;
  gap: 5px;
}
.workflow-heading strong {
  color: #eaf8ff;
  font-size: clamp(18px, 1.7vw, 26px);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.workflow-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(145, 203, 56, 0.42);
  padding: 7px 10px;
  background: rgba(145, 203, 56, 0.07);
  color: #c9f28d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.workflow-live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(145, 203, 56, 0.92);
}
.workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.workflow-section {
  position: relative;
  border: 1px solid rgba(94, 140, 161, 0.24);
  margin: 14px 0;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(117, 216, 244, 0.025), transparent 44%),
    rgba(4, 17, 24, 0.86);
  box-shadow: inset 2px 0 rgba(117, 216, 244, 0.22);
}
.workflow-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: #7ee7ef;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.workflow-section h3::before {
  width: 16px;
  height: 1px;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 8px rgba(224, 187, 102, 0.6);
}
.workflow-action-status { margin: 8px 0 12px; color: #b8cace; font-size: 15px; min-height: 18px; }
.workflow-action-status[data-kind="working"] { color: #ffd166; }
.workflow-action-status[data-kind="success"] { color: #65f2a4; }
.workflow-action-status[data-kind="error"] { color: #ff7b7b; }
.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.workflow-grid .full { grid-column: 1 / -1; }
.workflow-grid textarea { min-height: 72px; }
.workflow-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.workflow-columns section { border: 1px solid #18313a; background: #040b0f; padding: 12px; min-height: 150px; }
.workflow-columns h3 { margin: 0 0 10px; color: #56ded6; font-size: 15px; letter-spacing: 1px; }
.workflow-columns p { border-top: 1px solid #13262d; margin: 8px 0 0; padding-top: 8px; color: #b8cace; font-size: 15px; }
.workflow-validation { max-height: 260px; overflow: auto; margin-top: 14px; padding: 12px; background: #02070a; border: 1px solid #18313a; color: #cfe6e8; white-space: pre-wrap; }
.entity-form { border: 1px solid #18313a; background: #040b0f; padding: 10px 14px; margin: 10px 0; }
.entity-form summary { cursor: pointer; color: #79cbff; font-size: 15px; letter-spacing: 0.5px; text-transform: uppercase; padding: 4px 0; }
.entity-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.entity-card { border: 1px solid #18313a; background: #061116; padding: 12px 14px; }
.entity-card .workflow-actions { margin-top: 10px; }

.flight-test-console {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(224, 187, 102, 0.52);
  padding: clamp(18px, 2.2vw, 28px);
  background:
    linear-gradient(118deg, rgba(224, 187, 102, 0.11), transparent 35%),
    radial-gradient(circle at 88% 15%, rgba(117, 216, 244, 0.12), transparent 28%),
    #07141c;
  box-shadow:
    inset 3px 0 var(--gold),
    0 14px 38px rgba(0, 0, 0, 0.26);
}
.flight-test-console::after {
  position: absolute;
  top: -34px;
  right: -24px;
  width: 180px;
  height: 110px;
  border: 1px solid rgba(117, 216, 244, 0.12);
  content: "";
  pointer-events: none;
  transform: rotate(-18deg);
}
.flight-test-console__intro {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.flight-test-console h3 {
  margin: 5px 0 6px;
  color: #fff2c9;
  font-size: clamp(24px, 2.3vw, 34px);
  letter-spacing: 0.09em;
}
.flight-test-console p {
  max-width: 740px;
  margin: 0;
  color: #9cb2bf;
  line-height: 1.55;
}
.flight-test-console__launch {
  display: inline-flex;
  min-width: 245px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--gold);
  padding: 14px 18px;
  background: linear-gradient(110deg, #2f677b, #1e4b60);
  box-shadow: 0 0 24px rgba(117, 216, 244, 0.1);
  font-weight: 900;
  letter-spacing: 0.08em;
}
.flight-test-console__actions {
  display: grid;
  min-width: 245px;
  gap: 7px;
}
.flight-test-console__secondary {
  border: 1px solid rgba(117, 216, 244, 0.28);
  padding: 8px 12px;
  background: rgba(4, 18, 25, 0.8);
  color: #9ec5d3;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.flight-test-console__secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.flight-test-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}
.flight-test-stages > div {
  position: relative;
  display: grid;
  min-height: 74px;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 9px;
  border: 1px solid rgba(113, 139, 157, 0.27);
  padding: 10px 12px;
  background: rgba(2, 10, 15, 0.66);
  transition: border-color 180ms ease, background 180ms ease;
}
.flight-test-stages > div:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  width: 9px;
  height: 1px;
  content: "";
  background: #486270;
}
.flight-test-stages span {
  display: grid;
  width: 32px;
  height: 32px;
  grid-row: 1 / 3;
  place-items: center;
  border: 1px solid #45606e;
  color: #8299a5;
  font-size: 12px;
  font-weight: 900;
}
.flight-test-stages strong {
  align-self: end;
  color: #d7e7ee;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.flight-test-stages small {
  overflow: hidden;
  color: #728895;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flight-test-stages > div[data-state="working"] {
  border-color: rgba(224, 187, 102, 0.68);
  background: rgba(224, 187, 102, 0.07);
}
.flight-test-stages > div[data-state="working"] span {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 14px rgba(224, 187, 102, 0.16);
}
.flight-test-stages > div[data-state="complete"] {
  border-color: rgba(145, 203, 56, 0.44);
  background: rgba(145, 203, 56, 0.055);
}
.flight-test-stages > div[data-state="complete"] span {
  border-color: var(--green);
  color: #071018;
  background: var(--green);
}
.flight-test-stages > div[data-state="ready"] {
  border-color: rgba(117, 216, 244, 0.58);
  background: rgba(117, 216, 244, 0.07);
}
.flight-test-stages > div[data-state="ready"] span {
  border-color: var(--cyan);
  color: var(--cyan);
}
.flight-test-console__status {
  min-height: 20px;
  margin-top: 14px;
  color: #b9cbd4;
  line-height: 1.5;
}
.flight-test-console__status[data-kind="working"] { color: #ffe097; }
.flight-test-console__status[data-kind="success"] { color: #b9ef7e; }
.flight-test-console__status[data-kind="error"] { color: #ff8c89; }
.flight-test-console__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.flight-test-console__summary span {
  border: 1px solid rgba(113, 139, 157, 0.27);
  padding: 6px 9px;
  background: rgba(3, 12, 17, 0.68);
  color: #9fb5c0;
  font-size: 12px;
}
.flight-test-console__summary b {
  color: #edf8fb;
}
.workflow-command-deck {
  position: sticky;
  top: -18px;
  z-index: 12;
  margin: 14px 0;
  border: 1px solid rgba(117, 216, 244, 0.31);
  background: rgba(3, 13, 19, 0.72);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.42),
    inset 0 1px rgba(255, 255, 255, 0.03);
}
.workflow-mission-strip {
  display: grid;
  grid-template-columns: 78px minmax(240px, 1fr) minmax(380px, 0.92fr);
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
}
.readiness-gauge {
  --gauge-color: var(--cyan);
  position: relative;
  display: grid;
  width: 66px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #06131a 0 57%, transparent 58%),
    conic-gradient(
      var(--gauge-color) 0 calc(var(--readiness) * 1%),
      rgba(112, 139, 151, 0.2) calc(var(--readiness) * 1%) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(117, 216, 244, 0.19),
    0 0 22px rgba(145, 203, 56, 0.08);
}
.readiness-gauge[data-level="blocked"] { --gauge-color: #ff7772; }
.readiness-gauge[data-level="progress"] { --gauge-color: var(--gold); }
.readiness-gauge[data-level="ready"] { --gauge-color: var(--green); }
.readiness-gauge::after {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(117, 216, 244, 0.17);
  border-radius: inherit;
  content: "";
}
.readiness-gauge > div {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
}
.readiness-gauge strong {
  color: #f1f8fa;
  font-size: 20px;
  line-height: 1;
}
.readiness-gauge small {
  color: #8ba0aa;
  font-size: 9px;
}
.workflow-mission-identity {
  min-width: 0;
}
.workflow-mission-identity h3 {
  overflow: hidden;
  margin: 3px 0 2px;
  color: #f0f7fa;
  font-size: 16px;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-mission-identity p {
  overflow: hidden;
  margin: 0;
  color: #8096a2;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workflow-mission-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 6px;
}
.workflow-mission-kpis span {
  display: grid;
  min-height: 48px;
  align-content: center;
  border-left: 1px solid rgba(117, 216, 244, 0.2);
  padding: 4px 9px;
}
.workflow-mission-kpis small {
  color: #738b97;
  font-size: 9px;
  letter-spacing: 0.11em;
}
.workflow-mission-kpis strong {
  color: #dff3fa;
  font-size: 17px;
}
.workflow-step-nav {
  display: flex;
  overflow-x: auto;
  border-top: 1px solid rgba(117, 216, 244, 0.16);
  scrollbar-color: #365767 #07141b;
  scrollbar-width: thin;
}
.workflow-step-nav button {
  position: relative;
  display: inline-flex;
  min-width: max-content;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-right: 1px solid rgba(117, 216, 244, 0.13);
  padding: 9px 11px;
  background: rgba(6, 22, 30, 0.72);
  color: #8198a4;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.workflow-step-nav button span {
  color: #536f7c;
  font-size: 9px;
}
.workflow-step-nav button:hover,
.workflow-step-nav button.active {
  background: rgba(117, 216, 244, 0.08);
  color: #dbf7ff;
}
.workflow-step-nav button.active::after {
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--gold);
  box-shadow: 0 0 8px rgba(224, 187, 102, 0.75);
}
.workflow-step-nav button[data-state="complete"] span {
  color: var(--green);
}
.workflow-step-nav button[data-state="complete"]::before {
  color: var(--green);
  content: "✓";
  font-size: 9px;
}
.workflow-section {
  scroll-margin-top: 146px;
}
.workflow-section-details {
  border-top: 1px solid rgba(117, 216, 244, 0.12);
  margin-top: 10px;
  padding-top: 8px;
}
.workflow-section-details > summary {
  cursor: pointer;
  color: #a5bdc8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.workflow-section-details[open] > summary {
  margin-bottom: 8px;
  color: var(--cyan);
}
.workflow-shell input,
.workflow-shell select,
.workflow-shell textarea {
  border-color: rgba(91, 133, 153, 0.44);
  background: rgba(3, 14, 21, 0.9);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}
.workflow-shell input:hover,
.workflow-shell select:hover,
.workflow-shell textarea:hover {
  border-color: rgba(117, 216, 244, 0.55);
}
.workflow-shell input:focus,
.workflow-shell select:focus,
.workflow-shell textarea:focus {
  border-color: var(--cyan);
  background: #061923;
  box-shadow: 0 0 0 2px rgba(117, 216, 244, 0.09);
}
.workflow-shell button {
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}
.workflow-shell button:not(:disabled):active {
  transform: translateY(1px);
}
.entity-form:not([open]) {
  border-style: dashed;
  background: rgba(3, 12, 17, 0.55);
}
.entity-form:not([open]):hover {
  border-color: rgba(117, 216, 244, 0.42);
}
#workflowRouteTable {
  max-width: 100%;
  overflow-x: auto;
}
#workflowTiming {
  overflow: auto;
  border: 1px solid rgba(117, 216, 244, 0.15);
  padding: 12px;
  background: rgba(1, 8, 12, 0.72);
  color: #bad6de;
  font-size: 12px;
}
.workflow-section--export {
  border-color: rgba(224, 187, 102, 0.34);
  box-shadow: inset 2px 0 rgba(224, 187, 102, 0.72);
}
.handoff-protocol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.handoff-protocol span {
  border: 1px solid rgba(113, 139, 157, 0.24);
  padding: 11px;
  background: rgba(2, 10, 15, 0.58);
  color: #aabdc7;
  line-height: 1.45;
}
.handoff-protocol b {
  margin-right: 5px;
  color: var(--gold);
}
.technical-details {
  margin-top: 12px;
  border-top: 1px solid rgba(113, 139, 157, 0.2);
  padding-top: 10px;
}
.technical-details summary {
  cursor: pointer;
  color: #89a7b5;
  font-size: 13px;
  letter-spacing: 0.06em;
}

@media (max-width: 1100px) {
  .workflow-grid, .workflow-columns { grid-template-columns: 1fr 1fr; }
  .flight-test-console__intro { align-items: flex-start; flex-direction: column; }
  .flight-test-console__actions,
  .flight-test-console__launch { width: 100%; }
  .workflow-mission-strip {
    grid-template-columns: 70px 1fr;
  }
  .workflow-mission-kpis {
    grid-column: 1 / -1;
  }
  .handoff-protocol { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .workflow-grid, .workflow-columns { grid-template-columns: 1fr; }
  .flight-test-stages { grid-template-columns: 1fr 1fr; }
  .flight-test-stages > div::after { display: none; }
  .workflow-command-deck { position: static; }
  .workflow-mission-strip { grid-template-columns: 1fr; }
  .readiness-gauge { width: 58px; }
  .workflow-mission-kpis { grid-template-columns: 1fr 1fr; }
}

/* Honest simulator-connection panel states (no fake "connected") */
.status-light.off {
  background: #5a6b73;
  box-shadow: none;
}
.status-warn { color: #ffd166; }
.status-off { color: #6f838c; }
.agent-app { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }

/* Training / Campaign — real "not built yet" workbench views (no dead UI) */
.coming-soon-panel {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border: 1px dashed rgba(100, 149, 174, 0.38);
  color: var(--muted);
  text-align: center;
  gap: 8px;
}
.coming-soon-panel h3 { color: #9ecfd3; margin: 0; }
