:root {
  color-scheme: light;
  --governance-teal: #0d7a6e;
  --approved-green: #2d7d46;
  --risk-amber: #b45309;
  --rejected-red: #c0392b;
  --attribution-blue: #1b4f9b;
  --neutral-slate: #1e293b;
  --sidebar: #0f172a;
  --surface: #ffffff;
  --page: #f8fafc;
  --hover: #f1f5f9;
  --line: #e2e8f0;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --text: #0f172a;
  --body: #334155;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-family: "DM Sans", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--body);
  background: var(--page);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
}

.num,
code,
pre,
.metric-card strong,
.sidebar-meta strong,
.pulse strong,
td .status {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  color: var(--muted-light);
  background: var(--sidebar);
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--governance-teal);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.brand strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

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

.nav a {
  padding: 10px 16px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: var(--muted-light);
  font-size: 14px;
}

.nav a[aria-current="page"],
.nav a:hover {
  border-left-color: var(--governance-teal);
  color: #f8fafc;
  background: var(--neutral-slate);
}

.sidebar-meta {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12px;
}

.sidebar-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.topbar-actions,
.persona-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.persona-control {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.persona-control select {
  min-height: 34px;
  padding: 4px 28px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
}

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

.preset-card,
.trust-grid article {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--body);
  background: var(--surface);
  text-align: left;
}

.preset-card:hover,
.preset-card.active {
  border-color: var(--governance-teal);
  background: #f0fdfa;
}

.preset-card span,
.trust-grid span {
  color: var(--muted);
  font-size: 13px;
}

.proof-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.proof-grid,
.assurance-matrix,
.provider-bars {
  display: grid;
  gap: 12px;
}

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

.proof-grid article,
.assurance-matrix article,
.provider-bar-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.proof-grid article {
  display: grid;
  gap: 5px;
}

.proof-grid span,
.assurance-matrix small,
.provider-bar-card span {
  color: var(--muted);
  font-size: 13px;
}

.decision-stack {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.stack-bar {
  display: flex;
  width: 100%;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--hover);
}

.stack-bar i {
  display: grid;
  min-width: 28px;
  place-items: center;
  color: #ffffff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
}

.stack-bar .approved {
  background: var(--approved-green);
}

.stack-bar .degraded {
  background: var(--risk-amber);
}

.stack-bar .denied {
  background: var(--rejected-red);
}

.stack-bar .abstained {
  background: #6d28d9;
}

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

.stack-legend span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stack-legend small {
  color: var(--muted);
  line-height: 1.35;
}

.decision-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--governance-teal);
  border-radius: 6px;
  background: #f0fdfa;
}

.decision-banner span {
  color: var(--muted);
  font-size: 14px;
}

.decision-banner.denied {
  border-left-color: var(--rejected-red);
  background: #fef2f2;
}

.decision-banner.degraded {
  border-left-color: var(--risk-amber);
  background: #fffbeb;
}

.decision-banner.abstained {
  border-left-color: #6d28d9;
  background: #f5f3ff;
}

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

.provider-bar-card {
  display: grid;
  gap: 10px;
}

.provider-bar-card div,
.provider-bar-card label {
  display: grid;
  gap: 5px;
}

.provider-bar-card label {
  grid-template-columns: 86px 1fr 42px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.provider-bar-card i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--attribution-blue);
}

.provider-bar-card i.quality {
  background: var(--approved-green);
}

.assurance-matrix {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.assurance-matrix article {
  display: grid;
  gap: 7px;
}

.status.abstained {
  color: #6d28d9;
  background: #ede9fe;
}

.overage-alert {
  color: var(--risk-amber);
  font-weight: 600;
}

body[data-persona="cfo"] .provider-technical {
  display: none;
}

body[data-persona="bu_lead"] [data-bu]:not([data-bu="Fab Operations & Yield"]),
body[data-persona="bu_lead"] [data-agent-for]:not([data-agent-for="Fab Operations & Yield"]),
body[data-persona="bu_lead"] [data-ledger-table] tr:not([data-business-unit="Fab Operations & Yield"]) {
  display: none;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--governance-teal);
  box-shadow: 0 0 0 0 rgba(13, 122, 110, 0.4);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 122, 110, 0.38);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(13, 122, 110, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 122, 110, 0);
  }
}

.page {
  display: grid;
  gap: 22px;
  padding: 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.page-intro {
  min-width: 0;
}

.section-label,
legend {
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: clamp(34px, 4vw, 42px);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.page-intro h1 {
  max-width: 1040px;
}

.hero p,
.page-intro p {
  max-width: 760px;
  margin-bottom: 0;
  color: #475569;
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: normal;
}

.button.primary {
  border-color: var(--governance-teal);
  background: var(--governance-teal);
  color: #ffffff;
}

.button.secondary {
  color: var(--neutral-slate);
  background: #ffffff;
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.text-link,
.audit-link {
  border: 0;
  background: transparent;
  color: var(--attribution-blue);
  font-size: 14px;
  font-weight: 600;
}

.panel,
.metric-card,
.stage-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.executive-brief {
  padding: 20px 24px;
}

.executive-brief h2 {
  margin: 10px 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.executive-brief p {
  margin-bottom: 0;
}

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

.metric-grid.six {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.metric-card {
  min-height: 126px;
  padding: 20px 24px;
}

.metric-card span {
  display: block;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.sparkline {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 14px;
}

.problem-grid,
.dashboard-grid,
.standards-grid,
.benefit-grid,
.maturity-grid {
  display: grid;
  gap: 18px;
}

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

.dashboard-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}

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

.benefit-grid,
.maturity-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.token-bank-strip {
  padding: 18px;
}

.benefit-card,
.maturity-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.benefit-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.benefit-card > strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 25px;
}

.benefit-card small {
  color: var(--muted);
}

.executive-lens {
  padding: 22px 18px 18px;
}

.executive-lens > h2 {
  max-width: 820px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 26px;
  line-height: 1.2;
}

.executive-lens > p {
  max-width: 780px;
  margin-bottom: 18px;
  color: var(--muted);
}

.executive-stat {
  min-width: 0;
  padding: 16px 0;
  border-top: 3px solid var(--governance-teal);
}

.executive-stat span,
.executive-stat small {
  display: block;
  color: var(--muted);
}

.executive-stat span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.executive-stat strong {
  display: block;
  margin: 5px 0;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 25px;
}

.executive-stat small {
  font-size: 13px;
}

.benefit-bar {
  height: 7px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8f0;
}

.benefit-bar i {
  display: block;
  height: 100%;
  background: var(--governance-teal);
}

.problem-card,
.standard-card {
  padding: 20px 24px;
}

.problem-card h2 {
  margin: 10px 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.2;
}

.problem-card p {
  color: var(--body);
}

.problem-card strong {
  color: var(--governance-teal);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  min-height: auto;
  padding: 16px 18px;
}

.panel-head.inline {
  min-height: auto;
  padding: 0 0 12px;
  border-bottom: 0;
}

.panel-head strong {
  color: var(--text);
  font-weight: 600;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  padding: 18px;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
  padding: 18px;
}

.layer-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--attribution-blue);
  border-radius: 8px;
  background: #ffffff;
}

.layer-card > span {
  color: var(--attribution-blue);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.layer-card h2 {
  margin: 9px 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.layer-card p {
  font-size: 13px;
  line-height: 1.45;
}

.layer-card strong {
  color: var(--governance-teal);
  font-size: 13px;
  line-height: 1.4;
}

.pipeline-card {
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--governance-teal);
  border-radius: 8px;
  background: #ffffff;
}

.pipeline-card span {
  color: var(--governance-teal);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipeline-card p {
  margin: 9px 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.45;
}

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

.provider-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

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

.provider-list strong {
  display: block;
  color: var(--text);
}

.provider-list small {
  color: var(--muted);
}

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

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  color: var(--body);
}

.value-table td:first-child,
td:nth-child(2) {
  color: var(--text);
  font-weight: 500;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.status.large {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.approved,
.approved-optimized {
  border-color: #6ee7b7;
  color: #065f46;
  background: #d1fae5;
}

.rejected-budget,
.rejected-risk,
.rejected-roi,
.rejected-policy,
.rejected {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fee2e2;
}

.status.within,
.status.active {
  border-color: #6ee7b7;
  color: #065f46;
  background: #d1fae5;
}

.status.approaching,
.status.attestation-due,
.status.flagged {
  border-color: #fcd34d;
  color: #92400e;
  background: #fef3c7;
}

.status.breach,
.status.throttled,
.status.deprecated {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fee2e2;
}

.simulating {
  border-color: #93c5fd;
  color: #1e40af;
  background: #dbeafe;
}

.degraded {
  border-color: #fcd34d;
  color: #92400e;
  background: #fef3c7;
}

.ready {
  border-color: #cbd5e1;
  color: var(--muted);
  background: #f8fafc;
}

.positive {
  color: var(--approved-green);
}

.warning {
  color: var(--risk-amber);
}

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

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

.artifact-note,
.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

.simulation-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: start;
}

.intent-form {
  overflow: hidden;
}

fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

label,
.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid rgba(13, 122, 110, 0.28);
  outline-offset: 2px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--governance-teal);
}

.range-value {
  justify-self: end;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
}

.toggle-group,
.radio-grid,
.checkbox-grid,
.filter-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-group button,
.segmented button,
.stress-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--body);
}

.toggle-group button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
}

.toggle-group button.active,
.segmented button.active,
.stress-card.active {
  border-color: var(--governance-teal);
  color: #ffffff;
  background: var(--governance-teal);
}

.radio-grid label,
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--body);
}

.radio-grid input,
.checkbox-grid input {
  width: auto;
  min-height: auto;
}

.intent-form > .button,
.intent-form > .form-note {
  margin: 16px 18px;
}

.simulation-output {
  padding-bottom: 18px;
  overflow: hidden;
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 8px;
  padding: 18px;
}

.pipeline-track span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.pipeline-track span.active {
  color: #ffffff;
  background: var(--governance-teal);
  animation: pulse-stage 1s infinite;
}

.pipeline-track span.complete {
  color: #065f46;
  background: #d1fae5;
}

.pipeline-track span.complete::before {
  margin-right: 5px;
  content: "OK";
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

@keyframes pulse-stage {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 122, 110, 0.28);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(13, 122, 110, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 122, 110, 0);
  }
}

.signal-log {
  display: grid;
  gap: 7px;
  margin: 0 18px 18px;
  padding: 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #d1fae5;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.signal-log span::before {
  color: var(--governance-teal);
  content: "-> ";
}

.recent-box,
.decision-output {
  display: grid;
  gap: 16px;
  padding: 0 18px;
}

.recent-decision {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.recent-decision strong {
  color: var(--text);
}

.recent-decision small {
  color: var(--muted);
}

.decision-head {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.decision-head h2 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
}

.decision-head p {
  margin-bottom: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.constraint-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.constraint-box summary {
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.constraint-box ul,
.standard-card ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.constraint-box li span {
  display: block;
  color: var(--muted);
}

.consequence-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

dl {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(0, 1fr);
  gap: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: var(--text);
}

.stress-panel {
  overflow: hidden;
}

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

.stress-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  text-align: left;
}

.stress-card strong {
  color: inherit;
  font-size: 15px;
}

.stress-card span {
  color: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.ledger-kpis {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.ledger-navigation .panel-head {
  align-items: flex-start;
  flex-direction: column;
}

.ledger-navigation .segmented {
  width: 100%;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.segmented button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
}

.filter-row select {
  width: auto;
  min-width: 150px;
  min-height: 34px;
  font-size: 13px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.benefit-waterfall {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.benefit-waterfall article {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 90px 100px;
  gap: 12px;
  align-items: center;
}

.benefit-waterfall article > span {
  color: var(--text);
  font-weight: 600;
}

.benefit-waterfall article > div {
  height: 16px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e8f0;
}

.benefit-waterfall article i {
  display: block;
  height: 100%;
  background: var(--attribution-blue);
}

.benefit-waterfall article strong,
.benefit-waterfall article small {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.utilization {
  position: relative;
  display: block;
  width: 140px;
  height: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.utilization i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
}

.utilization.low i {
  background: #d1fae5;
}

.utilization.medium i {
  background: #fef3c7;
}

.utilization.high i {
  background: #fee2e2;
}

.utilization b {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}

.mini-spark {
  width: 90px;
  height: 24px;
}

.row-toggle {
  border: 0;
  background: transparent;
  color: var(--attribution-blue);
  font-weight: 600;
  text-align: left;
}

.agent-row td {
  background: #f8fafc;
}

.agent-row span {
  display: inline-block;
  margin-right: 18px;
  color: var(--muted);
}

.audit-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  width: min(440px, 100vw);
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.12);
}

.drawer-close {
  float: right;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.audit-drawer h2 {
  margin: 8px 0;
  color: var(--text);
}

.audit-drawer h3 {
  margin-bottom: 6px;
  color: var(--text);
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  padding: 18px;
}

.stage-card {
  padding: 18px;
}

.stage-card span {
  color: var(--governance-teal);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage-card h2 {
  margin: 10px 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.stage-card p {
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.stage-card dl div {
  grid-template-columns: 70px 1fr;
}

.standard-card {
  min-height: 190px;
}

.maturity-card h2 {
  margin: 12px 0 6px;
  color: var(--text);
  font-size: 22px;
}

.maturity-card p {
  margin-bottom: 0;
}

.code-map {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.code-map code {
  display: block;
  padding: 8px 0;
  color: var(--text);
  font-size: 13px;
  white-space: normal;
}

.data-error::before {
  display: block;
  padding: 10px 18px;
  color: #991b1b;
  background: #fee2e2;
  content: "Console data could not be loaded.";
}

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

  .metric-grid,
  .metric-grid.six,
  .problem-grid,
  .dashboard-grid,
  .pipeline-grid,
  .layer-grid,
  .architecture-flow,
  .standards-grid,
  .benefit-grid,
  .maturity-grid,
  .stress-grid,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-layout,
  .provider-bars,
  .assurance-matrix {
    grid-template-columns: 1fr;
  }

  .simulation-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    width: 100%;
    max-width: 100vw;
  }

  .preset-grid,
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: block;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    padding: 8px;
    box-sizing: border-box;
  }

  .sidebar .brand,
  .sidebar-meta {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  .nav a {
    display: grid;
    min-width: 0;
    min-height: 42px;
    place-items: center;
    padding: 6px 4px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    overflow: hidden;
    font-size: 11px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav a[aria-current="page"],
  .nav a:hover {
    border-bottom-color: var(--governance-teal);
    border-left-color: transparent;
  }

  .topbar {
    position: sticky;
    gap: 8px;
    width: 100vw;
    max-width: 100vw;
    padding: 0 16px;
    box-sizing: border-box;
  }

  .pulse {
    display: none;
  }

  .topbar .breadcrumb {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
    min-width: 0;
  }

  .persona-control {
    gap: 0;
    font-size: 0;
  }

  .persona-control select {
    min-width: 72px;
    max-width: 72px;
    padding-right: 18px;
    font-size: 12px;
  }

  .content-shell,
  .page,
  .hero,
  .hero-copy,
  .page-intro,
  .panel,
  .metric-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .content-shell {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .page {
    gap: 18px;
    padding: 22px 16px 88px;
    overflow-x: hidden;
  }

  .hero,
  .metric-grid,
  .metric-grid.six,
  .metric-grid.three,
  .problem-grid,
  .dashboard-grid,
  .pipeline-grid,
  .layer-grid,
  .architecture-flow,
  .standards-grid,
  .benefit-grid,
  .maturity-grid,
  .stress-grid,
  .result-grid,
  .ledger-kpis {
    grid-template-columns: 1fr;
  }

  .proof-grid,
  .stack-legend,
  .provider-bars,
  .assurance-matrix {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
    max-width: 100%;
  }

  .hero p,
  .page-intro p {
    font-size: 16px;
    max-width: 100%;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .hero-actions .button {
    flex: 1 1 100%;
    min-width: 0;
    white-space: normal;
  }

  .panel-head,
  .ledger-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .executive-head .segmented {
    width: 100%;
  }

  .pipeline-track {
    grid-template-columns: 1fr;
  }

  .filter-row select,
  .filter-row .button {
    width: 100%;
  }

  .benefit-waterfall article {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .metric-card {
    min-height: auto;
  }
}
