:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e0e0e0;
  --surface: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #f5f5f7;
  --brand: #0066cc;
  --brand-dark: #0071e3;
  --brand-on-dark: #2997ff;
  --accent: #0066cc;
  --good: #248a3d;
  --good-soft: #eef7f0;
  --warning: #9a6700;
  --warning-soft: #fff8e6;
  --danger: #d70015;
  --danger-soft: #fff0f2;
  --neutral-soft: #f0f0f0;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  min-height: 96px;
  padding: 0;
  background: transparent;
}

.global-nav,
.product-subnav {
  display: grid;
  align-items: center;
  padding-right: max(24px, calc((100vw - 1440px) / 2));
  padding-left: max(24px, calc((100vw - 1440px) / 2));
}

.global-nav {
  grid-template-columns: 1fr auto 1fr;
  min-height: 44px;
  color: #ffffff;
  background: #000000;
}

.product-subnav {
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, 1fr);
  min-height: 52px;
  background: rgba(245, 245, 247, 0.88);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(20px);
}

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

.brand-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: #1d1d1f;
  border: 1px solid #56565b;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.brand-lockup strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.global-context {
  color: #d2d2d7;
  font-size: 0.75rem;
  font-weight: 400;
}

.pilot-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pilot-title strong {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.16rem;
  font-weight: 600;
}

.pilot-title span {
  color: var(--muted);
  font-size: 0.75rem;
}

.header-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  color: #f5f5f7;
  background: #1d1d1f;
  border: 1px solid #424245;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 400;
}

.model-badge i {
  width: 7px;
  height: 7px;
  background: #30d158;
  border-radius: 50%;
  box-shadow: none;
}

button,
input {
  font: inherit;
}

button,
a,
summary,
input {
  outline-color: var(--brand);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.side-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 20px;
  overflow-y: auto;
  background: #fbfcfb;
  border-right: 1px solid var(--line);
}

.brand-block h1,
.story-heading h2,
.section-intro h2,
.panel h3 {
  margin: 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

.brand-block h1 {
  max-width: 12ch;
  margin-top: 5px;
  font-size: 2rem;
  line-height: 1.05;
}

.brand-copy {
  max-width: 31ch;
  margin: 11px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.eyebrow,
.summary-label,
.scene-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.simulation-badge,
.status-badge,
.part-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
}

.simulation-badge,
.status-badge.simulated {
  color: #515154;
  background: #ffffff;
  border-color: #d2d2d7;
}

.product-subnav > .simulation-badge {
  justify-self: end;
}

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

.pilot-context div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pilot-context div:last-child {
  grid-column: 1 / -1;
}

.pilot-context strong {
  font-size: 0.88rem;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-label-row > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.scene-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scene-button {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 5px 8px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.scene-button span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  background: var(--neutral-soft);
  border-radius: 50%;
  font-size: 0.74rem;
  font-weight: 600;
}

.scene-button strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.scene-button:hover,
.scene-button.active {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}

.scene-button.active span {
  color: #ffffff;
  background: var(--brand);
}

.presenter-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 400;
}

.primary-button {
  color: #ffffff;
  background: var(--brand);
  border: 1px solid var(--brand);
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible {
  background: var(--brand-dark);
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.95);
}

.secondary-button {
  color: var(--brand);
  background: #ffffff;
  border: 1px solid var(--brand);
}

.secondary-button:hover:not(:disabled),
.secondary-button:focus-visible {
  background: var(--panel-soft);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.control-button:focus-visible,
.restart-button:focus-visible {
  outline: 2px solid var(--brand-dark);
}

.text-button {
  grid-column: 1 / -1;
  min-height: 34px;
  color: var(--brand);
  background: transparent;
  border: 0;
}

.source-box {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.source-box a {
  padding: 5px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.source-box a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.workspace {
  width: min(100%, 1440px);
  min-width: 0;
  margin: 0 auto;
  padding: 20px 24px 36px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  margin-bottom: 14px;
}

.workspace-header > div:first-child {
  display: grid;
  gap: 4px;
}

.workspace-header > div:first-child strong {
  font-size: 1rem;
}

.work-order-facts {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.work-order-facts span {
  display: grid;
  gap: 2px;
  min-width: 72px;
}

.work-order-facts small,
.trace-fields small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.work-order-facts strong {
  font-size: 0.82rem;
}

.telemetry-ribbon {
  display: grid;
  grid-template-columns: 145px repeat(5, minmax(120px, 1fr)) auto;
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--line);
  border: 0;
  border-radius: 0;
}

.telemetry-state,
.telemetry-signal {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 64px;
  padding: 9px 11px;
  background: #ffffff;
}

.telemetry-state {
  background: #eef5fc;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.live-indicator i {
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  animation: livePulse 1.6s ease-in-out infinite;
}

.telemetry-state small,
.telemetry-signal small,
.telemetry-signal > span {
  color: var(--muted);
  font-size: 0.66rem;
}

.telemetry-signal > span {
  font-weight: 600;
  text-transform: uppercase;
}

.telemetry-signal strong {
  min-width: 8ch;
  overflow: hidden;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-toggle {
  min-width: 62px;
  min-height: 64px;
  padding: 8px;
  color: var(--brand);
  background: #ffffff;
  border: 0;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 600;
}

.telemetry-toggle:hover,
.telemetry-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: var(--panel-soft);
}

.micro-bars {
  display: flex;
  align-items: end;
  gap: 2px;
  width: 76px;
  height: 12px;
}

.micro-bars i {
  width: 4px;
  min-height: 2px;
  background: var(--brand);
  border-radius: 1px 1px 0 0;
  transition: height 300ms ease;
}

.view-tabs {
  display: inline-flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.contextual-controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 10px 12px;
  background: rgba(245, 245, 247, 0.9);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  backdrop-filter: saturate(180%) blur(20px);
}

.control-button,
.restart-button {
  min-height: 44px;
  padding: 8px 14px;
  color: var(--brand);
  background: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 400;
}

.control-button:hover:not(:disabled),
.restart-button:hover {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}

.story-position {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.story-position > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.story-position strong {
  font-size: 0.8rem;
}

.story-position span {
  color: var(--muted);
  font-size: 0.72rem;
}

.story-progress {
  height: 4px;
  overflow: hidden;
  background: #d2d2d7;
  border-radius: 999px;
}

.story-progress i {
  display: block;
  width: 14.28%;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width 180ms ease;
}

.view-tab {
  min-height: 44px;
  padding: 7px 0 5px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 400;
}

.view-tab:hover,
.view-tab.active {
  color: var(--brand);
  background: transparent;
  border-bottom-color: var(--brand);
  box-shadow: none;
}

.view-panel.active {
  display: grid;
  gap: 24px;
}

#liveView.view-panel.active {
  gap: 0;
}

#valueView.view-panel.active,
#exceptionView.view-panel.active {
  padding-top: 24px;
}

.story-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #000000;
  border-radius: 0;
  box-shadow: none;
  isolation: isolate;
}

.story-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.story-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, 0.38);
  z-index: -1;
}

.story-overlay {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 520px;
  padding: 64px;
  color: #ffffff;
}

.story-heading {
  max-width: 860px;
}

.story-heading .scene-kicker {
  color: var(--brand-on-dark);
}

.story-heading h2 {
  max-width: 19ch;
  margin-top: 7px;
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07;
}

.story-heading p:last-child {
  max-width: 72ch;
  margin: 13px 0 0;
  color: #f5f5f7;
  font-size: 1.06rem;
  line-height: 1.47;
}

.scene-focus {
  display: grid;
  gap: 5px;
  min-width: 240px;
  max-width: 310px;
  padding: 8px 0 8px 18px;
  background: rgba(0, 0, 0, 0.36);
  border: 0;
  border-left: 3px solid var(--brand-on-dark);
  border-radius: 0;
}

.scene-focus span {
  color: var(--brand-on-dark);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.scene-focus strong {
  line-height: 1.35;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.status-strip > div {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 13px 15px;
  background: #ffffff;
  border-top: 3px solid #a1a1a6;
}

.status-strip > div[data-tone="good"] {
  border-top-color: var(--good);
}

.status-strip > div[data-tone="warning"] {
  border-top-color: var(--warning);
}

.status-strip > div[data-tone="danger"] {
  border-top-color: var(--danger);
}

.status-strip span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-strip strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

.ai-insight {
  overflow: hidden;
  color: #ffffff;
  background: #272729;
  border: 0;
  border-left: 5px solid var(--brand-on-dark);
  border-radius: 0;
  box-shadow: none;
}

.ai-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #2a2a2c;
  border-bottom: 1px solid #424245;
}

.ai-insight-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-insight-head > div > div {
  display: grid;
  gap: 1px;
}

.ai-insight-head > div > div span {
  color: #cccccc;
  font-size: 0.72rem;
}

.ai-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #ffffff;
  background: var(--brand);
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
}

.ai-model {
  min-height: 26px;
  padding: 4px 8px;
  color: var(--brand-on-dark);
  background: #1d1d1f;
  border: 1px solid #56565b;
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 600;
}

.ai-insight-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.4fr);
  min-width: 0;
}

.ai-main,
.ai-metrics,
.ai-evidence {
  min-width: 0;
  padding: 17px;
}

.ai-main,
.ai-metrics {
  border-right: 1px solid #424245;
}

.ai-metrics {
  border-right: 0;
}

.ai-main h3 {
  max-width: 32ch;
  margin: 5px 0 7px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.ai-main .summary-label {
  color: var(--brand-on-dark);
}

.ai-main p {
  max-width: 72ch;
  margin: 0;
  color: #cccccc;
  font-size: 0.86rem;
  line-height: 1.43;
}

.ai-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.ai-metrics > div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 82px;
  padding: 10px;
  background: #1d1d1f;
  border-radius: 8px;
}

.ai-metrics span {
  color: #cccccc;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ai-metrics strong {
  font-size: 1.25rem;
}

.ai-evidence > span {
  color: var(--brand-on-dark);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ai-evidence ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.ai-evidence li {
  position: relative;
  padding-left: 13px;
  color: #cccccc;
  font-size: 0.79rem;
  line-height: 1.32;
}

.ai-evidence li::before {
  position: absolute;
  top: 0.48em;
  left: 0;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--brand-on-dark);
  border-radius: 50%;
}

.dark-disclosure {
  color: #cccccc;
  border-top: 1px solid #424245;
}

.dark-disclosure summary {
  min-height: 44px;
  padding: 12px 17px;
  color: var(--brand-on-dark);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.dark-disclosure ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 32px 16px;
}

.dark-disclosure li {
  font-size: 0.79rem;
  line-height: 1.4;
}

.ai-governance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 55px;
  padding: 9px 15px;
  color: #cccccc;
  background: #252527;
  border-top: 1px solid #424245;
}

.ai-governance > span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.ai-governance .primary-button {
  flex: 0 0 auto;
}

.story-outcome {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.story-outcome > div {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.story-outcome > div:last-child {
  border-right: 0;
}

.story-outcome p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.44;
}

.value-proof {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: #f5f5f7;
}

.value-proof-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.value-proof-heading h3 {
  margin: 4px 0 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.value-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
}

.value-proof-grid > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 126px;
  padding: 20px;
  background: #ffffff;
}

.value-proof-grid > div + div {
  border-left: 1px solid var(--line);
}

.value-proof-grid span,
.value-proof-grid small {
  color: var(--muted);
}

.value-proof-grid span {
  font-size: 0.69rem;
  font-weight: 600;
  text-transform: uppercase;
}

.value-proof-grid strong {
  align-self: end;
  font-size: 1.3rem;
  line-height: 1.18;
}

.value-proof-grid small {
  font-size: 0.74rem;
  line-height: 1.38;
}

.system-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 16px;
  color: var(--ink);
  background: #f5f5f7;
  border-radius: 0;
}

.flow-node {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  opacity: 0.54;
  transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease;
}

.flow-node.active {
  background: #eef5fc;
  border-color: var(--brand);
  opacity: 1;
}

.flow-node span {
  color: var(--brand);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
}

.flow-node strong {
  align-self: end;
  font-size: 0.83rem;
}

.flow-arrow {
  position: relative;
  min-width: 28px;
  overflow: hidden;
  color: var(--brand);
  font-weight: 600;
}

.flow-arrow::after {
  position: absolute;
  top: 50%;
  left: -6px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--brand);
  border-radius: 50%;
  transform: translateY(-50%);
  animation: dataPacket 1.8s linear infinite;
}

.flow-node.active {
  animation: activeNode 2.4s ease-in-out infinite;
}

.live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 48px 0 24px;
}

.inventory-panel {
  margin-bottom: 24px;
}

.panel,
.assumption-panel,
.value-summary {
  min-width: 0;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

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

.panel-heading h3 {
  margin-top: 3px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.status-badge.neutral,
.part-state.healthy,
.part-state.closed {
  color: #506159;
  background: var(--neutral-soft);
  border-color: #d4ddd8;
}

.status-badge.good,
.part-state.inbound,
.part-state.approved,
.part-state.issued {
  color: #0f5f42;
  background: var(--good-soft);
  border-color: #9edabf;
}

.status-badge.warning,
.part-state.watch {
  color: #704000;
  background: var(--warning-soft);
  border-color: #e9c36e;
}

.status-badge.danger,
.part-state.critical {
  color: #8c1e16;
  background: var(--danger-soft);
  border-color: #eca59f;
}

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

.baseline-grid > div {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.baseline-grid strong {
  font-size: 1.55rem;
}

.baseline-grid span {
  align-self: end;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.evidence-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 12px;
  background: #fafafc;
  border-left: 4px solid var(--brand);
}

.evidence-note span {
  color: var(--muted);
  font-size: 0.84rem;
}

.order-delta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 13px;
}

.order-delta > div {
  display: grid;
  gap: 5px;
  min-height: 105px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.order-delta > div.changed {
  background: var(--warning-soft);
  border-color: #e8c66f;
}

.order-delta span,
.order-delta small {
  color: var(--muted);
}

.order-delta strong {
  font-size: 1.65rem;
}

.delta-arrow {
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 600;
}

.demand-profile {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  align-items: end;
  height: 96px;
  margin-top: 13px;
  padding: 8px 9px 0;
  background: #fafafc;
}

.demand-profile > span {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 5px;
  align-items: end;
  height: 100%;
  text-align: center;
}

.demand-profile i {
  display: block;
  width: 100%;
  height: var(--bar);
  min-height: 8px;
  background: var(--brand);
  border-radius: 3px 3px 0 0;
}

.demand-profile small {
  color: var(--muted);
  font-size: 0.67rem;
}

.risk-clock {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 11px;
}

.risk-time,
.risk-gap {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 112px;
  padding: 13px;
  text-align: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.risk-time.danger {
  background: var(--danger-soft);
  border-color: #eaa49e;
}

.risk-time strong {
  font-size: 1.85rem;
}

.risk-time span,
.risk-time small,
.risk-gap span {
  color: var(--muted);
}

.risk-gap {
  min-width: 120px;
  color: #8c1e16;
  background: #ffffff;
  border-style: dashed;
}

.calculation-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  background: #fafafc;
  border: 1px solid var(--line);
}

.calculation-line span {
  color: var(--muted);
}

.calculation-line strong {
  color: var(--danger);
}

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

.supply-options > div {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
  background: #fafafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.supply-options > div.selected {
  background: #eef5fc;
  border-color: #99c2eb;
  border-left: 4px solid var(--brand);
}

.supply-options span {
  color: var(--brand);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
}

.option-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.option-top b {
  color: var(--ink);
  font-size: 0.72rem;
}

.supply-options small {
  color: var(--muted);
  line-height: 1.35;
}

.material-gate {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.gate-pass {
  display: grid;
  gap: 5px;
  min-height: 110px;
  padding: 11px;
  background: var(--good-soft);
  border: 1px solid #a2d9c1;
  border-radius: 7px;
}

.gate-pass span {
  width: fit-content;
  color: #0f5f42;
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
}

.gate-pass small {
  align-self: end;
  color: #45665a;
}

.assembly-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  gap: 14px;
}

.assembly-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assembly-steps li {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 9px;
  min-height: 50px;
  padding: 8px 10px;
  background: #fafafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.assembly-steps li > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  background: var(--neutral-soft);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 600;
}

.assembly-steps li.complete > span {
  color: #ffffff;
  background: var(--good);
}

.assembly-steps li.failed {
  background: var(--danger-soft);
  border-color: #e5a09a;
}

.assembly-steps li.failed > span {
  color: #ffffff;
  background: var(--danger);
}

.assembly-steps li div {
  display: grid;
  gap: 2px;
}

.assembly-steps small {
  color: var(--muted);
}

.torque-card {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 240px;
  padding: 17px;
  background: var(--danger-soft);
  border: 1px solid #e5a09a;
  border-radius: 7px;
  text-align: center;
}

.torque-card > span {
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.torque-card > strong {
  font-size: 2.15rem;
}

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

.curve-signature {
  display: grid;
  gap: 3px;
  padding: 9px;
  color: #8c1e16;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid #e5a09a;
  border-radius: 6px;
}

.curve-signature span {
  font-size: 0.74rem;
  font-weight: 600;
}

.torque-track {
  position: relative;
  height: 20px;
  background: #dfd9d6;
  border-radius: 999px;
}

.torque-track i {
  position: absolute;
  left: 33%;
  width: 50%;
  height: 100%;
  background: #a7ddc4;
  border-radius: inherit;
}

.torque-track b {
  position: absolute;
  top: -5px;
  bottom: -5px;
  left: 93%;
  width: 4px;
  background: var(--danger);
  border-radius: 3px;
}

.trace-summary {
  display: grid;
  gap: 13px;
}

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

.trace-path > div {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.trace-path > div.failed {
  background: var(--danger-soft);
  border-color: #e5a09a;
}

.trace-path > div.passed {
  background: var(--good-soft);
  border-color: #91d3b7;
}

.trace-path span,
.trace-path small {
  color: var(--muted);
}

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

.trace-fields > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: #fafafc;
  border: 1px solid var(--line);
}

.learning-loop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 11px;
  background: #eef5fc;
  border: 1px solid #b7d5f2;
  border-radius: 7px;
}

.learning-loop > div {
  display: grid;
  gap: 3px;
}

.learning-loop span {
  color: var(--brand);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
}

.learning-loop strong {
  font-size: 0.8rem;
}

.learning-loop i {
  color: var(--brand);
  font-style: normal;
  font-weight: 600;
}

.event-panel {
  max-height: 390px;
  overflow: hidden;
}

.event-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
}

.event-timeline {
  display: grid;
  gap: 0;
  max-height: 300px;
  margin: 0;
  padding: 0 5px 0 0;
  overflow-y: auto;
  list-style: none;
}

.event-item {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0 9px 14px;
  border-left: 2px solid #b8c4be;
}

.event-item::before {
  position: absolute;
  top: 16px;
  left: -5px;
  width: 8px;
  height: 8px;
  content: "";
  background: #84948c;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.event-item.good {
  border-left-color: #8fceb3;
}

.event-item.good::before {
  background: var(--good);
}

.event-item.warning {
  border-left-color: #e0b75f;
}

.event-item.warning::before {
  background: var(--warning);
}

.event-item.danger {
  border-left-color: #e49e98;
}

.event-item.danger::before {
  background: var(--danger);
}

.event-item > div {
  display: grid;
  align-content: start;
  gap: 2px;
}

.event-item time {
  font-size: 0.78rem;
  font-weight: 600;
}

.event-item span {
  color: var(--muted);
  font-size: 0.68rem;
}

.event-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.36;
}

.parts-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(205px, 1.35fr) minmax(135px, 0.9fr) minmax(105px, 0.7fr) minmax(95px, 0.65fr) 92px;
  gap: 12px;
  align-items: center;
  min-width: 790px;
  min-height: 53px;
  padding: 8px 10px;
  background: #fafafc;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  font-size: 0.82rem;
}

.table-head {
  min-height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.part-name,
.level-cell {
  display: grid;
  gap: 3px;
}

.part-name span,
.level-cell span {
  color: var(--muted);
  font-size: 0.72rem;
}

.level-track {
  height: 8px;
  overflow: hidden;
  background: #d2d2d7;
  border-radius: 999px;
}

.level-fill {
  display: block;
  height: 100%;
  background: var(--good);
  border-radius: inherit;
  transition: width 180ms ease;
}

.level-fill.watch {
  background: var(--warning);
}

.level-fill.critical {
  background: var(--danger);
}

.source-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 18px 2px 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.source-footer span {
  font-weight: 600;
  text-transform: uppercase;
}

.source-footer a {
  text-decoration: none;
}

.source-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 2px 8px;
}

.section-intro h2 {
  max-width: 20ch;
  margin-top: 5px;
  font-size: 2.2rem;
  line-height: 1.08;
}

.section-intro > p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.evidence-drawer {
  background: #ffffff;
  border: 1px solid var(--line);
}

.evidence-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 14px 20px;
  cursor: pointer;
}

.evidence-drawer > summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.evidence-drawer > summary strong {
  color: var(--brand);
  font-size: 0.86rem;
}

.evidence-drawer[open] > summary {
  border-bottom: 1px solid var(--line);
}

.evidence-content {
  display: grid;
  gap: 16px;
  padding: 16px;
  background: #f5f5f7;
}

.exception-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.exception-selector button {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.exception-selector button:hover,
.exception-selector button:focus-visible {
  border-color: var(--brand);
}

.exception-selector button.active {
  padding: 11px 13px;
  border: 2px solid var(--brand-dark);
}

.exception-selector span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
}

.exception-selector button.resolved span {
  color: #0f5f42;
}

.exception-selector button.resolved span::after {
  content: " · Controlled";
}

.exception-selector strong {
  font-size: 0.82rem;
  line-height: 1.25;
}

.exception-hero {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  color: #ffffff;
  background: #000000;
  isolation: isolate;
}

.exception-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.exception-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, 0.58);
  z-index: -1;
}

.exception-hero-overlay {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  min-height: 440px;
  padding: 56px;
}

.exception-hero-overlay > div:first-child {
  max-width: 850px;
}

.exception-hero h2 {
  max-width: 20ch;
  margin: 8px 0 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.exception-hero-overlay > div:first-child > p:last-child {
  max-width: 66ch;
  margin: 15px 0 0;
  color: #f5f5f7;
  font-size: 1rem;
}

.incident-signal {
  display: grid;
  gap: 5px;
  min-width: 230px;
  padding: 20px 0 4px 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
}

.incident-signal span,
.incident-signal small {
  color: #cccccc;
}

.incident-signal span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.incident-signal strong {
  font-size: 2rem;
  line-height: 1.05;
}

.incident-signal small {
  font-size: 0.78rem;
}

.exception-ai {
  color: #ffffff;
  background: #272729;
  border-left: 5px solid var(--brand-on-dark);
}

.exception-ai-head,
.exception-governance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 22px;
}

.exception-ai-head {
  border-bottom: 1px solid #424245;
}

.exception-ai-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exception-ai-head > div > div {
  display: grid;
  gap: 2px;
}

.exception-ai-head > div > div span {
  color: #cccccc;
  font-size: 0.74rem;
}

.exception-ai-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.25fr);
}

.exception-ai-body > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 24px;
  border-right: 1px solid #424245;
}

.exception-ai-body > div:last-child {
  border-right: 0;
}

.exception-ai-body h3 {
  margin: 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.2;
}

.exception-ai-body p,
.exception-ai-body li {
  color: #cccccc;
  font-size: 0.82rem;
  line-height: 1.45;
}

.exception-ai-body p {
  margin: 0;
}

.exception-ai-body ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.exception-ai-confidence {
  justify-items: start;
}

.exception-ai-confidence span {
  color: #cccccc;
  font-size: 0.72rem;
}

.exception-ai-confidence strong {
  font-size: 1.65rem;
}

.exception-governance {
  color: #cccccc;
  border-top: 1px solid #424245;
  font-size: 0.8rem;
}

.exception-governance > div {
  display: grid;
  gap: 5px;
}

.exception-governance > div strong {
  color: #ffffff;
}

.exception-governance .primary-button,
.exception-governance .secondary-button {
  flex: 0 0 auto;
}

.response-path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
}

.response-path > div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  min-height: 150px;
  padding: 22px;
  background: #ffffff;
}

.response-path > div + div {
  border-left: 1px solid var(--line);
}

.response-path > div.active {
  padding-top: 19px;
  background: #eef5fc;
  border-top: 3px solid var(--brand);
}

.response-path > div.pending {
  opacity: 0.58;
}

.response-path > div.complete span {
  color: #0f5f42;
}

.response-path span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.response-path strong {
  font-size: 0.94rem;
  line-height: 1.3;
}

.response-path p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.44;
}

.exception-evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.exception-timeline {
  max-height: none;
}

.exception-outcome {
  align-content: start;
  color: #ffffff;
  background: #272729;
}

.exception-outcome .eyebrow,
.exception-outcome > p {
  color: #cccccc;
}

.exception-outcome > p {
  margin: 0;
  line-height: 1.5;
}

.exception-outcome > div:last-child {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #424245;
}

.exception-outcome > div:last-child span {
  color: #cccccc;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.exception-outcome > div:last-child strong {
  font-size: 0.85rem;
  line-height: 1.45;
}

.partnership-case {
  color: #ffffff;
  background: #272729;
}

.partnership-heading {
  padding: 32px;
  border-bottom: 1px solid #424245;
}

.partnership-heading .eyebrow {
  color: #cccccc;
}

.partnership-heading h3 {
  max-width: 22ch;
  margin: 5px 0 0;
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

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

.partnership-grid > div {
  display: grid;
  gap: 8px;
  min-height: 180px;
  padding: 28px 32px;
  border-right: 1px solid #424245;
}

.partnership-grid > div:last-child {
  border-right: 0;
}

.partnership-grid span,
.partnership-grid p,
.partnership-next span {
  color: #cccccc;
}

.partnership-grid span,
.partnership-next span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.partnership-grid strong {
  align-self: end;
  font-size: 1.2rem;
}

.partnership-grid p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.partnership-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  background: #1d1d1f;
  border-top: 1px solid #424245;
}

.partnership-next strong {
  max-width: 54ch;
  text-align: right;
}

.value-summary-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.value-summary-wide > div {
  min-height: 120px;
}

.decision-chain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  color: #ffffff;
  background: #272729;
}

.decision-chain > div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 28px;
}

.decision-chain > div + i + div {
  border-left: 1px solid #424245;
}

.decision-chain > i {
  display: grid;
  align-items: center;
  color: #86868b;
  font-style: normal;
}

.decision-chain span {
  color: #cccccc;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.decision-chain strong {
  font-size: 1.05rem;
  line-height: 1.3;
}

.decision-chain p {
  margin: 0;
  color: #cccccc;
  font-size: 0.82rem;
  line-height: 1.48;
}

.value-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.65fr);
  gap: 16px;
}

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

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.compact-button {
  padding: 9px 16px;
  font-size: 0.82rem;
}

.assumption-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 4px 8px;
  align-items: center;
  min-height: 68px;
  padding: 9px 10px;
  background: #fafafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.assumption-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.assumption-field input {
  width: 100%;
  height: 44px;
  padding: 5px 7px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #becbc4;
  border-radius: 5px;
  font-weight: 600;
}

.assumption-field small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
}

.value-summary {
  display: grid;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--line);
}

.value-summary > div {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 15px 17px;
  background: #ffffff;
}

.value-summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.value-summary strong {
  align-self: end;
  font-size: 1.5rem;
}

.value-summary .payback-result {
  color: #ffffff;
  background: #272729;
}

.value-summary .payback-result span {
  color: #cccccc;
}

.value-summary .evidence-result {
  min-height: 88px;
  background: #f5f5f7;
}

.evidence-result strong {
  font-size: 1.08rem;
}

.evidence-result small {
  color: var(--muted);
  font-size: 0.72rem;
}

.value-bridge {
  display: grid;
  gap: 10px;
}

.bridge-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1.5fr) 120px;
  gap: 13px;
  align-items: center;
  min-height: 48px;
}

.bridge-row > div:first-child {
  display: grid;
  gap: 3px;
}

.bridge-row small {
  color: var(--muted);
}

.bridge-track {
  height: 13px;
  overflow: hidden;
  background: #e0e0e0;
  border-radius: 999px;
}

.bridge-track i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.bridge-row > strong {
  text-align: right;
}

.kpi-table {
  display: grid;
  gap: 5px;
  overflow-x: auto;
}

.kpi-row {
  display: grid;
  grid-template-columns: minmax(185px, 1.1fr) minmax(125px, 0.8fr) minmax(125px, 0.8fr) minmax(125px, 0.8fr) minmax(210px, 1.25fr);
  gap: 10px;
  align-items: center;
  min-width: 850px;
  min-height: 47px;
  padding: 8px 10px;
  background: #fafafc;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.8rem;
}

.kpi-head {
  min-height: 32px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-row:not(.kpi-head) span:first-child,
.kpi-row:not(.kpi-head) span:nth-child(3) {
  font-weight: 600;
}

.view-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.view-handoff > div {
  display: grid;
  gap: 4px;
}

.view-handoff span {
  color: var(--muted);
  font-size: 0.82rem;
}

.view-handoff .primary-button {
  flex: 0 0 auto;
}

.ai-insight.refreshing .ai-main,
.ai-insight.refreshing .ai-metrics,
.ai-insight.refreshing .ai-evidence {
  animation: inferenceRefresh 480ms ease-out;
}

.event-item:first-child {
  animation: eventArrival 520ms ease-out;
}

.telemetry-ribbon.paused .live-indicator {
  color: var(--warning);
}

.telemetry-ribbon.paused .live-indicator i {
  background: var(--warning);
  animation: none;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.72);
  }
}

@keyframes dataPacket {
  0% {
    left: -6px;
    opacity: 0;
  }
  15%, 80% {
    opacity: 1;
  }
  100% {
    left: calc(100% + 2px);
    opacity: 0;
  }
}

@keyframes activeNode {
  0%, 100% {
    opacity: 0.88;
  }
  50% {
    opacity: 1;
  }
}

@keyframes inferenceRefresh {
  0% {
    opacity: 0.42;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes eventArrival {
  0% {
    background: var(--good-soft);
    transform: translateY(-4px);
  }
  100% {
    background: transparent;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .work-order-facts span:nth-child(2) {
    display: none;
  }

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

  .material-gate > div:last-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 1040px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .product-subnav {
    grid-template-columns: 1fr auto;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .product-subnav .view-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .product-subnav > .simulation-badge {
    grid-column: 2;
    grid-row: 1;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.2fr);
    height: auto;
    padding: 20px 24px;
  }

  .brand-block h1 {
    max-width: 20ch;
  }

  .pilot-context {
    align-self: start;
  }

  .scene-navigation,
  .source-box {
    grid-column: 1 / -1;
  }

  .scene-list {
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    overflow-x: auto;
  }

  .scene-button {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 66px;
    text-align: center;
  }

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

  .text-button {
    grid-column: auto;
  }

  .source-box {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    align-items: center;
  }
}

@media (max-width: 900px) {
  .ai-insight-grid {
    grid-template-columns: 1fr;
  }

  .ai-main {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #424245;
  }

  .ai-metrics {
    border-right: 0;
  }

  .workspace-header,
  .section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .work-order-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .work-order-facts span:nth-child(2) {
    display: grid;
  }

  .story-overlay {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
  }

  .story-heading h2 {
    font-size: 2.5rem;
  }

  .scene-focus {
    min-width: 0;
    max-width: 520px;
  }

  .status-strip,
  .story-outcome {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-outcome > div:nth-child(2) {
    border-right: 0;
  }

  .story-outcome > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

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

  .value-proof-grid > div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .value-proof-grid > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .value-proof-grid > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

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

  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .live-grid,
  .value-layout {
    grid-template-columns: 1fr;
  }

  .event-panel {
    max-height: none;
  }

  .event-timeline {
    max-height: 360px;
  }

  .section-intro h2 {
    font-size: 1.9rem;
  }

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

  .exception-hero-overlay {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
  }

  .incident-signal {
    width: 100%;
  }

  .exception-ai-body {
    grid-template-columns: 1fr;
  }

  .exception-ai-body > div:first-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #424245;
  }

  .partnership-grid {
    grid-template-columns: 1fr;
  }

  .partnership-grid > div {
    border-top: 1px solid #424245;
    border-right: 0;
    border-left: 0;
  }

  .partnership-grid > div:first-child {
    border-top: 0;
  }

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

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

  .response-path > div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .response-path > div:nth-child(odd) {
    border-left: 0;
  }

  .response-path > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .response-path > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .response-path > div:last-child {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .exception-evidence-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 680px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .global-nav,
  .product-subnav {
    padding-right: 16px;
    padding-left: 16px;
  }

  .global-nav {
    grid-template-columns: 1fr auto;
  }

  .global-context {
    display: none;
  }

  .header-badges {
    justify-content: flex-end;
  }

  .product-subnav {
    grid-template-columns: 1fr auto;
  }

  .product-subnav .view-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
  }

  .contextual-controls {
    grid-template-columns: 1fr 1fr;
  }

  .telemetry-ribbon {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .telemetry-state,
  .telemetry-signal {
    min-width: 132px;
    flex: 0 0 132px;
    scroll-snap-align: start;
  }

  .telemetry-toggle {
    min-width: 72px;
    flex: 0 0 72px;
  }

  .story-position {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .restart-button {
    grid-column: 1 / -1;
  }

  .ai-insight-grid {
    grid-template-columns: 1fr;
  }

  .ai-main,
  .ai-metrics {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #424245;
  }

  .ai-insight-head,
  .ai-governance {
    align-items: flex-start;
    flex-direction: column;
  }

  .learning-loop {
    grid-template-columns: 1fr;
  }

  .learning-loop i {
    text-align: center;
    transform: rotate(90deg);
  }

  .source-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .side-panel,
  .workspace {
    padding: 16px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .pilot-context,
  .scene-navigation,
  .source-box {
    grid-column: auto;
  }

  .source-box {
    grid-template-columns: 1fr;
  }

  .presenter-controls {
    grid-template-columns: 1fr 1fr;
  }

  .text-button {
    grid-column: 1 / -1;
  }

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

  .view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .view-tab {
    padding: 7px 5px;
    font-size: 0.75rem;
  }

  .story-hero,
  .story-overlay {
    min-height: 470px;
  }

  .story-overlay {
    padding: 48px 24px;
  }

  .story-heading h2 {
    font-size: 2.125rem;
  }

  .status-strip,
  .story-outcome,
  .baseline-grid,
  .supply-options,
  .material-gate,
  .assumption-grid {
    grid-template-columns: 1fr;
  }

  .decision-chain {
    grid-template-columns: 1fr;
  }

  .partnership-next {
    align-items: flex-start;
    flex-direction: column;
  }

  .partnership-next strong {
    max-width: none;
    text-align: left;
  }

  .value-summary-wide {
    grid-template-columns: 1fr;
  }

  .evidence-drawer > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .decision-chain > div {
    padding: 24px;
  }

  .decision-chain > i {
    min-height: 24px;
    justify-items: center;
    transform: rotate(90deg);
  }

  .decision-chain > div + i + div {
    border-left: 0;
  }

  .panel-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .exception-selector {
    display: flex;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .exception-selector button {
    min-width: 180px;
    flex: 0 0 180px;
    scroll-snap-align: start;
  }

  .exception-hero,
  .exception-hero-overlay {
    min-height: 500px;
  }

  .exception-hero-overlay {
    gap: 30px;
    padding: 40px 24px;
  }

  .exception-hero h2 {
    font-size: 34px;
  }

  .incident-signal {
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    border-left: 0;
  }

  .exception-ai-head,
  .exception-governance {
    align-items: flex-start;
    flex-direction: column;
  }

  .exception-ai-body,
  .response-path {
    grid-template-columns: 1fr;
  }

  .exception-ai-body > div,
  .exception-ai-body > div:first-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid #424245;
  }

  .exception-ai-body > div:last-child {
    border-bottom: 0;
  }

  .response-path > div,
  .response-path > div:nth-child(even),
  .response-path > div:last-child {
    grid-column: auto;
    border-left: 0;
  }

  .response-path > div:nth-child(-n + 2) {
    border-top: 1px solid var(--line);
  }

  .response-path > div:first-child {
    border-top: 0;
  }

  .view-handoff {
    align-items: stretch;
    flex-direction: column;
  }

  .view-handoff .primary-button {
    width: 100%;
  }

  .story-outcome > div {
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .story-outcome > div:first-child {
    border-top: 0;
  }

  .story-outcome > div:last-child,
  .material-gate > div:last-child {
    grid-column: auto;
  }

  .value-proof {
    padding: 24px 20px;
  }

  .value-proof-heading {
    flex-direction: column;
  }

  .value-proof-grid {
    grid-template-columns: 1fr;
  }

  .value-proof-grid > div,
  .value-proof-grid > div:nth-child(-n + 2),
  .value-proof-grid > div:nth-child(even) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .value-proof-grid > div:first-child {
    border-top: 0;
  }

  .order-delta,
  .risk-clock {
    grid-template-columns: 1fr;
  }

  .delta-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .risk-gap {
    min-height: 72px;
  }

  .calculation-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .assembly-detail,
  .trace-path,
  .trace-fields {
    grid-template-columns: 1fr;
  }

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

  .bridge-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bridge-row > strong {
    text-align: left;
  }

}

@media (max-width: 419px) {
  .model-badge {
    padding: 4px 7px;
    font-size: 0;
  }

  .model-badge i {
    margin: 0;
  }

  .pilot-title span {
    display: none;
  }

  .story-overlay {
    padding: 32px 20px;
  }

  .story-heading h2 {
    font-size: 28px;
  }

  .exception-hero-overlay {
    padding: 32px 20px;
  }

  .exception-hero h2 {
    font-size: 28px;
  }

  .story-heading p:last-child {
    font-size: 15px;
  }
}
