
:root {
  --bg: #08111f;
  --bg-elevated: #0f1a2c;
  --panel: rgba(14, 24, 42, 0.92);
  --panel-soft: rgba(18, 29, 50, 0.88);
  --panel-strong: #13213b;
  --border: rgba(120, 148, 198, 0.18);
  --border-strong: rgba(135, 169, 227, 0.34);
  --text: #ecf2ff;
  --text-soft: #b8c5e0;
  --text-muted: #8ea0c1;
  --accent: #5d8dff;
  --accent-soft: rgba(93, 141, 255, 0.14);
  --accent-strong: #7da4ff;
  --success: #2fd99f;
  --success-soft: rgba(47, 217, 159, 0.16);
  --warn: #f0b14a;
  --warn-soft: rgba(240, 177, 74, 0.14);
  --danger: #ff7676;
  --danger-soft: rgba(255, 118, 118, 0.16);
  --purple: #aa7dff;
  --purple-soft: rgba(170, 125, 255, 0.16);
  --shadow: 0 18px 50px rgba(3, 8, 20, 0.36);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(93, 141, 255, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(170, 125, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #09111f 0%, #07101d 100%);
  min-height: 100vh;
}
body.theme-contrast {
  --accent: #4dd2ff;
  --accent-soft: rgba(77, 210, 255, 0.14);
  --accent-strong: #8ee8ff;
}
body.theme-ember {
  --accent: #ff8c5d;
  --accent-soft: rgba(255, 140, 93, 0.14);
  --accent-strong: #ffbf9f;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.site-shell {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(8, 15, 29, 0.94), rgba(9, 15, 27, 0.92));
  backdrop-filter: blur(16px);
  overflow: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.2), rgba(170, 125, 255, 0.22));
  border: 1px solid var(--border-strong);
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand-copy strong { display: block; font-size: 0.98rem; }
.brand-copy span { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

.sidebar-block {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.92), rgba(11, 20, 37, 0.9));
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sidebar-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.flow-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}
.flow-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--text-soft);
  font-size: 0.88rem;
}
.flow-list span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(93, 141, 255, 0.16);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}
.nav-list {
  display: grid;
  gap: 8px;
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: 180ms ease;
}
.nav-link:hover {
  background: rgba(93, 141, 255, 0.08);
  border-color: rgba(93, 141, 255, 0.16);
  color: var(--text);
}
.nav-link.is-active {
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.18), rgba(170, 125, 255, 0.16));
  border-color: var(--border-strong);
  color: white;
}
.nav-link small {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.sidebar-stats {
  display: grid;
  gap: 8px;
}
.sidebar-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.sidebar-stat strong { color: var(--text); }

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.sidebar-note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.content-shell {
  min-width: 0;
  padding: 22px;
}
.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.page-toolbar h1 {
  margin: 6px 0 8px;
  font-size: clamp(1.7rem, 2.2vw, 2.4rem);
  line-height: 1.05;
}
.page-toolbar p {
  margin: 0;
  color: var(--text-soft);
  max-width: 68ch;
}
.eyebrow {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.toolbar-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 320px;
}
.metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.metric-pill {
  min-width: 120px;
  padding: 11px 13px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 36, 0.84);
}
.metric-pill span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.metric-pill strong { font-size: 1.02rem; }

.workspace-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}
.workspace-grid.three-col {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1.65fr) minmax(300px, 360px);
}
.workspace-grid.two-col {
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
}
.workspace-grid.surface-grid {
  grid-template-columns: minmax(280px, 310px) minmax(0, 1.55fr) minmax(300px, 360px);
}
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 24, 42, 0.94), rgba(10, 18, 34, 0.92));
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel.compact { padding: 16px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2, .panel-head h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
}
.panel-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.panel-stack {
  display: grid;
  gap: 14px;
}
.panel-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120, 148, 198, 0.22), transparent);
  margin: 2px 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.button {
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.16), rgba(170, 125, 255, 0.14));
  color: white;
  padding: 10px 14px;
  border-radius: 13px;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.button.ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border);
  color: var(--text-soft);
}
.button.warn {
  background: var(--warn-soft);
  border-color: rgba(240, 177, 74, 0.34);
  color: #ffe6b4;
}
.button.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 118, 118, 0.34);
  color: #ffd0d0;
}
.button.slim { padding: 8px 11px; border-radius: 12px; font-size: 0.9rem; }

.mini-chip, .status-badge, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.028);
  color: var(--text-soft);
  font-size: 0.78rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-badge.ready, .status-badge.active, .status-badge.complete { background: var(--success-soft); border-color: rgba(47, 217, 159, 0.28); color: #bdf6e2; }
.status-badge.pipeline, .status-badge.warm, .status-badge.running { background: var(--accent-soft); border-color: rgba(93, 141, 255, 0.3); color: #d7e4ff; }
.status-badge.review, .status-badge.warn { background: var(--warn-soft); border-color: rgba(240, 177, 74, 0.28); color: #ffe2b0; }
.status-badge.builder, .status-badge.draft, .status-badge.idle { background: rgba(255,255,255,0.03); color: var(--text-soft); }
.status-badge.blocked, .status-badge.disabled, .status-badge.error { background: var(--danger-soft); border-color: rgba(255, 118, 118, 0.28); color: #ffd2d2; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field-grid.single { grid-template-columns: 1fr; }
.field label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(8, 15, 28, 0.86);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 94px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(93, 141, 255, 0.14);
}
.helper {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.list-stack {
  display: grid;
  gap: 10px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}
.list-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: 160ms ease;
}
.list-item:hover {
  border-color: rgba(93, 141, 255, 0.26);
  transform: translateY(-1px);
}
.list-item.is-active {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.12), rgba(170, 125, 255, 0.12));
}
.list-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.list-item-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}
.list-item-copy {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}
.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.tiny {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.segmented button {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  border-radius: 11px;
}
.segmented button.is-active {
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.16), rgba(170, 125, 255, 0.14));
  color: white;
}

.chat-stream {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 12, 22, 0.7);
  padding: 14px;
  min-height: 470px;
  max-height: 620px;
  overflow: auto;
  display: grid;
  gap: 12px;
}
.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 92%;
}
.chat-message.is-self {
  margin-left: auto;
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: white;
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.9), rgba(170, 125, 255, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}
.chat-avatar.dev { background: linear-gradient(135deg, #3ccf95, #149f73); }
.chat-avatar.ops { background: linear-gradient(135deg, #ff9e57, #f16d4a); }
.chat-avatar.model { background: linear-gradient(135deg, #6d9cff, #4f7dff); }
.chat-avatar.creative { background: linear-gradient(135deg, #c37dff, #8d52ff); }
.chat-card {
  background: rgba(18, 28, 46, 0.86);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 17px;
  min-width: 0;
}
.chat-message.is-self .chat-card {
  background: rgba(93, 141, 255, 0.12);
}
.chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.chat-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}
.composer {
  display: grid;
  gap: 12px;
}
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.composer-note {
  color: var(--text-muted);
  font-size: 0.83rem;
}
.summary-box {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}
.summary-box h3 {
  margin: 4px 0 12px;
  font-size: 0.98rem;
}
.summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.kv {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}
.kv span { display: block; color: var(--text-muted); font-size: 0.74rem; margin-bottom: 5px; }
.kv strong { font-size: 1rem; }

.board {
  display: grid;
  gap: 12px;
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.board-column {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}
.board-column h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.task-card, .mini-card {
  border: 1px solid var(--border);
  background: rgba(8, 15, 28, 0.82);
  border-radius: 15px;
  padding: 12px;
}
.task-card + .task-card { margin-top: 8px; }
.task-title {
  font-weight: 600;
  margin-bottom: 7px;
}
.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}
.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.progress.warn > span { background: linear-gradient(90deg, #f0b14a, #ffda6b); }
.progress.good > span { background: linear-gradient(90deg, #2fd99f, #66f0c0); }

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: auto;
  background: rgba(8, 15, 28, 0.76);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(120, 148, 198, 0.12);
  text-align: left;
  font-size: 0.9rem;
}
.data-table th {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.02);
}
.data-table tbody tr {
  cursor: pointer;
  transition: 150ms ease;
}
.data-table tbody tr:hover {
  background: rgba(93, 141, 255, 0.08);
}
.data-table tbody tr.is-active {
  background: rgba(93, 141, 255, 0.12);
}
.data-table td strong { display: block; font-size: 0.95rem; }
.data-table td small { color: var(--text-muted); }

.pipeline-track {
  display: grid;
  gap: 12px;
}
.stage-card {
  position: relative;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 8px;
}
.stage-card + .stage-card::before {
  content: "";
  position: absolute;
  left: 22px;
  top: -12px;
  width: 2px;
  height: 12px;
  background: linear-gradient(180deg, rgba(93, 141, 255, 0.08), rgba(93, 141, 255, 0.4));
}
.stage-card.is-active { border-color: rgba(93, 141, 255, 0.4); background: rgba(93, 141, 255, 0.08); }
.stage-card.is-complete { border-color: rgba(47, 217, 159, 0.28); background: rgba(47, 217, 159, 0.08); }
.stage-card.is-blocked { border-color: rgba(255, 118, 118, 0.3); background: rgba(255, 118, 118, 0.08); }
.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stage-state-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.small-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-soft);
  padding: 6px 9px;
  border-radius: 10px;
  font-size: 0.8rem;
}
.small-button.is-on {
  background: var(--accent-soft);
  border-color: rgba(93, 141, 255, 0.32);
  color: white;
}

.agent-grid {
  display: grid;
  gap: 12px;
}
.agent-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.025);
}
.agent-card.is-active {
  border-color: rgba(47, 217, 159, 0.32);
}
.agent-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}
.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.check-grid {
  display: grid;
  gap: 8px;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.check-grid input { accent-color: var(--accent); }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-soft);
  padding: 9px 12px;
  border-radius: 12px;
}
.tab-button.is-active {
  background: linear-gradient(135deg, rgba(93, 141, 255, 0.16), rgba(170, 125, 255, 0.12));
  color: white;
  border-color: var(--border-strong);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.callout {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}
.callout strong { display: block; margin-bottom: 7px; font-size: 0.95rem; }
.callout p { margin: 0; color: var(--text-soft); line-height: 1.45; }

.activity-list, .timeline {
  display: grid;
  gap: 9px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.timeline-item {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}
.timeline-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.92rem;
}
.timeline-item span, .timeline-item p {
  color: var(--text-soft);
  font-size: 0.87rem;
  line-height: 1.45;
  margin: 0;
}
.timeline-item small {
  display: inline-block;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.surface-metrics {
  display: grid;
  gap: 10px;
}
.surface-metric {
  padding: 12px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.surface-metric strong { display: block; margin-bottom: 5px; }
.surface-metric p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stack-sm { display: grid; gap: 10px; }
.stack-xs { display: grid; gap: 7px; }

.code-box {
  font-family: var(--mono);
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 22, 0.92);
  color: #d8e3ff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
  line-height: 1.5;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 10px;
}
.route-card {
  padding: 12px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.route-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.route-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 23, 40, 0.96);
  box-shadow: var(--shadow);
  color: white;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(120, 148, 198, 0.28);
  text-align: center;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}

.mission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.mission-title {
  margin: 0;
  font-size: 1.1rem;
}
.rich-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.rich-list li {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}
.note-card {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.note-card strong {
  display: block;
  margin-bottom: 5px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat-tile {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.stat-tile span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-bottom: 6px;
}
.stat-tile strong { font-size: 1.15rem; }

.surface-tab-content {
  display: grid;
  gap: 12px;
}
.surface-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.surface-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.surface-card h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.surface-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}
.surface-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 0.86rem;
}
.queue-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.queue-card .queue-copy {
  flex: 1;
}
.queue-card strong {
  display: block;
  margin-bottom: 6px;
}
.queue-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.45;
}
.model-card {
  padding: 13px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
}
.model-card.active { border-color: rgba(47, 217, 159, 0.28); }
.model-card.warm { border-color: rgba(93, 141, 255, 0.28); }
.model-card.idle { border-color: rgba(120,148,198,0.18); }
.model-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.model-card h3 {
  margin: 0;
  font-size: 0.98rem;
}
.bar-pair {
  display: grid;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.toggle-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-muted);
}
.status-dot.active { background: var(--success); }
.status-dot.warm { background: var(--accent); }
.status-dot.idle { background: var(--text-muted); }
.status-dot.blocked { background: var(--danger); }

.download-link {
  color: #d5e0ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 1440px) {
  .workspace-grid.three-col,
  .workspace-grid.surface-grid {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }
  .workspace-grid.three-col > :nth-child(3),
  .workspace-grid.surface-grid > :nth-child(3) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1180px) {
  .site-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .page-toolbar {
    flex-direction: column;
  }
  .toolbar-actions {
    justify-items: start;
    min-width: 0;
  }
  .metric-strip {
    justify-content: flex-start;
  }
}
@media (max-width: 900px) {
  .workspace-grid.two-col,
  .workspace-grid.three-col,
  .workspace-grid.surface-grid,
  .board-grid,
  .dual,
  .field-grid,
  .surface-cards,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .data-table {
    min-width: 600px;
  }
}
