﻿@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
  --bg: #ffffff;
  --bg-soft: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563a8;
  --brand-press: #1d4f8a;
  --ok: #1e9e6a;
  --warn: #d97706;
  --risk: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 41, 55, 0.04), 0 8px 18px rgba(31, 41, 55, 0.05);
  --font: "Manrope", "Inter", "PT Root UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

.login-body {
  min-height: 100%;
  overflow: auto;
  background: #1a1a1a;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  border: 1px solid #2a3848;
  border-radius: 8px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.login-brand {
  margin-bottom: 22px;
  color: var(--ink);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.login-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: #ffffff;
  text-transform: none;
}

.login-error {
  min-height: 20px;
  color: var(--risk);
  font-size: 13px;
}

.login-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

button,
textarea,
select {
  font: inherit;
}

input {
  font: inherit;
}

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

.sidebar {
  background: #1a1a1a;
  color: #f5f7fa;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  min-height: 0;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563a8, #1e9e6a);
  font-weight: 800;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  color: #a7b2c0;
  font-size: 12px;
}

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

.expertise-switcher {
  border-top: 1px solid #2a3848;
  border-bottom: 1px solid #2a3848;
  padding: 14px 0;
}

.expertise-list {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.expertise-search {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.expertise-search span {
  color: #8fa0b2;
  font-size: 11px;
  font-weight: 700;
}

.expertise-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d8dee7;
  border-radius: 8px;
  padding: 8px 10px;
  color: #121821;
  background: #ffffff;
  outline: none;
}

.expertise-search input::placeholder {
  color: #657184;
}

.expertise-search input:focus {
  border-color: #4b8fd7;
  box-shadow: 0 0 0 3px rgba(75, 143, 215, 0.18);
}

.expertise-empty {
  border: 1px dashed #d8dee7;
  border-radius: 8px;
  padding: 10px;
  color: #647084;
  background: #fafbfc;
  font-size: 12px;
  line-height: 1.35;
}

.expertise-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 56px;
  text-align: left;
  border: 1px solid #2a3848;
  border-radius: 8px;
  padding: 9px 10px;
  color: #e9eef5;
  background: #15202c;
  cursor: pointer;
}

.expertise-item:hover,
.expertise-item.active {
  border-color: #3d6681;
  background: #203246;
}

.expertise-item span,
.expertise-item small {
  overflow-wrap: anywhere;
}

.expertise-item span {
  font-weight: 700;
}

.expertise-item small {
  color: #a7b2c0;
  font-size: 11px;
  line-height: 1.3;
}

.nav-item {
  min-height: 38px;
  text-align: left;
  border: 1px solid transparent;
  color: #dce4ed;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #1d2a38;
  border-color: #2d4054;
  color: #ffffff;
}

.status-block {
  border-top: 1px solid #2a3848;
  padding-top: 14px;
}

.status-label {
  color: #9aa8b7;
  font-size: 12px;
  text-transform: uppercase;
}

.status-value {
  margin-top: 4px;
  color: #f5f7fa;
  font-size: 13px;
}

.workspace {
  height: 100vh;
  min-height: 0;
  padding: 24px;
  min-width: 0;
  max-width: 1480px;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 3px;
  font-size: 28px;
}

h2 {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.pipeline-stepper {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  max-width: 760px;
}

.pipeline-step {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #ffffff;
  color: #526170;
  font-size: 12px;
}

.pipeline-step.done {
  border-color: #9bc5bd;
  background: #eef8f5;
  color: #0f5f58;
}

.pipeline-step.active {
  border-color: var(--brand);
  background: #eef6fd;
  color: var(--ink);
  font-weight: 800;
}

.user-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 4px 4px 10px;
  background: #ffffff;
  color: var(--muted);
}

.status-control {
  display: grid;
  gap: 4px;
  min-width: 170px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  text-transform: none;
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  background: var(--surface);
}

.button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.button.large {
  min-height: 52px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 800;
}

.button.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button.secondary:hover,
.button.primary:hover {
  filter: brightness(0.96);
}

.view {
  display: none;
  min-height: 0;
}

.view.active {
  display: block;
  overflow: visible;
  padding-right: 6px;
  padding-bottom: 12px;
}

.app-notice {
  flex: 0 0 auto;
  display: none;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
  color: var(--ink);
}

.app-notice.visible {
  display: block;
}

.app-notice.success {
  border-color: #9bc5bd;
  background: #eef8f5;
}

.app-notice.error {
  border-color: #d9a3aa;
  background: #fff5f6;
}

.deal-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.deal-action-status,
.health-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.deal-action-status {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(138, 100, 0, 0.12);
}

.health-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.health-dot.warn {
  background: var(--warn);
}

.deal-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 520px);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid #cfd9e4;
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.command-center[hidden] {
  display: none;
}

.compact-create {
  animation: panelReveal 160ms ease-out;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.command-center h2 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 22px;
}

.command-center p {
  color: var(--muted);
}

.intake-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.project-name-field {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.project-name-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: #ffffff;
  text-transform: none;
}

.project-name-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
  text-transform: none;
}

.project-name-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34, 111, 181, 0.12);
  outline: none;
}

.project-name-field.compact {
  margin: 0;
}

.project-name-field input:disabled {
  background: #f0f3f6;
  color: var(--muted);
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.file-pick-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px dashed #8ba9c4;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbfd;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.intake-form .file-pick-card {
  grid-column: 1 / -1;
}

.file-pick-card:hover,
.file-pick-card:focus-visible {
  border-color: var(--brand);
  background: #f3f8fd;
  box-shadow: 0 0 0 3px rgba(34, 111, 181, 0.12);
  outline: none;
}

.file-pick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.file-pick-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.file-pick-card-main .file-pick-action {
  min-width: 170px;
}

.intake-form .button.large {
  width: 100%;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.director-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.director-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.director-metric {
  display: grid;
  gap: 6px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.director-metric span {
  color: var(--muted);
  font-size: 12px;
}

.director-metric strong {
  color: var(--ink);
  font-size: 20px;
}

.director-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 12px;
  min-width: 0;
}

.director-wide {
  grid-row: span 2;
}

.director-queue {
  display: grid;
  gap: 8px;
}

.director-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main action"
    "meta action";
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfd;
  min-width: 0;
}

.director-row.active {
  border-color: #9fbfda;
  background: #f4f9fd;
}

.director-row.urgent {
  border-color: #d8b562;
  background: #fffaf0;
}

.director-row-main {
  grid-area: main;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.director-row-main strong,
.director-row-main span {
  overflow-wrap: anywhere;
}

.director-row-main span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.director-row-meta {
  grid-area: meta;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.director-row > .button {
  grid-area: action;
}

.director-row-meta span,
.director-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #c9d5e1;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

.director-current {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.director-current-score {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.director-current-score > strong {
  font-size: 22px;
}

.director-current-score .decision-badge {
  max-width: 100%;
}

.director-facts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.director-gap-block {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.director-gap-block p {
  color: var(--muted);
}

.director-risk-list {
  max-height: none;
}

.model-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
  min-width: 0;
}

.model-wide {
  grid-row: span 3;
}

.formula-badge,
.state-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border: 1px solid #c9d5e1;
  border-radius: 999px;
  padding: 4px 9px;
  background: #f7fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-pill.positive {
  border-color: #8ec8be;
  background: #edf8f5;
  color: #0d5f57;
}

.state-pill.warning {
  border-color: #dcc17a;
  background: #fff8e6;
  color: #6e5200;
}

.state-pill.negative {
  border-color: #d6a2a8;
  background: #fff4f5;
  color: var(--risk);
}

.risk-model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.model-kpi {
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.model-kpi span,
.model-kpi small,
.fact-list span,
.sensitivity-row span,
.council-agent span {
  color: var(--muted);
}

.model-kpi span,
.fact-list span {
  font-size: 12px;
  text-transform: uppercase;
}

.model-kpi strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.model-kpi small {
  font-size: 12px;
  line-height: 1.35;
}

.sensitivity-list,
.deal-economics,
.valuation-sanity,
.ic-gate,
.science-council {
  display: grid;
  gap: 10px;
}

.sensitivity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.sensitivity-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sensitivity-row strong {
  overflow-wrap: anywhere;
}

.sensitivity-bars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sensitivity-bars span {
  display: inline-flex;
  min-height: 26px;
  border: 1px solid #c9d5e1;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f7fafc;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
}

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

.fact-list div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.fact-list strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.council-agent {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.council-agent strong {
  color: var(--ink);
}

.council-agent p {
  color: var(--ink);
}

.council-agent span {
  font-size: 13px;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.decision-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid #d6a2a8;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff4f5;
  color: var(--risk);
  font-size: 13px !important;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-badge.warning {
  border-color: #dcc17a;
  background: #fff8e6;
  color: #6e5200;
}

.decision-badge.positive {
  border-color: #8ec8be;
  background: #edf8f5;
  color: #0d5f57;
}

.panel {
  padding: 18px;
  margin-bottom: 12px;
  min-width: 0;
}

.accent-red {
  border-color: #d7a2a9;
  background: #fffafa;
}

.accent-gold {
  border-color: #dbc37d;
  background: #fffdf5;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
}

.data-room-layout {
  height: 100%;
  min-height: 0;
}

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

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

.compact-list {
  margin: 0;
  padding-left: 18px;
}

.compact-list li {
  margin-bottom: 8px;
  line-height: 1.55;
}

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

.roadmap-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

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

.readiness-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffaf0;
}

.readiness-item.ok {
  border-color: #9bc5bd;
  background: #eef8f5;
}

.readiness-item.missing {
  border-color: #d9a3aa;
  background: #fff5f6;
}

.readiness-item span {
  color: var(--muted);
  font-size: 13px;
}

.table-host {
  overflow-x: auto;
}

.score-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.score-bar-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #fbfcfd;
}

.score-bar-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.score-bar-meta strong {
  color: var(--ink);
}

.score-bar-meta span {
  color: var(--muted);
  font-weight: 700;
}

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

.score-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
}

.score-bar-card.weak .score-fill {
  background: var(--risk);
}

.score-bar-card.medium .score-fill {
  background: var(--warn);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--surface-2);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 12px;
  height: auto;
  min-height: 0;
}

.chat-panel {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

#chat.view.active,
#documents.view.active,
#reports.view.active {
  overflow: visible;
}

.chat-layout > .panel,
.data-room-layout > .panel,
#reports.view.active > .panel {
  min-height: 0;
}

.chat-layout > .panel:not(.chat-panel),
.data-room-layout > .panel,
#reports.view.active > .panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
}

.chat-log {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  overflow: auto;
  min-height: 360px;
  max-height: calc(100vh - 360px);
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.prompt-rail {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
}

.chip-button {
  min-height: 34px;
  border: 1px solid #c9d5e1;
  border-radius: 999px;
  padding: 6px 11px;
  background: #f7fafc;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.chip-button:hover {
  border-color: var(--brand);
  background: #eef6fd;
}

.msg {
  max-width: 86%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.msg.user {
  margin-left: auto;
  background: #e7f0fa;
}

.msg.assistant {
  background: #eef7f4;
}

.chat-form,
.note-form,
.builder-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.panel-heading h2 {
  margin-bottom: 0;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: white;
}

.notes-list {
  flex: 1 1 auto;
  margin-top: 12px;
  display: grid;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.upload-form {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.upload-mode {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-mode label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: white;
}

input[type="file"] {
  min-height: 38px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: white;
}

.documents-list {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 160px;
  padding-right: 2px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.checklist strong {
  color: var(--ink);
}

.checklist span {
  color: var(--muted);
  font-size: 13px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.document-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.document-row a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.reports-list {
  flex: 1 1 auto;
  display: grid;
  gap: 10px;
  overflow: auto;
  min-height: 260px;
  padding-right: 2px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.report-row.latest {
  border-color: #9fbfda;
  background: #f7fbff;
}

.report-row.compact {
  box-shadow: none;
}

.report-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.report-date-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #8ec8be;
  border-radius: 999px;
  padding: 3px 8px;
  background: #edf8f5;
  color: #0d5f57;
  font-size: 12px;
  font-weight: 800;
}

.report-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.report-history summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.report-history-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.empty-state {
  border: 1px dashed #a9b9c8;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
  color: var(--muted);
}

.report-main div {
  overflow-wrap: anywhere;
}

.report-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-links a,
.artifact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #c9d5e1;
  border-radius: 8px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

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

.report-links.wide {
  justify-content: flex-start;
  margin-top: 12px;
}

#reports.view.active > .panel {
  height: auto;
}

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

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

.settings-form .button,
.settings-form .checkbox-line {
  grid-column: 1 / -1;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--muted);
}

.settings-wide {
  grid-column: 1 / -1;
}

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

.settings-list div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.settings-list span {
  color: var(--muted);
}

.settings-list strong {
  overflow-wrap: anywhere;
}

.command-box {
  border: 1px solid #c9d5e1;
  border-radius: 8px;
  padding: 11px 12px;
  background: #1a1a1a;
  color: #f5f7fa;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.compact-output {
  max-height: 260px;
}

.plan-output {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  white-space: pre-wrap;
  overflow: auto;
  max-height: 520px;
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .view.active,
  #chat.view.active,
  #documents.view.active,
  #reports.view.active {
    overflow: visible;
  }

  .metrics-grid,
  .director-head,
  .director-metrics,
  .director-grid,
  .model-grid,
  .two-col,
  .three-col,
  .overview-grid,
  .council-grid,
  .settings-grid,
  .roadmap,
  .chat-layout,
  .deal-action-bar,
  .command-center {
    grid-template-columns: 1fr;
  }

  .model-wide {
    grid-row: auto;
  }

  .sensitivity-row,
  .fact-list {
    grid-template-columns: 1fr;
  }

  .sensitivity-bars {
    justify-content: flex-start;
  }

  .deal-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .deal-action-buttons {
    justify-content: flex-start;
  }

  .settings-wide {
    grid-column: auto;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .report-row {
    display: grid;
  }

  .director-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "meta"
      "action";
  }

  .report-links {
    justify-content: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .intake-form {
    grid-template-columns: 1fr;
  }

  .file-pick-card {
    grid-template-columns: 1fr;
  }

  .file-pick-action {
    width: 100%;
  }

  .chat-layout,
  .chat-panel {
    height: auto;
    min-height: 0;
  }

  .data-room-layout,
  #reports.view.active > .panel {
    height: auto;
  }

  .chat-log {
    height: 420px;
    flex: none;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .compact-create {
    animation: none;
  }
}

body {
  background: var(--bg-soft);
  color: var(--ink);
}

h1 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

h3 {
  color: var(--ink-soft);
  font-weight: 800;
}

.eyebrow,
.status-label,
.metric span,
.model-kpi span,
.director-metric span,
.fact-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-shell {
  background: var(--bg-soft);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.brand-mark {
  border-radius: 10px;
  background: var(--brand);
  color: #ffffff;
}

.brand-title {
  color: var(--ink);
}

.brand-subtitle,
.expertise-item small {
  color: var(--muted);
}

.expertise-switcher,
.status-block {
  border-color: var(--line);
}

.expertise-item {
  border-color: var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-2);
}

.expertise-item:hover,
.expertise-item.active {
  border-color: rgba(232, 52, 42, 0.45);
  background: #fff7f6;
}

.nav-item {
  min-height: 42px;
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(232, 52, 42, 0.28);
  background: #fff7f6;
  color: var(--brand);
  font-weight: 800;
}

.workspace {
  max-width: none;
  padding: 22px 24px;
}

.topbar,
.deal-action-bar,
.command-center,
.metric,
.panel,
.director-metric,
.model-kpi,
.score-bar-card,
.roadmap-item,
.readiness-item,
.document-row,
.report-row,
.checklist div,
.settings-list div,
.director-row,
.director-gap-block,
.council-agent,
.sensitivity-row,
.fact-list div {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  margin-bottom: 12px;
}

.deal-action-bar,
.command-center,
.panel,
.metric {
  background: var(--surface);
}

.panel,
.metric,
.director-metric,
.model-kpi,
.overview-score-panel,
.overview-deal-panel,
.director-head {
  position: relative;
  overflow: hidden;
}

.panel::before,
.metric::before,
.director-metric::before,
.model-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
}

.metric,
.director-metric,
.model-kpi {
  height: 100%;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 18px 18px 20px;
  background: var(--surface);
}

.metric strong,
.director-metric strong,
.model-kpi strong {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.metrics-grid,
.director-metrics,
.risk-model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: stretch;
  gap: 12px;
}

.director-head {
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1.45fr);
}

.director-grid,
.model-grid,
.chat-layout,
.data-room-layout,
.settings-grid,
.overview-grid {
  gap: 14px;
}

.case-screen {
  min-height: 0;
}

@media (min-width: 1280px) {
  #overview.view.active {
    min-height: calc(100vh - 160px);
  }

  .case-screen {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    min-height: calc(100vh - 178px);
  }

  .overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
    grid-auto-rows: minmax(130px, auto);
    align-items: stretch;
  }

  .overview-grid > .panel {
    margin-bottom: 0;
  }

  .overview-score-panel {
    grid-row: span 2;
  }

  .overview-deal-panel {
    grid-row: span 1;
  }

  .details-panel {
    margin-top: 12px;
  }
}

.button,
.artifact-button,
.chip-button,
.file-pick-action,
.pipeline-step,
.user-chip,
.status-control select,
.project-name-field input,
.project-name-field select,
textarea,
.upload-mode label {
  border-radius: var(--radius);
}

.button.primary,
.artifact-button.primary,
.file-pick-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.button.primary:hover,
.artifact-button.primary:hover,
.file-pick-action:hover {
  background: var(--brand-press);
}

.button.secondary,
.artifact-button,
.chip-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.chip-button {
  min-height: 38px;
  color: var(--brand);
  font-weight: 800;
}

.link-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pipeline-step.active {
  border-color: var(--brand);
  background: #fff7f6;
  color: var(--brand);
}

.pipeline-step.done {
  border-color: rgba(30, 158, 106, 0.35);
  background: #f1fbf7;
  color: var(--ok);
}

.health-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(30, 158, 106, 0.14);
}

.health-dot.warn,
.score-bar-card.medium .score-fill {
  background: var(--warn);
}

.decision-badge {
  max-width: 100%;
  border-color: rgba(232, 52, 42, 0.35);
  background: #fff6f5;
  color: var(--brand);
  white-space: normal;
  text-wrap: pretty;
}

.decision-badge.warning {
  border-color: rgba(230, 167, 0, 0.35);
  background: #fff9e8;
  color: #7a5a00;
}

.decision-badge.positive {
  border-color: rgba(30, 158, 106, 0.35);
  background: #effbf6;
  color: var(--ok);
}

.accent-red {
  border-color: rgba(232, 52, 42, 0.28);
  background: #fffafa;
}

.accent-gold {
  border-color: rgba(230, 167, 0, 0.28);
  background: #fffdf4;
}

.chart-box {
  min-height: 180px;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chart-box svg {
  max-width: 100%;
  height: auto;
}

.radar-box {
  min-height: 260px;
}

.waterfall-box,
.tornado-box {
  min-height: 190px;
}

.gauge-box,
.donut-box {
  min-height: 170px;
}

.compact-chart {
  min-height: 128px;
  margin: -8px 0 6px;
}

.flag-lights,
.what-if-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.flag-light,
.what-if-result article {
  display: grid;
  gap: 4px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-2);
}

.flag-light span,
.what-if-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flag-light strong,
.what-if-result strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.flag-light.risk strong,
.flag-light.negative strong {
  color: var(--brand);
}

.flag-light.ok strong,
.flag-light.positive strong {
  color: var(--ok);
}

.flag-light.warning strong {
  color: #7a5a00;
}

.deal-snapshot,
.what-if-simulator {
  display: grid;
  gap: 12px;
}

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

.deal-blockers {
  max-height: 120px;
  overflow: auto;
}

.model-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 12px;
}

.model-visual-grid > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.score-detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}

.highlighted-row {
  outline: 2px solid rgba(232, 52, 42, 0.45);
  outline-offset: -2px;
  background: #fff7f6;
}

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

.details-panel {
  padding: 0;
}

.details-panel::before {
  display: none;
}

.details-panel summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 16px 18px 16px 22px;
  color: var(--ink);
  font-weight: 800;
}

.details-panel summary::marker {
  color: var(--brand);
}

.details-panel > :not(summary) {
  margin: 0 18px 18px;
}

.what-if-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.what-if-controls {
  display: grid;
  gap: 10px;
}

.what-if-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #ffffff;
}

.what-if-row span {
  display: grid;
  gap: 2px;
}

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

.what-if-row input[type="range"] {
  accent-color: var(--brand);
  width: 100%;
}

.mobile-menu-button {
  display: none;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--brand);
  font-weight: 800;
}

.report-links a,
.artifact-button,
.document-row a {
  color: var(--brand);
  font-weight: 800;
}

.report-links a::after,
.artifact-button::after,
.document-row a::after {
  content: " →";
}

.artifact-button.primary::after {
  color: #ffffff;
}

@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    height: 100vh;
    transform: translateX(-104%);
    transition: transform 180ms ease-out;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    padding: 14px;
    overflow: visible;
  }

  .topbar,
  .deal-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .deal-action-buttons {
    justify-content: flex-start;
  }

  .metrics-grid,
  .director-metrics,
  .risk-model-cards,
  .overview-grid,
  .model-grid,
  .director-grid,
  .two-col,
  .council-grid,
  .settings-grid,
  .chat-layout,
  .roadmap,
  .model-visual-grid,
  .score-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .director-head,
  .command-center,
  .deal-action-bar {
    grid-template-columns: 1fr;
  }

  .model-wide,
  .director-wide {
    grid-row: auto;
  }

  .button,
  .chip-button,
  .artifact-button,
  .file-pick-action {
    min-height: 44px;
  }

  .chat-log {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .metrics-grid,
  .director-metrics,
  .risk-model-cards,
  .overview-grid,
  .model-grid,
  .director-grid,
  .two-col,
  .council-grid,
  .settings-grid,
  .chat-layout,
  .roadmap,
  .model-visual-grid,
  .score-detail-grid,
  .fact-list,
  .compact-facts,
  .what-if-row,
  .what-if-result,
  .flag-lights {
    grid-template-columns: 1fr;
  }

  .panel,
  .metric,
  .director-metric,
  .model-kpi {
    padding: 16px 16px 16px 18px;
  }

  .report-row,
  .document-row {
    display: grid;
  }

  .report-links,
  .deal-action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .report-links a,
  .artifact-button,
  .button,
  .chip-button {
    width: 100%;
  }

  .decision-badge {
    width: 100%;
    justify-content: center;
  }

  .radar-box {
    min-height: 230px;
  }
}

#overview.view.active {
  display: block;
}

#overview .case-screen {
  display: grid;
  gap: 12px;
  min-height: 0;
}

#overview .metrics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

#overview .metric {
  min-height: 92px;
  height: 92px;
  padding: 12px 12px 12px 16px;
}

#overview .metric strong {
  font-size: 16px;
  letter-spacing: 0;
}

#overview .verdict-metric .decision-badge {
  align-self: flex-start;
  max-width: 100%;
  max-height: 58px;
  overflow: hidden;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.15;
}

#overview .overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 12px;
  align-items: stretch;
}

#overview .overview-score-panel,
#overview .overview-deal-panel,
#overview .overview-flags-panel {
  grid-row: auto;
  margin-bottom: 0;
}

#overview .overview-score-panel,
#overview .overview-deal-panel,
#overview .overview-flags-panel {
  padding: 14px;
}

.overview-right-stack {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-width: 0;
}

#overview .panel-heading {
  min-height: 28px;
}

#overview .radar-box {
  height: clamp(198px, 25vh, 240px);
  min-height: 198px;
}

#overview .flag-lights {
  margin-top: 8px;
}

#overview .flag-light {
  min-height: 50px;
  padding: 8px;
}

#overview .overview-deal-panel .compact-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#overview .overview-deal-panel .compact-facts > div {
  min-height: 50px;
}

.deal-blockers {
  margin-top: 8px;
  max-height: 64px;
  overflow: auto;
}

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

.flag-columns h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.flag-columns .compact-list {
  max-height: 104px;
  overflow: auto;
}

#overview .details-panel:first-of-type {
  margin-top: 12px;
}

#overview .details-panel > p {
  margin: 0 18px 14px;
  color: var(--ink-soft);
}

@media (min-width: 1280px) {
  #overview .case-screen {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  #overview .metrics-grid,
  #overview .overview-grid,
  .flag-columns {
    grid-template-columns: 1fr;
  }

  #overview .metric {
    height: auto;
    min-height: 96px;
  }

  .overview-right-stack {
    grid-template-rows: auto;
  }
}

.sidebar {
  gap: 16px;
}

.expertise-switcher {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.expertise-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.expertise-item {
  min-height: 74px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.expertise-item:hover,
.expertise-item.active {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.expertise-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.case-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.case-tabs .nav-item {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
  text-align: center;
}

.case-tabs .nav-item:hover,
.case-tabs .nav-item.active {
  border-color: rgba(37, 99, 235, 0.2);
  background: #eff6ff;
  color: var(--brand);
}

.panel::before,
.metric::before,
.director-metric::before,
.model-kpi::before {
  display: none;
}

.accent-red {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fffafa;
}

.decision-badge,
.decision-badge.negative,
.flag-light.risk strong,
.flag-light.negative strong,
.state-pill.negative {
  color: var(--risk);
}

.decision-badge {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff7f7;
}

.pipeline-step.active {
  border-color: rgba(37, 99, 235, 0.32);
  background: #eff6ff;
  color: var(--brand);
}

.pipeline-step.done {
  border-color: rgba(22, 163, 74, 0.35);
  background: #f0fdf4;
  color: var(--ok);
}

.chip-button {
  color: var(--ink-soft);
}

.chip-button:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  color: var(--brand);
}

.deal-blockers,
.flag-columns .compact-list,
.chat-log,
.documents-list,
.reports-list {
  max-height: none;
  overflow: visible;
}

.chat-layout,
.chat-panel {
  height: auto;
  min-height: 0;
}

.chat-log {
  min-height: 240px;
  display: grid;
  gap: 12px;
  background: #ffffff;
}

.msg {
  max-width: min(780px, 92%);
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  white-space: normal;
  overflow: hidden;
}

.msg.user {
  margin-left: auto;
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.18);
}

.msg.assistant {
  margin-right: auto;
  background: #ffffff;
}

.msg.typing .msg-body {
  color: var(--muted);
}

.msg-label {
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.msg-body {
  padding: 12px;
}

.msg-body p,
.msg-body ul,
.msg-body ol,
.msg-body pre,
.msg-body table {
  margin: 0 0 12px;
}

.msg-body :last-child {
  margin-bottom: 0;
}

.msg-body h3,
.msg-body h4,
.msg-body h5,
.msg-body h6 {
  margin: 14px 0 8px;
  color: var(--ink);
}

.msg-body code {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--surface-2);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.msg-body pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #111827;
  color: #f9fafb;
}

.msg-body pre code {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

.md-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 12px;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.md-table th,
.md-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: var(--surface-2);
  color: var(--ink);
}

.source-ledger,
.processing-tags {
  display: grid;
  gap: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.6fr) minmax(220px, 0.8fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.source-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.source-row span {
  color: var(--muted);
  font-size: 12px;
}

.source-row strong {
  overflow-wrap: anywhere;
}

.processing-tags {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
}

.processing-tags span,
.checklist-item strong {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.processing-tags .ok,
.checklist-item.done strong {
  border-color: rgba(22, 163, 74, 0.35);
  background: #f0fdf4;
  color: var(--ok);
}

.processing-tags .warn,
.checklist-item.missing strong {
  border-color: rgba(217, 119, 6, 0.35);
  background: #fffbeb;
  color: var(--warn);
}

.checklist-item {
  display: grid;
  gap: 6px;
}

.chart-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.highlighted-row {
  outline-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
}

@media (max-width: 768px) {
  .case-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-row {
    grid-template-columns: 1fr;
  }
}

#overview .case-screen {
  gap: 14px;
}

.executive-verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 0.22fr) auto;
  gap: 14px;
  align-items: stretch;
  border: 1px solid rgba(217, 119, 6, 0.34);
  border-radius: var(--radius);
  padding: 16px;
  background: #fffbeb;
}

.executive-verdict[data-tone="negative"] {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff7f7;
}

.executive-verdict[data-tone="positive"] {
  border-color: rgba(22, 163, 74, 0.3);
  background: #f0fdf4;
}

.executive-verdict-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.executive-verdict-main > span,
.executive-score-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.executive-verdict .decision-badge {
  width: fit-content;
  max-width: 100%;
  justify-content: flex-start;
  font-size: 18px;
  line-height: 1.25;
  white-space: normal;
}

.executive-verdict-main p {
  max-width: 78ch;
  margin: 0;
  color: var(--ink-soft);
}

.executive-score-card {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.executive-score-card strong {
  font-size: 26px;
  line-height: 1.1;
}

.executive-meta {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
  gap: 8px;
}

.overview-metrics.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#overview .overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
}

#overview .overview-score-panel,
#overview .overview-deal-panel {
  min-height: 100%;
}

#overview .overview-flags-panel {
  display: grid;
  gap: 14px;
  border-color: rgba(220, 38, 38, 0.26);
  background: #fffafa;
}

#overview .overview-flags-panel .panel-heading {
  align-items: flex-start;
}

.flag-columns {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
}

.flag-columns > div {
  border: 1px solid rgba(220, 38, 38, 0.16);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.flag-columns > div:nth-child(2) {
  border-color: rgba(37, 99, 235, 0.16);
}

.flag-columns .compact-list {
  display: grid;
  gap: 8px;
  max-height: none;
  overflow: visible;
}

.flag-columns .compact-list li {
  margin: 0;
}

.deal-blockers {
  max-height: none;
  overflow: visible;
}

.source-ledger-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: var(--radius);
  padding: 12px;
  background: #eff6ff;
}

.source-ledger-head > div {
  display: grid;
  gap: 3px;
}

.source-ledger-head span {
  color: var(--muted);
  font-size: 12px;
}

.claim-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.claim-list h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.claim-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.3fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.claim-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.claim-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.claim-row strong {
  overflow-wrap: anywhere;
}

@media (max-width: 1040px) {
  .executive-verdict,
  #overview .overview-grid,
  .overview-metrics.metrics-grid,
  .flag-columns,
  .source-ledger-head,
  .claim-row {
    grid-template-columns: 1fr;
  }

  .executive-meta {
    justify-content: flex-start;
  }
}

#overview .case-screen {
  max-width: 1200px;
}

#overview .overview-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
}

#overview .overview-score-panel .radar-box {
  height: 260px;
  min-height: 260px;
  max-height: 260px;
  overflow: hidden;
}

#overview .overview-score-panel .radar-box svg {
  max-height: 260px;
}

#overview .flag-lights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-ai-panel {
  display: grid;
  gap: 12px;
}

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

.overview-action {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.overview-action:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
  transform: translateY(-1px);
}

.overview-action strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.overview-action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.readiness-strip {
  display: grid;
  gap: 8px;
  margin: 10px 18px 14px;
}

.readiness-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.readiness-strip-head strong {
  font-size: 20px;
}

.readiness-strip-head span {
  color: var(--muted);
  font-weight: 700;
}

.readiness-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.readiness-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--warn);
}

.readiness-fill.positive {
  background: var(--ok);
}

.readiness-fill.negative {
  background: var(--risk);
}

.gauge-box {
  height: 150px;
  min-height: 150px;
}

.gauge-box svg {
  width: min(260px, 100%);
  max-height: 150px;
}

.chat-layout {
  height: calc(100vh - 220px);
  min-height: 520px;
}

.chat-layout,
.chat-panel {
  overflow: hidden;
}

.chat-log {
  min-height: 0;
  max-height: none;
  overflow: auto;
  align-content: start;
}

#chat.view.active {
  overflow: hidden;
}

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

@media (max-width: 760px) {
  #overview .overview-score-panel .radar-box {
    height: 230px;
    min-height: 230px;
    max-height: 230px;
  }

  #overview .flag-lights,
  .overview-action-grid {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .chat-log {
    max-height: 55vh;
  }
}

.sidebar-new-button {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  border: 1px solid #31546f;
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  background: #245f9f;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-new-button:hover {
  background: #1d4f86;
}

.status-block {
  margin-top: auto;
  border-top: 1px solid #2a3848;
}

.status-block .health-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--ink);
  font-weight: 800;
}

.sidebar .status-label {
  color: var(--muted);
}

.topbar {
  align-items: center;
  margin-bottom: 10px;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.15;
}

.case-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.case-context-bar h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.case-status-control {
  justify-self: end;
  width: 100%;
  max-width: 260px;
}

.case-context-actions {
  justify-self: end;
  width: min(100%, 280px);
  display: grid;
  gap: 8px;
}

.case-context-actions .case-status-control {
  justify-self: stretch;
  max-width: none;
}

.danger-ghost-button {
  min-height: 38px;
  border: 1px solid rgba(220, 38, 38, 0.26);
  border-radius: 8px;
  padding: 8px 12px;
  color: #b91c1c;
  background: #fff7f7;
  font-weight: 800;
  cursor: pointer;
}

.danger-ghost-button:hover {
  border-color: rgba(220, 38, 38, 0.45);
  background: #fee2e2;
}

.danger-ghost-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.deal-action-bar {
  margin-bottom: 10px;
  padding: 10px 12px;
}

.deal-action-status {
  color: var(--ink);
  font-weight: 800;
}

.case-tabs {
  margin-bottom: 12px;
}

.director-head {
  display: block;
  padding: 12px;
}

.director-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.director-metric {
  min-height: 66px;
}

.director-grid {
  gap: 12px;
}

.director-row-meta span {
  white-space: normal;
}

#newCasePanel {
  margin-bottom: 12px;
}

#documents .upload-form {
  gap: 12px;
}

#builder.view.active {
  display: block;
}

.case-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.case-modal::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.case-modal-shell {
  display: grid;
  max-height: inherit;
  overflow: hidden;
}

.case-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.case-modal-head h2 {
  margin: 2px 0 4px;
}

.case-modal-head p {
  color: var(--muted);
}

.case-modal-body {
  overflow: auto;
  padding: 18px 20px 20px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-intake {
  grid-template-columns: 1fr;
}

.file-pick-card.drag-over {
  border-color: var(--brand);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.selected-files {
  display: grid;
  gap: 8px;
}

.selected-empty,
.case-progress-text {
  color: var(--muted);
  font-size: 13px;
}

.selected-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-2);
}

.selected-file span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.selected-file small {
  color: var(--muted);
}

.selected-file button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--risk);
  cursor: pointer;
  font-weight: 800;
}

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

.case-progress li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas:
    "dot title"
    "dot note";
  gap: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #ffffff;
}

.case-progress li > span {
  grid-area: dot;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
}

.case-progress strong {
  grid-area: title;
}

.case-progress small {
  grid-area: note;
  color: var(--muted);
}

.case-progress li.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eff6ff;
}

.case-progress li.active > span {
  border-color: var(--brand);
  border-top-color: transparent;
  animation: progressSpin 850ms linear infinite;
}

.case-progress li.done {
  border-color: rgba(22, 163, 74, 0.34);
  background: #f0fdf4;
}

.case-progress li.done > span {
  display: grid;
  place-items: center;
  border-color: var(--ok);
  background: var(--ok);
}

.case-progress li.done > span::after {
  content: "";
  width: 7px;
  height: 4px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.case-progress li.error {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fff7f7;
}

.case-progress li.error > span {
  border-color: var(--risk);
  background: var(--risk);
}

@keyframes progressSpin {
  to {
    transform: rotate(360deg);
  }
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.method-formula-panel {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  padding: 12px;
  background: #eff6ff;
}

.method-formula-panel h3 {
  margin: 0;
  color: var(--ink);
}

.method-formula-panel p {
  color: var(--ink-soft);
}

.explain-card {
  cursor: pointer;
}

.explain-card summary,
.score-detail-card summary {
  cursor: pointer;
  list-style: none;
}

.explain-card summary::-webkit-details-marker,
.score-detail-card summary::-webkit-details-marker {
  display: none;
}

.explain-card p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.score-detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.score-detail-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.score-detail-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 12px;
}

.score-detail-card summary span {
  font-weight: 800;
}

.score-detail-card summary strong {
  font-size: 16px;
}

.score-detail-card summary em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.score-detail-card.positive {
  border-color: rgba(22, 163, 74, 0.28);
}

.score-detail-card.warning {
  border-color: rgba(217, 119, 6, 0.3);
}

.score-detail-card.negative {
  border-color: rgba(220, 38, 38, 0.26);
}

.score-detail-body {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
  color: var(--ink-soft);
}

.score-detail-body p {
  margin: 0;
}

#chat.view.active {
  overflow: hidden;
}

.chat-log {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

.msg {
  display: block;
  width: fit-content;
  min-width: min(260px, 100%);
  max-width: min(780px, 92%);
  min-height: 42px;
  flex: 0 0 auto;
  contain: none;
}

.msg.user {
  align-self: flex-end;
}

.msg.assistant,
.msg.assistant.typing {
  align-self: flex-start;
}

.msg-body {
  display: block;
  min-width: 0;
  min-height: 1.45em;
  overflow-wrap: anywhere;
}

.msg-body p,
.msg-body ul,
.msg-body ol,
.msg-body pre,
.msg-body table,
.msg-body h3,
.msg-body h4,
.msg-body h5,
.msg-body h6 {
  display: block;
  width: auto;
  height: auto;
}

@media (max-width: 640px) {
  .case-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .case-modal-head,
  .case-modal-body {
    padding: 14px;
  }

  .selected-file {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    display: grid;
  }

  .modal-actions .button {
    width: 100%;
  }
}

@media (max-width: 1040px) {
  .case-context-bar {
    grid-template-columns: 1fr;
  }

  .case-status-control {
    justify-self: stretch;
    max-width: none;
  }

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .case-context-bar h2 {
    font-size: 21px;
  }

  .director-metrics {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  overflow: hidden;
}

.expertise-switcher {
  min-height: 0;
}

.expertise-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  padding-bottom: 6px;
}

.system-nav {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.system-nav-item {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.system-nav-item.active {
  border-color: rgba(37, 99, 235, 0.22);
  background: #eff6ff;
  color: var(--brand);
  font-weight: 800;
}

body.system-dashboard-active .case-context-bar,
body.system-dashboard-active .deal-action-bar,
body.system-dashboard-active .case-tabs {
  display: none;
}

.expertise-item .item-subtitle {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-block {
  flex: 0 0 auto;
  margin-top: 0;
  background: inherit;
}

.status-block .health-value {
  color: inherit;
}

.sidebar .status-label {
  color: rgba(245, 247, 250, 0.72);
}

.case-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

.case-tabs .nav-item {
  min-height: 44px;
  white-space: nowrap;
  scroll-snap-align: start;
}

.panel-heading {
  flex-wrap: wrap;
  min-width: 0;
}

.panel-heading > * {
  min-width: 0;
}

.formula-badge {
  max-width: 100%;
  white-space: normal;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, auto);
  align-items: start;
}

.report-main {
  min-width: 0;
}

.report-file-name {
  max-width: 100%;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.report-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 8px;
  justify-content: stretch;
  min-width: 0;
}

.report-links a,
.artifact-button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  white-space: nowrap;
}

.report-links a::after,
.artifact-button::after {
  content: "";
}

.metric strong,
.director-metric strong,
.model-kpi strong,
.deal-kpis strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.table-host,
.table-scroll {
  overflow-x: auto;
}

.table-host table,
.table-scroll table {
  table-layout: fixed;
  width: 100%;
}

.table-host th,
.table-host td,
.table-scroll th,
.table-scroll td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.chat-empty-state {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink-soft);
  background: #fbfcfd;
}

.chat-empty-state strong {
  color: var(--ink);
}

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

.ai-command-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.ai-command-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.ai-command-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-command-card strong {
  display: block;
  line-height: 1.2;
}

.ai-command-card:disabled,
.chip-button:disabled,
.button:disabled,
.is-disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-thinking {
  display: grid;
  gap: 12px;
  min-width: min(620px, 100%);
}

.ai-thinking-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ai-thinking-head strong,
.ai-thinking-head span {
  display: block;
}

.ai-thinking-head span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ai-thinking-head time {
  color: var(--brand);
  font-weight: 900;
}

.ai-pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  animation: aiPulse 1.4s infinite;
}

.ai-thinking-steps {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-thinking-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.ai-thinking-steps li span {
  width: 10px;
  height: 10px;
  border: 1px solid #c9d5e1;
  border-radius: 50%;
  background: #ffffff;
}

.ai-thinking-steps li.active {
  color: var(--ink);
}

.ai-thinking-steps li.active span {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-thinking-steps li.done {
  color: var(--ok);
}

.ai-thinking-steps li.done span {
  border-color: var(--ok);
  background: var(--ok);
}

.ai-thinking p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.case-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.case-tabs .nav-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.vc-playbook-grid,
.committee-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.vc-wide,
.committee-wide {
  grid-column: 1 / -1;
}

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

.practice-card,
.request-card,
.evidence-row,
.stage-gate,
.legal-pack-item,
.condition-item,
.dissent-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.practice-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
}

.practice-card > div {
  display: grid;
  gap: 5px;
}

.practice-card span,
.request-card span,
.dissent-item span,
.legal-pack-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.practice-card strong,
.request-card strong,
.evidence-row strong,
.legal-pack-item strong,
.dissent-item strong {
  color: var(--ink);
}

.practice-card em {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.practice-card p,
.request-card p,
.stage-gate p,
.condition-item p,
.dissent-item p,
.legal-pack p,
.decision-room-banner p {
  margin: 0;
  color: var(--ink-soft);
}

.practice-card.positive em,
.legal-pack-item.ready span,
.dissent-item.closed span {
  background: #ecfdf5;
  color: #047857;
}

.practice-card.warning em {
  background: #fffbeb;
  color: #a16207;
}

.practice-card.negative em,
.legal-pack-item.missing span,
.dissent-item.open span {
  background: #fef2f2;
  color: var(--risk);
}

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

.stage-gate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 122px;
  padding: 12px;
}

.stage-gate > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--line);
}

.stage-gate.done > span {
  background: var(--ok);
}

.stage-gate.current > span {
  background: var(--brand);
}

.stage-gate.blocked > span {
  background: var(--risk);
}

.stage-gate.pending > span {
  background: #cbd5e1;
}

.stage-gate strong {
  display: block;
  margin-bottom: 6px;
}

.evidence-matrix,
.request-stack,
.condition-list,
.dissent-log,
.committee-artifacts {
  display: grid;
  gap: 10px;
}

.evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.evidence-row span {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.evidence-row-meta {
  display: grid;
  gap: 4px;
  min-width: 98px;
  text-align: right;
}

.evidence-row-meta b {
  color: var(--brand);
}

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

.request-card {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.request-card.compact {
  gap: 6px;
}

.legal-pack {
  display: grid;
  gap: 12px;
}

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

.legal-pack-item {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.legal-pack-item span {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
}

.decision-room {
  display: grid;
  gap: 14px;
}

.decision-room-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fbfcfd;
}

.decision-room-banner.positive {
  border-color: rgba(22, 163, 74, 0.28);
  background: #f0fdf4;
}

.decision-room-banner.negative {
  border-color: rgba(220, 38, 38, 0.24);
  background: #fff7f7;
}

.decision-room-banner span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.decision-room-banner strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.decision-room-banner em {
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

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

.committee-kpis article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.committee-kpis span,
.committee-kpis small {
  color: var(--muted);
}

.committee-kpis strong {
  font-size: 22px;
}

.committee-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.condition-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
}

.condition-item > span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--line);
}

.condition-item.positive > span {
  background: var(--ok);
}

.condition-item.warning > span {
  background: var(--warn);
}

.condition-item.negative > span {
  background: var(--risk);
}

.dissent-item {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.dissent-item span {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
}

.artifact-stack {
  display: grid;
  gap: 10px;
}

.committee-report-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

@keyframes aiPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

@media (pointer: coarse) {
  .button,
  .chip-button,
  .artifact-button,
  .file-pick-action,
  .link-button,
  .icon-button,
  .delete-file-button {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .ai-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .model-grid,
  .model-visual-grid,
  .score-detail-grid,
  #overview .overview-grid,
  .settings-grid,
  .chat-layout,
  .vc-playbook-grid,
  .committee-grid,
  .practice-summary,
  .stage-gate-board,
  .legal-pack-grid,
  .committee-kpis {
    grid-template-columns: 1fr;
  }

  .risk-model-cards,
  .director-metrics,
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-row {
    grid-template-columns: 1fr;
  }

  .report-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .ai-command-center {
    grid-template-columns: 1fr;
  }

  .risk-model-cards,
  .director-metrics,
  .metrics-grid,
  .report-links {
    grid-template-columns: 1fr;
  }
}

body.assistant-workspace-active .case-tabs {
  display: none;
}

.system-nav-item {
  color: var(--ink-soft);
}

.system-nav-item:not(.active):hover {
  background: #f8fafc;
}

.system-nav-item.active {
  background: #ffffff;
  color: var(--brand);
}

.status-block .health-value {
  color: var(--ink);
  font-weight: 800;
}

.sidebar .status-label {
  color: var(--muted);
}

.assistant-workspace.view.active {
  display: block;
}

.voice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 18px;
}

.voice-main,
.voice-side {
  min-width: 0;
}

.voice-heading {
  align-items: start;
}

.voice-context {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--ink-soft);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
}

.voice-recorder {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 16px 0;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.voice-recorder.is-recording {
  border-color: #86efac;
  background: #f0fdf4;
}

.voice-orb {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.voice-orb span {
  position: absolute;
  inset: 14px;
  border-radius: inherit;
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.voice-recorder.is-recording .voice-orb {
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.12), 0 12px 30px rgba(22, 163, 74, 0.18);
}

.voice-orb strong {
  position: relative;
  z-index: 1;
  font-size: 16px;
}

.voice-recorder-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.voice-recorder-copy strong {
  font-size: 20px;
}

.voice-recorder-copy span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.voice-actions {
  display: grid;
  gap: 9px;
  min-width: 190px;
}

.voice-speak-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.voice-scenario {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.voice-scenario:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.voice-scenario span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.voice-scenario strong {
  display: block;
  line-height: 1.2;
}

.voice-transcript-label {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.voice-transcript-label textarea {
  width: 100%;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  resize: vertical;
  text-transform: none;
  font-weight: 600;
}

.voice-command-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.voice-answer-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}

.voice-answer-card h3 {
  margin: 0;
}

.voice-answer-empty,
.voice-answer-thinking,
.voice-answer-rich,
.voice-answer-error {
  min-height: 120px;
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.voice-answer-error {
  border: 1px solid #fecaca;
  color: var(--risk);
}

.voice-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.voice-principles {
  display: grid;
  gap: 10px;
}

.voice-principles div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.voice-principles span {
  color: var(--muted);
}

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

.voice-command-list button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.voice-command-list button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.ai-thinking.compact {
  min-width: 0;
}

@media (max-width: 1180px) {
  .voice-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .voice-recorder {
    grid-template-columns: 1fr;
  }

  .voice-orb {
    width: 78px;
    height: 78px;
  }

  .voice-actions {
    min-width: 0;
  }

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

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

@media (max-width: 520px) {
  .voice-scenarios {
    grid-template-columns: 1fr;
  }

  .voice-command-row {
    display: grid;
  }
}

.sidebar {
  gap: 12px;
  padding: 18px 18px;
  background: #ffffff;
  color: var(--ink);
}

.brand {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.system-nav {
  gap: 4px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 10px;
}

.system-nav-item,
.system-nav-item.nav-item {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
  opacity: 1;
}

.system-nav-item:not(.active):hover {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--ink);
}

.system-nav-item.active,
.system-nav-item.nav-item.active {
  min-height: 42px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--brand);
  font-weight: 900;
}

.expertise-switcher {
  padding: 8px 0;
  border-top: 0;
}

.expertise-switcher .status-label {
  margin-bottom: 6px;
}

.sidebar-new-button {
  margin-top: 0;
  min-height: 38px;
}

.expertise-list {
  margin-top: 8px;
}

.status-block {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.user-chip {
  gap: 8px;
}

.model-grid {
  align-items: start;
}

.model-grid > .panel {
  align-self: start;
}

.deal-economics {
  align-content: start;
}

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

.deal-economics h3 {
  margin-top: 6px;
  font-size: 15px;
}

#overview .overview-grid {
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.72fr);
  align-items: start;
}

#overview .overview-score-panel .radar-box {
  height: clamp(330px, 34vh, 410px);
  min-height: 330px;
  max-height: 410px;
}

#overview .overview-score-panel .radar-box svg {
  max-height: 100%;
}

#chat.view.active {
  height: calc(100vh - 178px);
  min-height: 620px;
  overflow: hidden;
}

#chat.view.active .chat-layout {
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

#chat.view.active .chat-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.assistant-project-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: center;
  border: 1px solid #cfe0f5;
  border-radius: 10px;
  padding: 12px;
  background: #f7fbff;
}

.assistant-context-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assistant-context-main span,
.assistant-context-facts span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-context-main strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.assistant-context-main p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.assistant-context-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.assistant-context-facts span {
  min-height: 28px;
  border: 1px solid #c9d5e1;
  border-radius: 999px;
  padding: 5px 9px;
  background: #ffffff;
  color: var(--ink-soft);
  text-transform: none;
}

.assistant-context-decision {
  grid-column: 1 / -1;
  border-top: 1px solid #dbe7f5;
  padding-top: 8px;
  color: var(--ink);
  font-weight: 700;
}

.assistant-tools-drawer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.assistant-tools-drawer summary {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
}

.assistant-tools-drawer summary::marker {
  content: "";
}

.assistant-tools-drawer summary span {
  color: var(--brand);
  font-weight: 900;
}

.assistant-tools-drawer summary strong {
  color: var(--muted);
  font-size: 13px;
}

.assistant-tools-drawer[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.assistant-tools-drawer .ai-command-center {
  margin: 12px;
}

.assistant-tools-drawer .prompt-rail {
  margin: 0 12px 12px;
}

#chat.view.active .chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

#chat.view.active .chat-form {
  flex: 0 0 auto;
}

.notes-toggle-button {
  min-width: 96px;
}

.notes-drawer {
  position: fixed;
  top: 96px;
  right: 22px;
  bottom: 22px;
  z-index: 35;
  width: min(430px, calc(100vw - 42px));
  margin: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 32px));
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.18);
}

body.notes-drawer-open .notes-drawer {
  transform: translateX(0);
}

.notes-drawer .note-form {
  flex: 0 0 auto;
}

.notes-drawer .notes-list {
  flex: 1 1 auto;
}

@media (max-width: 1040px) {
  #overview .overview-grid,
  .assistant-project-context,
  .assistant-tools-drawer summary {
    grid-template-columns: 1fr;
  }

  .assistant-context-facts {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  #chat.view.active {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .notes-drawer {
    top: 74px;
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

.panel::before,
.metric::before,
.director-metric::before,
.model-kpi::before {
  display: none;
}

.panel,
.metric,
.director-metric,
.model-kpi,
.overview-score-panel,
.overview-deal-panel {
  box-shadow: none;
}

.panel,
.metric,
.director-metric,
.model-kpi {
  border-color: #dde6ef;
}

.main-content {
  background:
    linear-gradient(180deg, rgba(37, 99, 168, 0.045), rgba(255, 255, 255, 0) 260px),
    #f5f7fa;
}

.director-head {
  display: grid;
  grid-template-columns: minmax(300px, 0.55fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: stretch;
  border-color: #cfe0ee;
  background: linear-gradient(135deg, #ffffff, #f4f9fd);
}

.director-hero-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.director-hero-copy span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.director-hero-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.director-hero-copy p {
  max-width: 58ch;
  color: var(--muted);
  font-weight: 600;
}

.director-metrics {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.director-metric {
  min-height: 92px;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.director-metric span {
  color: #596779;
  font-weight: 900;
}

.director-metric strong {
  font-size: 24px;
}

.director-metric.metric-tone-1 strong,
.director-board-card:first-child strong {
  color: var(--ok);
}

.director-metric.metric-tone-2 strong,
.director-metric.metric-tone-3 strong {
  color: var(--warn);
}

.director-metric.metric-tone-4 strong {
  color: var(--risk);
}

.director-decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.director-board-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  border: 1px solid #d9e4ef;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.director-board-card strong {
  color: var(--brand);
  font-size: 28px;
  line-height: 1;
}

.director-board-card span {
  color: var(--ink);
  font-weight: 900;
}

.director-board-card small {
  color: var(--muted);
  line-height: 1.35;
}

.director-board-card.muted {
  background: #f9fbfd;
}

.director-board-card.muted strong {
  color: #8c9aac;
}

.director-weak-sections {
  display: grid;
  gap: 10px;
}

.weak-section-row {
  display: grid;
  gap: 7px;
}

.weak-section-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.weak-section-row strong {
  color: var(--ink);
}

.weak-section-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.weak-section-row i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) var(--bar), #e8eef5 var(--bar));
}

.director-grid {
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
}

.director-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main action"
    "meta action"
    "tags action";
  border-radius: 12px;
  background: #ffffff;
}

.director-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.director-row-title em {
  border: 1px solid #b8d8c9;
  border-radius: 999px;
  padding: 3px 8px;
  color: #13724b;
  background: #edf8f3;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.director-blocker-tags {
  grid-area: tags;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.director-blocker-tags b {
  border: 1px solid #f2d7b8;
  border-radius: 999px;
  padding: 4px 8px;
  color: #8a4b00;
  background: #fff8ed;
  font-size: 12px;
}

.director-review-decision {
  display: grid;
  gap: 4px;
  border: 1px solid #cfe0ee;
  border-radius: 12px;
  padding: 12px;
  background: #f7fbff;
}

.director-review-decision span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.director-review-decision strong {
  color: var(--brand);
  font-size: 17px;
}

#chat.view.active {
  height: calc(100vh - 136px);
  min-height: 620px;
}

#chat.view.active .chat-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  }

#chat.view.active .panel-heading,
#chat.view.active .assistant-project-context,
#chat.view.active .assistant-tools-drawer,
#chat.view.active .chat-form {
  margin: 0;
}

.current-question {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #bfd4ec;
  border-radius: 12px;
  padding: 10px 12px;
  background: #eff6ff;
  box-shadow: 0 10px 24px rgba(37, 99, 168, 0.08);
}

.current-question div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.current-question span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.current-question strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-question em {
  color: #13724b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.ai-thinking {
  max-height: 260px;
  overflow: auto;
}

#chat.view.active .assistant-project-context {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px 10px;
}

#chat.view.active .assistant-context-main p {
  display: none;
}

#chat.view.active .assistant-context-decision {
  grid-column: auto;
  border-top: 0;
  padding-top: 0;
  max-width: 34ch;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#chat.view.active .chat-form {
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  align-items: stretch;
}

#chat.view.active #chatInput {
  min-height: 58px;
  max-height: 92px;
  resize: vertical;
}

#chat.view.active #chatSubmitBtn {
  min-height: 58px;
  width: auto;
  padding-inline: 18px;
  border-radius: 10px;
}

#chat.view.active .assistant-tools-drawer summary {
  min-height: 38px;
  padding: 8px 10px;
}

#chat.view.active .assistant-tools-drawer summary strong {
  display: none;
}

#chat.view.active .chat-log {
  min-height: 320px;
  border: 1px solid #dde6ef;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

#voice.view.active {
  height: calc(100vh - 136px);
  min-height: 620px;
  overflow: hidden;
}

#voice.view.active .voice-layout {
  height: 100%;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  min-height: 0;
}

#voice.view.active .voice-main,
#voice.view.active .voice-side {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#voice.view.active .voice-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(150px, 1fr) auto minmax(120px, 0.65fr);
  gap: 10px;
  padding: 16px;
}

#voice.view.active .voice-heading {
  margin: 0;
}

#voice.view.active .voice-recorder {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  margin: 0;
  padding: 14px;
}

#voice.view.active .voice-orb {
  width: 70px;
  height: 70px;
}

#voice.view.active .voice-recorder-copy strong {
  font-size: 17px;
}

#voice.view.active .voice-actions {
  grid-template-columns: 1fr;
  min-width: 170px;
}

#voice.view.active .voice-actions .button.large,
#voice.view.active .voice-actions .button {
  min-height: 42px;
  width: auto;
  border-radius: 10px;
  padding: 8px 12px;
}

#voice.view.active .voice-scenarios {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

#voice.view.active .voice-scenario {
  min-height: 74px;
  padding: 10px;
}

#voice.view.active .voice-transcript-label {
  min-height: 0;
  margin: 0;
}

#voice.view.active .voice-transcript-label textarea {
  height: 100%;
  min-height: 150px;
  resize: none;
}

#voice.view.active .voice-command-row {
  margin: 0;
}

#voice.view.active .voice-answer-card {
  min-height: 0;
  overflow: hidden;
}

#voice.view.active #voiceAnswer {
  max-height: 100%;
  overflow: auto;
}

#voice.view.active .voice-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

#voice.view.active .voice-side > .panel:first-child {
  overflow: auto;
}

@media (max-width: 1180px) {
  .director-head,
  .director-decision-grid,
  .director-grid {
    grid-template-columns: 1fr;
  }

  .director-metrics,
  .director-decision-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .director-metrics,
  .director-decision-board {
    grid-template-columns: 1fr;
  }

  .current-question {
    grid-template-columns: 1fr;
  }

  .current-question strong {
    white-space: normal;
  }

  #chat.view.active .assistant-project-context,
  #chat.view.active .chat-form {
    grid-template-columns: 1fr;
  }

  #chat.view.active .assistant-context-decision {
    grid-column: 1;
    max-width: none;
    white-space: normal;
  }
}

.expertise-item {
  position: relative;
  cursor: pointer;
}

.expertise-item.active {
  border-color: rgba(37, 99, 168, 0.48);
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--brand);
}

.expertise-item.active::after {
  content: "Открыто";
  justify-self: start;
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--brand);
  background: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

body.assistant-workspace-active .workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  overflow: hidden;
}

body.assistant-workspace-active #appNotice:empty {
  display: none;
}

body.assistant-workspace-active .topbar,
body.assistant-workspace-active .case-context-bar {
  margin: 0;
}

body.assistant-workspace-active .case-context-bar {
  min-height: 108px;
  padding: 14px 18px;
}

body.assistant-workspace-active .case-tabs {
  display: none;
}

body.assistant-workspace-active .view.active {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

body.assistant-workspace-active #chat.view.active,
body.assistant-workspace-active #voice.view.active {
  height: 100%;
  min-height: 0;
}

body.assistant-workspace-active .panel-heading {
  margin-bottom: 0;
}

body.assistant-workspace-active .assistant-project-context {
  min-height: 0;
}

#chat.view.active .chat-layout,
#voice.view.active .voice-layout {
  height: 100%;
  min-height: 0;
}

#chat.view.active .chat-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  gap: 10px;
  overflow: hidden;
  padding: 14px;
}

#chat.view.active .panel-heading h2 {
  font-size: 18px;
}

#chat.view.active .panel-subtitle {
  max-width: 78ch;
}

#chat.view.active .assistant-tools-drawer {
  min-height: 0;
}

#chat.view.active .assistant-tools-drawer summary {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 36px;
}

#chat.view.active .assistant-tools-drawer summary strong {
  display: none;
}

#chat.view.active .ai-command-center {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#chat.view.active .ai-command-card {
  min-height: 72px;
  padding: 10px;
}

#chat.view.active .chat-log {
  min-height: 0;
  overflow: auto;
  scroll-behavior: smooth;
}

#chat.view.active .chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  margin: 0;
}

#chat.view.active #chatInput {
  min-height: 52px;
  max-height: 86px;
  resize: none;
}

#chat.view.active #chatSubmitBtn {
  min-height: 52px;
  width: auto;
  padding-inline: 14px;
  border-radius: 10px;
}

#voice.view.active .voice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 14px;
}

#voice.view.active .voice-main,
#voice.view.active .voice-side {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#voice.view.active .voice-main {
  display: grid;
  grid-template-rows: auto auto auto minmax(130px, 1fr) auto minmax(116px, 0.62fr);
  gap: 10px;
  padding: 14px;
}

#voice.view.active .voice-heading h2 {
  font-size: 18px;
}

#voice.view.active .voice-heading .panel-subtitle {
  display: none;
}

#voice.view.active .voice-context {
  max-width: 42ch;
}

#voice.view.active .voice-recorder {
  grid-template-columns: 74px minmax(0, 1fr) 170px;
  gap: 14px;
  margin: 0;
  padding: 12px;
}

#voice.view.active .voice-orb {
  width: 70px;
  height: 70px;
}

#voice.view.active .voice-recorder-copy strong {
  font-size: 17px;
}

#voice.view.active .voice-recorder-copy span {
  max-width: 70ch;
}

#voice.view.active .voice-actions {
  min-width: 0;
  grid-template-columns: 1fr;
}

#voice.view.active .voice-actions .button,
#voice.view.active .voice-actions .button.large {
  min-height: 40px;
  width: auto;
  padding: 8px 12px;
}

#voice.view.active .voice-scenarios {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

#voice.view.active .voice-scenario {
  min-height: 70px;
  padding: 10px;
}

#voice.view.active .voice-transcript-label {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin: 0;
}

#voice.view.active .voice-transcript-label textarea {
  height: 100%;
  min-height: 0;
  resize: none;
}

#voice.view.active .voice-command-row {
  margin: 0;
}

#voice.view.active .voice-command-row .button {
  min-height: 42px;
}

#voice.view.active .voice-answer-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

#voice.view.active .voice-answer-card .panel-heading {
  margin-bottom: 6px;
}

#voice.view.active #voiceAnswer {
  max-height: 100%;
  overflow: auto;
}

#voice.view.active .voice-side {
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 14px;
}

#voice.view.active .voice-side h2 {
  font-size: 18px;
}

#voice.view.active .voice-principles {
  gap: 8px;
}

#voice.view.active .voice-principles div {
  padding: 10px;
}

.director-metric span,
.director-board-card span,
.director-board-card small,
.director-row-meta span {
  overflow-wrap: anywhere;
}

#director {
  display: none;
}

#director.view.active {
  display: grid;
  gap: 14px;
}

.director-updated {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  border: 1px solid #dbe7f2;
  border-radius: 999px;
  padding: 4px 10px;
  color: #41546b;
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

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

.director-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 94px;
}

.director-metric small {
  color: #65758a;
  font-size: 11px;
  font-weight: 800;
}

.director-metric.metric-positive {
  --metric-color: var(--ok);
}

.director-metric.metric-warning {
  --metric-color: var(--warn);
}

.director-metric.metric-negative {
  --metric-color: var(--risk);
}

.director-metric.metric-neutral {
  --metric-color: var(--brand);
}

.director-metric-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 51%, transparent 52%),
    conic-gradient(var(--metric-color) var(--pct), #e8eef5 0);
}

.director-decision-grid {
  align-items: stretch;
}

.director-decision-board {
  display: grid;
  gap: 12px;
}

.director-funnel-track {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.director-funnel-segment {
  position: relative;
  flex: var(--share) 1 150px;
  min-width: 126px;
  min-height: 118px;
  border: 1px solid #d8e3ee;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.director-funnel-segment::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-top: 1px solid #d8e3ee;
  border-right: 1px solid #d8e3ee;
  background: inherit;
  transform: translateY(-50%) rotate(45deg);
  z-index: 1;
}

.director-funnel-segment:last-child::after {
  display: none;
}

.director-funnel-segment strong {
  display: block;
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1;
}

.director-funnel-segment span {
  display: block;
  color: var(--ink);
  font-weight: 900;
}

.director-funnel-segment small {
  display: block;
  margin-top: 6px;
  color: #5f7084;
  font-size: 12px;
  line-height: 1.35;
}

.director-funnel-segment.positive strong {
  color: var(--ok);
}

.director-funnel-segment.warning strong {
  color: var(--warn);
}

.director-funnel-segment.negative strong {
  color: var(--risk);
}

.director-funnel-segment.neutral strong {
  color: var(--brand);
}

.director-funnel-segment.selected {
  border-color: var(--brand);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.12);
}

.director-funnel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.director-funnel-actions span {
  color: #65758a;
  font-size: 12px;
  font-weight: 800;
}

.director-heatmap {
  margin-bottom: 14px;
}

.director-heatmap-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(var(--cols), minmax(66px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.heatmap-head {
  min-height: 26px;
  color: #65758a;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.heatmap-head.project {
  text-align: left;
}

.heatmap-project,
.heatmap-cell {
  min-height: 42px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.heatmap-project {
  padding: 8px 10px;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.heatmap-cell {
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.heatmap-cell.strong {
  border-color: #bde5d1;
  background: color-mix(in srgb, var(--ok) calc(var(--cell) * 0.45), #ffffff);
}

.heatmap-cell.mid {
  border-color: #f0d7ad;
  background: color-mix(in srgb, var(--warn) calc(var(--cell) * 0.34), #ffffff);
}

.heatmap-cell.weak {
  border-color: #f2c8c8;
  background: color-mix(in srgb, var(--risk) calc((100% - var(--cell)) * 0.28), #ffffff);
}

.director-comparison-panel {
  margin-bottom: 14px;
}

.director-comparison {
  display: grid;
  gap: 10px;
}

.director-comparison-head {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-left: min(260px, 30%);
  color: #65758a;
  font-size: 11px;
  font-weight: 900;
}

.director-comparison-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.director-comparison-title {
  display: grid;
  gap: 4px;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.director-comparison-title strong {
  font-size: 15px;
}

.director-comparison-title span {
  color: #5f7084;
  font-size: 12px;
  font-weight: 800;
}

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

.comparison-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}

.comparison-bar i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bar-color) var(--value), #e8eef5 var(--value));
}

.comparison-bar span {
  color: #344256;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.comparison-bar.positive {
  --bar-color: var(--ok);
}

.comparison-bar.warning {
  --bar-color: var(--warn);
}

.comparison-bar.negative {
  --bar-color: var(--risk);
}

.director-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #cfe0ee;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f7fbff;
}

.director-filter-bar strong {
  color: var(--brand);
}

.director-current-top {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.director-donut {
  --donut-color: var(--brand);
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--donut-color) var(--pct), #e8eef5 0);
}

.director-donut.positive {
  --donut-color: var(--ok);
}

.director-donut.warning {
  --donut-color: var(--warn);
}

.director-donut.negative {
  --donut-color: var(--risk);
}

.director-donut strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.director-donut span {
  max-width: 78px;
  color: #65758a;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.director-current-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.director-checklist div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 9px;
  background: #ffffff;
}

.director-checklist i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--warn);
  font-style: normal;
  font-weight: 900;
}

.director-checklist .done i {
  background: var(--ok);
}

.director-checklist .blocked i {
  background: var(--risk);
}

.director-checklist span {
  color: #65758a;
  font-size: 11px;
  font-weight: 900;
}

.director-checklist strong {
  color: var(--ink);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .director-funnel-track,
  .director-comparison-row,
  .director-current-top {
    grid-template-columns: 1fr;
  }

  .director-funnel-track {
    display: grid;
  }

  .director-funnel-segment::after {
    display: none;
  }

  .director-comparison-head {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .director-heatmap-grid {
    overflow-x: auto;
    grid-template-columns: 120px repeat(var(--cols), 76px);
  }

  .director-comparison-head,
  .director-comparison-bars,
  .director-checklist {
    grid-template-columns: 1fr;
  }

  .comparison-bar {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
}

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

.director-funnel-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.director-funnel-segment {
  min-width: 0;
  overflow: hidden;
}

.director-funnel-segment::before {
  content: "";
  position: absolute;
  left: 14px;
  right: auto;
  bottom: 12px;
  width: calc(var(--share) - 8px);
  max-width: calc(100% - 28px);
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.32;
}

.director-funnel-segment.positive {
  color: var(--ok);
}

.director-funnel-segment.warning {
  color: var(--warn);
}

.director-funnel-segment.negative {
  color: var(--risk);
}

.director-funnel-segment.neutral {
  color: var(--brand);
}

.director-funnel-segment span,
.director-funnel-segment small {
  color: var(--ink);
}

.director-funnel-segment small {
  color: #5f7084;
}

.director-heatmap-grid {
  grid-template-columns: minmax(150px, 0.75fr) repeat(var(--cols), minmax(110px, 1fr));
}

.director-weak-sections {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .director-funnel-track,
  .director-weak-sections {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .director-funnel-track,
  .director-weak-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  body.assistant-workspace-active .workspace {
    overflow: auto;
  }

  body.assistant-workspace-active .view.active,
  body.assistant-workspace-active #chat.view.active,
  body.assistant-workspace-active #voice.view.active {
    height: auto;
    overflow: visible;
  }

  #voice.view.active .voice-layout {
    grid-template-columns: 1fr;
  }

  #voice.view.active .voice-main,
  #voice.view.active .voice-side {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  #chat.view.active .ai-command-center,
  #voice.view.active .voice-scenarios {
    grid-template-columns: 1fr;
  }

  #chat.view.active .chat-form,
  #voice.view.active .voice-recorder {
    grid-template-columns: 1fr;
  }
}

[hidden] {
  display: none !important;
}

#director.view.active {
  gap: 18px;
}

.director-head {
  border: 1px solid #d4e4f4;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(37, 99, 168, 0.08), transparent 40%),
    #ffffff;
  box-shadow: none;
}

.director-hero-copy h2 {
  max-width: 560px;
  color: #162235;
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: 0;
}

.director-hero-copy p {
  max-width: 54ch;
  color: #56657a;
  font-weight: 650;
}

.director-mode-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  border-radius: 999px;
  padding: 6px;
  background: #ffffff;
  box-shadow: none;
}

.director-mode-tab {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  color: #344256;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.director-mode-tab:hover,
.director-mode-tab:focus-visible {
  border-color: #bfd5eb;
  outline: none;
}

.director-mode-tab.active {
  border-color: #9fc5ec;
  color: #174d89;
  background: #edf6ff;
}

.director-metrics {
  grid-template-columns: repeat(3, minmax(190px, 1fr));
}

.director-metric {
  min-height: 86px;
  border-color: #dbe7f2;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  box-shadow: none;
}

.director-metric span {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0;
}

.director-metric strong {
  color: #162235;
  font-size: 27px;
}

.director-metric small {
  color: #64748b;
}

.director-metric-ring {
  width: 36px;
  height: 36px;
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(var(--metric-color) var(--pct), #e7eef6 0);
}

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

.director-board-panel,
.director-weak-panel,
.director-comparison-panel {
  border-radius: 12px;
  box-shadow: none;
}

.director-funnel-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.director-funnel-segment {
  display: grid;
  grid-template-rows: auto auto auto 8px;
  gap: 6px;
  min-width: 0;
  min-height: 104px;
  border: 1px solid #dbe7f2;
  border-radius: 12px;
  padding: 15px 16px 14px;
  color: #162235;
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;
}

.director-funnel-segment::before,
.director-funnel-segment::after {
  display: none;
}

.director-funnel-segment span {
  color: #27364a;
  font-size: 15px;
  font-weight: 900;
}

.director-funnel-segment strong {
  margin: 0;
  font-size: 30px;
}

.director-funnel-segment small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.director-funnel-segment i {
  display: block;
  width: var(--share);
  min-width: 14px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.director-funnel-segment.positive {
  color: #1e9e6a;
}

.director-funnel-segment.warning {
  color: #d97706;
}

.director-funnel-segment.negative {
  color: #dc2626;
}

.director-funnel-segment.neutral {
  color: #2563a8;
}

.director-funnel-segment.selected {
  border-color: #2563a8;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 168, 0.32);
}

.director-funnel-actions {
  min-height: 38px;
}

.director-heatmap {
  margin: 0;
}

.director-heatmap-grid {
  grid-template-columns: minmax(160px, 0.65fr) repeat(var(--cols), minmax(110px, 1fr));
  gap: 8px;
}

.heatmap-head {
  color: #52647a;
  text-transform: none;
}

.heatmap-project,
.heatmap-cell {
  border-radius: 8px;
  box-shadow: none;
}

.heatmap-cell.weak {
  border-color: #f0b8bd;
  background: #f7d5d7;
}

.heatmap-cell.mid {
  border-color: #f2d39f;
  background: #fff2dc;
}

.heatmap-cell.strong {
  border-color: #a9dfc4;
  background: #e8f8f0;
}

.director-comparison-head {
  margin-left: min(250px, 29%);
}

.director-comparison-row {
  border-color: #dbe7f2;
  border-radius: 12px;
  box-shadow: none;
}

.comparison-bar i {
  height: 9px;
  background: linear-gradient(90deg, var(--bar-color) var(--value), #e6edf5 var(--value));
}

.director-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  align-items: start;
}

.director-analytics-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
}

.director-row {
  border-color: #dbe7f2;
  border-radius: 12px;
  box-shadow: none;
}

.director-row-meta {
  gap: 6px;
}

.director-row-meta span,
.director-blocker-tags b {
  border-radius: 999px;
  font-size: 11px;
}

.director-current {
  gap: 12px;
}

.director-risk-list {
  max-height: 180px;
  overflow: auto;
}

.director-analytics-focus {
  display: grid;
  gap: 12px;
}

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

.analytics-focus-grid article,
.analytics-focus-list {
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.analytics-focus-grid span,
.analytics-focus-grid small {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.analytics-focus-grid strong {
  display: block;
  margin: 4px 0;
  color: #162235;
  font-size: 22px;
}

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

.analytics-focus-list p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: #344256;
}

.analytics-focus-list span {
  color: #64748b;
  font-weight: 800;
}

.risk-model-cards {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.model-kpi.model-kpi-compact {
  min-height: 118px;
  border-color: #dbe7f2;
  border-radius: 10px;
  background: #ffffff;
}

.model-kpi.model-kpi-compact span {
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.model-kpi.model-kpi-compact strong {
  color: #162235;
  font-size: 28px;
  line-height: 1;
}

.model-kpi.model-kpi-compact small {
  max-width: 28ch;
  color: #52647a;
  font-size: 12px;
}

.formula-card,
.model-formula,
#modelFormula {
  max-width: 100%;
}

@media (max-width: 1280px) {
  .director-head {
    grid-template-columns: 1fr;
  }

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

  .director-grid,
  .director-analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .director-mode-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .director-funnel-track,
  .risk-model-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .director-comparison-head {
    display: none;
  }

  .director-comparison-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .director-metrics,
  .director-funnel-track,
  .analytics-focus-grid,
  .risk-model-cards {
    grid-template-columns: 1fr;
  }

  .director-heatmap-grid {
    grid-template-columns: 150px repeat(var(--cols), 86px);
    overflow-x: auto;
  }
}

.director-board-panel {
  overflow: hidden;
}

.director-decision-board {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100%;
}

.director-funnel-track {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px;
  width: 100%;
}

.director-funnel-segment {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.2fr) 64px 112px minmax(220px, 2fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 68px;
  border: 1px solid #dbe7f2;
  border-radius: 12px;
  padding: 13px 16px;
  background: #ffffff;
  text-align: left;
}

.director-funnel-segment span {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #27364a;
}

.director-funnel-segment span b {
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

.director-funnel-segment span em {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.25;
}

.director-funnel-segment strong {
  justify-self: end;
  margin: 0;
  color: currentColor;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.director-funnel-segment small {
  justify-self: start;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.director-funnel-segment i {
  display: block;
  width: 100%;
  min-width: 0;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, currentColor var(--fill), #e8eef5 var(--fill));
}

.director-funnel-segment.positive {
  color: #1e9e6a;
}

.director-funnel-segment.warning {
  color: #d97706;
}

.director-funnel-segment.negative {
  color: #dc2626;
}

.director-funnel-segment.neutral {
  color: #2563a8;
}

.director-funnel-segment.selected {
  border-color: #2563a8;
  background: #f4f9ff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 168, 0.24);
}

.director-funnel-actions {
  justify-content: flex-start;
  padding-top: 2px;
}

.director-funnel-actions span {
  max-width: 52ch;
}

@media (max-width: 860px) {
  .director-funnel-segment {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }

  .director-funnel-segment strong {
    grid-column: 2;
    grid-row: 1;
  }

  .director-funnel-segment small {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .director-funnel-segment i {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (max-width: 520px) {
  .director-funnel-segment {
    min-height: 82px;
    padding: 12px;
  }

  .director-funnel-segment span b {
    font-size: 14px;
  }

  .director-funnel-segment span em {
    display: none;
  }

  .director-funnel-segment strong {
    font-size: 26px;
  }
}

.expertise-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 8px 0;
  scrollbar-gutter: stable;
}

.expertise-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title badge"
    "meta meta"
    "summary summary";
  align-items: start;
  gap: 5px 8px;
  width: 100%;
  min-height: 0;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  white-space: normal;
  overflow: visible;
  box-shadow: none;
}

.expertise-item:hover,
.expertise-item.active {
  border-color: rgba(37, 99, 168, 0.42);
  background: #eef6ff;
}

.expertise-item.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.expertise-item.active::after {
  display: none;
}

.expertise-title {
  grid-area: title;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.expertise-meta {
  grid-area: meta;
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.expertise-summary {
  grid-area: summary;
  min-width: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.expertise-open-badge {
  grid-area: badge;
  align-self: start;
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--brand);
  background: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.analysis-progress-panel[hidden] {
  display: none !important;
}

.analysis-progress-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid #cfe0ee;
  border-radius: 12px;
  padding: 13px;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.analysis-progress-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.analysis-progress-copy span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.analysis-progress-copy strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.analysis-progress-copy small {
  max-width: 64ch;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.analysis-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-progress-steps li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-areas:
    "dot title"
    "dot note";
  gap: 2px 7px;
  min-width: 0;
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  padding: 9px;
  background: #ffffff;
}

.analysis-progress-steps li > span {
  grid-area: dot;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
}

.analysis-progress-steps strong {
  grid-area: title;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.analysis-progress-steps small {
  grid-area: note;
  min-width: 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.analysis-progress-steps li.active {
  border-color: rgba(37, 99, 168, 0.42);
  background: #eef6ff;
}

.analysis-progress-steps li.active > span {
  border-color: var(--brand);
  border-top-color: transparent;
  animation: progressSpin 850ms linear infinite;
}

.analysis-progress-steps li.done {
  border-color: rgba(30, 158, 106, 0.35);
  background: #f0fdf4;
}

.analysis-progress-steps li.done > span {
  display: grid;
  place-items: center;
  border-color: var(--ok);
  background: var(--ok);
}

.analysis-progress-steps li.done > span::after {
  content: "";
  width: 6px;
  height: 4px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg);
}

.analysis-progress-steps li.error {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fff7f7;
}

.analysis-progress-steps li.error > span {
  border-color: var(--risk);
  background: var(--risk);
}

.analysis-progress-panel.done {
  border-color: rgba(30, 158, 106, 0.36);
  background: #f3fbf7;
}

.analysis-progress-panel.error {
  border-color: rgba(220, 38, 38, 0.34);
  background: #fff7f7;
}

@media (max-width: 1180px) {
  .analysis-progress-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .expertise-item {
    padding: 10px;
  }

  .analysis-progress-steps {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-progress-steps li.active > span,
  .case-progress li.active > span {
    animation: none;
    border-top-color: var(--brand);
  }
}

.executive-verdict {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px) max-content;
}

.executive-score-card {
  min-width: 230px;
  align-content: center;
  justify-content: stretch;
  padding: 14px 16px;
}

.executive-score-card span:first-child {
  white-space: nowrap;
}

.executive-score-card strong.score-split {
  display: grid;
  grid-template-columns: max-content 1px max-content;
  align-items: end;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.score-ratio,
.score-percent {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.score-ratio b,
.score-percent {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.score-ratio em {
  margin-left: 3px;
  color: #64748b;
  font-size: 20px;
  font-style: normal;
  font-weight: 850;
}

.score-divider {
  width: 1px;
  height: 30px;
  border-radius: 999px;
  background: #dbe7f2;
}

.score-split-plain {
  display: block !important;
  width: auto !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .executive-verdict {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  }

  .executive-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .executive-verdict {
    grid-template-columns: 1fr;
  }

  .executive-score-card {
    min-width: 0;
  }

  .executive-score-card strong.score-split {
    grid-template-columns: max-content 1px max-content;
    width: max-content;
  }
}

@media (max-width: 420px) {
  .executive-score-card strong.score-split {
    gap: 8px;
  }

  .score-ratio b,
  .score-percent {
    font-size: 26px;
  }

  .score-ratio em {
    font-size: 18px;
  }
}

.analysis-progress-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.analysis-progress-metrics span,
.analysis-progress-metrics strong {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #dbe7f2;
  border-radius: 999px;
  padding: 4px 9px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.analysis-progress-metrics strong {
  border-color: rgba(37, 99, 168, 0.28);
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.analysis-progress-track {
  overflow: hidden;
  width: 100%;
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: #e8eef5;
}

.analysis-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 300ms ease;
}

.case-modal-body {
  display: grid;
}

.modal-intake {
  min-height: 0;
}

.modal-actions {
  position: sticky;
  bottom: -20px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.34fr);
  gap: 10px;
  align-items: center;
  margin: 4px -2px -20px;
  padding: 12px 2px 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.86);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), #ffffff 34%);
}

.modal-actions .button,
.modal-actions .button.large {
  width: 100%;
  min-height: 44px;
  white-space: normal;
}

.modal-actions .button:disabled {
  cursor: wait;
}

@media (max-width: 640px) {
  .modal-actions {
    bottom: -14px;
    grid-template-columns: 1fr;
    margin-bottom: -14px;
    padding-bottom: 14px;
  }

  .analysis-progress-metrics {
    align-items: stretch;
  }

  .analysis-progress-metrics span,
  .analysis-progress-metrics strong {
    justify-content: center;
  }
}

#overview.view.active {
  padding-bottom: 28px;
}

#overview .case-screen {
  width: 100%;
  max-width: 1360px;
  display: grid;
  grid-template-rows: none;
  grid-auto-rows: auto;
  gap: 12px;
  min-height: 0;
}

#overview .panel,
#overview .metric,
#overview .executive-verdict {
  border-color: #dbe7f2;
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04);
}

#overview .executive-verdict {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
  grid-template-areas:
    "main score"
    "main meta";
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #ffffff;
}

#overview .executive-verdict[data-tone="negative"] {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fffafa;
}

#overview .executive-verdict[data-tone="positive"] {
  border-color: rgba(30, 158, 106, 0.24);
  background: #f8fffb;
}

#overview .executive-verdict-main {
  grid-area: main;
  align-content: start;
  gap: 8px;
  padding: 2px 0;
}

#overview .executive-verdict-main > span,
#overview .executive-score-card span:first-child {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: none;
}

#overview .executive-verdict .decision-badge {
  min-height: 30px;
  max-width: min(100%, 56rem);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px !important;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

#overview .executive-verdict-main p {
  max-width: 76ch;
  color: #374151;
  font-size: 15px;
  line-height: 1.45;
}

#overview .executive-score-card {
  grid-area: score;
  min-width: 0;
  align-content: center;
  justify-content: stretch;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid #dbe7f2;
  border-radius: 10px;
  background: #f8fafc;
}

#overview .executive-score-card strong.score-split {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  white-space: nowrap;
}

#overview .executive-score-card .score-ratio,
#overview .executive-score-card .score-percent {
  flex: 0 0 auto;
}

#overview .executive-score-card .score-ratio b,
#overview .executive-score-card .score-percent {
  font-size: 27px;
  line-height: 1;
}

#overview .executive-score-card .score-ratio em {
  font-size: 18px;
}

#overview .executive-score-card .score-divider {
  flex: 0 0 1px;
  height: 26px;
}

#overview .executive-meta {
  grid-area: meta;
  justify-content: flex-start;
  align-content: start;
  gap: 7px;
}

#overview .executive-meta .state-pill {
  min-height: 28px;
  max-width: 100%;
  border-color: #dbe7f2;
  background: #ffffff;
  color: #243449;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

#overview .overview-metrics.metrics-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

#overview .overview-metrics .metric {
  height: auto;
  min-height: 84px;
  justify-content: center;
  gap: 8px;
  padding: 13px 14px;
  overflow: visible;
}

#overview .overview-metrics .metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-transform: none;
}

#overview .overview-metrics .metric strong {
  min-width: 0;
  color: #172033;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: normal;
}

#overview #roundValue {
  font-size: 18px;
  line-height: 1.18;
}

#overview .overview-grid {
  grid-template-columns: minmax(0, 0.96fr) minmax(340px, 0.72fr);
  align-items: start;
  gap: 12px;
}

#overview .overview-score-panel,
#overview .overview-deal-panel {
  min-height: 0;
  align-self: start;
  padding: 16px;
  border-radius: 12px;
}

#overview .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#overview .panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

#overview .panel-heading .link-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#overview .overview-score-panel .radar-box {
  width: 100%;
  height: 290px;
  min-height: 290px;
  max-height: 290px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#overview .overview-score-panel .radar-box svg {
  width: min(100%, 560px);
  height: 100%;
  max-height: 290px;
}

#overview .overview-score-panel .flag-lights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

#overview .overview-score-panel .flag-lights > * {
  min-width: 0;
}

#overview .overview-deal-panel .deal-snapshot {
  display: grid;
  gap: 12px;
}

#overview .overview-deal-panel .compact-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#overview .overview-deal-panel .compact-facts > div {
  min-height: 64px;
  padding: 11px 12px;
  overflow: visible;
}

#overview .overview-deal-panel .compact-facts strong,
#overview .overview-deal-panel .compact-facts b {
  overflow-wrap: anywhere;
}

#overview .overview-deal-panel .compact-list {
  max-width: 68ch;
  color: #253246;
}

#overview .overview-flags-panel {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fffafa;
}

#overview .flag-columns {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 12px;
}

#overview .flag-columns > div {
  min-width: 0;
  border-color: #ead6d8;
}

.main-content {
  background:
    linear-gradient(180deg, rgba(37, 99, 168, 0.042), rgba(255, 255, 255, 0) 250px),
    #f3f4f6;
}

.case-header {
  border-radius: 10px;
}

.case-title-row h1,
.page-title h1 {
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.expertise-list {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px;
  padding-right: 2px;
}

.expertise-item {
  flex: 0 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    "title"
    "meta"
    "summary"
    "badge" !important;
  align-items: start !important;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.expertise-title,
.expertise-item .item-title,
.expertise-item strong,
.expertise-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.expertise-title {
  grid-area: title;
}

.expertise-meta {
  grid-area: meta;
}

.expertise-summary {
  grid-area: summary;
}

.expertise-open-badge {
  grid-area: badge;
  justify-self: start;
  margin-top: 2px;
}

.expertise-meta,
.expertise-summary,
.expertise-item .item-subtitle,
.expertise-item .item-summary,
.expertise-item .item-meta,
.expertise-item small {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

.delete-case-button {
  min-height: 42px;
  white-space: normal;
}

.toast,
.notice {
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  #overview .case-screen {
    max-width: 100%;
  }

  #overview .executive-verdict {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  }

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

  #overview .overview-deal-panel .compact-facts {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

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

  .sidebar {
    height: auto;
    max-height: none;
  }

  #overview .executive-verdict {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "score"
      "meta";
  }

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

  #overview .overview-deal-panel .compact-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #overview .flag-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  #overview .case-screen {
    gap: 10px;
  }

  #overview .executive-verdict,
  #overview .overview-score-panel,
  #overview .overview-deal-panel {
    padding: 12px;
  }

  #overview .executive-score-card strong.score-split {
    gap: 8px;
  }

  #overview .executive-score-card .score-ratio b,
  #overview .executive-score-card .score-percent {
    font-size: 24px;
  }

  #overview .executive-score-card .score-ratio em {
    font-size: 16px;
  }

  #overview .overview-metrics.metrics-grid,
  #overview .overview-deal-panel .compact-facts {
    grid-template-columns: 1fr;
  }

  #overview .overview-score-panel .radar-box {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
  }

  #overview .overview-score-panel .radar-box svg {
    max-height: 240px;
  }

  #overview .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.report-row {
  align-items: start;
}

.report-main {
  min-width: 0;
}

.report-date-line {
  flex-wrap: wrap;
  gap: 8px;
}

.report-files-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  padding: 3px 9px;
  color: #2563a8;
  background: #f3f8ff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.report-files-status.warning {
  border-color: #f5c6c6;
  color: #b42318;
  background: #fff5f5;
}

.report-warning {
  margin-top: 8px;
  border: 1px solid #f5c6c6;
  border-radius: 10px;
  padding: 8px 10px;
  color: #8f1d1d;
  background: #fff7f7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.report-links {
  align-items: stretch;
}

.report-links a,
.artifact-button {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 2px;
  padding: 9px 12px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.artifact-button.missing,
.artifact-button.disabled {
  cursor: not-allowed;
  pointer-events: none;
  border-style: dashed;
  color: #64748b;
  background: #f8fafc;
  box-shadow: none;
}

.artifact-button.missing {
  border-color: #f1c6c6;
  color: #b42318;
  background: #fff7f7;
}

.artifact-button small {
  display: block;
  color: inherit;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}

.director-donut {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  padding: 0;
  overflow: hidden;
  background: conic-gradient(from -90deg, var(--donut-color) 0 var(--pct), #e8eef5 var(--pct) 100%);
  box-shadow: inset 0 0 0 1px #dbe7f2;
}

.director-donut::before {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(219, 231, 242, 0.95);
}

.director-donut > * {
  position: relative;
  z-index: 1;
}

.director-donut strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.director-donut span {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1;
  width: 76px;
  max-width: 76px;
  color: #5b6b80;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 720px) {
  .report-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-links a,
  .artifact-button {
    min-height: 40px;
  }

  .director-current-top {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .director-donut {
    width: 96px;
    height: 96px;
  }

  .director-donut::before {
    inset: 10px;
  }

  .director-donut strong {
    font-size: 22px;
  }

  .director-donut span {
    bottom: 15px;
    width: 68px;
    max-width: 68px;
    font-size: 8.5px;
  }
}

#investmentIndex.view.active {
  display: block;
}

.investment-index-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 12px;
  min-width: 0;
}

.investment-index-hero-panel,
.investment-methods-table-panel,
.investment-score-table-panel {
  grid-column: span 2;
}

.investment-index-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid #d6e4f1;
  border-radius: 14px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(37, 99, 168, 0.08), rgba(255, 255, 255, 0.96) 42%),
    #ffffff;
}

.investment-index-ring {
  --ring: var(--brand);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--ring) 0 var(--pct), #e8eef5 var(--pct) 100%);
  box-shadow: inset 0 0 0 1px #dbe7f2;
}

.investment-index-ring::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(219, 231, 242, 0.95);
}

.investment-index-ring.positive {
  --ring: #26a269;
}

.investment-index-ring.warning {
  --ring: #d97706;
}

.investment-index-ring.negative {
  --ring: #dc2626;
}

.investment-index-ring strong,
.investment-index-ring span {
  position: relative;
  z-index: 1;
  line-height: 1;
}

.investment-index-ring strong {
  color: var(--ink);
  font-size: 38px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.investment-index-ring span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.investment-index-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.investment-index-summary > span,
.investment-method-detail-head > div > span,
.method-detail-grid span,
.investment-council span,
.investment-method-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.investment-index-summary h3 {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.12;
}

.investment-index-summary p {
  max-width: 900px;
  color: #405064;
  font-size: 15px;
  line-height: 1.45;
}

.investment-index-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.investment-index-badges span {
  border: 1px solid #cfe0ee;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f6fbff;
  color: #245f9f;
  font-size: 12px;
  font-weight: 900;
}

.investment-index-formula {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.investment-formula-line {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid #cfe0ee;
  border-radius: 12px;
  padding: 11px 13px;
  background: #f6fbff;
  color: #25364a;
}

.investment-formula-line strong {
  color: #165fa8;
}

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

.investment-contribution-list article {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.investment-contribution-list article.positive {
  border-color: #b8e2d2;
}

.investment-contribution-list article.warning {
  border-color: #edd8aa;
}

.investment-contribution-list article.negative {
  border-color: #f0c2c2;
}

.investment-contribution-list strong,
.investment-contribution-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.investment-contribution-list strong {
  color: var(--ink);
  font-size: 13px;
}

.investment-contribution-list span {
  color: var(--muted);
  font-size: 12px;
}

.investment-contribution-list i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #2563a8;
}

.investment-contribution-list article.warning i {
  background: #d97706;
}

.investment-contribution-list article.negative i {
  background: #dc2626;
}

.investment-method-nav {
  display: grid;
  gap: 8px;
}

.investment-method-button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 78px;
  border: 1px solid #dbe7f2;
  border-radius: 12px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.investment-method-button:hover,
.investment-method-button:focus-visible,
.investment-method-button.active {
  border-color: #8bbdf0;
  box-shadow: 0 10px 28px rgba(37, 99, 168, 0.12);
  transform: translateY(-1px);
}

.investment-method-button.active {
  background: #edf6ff;
}

.investment-method-button strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.2;
}

.investment-method-button small {
  color: #516275;
  font-size: 12px;
  font-weight: 800;
}

.investment-method-button.positive {
  border-left: 4px solid #26a269;
}

.investment-method-button.warning {
  border-left: 4px solid #d97706;
}

.investment-method-button.negative {
  border-left: 4px solid #dc2626;
}

.investment-method-detail {
  display: grid;
  gap: 14px;
}

.investment-method-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 14px;
  align-items: stretch;
}

.investment-method-detail-head h2 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
}

.investment-method-detail-head p {
  margin-top: 8px;
  color: #405064;
  line-height: 1.5;
}

.method-score-card {
  display: grid;
  place-items: center;
  border: 1px solid #dbe7f2;
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
  text-align: center;
}

.method-score-card.positive {
  border-color: #b8e2d2;
  background: #f1fbf6;
}

.method-score-card.warning {
  border-color: #edd8aa;
  background: #fffaf0;
}

.method-score-card.negative {
  border-color: #f0c2c2;
  background: #fff7f7;
}

.method-score-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.method-score-card small,
.method-score-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.method-detail-grid article {
  display: grid;
  gap: 6px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfcfd;
}

.method-detail-grid strong {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.investment-table {
  min-width: 980px;
}

.investment-table th,
.investment-table td {
  vertical-align: top;
}

.investment-table td strong,
.investment-table td span {
  display: block;
}

.investment-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.investment-table td b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.score-contribution-table {
  min-width: 760px;
}

.investment-council {
  display: grid;
  gap: 10px;
}

.investment-council article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfcfd;
}

.investment-council strong {
  color: var(--ink);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .investment-index-grid,
  .investment-method-detail-head {
    grid-template-columns: 1fr;
  }

  .investment-index-hero-panel,
  .investment-methods-table-panel,
  .investment-score-table-panel {
    grid-column: span 1;
  }

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

  .method-score-card {
    place-items: start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .case-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .case-tabs::-webkit-scrollbar {
    display: none;
  }

  .case-tabs .nav-item {
    flex: 0 0 auto;
  }

  .investment-index-hero {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .investment-index-ring {
    width: 116px;
    height: 116px;
  }

  .investment-index-ring strong {
    font-size: 32px;
  }

  .investment-index-summary h3,
  .investment-method-detail-head h2 {
    font-size: 22px;
  }

  .investment-contribution-list,
  .method-detail-grid {
    grid-template-columns: 1fr;
  }

  .investment-method-button {
    min-height: 68px;
  }
}

@media (max-width: 520px) {
  .case-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .case-tabs .nav-item {
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    text-align: center;
    white-space: normal;
  }
}

/* investar.tech brand pass: white workspace, black typography, red decision accents */
:root {
  --brand: #e30613;
  --brand-press: #b8000b;
  --risk: #e30613;
  --ink: #121821;
  --ink-soft: #303846;
  --muted: #647084;
  --line: #e1e6ed;
  --bg: #f4f5f7;
  --bg-soft: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f9fafb;
}

body {
  color: var(--ink);
  background: #f4f5f7;
}

.login-body {
  background:
    radial-gradient(circle at 24% 16%, rgba(227, 6, 19, 0.16), transparent 28%),
    linear-gradient(135deg, #0b0d12 0%, #161b23 46%, #ffffff 46%, #f3f5f8 100%);
}

.login-card {
  border-color: rgba(18, 24, 33, 0.1);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(18, 24, 33, 0.18);
}

.login-brand {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-bottom: 24px;
}

.login-brand .brand-copy {
  display: grid;
  gap: 2px;
}

.login-form label {
  color: #465365;
  text-transform: none;
  font-size: 13px;
  font-weight: 800;
}

.login-form input,
.expertise-search input,
.builder-form input,
.builder-form select,
.builder-form textarea {
  color: var(--ink);
  background: #ffffff;
  border-color: #d8dee7;
}

.login-form input::placeholder,
.expertise-search input::placeholder,
.builder-form input::placeholder,
.builder-form textarea::placeholder {
  color: #657184;
}

.login-form input:focus,
.expertise-search input:focus,
.builder-form input:focus,
.builder-form select:focus,
.builder-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.13);
  outline: none;
}

.sidebar {
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid #e6ebf1;
}

.brand {
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: none;
}

.brand-logo {
  display: block;
  width: min(224px, 100%);
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
}

.sidebar .brand {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

.sidebar .brand-copy {
  display: none;
}

.brand-title {
  color: var(--ink);
}

.brand-subtitle,
.status-label,
.expertise-search span {
  color: #69778a;
}

.system-nav {
  gap: 6px;
}

.nav-item,
.system-nav-item {
  color: #243044;
}

.system-nav-item.active,
.system-nav-item.nav-item.active,
.nav-item.active,
.case-tabs .nav-item.active {
  color: var(--brand-press);
  background: #fff1f2;
  border-color: rgba(227, 6, 19, 0.22);
}

.system-nav-item:hover,
.nav-item:hover,
.case-tabs .nav-item:hover {
  color: var(--brand-press);
  background: #fff7f8;
}

.director-mode-tab:hover,
.director-mode-tab:focus-visible,
.director-mode-tab.active {
  color: var(--brand-press);
  background: #fff1f2;
  border-color: rgba(227, 6, 19, 0.24);
}

.director-mode-tab.active {
  box-shadow: inset 0 0 0 1px rgba(227, 6, 19, 0.12);
}

.sidebar-new-button,
.button.primary {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.sidebar-new-button:hover,
.button.primary:hover {
  background: var(--brand-press);
  border-color: var(--brand-press);
}

.button.secondary,
.icon-button,
.danger-ghost-button,
.report-download-button,
.quick-action,
.chip,
.pill {
  border-color: #dbe1ea;
}

.danger-ghost-button {
  color: var(--brand-press);
  background: #fff7f8;
  border-color: rgba(227, 6, 19, 0.22);
}

.danger-ghost-button:hover {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.expertise-switcher {
  border-color: #edf0f4;
}

.expertise-search {
  gap: 7px;
}

.expertise-search input {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 12px;
}

.expertise-empty {
  color: #647084;
  background: #fafbfc;
  border-color: #d8dee7;
}

.expertise-item {
  color: var(--ink);
  background: #ffffff;
  border-color: #e0e6ee;
}

.expertise-item:hover,
.expertise-item.active {
  color: var(--ink);
  background: #fff7f8;
  border-color: rgba(227, 6, 19, 0.3);
}

.expertise-item.active {
  box-shadow: inset 0 0 0 1px rgba(227, 6, 19, 0.16);
}

.expertise-item .status-pill,
.expertise-card-state {
  color: var(--brand-press);
  background: #ffffff;
  border-color: rgba(227, 6, 19, 0.2);
}

.health-dot {
  background: #22a06b;
}

.topbar {
  align-items: center;
}

.topbar-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  line-height: 1.12;
}

.topbar-brand-logo {
  display: none;
  width: 154px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  color: #7a8493;
}

.topbar h1,
.case-context-bar h2,
.panel h2,
.panel h3 {
  color: var(--ink);
}

.app-notice {
  color: #243044;
  background: #ffffff;
  border-color: #d8dee7;
}

.app-notice:not(:empty) {
  border-color: rgba(31, 157, 99, 0.25);
  background: #f1faf5;
}

.case-context-bar,
.case-tabs,
.panel,
.director-hero,
.director-kpi,
.funnel-modern-card,
.portfolio-card,
.verdict-banner,
.metric-card,
.deal-economics,
.analysis-progress-panel {
  border-color: #e1e6ed;
}

.director-hero .eyebrow,
.case-context-bar .eyebrow,
.case-modal .eyebrow {
  color: #1f5f9f;
}

.director-head {
  grid-template-columns: minmax(250px, 0.42fr) minmax(0, 1.58fr);
  gap: 16px;
  padding: 16px;
}

.director-hero-copy {
  gap: 10px;
}

.director-hero-copy h2 {
  max-width: 440px;
  font-size: 28px;
  line-height: 1.08;
}

.director-updated {
  width: fit-content;
}

.analysis-progress-step.current {
  border-color: rgba(227, 6, 19, 0.28);
  background: #fff7f8;
}

.analysis-progress-track i {
  background: linear-gradient(90deg, var(--brand), #111827);
}

.status-control select {
  border-color: #d8dee7;
  background: #ffffff;
}

.status-control select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.13);
  outline: none;
}

a,
.link-button,
.text-link,
.report-link,
.report-download-button,
.panel-action-link {
  color: var(--brand-press);
}

.link-button:hover,
.text-link:hover,
.report-link:hover,
.panel-action-link:hover {
  color: var(--brand);
}

.report-download-button.primary,
.report-download-button.active {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.score-number,
.risk-number,
.portfolio-kpi strong,
.case-score strong {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 920px) {
  .topbar-title-block {
    gap: 10px;
  }

  .topbar-brand-logo {
    display: block;
    width: 132px;
  }

  .topbar-title-block .eyebrow {
    display: none;
  }
}

@media (max-width: 720px) {
  .brand-logo {
    width: 190px;
    max-height: 54px;
  }

  .topbar-brand-logo {
    width: 118px;
  }
}
