:root {
  --bg-void: #05070b;
  --bg-panel: #090d14;
  --bg-panel-alt: #0c111a;
  --bg-panel-hover: #111824;
  --bg-console: #04060a;
  --amber: #f5a623;
  --amber-bright: #ffd07a;
  --amber-soft: rgba(245, 166, 35, 0.14);
  --amber-glow: rgba(245, 166, 35, 0.34);
  --amber-line: rgba(245, 166, 35, 0.24);
  --amber-line-strong: rgba(245, 166, 35, 0.55);
  --hairline: rgba(180, 196, 220, 0.11);
  --hairline-strong: rgba(180, 196, 220, 0.22);
  --text: #e9eef6;
  --text-secondary: #9ba7bc;
  --text-muted: #647187;
  --success: #34d399;
  --success-dim: rgba(52, 211, 153, 0.13);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.14);
  --font-sans: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color-scheme: dark;
  scrollbar-color: rgba(245, 166, 35, 0.35) var(--bg-void);
  scrollbar-width: thin;
  background-color: var(--bg-void);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.scene-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  contain: strict;
}

.scene-background canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-background:empty::before {
  content: "";
  position: absolute;
  left: 78%;
  top: 38%;
  width: 108vmin;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("./orbital-still.webp") center / contain no-repeat;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-void);
}

::-webkit-scrollbar-thumb {
  background: rgba(245, 166, 35, 0.24);
  border: 1px solid rgba(245, 166, 35, 0.16);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 166, 35, 0.45);
}

a {
  color: var(--amber);
  text-decoration: none;
}

a:hover {
  color: var(--amber-bright);
  text-decoration: underline;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.24);
  color: var(--amber-bright);
  padding: 0.08rem 0.38rem;
  border-radius: 2px;
  word-break: break-word;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ─────────────────────────────── Shell & Sidebar ─────────────────────────────── */

.hud-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  transition: grid-template-columns 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.hud-shell.is-sidebar-collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 12, 19, 0.90), rgba(4, 6, 11, 0.95));
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(180, 196, 220, 0.13);
  padding: 1.15rem 0 1.1rem;
  z-index: 35;
  overflow-x: hidden;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0 0.85rem 0 1.1rem;
}

.nav-toggle-btn {
  appearance: none;
  position: relative;
  isolation: isolate;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-bright);
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.65), rgba(180, 196, 220, 0.22));
  transition: background 0.16s, color 0.16s;
}

.nav-toggle-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(7, 11, 18, 0.94);
  clip-path: polygon(5.5px 0, 100% 0, 100% calc(100% - 5.5px), calc(100% - 5.5px) 100%, 0 100%, 0 5.5px);
}

.nav-toggle-btn:hover {
  background: linear-gradient(135deg, #ffd07a, #f5a623);
  color: #ffffff;
}

.nav-toggle-btn svg {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-only {
  display: none;
}

.mobile-topbar {
  display: none;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(4px);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 52px;
  right: -1px;
  bottom: 52px;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(245, 166, 35, 0.55) 0%,
    rgba(180, 196, 220, 0.12) 18%,
    rgba(180, 196, 220, 0.08) 82%,
    rgba(245, 166, 35, 0.50) 100%
  );
  pointer-events: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(245, 166, 35, 0.35));
}

.brand-name {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--text);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-top: 0.12rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-right: 0.7rem;
}

.side-link {
  appearance: none;
  position: relative;
  isolation: isolate;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  padding: 0.78rem 1.15rem 0.78rem 1.28rem;
  display: flex;
  align-items: center;
  gap: 0.78rem;
  cursor: pointer;
  text-align: left;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  transition: color 0.18s, background 0.18s, transform 0.15s;
}

.side-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s, box-shadow 0.18s;
}

.side-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
  transition: background 0.18s;
}

.side-link:hover {
  color: var(--text);
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.16) 0%, rgba(180, 196, 220, 0.08) 65%, transparent 100%);
}

.side-link:hover::before {
  background: rgba(245, 166, 35, 0.55);
}

.side-link:hover::after {
  inset: 1px 1px 1px 0;
  background: linear-gradient(90deg, rgba(16, 22, 34, 0.92), rgba(9, 13, 21, 0.72));
  clip-path: polygon(0 0, calc(100% - 12.5px) 0, 100% 12.5px, 100% 100%, 0 100%);
}

.side-link.is-active {
  color: var(--amber-bright);
  background: linear-gradient(
    90deg,
    rgba(255, 208, 122, 0.78) 0%,
    rgba(245, 166, 35, 0.38) 46%,
    rgba(245, 166, 35, 0.10) 100%
  );
}

.side-link.is-active::before {
  background: linear-gradient(180deg, #ffe2a4 0%, #f5a623 55%, #d98212 100%);
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.95), 0 0 4px rgba(255, 224, 160, 0.9);
}

.side-link.is-active::after {
  inset: 1px 1px 1px 3px;
  background: linear-gradient(
    90deg,
    rgba(68, 44, 12, 0.94) 0%,
    rgba(30, 22, 12, 0.88) 45%,
    rgba(10, 14, 22, 0.78) 100%
  );
  clip-path: polygon(0 0, calc(100% - 12.5px) 0, 100% 12.5px, 100% 100%, 0 100%);
}

.side-link.is-active .side-icon {
  color: var(--amber-bright);
  filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.85));
}

.side-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
}

.side-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.side-link.is-active .side-count {
  color: var(--amber-bright);
}

.side-count:empty {
  display: none;
}

.sidebar-footer {
  padding: 0.9rem 1.15rem 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.micro-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.team-selector-box {
  position: relative;
  isolation: isolate;
  padding: 0.48rem 0.68rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.55), rgba(245, 166, 35, 0.2));
}

.team-selector-box::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(5, 8, 13, 0.94);
  clip-path: polygon(7.5px 0, 100% 0, 100% calc(100% - 7.5px), calc(100% - 7.5px) 100%, 0 100%, 0 7.5px);
}

.select-sidebar {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.1rem 0;
}

.select-sidebar option {
  background: var(--bg-panel);
  color: var(--text);
}

.sidebar-auth {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.operator-badge {
  position: relative;
  isolation: isolate;
  padding: 0.55rem 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.45), rgba(180, 196, 220, 0.18));
  cursor: pointer;
  transition: background 0.16s;
}

.operator-badge:hover {
  background: linear-gradient(135deg, rgba(255, 208, 122, 0.85), rgba(245, 166, 35, 0.45));
}

.operator-badge::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(5, 8, 13, 0.94);
  clip-path: polygon(8.5px 0, 100% 0, 100% calc(100% - 8.5px), calc(100% - 8.5px) 100%, 0 100%, 0 8.5px);
}

.operator-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-transform: uppercase;
}

.operator-email {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar-links a {
  color: var(--text-secondary);
}

.sidebar-links a:hover {
  color: var(--amber);
}

/* ─────────────────────────────── Workspace & HUD Frame ─────────────────────────────── */

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hud-frame-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 1.85rem 0.1rem 0;
  position: relative;
}

.hud-bevel-svg {
  flex: 1;
  height: 36px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.28));
}

.hud-version {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.9rem 1.85rem 2.2rem;
}

.hud-footer {
  border-top: 1px solid var(--hairline);
  padding: 0.85rem 1.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hud-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.hud-footer-right {
  display: flex;
  gap: 1.25rem;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: amberPulse 2.4s infinite;
}

@keyframes amberPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--amber); }
  50% { opacity: 0.45; box-shadow: 0 0 2px var(--amber); }
}

/* ─────────────────────────────── HUD Panels & Hero ─────────────────────────────── */

.hud-panel {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 1.4rem 1.55rem;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  background: linear-gradient(
    135deg,
    rgba(255, 208, 122, 0.72) 0%,
    rgba(245, 166, 35, 0.30) 14%,
    rgba(160, 180, 210, 0.16) 50%,
    rgba(245, 166, 35, 0.28) 86%,
    rgba(255, 208, 122, 0.65) 100%
  );
}

.hud-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: linear-gradient(160deg, rgba(10, 15, 24, 0.80), rgba(5, 8, 14, 0.88));
  backdrop-filter: blur(8px);
  clip-path: polygon(15.5px 0, 100% 0, 100% calc(100% - 15.5px), calc(100% - 15.5px) 100%, 0 100%, 0 15.5px);
  pointer-events: none;
}

.hud-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, #ffd07a, transparent);
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.7);
  pointer-events: none;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.95fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  overflow: hidden;
  padding: 1.85rem 2.1rem;
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
  background: linear-gradient(
    96deg,
    rgba(6, 9, 15, 0.80) 0%,
    rgba(6, 9, 15, 0.48) 48%,
    rgba(6, 9, 15, 0.04) 100%
  );
  backdrop-filter: none;
}

.overview-hero::before {
  inset: 0;
  z-index: 2;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 208, 122, 0.88) 0%,
    rgba(245, 166, 35, 0.36) 24%,
    rgba(160, 180, 210, 0.16) 55%,
    rgba(245, 166, 35, 0.56) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  backdrop-filter: none;
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}

.overview-hero::after {
  left: 22px;
  width: 96px;
  z-index: 3;
}

.hud-viewport-window {
  min-height: 225px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.25rem 0.15rem;
  pointer-events: none;
}

.hud-coord-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 208, 122, 0.78);
  background: rgba(5, 7, 11, 0.56);
  border: 1px solid rgba(245, 166, 35, 0.24);
  padding: 0.22rem 0.55rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.display-title {
  margin: 0;
  font-size: 2.15rem;
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}

.display-sub {
  margin: 0.45rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1.15rem;
  margin: 1.55rem 0 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
}

.kpi-delta {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--amber);
  letter-spacing: 0.04em;
}

.sparkline-box {
  margin-top: 0.65rem;
  max-width: 360px;
}

.globe-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.globe-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 0 24px rgba(245, 166, 35, 0.2));
}

/* ─────────────────────────────── Section Headers & Layouts ─────────────────────────────── */

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--hairline);
}

.view-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.view-subtitle {
  margin-top: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}

.section-header h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.split-with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.15rem;
}

.rail-panel {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  background: linear-gradient(150deg, rgba(245, 166, 35, 0.58) 0%, rgba(180, 196, 220, 0.16) 40%, rgba(245, 166, 35, 0.36) 100%);
}

.rail-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(8, 12, 20, 0.84);
  backdrop-filter: blur(8px);
  clip-path: polygon(13.5px 0, 100% 0, 100% calc(100% - 13.5px), calc(100% - 13.5px) 100%, 0 100%, 0 13.5px);
  pointer-events: none;
}

.rail-metric {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--hairline);
}

.rail-metric:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.rail-metric-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--amber-bright);
  margin-top: 0.15rem;
}

/* ─────────────────────────────── Cards ─────────────────────────────── */

.card {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.34) 0%, rgba(180, 196, 220, 0.15) 35%, rgba(180, 196, 220, 0.12) 75%, rgba(245, 166, 35, 0.32) 100%);
  transition: background 0.18s, transform 0.18s, filter 0.18s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: linear-gradient(160deg, rgba(10, 15, 24, 0.84), rgba(6, 9, 15, 0.90));
  backdrop-filter: blur(8px);
  clip-path: polygon(12.5px 0, 100% 0, 100% calc(100% - 12.5px), calc(100% - 12.5px) 100%, 0 100%, 0 12.5px);
  transition: background 0.18s;
  pointer-events: none;
}

.card.is-clickable {
  cursor: pointer;
}

.card.is-clickable:hover {
  background: linear-gradient(135deg, rgba(255, 208, 122, 0.85) 0%, rgba(245, 166, 35, 0.42) 50%, rgba(255, 208, 122, 0.78) 100%);
  filter: drop-shadow(0 0 14px rgba(245, 166, 35, 0.18));
  transform: translateY(-2px);
}

.card.is-clickable:hover::before {
  background: linear-gradient(160deg, rgba(18, 25, 38, 0.90), rgba(10, 14, 22, 0.94));
}

.card.is-selected {
  background: linear-gradient(135deg, rgba(255, 208, 122, 0.92) 0%, rgba(245, 166, 35, 0.55) 50%, rgba(255, 208, 122, 0.85) 100%);
}

.card.is-solved {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.78) 0%, rgba(52, 211, 153, 0.32) 55%, rgba(52, 211, 153, 0.68) 100%);
}

.card.is-solved::before {
  background: linear-gradient(175deg, rgba(16, 36, 32, 0.88), rgba(7, 12, 17, 0.92));
}

.challenge-card {
  min-width: 0;
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.62) 0%, rgba(180, 196, 220, 0.15) 14%, rgba(180, 196, 220, 0.14) 86%, rgba(245, 166, 35, 0.36) 100%);
}

.card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.challenge-card.is-solved {
  border-top-color: var(--success);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-cta {
  color: var(--amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* ─────────────────────────────── CyberLab Badges & Tags ─────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.14rem 0.5rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.badge-live,
.badge-published,
.badge-solved,
.badge-easy {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.36);
}

.badge-upcoming,
.badge-medium,
.badge-admin,
.badge-captain,
.badge-info,
.badge-category {
  background: var(--amber-soft);
  color: var(--amber-bright);
  border-color: var(--amber-line-strong);
}

.badge-hard,
.badge-insane,
.badge-danger,
.badge-ended,
.badge-critical {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.48);
}

.badge-high {
  background: rgba(245, 115, 35, 0.16);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.48);
}

.badge-clean {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.42);
}

.badge-file {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.42);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.file-item {
  position: relative;
  isolation: isolate;
  padding: 0.72rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.42), rgba(180, 196, 220, 0.16));
}

.file-item::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(6, 10, 16, 0.94);
  clip-path: polygon(8.5px 0, 100% 0, 100% calc(100% - 8.5px), calc(100% - 8.5px) 100%, 0 100%, 0 8.5px);
  pointer-events: none;
}

.file-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.file-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.file-hash {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.file-preview-box {
  background: rgba(3, 5, 9, 0.96);
  border: 1px solid var(--hairline-strong);
  padding: 0.75rem 0.85rem;
  max-height: 280px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--amber-bright);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.file-preview-img {
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--amber-line);
  background: #04060a;
  display: block;
}

.dropzone {
  position: relative;
  border: 1px dashed var(--amber-line-strong);
  background: rgba(5, 8, 14, 0.72);
  padding: 1.05rem 1.15rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--amber-bright);
  background: rgba(245, 166, 35, 0.08);
}

.dropzone input[type="file"] {
  display: none;
}

.queued-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.5rem;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.48rem;
  background: rgba(8, 12, 20, 0.9);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.chip-remove {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1;
  padding: 0 0.15rem;
  cursor: pointer;
}

.chip-remove:hover {
  color: #ffffff;
}

.badge-muted,
.badge-draft,
.badge-archived {
  background: rgba(100, 113, 135, 0.14);
  color: var(--text-muted);
  border-color: rgba(100, 113, 135, 0.3);
}

.points-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--amber-bright);
  white-space: nowrap;
}

/* ─────────────────────────────── Controls, Pills & Progress ─────────────────────────────── */

.btn {
  appearance: none;
  position: relative;
  isolation: isolate;
  border: none;
  background: linear-gradient(135deg, rgba(180, 196, 220, 0.34), rgba(180, 196, 220, 0.16));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.54rem 1.02rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: color 0.15s, background 0.15s, filter 0.15s;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(6, 9, 15, 0.92);
  clip-path: polygon(7.5px 0, 100% 0, 100% calc(100% - 7.5px), calc(100% - 7.5px) 100%, 0 100%, 0 7.5px);
  transition: background 0.15s;
  pointer-events: none;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffd07a, #f5a623);
  color: var(--amber-bright);
  text-decoration: none;
}

.btn:hover:not(:disabled)::before {
  background: rgba(34, 24, 10, 0.92);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ffd07a 0%, #f5a623 55%, #d98212 100%);
  color: var(--amber-bright);
  filter: drop-shadow(0 0 10px rgba(245, 166, 35, 0.24));
}

.btn-primary::before {
  background: linear-gradient(135deg, rgba(64, 42, 12, 0.92), rgba(26, 18, 9, 0.94));
}

.btn-primary:hover:not(:disabled) {
  color: #ffffff;
  filter: drop-shadow(0 0 14px rgba(245, 166, 35, 0.45));
}

.btn-primary:hover:not(:disabled)::before {
  background: linear-gradient(135deg, rgba(96, 62, 16, 0.94), rgba(44, 28, 10, 0.94));
}

.btn-success {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.85), rgba(52, 211, 153, 0.42));
  color: var(--success);
}

.btn-success::before {
  background: rgba(10, 28, 24, 0.92);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.85), rgba(248, 113, 113, 0.42));
  color: var(--danger);
}

.btn-danger::before {
  background: rgba(32, 12, 16, 0.92);
}

.btn-sm {
  padding: 0.36rem 0.74rem;
  font-size: 0.67rem;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.btn-sm::before {
  clip-path: polygon(5.5px 0, 100% 0, 100% calc(100% - 5.5px), calc(100% - 5.5px) 100%, 0 100%, 0 5.5px);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 2px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

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

.pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.filter-pill {
  appearance: none;
  position: relative;
  isolation: isolate;
  border: none;
  background: rgba(180, 196, 220, 0.16);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.38rem 0.82rem;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.filter-pill::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(8, 12, 19, 0.88);
  clip-path: polygon(6.5px 0, 100% 0, 100% calc(100% - 6.5px), calc(100% - 6.5px) 100%, 0 100%, 0 6.5px);
  pointer-events: none;
}

.filter-pill:hover {
  color: var(--text);
  background: rgba(245, 166, 35, 0.45);
}

.filter-pill.is-active {
  color: var(--amber-bright);
  background: linear-gradient(135deg, #ffd07a, #f5a623);
}

.filter-pill.is-active::before {
  background: rgba(48, 32, 10, 0.92);
}

.subtabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.78rem;
}

.subtab {
  appearance: none;
  position: relative;
  isolation: isolate;
  border: none;
  background: rgba(180, 196, 220, 0.16);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.48rem 0.96rem;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.subtab::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(8, 12, 19, 0.88);
  clip-path: polygon(7.5px 0, 100% 0, 100% calc(100% - 7.5px), calc(100% - 7.5px) 100%, 0 100%, 0 7.5px);
  pointer-events: none;
}

.subtab:hover {
  color: var(--text);
  background: rgba(245, 166, 35, 0.45);
}

.subtab.is-active {
  color: var(--amber-bright);
  background: linear-gradient(135deg, #ffd07a, #f5a623);
}

.subtab.is-active::before {
  background: rgba(50, 34, 11, 0.92);
}

.subtab:hover {
  color: var(--text);
  border-color: var(--amber-line);
}

.subtab.is-active {
  color: var(--amber-bright);
  background: var(--amber-soft);
  border-color: var(--amber);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
  align-items: center;
}

input,
select,
textarea {
  background: var(--bg-console);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  padding: 0.52rem 0.75rem;
  font: inherit;
  font-size: 0.86rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.18);
}

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

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.46rem 0.75rem;
  background: var(--bg-console);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.arena-progress-bar {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 1rem 1.35rem;
  margin-bottom: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  background: linear-gradient(90deg, rgba(255, 208, 122, 0.72) 0%, rgba(245, 166, 35, 0.32) 32%, rgba(180, 196, 220, 0.18) 100%);
}

.arena-progress-bar::before {
  content: "";
  position: absolute;
  inset: 1px 1px 1px 3px;
  z-index: -1;
  background: rgba(8, 12, 20, 0.84);
  backdrop-filter: blur(8px);
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13.5px), calc(100% - 13.5px) 100%, 0 100%, 0 13px);
  pointer-events: none;
}

.progress-track {
  flex: 1;
  min-width: 160px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-bright));
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.65);
  transition: width 0.35s ease;
}

/* ─────────────────────────────── Charts, Console & Tables ─────────────────────────────── */

.viz-panel {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.4rem;
}

.viz-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 1px;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  padding: 1.5rem 1.2rem;
  border: 1px dashed rgba(245, 166, 35, 0.22);
  background: rgba(4, 6, 10, 0.55);
}

.chart-empty-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--amber-bright);
  text-transform: uppercase;
}

.chart-empty-sub {
  max-width: 480px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.68rem;
}

.hbar-row {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  transition: border-color 0.14s, background 0.14s;
}

.hbar-row:hover {
  border-color: var(--amber-line);
  background: rgba(245, 166, 35, 0.05);
}

.hbar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hbar-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text);
}

.hbar-track {
  height: 7px;
  background: rgba(180, 196, 220, 0.08);
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  transition: width 0.35s ease;
}

.hbar-fill.is-high {
  background: linear-gradient(90deg, var(--amber), var(--amber-bright));
  box-shadow: 0 0 10px rgba(245, 166, 35, 0.45);
}

.hbar-fill.is-mid {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.55), var(--amber));
}

.hbar-fill.is-zero {
  background: rgba(248, 113, 113, 0.38);
}

.chart-hit {
  cursor: crosshair;
}

.chart-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  pointer-events: none;
  will-change: transform;
  contain: layout style;
  max-width: 340px;
  padding: 0.45rem 0.7rem;
  background: rgba(5, 8, 14, 0.96);
  border: 1px solid var(--amber-line-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 166, 35, 0.18);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber-bright);
  line-height: 1.4;
}

.gpu-badge {
  margin-left: 0.45rem;
  padding: 0.12rem 0.46rem;
  border: 1px solid var(--amber-line);
  background: rgba(245, 166, 35, 0.09);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 0.95rem 1.12rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  clip-path: polygon(11px 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%, 0 11px);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.52) 0%, rgba(180, 196, 220, 0.16) 45%, rgba(245, 166, 35, 0.34) 100%);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(8, 12, 20, 0.84);
  backdrop-filter: blur(8px);
  clip-path: polygon(10.5px 0, 100% 0, 100% calc(100% - 10.5px), calc(100% - 10.5px) 100%, 0 100%, 0 10.5px);
  pointer-events: none;
}

.console-box {
  position: relative;
  isolation: isolate;
  border: none;
  padding: 1.05rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.75;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  background: linear-gradient(135deg, rgba(255, 208, 122, 0.65) 0%, rgba(245, 166, 35, 0.28) 40%, rgba(245, 166, 35, 0.52) 100%);
}

.console-box::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: rgba(4, 6, 11, 0.94);
  clip-path: polygon(13.5px 0, 100% 0, 100% calc(100% - 13.5px), calc(100% - 13.5px) 100%, 0 100%, 0 13.5px);
  pointer-events: none;
}

.console-line-amber {
  color: var(--amber-bright);
}

.console-line-ok {
  color: var(--success);
}

.table-wrap {
  background: rgba(9, 13, 20, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--hairline);
}

th {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.015);
}

tbody tr:hover {
  background: rgba(245, 166, 35, 0.045);
}

tr:last-child td {
  border-bottom: none;
}

.rank-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 78px;
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
  margin-bottom: 1.2rem;
}

.podium-card {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-top: 2px solid var(--amber-line-strong);
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.podium-card.rank-1 {
  border-top-color: var(--amber);
  background: linear-gradient(180deg, rgba(245, 166, 35, 0.1), var(--bg-panel));
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.75rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-group label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.prompt-box {
  background: var(--bg-console);
  border: 1px solid var(--hairline);
  padding: 1rem 1.15rem;
  color: var(--text);
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.65;
}

.checklist-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.58rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  background: var(--bg-console);
  color: var(--text-muted);
}

.check-pill.is-ok {
  border-color: rgba(52, 211, 153, 0.42);
  background: var(--success-dim);
  color: var(--success);
}

.check-pill.is-missing {
  border-color: var(--amber-line-strong);
  background: var(--amber-soft);
  color: var(--amber-bright);
}

.code-box {
  background: var(--bg-console);
  border: 1px solid var(--amber-line);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--amber-bright);
  overflow-x: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.announcement-item {
  background: var(--bg-console);
  border: 1px solid var(--hairline);
  border-left: 2px solid var(--amber-line-strong);
  padding: 0.75rem 0.95rem;
}

.announcement-item.is-pinned {
  border-left-color: var(--amber);
}

.hint-box {
  background: var(--bg-console);
  border: 1px solid var(--hairline);
  padding: 0.65rem 0.85rem;
}

.hint-box summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--amber-bright);
}

.empty-state {
  background: rgba(9, 13, 20, 0.72);
  backdrop-filter: blur(8px);
  border: 1px dashed var(--amber-line);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* ─────────────────────────────── Modal & Toasts ─────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 4, 8, 0.84);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  overflow: hidden;
  border: none;
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  background: linear-gradient(135deg, rgba(255, 208, 122, 0.85) 0%, rgba(245, 166, 35, 0.42) 45%, rgba(255, 208, 122, 0.75) 100%);
  filter: drop-shadow(0 28px 64px rgba(0, 0, 0, 0.85));
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: linear-gradient(165deg, rgba(10, 15, 24, 0.97), rgba(5, 8, 14, 0.99));
  clip-path: polygon(17.5px 0, 100% 0, 100% calc(100% - 17.5px), calc(100% - 17.5px) 100%, 0 100%, 0 17.5px);
  pointer-events: none;
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--hairline);
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-bright);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.35rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--amber-line-strong);
  border-left: 3px solid var(--amber);
  padding: 0.75rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}

.toast.is-success {
  border-left-color: var(--success);
}

.toast.is-error {
  border-left-color: var(--danger);
}

.divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0.35rem 0;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.small {
  font-size: 0.82rem;
}

/* ─────────────────────────────── Collapsed Desktop Rail ─────────────────────────────── */

@media (min-width: 961px) {
  .hud-shell.is-sidebar-collapsed .sidebar-header {
    flex-direction: column;
    gap: 0.7rem;
    padding: 0 0.5rem;
  }

  .hud-shell.is-sidebar-collapsed .brand-text,
  .hud-shell.is-sidebar-collapsed .side-label,
  .hud-shell.is-sidebar-collapsed .side-count,
  .hud-shell.is-sidebar-collapsed .sidebar-links,
  .hud-shell.is-sidebar-collapsed .team-selector-box,
  .hud-shell.is-sidebar-collapsed .operator-badge .micro-label,
  .hud-shell.is-sidebar-collapsed .operator-email,
  .hud-shell.is-sidebar-collapsed .operator-sub {
    display: none;
  }

  .hud-shell.is-sidebar-collapsed #btn-sidebar-collapse svg {
    transform: rotate(180deg);
  }

  .hud-shell.is-sidebar-collapsed .side-nav {
    padding-right: 0.45rem;
  }

  .hud-shell.is-sidebar-collapsed .side-link {
    justify-content: center;
    padding: 0.82rem 0.45rem;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  }

  .hud-shell.is-sidebar-collapsed .side-link::after {
    clip-path: polygon(0 0, calc(100% - 8.5px) 0, 100% 8.5px, 100% 100%, 0 100%);
  }

  .hud-shell.is-sidebar-collapsed .sidebar-footer {
    padding: 0.8rem 0.55rem 0;
    align-items: center;
  }

  .hud-shell.is-sidebar-collapsed .sidebar-auth {
    width: 100%;
    align-items: center;
  }

  .hud-shell.is-sidebar-collapsed .operator-badge {
    width: 44px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .hud-shell.is-sidebar-collapsed .operator-badge .operator-compact-icon {
    display: inline-flex;
  }

  .hud-shell.is-sidebar-collapsed .sidebar-auth .btn {
    width: 44px;
    height: 34px;
    padding: 0;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .hud-shell.is-sidebar-collapsed .sidebar-auth .btn-full-label {
    display: none;
  }

  .hud-shell.is-sidebar-collapsed .sidebar-auth .btn-short-label {
    display: inline;
  }
}

.operator-compact-icon {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--amber-bright);
}

.btn-short-label {
  display: none;
}

/* ─────────────── Phase A-D: Focus Rings, Skeletons, Markdown, HUD Toggles ─────────────── */

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(255, 208, 122, 0.92));
}

.hud-toggle-pill {
  appearance: none;
  cursor: pointer;
  padding: 0.16rem 0.55rem;
  border: 1px solid var(--amber-line);
  background: rgba(245, 166, 35, 0.09);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.hud-toggle-pill:hover {
  border-color: var(--amber-bright);
  background: rgba(245, 166, 35, 0.2);
}

.hud-toggle-pill.is-off {
  border-color: var(--hairline-strong);
  background: rgba(100, 113, 135, 0.12);
  color: var(--text-muted);
}

.status-dot.is-paused {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.52rem;
  border: 1px solid var(--amber-line-strong);
  background: rgba(245, 166, 35, 0.12);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber-bright);
  white-space: nowrap;
}

.skeleton-card {
  min-height: 150px;
  justify-content: center;
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(
    90deg,
    rgba(180, 196, 220, 0.06) 25%,
    rgba(245, 166, 35, 0.14) 50%,
    rgba(180, 196, 220, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeletonSweep 1.3s infinite linear;
}

.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-60 { width: 60%; height: 16px; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-100 { width: 100%; }

@keyframes skeletonSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.md-para {
  margin: 0 0 0.6rem;
  line-height: 1.62;
}

.md-para:last-child {
  margin-bottom: 0;
}

.md-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-bright);
  margin: 0.75rem 0 0.35rem;
}

.md-list {
  margin: 0.35rem 0 0.65rem 1.2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.md-code-block {
  margin: 0.65rem 0;
  border: 1px solid var(--amber-line);
  background: rgba(3, 5, 10, 0.96);
}

.md-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid var(--hairline);
  background: rgba(245, 166, 35, 0.06);
}

.md-code-pre {
  margin: 0;
  padding: 0.7rem 0.85rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber-bright);
  line-height: 1.55;
}

.hbar-row.is-clickable,
tbody tr.is-clickable {
  cursor: pointer;
}

.modal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--hairline);
}

.capture-banner {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(52, 211, 153, 0.55);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.18), rgba(52, 211, 153, 0.04));
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--success);
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .subtabs,
  .pill-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .subtabs::-webkit-scrollbar,
  .pill-strip::-webkit-scrollbar {
    display: none;
  }

  .subtab,
  .filter-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .table-wrap {
    position: relative;
    background-image:
      linear-gradient(to right, rgba(9, 13, 20, 0.92), rgba(9, 13, 20, 0)),
      linear-gradient(to left, rgba(9, 13, 20, 0.92), rgba(9, 13, 20, 0));
    background-position: left center, right center;
    background-repeat: no-repeat;
    background-size: 16px 100%, 16px 100%;
    background-attachment: local, local;
  }
}

/* ─────────────────────────────── Mobile Compact Bar & Drawer ─────────────────────────────── */

@media (max-width: 960px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex;
  }

  .hud-shell,
  .hud-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 42;
    height: 54px;
    padding: 0 0.85rem;
    background: linear-gradient(180deg, rgba(8, 12, 20, 0.94), rgba(5, 8, 14, 0.92));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--amber-line);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  }

  .mobile-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
  }

  .mobile-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .mobile-menu-btn {
    appearance: none;
    position: relative;
    isolation: isolate;
    width: 36px;
    height: 34px;
    padding: 0;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
    background: linear-gradient(135deg, rgba(255, 208, 122, 0.85), rgba(245, 166, 35, 0.35));
  }

  .mobile-menu-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    background: rgba(7, 11, 18, 0.95);
    clip-path: polygon(6.5px 0, 100% 0, 100% calc(100% - 6.5px), calc(100% - 6.5px) 100%, 0 100%, 0 6.5px);
  }

  .burger-lines {
    width: 17px;
    height: 12px;
    position: relative;
    display: block;
  }

  .burger-line {
    position: absolute;
    left: 0;
    height: 1.6px;
    background: var(--amber-bright);
    transition: transform 0.22s ease, opacity 0.2s ease, width 0.22s ease;
  }

  .burger-line.l1 {
    top: 0;
    width: 17px;
  }

  .burger-line.l2 {
    top: 5px;
    width: 12px;
    background: var(--amber);
  }

  .burger-line.l3 {
    top: 10px;
    width: 15px;
  }

  .hud-shell.is-mobile-nav-open .burger-line.l1 {
    transform: translateY(5px) rotate(45deg);
  }

  .hud-shell.is-mobile-nav-open .burger-line.l2 {
    opacity: 0;
    transform: translateX(-6px);
  }

  .hud-shell.is-mobile-nav-open .burger-line.l3 {
    width: 17px;
    transform: translateY(-5px) rotate(-45deg);
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
  }

  .mobile-brand-name {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text);
  }

  .mobile-view-chip {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    color: var(--amber-bright);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(286px, 84vw);
    height: 100dvh;
    z-index: 50;
    overflow-y: auto;
    border-right: none;
    transform: translateX(-108%);
    visibility: hidden;
    pointer-events: none;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
    box-shadow: none;
  }

  .hud-shell.is-mobile-nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 24px 0 64px rgba(0, 0, 0, 0.88);
  }

  .hud-frame-top {
    display: none;
  }

  .main-content {
    padding: 0.95rem 0.95rem 1.8rem;
  }

  .overview-hero {
    padding: 1.25rem 1.15rem;
  }

  .hud-viewport-window {
    min-height: 84px;
  }

  .display-title {
    font-size: 1.65rem;
    letter-spacing: 0.2em;
  }

  .overview-hero,
  .split-with-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px), (pointer: coarse) {
  .sidebar, .mobile-topbar, .mobile-nav-backdrop, .modal-backdrop,
  .hud-panel::before, .card::before, .rail-panel::before, .kpi-card::before,
  .arena-progress-bar::before, .table-wrap, .empty-state {
    backdrop-filter: none;
  }
}

@media (max-width: 960px), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
}

/* CSS layout/paint containment & offscreen virtualization for large grids */
.hud-panel,
.viz-panel,
.table-wrap,
.kpi-card {
  contain: layout style;
}

.grid-cards > .card {
  content-visibility: auto;
  contain-intrinsic-size: auto 215px;
}
