:root {
  --blue: #0f6cbd;
  --blue-dark: #0f548c;
  --blue-soft: #ebf3fc;
  --blue-line: #cfe4fa;
  --teal: #038387;
  --teal-dark: #025c5f;
  --teal-soft: #eefafa;
  --teal-line: #c7eeee;
  --green: #107c10;
  --green-soft: #f1faf1;
  --red: #d13438;
  --red-soft: #fdf3f4;
  --violet: #5c2e91;
  --violet-soft: #f7f2fb;
  --text: #242424;
  --muted: #5f5f5f;
  --subtle: #f5f5f5;
  --surface: #ffffff;
  --page: #f8f8f8;
  --line: #d1d1d1;
  --line-soft: #e6e6e6;
  --chat-width: min(440px, calc(100vw - 32px));
  --shadow-4: 0 1px 2px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);
  --shadow-8: 0 4px 8px rgba(0, 0, 0, 0.14), 0 0 2px rgba(0, 0, 0, 0.12);
  --shadow-16: 0 16px 38px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

img,
svg,
canvas {
  max-width: 100%;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chain-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0.18);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(15, 108, 189, 0);
  }
}

@keyframes agent-pulse {
  from {
    border-color: var(--line-soft);
    transform: translateY(0);
  }

  to {
    border-color: var(--blue-line);
    transform: translateY(-2px);
  }
}

@keyframes assistant-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes live-ring {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0.22);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(15, 108, 189, 0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--page);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:focus-visible,
.skip-link:focus-visible,
.panel-host:focus-visible,
textarea:focus-visible {
  outline: 3px solid #1a5fb4;
  outline-offset: 3px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.18;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.48rem, 1.1rem + 1.15vw, 2rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

h4 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 12px;
  color: #ffffff;
  background: var(--blue);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 120;
  height: 3px;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
}

body[data-view="learner"] .scroll-progress span {
  background: var(--teal);
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(300px, auto) minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  min-height: 72px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line-soft);
  background: #ffffff;
  box-shadow: var(--shadow-4);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mode-summary {
  display: grid;
  gap: 2px;
  justify-self: center;
  text-align: center;
}

.mode-summary strong {
  font-size: 1rem;
}

.data-source-badge {
  justify-self: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.data-source-badge.static {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.data-source-badge.loading {
  color: var(--violet);
  background: var(--violet-soft);
}

.data-source-badge.live {
  color: var(--green);
  background: var(--green-soft);
}

.chat-engine-badge {
  align-self: start;
  width: fit-content;
  max-width: 160px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.chat-engine-badge.static {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.chat-engine-badge.loading {
  color: var(--violet);
  background: var(--violet-soft);
}

.chat-engine-badge.live {
  color: var(--green);
  background: var(--green-soft);
}

.mode-summary span,
.mission-copy p,
.role-strip span,
.decision-summary,
.plain-list li,
.panel-copy,
.source-row p,
.source-row span,
.risk-item p,
.plan-copy p,
.practice-card p,
.rule-list span,
.role-panel-copy,
.intelligence-stack span,
.agent-node p,
.system-metrics small,
.case-role {
  color: var(--muted);
  line-height: 1.46;
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--subtle);
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.view-button,
.tab-button,
.case-button,
.icon-action,
.assistant-trigger {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.view-button {
  min-height: 34px;
  padding: 7px 14px;
  color: var(--muted);
  font-weight: 800;
}

.icon-action,
.assistant-trigger {
  min-height: 34px;
  padding: 7px 12px;
  font-weight: 800;
}

.icon-action {
  color: var(--blue-dark);
  border-color: var(--blue-line);
  background: #ffffff;
}

.assistant-trigger {
  color: #ffffff;
  background: var(--blue);
}

body[data-view="learner"] .assistant-trigger {
  background: var(--teal);
}

.icon-action[aria-pressed="true"] {
  color: #ffffff;
  border-color: var(--blue);
  background: var(--blue);
}

body[data-view="learner"] .icon-action[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal);
}

.accessibility-status {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 5px 10px;
  border: 1px solid var(--blue-line);
  border-radius: 999px;
  color: var(--blue-dark);
  background: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
}

.chat-fab {
  position: fixed;
  right: 22px;
  top: 118px;
  bottom: auto;
  z-index: 90;
  display: none;
  gap: 2px;
  min-width: 174px;
  min-height: 56px;
  padding: 12px 16px 12px 52px;
  border: 1px solid #0b5cab;
  border-radius: 10px;
  color: #ffffff;
  background: var(--blue);
  box-shadow: var(--shadow-16);
}

.chat-fab::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) 7px 8px / 12px 2px no-repeat,
    linear-gradient(#ffffff, #ffffff) 7px 14px / 8px 2px no-repeat,
    rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.chat-fab span,
.chat-fab strong {
  text-align: left;
  line-height: 1.15;
}

.chat-fab span {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-fab strong {
  font-size: 0.95rem;
}

.chat-fab:hover {
  background: #0b5cab;
  transform: translateY(-2px);
}

body[data-view="learner"] .chat-fab {
  border-color: var(--teal-dark);
  background: var(--teal);
}

body[data-chat="open"] .chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.view-button.active,
.view-button[aria-pressed="true"],
.tab-button.active {
  color: #ffffff;
  background: var(--blue);
}

body[data-view="learner"] .view-button.active,
body[data-view="learner"] .view-button[aria-pressed="true"],
body[data-view="learner"] .tab-button.active {
  color: #ffffff;
  background: var(--teal);
}

.view-button:hover,
.tab-button:hover,
.icon-action:hover {
  color: var(--blue-dark);
  background: #eef6fd;
}

body[data-view="learner"] .view-button:hover,
body[data-view="learner"] .tab-button:hover {
  color: var(--teal-dark);
  background: #e9f8f8;
}

.view-button.active:hover,
.view-button[aria-pressed="true"]:hover,
.tab-button.active:hover {
  color: #ffffff;
  background: var(--blue);
}

body[data-view="learner"] .view-button.active:hover,
body[data-view="learner"] .view-button[aria-pressed="true"]:hover,
body[data-view="learner"] .tab-button.active:hover {
  color: #ffffff;
  background: var(--teal);
}

.view-button:hover,
.tab-button:hover,
.case-button:hover,
.icon-action:hover,
.assistant-trigger:hover {
  transform: translateY(-1px);
}

.product-shell {
  display: grid;
  gap: 14px;
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 22px 28px 34px;
}

.workspace-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-4);
  overflow-x: auto;
}

.workspace-nav-card {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line-soft);
  border-left: 0;
  border-radius: 7px;
  color: var(--text);
  background: #ffffff;
  text-align: left;
}

.workspace-nav-card strong,
.workspace-nav-card span {
  display: block;
}

.workspace-nav-card strong {
  font-size: 0.86rem;
  line-height: 1.15;
}

.workspace-nav-card span {
  color: var(--muted);
  display: none;
  font-size: 0.72rem;
  line-height: 1.3;
}

.workspace-nav-card.active span,
.workspace-nav-card[aria-current="page"] span {
  display: block;
}

.workspace-nav-card:hover {
  border-color: var(--blue-line);
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

.workspace-nav-card.active,
.workspace-nav-card[aria-current="page"] {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}

body[data-view="learner"] .workspace-nav-card.active,
body[data-view="learner"] .workspace-nav-card[aria-current="page"] {
  border-color: var(--teal-line);
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.mission-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.72fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-top: 5px solid var(--blue);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-4);
}

body[data-view="learner"] .mission-panel {
  border-top-color: var(--teal);
}

.decision-command-strip {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.command-verdict-card,
.command-proof-grid article {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-4);
}

.command-verdict-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-left: 5px solid var(--blue);
}

body[data-view="learner"] .command-verdict-card {
  border-left-color: var(--teal);
}

.command-verdict-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.command-verdict-line h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 1.1rem + 0.7vw, 1.8rem);
}

.command-why {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.command-proof-grid article {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 104px;
  padding: 12px;
  border-top: 3px solid var(--blue);
}

body[data-view="learner"] .command-proof-grid article {
  border-top-color: var(--teal);
}

.command-proof-grid strong {
  display: block;
  font-size: 1rem;
  line-height: 1.25;
}

.command-proof-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mission-copy {
  display: grid;
  align-content: center;
  gap: 12px;
}

.mission-copy p {
  max-width: 920px;
  margin-bottom: 0;
  font-size: 1rem;
}

.role-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.role-strip article {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-view="learner"] .role-strip article {
  border-left-color: var(--teal);
}

.role-strip article:hover {
  border-color: #b8d9f4;
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

.role-strip strong,
.role-strip span {
  display: block;
}

.role-strip strong {
  margin-bottom: 5px;
  font-size: 0.92rem;
}

.role-strip span {
  font-size: 0.84rem;
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-metrics article {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--subtle);
}

body[data-view="learner"] .system-metrics article {
  border-left-color: var(--teal);
}

.system-metrics strong {
  grid-row: span 2;
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-size: 1.45rem;
}

body[data-view="learner"] .system-metrics strong {
  background: var(--teal);
}

.system-metrics span {
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.dashboard-card {
  display: grid;
  gap: 10px;
  min-height: 136px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--blue);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-4);
}

body[data-view="learner"] .dashboard-card {
  border-top-color: var(--teal);
}

body[data-reading="guided"] {
  --shadow-4: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 2px rgba(0, 0, 0, 0.1);
}

body[data-reading="guided"] .mission-copy p,
body[data-reading="guided"] .decision-summary,
body[data-reading="guided"] .plain-list li,
body[data-reading="guided"] .panel-copy,
body[data-reading="guided"] .role-panel-copy,
body[data-reading="guided"] .chat-message p {
  font-size: 1rem;
  line-height: 1.62;
}

body[data-reading="guided"] .agent-node .agent-tool-call {
  display: none;
}

body[data-reading="guided"] .workspace-tabs,
body[data-reading="guided"] .case-filters {
  gap: 8px;
}

.learning-support-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--blue);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-4);
}

body[data-view="learner"] .learning-support-panel {
  border-top-color: var(--teal);
}

.learning-support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.64fr)) minmax(420px, 1.4fr) minmax(360px, 1fr);
  gap: 10px;
  align-items: start;
}

.learning-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 150px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--subtle);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-view="learner"] .learning-card {
  border-left-color: var(--teal);
}

.learning-card:hover {
  border-color: #b8d9f4;
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

body[data-screen]:not([data-screen="overview"]) .mission-panel,
body[data-screen]:not([data-screen="overview"]) .dashboard-grid,
body[data-screen]:not([data-screen="staff"]) .learning-support-panel,
body[data-screen]:not([data-screen="overview"]):not([data-screen="decision"]) .decision-command-strip {
  display: none;
}

body[data-screen="overview"] .operating-system {
  display: none;
}

body[data-screen="decision"] .agent-chain-panel,
body[data-screen="decision"] .decision-ledger,
body[data-screen="decision"] .score-grid,
body[data-screen="decision"] .workspace-tabs,
body[data-screen="decision"] .panel-host,
body[data-screen="decision"] .decision-summary {
  display: none;
}

body[data-screen="workflow"] .decision-ledger,
body[data-screen="workflow"] .score-grid {
  display: none;
}

body[data-screen="evidence"] .agent-chain-panel,
body[data-screen="controls"] .agent-chain-panel,
body[data-screen="team"] .agent-chain-panel,
body[data-screen="staff"] .agent-chain-panel {
  display: none;
}

.learning-card h4,
.learning-card p {
  margin-bottom: 0;
}

.learning-card p,
.learning-card span,
.learning-card small {
  color: var(--muted);
  line-height: 1.42;
}

.learning-value {
  display: grid;
  place-items: center;
  width: 54px;
  height: 44px;
  min-height: 44px;
  border-radius: 7px;
  color: #ffffff !important;
  background: var(--blue);
  font-size: 1.12rem;
  font-weight: 800;
}

body[data-view="learner"] .learning-value {
  background: var(--teal);
}

.module-chart-card {
  grid-column: span 1;
}

.support-chart {
  display: grid;
  gap: 8px;
}

.support-chart-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
}

.support-chart-row strong,
.support-chart-row span {
  font-size: 0.78rem;
}

.support-chart-row small {
  grid-column: 1 / -1;
  font-size: 0.72rem;
}

.glossary-card {
  align-content: start;
}

.term-list,
.access-list {
  display: grid;
  gap: 7px;
}

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

.term-list div,
.access-list div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
}

.term-list strong,
.access-list strong {
  font-size: 0.82rem;
}

.term-list span,
.access-list span {
  font-size: 0.76rem;
}

.chart-stack {
  display: grid;
  gap: 10px;
  align-content: end;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.5fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
}

.chart-row strong,
.chart-row span {
  font-size: 0.82rem;
}

.chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.chart-fill {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: var(--blue);
}

.chart-fill.tone-certified {
  background: var(--green);
}

.chart-fill.tone-conditional,
.chart-fill.tone-watch {
  background: var(--blue);
}

.chart-fill.tone-blocked,
.chart-fill.tone-critical {
  background: var(--red);
}

.agent-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 96px;
}

.agent-progress span {
  display: grid;
  place-items: end center;
  min-height: 40px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.7rem;
  font-weight: 800;
}

body[data-view="learner"] .agent-progress span {
  background: var(--teal);
}

.operating-system {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  height: min(920px, calc(100vh - 170px));
  min-height: 700px;
}

body[data-chat="open"] .operating-system {
  grid-template-columns: 292px minmax(0, 1fr);
}

body[data-recording="true"][data-chat="open"] .operating-system {
  grid-template-columns: 292px minmax(0, 1fr);
}

.queue-pane,
.run-pane,
.inspector-pane {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-4);
}

.queue-pane,
.inspector-pane {
  position: static;
  display: grid;
  gap: 14px;
  min-height: 0;
  max-height: none;
  padding: 16px;
  overflow-y: auto;
}

.run-pane {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
  padding: 18px;
  border-top: 5px solid var(--blue);
  overflow-y: auto;
  scroll-margin-top: 94px;
}

.inspector-pane {
  display: none;
  grid-column: 3;
  border-top: 5px solid var(--blue);
}

body[data-screen="team"] .inspector-pane {
  display: grid;
}

body[data-screen="team"] .operating-system {
  grid-template-columns: 292px minmax(0, 1fr) minmax(340px, 400px);
}

body[data-screen="team"][data-chat="open"] .operating-system {
  grid-template-columns: 292px minmax(0, 1fr) minmax(340px, 400px);
}

body[data-screen="team"][data-chat="open"] .inspector-pane {
  grid-column: 3;
}

body[data-view="learner"] .run-pane {
  border-top-color: var(--teal);
}

.pane-heading,
.run-header,
.section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.count-chip,
.foundry-chip,
.case-chip,
.verdict-pill,
.confidence-pill,
.gate-state,
.risk-severity {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.count-chip,
.foundry-chip,
.confidence-pill {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

body[data-view="learner"] .count-chip,
body[data-view="learner"] .foundry-chip,
body[data-view="learner"] .confidence-pill {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.case-list {
  display: grid;
  gap: 8px;
}

.case-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-button {
  min-height: 31px;
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--muted);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.filter-button.active,
.filter-button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--blue);
}

body[data-view="learner"] .filter-button.active,
body[data-view="learner"] .filter-button[aria-pressed="true"] {
  background: var(--teal);
}

.case-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border-color: var(--line-soft);
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.case-button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 4px 0 0 var(--blue);
}

body[data-view="learner"] .case-button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 4px 0 0 var(--teal);
}

.case-name,
.case-role,
.case-manager {
  display: block;
}

.case-name {
  font-weight: 800;
}

.case-role {
  margin-top: 2px;
  font-size: 0.82rem;
}

.case-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.case-manager {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.tone-certified {
  color: var(--green);
  background: var(--green-soft);
}

.tone-conditional {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.tone-blocked,
.tone-critical {
  color: var(--red);
  background: var(--red-soft);
}

.tone-watch {
  color: var(--violet);
  background: var(--violet-soft);
}

.verdict-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.verdict-pill {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.84rem;
  animation: chain-pulse 2200ms ease-in-out 1;
}

.decision-summary {
  max-width: 1120px;
  margin-bottom: 0;
  font-size: 1rem;
}

.journey-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.journey-step {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 6px 10px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--subtle);
  text-align: left;
}

.journey-step.active {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.journey-step:hover {
  border-color: #b8d9f4;
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

body[data-view="learner"] .journey-step.active {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.journey-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
}

body[data-view="learner"] .journey-number {
  background: var(--teal);
}

.journey-step strong {
  align-self: center;
}

.journey-step p {
  grid-column: 2;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.38;
  display: none;
}

.agent-chain-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--blue-line);
  border-radius: 9px;
  background: #fbfdff;
}

body[data-view="learner"] .agent-chain-panel {
  border-color: var(--teal-line);
  background: #fbffff;
}

.agent-chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 2px;
  counter-reset: agent-step;
}

.agent-node {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 6px 9px;
  align-content: start;
  min-height: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body[data-view="learner"] .agent-node {
  border-left-color: var(--teal);
}

.agent-node:hover {
  border-color: #b8d9f4;
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

.agent-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

body[data-view="learner"] .agent-index {
  background: var(--teal);
}

.agent-node strong {
  margin-bottom: 0;
  font-size: 0.94rem;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.agent-node em {
  grid-column: 2;
  margin-bottom: 0;
  color: var(--blue-dark);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
}

body[data-view="learner"] .agent-node em {
  color: var(--teal-dark);
}

.agent-node p {
  grid-column: 2;
  margin-bottom: 0;
  font-size: 0.8rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.trace-proof-grid {
  grid-column: 1 / -1;
  display: none;
  gap: 6px;
  padding-top: 4px;
}

.trace-proof-grid div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: start;
  padding: 6px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--subtle);
}

.trace-proof-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.trace-proof-grid strong {
  font-size: 0.74rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.agent-node .agent-tool-call {
  display: none;
  color: var(--blue-dark);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.28;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-view="learner"] .agent-node .agent-tool-call {
  color: var(--teal-dark);
}

body[data-view="learner"] .agent-chain {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

body[data-view="learner"] .agent-node {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  min-height: 96px;
  padding: 11px;
}

body[data-view="learner"] .agent-index {
  width: 26px;
  height: 26px;
}

body[data-view="learner"] .agent-node strong,
body[data-view="learner"] .agent-node em {
  grid-column: 1;
}

body[data-view="learner"] .agent-node p,
body[data-view="learner"] .agent-node .agent-tool-call {
  display: none;
}

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

.workflow-lane {
  position: relative;
  display: grid;
  gap: 9px;
  min-height: 122px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: inset 0 -3px 0 var(--blue-line);
}

body[data-view="learner"] .workflow-lane {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8ffff 100%);
  box-shadow: inset 0 -3px 0 var(--teal-line);
}

.workflow-lane::after {
  display: none;
}

.workflow-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.74rem;
  font-weight: 800;
}

body[data-view="learner"] .workflow-index {
  background: var(--teal);
}

.workflow-lane p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.workflow-steps {
  display: grid;
  gap: 4px;
  padding-left: 17px;
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.35;
}

.decision-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  overflow: visible;
}

.ledger-column {
  min-height: 170px;
  padding: 14px;
  border-left: 1px solid var(--line-soft);
  background: var(--surface);
}

.ledger-column:first-child {
  border-left: 0;
}

.ledger-column.allow {
  box-shadow: inset 4px 0 0 var(--green);
}

.ledger-column.block {
  box-shadow: inset 4px 0 0 var(--red);
}

.ledger-column.next {
  box-shadow: inset 4px 0 0 var(--blue);
}

body[data-view="learner"] .ledger-column.next {
  box-shadow: inset 4px 0 0 var(--teal);
}

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

.plain-list li {
  padding-left: 12px;
  border-left: 3px solid var(--line);
  font-size: 0.9rem;
}

.action-ribbon {
  padding: 14px;
  border: 1px solid var(--blue-line);
  border-left: 5px solid var(--blue);
  border-radius: 9px;
  background: var(--blue-soft);
}

body[data-view="learner"] .action-ribbon {
  border-color: var(--teal-line);
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.action-ribbon strong {
  display: block;
  color: var(--blue-dark);
  line-height: 1.42;
}

body[data-view="learner"] .action-ribbon strong {
  color: var(--teal-dark);
}

.live-impact-panel {
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 176px;
  max-width: 100%;
  padding: 14px;
  border: 1px solid var(--blue-line);
  border-left: 5px solid var(--blue);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: var(--shadow-4);
  overflow: visible;
}

.decision-command-strip.live-updated,
.run-pane.live-updated,
.action-ribbon.live-updated,
.live-impact-panel.live-updated {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.18), var(--shadow-8);
}

body[data-view="learner"] .decision-command-strip.live-updated,
body[data-view="learner"] .run-pane.live-updated,
body[data-view="learner"] .action-ribbon.live-updated,
body[data-view="learner"] .live-impact-panel.live-updated {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(3, 131, 135, 0.18), var(--shadow-8);
}

body[data-agent-run="running"] .decision-command-strip,
body[data-agent-run="running"] .action-ribbon {
  animation: live-ring 1s ease-in-out infinite;
}

.live-impact-panel[hidden] {
  display: none;
}

.live-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.live-impact-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--blue-soft);
}

.live-impact-grid span {
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.live-impact-grid strong {
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

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

.score-grid div {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
}

.score-grid dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-grid dd {
  margin-bottom: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.workspace-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--subtle);
  overflow-x: auto;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  color: var(--muted);
  font-weight: 800;
}

.panel-host {
  display: grid;
  gap: 12px;
  max-height: 560px;
  padding-right: 4px;
  overflow-y: auto;
  animation: panel-in 180ms ease both;
}

.panel-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface);
  animation: panel-in 180ms ease both;
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  grid-template-rows: auto auto minmax(210px, 1fr) auto auto auto auto auto auto auto;
  align-content: stretch;
  gap: 10px;
  width: var(--chat-width);
  height: min(760px, calc(100dvh - 44px));
  max-height: calc(100dvh - 44px);
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-top: 5px solid var(--blue);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: var(--shadow-16);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  transform-origin: right bottom;
  animation: assistant-pop 180ms ease both;
}

body[data-view="learner"] .chat-panel {
  border-top-color: var(--teal);
}

.chat-panel:not(.open) {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  animation: none;
}

.chat-header,
.chat-form-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.chat-header h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.chat-header {
  order: 1;
}

.coach-context {
  order: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--blue-soft);
}

body[data-view="learner"] .coach-context {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.coach-context span {
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
}

body[data-view="learner"] .coach-context span {
  background: var(--teal);
}

.coach-context p {
  display: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.chat-run-board {
  order: 6;
  display: grid;
  gap: 8px;
  max-height: 172px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #ffffff;
  overflow-y: auto;
}

.chat-run-board:empty {
  display: none;
}

.chat-run-board.running {
  border-color: var(--blue-line);
  background: linear-gradient(90deg, #ffffff 0%, var(--blue-soft) 100%);
}

.chat-run-board.scope {
  border-color: var(--line);
  background: var(--subtle);
}

body[data-view="learner"] .chat-run-board.running {
  border-color: var(--teal-line);
  background: linear-gradient(90deg, #ffffff 0%, var(--teal-soft) 100%);
}

.chat-run-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: start;
}

.chat-run-heading .eyebrow {
  grid-column: auto;
}

.chat-run-heading small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-agent-run-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-run-board.scope .chat-agent-run-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chat-agent-run-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  justify-items: center;
  text-align: center;
  min-width: 0;
  min-height: 50px;
  padding: 7px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.chat-run-board.running .chat-agent-run-item {
  animation: agent-pulse 900ms ease-in-out infinite alternate;
}

.chat-agent-run-item:nth-child(2) {
  animation-delay: 80ms;
}

.chat-agent-run-item:nth-child(3) {
  animation-delay: 160ms;
}

.chat-agent-run-item:nth-child(4) {
  animation-delay: 240ms;
}

.chat-agent-run-item:nth-child(5) {
  animation-delay: 320ms;
}

.chat-agent-run-item:nth-child(6) {
  animation-delay: 400ms;
}

.chat-agent-run-item:nth-child(7) {
  animation-delay: 480ms;
}

.agent-run-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
}

body[data-view="learner"] .agent-run-number {
  background: var(--teal);
}

.chat-agent-run-item strong {
  align-self: center;
  font-size: 0.68rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.chat-agent-run-item p {
  display: none;
}

.chat-thread {
  order: 3;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 210px;
  max-height: 360px;
  padding: 10px 8px 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.chat-message {
  display: grid;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--subtle);
}

.chat-message.user {
  justify-self: end;
  max-width: 88%;
  color: #ffffff;
  background: var(--blue);
}

.chat-message.user p {
  color: #ffffff;
}

.chat-message.assistant {
  justify-self: start;
  width: 100%;
  border-left: 4px solid var(--blue);
}

body[data-view="learner"] .chat-message.user {
  background: var(--teal);
}

body[data-view="learner"] .chat-message.assistant {
  border-left-color: var(--teal);
}

.chat-message p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.chat-message-body {
  display: grid;
  gap: 5px;
}

.chat-message-body p {
  margin: 0;
}

.chat-labelled-line {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.chat-labelled-line span {
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-labelled-line strong {
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chat-truncation-note {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--blue-dark);
}

.chat-cards {
  order: 7;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-cards:empty,
.chat-actions:empty,
.chat-grounding:empty,
.assistive-note {
  display: none;
}

.chat-card {
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.chat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 0.92rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-actions {
  order: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  max-height: 154px;
  overflow-y: auto;
  padding-right: 3px;
}

.suggested-prompts {
  order: 4;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  max-height: 38px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.chat-action-card {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: var(--blue-soft);
}

.chat-action-card span {
  color: var(--blue-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-action-card strong {
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

body[data-view="learner"] .chat-action-card {
  border-color: var(--teal-line);
  background: var(--teal-soft);
}

body[data-view="learner"] .chat-action-card span {
  color: var(--teal-dark);
}

.suggested-prompts button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--blue-line);
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--blue-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

body[data-view="learner"] .suggested-prompts button {
  border-color: var(--teal-line);
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.chat-grounding {
  order: 10;
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.chat-grounding:empty {
  display: none;
}

.chat-grounding div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}

.chat-grounding span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-grounding strong {
  font-size: 0.74rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chat-impact {
  order: 9;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.chat-impact:empty {
  display: none;
}

.chat-impact article {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: #ffffff;
}

.chat-impact span {
  color: var(--blue-dark);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-impact strong {
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chat-form {
  order: 5;
  display: grid;
  gap: 9px;
}

.chat-form textarea {
  width: 100%;
  min-height: 52px;
  resize: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  line-height: 1.4;
}

.assistive-note {
  order: 11;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.38;
}

.assistive-note {
  display: none;
}

body[data-contrast="high"] {
  --text: #000000;
  --muted: #222222;
  --page: #ffffff;
  --line: #000000;
  --line-soft: #6b6b6b;
  --blue: #004578;
  --blue-dark: #003966;
  --teal: #005e5e;
  --red: #a80000;
  --green: #0b6a0b;
  --violet: #4b1f73;
}

body[data-reading="guided"] .accessibility-status {
  border-color: var(--blue);
  background: var(--blue-soft);
}

body[data-reading="guided"] .mission-panel,
body[data-reading="guided"] .decision-command-strip {
  border-color: var(--blue-line);
}

body[data-contrast="high"] .command-bar,
body[data-contrast="high"] .mission-panel,
body[data-contrast="high"] .decision-command-strip,
body[data-contrast="high"] .dashboard-card,
body[data-contrast="high"] .queue-pane,
body[data-contrast="high"] .run-pane,
body[data-contrast="high"] .inspector-pane,
body[data-contrast="high"] .chat-panel,
body[data-contrast="high"] .panel-section,
body[data-contrast="high"] .learning-support-panel {
  border-color: #000000;
  background: #ffffff;
  box-shadow: none;
}

body[data-contrast="high"] .accessibility-status,
body[data-contrast="high"] .data-source-badge,
body[data-contrast="high"] .chat-engine-badge,
body[data-contrast="high"] .foundry-chip,
body[data-contrast="high"] .case-chip,
body[data-contrast="high"] .verdict-pill,
body[data-contrast="high"] .confidence-pill {
  color: #000000;
  border-color: #000000;
  background: #ffffff;
}

body[data-contrast="high"] .view-button.active,
body[data-contrast="high"] .view-button[aria-pressed="true"],
body[data-contrast="high"] .tab-button.active,
body[data-contrast="high"] .icon-action[aria-pressed="true"],
body[data-contrast="high"] .assistant-trigger,
body[data-contrast="high"] .chat-fab {
  color: #ffffff;
  border-color: #000000;
  background: #000000;
}

body[data-contrast="high"] .assistive-note,
body[data-reading="guided"] .assistive-note {
  display: block;
}

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

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

.gate-card {
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--subtle);
}

.gate-card.fail {
  border-top-color: var(--red);
}

.gate-card.warn {
  border-top-color: var(--violet);
}

.gate-card.pass {
  border-top-color: var(--green);
}

.gate-card h4 {
  margin: 10px 0 6px;
  font-size: 0.92rem;
}

.gate-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.risk-list,
.source-list,
.audit-list,
.manager-queue-list,
.mini-queue {
  display: grid;
  gap: 9px;
}

.risk-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.risk-item h4 {
  margin: 8px 0 4px;
}

.risk-owner,
.risk-fix {
  font-weight: 800;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.78fr) minmax(0, 1.35fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.source-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-row p {
  margin-bottom: 0;
}

.audit-step {
  display: grid;
  grid-template-columns: 34px minmax(130px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.audit-step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
}

.audit-step p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.control-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.control-card.active {
  border-color: #cfe4fa;
  background: var(--blue-soft);
}

.control-card input {
  margin-top: 3px;
  accent-color: var(--blue);
}

.control-card span,
.control-card strong,
.control-card em {
  display: block;
}

.control-card span span {
  margin: 5px 0 8px;
  color: var(--muted);
}

.control-card em {
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

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

.team-metrics div {
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--subtle);
}

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

.team-metrics span {
  font-size: 0.8rem;
  font-weight: 800;
}

.team-metrics strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 2rem;
}

.manager-queue-item {
  display: grid;
  grid-template-columns: auto minmax(140px, 0.48fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.manager-queue-item p {
  margin-bottom: 0;
}

.mini-queue .manager-queue-item {
  grid-template-columns: 1fr;
}

.intelligence-stack {
  display: grid;
  gap: 8px;
}

.intelligence-stack article {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--subtle);
}

.intelligence-stack strong,
.intelligence-stack span {
  display: block;
}

.intelligence-stack span {
  margin-top: 4px;
  font-size: 0.86rem;
}

.learner-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.learner-action-grid article {
  min-height: 112px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--subtle);
}

.learner-action-grid strong {
  display: block;
  margin-bottom: 6px;
}

.learner-action-grid p {
  margin-bottom: 0;
}

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

.plan-list li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.plan-day {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

.plan-copy strong {
  display: block;
  margin-bottom: 4px;
}

.plan-copy p {
  margin-bottom: 0;
}

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

.practice-card {
  min-height: 154px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--subtle);
}

.practice-number {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 26px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
}

.practice-card h4 {
  margin: 12px 0 7px;
}

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

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

.rule-list li {
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.authority-list {
  margin-top: 4px;
}

.learner-boundary {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #c7eeee;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
}

.learner-boundary strong,
.learner-boundary span {
  display: block;
}

.learner-boundary span {
  color: var(--teal-dark);
  line-height: 1.45;
}

.rule-list strong,
.rule-list span {
  display: block;
}

.rule-list span {
  margin-top: 5px;
}

.inspector-pane {
  border-top: 5px solid var(--blue);
}

body[data-view="learner"] .inspector-pane {
  border-top-color: var(--teal);
}

.role-panel-copy {
  margin-bottom: 0;
}

.metadata-list,
.definition-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.metadata-list div,
.definition-list div {
  display: grid;
  grid-template-columns: minmax(94px, 0.55fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--subtle);
}

.definition-list div {
  grid-template-columns: minmax(116px, 0.65fr) minmax(0, 1fr);
}

.metadata-list dt,
.definition-list dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metadata-list dd,
.definition-list dd {
  margin-bottom: 0;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inspector-pane .metadata-list div {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.distribution-chart {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.distribution-bar {
  display: flex;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--subtle);
}

.distribution-bar span {
  min-width: 12px;
}

.distribution-bar .tone-certified {
  background: var(--green);
}

.distribution-bar .tone-conditional {
  background: var(--blue);
}

.distribution-bar .tone-blocked {
  background: var(--red);
}

.distribution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.distribution-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.distribution-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.distribution-legend i.tone-certified {
  background: var(--green);
}

.distribution-legend i.tone-conditional {
  background: var(--blue);
}

.distribution-legend i.tone-blocked {
  background: var(--red);
}

.distribution-legend strong {
  color: var(--text);
}

.distribution-legend em {
  font-style: normal;
}

.agent-node:hover,
.ledger-column:hover,
.gate-card:hover,
.risk-item:hover,
.source-row:hover,
.audit-step:hover,
.control-card:hover,
.team-metrics div:hover,
.manager-queue-item:hover,
.learner-action-grid article:hover,
.learning-card:hover,
.practice-card:hover,
.rule-list li:hover,
.intelligence-stack article:hover {
  border-color: #b8d9f4;
  box-shadow: var(--shadow-4);
  transform: translateY(-1px);
}

.ledger-column,
.gate-card,
.risk-item,
.source-row,
.audit-step,
.control-card,
.team-metrics div,
.manager-queue-item,
.learner-action-grid article,
.learning-card,
.practice-card,
.rule-list li,
.intelligence-stack article {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

@media (max-width: 1500px) {
  .workspace-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .module-chart-card,
  .glossary-card {
    grid-column: span 3;
  }

  .operating-system {
    grid-template-columns: 272px minmax(0, 1fr);
    height: calc(100vh - 260px);
  }

  body[data-chat="open"] .operating-system {
    grid-template-columns: 272px minmax(0, 1fr);
  }

  body[data-screen="team"] .operating-system {
    grid-template-columns: 252px minmax(0, 1fr) minmax(320px, 380px);
  }

  body[data-screen="team"][data-chat="open"] .operating-system {
    grid-template-columns: 252px minmax(0, 1fr) minmax(320px, 380px);
  }

  .queue-pane {
    position: static;
    max-height: none;
    overflow-y: auto;
  }

  .chat-panel {
    position: fixed;
    grid-column: auto;
    max-height: calc(100dvh - 44px);
  }

  .inspector-pane {
    position: static;
    grid-column: 3;
    max-height: none;
  }

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

  body[data-view="learner"] .agent-chain {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

}

@media (max-width: 1120px) {
  .workspace-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-bar,
  .mission-panel,
  .workspace-nav,
  .decision-command-strip,
  .command-proof-grid,
  .dashboard-grid,
  .learning-support-grid,
  .operating-system {
    grid-template-columns: 1fr;
  }

  .module-chart-card,
  .glossary-card {
    grid-column: auto;
  }

  .mode-summary {
    justify-self: start;
    text-align: left;
  }

  .queue-pane {
    position: static;
    max-height: none;
  }

  .operating-system {
    height: auto;
  }

  .chat-panel {
    grid-column: auto;
    height: min(760px, calc(100dvh - 44px));
    max-height: calc(100dvh - 44px);
  }

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

  .decision-ledger,
  .score-grid,
  .role-strip,
  .workflow-map,
  .source-row,
  .risk-item,
  .manager-queue-item {
    grid-template-columns: 1fr;
  }

  .ledger-column {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .ledger-column:first-child {
    border-top: 0;
  }

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

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .command-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .command-bar,
  .product-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-right: 14px;
    padding-left: 14px;
    overflow-x: hidden;
  }

  .command-bar,
  .brand-lockup,
  .mode-summary,
  .mission-panel,
  .learning-support-panel,
  .operating-system,
  .run-pane,
  .queue-pane,
  .chat-panel,
  .inspector-pane,
  .agent-chain-panel,
  .decision-ledger,
  .score-grid,
  .panel-host,
  .system-metrics article,
  .case-button,
  .agent-node,
  .workflow-lane,
  .panel-section {
    min-width: 0;
    max-width: 100%;
  }

  .mission-panel,
  .decision-command-strip,
  .command-proof-grid,
  .operating-system,
  .role-strip,
  .learning-support-grid,
  .journey-board,
  .agent-chain,
  .workflow-map,
  .decision-ledger,
  .score-grid,
  .gate-list,
  .control-grid,
  .team-metrics,
  .learner-action-grid,
  .practice-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .decision-command-strip {
    order: -1;
  }

  .mode-summary {
    justify-self: stretch;
    width: 100%;
  }

  .mode-summary span,
  .mission-copy p,
  .system-metrics small,
  .case-name,
  .case-role,
  .plain-list li,
  .decision-summary {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: 1.38rem;
  }

  .view-switch {
    width: 100%;
  }

  .command-actions {
    width: 100%;
  }

  .icon-action,
  .assistant-trigger {
    flex: 1 1 auto;
  }

  .view-button {
    flex: 1 1 0;
    min-width: 0;
  }

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

  .dashboard-card {
    min-height: 0;
  }

  .learning-support-panel {
    padding: 14px;
  }

  .learning-card {
    min-height: 0;
  }

  .support-chart-row,
  .access-list {
    grid-template-columns: 1fr;
  }

  .run-pane {
    scroll-margin-top: 216px;
  }

  .workspace-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tab-button {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .mission-panel,
  .run-pane,
  .queue-pane,
  .chat-panel,
  .inspector-pane {
    padding: 14px;
  }

  .system-metrics,
  .case-list {
    grid-template-columns: 1fr;
  }

  .system-metrics article {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 70px;
  }

  .system-metrics strong {
    min-height: 44px;
    font-size: 1.24rem;
  }

  .system-metrics small {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .case-button,
  .run-header,
  .pane-heading,
  .section-heading {
    display: grid;
  }

  .case-meta,
  .verdict-stack {
    justify-items: start;
    justify-content: flex-start;
  }

  .plan-list li,
  .audit-step,
  .metadata-list div,
  .definition-list div {
    grid-template-columns: 1fr;
  }

  .plan-day,
  .audit-step-number {
    width: fit-content;
    min-width: 58px;
  }

  .chat-panel {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: min(720px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
    grid-template-rows: auto auto minmax(220px, 1fr) auto auto auto auto auto auto auto;
  }

  .chat-fab {
    display: grid;
    top: auto;
    right: 16px;
    bottom: 16px;
    min-width: 156px;
  }

  .product-shell {
    padding-bottom: 96px;
  }

  .chat-thread {
    min-height: 220px;
  }

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

  .live-impact-panel,
  .live-impact-grid,
  .live-impact-grid article {
    width: 100%;
    max-width: 100%;
  }

  .live-impact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-agent-run-item {
    min-height: 92px;
  }

  .chat-agent-run-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .chat-impact {
    grid-template-columns: 1fr;
  }
}

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