:root {
  --nerv-font-sans: Inter, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --nerv-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Material Design 3 — Complete Color Role System (Light) */
  --md-sys-color-primary: #146b52;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #a3f2d3;
  --md-sys-color-on-primary-container: #002117;
  --md-sys-color-secondary: #4b6359;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #cde9db;
  --md-sys-color-on-secondary-container: #072017;
  --md-sys-color-tertiary: #3f6375;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #c2e8fd;
  --md-sys-color-on-tertiary-container: #001f2a;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-background: #f5fbf6;
  --md-sys-color-on-background: #171d1a;
  --md-sys-color-surface: #f5fbf6;
  --md-sys-color-surface-dim: #d5dbd7;
  --md-sys-color-surface-bright: #f5fbf6;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #eff5f0;
  --md-sys-color-surface-container: #e9efea;
  --md-sys-color-surface-container-high: #e3eae5;
  --md-sys-color-surface-container-highest: #dde4df;
  --md-sys-color-on-surface: #171d1a;
  --md-sys-color-surface-variant: #dbe5df;
  --md-sys-color-on-surface-variant: #3f4944;
  --md-sys-color-outline: #6f7974;
  --md-sys-color-outline-variant: #bfc9c3;
  --md-sys-color-inverse-surface: #2c322f;
  --md-sys-color-inverse-on-surface: #ecf2ed;
  --md-sys-color-inverse-primary: #88d6b8;
  --md-sys-color-scrim: #000000;

  /* Material Design 3 — Canonical 6-Step Shape Scale */
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 24px;
  --md-sys-shape-corner-full: 9999px;

  /* Material Design 3 — Complete 15-Role Typescale */
  --md-ref-typeface-plain: var(--nerv-font-sans);
  --md-ref-typeface-brand: var(--nerv-font-sans);
  --md-sys-typescale-display-large-font: var(--nerv-font-sans);
  --md-sys-typescale-display-large-size: 57px;
  --md-sys-typescale-display-large-line-height: 64px;
  --md-sys-typescale-display-large-weight: 400;
  --md-sys-typescale-display-medium-font: var(--nerv-font-sans);
  --md-sys-typescale-display-medium-size: 45px;
  --md-sys-typescale-display-medium-line-height: 52px;
  --md-sys-typescale-display-medium-weight: 400;
  --md-sys-typescale-display-small-font: var(--nerv-font-sans);
  --md-sys-typescale-display-small-size: 36px;
  --md-sys-typescale-display-small-line-height: 44px;
  --md-sys-typescale-display-small-weight: 400;
  --md-sys-typescale-headline-large-font: var(--nerv-font-sans);
  --md-sys-typescale-headline-large-size: 32px;
  --md-sys-typescale-headline-large-line-height: 40px;
  --md-sys-typescale-headline-large-weight: 600;
  --md-sys-typescale-headline-medium-font: var(--nerv-font-sans);
  --md-sys-typescale-headline-medium-size: 28px;
  --md-sys-typescale-headline-medium-line-height: 36px;
  --md-sys-typescale-headline-medium-weight: 600;
  --md-sys-typescale-headline-small-font: var(--nerv-font-sans);
  --md-sys-typescale-headline-small-size: 24px;
  --md-sys-typescale-headline-small-line-height: 32px;
  --md-sys-typescale-headline-small-weight: 600;
  --md-sys-typescale-title-large-font: var(--nerv-font-sans);
  --md-sys-typescale-title-large-size: 22px;
  --md-sys-typescale-title-large-line-height: 28px;
  --md-sys-typescale-title-large-weight: 600;
  --md-sys-typescale-title-medium-font: var(--nerv-font-sans);
  --md-sys-typescale-title-medium-size: 16px;
  --md-sys-typescale-title-medium-line-height: 24px;
  --md-sys-typescale-title-medium-weight: 600;
  --md-sys-typescale-title-small-font: var(--nerv-font-sans);
  --md-sys-typescale-title-small-size: 14px;
  --md-sys-typescale-title-small-line-height: 20px;
  --md-sys-typescale-title-small-weight: 600;
  --md-sys-typescale-body-large-font: var(--nerv-font-sans);
  --md-sys-typescale-body-large-size: 16px;
  --md-sys-typescale-body-large-line-height: 24px;
  --md-sys-typescale-body-large-weight: 400;
  --md-sys-typescale-body-medium-font: var(--nerv-font-sans);
  --md-sys-typescale-body-medium-size: 14px;
  --md-sys-typescale-body-medium-line-height: 20px;
  --md-sys-typescale-body-medium-weight: 400;
  --md-sys-typescale-body-small-font: var(--nerv-font-sans);
  --md-sys-typescale-body-small-size: 12px;
  --md-sys-typescale-body-small-line-height: 16px;
  --md-sys-typescale-body-small-weight: 400;
  --md-sys-typescale-label-large-font: var(--nerv-font-sans);
  --md-sys-typescale-label-large-size: 14px;
  --md-sys-typescale-label-large-line-height: 20px;
  --md-sys-typescale-label-large-weight: 600;
  --md-sys-typescale-label-medium-font: var(--nerv-font-sans);
  --md-sys-typescale-label-medium-size: 12px;
  --md-sys-typescale-label-medium-line-height: 16px;
  --md-sys-typescale-label-medium-weight: 600;
  --md-sys-typescale-label-small-font: var(--nerv-font-sans);
  --md-sys-typescale-label-small-size: 11px;
  --md-sys-typescale-label-small-line-height: 16px;
  --md-sys-typescale-label-small-weight: 600;
}

@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-primary: #88d6b8;
    --md-sys-color-on-primary: #003829;
    --md-sys-color-primary-container: #00513d;
    --md-sys-color-on-primary-container: #a3f2d3;
    --md-sys-color-secondary: #b2ccc0;
    --md-sys-color-on-secondary: #1d352c;
    --md-sys-color-secondary-container: #344b42;
    --md-sys-color-on-secondary-container: #cde9db;
    --md-sys-color-tertiary: #a7cce0;
    --md-sys-color-on-tertiary: #0b3445;
    --md-sys-color-tertiary-container: #264b5c;
    --md-sys-color-on-tertiary-container: #c2e8fd;
    --md-sys-color-error: #ffb4ab;
    --md-sys-color-on-error: #690005;
    --md-sys-color-error-container: #93000a;
    --md-sys-color-on-error-container: #ffdad6;
    --md-sys-color-background: #0f1512;
    --md-sys-color-on-background: #dee4df;
    --md-sys-color-surface: #0f1512;
    --md-sys-color-surface-dim: #0f1512;
    --md-sys-color-surface-bright: #343b37;
    --md-sys-color-surface-container-lowest: #090f0d;
    --md-sys-color-surface-container-low: #171d1a;
    --md-sys-color-surface-container: #1b211e;
    --md-sys-color-surface-container-high: #252b28;
    --md-sys-color-surface-container-highest: #303633;
    --md-sys-color-on-surface: #dee4df;
    --md-sys-color-surface-variant: #3f4944;
    --md-sys-color-on-surface-variant: #bfc9c3;
    --md-sys-color-outline: #89938e;
    --md-sys-color-outline-variant: #3f4944;
    --md-sys-color-inverse-surface: #dee4df;
    --md-sys-color-inverse-on-surface: #2c322f;
    --md-sys-color-inverse-primary: #146b52;
    --md-sys-color-scrim: #000000;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: var(--md-sys-typescale-headline-large-size);
  line-height: var(--md-sys-typescale-headline-large-line-height);
  font-weight: var(--md-sys-typescale-headline-large-weight);
  color: var(--md-sys-color-on-surface);
}
h2 {
  font-size: var(--md-sys-typescale-title-large-size);
  line-height: var(--md-sys-typescale-title-large-line-height);
  font-weight: var(--md-sys-typescale-title-large-weight);
  color: var(--md-sys-color-on-surface);
}
h3 {
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  color: var(--md-sys-color-on-surface-variant);
}
code, .eyebrow, .wordmark, .wire, small {
  font-family: var(--nerv-font-mono);
  font-variant-numeric: tabular-nums;
}
code { overflow-wrap: anywhere; }
.eyebrow {
  color: var(--md-sys-color-primary);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-weight: var(--md-sys-typescale-label-small-weight);
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.wordmark {
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-headline-small-size);
  line-height: var(--md-sys-typescale-headline-small-line-height);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.mast, .brand { display: flex; align-items: center; gap: 16px; }
.mast {
  flex-wrap: wrap;
  row-gap: 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  padding: 16px clamp(20px, 5vw, 80px);
}
.mast span, .brand span {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
}

.entry {
  max-width: 1040px;
  margin: clamp(32px, 8vh, 96px) auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.identity {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  min-height: 420px;
  border-radius: var(--md-sys-shape-corner-large) 0 0 var(--md-sys-shape-corner-large);
}
.mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--md-sys-color-on-primary-container) 8%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--md-sys-color-on-primary-container) 8%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
}
.nerv-emblem {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  height: auto;
  display: block;
  overflow: visible;
}
.nerv-emblem .emblem-core { fill: #f0141e; }

#login-form {
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  padding: clamp(28px, 4.5vw, 56px);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0;
}
#login-form > p:not(.eyebrow) {
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-large-size);
  line-height: var(--md-sys-typescale-body-large-line-height);
  margin: 12px 0 24px;
}
#login-form label {
  display: block;
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  margin: 24px 0 8px;
}
input, select {
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
  line-height: 24px;
  padding: 12px 16px;
}
input:hover:not(:disabled), select:hover:not(:disabled) {
  border-color: var(--md-sys-color-on-surface);
}
input:focus-visible, select:focus-visible, summary:focus-visible, a.ext-link:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
select:disabled, input:disabled {
  border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
  color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
}
input { width: 100%; height: 48px; }
#login-form .hint {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  margin: 8px 0 24px;
}
#connect { width: 100%; }
#login-error, #notice {
  color: var(--md-sys-color-error);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
#login-error:not(:empty) { margin-top: 16px; }

:root {
  --nerv-rail-w: 96px;
  --nerv-ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
}
body[nav="open"] {
  --nerv-rail-now: 320px;
}
#scrim {
  position: fixed;
  inset: var(--nerv-top-offset, 0px) 0 0 0;
  z-index: 3;
  background-color: transparent;
  pointer-events: none;
  transition: background-color 180ms cubic-bezier(0.2, 0, 0, 1);
}
body[nav="open"] #scrim {
  background-color: color-mix(in srgb, var(--md-sys-color-scrim) 38%, transparent);
  pointer-events: auto;
}
#workspace {
  display: block;
  min-height: calc(100vh - var(--nerv-top-offset, 0px));
  min-height: calc(100dvh - var(--nerv-top-offset, 0px));
  padding-left: var(--nerv-rail-w);
}
#rail {
  position: fixed;
  top: var(--nerv-top-offset, 0px);
  bottom: 0;
  left: 0;
  z-index: 4;
  width: var(--nerv-rail-now, var(--nerv-rail-w));
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  padding: 12px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: width 250ms var(--nerv-ease-emphasized), transform 250ms var(--nerv-ease-emphasized);
  --md-sys-color-secondary: var(--md-sys-color-primary);
  --md-sys-color-secondary-container: var(--md-sys-color-primary-container);
  --md-sys-color-on-secondary-container: var(--md-sys-color-on-primary-container);
}
.rail-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}
#railMenu {
  flex: none;
  margin-left: 20px;
  --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}
.burger line {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  transform-box: view-box;
  transition: transform 200ms var(--nerv-ease-emphasized);
}
.burger .bt { transform-origin: 12px 6px; }
.burger .bb { transform-origin: 12px 18px; }
.burger .bm { transform-origin: 12px 12px; }
body[nav="open"] .burger .bt.bl { transform: translateY(6px) rotate(45deg); }
body[nav="open"] .burger .bt.br { transform: translateY(6px) rotate(-45deg); }
body[nav="open"] .burger .bb.bl { transform: translateY(-6px) rotate(-45deg); }
body[nav="open"] .burger .bb.br { transform: translateY(-6px) rotate(45deg); }
body[nav="open"] .burger .bm { transform: scaleX(0); }

#rail .brand {
  display: none;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
body[nav="open"] #rail .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#rail .brand .wordmark { color: var(--md-sys-color-primary); }
.rail-head,
.rail-nav-wrap,
#railFoot {
  position: relative;
  z-index: 1;
}
.rail-emblem-watermark {
  position: absolute;
  right: -24px;
  bottom: 68px;
  width: 224px;
  height: 224px;
  color: var(--nerv-red, var(--md-sys-color-primary));
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transform: scale(0.95);
  transition: opacity 220ms ease, transform 250ms var(--nerv-ease-emphasized);
}
body[nav="open"] #rail .rail-emblem-watermark {
  opacity: 0.14;
  transform: scale(1);
}
nav { display: block; min-width: 0; }
.rail-nav-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
#railNav {
  width: 100%;
  height: auto;
  padding: 0;
  background: transparent;
  --md-navigation-rail-collapsed-width: 100%;
  --md-navigation-rail-expanded-min-width: 100%;
  --md-navigation-rail-expanded-max-width: 100%;
  --md-navigation-rail-expanded-padding-inline: 4px;
  --md-navigation-rail-top-space: 2px;
  --md-navigation-rail-bottom-space: 2px;
  --md-navigation-rail-item-space: 4px;
  --md-navigation-rail-expanded-item-space: 6px;
  --md-navigation-rail-item-min-height: 58px;
}
#railBar {
  display: none;
  background: transparent;
}
#railFoot {
  flex: none;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#mobile-settings {
  display: none;
  --md-icon-button-icon-color: var(--nerv-amber, var(--md-sys-color-on-surface-variant));
  --md-icon-button-hover-icon-color: var(--nerv-orange, var(--md-sys-color-primary));
}
#mobile-settings[data-active="true"] {
  --md-icon-button-icon-color: var(--nerv-orange, var(--md-sys-color-primary));
}
.dest {
  background: transparent;
  border: none;
}
.dest[hidden] { display: none !important; }
#railNav .dest[expanded]::part(label),
#railNav .dest[expanded]::part(supporting-text) {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#rail .sub { display: none; }
body[nav="open"] #rail .sub {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: 1.35;
  color: var(--md-sys-color-on-surface-variant);
}
#rail .icwrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
md-list {
  --md-list-container-color: transparent;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
}
svg.fa-icon,
svg[slot="icon"],
svg[slot="leading-icon"],
svg[slot="start"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}
#rail .nav-icon,
md-list-item.dossier-item svg[slot="start"],
md-outlined-text-field svg[slot="leading-icon"],
md-outlined-select svg[slot="leading-icon"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}
md-outlined-text-field {
  --md-outlined-text-field-leading-icon-size: 18px;
  --md-outlined-text-field-trailing-icon-size: 18px;
}
md-outlined-select {
  --md-outlined-select-text-field-leading-icon-size: 18px;
  --md-outlined-select-text-field-trailing-icon-size: 18px;
}
md-icon-button {
  --md-icon-button-icon-size: 18px;
}
md-assist-chip, md-suggestion-chip, md-filter-chip {
  --md-assist-chip-icon-size: 15px;
  --md-suggestion-chip-icon-size: 15px;
  --md-filter-chip-icon-size: 15px;
}
md-assist-chip svg[slot="icon"],
md-suggestion-chip svg[slot="icon"],
md-filter-chip svg[slot="icon"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eyebrow-icon,
.field-label svg.fa-icon,
.inbox-summary-cell span svg.fa-icon,
small svg.fa-icon,
.stepper-pill svg.fa-icon,
.pipeline-step-title svg.fa-icon,
.team-top code svg.fa-icon,
.squad-top code svg.fa-icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
}
md-dialog svg[slot="icon"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  fill: var(--nerv-orange);
}
md-divider {
  --md-divider-color: var(--md-sys-color-outline-variant);
  width: 100%;
  background: transparent;
  border: none;
}
.card-divider { margin: 16px 0 12px; }

/* CI Execution Status & Version-Pinned Doc Reference Panels */
.ci-status-panel,
.doc-refs-panel {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ci-status-panel[data-ci-status="passed"] { border-left: 3px solid var(--nerv-green, var(--md-sys-color-secondary)); }
.ci-status-panel[data-ci-status="running"],
.ci-status-panel[data-ci-status="ambiguous"] { border-left: 3px solid var(--nerv-amber, var(--md-sys-color-tertiary)); }
.ci-status-panel[data-ci-status="failed"] { border-left: 3px solid var(--nerv-red, var(--md-sys-color-error)); }
.doc-refs-panel { border-left: 3px solid var(--nerv-orange, var(--md-sys-color-primary)); }
.ci-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.ci-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}
.ci-panel-title svg.fa-icon { width: 14px; height: 14px; min-width: 14px; min-height: 14px; }
.ci-sha-code {
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.ci-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ci-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.ci-check-main,
.ci-check-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.ci-check-main svg.fa-icon { width: 14px; height: 14px; min-width: 14px; min-height: 14px; }
.ci-check-time {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.doc-ref-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-drift-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: 1px solid var(--md-sys-color-error);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
  font-weight: 600;
}
.doc-drift-alert svg.fa-icon {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  color: var(--md-sys-color-error);
}
.doc-snapshot-reader { margin-top: 2px; }

.desk { padding: 0 clamp(20px, 4vw, 64px) 64px; min-width: 0; }
.toolbar {
  position: relative;
  min-height: 72px;
  padding: 10px 0;
  gap: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.toolbar #page-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  --md-linear-progress-track-height: 3px;
  --md-linear-progress-active-indicator-height: 3px;
}
.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.toolbar select {
  height: 40px;
  padding: 6px 12px;
}
.wire {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.wire::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  margin-right: 8px;
}
.wire.live::before { background: var(--md-sys-color-primary); }

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 32px 0 24px;
  gap: 12px;
}
#notice:not(:empty) {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
#notice[data-error="true"] {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

#nerv-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
  align-items: start;
}
#nerv-view[data-screen="inbox"] {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.inbox-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.inbox-summary-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.inbox-summary-cell span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.inbox-summary-cell span svg.fa-icon { color: var(--md-sys-color-primary); }
.inbox-summary-cell strong {
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  overflow-wrap: anywhere;
}
.inbox-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.inbox-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-top: 0;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.inbox-option-detail { min-width: 0; }
.inbox-option-detail .field:first-child { border-top: none; padding-top: 0; }
.inbox-option-detail .field:last-child { padding-bottom: 0; }
.inbox-option-action { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.inbox-option-action md-filled-button,
.inbox-option-action md-filled-tonal-button,
.inbox-option-action md-outlined-button {
  margin-top: 0;
  max-width: 100%;
  min-width: 0;
  --md-filled-button-leading-space: 16px;
  --md-filled-button-trailing-space: 16px;
  --md-filled-tonal-button-leading-space: 16px;
  --md-filled-tonal-button-trailing-space: 16px;
  --md-outlined-button-leading-space: 16px;
  --md-outlined-button-trailing-space: 16px;
}
@media (max-width: 760px) {
  .inbox-option-row { grid-template-columns: minmax(0, 1fr); }
  .inbox-option-action md-filled-button,
  .inbox-option-action md-filled-tonal-button,
  .inbox-option-action md-outlined-button { width: 100%; }
}
md-filled-button, md-filled-tonal-button, md-outlined-button, md-text-button, md-icon-button {
  max-width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  --md-filled-button-icon-size: 16px;
  --md-filled-tonal-button-icon-size: 16px;
  --md-outlined-button-icon-size: 16px;
  --md-text-button-icon-size: 16px;
  --md-filled-button-leading-space: 20px;
  --md-filled-button-trailing-space: 20px;
  --md-filled-button-with-leading-icon-leading-space: 16px;
  --md-filled-button-with-leading-icon-trailing-space: 20px;
  --md-filled-tonal-button-leading-space: 20px;
  --md-filled-tonal-button-trailing-space: 20px;
  --md-filled-tonal-button-with-leading-icon-leading-space: 16px;
  --md-filled-tonal-button-with-leading-icon-trailing-space: 20px;
  --md-outlined-button-leading-space: 18px;
  --md-outlined-button-trailing-space: 18px;
  --md-outlined-button-with-leading-icon-leading-space: 14px;
  --md-outlined-button-with-leading-icon-trailing-space: 18px;
  --md-outlined-button-with-trailing-icon-leading-space: 18px;
  --md-outlined-button-with-trailing-icon-trailing-space: 14px;
  --md-text-button-leading-space: 12px;
  --md-text-button-trailing-space: 12px;
  --md-text-button-with-leading-icon-leading-space: 12px;
  --md-text-button-with-leading-icon-trailing-space: 14px;
}
md-filled-tonal-button {
  --md-filled-tonal-button-container-color: var(--md-sys-color-surface-container-highest);
  --md-filled-tonal-button-label-text-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-hover-label-text-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-focus-label-text-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-pressed-label-text-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-icon-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-hover-icon-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-focus-icon-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-pressed-icon-color: var(--md-sys-color-on-surface);
  --md-filled-tonal-button-hover-state-layer-color: var(--md-sys-color-primary);
  --md-filled-tonal-button-pressed-state-layer-color: var(--md-sys-color-primary);
}

.ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.flow-panel .ext-links {
  margin: 12px 0 0;
}
md-assist-chip.ext-link, md-suggestion-chip.ext-link {
  border: none;
  background: transparent;
  max-width: 100%;
  min-width: 0;
  --md-assist-chip-container-height: 28px;
  --md-assist-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-assist-chip-outline-color: var(--md-sys-color-outline);
  --md-assist-chip-label-text-font: var(--nerv-font-mono);
  --md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
  --md-assist-chip-label-text-color: var(--nerv-orange);
  --md-assist-chip-hover-label-text-color: var(--nerv-orange);
  --md-assist-chip-focus-label-text-color: var(--nerv-orange);
  --md-assist-chip-icon-color: var(--nerv-orange);
  --md-assist-chip-hover-icon-color: var(--nerv-orange);
  --md-assist-chip-focus-icon-color: var(--nerv-orange);
  --md-assist-chip-icon-size: 14px;
  --md-assist-chip-leading-space: 8px;
  --md-assist-chip-trailing-space: 10px;
  --md-suggestion-chip-container-height: 28px;
  --md-suggestion-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-suggestion-chip-outline-color: var(--md-sys-color-outline-variant);
  --md-suggestion-chip-label-text-font: var(--nerv-font-mono);
  --md-suggestion-chip-label-text-size: var(--md-sys-typescale-label-small-size);
}
md-assist-chip.ext-link svg[slot="icon"] {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
md-assist-chip.ext-link[data-provider="jira"],
md-assist-chip.ext-link[data-provider="linear"] {
  --md-assist-chip-label-text-color: var(--nerv-amber);
  --md-assist-chip-hover-label-text-color: var(--nerv-amber);
  --md-assist-chip-focus-label-text-color: var(--nerv-amber);
  --md-assist-chip-icon-color: var(--nerv-amber);
  --md-assist-chip-hover-icon-color: var(--nerv-amber);
  --md-assist-chip-focus-icon-color: var(--nerv-amber);
}
md-assist-chip.ext-link[data-provider="sentry"],
md-assist-chip.ext-link[data-provider="alertmanager"] {
  --md-assist-chip-label-text-color: var(--nerv-red);
  --md-assist-chip-hover-label-text-color: var(--nerv-red);
  --md-assist-chip-focus-label-text-color: var(--nerv-red);
  --md-assist-chip-icon-color: var(--nerv-red);
  --md-assist-chip-hover-icon-color: var(--nerv-red);
  --md-assist-chip-focus-icon-color: var(--nerv-red);
}
md-assist-chip.ext-link[data-provider="argocd"],
md-assist-chip.ext-link[data-provider="prometheus"] {
  --md-assist-chip-label-text-color: var(--nerv-green);
  --md-assist-chip-hover-label-text-color: var(--nerv-green);
  --md-assist-chip-focus-label-text-color: var(--nerv-green);
  --md-assist-chip-icon-color: var(--nerv-green);
  --md-assist-chip-hover-icon-color: var(--nerv-green);
  --md-assist-chip-focus-icon-color: var(--nerv-green);
}
md-outlined-card {
  display: block;
  position: relative;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface);
  padding: 24px;
  overflow-wrap: anywhere;
  --md-outlined-card-container-color: var(--md-sys-color-surface-container-low);
  --md-outlined-card-outline-color: var(--md-sys-color-outline-variant);
  --md-outlined-card-outline-width: 1px;
  --md-outlined-card-container-shape: var(--md-sys-shape-corner-medium);
}
.empty {
  position: relative;
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  border: 1px dashed var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 48px 28px;
  overflow-wrap: anywhere;
}
md-outlined-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
md-outlined-card header .delete-seat-btn {
  --md-text-button-label-text-color: var(--md-sys-color-error);
  --md-text-button-icon-color: var(--md-sys-color-error);
  --md-text-button-container-height: 28px;
  --md-text-button-leading-space: 8px;
  --md-text-button-trailing-space: 8px;
  flex: 0 0 auto;
}
md-outlined-card header code, .subcard header code {
  min-width: 0;
  flex: 1 1 auto;
}
md-outlined-card code {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow-wrap: normal;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  padding: 4px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
}
md-outlined-card h2.card-link-title,
md-outlined-card header code.card-link-code {
  cursor: pointer;
  transition: color 150ms ease;
}
md-outlined-card h2.card-link-title:hover,
md-outlined-card header code.card-link-code:hover {
  color: var(--nerv-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}
md-outlined-card h2.card-link-title:focus-visible,
md-outlined-card header code.card-link-code:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
md-outlined-card header code.card-link-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
small[data-tone="active"] {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
small[data-tone="done"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
small[data-tone="warn"] {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
small[data-tone="error"] {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
small[data-tone="neutral"] {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
md-outlined-card h2 { margin-bottom: 16px; }
.field {
  display: grid;
  grid-template-columns: minmax(84px, 30%) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
.field span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--md-sys-color-on-surface-variant);
}
.field span svg.fa-icon { color: var(--md-sys-color-primary); }
.field strong {
  font-weight: 500;
  white-space: pre-wrap;
  font-variant-numeric: tabular-nums;
}
md-outlined-card section, md-outlined-card footer, .dossier-panel, .doc-reader { margin-top: 16px; }
md-outlined-card > .card-divider + footer { margin-top: 0; }
md-outlined-card footer { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
md-outlined-card md-outlined-button, md-outlined-card md-filled-button, md-outlined-card md-filled-tonal-button, md-outlined-card md-text-button { margin-top: 8px; }
md-outlined-card footer md-outlined-button, md-outlined-card footer md-filled-button, md-outlined-card footer md-filled-tonal-button, md-outlined-card footer md-text-button { margin-top: 0; }

blockquote {
  white-space: pre-wrap;
  margin: 10px 0;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  padding: 12px 16px;
  border-left: 4px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
}
#nerv-view pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}
.empty {
  padding: 48px 28px;
  border-style: dashed;
  background: var(--md-sys-color-surface-container-lowest);
}
.empty h2 {
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
}

/* Hill Chart SVG & Linear Progress */
.hill-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 16px;
  padding: 8px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
}
.fleet-hill { margin: 0; padding: 12px; }
.hill-curve { fill: none; stroke: var(--md-sys-color-outline); stroke-width: 2; }
.hill-crest { stroke: var(--md-sys-color-outline-variant); stroke-dasharray: 3 3; stroke-width: 1; }
.hill-label {
  fill: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-label-small-size);
  font-family: var(--nerv-font-sans);
}
.hill-pin { fill: var(--md-sys-color-primary); stroke: var(--md-sys-color-on-primary); stroke-width: 2; }
.hill-pin[data-alert="true"] { fill: var(--md-sys-color-error); stroke: var(--md-sys-color-on-error); }
.hill-pin-label {
  fill: var(--md-sys-color-on-surface);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  font-weight: var(--md-sys-typescale-label-small-weight);
}
.hill-pin-label.alert { fill: var(--md-sys-color-error); }
.hill-pin-group.clickable, .flow-node.clickable { cursor: pointer; }
.hill-pin-group.clickable:focus-visible, .flow-node.clickable:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.meter-wrap { margin: 8px 0 12px; }

/* Directed Flow Graphs, Squad × Team Matrix, & Kanban Boards (Material Design 3) */
.flow-panel, .kanban-board, .squad-matrix {
  grid-column: 1 / -1;
  min-width: 0;
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 20px 24px;
}
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.panel-head h3 {
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  color: var(--md-sys-color-on-surface);
}
.panel-sub {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.flow-scroll {
  overflow-x: auto;
  max-width: 100%;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 8px;
}
/* 그린 크기(1:1)를 상한으로 두고 좁을 때만 줄입니다. 넓은 데스크톱에서 노드/글자가 확대되지 않게 합니다. */
.flow-svg { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.flow-stage-rule {
  stroke: var(--md-sys-color-outline-variant);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.flow-col-header {
  fill: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-medium-size);
  font-weight: var(--md-sys-typescale-label-medium-weight);
}
.flow-edge { fill: none; stroke: var(--md-sys-color-outline); stroke-width: 1.75; }
.flow-edge.active { stroke: var(--md-sys-color-primary); stroke-width: 2.25; }
.flow-edge.warn { stroke: var(--md-sys-color-tertiary); stroke-width: 2; }
.flow-edge.dashed { stroke: var(--md-sys-color-tertiary); stroke-dasharray: 5 4; stroke-width: 1.75; }
.flow-arrow { fill: var(--md-sys-color-outline); }
.flow-arrow.active { fill: var(--md-sys-color-primary); }
.flow-arrow.warn, .flow-arrow.dashed { fill: var(--md-sys-color-tertiary); }
.flow-edge-label {
  fill: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-small-size);
}
.flow-node-box {
  fill: var(--md-sys-color-surface-container-lowest);
  stroke: var(--md-sys-color-outline-variant);
  stroke-width: 1.25;
}
.flow-node.clickable:hover .flow-node-box {
  fill: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container-lowest));
  stroke: var(--md-sys-color-primary);
}
.flow-node[data-tone="active"] .flow-node-box { stroke: var(--md-sys-color-primary); }
.flow-node[data-tone="warn"] .flow-node-box { stroke: var(--md-sys-color-tertiary); }
.flow-node[data-tone="error"] .flow-node-box { stroke: var(--md-sys-color-error); }
.flow-node-pill { fill: var(--md-sys-color-surface-container-high); }
.flow-node-badge {
  fill: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-small-size);
  font-weight: var(--md-sys-typescale-label-small-weight);
}
.flow-node[data-tone="active"] .flow-node-pill { fill: var(--md-sys-color-primary-container); }
.flow-node[data-tone="active"] .flow-node-badge { fill: var(--md-sys-color-on-primary-container); }
.flow-node[data-tone="done"] .flow-node-pill { fill: var(--md-sys-color-secondary-container); }
.flow-node[data-tone="done"] .flow-node-badge { fill: var(--md-sys-color-on-secondary-container); }
.flow-node[data-tone="warn"] .flow-node-pill { fill: var(--md-sys-color-tertiary-container); }
.flow-node[data-tone="warn"] .flow-node-badge { fill: var(--md-sys-color-on-tertiary-container); }
.flow-node[data-tone="error"] .flow-node-pill { fill: var(--md-sys-color-error-container); }
.flow-node[data-tone="error"] .flow-node-badge { fill: var(--md-sys-color-on-error-container); }
.flow-node-code {
  fill: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
}
.flow-node-title {
  fill: var(--md-sys-color-on-surface);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-large-size);
  font-weight: var(--md-sys-typescale-label-large-weight);
}
.flow-node-meta {
  fill: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
}

.lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  max-width: 100%;
}
.lane {
  min-width: 0;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.lane-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  color: var(--md-sys-color-on-surface);
}
.lane-title svg.fa-icon { width: 15px; height: 15px; color: var(--md-sys-color-primary); }
.lane[data-tone="warn"] .lane-title svg.fa-icon { color: var(--md-sys-color-tertiary); }
.lane[data-tone="done"] .lane-title svg.fa-icon { color: var(--md-sys-color-secondary); }
.lane[data-tone="error"] .lane-title svg.fa-icon { color: var(--md-sys-color-error); }
.lane[data-tone="neutral"] .lane-title svg.fa-icon { color: var(--md-sys-color-on-surface-variant); }
.lane-count {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 2px 10px;
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  font-variant-numeric: tabular-nums;
}
.lane[data-tone="active"] .lane-count {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.lane[data-tone="warn"] .lane-count {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.lane[data-tone="done"] .lane-count {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.lane[data-tone="error"] .lane-count {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
.lane-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lane-empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
}
md-outlined-card.kcard {
  padding: 16px;
  --md-outlined-card-container-color: var(--md-sys-color-surface-container-lowest);
}
md-filled-card.subcard {
  display: block;
  position: relative;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface);
  padding: 16px;
  overflow-wrap: anywhere;
  --md-filled-card-container-color: var(--md-sys-color-surface-container-lowest);
  --md-filled-card-container-shape: var(--md-sys-shape-corner-medium);
  --md-filled-card-container-elevation: 0;
}
md-outlined-card.kcard h2 {
  font-size: var(--md-sys-typescale-title-medium-size);
  line-height: var(--md-sys-typescale-title-medium-line-height);
  font-weight: var(--md-sys-typescale-title-medium-weight);
  margin-bottom: 12px;
}
.subcard header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.subcard code {
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.subcard h3 {
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

/* Squad (Case Rail) × Team (Seat / Delegate) 2D Matrix */
.matrix-scroll {
  overflow-x: auto;
  max-width: 100%;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.matrix-table th, .matrix-table td {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  padding: 12px 14px;
  vertical-align: top;
  text-align: left;
}
.matrix-table th:last-child, .matrix-table td:last-child { border-right: none; }
.matrix-table tbody tr:last-child th, .matrix-table tbody tr:last-child td { border-bottom: none; }
.matrix-corner, .team-col {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  min-width: 176px;
}
.matrix-corner {
  min-width: 224px;
  vertical-align: middle;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.team-top, .squad-top, .mcell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.team-top code, .squad-top code {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface);
  font-weight: var(--md-sys-typescale-label-medium-weight);
}
.team-meta, .team-load, .squad-gates, .mcell-note, .mcell-del {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-on-surface-variant);
  font-variant-numeric: tabular-nums;
}
.team-meta { margin-top: 6px; }
.team-load { margin-top: 4px; color: var(--md-sys-color-primary); }
.squad-row-head {
  background: var(--md-sys-color-surface-container-low);
  min-width: 224px;
  max-width: 280px;
}
.squad-link, .mcell-task {
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-small);
}
.squad-link { padding: 4px; margin: -4px; }
.squad-link:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
.squad-link:focus-visible, .mcell-task:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.squad-goal {
  margin-top: 6px;
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  color: var(--md-sys-color-on-surface);
}
.squad-gates { margin-top: 6px; }
.matrix-cell {
  background: var(--md-sys-color-surface-container-lowest);
  min-width: 176px;
}
.cell-idle {
  display: block;
  text-align: center;
  padding: 14px 0;
  color: var(--md-sys-color-outline-variant);
  font-family: var(--nerv-font-mono);
}
.mcell-task {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mcell-task + .mcell-task { margin-top: 8px; }
.mcell-task:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container));
}
.mcell-task[data-tone="active"] { border-color: var(--md-sys-color-primary); }
.mcell-task[data-tone="warn"] { border-color: var(--md-sys-color-tertiary); }
.mcell-task[data-tone="error"] { border-color: var(--md-sys-color-error); }
.mcell-id {
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-on-surface);
}

/* Chips, Dossier M3 List, and Hub Document Reader */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lineage-chip {
  border: none;
  background: transparent;
  max-width: 100%;
  min-width: 0;
  --md-assist-chip-container-height: 28px;
  --md-assist-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-assist-chip-outline-color: var(--md-sys-color-outline);
  --md-assist-chip-label-text-font: var(--nerv-font-mono);
  --md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
  --md-assist-chip-label-text-color: var(--md-sys-color-on-surface-variant);
  --md-assist-chip-hover-label-text-color: var(--md-sys-color-on-surface);
  --md-assist-chip-focus-label-text-color: var(--md-sys-color-on-surface);
  --md-assist-chip-icon-size: 14px;
}
.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.hub-filter-chip {
  border: none;
  background: transparent;
  max-width: 100%;
  min-width: 0;
  --md-filter-chip-container-height: 32px;
  --md-filter-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-filter-chip-outline-color: var(--md-sys-color-outline);
  --md-filter-chip-label-text-color: var(--md-sys-color-on-surface-variant);
  --md-filter-chip-icon-size: 14px;
  --md-filter-chip-selected-container-color: var(--md-sys-color-primary-container);
  --md-filter-chip-selected-label-text-color: var(--md-sys-color-on-primary-container);
  --md-filter-chip-selected-hover-label-text-color: var(--md-sys-color-on-primary-container);
  --md-filter-chip-selected-focus-label-text-color: var(--md-sys-color-on-primary-container);
  --md-filter-chip-selected-leading-icon-color: var(--md-sys-color-on-primary-container);
}
.dossier-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
md-list-item.dossier-item {
  border: none;
  background: transparent;
  min-width: 0;
  --md-list-item-container-color: var(--md-sys-color-surface-container);
  --md-list-item-top-space: 10px;
  --md-list-item-bottom-space: 10px;
  --md-list-item-leading-space: 12px;
  --md-list-item-trailing-space: 12px;
  --md-list-item-leading-icon-size: 18px;
  --md-list-item-leading-icon-color: var(--md-sys-color-primary);
  --md-list-item-label-text-color: var(--md-sys-color-on-surface);
  --md-list-item-supporting-text-color: var(--md-sys-color-on-surface-variant);
  --md-list-item-supporting-text-font: var(--nerv-font-mono);
}
md-list-item.dossier-item [slot="headline"],
md-list-item.dossier-item [slot="supporting-text"] {
  white-space: normal;
  overflow-wrap: anywhere;
}
md-list-item.dossier-item .prune-btn {
  margin-top: 0;
  flex: none;
}
.doc-reader {
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-small);
}
.doc-reader summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  color: var(--md-sys-color-primary);
}
.doc-reader summary::-webkit-details-marker { display: none; }

/* Pre-Decision Assignee Inquiry Thread & Composer */
.inquiry-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.inquiry-head { margin-bottom: 10px; }
.inquiry-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--md-sys-color-on-surface);
}
.inquiry-head h3 svg.fa-icon { color: var(--md-sys-color-primary); }
.inquiry-collapse { margin-bottom: 12px; }
.inquiry-collapse summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  color: var(--md-sys-color-tertiary);
  margin-bottom: 8px;
}
.inquiry-collapse summary::-webkit-details-marker { display: none; }
.inquiry-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.inquiry-turn {
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.inquiry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.inquiry-q {
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: var(--md-sys-typescale-label-large-line-height);
  font-weight: var(--md-sys-typescale-label-large-weight);
  color: var(--md-sys-color-primary);
}
.inquiry-err {
  margin-top: 6px;
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-error);
}
.inquiry-a {
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: var(--md-sys-typescale-body-medium-line-height);
  color: var(--md-sys-color-on-surface);
}
.inquiry-caution {
  margin-top: 6px;
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-tertiary);
}
.inquiry-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.preset-chip {
  border: none;
  background: transparent;
  max-width: 100%;
  min-width: 0;
  --md-suggestion-chip-container-height: 32px;
  --md-suggestion-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-suggestion-chip-outline-color: var(--md-sys-color-outline);
  --md-suggestion-chip-label-text-color: var(--md-sys-color-on-surface-variant);
  --md-suggestion-chip-hover-label-text-color: var(--md-sys-color-on-surface);
  --md-suggestion-chip-focus-label-text-color: var(--md-sys-color-on-surface);
  --md-suggestion-chip-label-text-size: var(--md-sys-typescale-label-medium-size);
  --md-suggestion-chip-icon-size: 14px;
}
.reissue-token {
  margin-top: 8px;
  --md-outlined-button-container-height: 34px;
  --md-outlined-button-leading-space: 14px;
  --md-outlined-button-trailing-space: 14px;
  --md-outlined-button-label-text-size: var(--md-sys-typescale-label-medium-size);
}
.inquiry-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.inquiry-seat,
.inquiry-session,
.inquiry-session-input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 100%;
  --md-outlined-select-text-field-container-shape: var(--md-sys-shape-corner-small);
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small);
}
md-outlined-text-field[hidden],
md-outlined-select[hidden] {
  display: none !important;
}
.inquiry-input {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small);
  --md-outlined-text-field-input-text-size: 15px;
  --md-outlined-text-field-input-text-line-height: 1.55;
}
md-outlined-text-field.agent-prompt-textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 12px;
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small, 8px);
  --md-outlined-text-field-input-text-size: 15px;
  --md-outlined-text-field-input-text-line-height: 1.55;
  --md-outlined-text-field-top-space: 14px;
  --md-outlined-text-field-bottom-space: 14px;
}
.form-grid md-outlined-text-field.agent-prompt-textarea,
.inquiry-form md-outlined-text-field.agent-prompt-textarea {
  margin-top: 0;
}
md-outlined-card .inquiry-send {
  margin-top: 0;
  margin-left: auto;
  --md-filled-tonal-button-container-height: 44px;
}
.inquiry-speaker {
  font-size: var(--md-sys-typescale-label-medium-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 4px;
}
.inquiry-box .inquiry-thread,
#case-steering-thread {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.md-prose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--md-sys-typescale-body-medium-size);
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
  overflow-wrap: anywhere;
}
.md-prose .md-p,
.md-prose .md-heading,
.md-prose .md-quote {
  margin: 0;
}
.md-prose .md-heading {
  font-size: var(--md-sys-typescale-title-small-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin-top: 4px;
}
.md-prose .md-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.md-prose .md-inline-code {
  font-family: var(--nerv-font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}
#nerv-view .md-prose pre.md-code-block {
  margin: 4px 0;
  padding: 10px 14px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-small);
  overflow-x: auto;
}
.md-prose .md-hr {
  border: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 4px 0;
}
.md-prose a.md-link {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
}
.md-prose .md-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 4px 0;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface-container-lowest);
}
.md-prose table.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: 1.55;
  white-space: normal;
}
.md-prose table.md-table th,
.md-prose table.md-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  overflow-wrap: anywhere;
}
.md-prose table.md-table th + th,
.md-prose table.md-table td + td {
  border-left: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 65%, transparent);
}
.md-prose table.md-table th {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
}
.md-prose table.md-table tbody tr:last-child td {
  border-bottom: none;
}
.md-prose table.md-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 45%, transparent);
}
.md-prose table.md-table [data-align="center"] {
  text-align: center;
}
.md-prose table.md-table [data-align="right"] {
  text-align: right;
}
#confirm {
  max-width: min(560px, calc(100vw - 32px));
  --md-dialog-container-color: var(--md-sys-color-surface-container-high);
  --md-dialog-headline-color: var(--md-sys-color-on-surface);
  --md-dialog-supporting-text-color: var(--md-sys-color-on-surface-variant);
}
#confirm-body { white-space: pre-wrap; }

@media (max-width: 760px) {
  #workspace {
    display: block;
    padding-left: 0;
  }
  .desk {
    padding: 0 12px calc(92px + env(safe-area-inset-bottom));
  }
  #scrim { display: none; }
  #rail {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 6;
    width: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 0;
    overflow: visible;
    border-right: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container);
    padding: 4px calc(2px + env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) calc(2px + env(safe-area-inset-left));
  }
  .rail-head,
  .rail-nav-wrap,
  .rail-emblem-watermark {
    display: none;
  }
  #railBar {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
  }
  #railBar md-navigation-tab {
    min-width: 0;
  }
  #railBar md-navigation-tab::part(indicator) {
    width: min(52px, calc(100% - 4px));
    max-width: 100%;
  }
  #railBar md-navigation-tab::part(label) {
    font-size: 10px;
    line-height: 12px;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #railFoot {
    flex: none;
    margin-top: 0;
    padding-top: 0;
    padding-left: 2px;
    border-top: 0;
    border-left: 1px solid var(--md-sys-color-outline-variant);
    flex-direction: row;
  }
  #railFoot #open-settings {
    display: none !important;
  }
  #mobile-settings {
    display: inline-flex;
  }
  #logout {
    width: 35px;
    margin: 0;
    --md-navigation-rail-item-indicator-width: 32px;
    --md-navigation-rail-item-min-height: 52px;
  }
  #rail .sub { display: none !important; }
  .toolbar {
    min-height: 0;
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 10px;
  }
  .toolbar-controls {
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .toolbar-controls md-outlined-select {
    flex: 1 1 0;
    min-width: 0;
    --md-outlined-select-text-field-leading-icon-size: 16px;
  }
  .mast {
    padding: 14px 16px;
    gap: 10px;
  }
  .mast .lang-select { min-width: 132px; --md-outlined-select-text-field-leading-icon-size: 16px; }
  .entry { grid-template-columns: minmax(0, 1fr); margin-top: 24px; padding: 0 16px; }
  .identity {
    min-height: 196px;
    padding: 20px;
    border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
  }
  .nerv-emblem { width: min(72%, 200px); }
  #login-form {
    border-radius: 0 0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large);
  }
  .page-heading { margin: 18px 0 16px; }
  md-outlined-card { padding: 14px; }
  md-outlined-card.kcard { padding: 14px; }
  .flow-panel, .kanban-board, .squad-matrix { padding: 14px 12px; }
  .flow-scroll { overflow-x: hidden; padding: 6px 4px; }
  .inbox-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px;
    gap: 10px;
  }
  .inbox-summary-grid .inbox-summary-cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .field {
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr);
    gap: 8px;
  }
  .inquiry-form { flex-direction: column; }
  .inquiry-seat,
  .inquiry-session,
  .inquiry-session-input,
  .inquiry-input,
  md-outlined-card .inquiry-send {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  md-outlined-card .inquiry-send {
    --md-filled-tonal-button-container-height: 44px;
  }
  .lanes {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .lanes::-webkit-scrollbar { display: none; }
  .lane {
    padding: 12px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .kanban-board[data-carousel-mode="stack"] .lanes {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .pipeline-track {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
    gap: 8px;
  }
  .pipeline-step {
    padding: 10px 12px;
  }
  .pipeline-step[data-empty="true"] {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-head {
    order: 2;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-title {
    order: 1;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-desc,
  .pipeline-step[data-empty="true"] .pipeline-items {
    display: none;
  }
  .squad-matrix .matrix-scroll {
    display: none;
  }
  .squad-matrix .matrix-mobile {
    display: block;
  }
}

/* ==========================================================================
   NERV 관제실 테마 레이어
   위의 Material 3 토큰과 레이아웃을 그대로 두고, 뒤에서 토큰을 재정의해 검정/주황/경고색 팔레트와
   해저드 줄무늬/육각 그리드/명조 헤드라인을 입힙니다. 원작 로고 등 상표 요소는 쓰지 않습니다.
   외부 글꼴은 CSP(default-src 'self') 때문에 쓰지 않고 시스템 글꼴만 사용합니다.
   ========================================================================== */
:root {
  color-scheme: dark;
  --nerv-black: #07090b;
  --nerv-orange: #ff7a1a;
  --nerv-red: #ff3b3b;
  --nerv-green: #5ee08c;
  --nerv-amber: #ffc240;
  --nerv-font-display: "Hiragino Mincho ProN", "Yu Mincho", "AppleMyungjo", "Noto Serif CJK KR", "Noto Serif KR", "Batang", "Times New Roman", serif;
  --nerv-hazard: repeating-linear-gradient(-45deg, var(--nerv-orange) 0 10px, var(--nerv-black) 10px 20px);
  --nerv-hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 16L-28 0M56 16L84 0' fill='none' stroke='%23ff7a1a' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E");

  --md-sys-color-primary: #ff7a1a;
  --md-sys-color-on-primary: #1a0a00;
  --md-sys-color-primary-container: #4a2000;
  --md-sys-color-on-primary-container: #ffdcc4;
  --md-sys-color-secondary: #5ee08c;
  --md-sys-color-on-secondary: #00210d;
  --md-sys-color-secondary-container: #12371f;
  --md-sys-color-on-secondary-container: #b6f5c8;
  --md-sys-color-tertiary: #ffc240;
  --md-sys-color-on-tertiary: #241a00;
  --md-sys-color-tertiary-container: #4d3a00;
  --md-sys-color-on-tertiary-container: #ffe6a8;
  --md-sys-color-error: #ff3b3b;
  --md-sys-color-on-error: #2a0000;
  --md-sys-color-error-container: #5c0a0a;
  --md-sys-color-on-error-container: #ffd9d6;
  --md-sys-color-background: #07090b;
  --md-sys-color-on-background: #f0ece4;
  --md-sys-color-surface: #07090b;
  --md-sys-color-surface-dim: #07090b;
  --md-sys-color-surface-bright: #262d32;
  --md-sys-color-surface-container-lowest: #040506;
  --md-sys-color-surface-container-low: #0d1114;
  --md-sys-color-surface-container: #11161a;
  --md-sys-color-surface-container-high: #172025;
  --md-sys-color-surface-container-highest: #1e282e;
  --md-sys-color-on-surface: #f0ece4;
  --md-sys-color-surface-variant: #1e282e;
  --md-sys-color-on-surface-variant: #aeaaa1;
  --md-sys-color-outline: #6f6a62;
  --md-sys-color-outline-variant: #2b3439;
  --md-sys-color-inverse-surface: #f0ece4;
  --md-sys-color-inverse-on-surface: #11161a;
  --md-sys-color-inverse-primary: #9c4300;

  /* 각진 관제실 패널. Material 3 표준 단계 중 none(0px)과 extra-small(4px)만 사용합니다. */
  --md-sys-shape-corner-extra-small: 0px;
  --md-sys-shape-corner-small: 0px;
  --md-sys-shape-corner-medium: 0px;
  --md-sys-shape-corner-large: 0px;
  --md-sys-shape-corner-extra-large: 4px;
  --md-filled-button-container-shape: 0px;
  --md-filled-tonal-button-container-shape: 0px;
  --md-outlined-button-container-shape: 0px;
  --md-text-button-container-shape: 0px;
  --md-dialog-container-shape: 4px;
  --md-snackbar-action-shape: 0px;
  --md-snackbar-close-shape: 0px;
  --md-focus-ring-color: var(--md-sys-color-primary);
  --md-focus-ring-shape: 0px;
}
::selection { background: var(--nerv-orange); color: var(--nerv-black); }
body {
  background: var(--nerv-black) var(--nerv-hex);
  background-attachment: fixed;
  animation: nerv-hex-drift 28s linear infinite;
}
@keyframes nerv-hex-drift {
  from { background-position: 0 0; }
  to { background-position: 56px 97px; }
}
@keyframes nerv-hazard-scroll {
  from { background-position: 0 0; }
  to { background-position: 28.28px 0; }
}
@keyframes nerv-hud-scanline {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 0.55; }
  88% { opacity: 0.55; }
  100% { transform: translateY(96vh); opacity: 0; }
}
#workspace { position: relative; }
#workspace::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--nerv-orange) 42%, transparent) 35%, color-mix(in srgb, var(--nerv-amber) 70%, transparent) 50%, color-mix(in srgb, var(--nerv-orange) 42%, transparent) 65%, transparent 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--nerv-orange) 35%, transparent);
  pointer-events: none;
  z-index: 2;
  animation: nerv-hud-scanline 8.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.seat-capability-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
}
.seat-capability-chips .cap-chips-label {
  font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);
  color: var(--md-sys-color-on-surface-variant);
  margin-right: 4px;
}
.seat-capability-hint {
  margin: 4px 0 8px;
  padding: 10px 14px;
  border-radius: var(--md-sys-shape-corner-small, 8px);
  background: var(--md-sys-color-surface-container);
  border-left: 3px solid var(--md-sys-color-primary);
  color: var(--md-sys-color-on-surface-variant);
  font-size: var(--md-sys-typescale-body-small-size, 0.8125rem);
  line-height: 1.5;
}
.seat-capability-hint[data-tone="warn"] {
  border-left-color: var(--md-sys-color-error);
  color: var(--md-sys-color-error);
}

/* 헤드라인: 굵은 명조 + 단말기식 라벨 */
h1, md-outlined-card h2, .empty h2 { font-family: var(--nerv-font-display); font-weight: 900; letter-spacing: -0.01em; }
.eyebrow { color: var(--nerv-red); text-transform: uppercase; letter-spacing: 0.22em; }
.eyebrow:not(:has(svg)):not(:empty)::before { content: "▲ "; display: inline-block; animation: nerv-beacon-blink 2.4s ease-in-out infinite; }
.eyebrow svg.eyebrow-icon { animation: nerv-beacon-blink 2.4s ease-in-out infinite; }
@keyframes nerv-beacon-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.42; }
}
.wordmark { font-family: var(--nerv-font-display); font-weight: 900; font-style: normal; letter-spacing: 0.08em; color: var(--nerv-orange); }

/* 상단 띠와 해저드 줄무늬 */
.mast { position: relative; z-index: 5; background: var(--nerv-black); border-bottom: 1px solid var(--nerv-orange); }
.mast::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 6px; background: var(--nerv-hazard); background-size: 28.28px 28.28px; animation: nerv-hazard-scroll 2.8s linear infinite; }
.mast span, .brand span { color: var(--nerv-amber); text-transform: uppercase; letter-spacing: 0.18em; font-family: var(--nerv-font-mono); }

/* 로그인 식별 패널 — 신극장판 NERV 반쪽 잎사귀 엠블럼 & 전술 조준선 애니메이션 */
.identity { background: var(--nerv-black) var(--nerv-hex); color: var(--nerv-orange); border: 1px solid var(--nerv-orange); border-right: 0; }
.identity::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--nerv-hazard); background-size: 28.28px 28.28px; animation: nerv-hazard-scroll 2.8s linear infinite; }
.mesh { background-image: linear-gradient(rgba(255,122,26,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,122,26,.07) 1px, transparent 1px); }
@keyframes nerv-reticle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes nerv-reticle-spin-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes nerv-emblem-pulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(240, 20, 30, 0.36)); }
  50% { filter: drop-shadow(0 0 26px rgba(255, 36, 48, 0.72)) drop-shadow(0 0 8px rgba(255, 122, 26, 0.4)); }
}
@keyframes nerv-axis-sweep {
  from { stroke-dashoffset: 234; opacity: 0.9; }
  to { stroke-dashoffset: 0; opacity: 0.9; }
}
@keyframes nerv-glyph-reveal {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.nerv-emblem .reticle-outer { transform-origin: 288px 242px; animation: nerv-reticle-spin 26s linear infinite; }
.nerv-emblem .reticle-inner { transform-origin: 288px 242px; animation: nerv-reticle-spin-rev 17s linear infinite; }
.nerv-emblem .emblem-core { fill: #f0141e; animation: nerv-emblem-pulse 3.4s ease-in-out infinite; }
.nerv-emblem .emblem-leaf { transform-origin: 310px 230px; animation: nerv-glyph-reveal 460ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.nerv-emblem .emblem-n { transform-origin: 126px 230px; animation: nerv-glyph-reveal 420ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.nerv-emblem .emblem-r { transform-origin: 273px 360px; animation: nerv-glyph-reveal 420ms 210ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.nerv-emblem .emblem-axis { stroke: var(--nerv-amber); animation: nerv-axis-sweep 2.6s linear infinite; }
:root[color-theme="light"] .nerv-emblem .emblem-core { fill: #c8102e; }
@media (prefers-color-scheme: light) {
  :root:not([color-theme]) .nerv-emblem .emblem-core { fill: #c8102e; }
}
#login-form { background: var(--md-sys-color-surface-container-low); border: 1px solid var(--nerv-orange); }
.entry { animation: nerv-boot-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both; }

/* 사이드 레일 (magi md-navigation-rail + 플로팅 드로어): 검정 레일 + 주황 활성 표시 */
#rail {
  background: var(--md-sys-color-surface-container-lowest);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: inset 3px 0 0 var(--nerv-orange);
  --md-sys-color-secondary: var(--nerv-orange);
  --md-sys-color-secondary-container: var(--md-sys-color-primary-container);
  --md-sys-color-on-secondary-container: var(--md-sys-color-on-primary-container);
}
#railMenu {
  --md-icon-button-icon-color: var(--nerv-amber);
  --md-icon-button-hover-icon-color: var(--nerv-orange);
  color: var(--nerv-amber);
}

/* 툴바: 단말기 상태줄 — 해저드 줄무늬 좌우 전체 폭 적용 */
.toolbar { position: relative; border-bottom: 1px solid var(--nerv-orange); }
.toolbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px; background: var(--nerv-hazard); background-size: 28.28px 28.28px; animation: nerv-hazard-scroll 2.8s linear infinite; pointer-events: none; }
.wire { color: var(--nerv-amber); text-transform: uppercase; letter-spacing: 0.14em; }
.wire::before { background: var(--nerv-red); box-shadow: 0 0 8px var(--nerv-red); }
.wire.live::before { background: var(--nerv-green); animation: nerv-radar-ping 1.8s ease-out infinite; }
@keyframes nerv-radar-ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nerv-green) 70%, transparent), 0 0 8px var(--nerv-green); opacity: 1; }
  70% { box-shadow: 0 0 0 7px transparent, 0 0 12px var(--nerv-green); opacity: 0.88; }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 6px var(--nerv-green); opacity: 0.65; }
}

/* 카드/보드/그래프: 각진 패널 + 주황 모서리 표식/잠금 애니메이션. 본문은 대비 높은 기본 글꼴로 읽기 쉽게 유지 */
@keyframes nerv-bracket-lock {
  from { width: 6px; height: 6px; opacity: 0.35; }
  to { width: 18px; height: 18px; opacity: 1; }
}
.empty, .flow-panel, .kanban-board, .squad-matrix {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  position: relative;
  transition: border-color 200ms ease, box-shadow 220ms ease;
}
md-outlined-card {
  transition: box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
md-outlined-card:hover {
  --md-outlined-card-outline-color: color-mix(in srgb, var(--nerv-orange) 65%, var(--md-sys-color-outline-variant));
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--nerv-orange) 32%, transparent);
}
.flow-panel:hover, .kanban-board:hover, .squad-matrix:hover {
  border-color: color-mix(in srgb, var(--nerv-orange) 50%, var(--md-sys-color-outline-variant));
  box-shadow: 0 10px 28px -16px color-mix(in srgb, var(--nerv-orange) 28%, transparent);
}
md-outlined-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--nerv-orange);
  border-left: 2px solid var(--nerv-orange);
  pointer-events: none;
  z-index: 1;
  animation: nerv-bracket-lock 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1), height 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease;
}
md-outlined-card:hover::before { width: 26px; height: 26px; border-color: var(--nerv-amber); }
.flow-panel::before, .kanban-board::before, .squad-matrix::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--nerv-orange);
  border-left: 2px solid var(--nerv-orange);
  pointer-events: none;
  animation: nerv-bracket-lock 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1), height 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.flow-panel:hover::before, .kanban-board:hover::before, .squad-matrix:hover::before { width: 26px; height: 26px; }
md-outlined-card header code, .subcard code { color: var(--nerv-orange); }
small { background: transparent; border: 1px solid var(--nerv-amber); color: var(--nerv-amber); text-transform: uppercase; letter-spacing: 0.1em; }
small[data-tone="active"] { background: transparent; border-color: var(--nerv-orange); color: var(--nerv-orange); }
small[data-tone="done"] { background: transparent; border-color: var(--nerv-green); color: var(--nerv-green); }
small[data-tone="warn"] { background: transparent; border-color: var(--nerv-amber); color: var(--nerv-amber); }
small[data-tone="error"] { background: transparent; border-color: var(--nerv-red); color: var(--nerv-red); }
small[data-tone="neutral"] { background: transparent; border-color: var(--md-sys-color-outline); color: var(--md-sys-color-on-surface-variant); }
.field { border-top-color: var(--md-sys-color-outline-variant); }
blockquote { background: var(--md-sys-color-surface-container); border-left-color: var(--nerv-amber); }
.empty { border-style: dashed; border-color: var(--md-sys-color-outline); }
#notice[data-error="true"] { border-left: 3px solid var(--nerv-red); }

/* Stage Pipeline, Card Stepper, Hierarchy Breadcrumb, and Spatial Depth Transitions */
.pipeline-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(172px, 1fr));
  gap: 10px;
  overflow-x: auto;
  max-width: 100%;
}
.pipeline-step {
  position: relative;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pipeline-step[data-tone="active"] { border-color: var(--md-sys-color-primary); }
.pipeline-step[data-tone="warn"] { border-color: var(--md-sys-color-tertiary); }
.pipeline-step[data-tone="done"] { border-color: var(--md-sys-color-secondary); }
.pipeline-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.pipeline-step-no {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-primary);
}
.pipeline-step-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  color: var(--md-sys-color-on-surface);
}
.pipeline-step-title svg.fa-icon { color: var(--md-sys-color-primary); }
.pipeline-step-desc {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: var(--md-sys-typescale-body-small-line-height);
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 4px;
}
.pipeline-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.pipeline-empty {
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-outline);
  font-family: var(--nerv-font-mono);
}
.pipeline-chip {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  --md-assist-chip-container-height: 32px;
  --md-assist-chip-container-shape: var(--md-sys-shape-corner-small);
  --md-assist-chip-outline-color: var(--md-sys-color-outline-variant);
  --md-assist-chip-label-text-color: var(--md-sys-color-on-surface);
  --md-assist-chip-hover-label-text-color: var(--md-sys-color-on-surface);
  --md-assist-chip-focus-label-text-color: var(--md-sys-color-on-surface);
  --md-assist-chip-icon-size: 14px;
  --md-assist-chip-label-text-font: var(--nerv-font-mono);
  --md-assist-chip-label-text-size: var(--md-sys-typescale-label-small-size);
  --md-assist-chip-leading-space: 10px;
  --md-assist-chip-trailing-space: 10px;
  cursor: pointer;
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1);
}
.pipeline-chip:hover {
  --md-assist-chip-outline-color: var(--nerv-orange);
  transform: translateX(2px);
}
.pipeline-chip[data-alert="true"] {
  --md-assist-chip-outline-color: var(--md-sys-color-error);
  --md-assist-chip-label-text-color: var(--md-sys-color-error);
  --md-assist-chip-hover-label-text-color: var(--md-sys-color-error);
  --md-assist-chip-focus-label-text-color: var(--md-sys-color-error);
  --md-assist-chip-icon-color: var(--md-sys-color-error);
  --md-assist-chip-hover-icon-color: var(--md-sys-color-error);
  --md-assist-chip-focus-icon-color: var(--md-sys-color-error);
}
.stage-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 12px;
}
.stepper-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: var(--md-sys-typescale-label-small-line-height);
  color: var(--md-sys-color-on-surface-variant);
}
.stepper-pill[data-step="done"] {
  border-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-secondary);
}
.stepper-pill[data-step="active"] {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary-container);
}
.stepper-pill[data-step="alert"] {
  background: var(--md-sys-color-error-container);
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error-container);
}
.depth-crumb {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 0;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
}
.crumb-back {
  background: transparent;
  border: none;
  --md-text-button-container-height: 32px;
  --md-text-button-leading-space: 8px;
  --md-text-button-trailing-space: 10px;
  --md-text-button-with-leading-icon-leading-space: 8px;
  --md-text-button-with-leading-icon-trailing-space: 10px;
  --md-text-button-label-text-font: var(--nerv-font-mono);
  --md-text-button-label-text-size: var(--md-sys-typescale-label-medium-size);
}
.crumb-sep { color: var(--md-sys-color-outline); }
.crumb-current { color: var(--md-sys-color-on-surface); }

/* Spatial & Hierarchical Depth Motion, Flow Streams, & Tactical Micro-Interactions */
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-old(*),
::view-transition-new(*) {
  pointer-events: none;
  animation-duration: 260ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes nerv-boot-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes nerv-depth-down-in {
  from { opacity: 0; transform: scale(0.945) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes nerv-depth-down-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.92); }
}
@keyframes nerv-depth-up-in {
  from { opacity: 0; transform: scale(0.97) translateY(-12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes nerv-depth-up-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94) translateY(14px); }
}
@keyframes nerv-lateral-next-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes nerv-lateral-prev-in {
  from { opacity: 0; transform: translateY(-18px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes nerv-layer-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nerv-flow-stream {
  from { stroke-dashoffset: 26; }
  to { stroke-dashoffset: 0; }
}
@keyframes nerv-node-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--nerv-orange) 45%, transparent)); }
}
@keyframes nerv-step-glow {
  0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
  50% { box-shadow: inset 0 0 14px -6px color-mix(in srgb, var(--nerv-orange) 38%, transparent); }
}
@keyframes nerv-details-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nerv-dialog-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
html[data-transition="depth-down"]::view-transition-old(root) { animation-name: nerv-depth-down-out; }
html[data-transition="depth-down"]::view-transition-new(root) { animation-name: nerv-depth-down-in; }
html[data-transition="depth-up"]::view-transition-old(root) { animation-name: nerv-depth-up-out; }
html[data-transition="depth-up"]::view-transition-new(root) { animation-name: nerv-depth-up-in; }
#nerv-view[data-motion="initial"] > * {
  animation: nerv-boot-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 45ms);
}
#nerv-view[data-motion="depth-down"] > * {
  animation: nerv-depth-down-in 270ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 40ms);
}
#nerv-view[data-motion="depth-up"] > * {
  animation: nerv-depth-up-in 250ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 35ms);
}
#nerv-view[data-motion="lateral-next"] > * {
  animation: nerv-lateral-next-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 38ms);
}
#nerv-view[data-motion="lateral-prev"] > * {
  animation: nerv-lateral-prev-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 38ms);
}
#nerv-view[data-motion="fade-in"] > * {
  animation: nerv-layer-rise 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--layer-order, 0) * 30ms);
}
#nerv-view:not([data-motion="none"]) .pipeline-step:nth-child(1) { animation: nerv-layer-rise 240ms 20ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .pipeline-step:nth-child(2) { animation: nerv-layer-rise 240ms 55ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .pipeline-step:nth-child(3) { animation: nerv-layer-rise 240ms 90ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .pipeline-step:nth-child(4) { animation: nerv-layer-rise 240ms 125ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .pipeline-step:nth-child(5) { animation: nerv-layer-rise 240ms 160ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .lane:nth-child(1) { animation: nerv-layer-rise 250ms 30ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .lane:nth-child(2) { animation: nerv-layer-rise 250ms 70ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .lane:nth-child(3) { animation: nerv-layer-rise 250ms 110ms cubic-bezier(0.22, 1, 0.36, 1) both; }
#nerv-view:not([data-motion="none"]) .lane:nth-child(4) { animation: nerv-layer-rise 250ms 150ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.flow-edge.active {
  stroke-dasharray: 8 5;
  animation: nerv-flow-stream 1.15s linear infinite;
}
.flow-edge.dashed {
  stroke-dasharray: 7 6;
  animation: nerv-flow-stream 2.1s linear infinite;
}
.flow-node[data-tone="active"] .flow-node-box,
.flow-node[data-tone="error"] .flow-node-box {
  animation: nerv-node-pulse 2.6s ease-in-out infinite;
}
.pipeline-step[data-tone="active"] {
  border-color: var(--nerv-orange);
  animation: nerv-step-glow 3s ease-in-out infinite;
}
.pipeline-step[data-tone="warn"] { border-color: var(--nerv-amber); }
.pipeline-step[data-tone="done"] { border-color: var(--nerv-green); }
.stepper-pill[data-step="active"],
.stepper-pill[data-step="alert"] {
  transition: background-color 180ms ease, border-color 180ms ease;
}
details.doc-reader[open] > pre,
details.evidence-gate[open] > blockquote,
details.inquiry-collapse[open] > .inquiry-thread {
  animation: nerv-details-open 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#confirm[open] {
  animation: nerv-dialog-in 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
#refresh svg.fa-icon {
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
#refresh:hover:not([disabled]) svg.fa-icon {
  transform: rotate(180deg);
}
.theme-toggle svg {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.theme-toggle:hover svg {
  transform: rotate(22deg) scale(1.08);
}
nav md-list-item {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
nav md-list-item .nav-icon {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
nav md-list-item:hover .nav-icon {
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  body,
  #workspace::before,
  .eyebrow:not(:has(svg)):not(:empty)::before,
  .eyebrow svg.eyebrow-icon,
  .mast::after,
  .identity::before,
  .toolbar::after,
  .nerv-emblem .reticle-outer,
  .nerv-emblem .reticle-inner,
  .nerv-emblem .emblem-core,
  .nerv-emblem .emblem-leaf,
  .nerv-emblem .emblem-n,
  .nerv-emblem .emblem-r,
  .nerv-emblem .emblem-axis,
  .entry,
  .wire.live::before,
  md-outlined-card::before,
  .flow-panel::before,
  .kanban-board::before,
  .squad-matrix::before,
  .flow-edge.active,
  .flow-edge.dashed,
  .flow-node[data-tone="active"] .flow-node-box,
  .flow-node[data-tone="error"] .flow-node-box,
  .pipeline-step,
  details[open] > *,
  #confirm[open],
  #nerv-view[data-motion] > * { animation: none !important; }
  .pipeline-chip,
  nav md-list-item,
  nav md-list-item .nav-icon,
  md-outlined-card,
  .flow-panel,
  .kanban-board,
  .squad-matrix,
  #refresh svg.fa-icon,
  .theme-toggle svg { transition: none !important; }
}
@media (max-width: 760px) {
  .identity { border-right: 1px solid var(--nerv-orange); border-bottom: 0; }
  .identity::after { display: none; }
  #rail {
    border-right: 0;
    border-top: 1px solid var(--nerv-orange);
    box-shadow: none;
  }
}

/* ==========================================================================
   실시간 이벤트 표식 (WebSocket 통합 이벤트 스트림, WEB_UI.md §3.3)
   ========================================================================== */
[data-live="updated"] { animation: nerv-live-pulse 1.6s cubic-bezier(0.22, 1, 0.36, 1) 1; }
[data-live="resolved"] { transition: opacity .26s ease, transform .26s cubic-bezier(0.4, 0, 1, 1); opacity: 0; transform: scale(.96) translateY(-6px); }
@keyframes nerv-live-pulse {
  0% { box-shadow: 0 0 0 2px var(--md-sys-color-primary), 0 0 18px color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent); }
  45% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent), 0 0 24px color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent, 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  [data-live="updated"] { animation: none; outline: 2px solid var(--md-sys-color-primary); }
  [data-live="resolved"] { transition: none; }
}

/* ==========================================================================
   sayaya-ui 셸 컨트롤 (md-outlined-text-field, md-outlined-select, md-list-item, md-badge)
   ========================================================================== */
#login-form md-outlined-text-field {
  display: block;
  width: 100%;
  margin-top: 16px;
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
  --md-outlined-text-field-input-text-size: 16px;
}
.mast .lang-select {
  margin-left: auto;
  min-width: 136px;
  --md-outlined-select-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
}
.toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-controls md-outlined-select {
  min-width: 136px;
  --md-outlined-select-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
}
#rail .dest .nav-icon {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
#rail .dest:hover .nav-icon {
  transform: scale(1.1);
}
@media (prefers-reduced-motion: reduce) {
  #rail,
  #scrim,
  .burger line,
  #rail .dest .nav-icon { transition: none !important; }
}

/* sayaya-ui 카드/칩 (md-outlined-card, md-assist-chip, md-chip-set) */
md-outlined-card { --md-outlined-card-container-shape: var(--md-sys-shape-corner-large, 0px); }
.pipeline-items md-assist-chip, .inquiry-presets md-suggestion-chip, .ext-links md-assist-chip, .chips md-assist-chip, .hub-filters md-filter-chip { max-width: 100%; min-width: 0; }

/* ==========================================================================
   NERV 라이트 테마 (handbook color-theme 방식)
   기본 NERV 레이어는 다크입니다. 사용자가 라이트를 고르거나(color-theme="light"), 선택이 없고 OS가 라이트면
   같은 관제실 장식(각진 패널/해저드 줄무늬/주황 모서리)을 유지한 채 깨끗한 쿨 슬레이트/화이트 팔레트로 바꿉니다.
   배경/카드 간 명도 층위를 또렷이 분리하고, 모든 전경/강조색은 WCAG AA(>= 4.5:1) 대비를 충족합니다.
   ========================================================================== */
:root[color-theme="light"] {
  color-scheme: light;
  --nerv-black: #f4f6f9;
  --nerv-orange: #b84200;
  --nerv-red: #be123c;
  --nerv-green: #116e3a;
  --nerv-amber: #925000;
  --md-sys-color-primary: #b84200;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #ffedd5;
  --md-sys-color-on-primary-container: #7c2d12;
  --md-sys-color-secondary: #116e3a;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #dcfce7;
  --md-sys-color-on-secondary-container: #052e16;
  --md-sys-color-tertiary: #925000;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #fef3c7;
  --md-sys-color-on-tertiary-container: #451a03;
  --md-sys-color-error: #be123c;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffe4e6;
  --md-sys-color-on-error-container: #881337;
  --md-sys-color-background: #f4f6f9;
  --md-sys-color-on-background: #111827;
  --md-sys-color-surface: #f4f6f9;
  --md-sys-color-surface-dim: #d8e0ea;
  --md-sys-color-surface-bright: #ffffff;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #ffffff;
  --md-sys-color-surface-container: #eef2f6;
  --md-sys-color-surface-container-high: #e4eaf1;
  --md-sys-color-surface-container-highest: #d8e0ea;
  --md-sys-color-on-surface: #111827;
  --md-sys-color-surface-variant: #e4eaf1;
  --md-sys-color-on-surface-variant: #475569;
  --md-sys-color-outline: #64748b;
  --md-sys-color-outline-variant: #cbd5e1;
  --md-sys-color-inverse-surface: #1e293b;
  --md-sys-color-inverse-on-surface: #f8fafc;
  --md-sys-color-inverse-primary: #ff9a52;
  --nerv-hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 16L-28 0M56 16L84 0' fill='none' stroke='%2394a3b8' stroke-opacity='.24' stroke-width='1'/%3E%3C/svg%3E");
  --nerv-hazard: repeating-linear-gradient(-45deg, #e05200 0 10px, #1e293b 10px 20px);
}
@media (prefers-color-scheme: light) {
  :root:not([color-theme]) {
    color-scheme: light;
    --nerv-black: #f4f6f9;
    --nerv-orange: #b84200;
    --nerv-red: #be123c;
    --nerv-green: #116e3a;
    --nerv-amber: #925000;
    --md-sys-color-primary: #b84200;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #ffedd5;
    --md-sys-color-on-primary-container: #7c2d12;
    --md-sys-color-secondary: #116e3a;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #dcfce7;
    --md-sys-color-on-secondary-container: #052e16;
    --md-sys-color-tertiary: #925000;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #fef3c7;
    --md-sys-color-on-tertiary-container: #451a03;
    --md-sys-color-error: #be123c;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #ffe4e6;
    --md-sys-color-on-error-container: #881337;
    --md-sys-color-background: #f4f6f9;
    --md-sys-color-on-background: #111827;
    --md-sys-color-surface: #f4f6f9;
    --md-sys-color-surface-dim: #d8e0ea;
    --md-sys-color-surface-bright: #ffffff;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #ffffff;
    --md-sys-color-surface-container: #eef2f6;
    --md-sys-color-surface-container-high: #e4eaf1;
    --md-sys-color-surface-container-highest: #d8e0ea;
    --md-sys-color-on-surface: #111827;
    --md-sys-color-surface-variant: #e4eaf1;
    --md-sys-color-on-surface-variant: #475569;
    --md-sys-color-outline: #64748b;
    --md-sys-color-outline-variant: #cbd5e1;
    --md-sys-color-inverse-surface: #1e293b;
    --md-sys-color-inverse-on-surface: #f8fafc;
    --md-sys-color-inverse-primary: #ff9a52;
    --nerv-hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 16L-28 0M56 16L84 0' fill='none' stroke='%2394a3b8' stroke-opacity='.24' stroke-width='1'/%3E%3C/svg%3E");
    --nerv-hazard: repeating-linear-gradient(-45deg, #e05200 0 10px, #1e293b 10px 20px);
  }
}
:root[color-theme="dark"] { color-scheme: dark; }
.theme-toggle { --md-icon-button-icon-color: var(--nerv-amber); --md-icon-button-hover-icon-color: var(--nerv-orange); }
.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }
.mast .theme-toggle { margin-left: 8px; }

/* Settings, Doctor, Cost Telemetry, Scheduler, & Inline Form Panels */
#nerv-view[data-screen="settings"],
#nerv-view[data-screen="cost"] {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.scheduler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin-top: 12px;
}
.form-panel summary.form-summary,
.attach-doc-panel summary.form-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--md-sys-typescale-title-small-size);
  line-height: var(--md-sys-typescale-title-small-line-height);
  font-weight: var(--md-sys-typescale-title-small-weight);
  color: var(--md-sys-color-primary);
}
.form-panel summary.form-summary::-webkit-details-marker,
.attach-doc-panel summary.form-summary::-webkit-details-marker {
  display: none;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}
.form-grid md-outlined-text-field,
.form-grid md-outlined-select {
  width: 100%;
  min-width: 0;
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
  --md-outlined-select-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
}
md-outlined-select,
md-filled-select,
md-select-option,
md-outlined-text-field:not([type="textarea"]) {
  white-space: nowrap;
}
md-outlined-select::part(menu),
md-filled-select::part(menu) {
  min-width: max(var(--__menu-min-width, 100%), min(max-content, 92vw));
  max-width: min(92vw, 760px);
}
.form-grid .form-span-full {
  grid-column: 1 / -1;
}
@media (min-width: 760px) {
  .form-grid .form-span-2 {
    grid-column: span 2;
  }
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.seat-console-panel[open] {
  padding-bottom: 26px;
}
.session-suggest {
  position: relative;
  min-width: 0;
}
.form-grid .session-suggest {
  width: 100%;
}
.session-suggest-field {
  display: block;
  width: 100%;
  min-width: 0;
  --md-outlined-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
}
.session-suggest-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
  padding: 6px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-suggest-menu[hidden] {
  display: none !important;
}
.session-suggest-option {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  font-family: var(--nerv-font-sans);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.session-suggest-option:hover,
.session-suggest-option[data-highlighted="true"] {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
}
.session-suggest-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-container-highest));
}
.session-opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.session-opt-id {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.session-opt-title {
  font-size: var(--md-sys-typescale-body-medium-size);
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.session-opt-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.session-opt-badges small {
  padding: 1px 6px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: 1.4;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
}
.session-opt-badges small[data-tone="active"] {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.session-opt-badges small[data-tone="done"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.session-opt-sub {
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: 1.4;
  color: var(--md-sys-color-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.session-suggest-empty {
  padding: 10px 12px;
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.session-suggest-new {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--md-sys-color-primary);
  font-weight: 600;
}
.session-suggest-new .session-opt-head {
  justify-content: flex-start;
  gap: 6px;
}
.session-tab-bar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  margin-top: 14px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.session-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--md-sys-shape-corner-small);
  padding: 8px 14px;
  min-height: 38px;
  max-width: 240px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-large-size);
  line-height: 1.3;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.session-tab:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  color: var(--md-sys-color-on-surface);
}
.session-tab:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}
.session-tab[data-active="true"] {
  background: color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface-container));
  border-bottom-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
  font-weight: 600;
}
.session-tab-new {
  color: var(--md-sys-color-primary);
  font-weight: 600;
  margin-left: auto;
}
.session-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
#seat-console-thread.chat-viewport {
  min-height: 160px;
  max-height: clamp(280px, 50vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  margin: 10px 0 14px;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#seat-console-thread .inquiry-turn.chat-exchange {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble {
  max-width: min(88%, 840px);
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-bubble-user {
  align-self: flex-end;
  padding: 10px 14px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-large);
}
.chat-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.chat-session-tag {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  line-height: 1.3;
  color: var(--md-sys-color-on-primary-container);
  opacity: 0.82;
}
.chat-bubble-user .md-prose,
.chat-bubble-user .md-prose .md-heading {
  color: var(--md-sys-color-on-primary-container);
}
.chat-bubble-user .md-prose .md-inline-code {
  background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 14%, transparent);
  color: var(--md-sys-color-on-primary-container);
}
.chat-bubble-agent {
  align-self: flex-start;
  width: fit-content;
  min-width: min(100%, 260px);
  max-width: min(94%, 880px);
  padding: 12px 16px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-extra-small);
}
.chat-agent-head {
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 65%, transparent);
}
.chat-agent-head .inquiry-speaker {
  margin-bottom: 0;
}
.chat-empty-hint {
  margin: auto 0;
  text-align: center;
  padding: 24px 12px;
}
.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-composer md-outlined-text-field.agent-prompt-textarea {
  margin-top: 0;
}
.chat-composer-actions {
  margin-top: 0;
  margin-bottom: 2px;
}
@media (max-width: 760px) {
  .seat-console-panel[open] {
    padding-bottom: 22px;
  }
  .chat-bubble-user,
  .chat-bubble-agent {
    max-width: 96%;
  }
}
.form-actions + .inquiry-thread {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.prefs-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  align-items: center;
}
.prefs-controls-row .lang-select {
  width: 100%;
  min-width: 0;
  --md-outlined-select-text-field-container-shape: var(--md-sys-shape-corner-small, 0px);
}
.theme-control-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.theme-mode-label {
  font-size: var(--md-sys-typescale-body-medium-size);
  color: var(--md-sys-color-on-surface);
}
.settings-subhead {
  margin: 8px 0 10px;
  color: var(--md-sys-color-on-surface);
}
.settings-item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.settings-list-row {
  padding: 8px 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.doctor-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Mobile Carousel Controls, Mobile Case Squad Deck, & Touch Target Ergonomics */
details > summary {
  min-height: 40px;
  padding: 6px 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.carousel-chrome {
  display: none;
}
.matrix-mobile {
  display: none;
}
.carousel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.carousel-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--nerv-font-sans);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.carousel-pill:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container));
}
.carousel-pill:focus-visible,
.carousel-arrow:focus-visible,
.carousel-mode-btn:focus-visible,
.mslide-head:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.carousel-pill[data-active="true"] {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  font-weight: 600;
}
.carousel-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  font-variant-numeric: tabular-nums;
}
.carousel-pill[data-active="true"] .carousel-pill-count {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.carousel-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.carousel-arrow {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.carousel-arrow:hover:not([disabled]) {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container));
  border-color: var(--md-sys-color-primary);
}
.carousel-arrow[disabled] {
  opacity: 0.38;
  cursor: default;
}
.carousel-status {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
}
.carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-outline-variant);
  transition: width 160ms ease, background-color 160ms ease;
}
.carousel-dot[data-active="true"] {
  width: 20px;
  background: var(--md-sys-color-primary);
}
.carousel-mode-btn {
  appearance: none;
  min-height: 36px;
  padding: 6px 12px;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  cursor: pointer;
}
.carousel-mode-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, var(--md-sys-color-surface-container));
  color: var(--md-sys-color-on-surface);
}
.carousel-mode-btn[aria-pressed="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-secondary);
}
.matrix-slides {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.matrix-slides::-webkit-scrollbar { display: none; }
.matrix-slide {
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mslide-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
}
.mslide-assignments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mslide-task {
  margin: 0;
}
.mslide-seat {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
  color: var(--nerv-orange);
}
.issue-triage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.issue-triage-row {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.issue-triage-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.issue-triage-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.issue-triage-title {
  display: block;
  font-size: var(--md-sys-typescale-body-medium-size);
  color: var(--md-sys-color-on-surface);
  overflow-wrap: anywhere;
}
.issue-resolution-note {
  margin: 0;
  padding: 8px 12px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: var(--md-sys-typescale-body-small-size);
  overflow-wrap: anywhere;
}
.issue-bulk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin-top: 14px;
}
.issue-bulk-box {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.issue-bulk-box h4 {
  margin: 0;
  font-size: var(--md-sys-typescale-title-small-size);
  color: var(--md-sys-color-on-surface);
}
.session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
}
.steering-cockpit {
  border-color: var(--md-sys-color-primary);
}
.steering-lead {
  margin: 6px 0 10px;
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.steering-live-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-small);
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-on-surface);
}
.case-steer-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.case-output-preview {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--md-sys-color-surface-container-high);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: 1.45;
  color: var(--md-sys-color-on-surface);
}
.case-output-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.case-output-preview-line {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  color: var(--md-sys-color-on-surface);
}
.case-request-preview-line {
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.agent-request-block {
  margin: 0 0 6px;
  padding: 6px 8px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-size: var(--md-sys-typescale-body-small-size);
  line-height: 1.45;
  color: var(--md-sys-color-on-surface);
}
.agent-io-kicker {
  display: inline-block;
  margin-right: 6px;
  font-size: var(--md-sys-typescale-label-small-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}
.agent-response-label {
  display: block;
  margin: 0 0 4px;
}
.agent-output-feed {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.agent-output-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.agent-output-feed-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--md-sys-typescale-label-large-size);
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}
.agent-output-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-output-item {
  padding: 8px 10px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-small);
}
.agent-output-item[data-live-run="true"] {
  border-left: 3px solid var(--md-sys-color-primary);
}
.agent-output-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.agent-output-tail {
  margin: 0;
  padding: 8px 10px;
  max-height: 132px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
}
.agent-output-expand {
  margin-top: 6px;
}
.agent-output-expand > summary {
  cursor: pointer;
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-primary);
}
.agent-output-full {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
}
.agent-output-empty {
  margin: 0;
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.agent-recent-output {
  margin: 8px 0 4px;
  padding: 8px 10px;
  background: var(--md-sys-color-surface-container-high);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-extra-small);
}
.agent-run-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.case-tab-btn {
  appearance: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--md-sys-typescale-label-medium-font);
  font-size: var(--md-sys-typescale-label-medium-size);
  line-height: var(--md-sys-typescale-label-medium-line-height);
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.case-tab-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.case-tab-btn[data-active="true"] {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  font-weight: 600;
}
.case-detail-section[hidden],
.flow-panel[hidden],
.kanban-board[hidden] {
  display: none !important;
}
.case-linked-issues-list {
  margin: 8px 0 12px;
}
@media (min-width: 761px) {
  .case-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    align-items: center;
  }
  .case-metrics-grid > .meter-wrap {
    grid-column: 1 / -1;
    margin: 2px 0 8px;
  }
  .case-metrics-grid > .field {
    grid-template-columns: minmax(96px, 38%) 1fr;
  }
}
@media (min-width: 761px) and (max-width: 959px) {
  #nerv-view:has([data-case-detail]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  #nerv-view:has([data-case-detail]) > [data-case-detail],
  #nerv-view:has([data-case-detail]) > .case-stage-panel {
    grid-column: 1 / -1;
  }
}
@media (min-width: 960px) {
  #nerv-view:has([data-case-detail]) {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 14px 20px;
    align-items: start;
  }
  #nerv-view:has([data-case-detail]) > [data-case-detail] {
    grid-column: 1;
    min-width: 0;
  }
  #nerv-view:has([data-case-detail]) > .case-stage-panel {
    grid-column: 2;
    position: sticky;
    top: 16px;
    padding: 16px 18px;
  }
  #nerv-view:has([data-case-detail]) > .case-stage-panel[data-has-dag="true"] {
    position: static;
  }
  #nerv-view:has([data-case-detail]) > .case-stage-panel .panel-head {
    margin-bottom: 12px;
  }
  #nerv-view:has([data-case-detail]):not(:has(> .case-stage-panel:not([hidden]))) > [data-case-detail] {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .case-stage-panel[data-has-dag="true"] {
    display: none;
  }
  .carousel-chrome {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }
  [data-carousel-mode="stack"] > .carousel-chrome .carousel-pills,
  [data-carousel-mode="stack"] > .carousel-chrome .carousel-pager {
    display: none;
  }
  .kanban-board[data-carousel-mode="stack"] .lanes,
  .matrix-mobile[data-carousel-mode="stack"] .matrix-slides {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .pipeline-track {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
    gap: 8px;
  }
  .pipeline-step {
    padding: 10px 12px;
  }
  .pipeline-step[data-empty="true"] {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-head {
    order: 2;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-title {
    order: 1;
  }
  .pipeline-step[data-empty="true"] .pipeline-step-desc,
  .pipeline-step[data-empty="true"] .pipeline-items {
    display: none;
  }
  .squad-matrix .matrix-scroll {
    display: none;
  }
  .squad-matrix .matrix-mobile {
    display: block;
  }
}
@media (max-width: 520px) {
  md-outlined-card footer md-filled-button,
  md-outlined-card footer md-filled-tonal-button,
  md-outlined-card footer md-outlined-button {
    flex: 1 1 100%;
    width: 100%;
  }
}
md-outlined-card[data-decision-id] > footer {
  justify-content: flex-end;
}
md-outlined-card[data-decision-id] > footer > * {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
}
md-outlined-card[data-seat-card] > footer,
md-outlined-card[data-case-id] > footer,
md-outlined-card.kcard > footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 8px;
  width: 100%;
}
md-outlined-card[data-seat-card] > footer md-outlined-button,
md-outlined-card[data-seat-card] > footer md-filled-button,
md-outlined-card[data-seat-card] > footer md-filled-tonal-button,
md-outlined-card[data-case-id] > footer md-outlined-button,
md-outlined-card[data-case-id] > footer md-filled-button,
md-outlined-card[data-case-id] > footer md-filled-tonal-button,
md-outlined-card.kcard > footer md-outlined-button,
md-outlined-card.kcard > footer md-filled-button,
md-outlined-card.kcard > footer md-filled-tonal-button {
  width: 100%;
  --md-outlined-button-leading-space: 12px;
  --md-outlined-button-trailing-space: 12px;
  --md-outlined-button-with-leading-icon-leading-space: 10px;
  --md-outlined-button-with-leading-icon-trailing-space: 12px;
  --md-outlined-button-with-trailing-icon-leading-space: 12px;
  --md-outlined-button-with-trailing-icon-trailing-space: 10px;
  --md-filled-button-leading-space: 12px;
  --md-filled-button-trailing-space: 12px;
  --md-filled-button-with-leading-icon-leading-space: 10px;
  --md-filled-button-with-leading-icon-trailing-space: 12px;
  --md-filled-tonal-button-leading-space: 12px;
  --md-filled-tonal-button-trailing-space: 12px;
  --md-filled-tonal-button-with-leading-icon-leading-space: 10px;
  --md-filled-tonal-button-with-leading-icon-trailing-space: 12px;
}
.case-pipeline-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.case-pipeline-row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
}
.case-pipeline-row[data-tone="active"] { border-color: var(--md-sys-color-primary); }
.case-pipeline-row[data-tone="warn"] { border-color: var(--md-sys-color-tertiary); }
.case-pipeline-row[data-tone="done"] { border-color: var(--md-sys-color-secondary); }
.case-pipe-meta {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  font-family: var(--nerv-font-sans);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.case-pipe-meta:hover .case-pipe-goal {
  color: var(--nerv-orange, var(--md-sys-color-primary));
  text-decoration: underline;
  text-underline-offset: 3px;
}
.case-pipe-meta:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.case-pipe-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.case-pipe-id {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-medium-size);
  color: var(--nerv-orange, var(--md-sys-color-primary));
}
.case-pipe-goal {
  font-size: var(--md-sys-typescale-body-medium-size);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.case-pipe-seat {
  font-family: var(--nerv-font-mono);
  font-size: var(--md-sys-typescale-label-small-size);
  color: var(--md-sys-color-on-surface-variant);
}
.case-pipe-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.autonomous-solve-box {
  margin-bottom: 14px;
}
.case-details-box {
  margin: 4px 0 14px;
  padding: 12px 16px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-small);
}
.case-details-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: var(--md-sys-typescale-label-medium-size);
  color: var(--md-sys-color-primary);
}
.case-steps-editor {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
@media (max-width: 760px) {
  .case-pipeline-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lanes,
  .matrix-slides {
    scroll-behavior: auto !important;
  }
  .carousel-pill,
  .carousel-dot {
    transition: none !important;
  }
}

.runtime-outputs, .case-detail-actions, .case-stage-summary, .case-output-slot { display: contents; }
