:root {
  color-scheme: light;
  --bg: #f7f8f8;
  --surface: #ffffff;
  --surface-soft: #fbfcfc;
  --surface-raised: #ffffff;
  --ink: #0b0d10;
  --ink-2: #1f2328;
  --muted: #69707d;
  --muted-2: #9aa1ae;
  --line: #e4e7eb;
  --line-strong: #cfd5dc;
  --grid: #f1f3f5;
  --accent: #2f7654;
  --accent-dark: #245b43;
  --accent-soft: rgba(47, 118, 84, 0.09);
  --ai-blue: #2563eb;
  --ai-purple: #7c3aed;
  --ai-indigo: #675db6;
  --ai-ink: #39347f;
  --ai-line: rgba(103, 93, 182, 0.32);
  --ai-line-strong: rgba(37, 99, 235, 0.34);
  --ai-soft: rgba(124, 58, 237, 0.075);
  --ai-soft-blue: rgba(37, 99, 235, 0.07);
  --ai-glow: 0 0 0 1px rgba(124, 58, 237, 0.08), 0 18px 52px rgba(37, 99, 235, 0.09);
  --ai-glow-tight: 0 0 0 1px rgba(124, 58, 237, 0.08), 0 10px 26px rgba(37, 99, 235, 0.08);
  --warn: #b26c18;
  --danger: #a3433c;
  --rail: #0b0d10;
  --rail-2: #12161a;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-soft: 0 24px 60px rgba(11, 13, 16, 0.06);
  --shadow-panel: 0 20px 48px rgba(11, 13, 16, 0.05);
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 420ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-linear: linear;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(#dfe4e8 0.8px, transparent 0.8px) 0 0 / 22px 22px,
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #ffffff 100%);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.16;
  background-image: linear-gradient(90deg, rgba(11, 13, 16, 0.05) 1px, transparent 1px);
  background-size: 96px 96px;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

code,
pre,
samp {
  font-family: var(--mono);
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: 72px minmax(360px, 420px) minmax(0, 1fr);
  min-height: 100dvh;
}

.app-shell.auth-shell {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at top, rgba(47, 118, 84, 0.08), transparent 28rem),
    linear-gradient(180deg, #f7f8f8, #eef1f0 70%, #f7f8f8);
}

.app-rail {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  height: 100dvh;
  padding: 18px 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 16rem),
    linear-gradient(180deg, var(--rail-2), var(--rail));
  color: #ffffff;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.rail-brand,
.rail-button,
.rail-avatar,
.icon-button {
  display: grid;
  place-items: center;
}

.rail-button svg,
.rail-button svg * {
  pointer-events: none;
}

.rail-brand {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.inducta-mark {
  position: relative;
  display: block;
  width: 25px;
  height: 25px;
  transform: rotate(-45deg);
}

.inducta-mark::before,
.inducta-mark::after,
.inducta-mark i,
.inducta-mark b {
  content: "";
  position: absolute;
  display: block;
  background: currentColor;
}

.inducta-mark::before {
  width: 12px;
  height: 9px;
  top: 0;
  left: 0;
}

.inducta-mark::after {
  width: 9px;
  height: 13px;
  top: 0;
  right: 0;
}

.inducta-mark i {
  width: 9px;
  height: 13px;
  bottom: 0;
  left: 0;
}

.inducta-mark b {
  width: 12px;
  height: 9px;
  right: 0;
  bottom: 0;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 12px;
}

.rail-button,
.rail-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    color var(--duration-normal) var(--ease-standard),
    background var(--duration-normal) var(--ease-standard);
}

.rail-button:hover,
.rail-button.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.rail-button:active,
.rail-avatar:active,
.icon-button:active,
.primary-button:active,
.secondary-button:active,
.approve-button:active,
.case-item:active {
  transform: translateY(1px) scale(0.98);
}

.rail-avatar {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.rail-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--danger);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.case-dock {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.case-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.case-dock-header span,
.case-dock-header strong,
.case-list-label span,
.eyebrow,
.summary-label,
.intake-readout span,
.metric-strip span,
.batch-results-heading span,
.lane-card span,
.audit-event time,
.provider-grid code,
.phase-status,
.step-heading span,
.workflow-progress-copy span,
label {
  font-family: var(--mono);
}

.case-dock-header span {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.case-dock-header strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  background: var(--surface);
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    border-color var(--duration-normal) var(--ease-standard),
    background var(--duration-normal) var(--ease-standard);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button.subtle {
  width: 32px;
  height: 32px;
}

.case-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 20px;
  padding: 5px 5px 5px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted-2);
  box-shadow: var(--shadow-panel);
}

.case-search span {
  font-size: 13px;
}

.case-list-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.case-list-label span,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-button {
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.case-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.case-item {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 92px;
  padding: 15px 36px 15px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 36px rgba(11, 13, 16, 0.035);
  text-align: left;
  cursor: pointer;
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 42ms);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    border-color var(--duration-normal) var(--ease-standard),
    background var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard);
}

.case-item:hover,
.case-item.active {
  border-color: rgba(47, 118, 84, 0.42);
  background: var(--surface);
  box-shadow: 0 22px 44px rgba(11, 13, 16, 0.07);
}

.case-item:hover {
  transform: translateY(-2px);
}

.case-item span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.case-item strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.case-item small {
  color: var(--muted);
  font-size: 12px;
}

.case-item i {
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.empty-case-list {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-case-list strong {
  color: var(--ink);
}

.empty-case-list p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.main-content {
  min-width: 0;
  padding: 32px clamp(24px, 3vw, 52px) 48px;
}

.approval-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.approval-list-panel,
.approval-detail-panel,
.approvals-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-panel);
}

.approval-list-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

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

.approval-list-head h2,
.approval-detail-header h1,
.approvals-empty h2 {
  margin: 0;
  letter-spacing: 0;
}

.approval-list-head h2 {
  font-size: 22px;
}

.approval-list-head span,
.approval-row span,
.approval-row small,
.approval-row em,
.approval-context span,
.approval-metrics span,
.approval-status {
  font-family: var(--mono);
}

.approval-list-head span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.approval-list {
  display: grid;
  max-height: calc(100dvh - 170px);
  overflow: auto;
}

.approval-row {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 45ms);
  transition:
    background var(--duration-normal) var(--ease-standard),
    transform var(--duration-normal) var(--ease-spring);
}

.approval-row:hover,
.approval-row.active {
  background: var(--accent-soft);
}

.approval-row strong {
  font-size: 15px;
}

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

.approval-row em,
.approval-status {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--warn);
  background: rgba(178, 108, 24, 0.12);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-detail-panel,
.approvals-empty {
  padding: clamp(20px, 3vw, 34px);
}

.approval-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.approval-detail-header h1 {
  margin-top: 4px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.02;
}

.approval-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 700;
}

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

.approval-metrics article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.approval-metrics span,
.approval-context span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.approval-metrics strong {
  font-size: 20px;
  line-height: 1.1;
}

.approval-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.approval-context div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.approval-context strong {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-reason {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.approval-reason h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.approval-reason p {
  margin: 0 0 10px;
  color: var(--ink-2);
  line-height: 1.5;
}

.approval-reason ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.approval-action-form {
  display: grid;
  gap: 12px;
}

.approval-action-form textarea,
.approval-action-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.approval-adjustments {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.approval-adjustments h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.approval-adjustment-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.approval-adjustment-row strong,
.approval-adjustment-row span {
  display: block;
}

.approval-adjustment-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.approval-adjustment-row label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 760;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.approval-actions button {
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: #ffffff;
  font-weight: 780;
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    filter var(--duration-normal) var(--ease-standard);
}

.approval-actions button:active,
.approval-row:active {
  transform: translateY(1px) scale(0.98);
}

.approval-approve {
  background: var(--accent-dark);
}

.approval-reprice {
  background: var(--warn);
}

.approval-reject {
  background: var(--danger);
}

.approval-actions button:hover {
  filter: brightness(0.94);
}

.approvals-empty {
  max-width: 720px;
}

.approvals-empty p {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .approval-adjustment-row {
    grid-template-columns: 1fr;
  }
}

.case-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
}

.case-hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 16px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.02;
  text-wrap: balance;
}

.title-route {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  white-space: nowrap;
}

.route-arrow {
  font-weight: 520;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.case-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.case-meta svg {
  width: 16px;
  height: 16px;
}

.case-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-panel);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  animation: live-pulse 1800ms var(--ease-standard) infinite;
}

.live-dot.online {
  background: var(--accent);
}

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

.live-dot.offline {
  background: var(--muted-2);
  animation: none;
}

.panel,
.side-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-panel);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
}

.section-heading,
.analysis-title-row,
.step-heading,
.batch-results-heading,
.workflow-progress-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h3,
.analysis-title-row h2,
.drawer-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.15;
}

.compact-heading {
  margin-bottom: 12px;
}

.badge,
.decision-pill,
.status-chip,
.phase-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  max-width: 100%;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.ok,
.decision-pill.viable,
.status-chip.completed,
.status-chip.stable,
.phase-status.ok {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.26);
  background: var(--accent-soft);
}

.status-chip.matched,
.status-chip.ready,
.phase-status.running {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.28);
  background: var(--accent-soft);
}

.badge.warning,
.decision-pill.negotiable,
.decision-pill.review-required,
.status-chip.review-required,
.phase-status.warning {
  color: var(--warn);
  border-color: rgba(178, 108, 24, 0.26);
  background: rgba(178, 108, 24, 0.08);
}

.badge.danger,
.decision-pill.not-recommended,
.status-chip.blocked,
.phase-status.danger {
  color: var(--danger);
  border-color: rgba(163, 67, 60, 0.24);
  background: rgba(163, 67, 60, 0.08);
}

.ai-reasoning-panel {
  animation-delay: 60ms;
}

.analysis-title-row {
  align-items: center;
  margin-bottom: 18px;
}

.workflow-progress-block {
  min-width: min(320px, 42vw);
  max-width: 100%;
  min-inline-size: 0;
}

.workflow-progress-copy {
  align-items: center;
  margin-bottom: 8px;
}

.workflow-progress-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workflow-progress-copy strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
}

.workflow-progress,
.phase-progress {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #edf0f2;
}

.workflow-progress div,
.phase-progress div {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  min-width: 0;
  transform: scaleX(var(--progress-ratio, 0));
  transform-origin: left center;
  transition: transform var(--progress-duration, 1000ms) var(--ease-linear);
  will-change: transform;
}

.workflow-progress div::after,
.phase-progress div::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: none;
}

.workflow-progress.active div::after,
.phase-progress.active div::after {
  opacity: 0.42;
  animation: shimmer 1800ms linear infinite;
}

.ai-run-meta {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.process-timeline {
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.phase-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.phase-icon svg {
  width: 18px;
  height: 18px;
}
.ai-tag {
  position: absolute;
  bottom: -3px;
  right: -5px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--accent, #6366f1);
  color: #fff;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1.3;
  font-style: normal;
  pointer-events: none;
}
@keyframes phase-spin {
  to { transform: rotate(360deg); }
}
.phase-icon-spin svg {
  animation: phase-spin 1.6s linear infinite;
  transform-origin: center;
}
.step-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex-wrap: wrap;
}

.step-heading span,
.phase-message,
.phase-activity,
.ai-phase-placeholder,
.ai-phase-text {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.process-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 48ms);
  transition:
    background var(--duration-normal) var(--ease-standard),
    transform var(--duration-normal) var(--ease-spring);
}

.process-step + .process-step {
  border-top: 1px solid var(--line);
}

.process-step.running {
  background: linear-gradient(90deg, var(--accent-soft), var(--surface));
}

.process-step.completed .step-node {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.process-step.running .step-node {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.38);
  background: #ffffff;
  animation: live-pulse 1600ms var(--ease-standard) infinite;
}

.process-step.queued {
  color: var(--muted);
}

.step-node {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.step-content {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.step-heading {
  align-items: center;
}

.step-heading span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 0;
  overflow-wrap: anywhere;
}

.phase-message {
  position: relative;
  z-index: 0;
  min-height: 1.35em;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition:
    opacity var(--duration-normal) var(--ease-standard),
    transform var(--duration-normal) var(--ease-standard);
}

.ai-phase.running .phase-message {
  padding-left: 28px;
  color: var(--ink-2);
  font-weight: 500;
}

.ai-phase.running .phase-message::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.05em;
  z-index: -1;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(47, 118, 84, 0.22);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 42%, rgba(47, 118, 84, 0.2) 0 2px, transparent 2.4px),
    radial-gradient(circle at 35% 58%, rgba(47, 118, 84, 0.34) 0 1.6px, transparent 2px),
    radial-gradient(circle at 65% 58%, rgba(47, 118, 84, 0.34) 0 1.6px, transparent 2px),
    rgba(47, 118, 84, 0.06);
  animation: thinking-halo 1800ms var(--ease-standard) infinite;
}

.thinking-dots {
  display: none;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.ai-phase.running .thinking-dots {
  display: inline-flex;
}

.thinking-dots i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.36;
  animation: thinking-dot 1050ms var(--ease-standard) infinite;
  animation-delay: calc(var(--dot-index, 0) * 120ms);
}

.thinking-dots i:nth-child(2) {
  --dot-index: 1;
}

.thinking-dots i:nth-child(3) {
  --dot-index: 2;
}

.phase-text-out {
  opacity: 0.28;
  transform: translateY(-4px);
}

.phase-text-in,
.status-text-in {
  animation: phase-text-in 280ms var(--ease-standard) both;
}

.phase-activity {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  transition:
    opacity var(--duration-normal) var(--ease-standard),
    transform var(--duration-normal) var(--ease-standard);
}

.ai-phase-text,
.ai-phase-placeholder {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.process-step.completed .ai-phase-placeholder {
  display: none;
}

.reasoning-bullet {
  display: block;
  position: relative;
  padding-left: 14px;
}

.reasoning-bullet::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.workspace-grid,
.analysis-grid,
.technical-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.bottom-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

.intake-readout,
.metric-strip,
.summary-metrics {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  gap: 1px;
}

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

.intake-readout div,
.metric-strip article,
.summary-metrics article {
  min-width: 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.94);
}

.intake-readout span,
.metric-strip span,
.summary-metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intake-readout strong,
.metric-strip strong,
.summary-metrics strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.raw-message,
.json-card pre,
.audit-event pre,
.email-draft-card pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(#dfe4e8 0.8px, transparent 0.8px) 0 0 / 18px 18px,
    var(--surface-soft);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.raw-message {
  min-height: 230px;
}

.decision-copy {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
}

.decision-copy p,
.risk-block p,
.detail-card p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
}

.final-rfq-workspace,
.history-workspace {
  align-content: start;
}

.final-rfq-layout {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

.final-rfq-summary {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.final-quote-card {
  position: relative;
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: clamp(20px, 2vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.1), transparent 28%),
    linear-gradient(145deg, #11161a 0%, var(--rail) 72%);
  color: #f8faf9;
  box-shadow: 0 24px 70px rgba(11, 13, 16, 0.18);
  animation: final-card-in var(--duration-slow) var(--ease-out) both;
}

.final-quote-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  opacity: 0.5;
  transform: translate(42px, 42px);
}

.final-quote-card .eyebrow,
.final-quote-card span {
  color: rgba(248, 250, 249, 0.64);
}

.final-quote-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.final-quote-head h2 {
  margin: 8px 0 0;
  color: #ffffff;
  font-family: var(--mono);
  font-size: clamp(32px, 3.2vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.95;
}

.final-quote-head > span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.final-quote-status svg {
  width: 14px;
  height: 14px;
}

.final-rate-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  gap: 1px;
}

.final-rate-metrics article {
  min-width: 0;
  padding: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.final-rate-metrics span,
.codex-reasoning span {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.final-rate-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 14px;
}

.codex-reasoning {
  position: relative;
  z-index: 1;
  padding-top: 4px;
}

.codex-reasoning p {
  margin: 0;
  color: rgba(248, 250, 249, 0.86);
  font-size: 14px;
  line-height: 1.6;
}

.final-quote-card.reasoning-pending .codex-reasoning p {
  color: rgba(248, 250, 249, 0.58);
}

.commercial-proposal-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: clamp(18px, 1.8vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 250, 0.82)),
    var(--surface);
  box-shadow: 0 18px 44px rgba(31, 35, 40, 0.07);
  animation: final-card-in var(--duration-slow) var(--ease-out) both;
  animation-delay: 35ms;
}

.commercial-proposal-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.15;
}

.commercial-proposal-card p:not(.eyebrow) {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.commercial-proposal-card.pending {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.74);
}

.ai-insight-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  animation: final-panel-in var(--duration-slow) var(--ease-out) both;
  animation-delay: 50ms;
}

.ai-insight-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.ai-insight-head h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 16px;
}

.ai-insight-head > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ai-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 10px;
}

.ai-insight-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 132px;
  max-height: 162px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid rgba(103, 93, 182, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(103, 93, 182, 0.08), rgba(63, 125, 180, 0.06)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(31, 35, 64, 0.06);
  animation: final-panel-in var(--duration-slow) var(--ease-out) both;
  animation-delay: calc(var(--index) * 44ms);
}

.ai-insight-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.96));
}

.ai-insight-card span {
  color: #4b468f;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ai-insight-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.46;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ai-insight-card.pending {
  border-color: rgba(105, 112, 125, 0.24);
  background: rgba(255, 255, 255, 0.74);
}

.insight-more-btn {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: start;
  min-height: 26px;
  padding: 0;
  color: #4b468f;
  background: transparent;
  font-size: 12px;
}

.reasoning-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.reasoning-modal-layer[hidden] {
  display: none;
}

.reasoning-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 16, 0.42);
}

.reasoning-modal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(720px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(103, 93, 182, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-panel);
  animation: final-card-in var(--duration-slow) var(--ease-out) both;
}

.reasoning-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.reasoning-modal-head h2 {
  margin: 2px 0 0;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.1;
}

.reasoning-modal-body {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
}

/* ─── Config Modal ────────────────────────────────────────────────────────── */

.config-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.config-modal-layer[hidden] { display: none; }
.config-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 16, 0.42);
  border: none;
  cursor: default;
}
.config-modal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: min(88dvh, calc(100dvh - 48px));
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface, #fff);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: final-card-in var(--duration-slow) var(--ease-out) both;
}
.config-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.config-modal-head h2 {
  margin: 4px 0 0;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.15;
}
.config-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 2px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Inputs inside modal — match config-workspace design system */
.config-modal input:not([type="checkbox"]),
.config-modal select {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px var(--sans);
  transition: border-color 120ms, box-shadow 120ms;
}
.config-modal input:not([type="checkbox"]):focus,
.config-modal select:focus {
  outline: none;
  border-color: rgba(47, 118, 84, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.config-modal input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}
.config-modal label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.config-modal-body .quote-engine-actions {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.config-modal-body .approve-button {
  width: 100%;
  justify-content: center;
}

.form-action-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(159, 47, 45, 0.24);
  border-radius: 8px;
  background: var(--qe-red-bg);
  color: var(--qe-red);
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
}

/* ─── TSR Chip Selector ───────────────────────────────────────────────────── */

.tsr-chip-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}
.tsr-chip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(24px, auto);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 160ms, background 160ms, color 160ms, transform 160ms;
  user-select: none;
}
.tsr-chip:hover {
  transform: none;
  background: rgba(47, 118, 84, 0.035);
}
.tsr-chip input[type="checkbox"] { display: none; }
.tsr-chip.is-selected {
  background: rgba(47, 118, 84, 0.055);
  color: var(--accent-dark);
}
.tsr-chip-main {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
}
.tsr-chip-code {
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  line-height: 1;
}
.tsr-chip-name {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tsr-chip.is-selected .tsr-chip-code,
.tsr-chip.is-selected .tsr-chip-name { color: var(--accent-dark); }
.tsr-chip-id {
  grid-column: 1;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tsr-chip-check {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: transparent;
  background: #ffffff;
}
.tsr-chip-check svg {
  width: 14px;
  height: 14px;
}
.tsr-chip.is-selected .tsr-chip-check {
  border-color: rgba(47, 118, 84, 0.32);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* ─── Modal form grid ─────────────────────────────────────────────────────── */

.modal-company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.modal-company-grid .span-2 { grid-column: span 2; }
.modal-company-grid .span-3 { grid-column: span 3; }
.modal-field-label {
  display: block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.modal-profile-grid .span-2 { grid-column: span 2; }

/* ─── Unit profile detail card ────────────────────────────────────────────── */

.unit-profile-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  animation: final-card-in var(--duration-fast) var(--ease-out) both;
}
.unit-profile-detail[hidden] { display: none; }
.unit-profile-detail-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.unit-profile-detail-head strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.unit-profile-detail-head span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ─── Company list (read-only) ────────────────────────────────────────────── */

.company-list-readonly {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.company-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft, rgba(0,0,0,0.02));
}
.company-list-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.company-list-id {
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--muted, #888);
}
.company-list-tsrs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tsr-badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(103, 93, 182, 0.10);
  color: var(--ink-2, #444);
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
}
.tsr-badge-empty {
  background: transparent;
  color: var(--muted, #888);
  font-weight: 400;
}
.config-empty {
  padding: 16px 0;
  color: var(--muted, #888);
  font-size: 13px;
}

/* ─── Matrix read-only rows ───────────────────────────────────────────────── */

.config-matrix-row-readonly {
  cursor: default;
}
.matrix-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
.status-inactive {
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
}

/* ─── Formula profile tabs ────────────────────────────────────────────────── */

.formula-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.formula-tab-btn {
  padding: 5px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2, #555);
  font-size: 13px;
  cursor: pointer;
  transition: background 100ms, border-color 100ms, color 100ms;
}
.formula-tab-btn:hover {
  border-color: var(--accent, #6b5fe2);
  background: rgba(103, 93, 182, 0.06);
}
.formula-tab-btn.is-active {
  border-color: var(--accent, #6b5fe2);
  background: rgba(103, 93, 182, 0.10);
  color: var(--ink, #111);
  font-weight: 600;
}

/* ─── End config UI additions ─────────────────────────────────────────────── */

.commercial-decision-panel {
  animation: final-panel-in var(--duration-slow) var(--ease-out) both;
  animation-delay: 70ms;
}

.decision-report {
  display: grid;
  gap: 10px;
}

.viability-card,
.decision-report-card,
.decision-report-note {
  border-radius: var(--radius);
}

.viability-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(47, 118, 84, 0.18);
  background:
    linear-gradient(135deg, rgba(47, 118, 84, 0.12), rgba(47, 118, 84, 0.04)),
    rgba(255, 255, 255, 0.88);
}

.viability-card.status-approved {
  background:
    linear-gradient(135deg, rgba(47, 118, 84, 0.13), rgba(47, 118, 84, 0.045)),
    rgba(255, 255, 255, 0.86);
}

.viability-card.status-pending {
  border-color: rgba(178, 108, 24, 0.2);
  background:
    linear-gradient(135deg, rgba(178, 108, 24, 0.13), rgba(178, 108, 24, 0.04)),
    rgba(255, 255, 255, 0.88);
}

.viability-card.status-risk {
  border-color: rgba(163, 67, 60, 0.2);
  background:
    linear-gradient(135deg, rgba(163, 67, 60, 0.12), rgba(163, 67, 60, 0.04)),
    rgba(255, 255, 255, 0.88);
}

.commercial-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid rgba(47, 118, 84, 0.24);
  border-radius: 999px;
  background: rgba(47, 118, 84, 0.1);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
}

.commercial-status-badge svg {
  width: 13px;
  height: 13px;
}

.viability-card strong {
  color: var(--ink-2);
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.32;
}

.decision-report-card,
.decision-report-note {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.decision-report-card span,
.decision-report-note span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.decision-report-card p,
.decision-report-note p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.48;
}

.decision-report-note {
  background: var(--surface-soft);
}

.commercial-metric-strip,
.commercial-technical-grid {
  margin-top: 16px;
}

.operational-moves-widget {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, var(--ink) 8%);
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) 1fr;
  gap: 14px;
}

.operational-moves-widget h4 {
  margin: 3px 0 0;
  font-size: 0.95rem;
}

.operational-move-list {
  display: grid;
  gap: 10px;
}

.operational-move-list article {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.operational-move-list span,
.operational-move-list small {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.operational-move-list strong {
  display: block;
  margin: 4px 0;
}

.return-policy-card {
  background: rgba(255, 255, 255, 0.86);
}

.return-policy-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-top: 12px;
}

.return-policy-list {
  align-content: start;
}

.return-policy-copy,
.return-cost-summary {
  display: grid;
  gap: 10px;
}

.return-policy-copy p,
.return-cost-summary p,
.cost-breakdown-note,
.return-policy-note {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}

.return-cost-summary > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.return-cost-summary > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
  gap: 1px;
}

.return-cost-summary article {
  min-width: 0;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.return-cost-summary small {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.return-cost-summary strong {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  text-overflow: ellipsis;
}

.history-workspace {
  gap: 18px;
}

.history-section {
  animation: final-panel-in var(--duration-slow) var(--ease-out) both;
}

.batch-results-section {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  animation: final-panel-in var(--duration-slow) var(--ease-out) both;
}

.is-retracting {
  pointer-events: none;
  clip-path: inset(0 0 100% 0 round var(--radius));
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  transition:
    clip-path 180ms var(--ease-standard),
    opacity 180ms var(--ease-standard),
    transform 180ms var(--ease-standard);
}

.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}

.metric-strip strong {
  font-size: clamp(16px, 1.4vw, 21px);
}

.technical-grid {
  margin-top: 16px;
}

.technical-block,
.risk-block,
.detail-card,
.email-draft-card,
.json-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.detail-card,
.email-draft-card,
.json-card {
  margin-top: 12px;
}

.technical-block h4,
.risk-block h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
}

.data-list {
  display: grid;
  grid-template-columns: minmax(124px, 0.82fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}

.data-list dt {
  color: var(--muted);
}

.data-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
  font-family: var(--mono);
  font-weight: 650;
  overflow-wrap: anywhere;
}

details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.email-draft-card summary {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.email-draft-card summary span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-card ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.batch-results {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.batch-results-heading strong {
  color: var(--ink-2);
  font-size: 14px;
}

.batch-results-grid,
.batch-queue {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.batch-result-card,
.batch-queue-item,
.lane-card,
.audit-event {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 42ms);
}

.batch-result-card,
.batch-queue-item,
.lane-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.batch-result-card {
  width: 100%;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

.batch-result-card:hover,
.batch-result-card.active {
  border-color: rgba(34, 89, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(34, 89, 255, 0.12);
}

.batch-result-card span,
.batch-queue-item span,
.batch-queue-item em,
.lane-card span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.batch-result-card strong,
.batch-queue-item strong,
.lane-card strong {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.batch-result-card dl,
.lane-card dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  margin: 0;
}

.batch-result-card dt,
.batch-result-card dd,
.lane-card dt,
.lane-card dd {
  margin: 0;
  font-size: 12px;
}

.batch-result-card dt,
.lane-card dt {
  color: var(--muted);
}

.batch-result-card dd,
.lane-card dd {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 650;
  text-align: right;
}

.batch-result-card p,
.lane-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.batch-queue {
  margin: 12px 0 16px;
}

.batch-queue-summary {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.batch-queue-item.running {
  border-color: rgba(47, 118, 84, 0.32);
  background: var(--accent-soft);
}

.batch-queue-item.completed em {
  color: var(--accent-dark);
}

.active-batch-stage {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 14px 0 4px;
}

.active-batch-stage h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.active-batch-stage span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lane-grid,
.audit-log {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.lane-card.active,
.lane-card:hover {
  border-color: rgba(47, 118, 84, 0.38);
  background: var(--accent-soft);
}

.audit-event {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.audit-event.warning {
  border-color: rgba(178, 108, 24, 0.24);
  background: rgba(178, 108, 24, 0.06);
}

.audit-event strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}

.audit-event p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.audit-event pre {
  max-height: 180px;
  margin-top: 10px;
}

.summary-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
  padding: 32px 24px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.summary-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: 90ms;
}

.dock-summary {
  margin-bottom: 20px;
}

.dock-summary-secondary {
  margin-top: 20px;
  padding: 22px;
  gap: 14px;
  background:
    radial-gradient(#eef1f3 0.8px, transparent 0.8px) 0 0 / 18px 18px,
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(11, 13, 16, 0.035);
}

.dock-summary .summary-price strong,
.dock-summary-secondary .summary-price strong {
  font-size: clamp(31px, 2.3vw, 38px);
}

.dock-summary-secondary .summary-price {
  padding-bottom: 14px;
}

.dock-summary-secondary .summary-metrics strong {
  font-size: 16px;
}

.dock-summary-secondary .approve-button,
.dock-summary-secondary .secondary-button {
  min-height: 40px;
}

.summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.summary-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-price strong {
  color: var(--ink);
  font-size: clamp(34px, 3.2vw, 48px);
  line-height: 1;
}

.summary-price span {
  color: var(--ink-2);
  font-weight: 750;
}

.competitive-range {
  display: grid;
  gap: 10px;
}

.competitive-range span,
.competitive-range em,
.summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.competitive-range strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
}

.range-line {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 118, 84, 0.35), rgba(47, 118, 84, 0.9), rgba(47, 118, 84, 0.35));
}

.range-line i,
.range-line b {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent-dark);
  transform: translate(-50%, -50%);
}

.range-line i {
  opacity: 0.78;
}

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

.summary-metrics strong {
  font-size: 18px;
  line-height: 1.05;
  white-space: nowrap;
}

.risk-value {
  color: var(--accent-dark) !important;
}

.approve-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 720;
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    background var(--duration-normal) var(--ease-standard),
    border-color var(--duration-normal) var(--ease-standard),
    color var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard);
}

.approve-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffffff;
  background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.approve-button {
  width: 100%;
}

.approve-button:hover,
.primary-button:hover {
  background: #15191d;
  box-shadow: 0 18px 36px rgba(11, 13, 16, 0.18);
}

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.summary-actions,
.demo-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.drawer-layer.open {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 16, 0);
  cursor: default;
  transition: background var(--duration-slow) var(--ease-standard);
}

.drawer-layer.open .drawer-backdrop {
  background: rgba(11, 13, 16, 0.28);
}

.intake-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100dvh;
  overflow: auto;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -30px 0 80px rgba(11, 13, 16, 0.16);
  transform: translateX(104%);
  transition: transform var(--duration-slow) var(--ease-standard);
}

.drawer-layer.open .intake-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.intake-drawer .intake-panel {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  animation: none;
}

.demo-actions {
  margin-bottom: 16px;
}

.demo-actions .secondary-button {
  min-height: 36px;
  font-family: var(--mono);
  font-size: 11px;
}

.intake-form {
  display: grid;
  gap: 11px;
}

label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  min-height: 270px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--ink-2);
  background: var(--surface-soft);
  line-height: 1.55;
  transition:
    border-color var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard),
    background var(--duration-normal) var(--ease-standard);
}

textarea:focus {
  border-color: rgba(47, 118, 84, 0.5);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

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

.empty-state {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  max-width: 44ch;
  margin: 0;
  line-height: 1.55;
}

.compact-empty {
  min-height: 118px;
}

/* QuoteOps operational redesign */
body {
  background:
    radial-gradient(rgba(31, 35, 40, 0.07) 0.6px, transparent 0.6px) 0 0 / 28px 28px,
    linear-gradient(180deg, #ffffff 0%, #f7f8f8 52%, #ffffff 100%);
}

body::before {
  opacity: 0.045;
  background-size: 128px 128px;
}

.app-shell {
  grid-template-columns: 56px minmax(304px, 356px) minmax(0, 1fr);
}

.app-rail {
  gap: 18px;
  padding: 14px 8px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: none;
}

.rail-brand,
.rail-button,
.rail-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.rail-brand {
  background: var(--ink);
  color: #ffffff;
  box-shadow: none;
}

.rail-button,
.rail-avatar {
  color: var(--muted);
}

.rail-button:hover,
.rail-button.active {
  color: var(--ink);
  background: #f0f2f3;
}

.rail-button.active::before {
  content: "";
  position: absolute;
  left: -8px;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--ink);
}

.rail-avatar {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
  font-weight: 600;
}

.rail-badge {
  right: 4px;
  top: 4px;
  min-width: 15px;
  height: 15px;
  background: var(--ink);
  font-weight: 600;
}

.case-dock {
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.case-dock-header {
  margin-bottom: 14px;
}

.case-dock-header span {
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
}

.case-dock-header strong {
  font-size: 11px;
  font-weight: 500;
}

.dock-status {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dock-status-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dock-status-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.dock-status-head small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

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

.dock-status-grid div {
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
}

.dock-status-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
}

.dock-status-grid strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-live-state.online {
  color: var(--accent-dark);
}

.home-live-state.warning {
  color: var(--warn);
}

.home-live-state.offline {
  color: var(--muted);
}

.queue-module {
  grid-column: span 1;
}

.queue-list article {
  border-left: 2px solid transparent;
}

.queue-list article.queued {
  border-left-color: var(--muted-2);
}

.queue-list article.processing {
  border-left-color: var(--ink);
}

.queue-list article.failed {
  border-left-color: var(--danger);
}

.queue-list article.processed {
  border-left-color: var(--accent);
}

.case-search {
  min-height: 38px;
  margin-bottom: 14px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.case-list-label {
  margin-bottom: 8px;
}

.case-list-label span,
.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.text-button {
  font-weight: 600;
}

.case-list {
  gap: 0;
  border-top: 1px solid var(--line);
}

.case-item {
  min-height: 66px;
  gap: 4px;
  padding: 11px 10px 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.case-item:hover,
.case-item.active {
  border-color: var(--line);
  background: rgba(247, 248, 248, 0.9);
  box-shadow: none;
}

.case-item:hover {
  transform: none;
}

.case-item span {
  font-size: 10px;
  font-weight: 500;
}

.case-item strong {
  font-size: 13px;
  font-weight: 600;
}

.case-item small {
  font-size: 11px;
}

.case-item i {
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  height: auto;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
}

.case-item.active i {
  background: var(--ink);
}

.main-content {
  padding: 24px clamp(20px, 2.6vw, 42px) 42px;
}

.case-hero {
  margin-bottom: 18px;
}

.case-hero h1 {
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.08;
}

.case-meta {
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
}

.case-hero-status {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  box-shadow: none;
  font-weight: 600;
}

.panel,
.side-section,
.approval-list-panel,
.approval-detail-panel,
.approvals-empty {
  border-color: rgba(228, 231, 235, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

.panel {
  padding: 18px;
  margin-bottom: 14px;
}

.section-heading h3,
.analysis-title-row h2,
.drawer-header h2 {
  font-size: clamp(17px, 1.3vw, 21px);
  font-weight: 600;
}

.badge,
.decision-pill,
.status-chip,
.phase-status,
.approval-status {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--muted);
  border-color: transparent;
  background: #f1f2f3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.ok,
.decision-pill.viable,
.status-chip.completed,
.status-chip.stable,
.status-chip.matched,
.status-chip.ready,
.phase-status.ok,
.phase-status.running {
  color: var(--ink-2);
  border-color: transparent;
  background: #eef0f1;
}

.badge.warning,
.decision-pill.negotiable,
.decision-pill.review-required,
.status-chip.review-required,
.phase-status.warning {
  color: #8a5a17;
  background: rgba(178, 108, 24, 0.09);
}

.badge.danger,
.decision-pill.not-recommended,
.status-chip.blocked,
.phase-status.danger {
  color: var(--danger);
  background: rgba(163, 67, 60, 0.08);
}

.decision-pill.status-approved,
.commercial-status-badge.status-approved,
.final-quote-status.status-approved {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.28);
  background: rgba(47, 118, 84, 0.12);
}

.decision-pill.status-pending,
.commercial-status-badge.status-pending,
.final-quote-status.status-pending {
  color: #8a5a17;
  border-color: rgba(178, 108, 24, 0.28);
  background: rgba(178, 108, 24, 0.1);
}

.decision-pill.status-risk,
.commercial-status-badge.status-risk,
.final-quote-status.status-risk {
  color: var(--danger);
  border-color: rgba(163, 67, 60, 0.26);
  background: rgba(163, 67, 60, 0.09);
}

.decision-pill svg {
  width: 13px;
  height: 13px;
}

.analysis-title-row {
  margin-bottom: 14px;
}

.workflow-progress-block {
  width: min(620px, 56vw);
  min-width: min(420px, 56vw);
  max-width: 100%;
}

.workflow-progress,
.phase-progress {
  height: 4px;
  background: #eef0f1;
}

.workflow-progress div,
.phase-progress div {
  background: var(--ink);
}

.workflow-progress div::after,
.phase-progress div::after {
  opacity: 0;
  animation-duration: 2200ms;
}

.workflow-progress.active div::after,
.phase-progress.active div::after {
  opacity: 0.22;
}

.ai-run-meta {
  margin: -4px 0 12px;
  font-size: 12px;
}

.analysis-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 14px;
}

.process-timeline {
  border-radius: 8px;
  background: #ffffff;
}

.process-step {
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 78px;
  padding: 12px 14px;
}

.process-step.running {
  background: linear-gradient(90deg, #f4f5f5, #ffffff);
}

.process-step.completed .step-node,
.process-step.running .step-node {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #ffffff;
  animation: none;
}

.step-node {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.step-content {
  gap: 6px;
}

.step-heading span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.phase-message {
  font-size: 13px;
  font-weight: 500;
}

.ai-phase.running .phase-message {
  padding-left: 0;
}

.ai-phase.running .phase-message::before {
  display: none;
}

.phase-activity {
  font-size: 12px;
  line-height: 1.35;
}

.ai-phase-text,
.ai-phase-placeholder {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.activity-feed {
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.activity-feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.activity-feed-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.activity-feed-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.activity-feed-list {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 36ms);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.activity-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.activity-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.activity-item.danger {
  background: rgba(163, 67, 60, 0.045);
}

.home-workspace {
  display: grid;
  gap: 18px;
  align-content: start;
}

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.home-header h1 {
  margin: 0;
  font-size: clamp(24px, 2.5vw, 38px);
  font-weight: 600;
  line-height: 1.08;
}

.home-live-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

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

.home-kpis article {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.home-kpis span,
.home-module-head span,
.home-module dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.home-kpis strong {
  display: block;
  margin: 7px 0 5px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-kpis small {
  color: var(--muted);
  font-size: 12px;
}

.home-kpis article.attention {
  background: rgba(163, 67, 60, 0.045);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 14px;
}

.home-module {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.recent-module {
  grid-column: 1 / -1;
}

.operation-module {
  border-color: rgba(47, 118, 84, 0.2);
  background:
    linear-gradient(180deg, rgba(47, 118, 84, 0.055), rgba(255, 255, 255, 0.9)),
    #ffffff;
}

.home-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.home-module-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.home-module p {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.home-module dl {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.home-module dl div,
.home-list article {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.home-module dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.home-list article {
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 36ms);
}

.home-list strong {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.operation-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(92px, 0.32fr);
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 36ms);
}

.operation-list article.is-operating {
  border-color: rgba(47, 118, 84, 0.24);
  box-shadow: inset 3px 0 0 rgba(47, 118, 84, 0.72);
}

.operation-list article > div:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.operation-list strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-list em {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
  text-transform: uppercase;
}

.operation-list small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-progress {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 35, 40, 0.07);
}

.operation-progress i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(var(--progress-ratio, 0));
  transform-origin: left;
  transition: transform 700ms var(--ease-standard);
}

.operation-list article.failed .operation-progress i {
  background: var(--danger);
}

.operation-pulse {
  position: relative;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted-2);
}

.operation-pulse.active {
  background: var(--accent);
  animation: live-pulse 1600ms var(--ease-standard) infinite;
}

.validation-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(178, 108, 24, 0.2);
  border-radius: 8px;
  background: rgba(178, 108, 24, 0.055);
}

.validation-overview span {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.validation-overview strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
}

.validation-shortcut.approve-button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(178, 108, 24, 0.18);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
}

.validation-shortcut svg {
  width: 14px;
  height: 14px;
}

.executive-history-module {
  gap: 12px;
}

.executive-quote-table {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.executive-quote-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.72fr) minmax(180px, 1.34fr) minmax(96px, 0.7fr) minmax(98px, 0.7fr) minmax(180px, 1.2fr) minmax(112px, 0.72fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.94);
  animation: rise-in var(--duration-slow) var(--ease-standard) both;
  animation-delay: calc(var(--index) * 32ms);
}

.executive-quote-head {
  background: var(--surface-soft);
}

.executive-quote-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.executive-quote-row time,
.executive-quote-row em {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-style: normal;
}

.executive-quote-row strong,
.executive-quote-row p,
.executive-quote-row b {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.executive-quote-row strong {
  color: var(--ink);
  font-size: 13px;
}

.executive-quote-row p {
  color: var(--ink-2);
  font-size: 12px;
}

.executive-quote-row b {
  justify-self: end;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.validation-pill {
  justify-self: start;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.validation-pill.validated {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.22);
  background: rgba(47, 118, 84, 0.08);
}

.validation-pill.pending,
.validation-pill.recalculated {
  color: var(--warn);
  border-color: rgba(178, 108, 24, 0.22);
  background: rgba(178, 108, 24, 0.08);
}

.validation-pill.rejected {
  color: var(--danger);
  border-color: rgba(163, 67, 60, 0.22);
  background: rgba(163, 67, 60, 0.08);
}

.executive-quote-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #ffffff;
}

.executive-quote-empty div {
  display: grid;
  gap: 4px;
}

.executive-quote-empty strong,
.executive-quote-empty span {
  display: block;
}

.system-status-panel p {
  max-width: 72ch;
  margin: 0 0 14px;
  color: var(--ink-2);
  line-height: 1.5;
}

.system-status-panel dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.system-status-panel dl div {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.system-status-panel dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.system-status-panel dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip.online {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.24);
  background: rgba(47, 118, 84, 0.08);
}

.status-chip.warning {
  color: var(--warn);
  border-color: rgba(178, 108, 24, 0.24);
  background: rgba(178, 108, 24, 0.08);
}

.status-chip.offline {
  color: var(--muted);
}

.config-workspace {
  display: grid;
  gap: 16px;
  align-content: start;
}

.config-auth-workspace {
  width: min(100%, 560px);
  justify-self: center;
  align-self: center;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.config-guard-panel {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.config-loading-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
}

.config-loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(21, 31, 36, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: config-spin 760ms linear infinite;
}

@keyframes config-spin {
  to {
    transform: rotate(360deg);
  }
}

.config-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(47, 118, 84, 0.08), rgba(255, 255, 255, 0.92) 42%),
    #ffffff;
}

.config-hero h1,
.config-guard-panel h1 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 620;
  line-height: 1.08;
}

.config-hero p,
.config-guard-panel p {
  max-width: 72ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.config-auth-card {
  display: grid;
  min-width: 210px;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.config-auth-card span,
.config-auth-card strong,
.config-panel-head span,
.config-message,
.form-action-error,
.installation-list em,
.installation-list span,
.installation-list small {
  font-family: var(--mono);
  font-size: 11px;
}

.config-auth-card strong {
  color: var(--accent-dark);
  text-transform: uppercase;
}

.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.64fr);
  gap: 16px;
}

.quote-engine-workspace .config-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.config-panel-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 640;
}

.config-selector-grid,
.tsr-create-form,
.config-login-form {
  display: grid;
  gap: 10px;
}

.config-login-form {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

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

.company-editor-list,
.operational-company-form {
  display: grid;
  gap: 14px;
}

.company-editor-list {
  margin-top: 18px;
}

.operational-company-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.unit-profile-detail {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 244, 0.82);
}

.unit-profile-detail strong {
  display: block;
  font-size: 14px;
}

.unit-profile-detail span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.quote-engine-form-list {
  display: grid;
  gap: 16px;
}

.quote-engine-cost-form {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.quote-engine-cost-form.is-initial-profile {
  border-style: dashed;
  background: #ffffff;
}

.quote-engine-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.quote-engine-empty strong {
  font-size: 15px;
  font-weight: 650;
}

.quote-engine-empty span {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}

.quote-engine-profile-head,
.quote-engine-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quote-engine-profile-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.quote-engine-profile-head strong {
  display: block;
  font-size: 16px;
}

.quote-engine-profile-title dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.quote-engine-profile-title dl div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--qe-line, var(--line));
  border-radius: 6px;
  background: #ffffff;
}

.quote-engine-profile-title dt,
.quote-engine-profile-title dd {
  margin: 0;
  font-size: 11px;
  line-height: 1;
}

.quote-engine-profile-title dt {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 760;
  text-transform: uppercase;
}

.quote-engine-profile-title dd {
  color: var(--ink-2);
  font-weight: 650;
}

.quote-engine-profile-head span,
.quote-engine-derived small,
.quote-engine-section-head code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.quote-engine-derived {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.quote-engine-derived small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid var(--qe-line, var(--line));
  border-radius: 6px;
  background: #ffffff;
}

.quote-engine-derived strong {
  color: var(--ink);
}

.quote-engine-section {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quote-engine-section-head {
  display: grid;
  gap: 8px;
}

.quote-engine-section-head h3 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.quote-engine-section-head code {
  display: block;
  overflow-wrap: anywhere;
}

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

.engine-toggle {
  align-content: start;
}

.engine-toggle input {
  width: 18px;
  min-height: 18px;
}

.config-workspace label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.config-workspace input,
.config-workspace select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font: 600 12px var(--mono);
  padding: 0 9px;
}

.config-auth-workspace input,
.config-auth-workspace button,
.config-auth-workspace label,
.config-auth-workspace form {
  pointer-events: auto;
}

.config-workspace input:focus,
.config-workspace select:focus {
  outline: 2px solid rgba(47, 118, 84, 0.18);
  border-color: rgba(47, 118, 84, 0.48);
}

.domain-list,
.installation-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.domain-list article,
.installation-list article {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.domain-list strong,
.installation-list strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-list span,
.installation-list div span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-matrix {
  display: grid;
  gap: 1px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.config-matrix-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(170px, 1.1fr) minmax(110px, 0.7fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) minmax(110px, 0.7fr) minmax(92px, 0.56fr) minmax(160px, auto);
  align-items: center;
  gap: 10px;
  min-width: 1160px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
}

.config-matrix-head {
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.config-matrix-row > span strong,
.config-matrix-row > span small {
  display: block;
}

.config-matrix-row > span strong {
  color: var(--ink);
  font-size: 12px;
}

.config-matrix-row > span small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.config-active-cell {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 7px;
}

.config-active-cell input {
  width: 16px;
  min-height: 16px;
}

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

.matrix-row-actions .save-matrix-row-btn {
  font-size: 11px;
  padding: 4px 10px;
}

.matrix-row-actions .delete-tsr-profile-btn {
  font-size: 11px;
  padding: 4px 10px;
  color: var(--error, #c44);
  border-color: var(--error, #c44);
}

.company-list-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.company-list-actions .delete-company-btn {
  color: var(--error, #c44);
  border-color: var(--error, #c44);
}

.installation-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(130px, auto) minmax(140px, 0.7fr);
  align-items: center;
  gap: 12px;
}

.installation-list em {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-style: normal;
  font-weight: 760;
  text-transform: uppercase;
}

.installation-list em.synced {
  color: var(--accent-dark);
  background: rgba(47, 118, 84, 0.08);
}

.installation-list em.conflict,
.installation-list em.pending_push,
.installation-list em.pending_pull {
  color: var(--warn);
  background: rgba(178, 108, 24, 0.08);
}

.installation-list em.offline {
  color: var(--danger);
  background: rgba(163, 67, 60, 0.08);
}

.config-message {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-2);
  font-weight: 650;
}

.approval-workspace {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
}

.approval-list-head {
  padding: 16px;
}

.approval-list-head h2 {
  font-size: 19px;
  font-weight: 600;
}

.approval-list-head span {
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.approval-row {
  gap: 5px;
  padding: 13px 16px;
}

.approval-row:hover,
.approval-row.active {
  background: #f4f5f5;
}

.approval-row strong {
  font-size: 14px;
  font-weight: 600;
}

.approval-row em,
.approval-status {
  color: var(--muted);
  background: #f1f2f3;
  font-weight: 600;
}

.approval-detail-panel,
.approvals-empty {
  padding: clamp(18px, 2.4vw, 28px);
}

.approval-detail-header h1 {
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 600;
}

.approval-message {
  color: var(--ink-2);
  background: #f4f5f5;
  font-weight: 600;
}

.approval-metrics article,
.approval-reason,
.technical-block,
.risk-block,
.detail-card,
.email-draft-card,
.json-card {
  border-radius: 8px;
  box-shadow: none;
}

.approval-actions button,
.approve-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 38px;
  border-radius: 7px;
  font-weight: 600;
}

.approval-approve {
  background: var(--ink);
}

.approval-reprice {
  border: 1px solid var(--line);
  color: var(--ink-2) !important;
  background: #ffffff;
}

.approval-reject {
  background: var(--danger);
}

.decision-copy {
  border-left-color: var(--ink);
  background: #f5f6f6;
}

/* Inducta intelligence alignment: restrained AI cues over the operational shell. */
body {
  background:
    radial-gradient(circle at 74% -8%, rgba(37, 99, 235, 0.055), transparent 28rem),
    radial-gradient(circle at 22% 8%, rgba(124, 58, 237, 0.04), transparent 24rem),
    radial-gradient(rgba(31, 35, 40, 0.07) 0.6px, transparent 0.6px) 0 0 / 28px 28px,
    linear-gradient(180deg, #ffffff 0%, #f7f8f8 52%, #ffffff 100%);
}

.rail-brand {
  background:
    radial-gradient(circle at 72% 18%, rgba(124, 58, 237, 0.42), transparent 42%),
    linear-gradient(145deg, #11161a 0%, #0b0d10 78%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(124, 58, 237, 0.13),
    0 12px 30px rgba(37, 99, 235, 0.12);
}

.rail-button.active::before,
.case-item.active i {
  background: linear-gradient(180deg, var(--ai-blue), var(--ai-purple));
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.26);
}

.ai-reasoning-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(31, 35, 40, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(31, 35, 40, 0.07);
}

.ai-reasoning-panel::before {
  display: none;
}

.ai-reasoning-panel > * {
  position: relative;
  z-index: 1;
}

.workflow-progress,
.phase-progress {
  background: #eef0f1;
}

.workflow-progress {
  height: 9px;
}

.workflow-progress div,
.phase-progress div {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  box-shadow: 0 0 14px rgba(47, 118, 84, 0.18);
}

.process-step.ai-phase .phase-progress div {
  background: linear-gradient(90deg, var(--ai-blue), var(--ai-purple));
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.22);
}

.workflow-progress.active div::after,
.phase-progress.active div::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
}

.process-step.ai-phase {
  border-left: 1px solid rgba(31, 35, 40, 0.1);
  background: #ffffff;
  isolation: isolate;
}

.process-step.ai-phase.completed {
  border-left-color: rgba(31, 35, 40, 0.1);
  background: #ffffff;
  box-shadow: none;
}

.process-step.ai-phase.running {
  border-left-color: transparent;
  margin: 10px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 35, 40, 0.08);
  opacity: 1;
  z-index: 1;
}

.process-step.ai-phase.running::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, var(--ai-blue), var(--ai-purple), var(--ai-blue));
  background-size: 220% 100%;
  animation: ai-contour-flow 2400ms linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.process-step.ai-phase.running::after {
  display: none;
}

.process-step.queued {
  opacity: 0.46;
  filter: saturate(0.72);
}

.process-step.queued .phase-message,
.process-step.queued .phase-activity,
.process-step.queued .ai-phase-placeholder {
  color: var(--muted-2);
}

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

.process-timeline {
  gap: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.process-step {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.process-step .step-content,
.process-step .phase-progress {
  min-width: 0;
  max-width: 100%;
}

.process-step + .process-step {
  border-top: 1px solid var(--line);
}

.process-step.completed {
  opacity: 1;
  color: var(--ink);
  border-color: rgba(31, 35, 40, 0.12);
  background: #ffffff;
  box-shadow: none;
}

.process-step.completed .step-heading span,
.process-step.completed .phase-message,
.process-step.completed .phase-activity {
  color: var(--ink);
  opacity: 1;
}

.process-step.running {
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.14),
    0 10px 24px rgba(31, 35, 40, 0.07);
}

.process-step.deterministic-phase.running {
  border-color: rgba(47, 118, 84, 0.28);
  box-shadow:
    inset 0 0 0 1px rgba(47, 118, 84, 0.14),
    0 10px 24px rgba(31, 35, 40, 0.07);
}

.process-step.running .phase-message {
  color: var(--ink);
  font-weight: 760;
}

.process-step.running .phase-activity {
  color: var(--ink-2);
}

.process-step.ai-phase.completed .step-node,
.process-step.ai-phase.running .step-node {
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.38);
  background: linear-gradient(145deg, var(--ai-blue), var(--ai-purple));
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.18);
}

.process-step.completed .step-node,
.process-step.ai-phase.completed .step-node {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: none;
}

.ai-phase.running .phase-message::before {
  border-color: rgba(103, 93, 182, 0.34);
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 99, 235, 0.32) 0 2px, transparent 2.4px),
    radial-gradient(circle at 35% 58%, rgba(124, 58, 237, 0.38) 0 1.6px, transparent 2px),
    radial-gradient(circle at 65% 58%, rgba(37, 99, 235, 0.38) 0 1.6px, transparent 2px),
    #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.04);
}

.process-step.ai-phase .ai-phase-text,
.process-step.ai-phase .ai-phase-placeholder {
  border-color: rgba(103, 93, 182, 0.16);
  background: #ffffff;
}

.final-quote-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, #101316 0%, #050607 76%);
  box-shadow: 0 24px 70px rgba(11, 13, 16, 0.2);
}

.final-quote-card::after {
  display: none;
}

.ai-insight-card {
  overflow: hidden;
  border: 1px solid rgba(103, 93, 182, 0.32);
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 28px rgba(31, 35, 64, 0.06);
}

.ai-insight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.24), rgba(124, 58, 237, 0.34), rgba(37, 99, 235, 0.24));
  background-size: 220% 100%;
  opacity: 0.62;
  animation: ai-contour-flow 3600ms linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.ai-insight-card span,
.insight-more-btn {
  color: var(--ai-ink);
}

.ai-insight-card.pending {
  border-color: rgba(105, 112, 125, 0.24);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

.ai-insight-card.pending::before {
  display: none;
}

.commercial-proposal-card.status-approved,
.commercial-proposal-card.status-pending,
.commercial-proposal-card.status-risk {
  background: #ffffff;
}

.commercial-proposal-card.ready {
  border-color: rgba(31, 35, 40, 0.12);
}

.commercial-proposal-card.pending {
  border-style: solid;
  opacity: 0.78;
}

.commercial-proposal-card h3 span {
  display: inline;
}

.commercial-proposal-status-word.status-approved {
  color: var(--accent-dark);
}

.commercial-proposal-status-word.status-pending {
  color: #9a6a16;
}

.commercial-proposal-status-word.status-risk {
  color: var(--danger);
}

.commercial-proposal-summary {
  display: grid;
  gap: 8px;
}

.commercial-proposal-card .commercial-proposal-summary p {
  display: block;
  overflow: visible;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  -webkit-line-clamp: unset;
}

.commercial-proposal-summary strong {
  color: var(--ink);
}

.commercial-proposal-state {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.commercial-proposal-state svg {
  width: 14px;
  height: 14px;
}

.commercial-proposal-state.status-approved {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.24);
}

.commercial-proposal-state.status-pending {
  color: #9a6a16;
  border-color: rgba(154, 106, 22, 0.26);
}

.commercial-proposal-state.status-risk {
  color: var(--danger);
  border-color: rgba(179, 54, 54, 0.24);
}

.viability-card.status-approved,
.decision-pill.status-approved,
.commercial-status-badge.status-approved,
.final-quote-status.status-approved {
  color: var(--accent-dark);
  border-color: rgba(47, 118, 84, 0.24);
  background: rgba(47, 118, 84, 0.1);
}

.final-quote-card .final-quote-status.status-approved {
  color: var(--accent-dark);
  border-color: rgba(255, 255, 255, 0.86);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.final-quote-card .final-quote-status.status-pending {
  color: #9a6a16;
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.94);
}

.final-quote-card .final-quote-status.status-risk {
  color: var(--danger);
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.94);
}

@keyframes ai-contour-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

.reasoning-modal {
  border-color: var(--ai-line);
  box-shadow:
    0 32px 90px rgba(11, 13, 16, 0.2),
    0 0 56px rgba(37, 99, 235, 0.1);
}

.app-shell.is-hydrated .case-item,
.app-shell.is-hydrated .approval-row,
.app-shell.is-hydrated .case-hero,
.app-shell.is-hydrated .panel,
.app-shell.is-hydrated .process-step,
.app-shell.is-hydrated .batch-result-card,
.app-shell.is-hydrated .batch-queue-item,
.app-shell.is-hydrated .lane-card,
.app-shell.is-hydrated .audit-event,
.app-shell.is-hydrated .summary-card,
.app-shell.is-hydrated .activity-item,
.app-shell.is-hydrated .home-list article {
  animation: none;
  animation-delay: 0ms;
}

.workflow-progress.active div::after,
.phase-progress.active div::after {
  opacity: 0.14;
  animation-duration: 2800ms;
}

.process-step.running .step-node {
  animation-duration: 2400ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(47, 118, 84, 0.24);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(47, 118, 84, 0);
  }
}

@keyframes final-card-in {
  from {
    clip-path: inset(10% 0 0 0 round var(--radius));
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    clip-path: inset(0 0 0 0 round var(--radius));
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes final-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes phase-text-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-dot {
  0%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  45% {
    opacity: 0.86;
    transform: translateY(-2px);
  }
}

@keyframes thinking-halo {
  0%,
  100% {
    opacity: 0.64;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes flow-line {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes node-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.66);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes drawWire {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes intelligence-scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1420px) {
  .app-shell {
    grid-template-columns: 56px minmax(304px, 340px) minmax(0, 1fr);
  }
}

@media (max-width: 1320px) {
  .analysis-workbench {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .case-dock {
    position: relative;
    grid-column: 2;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .main-content {
    grid-column: 2;
  }

  .analysis-workbench,
  .final-rfq-summary,
  .return-policy-grid,
  .operational-moves-widget,
  .workspace-grid,
  .analysis-grid,
  .bottom-grid,
  .home-grid,
  .technical-grid,
  .approval-workspace,
  .approval-metrics,
  .approval-context {
    grid-template-columns: 1fr;
  }

  .final-quote-card {
    position: relative;
    top: auto;
  }

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

  .executive-quote-row {
    grid-template-columns: minmax(110px, 0.7fr) minmax(170px, 1.2fr) minmax(92px, 0.62fr) minmax(96px, 0.62fr) minmax(150px, 1fr) minmax(108px, 0.62fr);
  }

  .approval-list-panel {
    position: relative;
    top: auto;
  }

  .quote-engine-field-grid,
  .config-selector-grid,
  .quote-engine-workspace .config-grid {
    grid-template-columns: 1fr;
  }
}

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

  .app-rail {
    position: sticky;
    z-index: 5;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    height: auto;
    padding: 10px 14px;
  }

  .rail-nav {
    grid-auto-flow: column;
    justify-content: center;
    overflow: auto;
  }

  .rail-button,
  .rail-avatar,
  .rail-brand {
    width: 42px;
    height: 42px;
  }

  .case-dock,
  .main-content {
    grid-column: 1;
  }

  .case-dock,
  .main-content,
  .intake-drawer {
    padding: 18px;
  }

  .case-hero,
  .analysis-title-row,
  .section-heading,
  .step-heading,
  .audit-event,
  .approval-detail-header {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .approval-metrics,
  .approval-context {
    grid-template-columns: 1fr;
  }

  .case-hero-status,
  .workflow-progress-block {
    width: 100%;
    min-width: 0;
  }

  .intake-readout,
  .final-rate-metrics,
  .ai-insight-grid,
  .metric-strip,
  .summary-metrics,
  .home-kpis,
  .summary-actions,
  .data-list,
  .batch-result-card dl,
  .lane-card dl {
    grid-template-columns: 1fr;
  }

  .operation-list article,
  .executive-quote-row,
  .system-status-panel dl {
    grid-template-columns: 1fr;
  }

  .operation-list em,
  .operation-list small,
  .executive-quote-row b {
    justify-self: start;
    text-align: left;
  }

  .executive-quote-head {
    display: none;
  }

  .validation-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .validation-shortcut.approve-button {
    justify-content: center;
    width: 100%;
  }

  .home-header,
  .home-module-head,
  .activity-feed-head {
    flex-direction: column;
  }

  .activity-item {
    grid-template-columns: 1fr;
  }

  .process-step {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 14px;
  }

  .summary-price strong {
    font-size: 36px;
  }
}

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

  .workflow-progress div::after,
  .phase-progress div::after {
    display: none;
  }

  .process-step.ai-phase.running::before,
  .process-step.ai-phase.running::after,
  .ai-insight-card::before {
    display: none;
  }

}

/* Editable matrix cells */
.matrix-cell-input {
  width: 80px;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.875rem;
  text-align: right;
}
.matrix-cell-input:focus {
  outline: 2px solid var(--accent, #2563eb);
}

/* Delete TSR button */
.delete-tsr-profile-btn {
  color: var(--danger, #dc2626);
  border-color: var(--danger, #dc2626);
}

/* Pricing model toggle */
.pricing-model-toggle { margin-bottom: 1.5rem; }
.pricing-model-options { display: flex; gap: 1rem; margin-top: 0.5rem; flex-wrap: wrap; }
.pricing-model-option {
  display: flex; flex-direction: column; gap: 0.25rem;
  border: 1px solid var(--border, #ddd); border-radius: 8px;
  padding: 0.75rem 1rem; cursor: pointer; flex: 1; min-width: 200px;
}
.pricing-model-option.is-active {
  border-color: var(--accent, #2563eb);
  background: var(--accent-subtle, #eff6ff);
}

/* Formula group toggle */
.formula-group { margin-bottom: 1.5rem; }
.formula-group-disabled { opacity: 0.5; }
.formula-group-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.75rem;
}
.formula-block-toggle-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }

/* RB table editor */
.rb-table-editor { margin-top: 1rem; }
.rb-table-rows { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.rb-table-row {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.875rem;
}
.rb-table-row span:first-child { min-width: 130px; color: var(--muted, #666); }
.rb-pct-input { width: 70px; text-align: right; }
.rb-table-row small { color: var(--muted, #666); min-width: 35px; }

/* Quote Engine redesign proposal */
.config-workspace {
  --qe-canvas: #fbfbfa;
  --qe-surface: #ffffff;
  --qe-soft: #f7f6f3;
  --qe-line: #eaeaea;
  --qe-ink: #111111;
  --qe-muted: #787774;
  --qe-green-bg: #edf3ec;
  --qe-green: #346538;
  --qe-blue-bg: #e1f3fe;
  --qe-blue: #1f6c9f;
  --qe-red-bg: #fdebec;
  --qe-red: #9f2f2d;
  gap: 18px;
  color: var(--qe-ink);
  font-family: var(--sans);
}

.config-workspace .panel {
  min-width: 0;
  border: 1px solid var(--qe-line);
  border-radius: 12px;
  background: var(--qe-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.config-workspace .panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.config-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 248px);
  background: var(--qe-surface);
}

.config-hero h1,
.config-guard-panel h1 {
  color: var(--qe-ink);
  font-family: var(--sans);
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 650;
  letter-spacing: 0;
}

.config-hero p,
.config-guard-panel p {
  color: var(--qe-muted);
  font-size: 15px;
  line-height: 1.6;
}

.config-auth-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-self: end;
  width: min(100%, 248px);
  min-width: 248px;
  gap: 10px 12px;
  border-color: var(--qe-line);
  background: var(--qe-soft);
}

.config-auth-card > span,
.config-auth-card > strong {
  grid-column: 1 / -1;
}

.config-engine-entry-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.config-engine-entry-copy b {
  overflow: hidden;
  color: var(--qe-ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-engine-entry-copy small {
  color: var(--qe-muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.config-auth-card .approve-button,
.config-engine-enter-btn {
  white-space: normal;
  border-radius: 6px;
  background: var(--qe-ink);
  color: #ffffff;
}

.config-engine-enter-icon-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.config-auth-card .approve-button svg,
.config-engine-enter-btn svg {
  width: 16px;
  height: 16px;
}

.config-summary-kpis {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.config-summary-kpis .config-selector-panel {
  min-height: 154px;
  padding: 24px;
}

.config-selector-panel h2 {
  margin: 10px 0 8px;
  color: var(--qe-ink);
  font-family: var(--sans);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0;
}

.config-selector-panel p:not(.eyebrow) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--qe-muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.config-company-overview-panel {
  padding: 24px;
}

.config-company-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.config-company-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--qe-line);
  border-radius: 10px;
  background: var(--qe-surface);
  animation: qe-card-in 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--index, 0) * 70ms);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease;
}

.config-company-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.14);
}

.config-company-card strong {
  display: block;
  color: var(--qe-ink);
  font-size: 15px;
}

.config-company-card span,
.config-company-card small {
  color: var(--qe-muted);
  font-family: "Geist Mono", "SF Mono", "JetBrains Mono", monospace;
  font-size: 11px;
}

.config-company-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--qe-line);
  border-radius: 8px;
  background: var(--qe-line);
}

.config-company-card dl div {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
  background: var(--qe-soft);
}

.config-company-card dt,
.config-company-card dd {
  margin: 0;
}

.config-company-card dt {
  color: var(--qe-muted);
  font-size: 10px;
}

.config-company-card dd {
  color: var(--qe-ink);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.quote-engine-workspace .config-grid {
  grid-template-columns: 1fr;
}

.company-list-row,
.config-matrix-row,
.quote-engine-cost-form {
  border-color: var(--qe-line);
  background: var(--qe-surface);
}

.config-matrix {
  border-color: var(--qe-line);
  background: var(--qe-line);
}

.config-matrix-head {
  background: var(--qe-soft);
}

.matrix-cell-input {
  border-color: var(--qe-line);
  border-radius: 6px;
  background: var(--qe-soft);
  color: var(--qe-ink);
}

.matrix-cell-input:focus {
  border-color: rgba(17, 17, 17, 0.38);
  outline: 2px solid rgba(17, 17, 17, 0.08);
}

.matrix-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-family: "Geist Mono", "SF Mono", monospace;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.matrix-status.status-active {
  background: var(--qe-green-bg);
  color: var(--qe-green);
}

.matrix-status.status-inactive {
  background: var(--qe-red-bg);
  color: var(--qe-red);
}

.pricing-model-toggle {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--qe-line);
  border-radius: 12px;
  background: var(--qe-soft);
}

.pricing-model-copy {
  display: grid;
  gap: 4px;
}

.pricing-model-copy strong,
.formula-group-header strong {
  color: var(--qe-ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.pricing-model-copy span {
  color: var(--qe-muted);
  font-size: 13px;
  line-height: 1.45;
}

.pricing-model-options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  padding: 4px;
  border: 1px solid var(--qe-line);
  border-radius: 10px;
  background: #ffffff;
}

.pricing-model-options::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: calc(50% - 4px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 7px;
  background: var(--qe-ink);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-model-toggle-profitability .pricing-model-options::before {
  transform: translateX(100%);
}

.pricing-model-option {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--qe-muted);
  text-align: center;
}

.pricing-model-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pricing-model-option strong {
  color: currentColor;
  font-size: 13px;
}

.pricing-model-option small {
  display: none;
}

.pricing-model-option.is-active {
  background: transparent;
  color: #ffffff;
}

.formula-group {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--qe-line);
  border-radius: 12px;
  background: var(--qe-surface);
}

.formula-group-disabled {
  opacity: 1;
  background: var(--qe-soft);
}

.formula-group-header {
  margin-bottom: 14px;
}

.formula-block-toggle-label {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--qe-line);
  border-radius: 999px;
  background: #e9e8e4;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.formula-block-toggle-label:has(.formula-block-toggle-input:checked) {
  border-color: rgba(52, 101, 56, 0.22);
  background: var(--qe-green-bg);
}

.formula-block-toggle-input {
  position: absolute;
  opacity: 0;
}

.toggle-label-text {
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  color: transparent;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.formula-block-toggle-input:checked + .toggle-label-text {
  transform: translateX(22px);
}

.quote-engine-section {
  padding-top: 14px;
  border-top-color: var(--qe-line);
}

.quote-engine-section-head h3 {
  color: var(--qe-muted);
  font-size: 13px;
  font-weight: 520;
}

.quote-engine-section-head code {
  display: none;
}

.quote-engine-field-grid {
  gap: 10px;
}

.config-workspace label {
  color: var(--qe-muted);
  font-family: "Geist Mono", "SF Mono", "JetBrains Mono", monospace;
}

.config-workspace input,
.config-workspace select {
  border-color: var(--qe-line);
  border-radius: 6px;
  background: #ffffff;
}

.delete-tsr-profile-btn,
.matrix-row-actions .delete-tsr-profile-btn,
.company-list-actions .delete-company-btn {
  border-color: rgba(159, 47, 45, 0.24);
  background: var(--qe-red-bg);
  color: var(--qe-red);
}

.rb-table-editor {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--qe-line);
}

.rb-table-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--qe-line);
}

.approve-button.is-saving,
.secondary-button.is-saving {
  opacity: 0.78;
  pointer-events: none;
  transform: scale(0.99);
}

.approve-button.is-success,
.secondary-button.is-success {
  border-color: rgba(52, 101, 56, 0.22);
  background: var(--qe-green-bg);
  color: var(--qe-green);
  animation: action-success-pop 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.approve-button.is-updated,
.secondary-button.is-updated {
  border-color: rgba(31, 108, 159, 0.22);
  background: var(--qe-blue-bg);
  color: var(--qe-blue);
  animation: action-success-pop 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.approve-button.is-error,
.secondary-button.is-error {
  border-color: rgba(159, 47, 45, 0.24);
  background: var(--qe-red-bg);
  color: var(--qe-red);
}

.matrix-status.status-active,
.pricing-model-option.is-active,
.formula-tab-btn.is-active,
.formula-block-toggle-label:has(.formula-block-toggle-input:checked),
.tsr-chip.is-selected {
  animation: active-soft-pulse 2600ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes qe-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes action-success-pop {
  from {
    opacity: 0.84;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes active-soft-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(52, 101, 56, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(52, 101, 56, 0.055);
  }
}

.route-evidence-widget {
  display: grid;
  grid-template-columns: minmax(132px, 0.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(24, 36, 44, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(248, 250, 247, 0.98), rgba(242, 247, 250, 0.95));
}

.route-evidence-widget.has-map-widget {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.phase-route-body .route-evidence-widget {
  margin: 10px 0 0;
  grid-template-columns: 116px minmax(0, 1fr);
  padding: 12px;
}

.phase-route-body .route-evidence-widget.has-map-widget {
  display: block;
  padding: 0;
}

.route-evidence-map-widget {
  min-width: 0;
}

.route-evidence-map-widget .qs-route-card {
  border-radius: 8px;
}

.route-evidence-map-widget .qs-route-title {
  letter-spacing: 0;
}

.route-evidence-heading-inline {
  padding: 16px 20px 0;
}

.route-evidence-heading-inline + .route-evidence-lane {
  margin: 12px 0 14px;
  padding: 0 20px;
}

.route-evidence-map-widget.qs-route-compact .route-evidence-heading-inline {
  padding: 14px 14px 0;
}

.route-evidence-map-widget.qs-route-compact .route-evidence-heading-inline + .route-evidence-lane {
  padding: 0 14px;
}

.route-evidence-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.route-evidence-heading h4 {
  margin: 2px 0 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.route-evidence-lane {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  color: #18242c;
}

.route-evidence-lane strong {
  min-width: 0;
  font-size: 0.92rem;
}

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

  .pricing-model-toggle {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .config-hero {
    grid-template-columns: 1fr;
  }

  .config-auth-card {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .config-summary-kpis,
  .config-company-card dl,
  .pricing-model-options,
  .route-evidence-widget,
  .phase-route-body .route-evidence-widget {
    grid-template-columns: 1fr;
  }

  .pricing-model-options::before {
    inset: 4px 4px auto 4px;
    width: auto;
    height: calc(50% - 4px);
  }

  .pricing-model-toggle-profitability .pricing-model-options::before {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-status.status-active,
  .pricing-model-option.is-active,
  .formula-tab-btn.is-active,
  .formula-block-toggle-label:has(.formula-block-toggle-input:checked),
  .tsr-chip.is-selected,
  .approve-button.is-success,
  .secondary-button.is-success,
  .approve-button.is-updated,
  .secondary-button.is-updated {
    animation: none;
  }
}
