﻿:root {
  color-scheme: dark;
  --bg: #05070c;
  --bg-soft: #080d14;
  --panel: rgba(14, 21, 33, 0.78);
  --panel-strong: rgba(17, 27, 42, 0.92);
  --line: rgba(117, 226, 205, 0.18);
  --line-strong: rgba(117, 226, 205, 0.34);
  --text: #eef7ff;
  --muted: #8ea0b8;
  --faint: #58677b;
  --cyan: #42d9c8;
  --blue: #5aa7ff;
  --green: #75e2a7;
  --amber: #f3bf55;
  --red: #ff6b7c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(66, 217, 200, 0.12), transparent 28%),
    radial-gradient(circle at 84% 24%, rgba(90, 167, 255, 0.12), transparent 24%),
    linear-gradient(135deg, #05070c 0%, #0a1018 44%, #06080d 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.button,
.ghost-button {
  border: 1px solid var(--line-strong);
  background: rgba(66, 217, 200, 0.12);
  color: var(--text);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

button:hover,
.button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: rgba(66, 217, 200, 0.2);
  box-shadow: 0 0 28px rgba(66, 217, 200, 0.13);
}

.primary-button {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #041018;
  border-color: transparent;
}

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.5;
  animation: drift 12s ease-in-out infinite alternate;
}

.ambient-one {
  width: 340px;
  height: 340px;
  left: 18%;
  top: -160px;
  background: rgba(66, 217, 200, 0.16);
}

.ambient-two {
  width: 460px;
  height: 460px;
  right: -190px;
  bottom: 8%;
  background: rgba(90, 167, 255, 0.13);
  animation-delay: -4s;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(24px, 18px, 0) scale(1.08);
  }
}

.terminal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  transition: grid-template-columns 220ms ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(5, 9, 15, 0.74);
  backdrop-filter: blur(20px);
  z-index: 2;
}

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

.terminal-shell.sidebar-collapsed .sidebar {
  padding: 20px 14px;
  align-items: center;
}

.terminal-shell.sidebar-collapsed .brand span:last-child,
.terminal-shell.sidebar-collapsed .side-nav a {
  font-size: 0;
}

.terminal-shell.sidebar-collapsed .brand span:last-child,
.terminal-shell.sidebar-collapsed .source-card {
  display: none;
}

.terminal-shell.sidebar-collapsed .nav-group-label {
  display: none;
}

.terminal-shell.sidebar-collapsed .nav-group + .nav-group {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

.terminal-shell.sidebar-collapsed .side-nav a {
  justify-content: center;
  padding: 0;
  width: 48px;
}

.terminal-shell.sidebar-collapsed .nav-icon {
  font-size: 12px;
}

.brand,
.top-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #041018;
  font-weight: 950;
  box-shadow: 0 0 28px rgba(66, 217, 200, 0.28);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 70%;
  height: 2px;
  left: 15%;
  bottom: 10px;
  background: rgba(4, 16, 24, 0.65);
}

.brand-mark.compact {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.brand small,
.source-card small,
.eyebrow,
.metric span,
.metric small,
.panel-heading span,
.muted,
td {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group + .nav-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.nav-group-label {
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dbe8f8;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.side-nav a:hover,
.side-nav a.active {
  transform: translateX(2px);
  border-color: var(--line-strong);
  background: rgba(66, 217, 200, 0.08);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.source-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 17, 27, 0.72);
}

.workspace {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 34px) 34px;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-brand {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.sidebar-toggle {
  display: inline-grid;
  place-items: center;
}

.sidebar-toggle span {
  width: 16px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: var(--cyan);
}

.sidebar-toggle span + span {
  margin-top: 4px;
}

.top-status-rail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logout-button {
  border-color: rgba(255, 107, 124, 0.46);
  background: rgba(255, 107, 124, 0.12);
  color: #ffd7dd;
}

.logout-button:hover {
  border-color: var(--red);
  background: rgba(255, 107, 124, 0.2);
  box-shadow: 0 0 28px rgba(255, 107, 124, 0.14);
}

.sidebar-logout {
  margin-top: 8px;
  width: 100%;
}

.live-badge,
.pill,
.badge {
  min-height: 30px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(66, 217, 200, 0.07);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.view-root {
  display: grid;
  gap: 18px;
  min-width: 0;
  animation: fadeUp 500ms ease both;
}

.view-root > *,
.metric-grid,
.grid-2,
.grid-3,
.panel,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  min-height: calc(100vh - 108px);
  display: grid;
  align-items: center;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(117, 226, 205, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 226, 205, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
  animation: gridPulse 5s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  from {
    opacity: 0.35;
  }

  to {
    opacity: 0.7;
  }
}

.hero-content {
  position: relative;
  max-width: 1120px;
  display: grid;
  gap: 24px;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(52px, 9vw, 118px);
  line-height: 0.88;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  max-width: 680px;
  color: #b8c7da;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.selector-panel,
.selector-row,
.risk-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.selector-panel {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 17, 27, 0.56);
}

.lab-controls {
  align-items: flex-end;
}

.risk-form {
  align-items: stretch;
}

.risk-field {
  flex: 1 1 220px;
  display: grid;
  gap: 8px;
}

.risk-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-weight: 800;
}

.risk-warning-stack {
  display: grid;
  gap: 10px;
}

.mapping-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mapping-card div {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 8px;
  padding: 12px;
}

.mapping-card span,
.mapping-card small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.mapping-card strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.tab-bar,
.quick-grid,
.compact-board,
.marker-legend,
.tv-legend,
.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tab-bar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 17, 27, 0.56);
}

.quick-grid {
  align-items: stretch;
}

.quick-grid .button {
  flex: 1 1 180px;
}

.compact-board {
  gap: 12px;
}

.compact-table table {
  min-width: 620px;
}

.selector-button {
  min-height: 36px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.045);
}

.compact-review-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.selector-button.active {
  border-color: var(--cyan);
  background: rgba(66, 217, 200, 0.2);
  color: var(--cyan);
  box-shadow: 0 0 24px rgba(66, 217, 200, 0.12);
}

.export-actions,
.review-actions {
  margin-left: auto;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tape {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.tape-item,
.metric,
.panel,
.setup-card,
.watch-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tape-item {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.tape-item strong {
  font-size: 22px;
}

.tape-item small.positive,
.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.page-heading h1 {
  margin: 6px 0 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
}

.page-heading p {
  margin: 0;
  max-width: 650px;
  color: var(--muted);
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 136px;
  padding: 18px;
  display: grid;
  gap: 8px;
  align-content: space-between;
  transition: transform 180ms ease, border-color 180ms ease;
}

.metric > span,
.metric > strong,
.metric > small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dashboard-metric {
  min-height: 164px;
}

.metric:hover,
.panel:hover,
.setup-card:hover,
.watch-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.metric strong {
  font-size: 36px;
  line-height: 1;
}

.dashboard-metric strong {
  display: grid;
  gap: 6px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.02;
}

.metric-grid.mission-filterable .dashboard-metric strong {
  font-size: clamp(18px, 2vw, 30px);
}

.equity-monitor-panel {
  display: grid;
  gap: 16px;
}

.equity-chart {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 8, 14, 0.78);
}

.metric-subvalue {
  color: var(--cyan);
  font-size: 17px;
  font-weight: 900;
}

.metric-note-lines {
  display: grid;
  gap: 4px;
  line-height: 1.25;
}

.outcome-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.outcome-pill {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  color: #061014;
}

.outcome-pill.win {
  background: var(--green);
}

.outcome-pill.loss {
  background: var(--red);
}

.grade-card {
  border-color: rgba(117, 226, 205, 0.28);
  background: linear-gradient(145deg, rgba(66, 217, 200, 0.13), rgba(11, 17, 27, 0.82));
}

.metric .sparkline {
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(66, 217, 200, 0.08), rgba(90, 167, 255, 0.18));
  position: relative;
  overflow: hidden;
}

.metric .sparkline::after {
  content: "";
  position: absolute;
  inset: 11px -20px auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scan 2.6s linear infinite;
}

@keyframes scan {
  from {
    transform: translateX(-30%);
  }

  to {
    transform: translateX(70%);
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.chart {
  width: 100%;
  min-height: 320px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    rgba(3, 8, 14, 0.5);
  background-size: 100% 20%, 9% 100%, auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.tv-ready-chart {
  min-height: 360px;
}

.tv-legend {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(66, 217, 200, 0.06);
}

.tv-legend span {
  color: var(--muted);
}

.tradingview-shell {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #05070c;
}

.tradingview-shell iframe {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
}

.tv-embed-note {
  min-height: 116px;
  margin-top: 14px;
}

.chart-placeholder-card {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(rgba(117, 226, 205, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 226, 205, 0.06) 1px, transparent 1px),
    rgba(3, 8, 14, 0.44);
  background-size: 32px 32px;
}

.chart-placeholder-card strong {
  font-size: clamp(22px, 3vw, 34px);
}

.chart-placeholder-card p {
  margin: 0;
  max-width: 620px;
  line-height: 1.55;
}

.chart-placeholder-card code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--green);
  background: rgba(0, 0, 0, 0.22);
}

.compact-note {
  min-height: 88px;
}

.confidence-warning {
  min-height: 0;
  margin-bottom: 14px;
  border-style: solid;
  border-color: rgba(243, 191, 85, 0.36);
  background: rgba(243, 191, 85, 0.07);
}

.panel-subsection {
  margin-top: 18px;
}

.marker-legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--cyan);
}

.legend-dot.above,
.legend-dot.reclaim {
  background: var(--green);
}

.legend-dot.below,
.legend-dot.reject {
  background: var(--red);
}

.legend-dot.slide {
  background: var(--blue);
}

.bias-stack {
  display: grid;
  gap: 10px;
}

.compact-context {
  gap: 8px;
}

.context-note {
  margin-top: 12px;
}

.bias-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  min-width: 0;
  overflow-wrap: anywhere;
}

.bias-row span,
.bias-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bias-row span {
  flex: 0 1 auto;
}

.bias-row strong {
  flex: 1 1 auto;
  text-align: right;
  white-space: normal;
}

.setup-grid,
.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.watch-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.setup-card,
.watch-card {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.setup-top,
.watch-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.strength {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.strength span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.table-wrap {
  overflow-x: auto;
}

.research-report-block {
  background: rgba(3, 7, 18, 0.52);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
  max-height: 520px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.clickable-table tbody tr {
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.clickable-table tbody tr:hover {
  background: rgba(66, 217, 200, 0.08);
}

.review-modal[aria-hidden="true"],
.review-modal:empty {
  display: none;
}

.review-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.review-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.78);
  backdrop-filter: blur(12px);
}

.review-dialog {
  position: relative;
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.66);
}

.review-chart {
  min-height: 420px;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

th {
  color: #dfeeff;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.distribution {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.research-list {
  display: grid;
  gap: 12px;
}

.research-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.panel-grid {
  display: grid;
  gap: 14px;
}

.panel-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mission-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(117, 226, 205, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(66, 217, 200, 0.12), rgba(90, 167, 255, 0.07) 42%, rgba(14, 21, 33, 0.84)),
    rgba(14, 21, 33, 0.78);
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow: hidden;
}

.mission-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.95;
}

.mission-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mission-hero-actions,
.mission-lock-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.mission-hero-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(142, 160, 184, 0.22);
  border-radius: 8px;
  background: rgba(3, 8, 14, 0.46);
  min-width: 0;
  overflow: hidden;
}

.mission-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-top: 6px;
}

.mission-section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.mission-filter {
  width: min(100%, 360px);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(142, 160, 184, 0.3);
  border-radius: 8px;
  color: var(--text);
  background: rgba(3, 8, 14, 0.62);
}

.mission-filter:focus {
  outline: 2px solid rgba(66, 217, 200, 0.45);
  outline-offset: 2px;
  border-color: var(--cyan);
}

.mission-spotlight {
  border-color: rgba(117, 226, 167, 0.26);
  background: linear-gradient(145deg, rgba(117, 226, 167, 0.1), rgba(11, 17, 27, 0.78));
}

.mission-empty-state {
  padding: 16px;
  border: 1px dashed rgba(142, 160, 184, 0.28);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.state-loading {
  position: relative;
  overflow: hidden;
}

.state-loading::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  animation: scan 1.8s linear infinite;
}

@media (max-width: 1100px) {
  .terminal-shell {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .terminal-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    height: auto;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .brand,
  .source-card {
    display: none;
  }

  .side-nav {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
  }

  .side-nav a {
    flex: 0 0 auto;
  }

  .top-brand {
    display: inline-flex;
  }

  .grid-2,
  .metric-grid,
  .grid-3,
  .panel-grid.two-column,
  .mission-hero,
  .setup-grid,
  .watch-grid,
  .hero-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .page-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .grid-2,
  .metric-grid,
  .grid-3,
  .panel-grid.two-column,
  .mission-hero,
  .setup-grid,
  .watch-grid,
  .mapping-card,
  .review-meta,
  .hero-tape {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding: 34px 0;
  }

  .side-nav a {
    padding: 0 10px;
  }

  .terminal-shell.sidebar-collapsed .sidebar {
    padding: 14px;
  }

  .terminal-shell.sidebar-collapsed .side-nav,
  .terminal-shell.sidebar-collapsed .source-card {
    display: none;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .top-status-rail {
    width: 100%;
  }

  .mission-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Shared UI state components */
.section-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 14px 0;
  flex-wrap: wrap;
}

.status-badge-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge {
  border: 1px solid rgba(142, 160, 184, 0.28);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 7px 10px;
  text-transform: uppercase;
}

.status-badge.source {
  border-color: rgba(90, 167, 255, 0.35);
  color: var(--accent);
}

.status-badge.readonly {
  border-color: rgba(117, 226, 167, 0.35);
  color: var(--green);
}

.status-badge.success {
  border-color: rgba(117, 226, 167, 0.35);
  color: var(--green);
}

.status-badge.warning {
  border-color: rgba(243, 191, 85, 0.42);
  color: var(--amber);
}

.status-badge.muted-chip {
  color: var(--muted);
}

.status-strip {
  align-items: center;
  background: rgba(11, 18, 32, 0.52);
  border: 1px solid rgba(142, 160, 184, 0.18);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
}

.status-strip-compact {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-status-strip {
  justify-content: space-between;
}

.compact-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.compact-success-copy {
  margin: 10px 0 0;
}

.mini-refresh {
  background: rgba(90, 167, 255, 0.08);
  border: 1px solid rgba(90, 167, 255, 0.28);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  min-height: 34px;
  padding: 0 12px;
}

.mini-refresh:hover {
  background: rgba(90, 167, 255, 0.16);
}

.state-card {
  background: rgba(11, 18, 32, 0.64);
  border: 1px solid rgba(142, 160, 184, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 13px 14px;
}

.state-card-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.state-card strong {
  color: var(--text);
  font-size: 13px;
}

.state-card p,
.state-card small,
.state-card span {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.state-loading {
  border-color: rgba(90, 167, 255, 0.36);
}

.state-empty {
  border-color: rgba(142, 160, 184, 0.32);
}

.state-error {
  background: rgba(255, 107, 124, 0.08);
  border-color: rgba(255, 107, 124, 0.42);
}

.state-success,
.state-readonly {
  background: rgba(117, 226, 167, 0.06);
  border-color: rgba(117, 226, 167, 0.32);
}

.state-stale,
.state-warning {
  background: rgba(243, 191, 85, 0.08);
  border-color: rgba(243, 191, 85, 0.42);
}

.data-health-card {
  margin-top: 18px;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-panel {
  background: rgba(11, 18, 32, 0.84);
  border: 1px solid rgba(142, 160, 184, 0.24);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  display: grid;
  gap: 16px;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.auth-brand {
  margin-bottom: 4px;
}

.auth-panel h1 {
  font-size: 28px;
  margin: 0;
}

.auth-panel p {
  color: var(--muted);
  margin: 0;
}

.auth-panel form {
  display: grid;
  gap: 14px;
}

.auth-panel label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  text-transform: uppercase;
}

.auth-panel input {
  background: rgba(3, 7, 18, 0.72);
  border: 1px solid rgba(142, 160, 184, 0.28);
  border-radius: 8px;
  color: var(--text);
  min-height: 42px;
  padding: 0 12px;
}

@media (max-width: 760px) {
  .section-toolbar {
    align-items: stretch;
  }

  .mini-refresh {
    width: 100%;
  }
}


/* Mobile-first module differentiation */
.mobile-system-status {
  display: none;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(117, 226, 167, 0.32);
  border-radius: 999px;
  color: var(--green);
  background: rgba(117, 226, 167, 0.08);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.module-hero {
  --module-accent: var(--cyan);
  --module-accent-soft: rgba(66, 217, 200, 0.11);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid color-mix(in srgb, var(--module-accent) 34%, transparent);
  border-left: 5px solid var(--module-accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--module-accent-soft), rgba(10, 16, 24, 0.92)),
    rgba(14, 21, 33, 0.74);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.module-hero .module-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #041018;
  background: var(--module-accent);
  font-size: 23px;
  font-weight: 950;
}

.module-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.module-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.module-label {
  color: var(--module-accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.module-mission,
.mission-hero {
  --module-accent: var(--green);
  --module-accent-soft: rgba(117, 226, 167, 0.11);
}

.module-research {
  --module-accent: #7dd3fc;
  --module-accent-soft: rgba(125, 211, 252, 0.11);
}

.module-queue {
  --module-accent: #c4b5fd;
  --module-accent-soft: rgba(196, 181, 253, 0.12);
}

.module-strategy,
.module-edge {
  --module-accent: var(--amber);
  --module-accent-soft: rgba(243, 191, 85, 0.1);
}

.module-governance {
  --module-accent: #fb7185;
  --module-accent-soft: rgba(251, 113, 133, 0.1);
}

.summary-card {
  border-top: 3px solid var(--module-accent, var(--cyan));
  background:
    linear-gradient(180deg, var(--module-accent-soft, rgba(66, 217, 200, 0.08)), rgba(14, 21, 33, 0.72)),
    rgba(14, 21, 33, 0.72);
}

.summary-card strong {
  overflow-wrap: anywhere;
}

.detail-panel {
  padding: 0;
  border: 1px solid rgba(142, 160, 184, 0.22);
  border-radius: 8px;
  background: rgba(9, 14, 22, 0.56);
  overflow: hidden;
}

.detail-panel > summary {
  min-height: 48px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
  list-style: none;
}

.detail-panel > summary::-webkit-details-marker {
  display: none;
}

.detail-panel > summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 18px;
}

.detail-panel[open] > summary::after {
  content: "-";
}

.detail-panel-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.legacy-note {
  border-color: rgba(243, 191, 85, 0.32);
  background: rgba(243, 191, 85, 0.07);
}

@media (max-width: 768px) {
  html,
  body,
  .terminal-shell,
  .workspace,
  .view-root {
    max-width: 100vw;
    overflow-x: hidden;
  }

  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .terminal-shell {
    display: flex;
    flex-direction: column;
  }

  .workspace {
    order: 1;
    padding: 10px max(12px, env(safe-area-inset-left)) 22px max(12px, env(safe-area-inset-right));
  }

  .sidebar {
    order: 2;
    display: none;
    width: 100%;
    padding: 0 12px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 9, 15, 0.96);
    backdrop-filter: blur(18px);
  }

  .terminal-shell:not(.sidebar-collapsed) .sidebar {
    display: flex;
  }

  .terminal-shell:not(.sidebar-collapsed) .side-nav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    overflow: visible;
  }

  .terminal-shell:not(.sidebar-collapsed) .side-nav a {
    width: 100%;
    min-height: 46px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    min-height: 58px;
    margin: -10px -12px 12px;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid rgba(142, 160, 184, 0.18);
    background: rgba(5, 9, 15, 0.96);
    backdrop-filter: blur(18px);
  }

  .topbar-primary {
    width: 100%;
    justify-content: space-between;
  }

  .top-brand {
    display: inline-flex;
  }

  .mobile-system-status {
    display: inline-flex;
  }

  .top-actions {
    display: none;
    width: 100%;
    margin-left: 0;
    padding-top: 8px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .terminal-shell:not(.sidebar-collapsed) .top-actions {
    display: grid;
  }

  .top-actions .live-badge,
  .top-actions .top-status-rail {
    display: none;
  }

  .top-actions .ghost-button,
  .top-actions .logout-button {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
  }

  .status-badge,
  .live-badge,
  .pill,
  .badge {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 10px;
    max-width: 100%;
  }

  .status-badge-row,
  .mission-lock-grid {
    gap: 6px;
  }

  .module-hero,
  .mission-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .module-hero .module-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .module-hero h1,
  .mission-hero h1 {
    font-size: clamp(30px, 12vw, 44px);
  }

  .module-hero p,
  .mission-hero p,
  .page-heading p,
  .muted {
    font-size: 13px;
  }

  .dashboard-metric,
  .metric {
    min-height: auto;
    padding: 14px;
  }

  .dashboard-metric strong,
  .metric strong {
    font-size: clamp(24px, 8vw, 34px);
  }

  .panel,
  .research-item {
    padding: 14px;
  }

  .mission-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
