/*
 * AuditPilot workspace system
 * Visual source: VoltAgent/awesome-design-md · design-md/linear.app/DESIGN.md.
 * The token values below intentionally mirror that source.
 */

:root {
  color-scheme: dark;
  --bg: #010102;
  --surface: #0f1011;
  --surface-muted: #141516;
  --surface-raised: #18191a;
  --surface-high: #191a1b;
  --text: #f7f8f8;
  --ink-muted: #d0d6e0;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;
  --muted: #8a8f98;
  --line: #23252a;
  --line-strong: #34343a;
  --line-tertiary: #3e3e44;
  --primary: #5e6ad2;
  --primary-dark: #5e69d1;
  --primary-focus: #5e69d1;
  --primary-hover: #828fff;
  --accent: #5e6ad2;
  --warning: #d5a95f;
  --danger: #e06c75;
  --success: #27a644;
  --ink: #f7f8f8;
  --shadow: none;
  --shadow-soft: inset 0 1px 0 rgba(255, 255, 255, .035);
  --glass: rgba(15, 16, 17, .96);
  --workspace-width: 1280px;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-feature-settings: "kern" 1, "ss01" 1, "tnum" 1;
  line-height: 1.55;
}

body::before {
  display: none;
}

.app-shell {
  grid-template-columns: 216px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 12px;
  background: rgba(1, 1, 2, .98);
  border-right: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  margin: 0 7px 24px;
  gap: 11px;
  font-size: 15px;
  letter-spacing: -.015em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: none;
}

.brand small {
  color: var(--ink-tertiary, #62666d);
  font-size: 9px;
  letter-spacing: .12em;
}

.nav-list {
  gap: 2px;
}

.nav-link {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--ink-subtle, #8a8f98);
  font-size: 13px;
}

.nav-link:hover,
.nav-link.active {
  color: #f5f7fa;
  background: var(--surface-muted);
  box-shadow: none;
  transform: none;
}

.nav-link.active::before {
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--primary);
  box-shadow: none;
}

.sidebar-note {
  margin-top: 18px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--ink-subtle, #8a8f98);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
  font-size: 11px;
  line-height: 1.62;
}

.main {
  max-width: var(--workspace-width);
  padding: 20px clamp(20px, 2.5vw, 36px) 48px;
}

.topbar,
.workspace-header {
  min-height: 62px;
  margin-bottom: 14px;
  padding: 8px 0 12px;
  background: rgba(1, 1, 2, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.page-title {
  min-width: 0;
}

.page-title h1,
.workspace-header h1 {
  font-size: clamp(24px, 2.1vw, 31px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.6px;
}

.page-title p {
  max-width: 900px;
  margin-top: 5px;
  color: var(--ink-subtle, #8a8f98);
  font-size: 13px;
  line-height: 1.58;
}

.workspace-actions {
  gap: 8px;
}

.global-search {
  width: min(290px, 25vw);
}

.global-search input,
.status-pill {
  min-height: 36px;
}

.page-quickbar {
  top: 76px;
  margin: -2px 0 14px;
  padding: 6px;
  gap: 4px;
  border-radius: 9px;
  border-color: var(--line);
  background: rgba(15, 16, 17, .96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.quickbar-link,
.density-toggle,
.focus-toggle {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink-subtle, #8a8f98);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}

.quickbar-link:hover,
.quickbar-link.active,
.density-toggle:hover,
.focus-toggle:hover,
.section-focus-mode .focus-toggle {
  color: #eef2f6;
  background: var(--surface-muted);
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 7px;
  color: #9aa4b2;
  background: #10141a;
  border-color: #272d37;
  box-shadow: none;
  font-size: 12px;
}

.status-dot,
.signal-dot {
  background: var(--success);
  animation: statusBreathe 2.8s ease-in-out infinite;
}

.panel,
.card,
.system-card-main,
.system-mini-card,
.candidate-card,
.quality-card,
.radar-card,
.backlog-item,
.proposal-card,
.lane-card,
.governance-detail,
.score-pill,
.item,
.signal,
.trace-step,
.delivery-card,
.control-card,
.scenario-card,
.tool-card,
.memory-card,
.evaluation-card,
.run-card {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.panel {
  padding: 24px;
  animation: workspaceEnter .34s var(--ease-out-ui) both;
  transition: border-color .18s ease, background-color .18s ease, transform .18s var(--ease-out-ui);
}

.panel:hover {
  transform: none;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title {
  margin-bottom: 11px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.2px;
}

.panel-head .panel-title {
  margin-bottom: 3px;
}

.muted,
.metric-label,
.section-title p {
  color: var(--ink-subtle);
}

.item {
  padding: 12px;
}

.item.compact {
  padding: 10px 11px;
}

.btn {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.btn:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--line-strong);
  transform: none;
  box-shadow: none;
}

.btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.btn.primary:hover {
  color: #fff;
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: none;
}

.btn.danger,
.btn.danger.ghost {
  color: #f39a9a;
  border-color: rgba(240, 120, 120, .26);
}

input,
select,
textarea {
  min-height: 38px;
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
  font-size: 13px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-focus, #5e69d1);
  box-shadow: 0 0 0 2px rgba(94, 105, 209, .48);
}

.segmented {
  border-radius: 7px;
  background: var(--bg);
  border-color: var(--line);
}

.seg {
  min-height: 28px;
  border-radius: 5px;
  color: var(--ink-subtle);
  font-size: 12px;
}

.seg.active {
  color: var(--text);
  background: var(--surface-muted);
  box-shadow: none;
}

.home-hero,
.console-hero,
.chat-command-panel {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.chat-command-panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 32px;
}

#chat-command.hero-console {
  grid-template-columns: minmax(0, 1fr);
}

.chat-command-copy h2 {
  max-width: 660px;
  font-size: clamp(28px, 2.4vw, 35px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.8px;
  text-wrap: balance;
}

.chat-command-copy p {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.65;
}

.home-hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 24px;
  min-height: 0;
  margin-bottom: 14px;
  padding: clamp(24px, 3vw, 38px);
}

.home-hero::before {
  display: none;
}

.hero-orb {
  display: none;
}

.home-hero-copy {
  gap: 13px;
}

.home-hero-copy h2 {
  max-width: 780px;
  color: var(--text);
  font-size: clamp(30px, 3.6vw, 49px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.048em;
  text-wrap: balance;
}

.home-hero-copy p,
.hero-copy {
  max-width: 750px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.72;
}

.section-kicker,
.hero-eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .4px;
}

.hero-tags {
  gap: 6px;
}

.hero-tags span,
.tag,
.chip,
.badge,
.status,
.command-badge {
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border-color: var(--line);
  box-shadow: none;
  font-size: 10px;
}

.home-hero-system {
  gap: 10px;
}

.system-card-main {
  min-height: 0;
  padding: 15px;
}

.system-flow {
  gap: 6px;
  margin: 15px 0;
}

.system-flow span {
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border-color: var(--line);
  font-size: 10px;
}

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

.system-layers > div {
  padding: 9px;
  border-radius: 8px;
  background: var(--surface);
  border-color: var(--line);
}

.system-layers small {
  font-size: 10px;
}

.system-mini-card {
  padding: 12px 14px;
  border-radius: 10px;
}

.system-mini-card strong {
  font-size: 27px;
}

.metric-strip {
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.metric-cell {
  padding: 14px 16px;
}

.metric-cell .metric-value {
  font-size: 25px;
}

.metric-cell small {
  color: var(--ink-subtle);
  font-size: 11px;
}

.business-value-section,
.scenario-section {
  margin-bottom: 14px;
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.section-heading-row h2 {
  max-width: 760px;
  margin: 7px 0 6px;
  color: var(--text);
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.section-heading-row p {
  max-width: 780px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.value-map {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.value-map-row {
  display: grid;
  grid-template-columns: 44px minmax(190px, .8fr) minmax(260px, 1.35fr) minmax(230px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 104px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  transition: background .18s ease;
}

.value-map-row:last-child { border-bottom: 0; }

.value-map-row:hover {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.value-index {
  align-self: start;
  color: var(--primary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.value-map-row small {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-subtle);
  font-size: 10px;
  letter-spacing: .04em;
}

.value-pain strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.value-map-row p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

.value-proof {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.value-proof span {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-subtle);
  background: var(--surface);
  font-size: 10px;
}

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

.scenario-value-card {
  position: relative;
  min-height: 220px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.scenario-value-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), transparent 75%);
  content: "";
}

.scenario-value-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  box-shadow: 0 12px 26px rgba(0, 0, 0, .12);
}

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

.scenario-standard {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}

.scenario-value-card h3 {
  margin: 17px 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.scenario-value-card > p {
  min-height: 58px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.65;
}

.scenario-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}

.scenario-card-metrics span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-muted);
  background: var(--surface);
  font-size: 10px;
}

.scenario-output {
  display: block;
  margin-top: 12px;
  color: var(--ink-subtle);
  font-size: 10px;
  line-height: 1.55;
}

.coverage-footnote {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-subtle);
  font-size: 11px;
  line-height: 1.6;
}

.evolution-command {
  grid-template-columns: minmax(0, 1.2fr) 148px minmax(260px, .8fr);
  gap: 14px;
  background: var(--surface);
}

.evolution-copy h2 {
  color: var(--text);
  font-size: 18px;
}

.evolution-copy p {
  color: var(--ink-subtle);
  font-size: 13px;
  line-height: 1.65;
}

.harness-score-card,
.harness-item,
.harness-meter {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--line);
  border-radius: 12px;
  box-shadow: none;
}

.harness-score-card {
  min-height: 120px;
  padding: 14px;
}

.harness-score-card strong {
  font-size: 35px;
}

.harness-item {
  padding: 9px;
  grid-template-columns: 54px minmax(0, 1fr);
}

.harness-item > span {
  color: #d0d6ff;
  background: rgba(94, 106, 210, .14);
}

.harness-item strong {
  color: var(--text);
}

.hero-console {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  gap: 14px;
}

.console-hero {
  min-height: 220px;
  padding: 20px;
}

.hero-title {
  max-width: 820px;
  margin: 8px 0;
  font-size: clamp(25px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.hero-actions {
  gap: 7px;
  margin-top: 14px;
}

.harness-metrics {
  grid-template-columns: minmax(190px, .8fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.harness-meter {
  min-height: 126px;
  padding: 15px;
}

.harness-meter strong {
  font-size: clamp(36px, 5vw, 55px);
  color: var(--primary);
}

.score-grid {
  gap: 7px;
}

.score-pill {
  padding: 9px 10px;
}

.quality-card,
.candidate-card,
.governance-detail,
.record-detail {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.selected-task,
.candidate-card[open],
.governance-detail[open] {
  background: var(--surface-muted);
  border-color: rgba(94, 106, 210, .52);
}

.matrix {
  border-radius: 9px;
  border-color: var(--line);
}

table,
.project-table,
.matrix table {
  background: var(--surface);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--ink-subtle);
  background: var(--surface-muted);
  border-color: var(--line);
  font-size: 11px;
  letter-spacing: .025em;
}

td {
  border-color: var(--line);
  font-size: 12px;
  line-height: 1.5;
}

tbody tr:hover {
  background: rgba(94, 106, 210, .07);
}

.section-collapse-btn {
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #919baa;
  background: #141820;
  border-color: #2a313c;
  backdrop-filter: none;
}

section.section-collapsed {
  max-height: 72px;
}

section.section-collapsed::after {
  height: 28px;
  background: linear-gradient(180deg, transparent, var(--surface));
}

.scroll-panel {
  max-height: min(520px, 60vh);
  overscroll-behavior: contain;
}

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

.component-contract {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #282f39;
  border-radius: 10px;
  background: #10141a;
}

.component-contract-head,
.component-score-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.component-contract h3 {
  margin: 0;
  color: #eef2f5;
  font-size: 14px;
  font-weight: 650;
}

.component-contract p {
  margin: 0;
  color: #939dab;
  font-size: 12px;
  line-height: 1.6;
}

.contract-meta {
  display: grid;
  gap: 4px;
  color: #7f8998;
  font-size: 11px;
}

.component-evaluation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.component-score-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.component-score-card progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-raised);
}

.component-score-card progress::-webkit-progress-bar {
  background: var(--surface-raised);
}

.component-score-card progress::-webkit-progress-value {
  background: var(--primary);
}

.assertion-list {
  display: grid;
  gap: 4px;
  color: #8993a2;
  font-size: 11px;
}

.assertion-list span {
  display: flex;
  gap: 7px;
  align-items: flex-start;
}

.assertion-list span::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--danger);
}

.assertion-list span.pass::before {
  background: var(--success);
}

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

.loop-status span {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-subtle);
  background: var(--surface);
  font-size: 11px;
}

.quality-ring {
  --quality-color: var(--primary);
  width: 112px;
  height: 112px;
  border: 1px solid var(--line-strong);
  background: conic-gradient(
    var(--quality-color) calc(var(--score) * 1%),
    var(--surface-raised) 0
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: background .28s ease, border-color .28s ease;
}

.quality-ring[data-status="pass"] {
  --quality-color: var(--success);
  border-color: rgba(39, 166, 68, .55);
}

.quality-ring[data-status="review"] {
  --quality-color: var(--primary);
  border-color: rgba(94, 106, 210, .66);
}

.quality-ring[data-status="blocked"] {
  --quality-color: var(--danger);
  border-color: rgba(224, 108, 117, .6);
}

.quality-ring span {
  width: 82px;
  height: 82px;
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.step-evaluation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #252b35;
}

.message.ai {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

.chat-box {
  color: var(--ink-muted);
  background: var(--bg);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  scrollbar-color: var(--line-strong) var(--bg);
}

.agent-orbit {
  border-radius: 16px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.agent-orbit::before,
.agent-orbit::after {
  border-color: rgba(94, 106, 210, .38);
}

.agent-orbit span {
  min-width: 72px;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border-color: var(--line-strong);
  box-shadow: none;
  font-weight: 500;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.agent-orbit span:hover {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.agent-orbit span:nth-child(6) {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary-hover);
}

.message-copy {
  color: var(--ink-muted);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.message.user {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary-hover);
  box-shadow: none;
}

.markdown-body {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.72;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text);
  letter-spacing: -.025em;
}

.markdown-body table {
  display: table;
  width: 100%;
}

@keyframes workspaceEnter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes workspaceSweep {
  from { background-position: -80vw 0; }
  to { background-position: 160vw 0; }
}

@keyframes statusBreathe {
  0%, 100% { opacity: .72; box-shadow: 0 0 0 3px rgba(94, 106, 210, .08); }
  50% { opacity: 1; box-shadow: 0 0 0 5px rgba(94, 106, 210, .14); }
}

@media (max-width: 1180px) {
  .component-boundary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-layers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid #202630;
    background: rgba(7, 9, 13, .98);
  }

  .brand {
    margin: 0 0 8px;
  }

  .nav-list {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 11px;
  }

  .nav-link.active::before {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 0;
    width: auto;
    height: 2px;
  }

  .main {
    padding: 16px 16px 38px;
  }

  .topbar,
  .workspace-header {
    position: static;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }

  .page-quickbar {
    top: 104px;
  }

  .home-hero,
  .hero-console,
  .evolution-command,
  .harness-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 22px;
  }

  .home-hero-copy h2 {
    font-size: clamp(28px, 7vw, 40px);
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .value-map-row {
    grid-template-columns: 34px minmax(170px, .8fr) minmax(240px, 1.2fr);
  }

  .value-proof {
    grid-column: 2 / -1;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .scenario-value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-cell {
    border-bottom: 1px solid var(--line);
  }

  .component-boundary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding-inline: 12px;
  }

  .sidebar {
    padding-inline: 12px;
  }

  .workspace-actions,
  .hero-actions,
  .toolbar {
    width: 100%;
  }

  .global-search {
    width: 100%;
  }

  .home-hero {
    padding: 18px;
    border-radius: 12px;
  }

  .home-hero-system {
    display: none;
  }

  .metric-strip,
  .harness-metrics,
  .component-evaluation-grid,
  .loop-status {
    grid-template-columns: 1fr;
  }

  .metric-cell {
    border-right: 0;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .value-map-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
  }

  .value-solution,
  .value-proof {
    grid-column: 2;
  }

  .scenario-value-grid {
    display: flex;
    gap: 10px;
    margin-inline: -4px;
    padding: 4px 4px 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .scenario-value-card {
    flex: 0 0 min(82vw, 330px);
    min-height: 210px;
    scroll-snap-align: start;
  }

  .panel {
    padding: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .status-dot,
  .signal-dot,
  .panel {
    animation: none;
  }
}
