/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * Hallmark · genre: modern-minimal · macrostructure: Workbench
 * design-system: design.md · designed-as-app
 */
:root {
  --color-paper: oklch(97.8% 0.006 185);
  --color-paper-2: oklch(95.5% 0.009 185);
  --color-paper-3: oklch(92.5% 0.012 185);
  --color-surface: oklch(99.4% 0.003 185);
  --color-surface-raised: oklch(100% 0 0);
  --color-white: oklch(100% 0 0);
  --color-surface-glass: oklch(100% 0 0 / 0.96);
  --color-ink: oklch(23% 0.025 190);
  --color-ink-2: oklch(47% 0.025 190);
  --color-ink-3: oklch(44% 0.024 190);
  --color-rule: oklch(87% 0.014 190);
  --color-rule-strong: oklch(76% 0.022 190);
  --color-accent: oklch(43% 0.095 185);
  --color-accent-hover: oklch(35% 0.08 185);
  --color-accent-soft: oklch(93% 0.028 185);
  --color-accent-ink: oklch(99% 0.005 185);
  --color-focus: oklch(58% 0.13 220);
  --color-focus-ring: oklch(58% 0.13 220 / 0.3);
  --color-success: oklch(48% 0.115 152);
  --color-success-soft: oklch(94% 0.035 152);
  --color-warning: oklch(57% 0.115 75);
  --color-warning-soft: oklch(95% 0.045 75);
  --color-danger: oklch(51% 0.17 27);
  --color-danger-soft: oklch(95% 0.038 27);
  --color-brand-signal: oklch(58% 0.16 34);
  --color-rail: oklch(20% 0.03 190);
  --color-rail-raised: oklch(25% 0.035 190);
  --color-rail-selected: oklch(32% 0.06 185);
  --color-rail-rule: oklch(34% 0.025 190);
  --color-rail-ink: oklch(94% 0.012 185);
  --color-rail-muted: oklch(73% 0.02 190);
  --color-overlay: oklch(16% 0.025 190 / 0.56);
  --color-selection: oklch(92% 0.04 185);
  --color-shadow-soft: oklch(18% 0.02 190 / 0.08);
  --color-shadow-medium: oklch(18% 0.02 190 / 0.12);
  --shadow-dialog: 0 18px 48px oklch(18% 0.02 190 / 0.18);
  --shadow-drawer: 18px 0 42px oklch(18% 0.02 190 / 0.24);

  --font-display: "IBM Plex Sans Variable", "Noto Sans SC Variable", "Segoe UI", sans-serif;
  --font-body: "Noto Sans SC Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-mono: "JetBrains Mono Variable", "Cascadia Code", Consolas, monospace;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-normal: 180ms;
  --radius-control: 4px;
  --radius-surface: 6px;
  --z-context: 30;
  --z-drawer-backdrop: 70;
  --z-drawer: 80;
  --z-dialog: 100;
  --z-toast: 120;

  --canvas: var(--color-paper);
  --surface: var(--color-surface);
  --surface-muted: var(--color-paper-2);
  --ink: var(--color-ink);
  --ink-soft: var(--color-ink-2);
  --line: var(--color-rule);
  --line-strong: var(--color-rule-strong);
  --primary: var(--color-accent);
  --primary-hover: var(--color-accent-hover);
  --primary-soft: var(--color-accent-soft);
  --amber: var(--color-warning);
  --amber-soft: var(--color-warning-soft);
  --danger: var(--color-danger);
  --danger-soft: var(--color-danger-soft);
  --success: var(--color-success);
  --success-soft: var(--color-success-soft);
  --focus: var(--color-focus);
  --shadow: var(--shadow-dialog);
  --sidebar-width: 216px;
  --radius: var(--radius-surface);
  --font-ui: var(--font-body);
  --font-data: var(--font-mono);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 0;
  overflow-x: clip;
  background: var(--canvas);
}

body {
  min-width: 0;
  overflow-x: clip;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--color-white);
  background: var(--ink);
  transform: translateY(-150%);
}

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

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

.hidden,
[hidden] {
  display: none !important;
}

.platform-login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  color: var(--ink);
  background: var(--surface);
}

.platform-login-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 44px;
  color: var(--color-rail-ink);
  background: var(--color-rail);
}

.platform-login-brand strong,
.platform-login-brand span {
  display: block;
}

.platform-login-brand strong { font-size: 18px; }
.platform-login-brand div > span { margin-top: 4px; color: var(--color-rail-muted); }

.platform-login-form {
  width: min(420px, calc(100% - 40px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 16px;
}

.platform-login-form h1,
.platform-login-form p { margin: 0; }
.platform-login-form > p:not(.eyebrow):not(.form-message) { color: var(--ink-soft); }
.platform-login-form .button { min-height: 44px; justify-content: center; }
.platform-login-form .form-message { min-height: 20px; color: var(--danger); }

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  color: var(--color-rail-ink);
  background: var(--color-rail);
  border-right: 1px solid var(--color-rail-rule);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--color-rail-rule);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  color: var(--color-white);
  background: var(--color-brand-signal);
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block strong {
  font-size: 15px;
}

.brand-block div > span {
  margin-top: 1px;
  color: var(--color-rail-muted);
  font-size: 12px;
}

.primary-nav,
.utility-nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.utility-nav {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-rail-rule);
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  color: var(--color-rail-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  text-align: left;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  color: var(--color-white);
  background: var(--color-rail-raised);
}

.nav-item.active {
  color: var(--color-white);
  background: var(--color-rail-selected);
  border-color: var(--color-accent);
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 2px;
  color: var(--color-rail-muted);
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--amber);
  border-radius: 50%;
}

.status-dot.online {
  background: var(--color-success);
}

.status-dot.offline {
  background: var(--color-danger);
}

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

.context-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 9px 28px;
  background: var(--color-surface-glass);
  border-bottom: 1px solid var(--line);
}

.platform-user {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.platform-user span,
.platform-user strong,
.platform-user small { display: block; }
.platform-user small { margin-top: 2px; color: var(--ink-soft); }
.platform-user .button { min-height: 34px; padding: 0 10px; }

.context-item {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.context-item span {
  color: var(--ink-soft);
  font-size: 11px;
}

.context-item strong {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.context-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#workspace {
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 28px;
}

#workspace:focus-visible {
  outline: none;
}

.view {
  min-width: 0;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 1px 0 0;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
}

.page-summary {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.runtime-ledger {
  margin-bottom: 18px;
  overflow: hidden;
  color: var(--color-rail-ink);
  background: var(--color-rail);
  border: 1px solid var(--color-rail-rule);
  border-radius: var(--radius);
}

.runtime-ledger-heading {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-rail-rule);
}

.runtime-ledger-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.runtime-label,
.runtime-timestamp {
  color: var(--color-rail-muted);
  font-family: var(--font-data);
  font-size: 10px;
}

.runtime-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.runtime-fact {
  position: relative;
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px 15px 16px 18px;
  border-right: 1px solid var(--color-rail-rule);
}

.runtime-fact:last-child {
  border-right: 0;
}

.runtime-fact::before {
  position: absolute;
  top: 19px;
  left: 8px;
  width: 3px;
  height: 24px;
  background: var(--color-ink-3);
  border-radius: 2px;
  content: "";
}

.runtime-fact.ready::before { background: var(--color-success); }
.runtime-fact.working::before { background: var(--color-warning); }
.runtime-fact.warning::before { background: var(--color-warning); }
.runtime-fact.error::before { background: var(--color-danger); }

.runtime-fact span,
.runtime-fact small {
  min-width: 0;
  overflow: hidden;
  color: var(--color-rail-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.runtime-fact strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-white);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-data);
  font-size: 14px;
}

.readiness-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 18px;
  color: var(--color-rail-muted);
  background: var(--color-rail-raised);
  border-top: 1px solid var(--color-rail-rule);
  font-size: 12px;
}

.readiness-line.ready { color: var(--color-success-soft); }
.readiness-line.warning { color: var(--color-warning-soft); }
.readiness-line.error { color: var(--color-danger-soft); }

.home-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.home-work-grid > .work-section {
  min-height: 282px;
}

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

.home-context-item {
  min-width: 0;
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface-muted);
}

.home-context-item span,
.home-context-item small {
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.home-context-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-data);
  font-size: 15px;
}

.work-section .home-actions {
  margin-top: 18px;
}

.work-section .home-actions.split-actions {
  justify-content: space-between;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.page-actions,
.action-row,
.split-actions,
.dialog-actions,
.form-submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.split-actions {
  justify-content: space-between;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

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

.button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button.secondary:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: var(--color-rule-strong);
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--color-danger-soft);
}

.button:disabled {
  opacity: 0.48;
}

.text-button {
  min-height: 44px;
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-weight: 650;
}

.email-back {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  margin: 0 0 4px;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-weight: 650;
}

.email-back:hover {
  color: var(--primary-hover);
}

.email-back-icon {
  font-size: 18px;
  line-height: 1;
}

.toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.toolbar input,
.toolbar select {
  min-height: 40px;
}

.search-field {
  flex: 1 1 360px;
}

.search-field input {
  width: 100%;
}

.toolbar-count {
  margin-left: auto;
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: var(--color-white);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

input,
select {
  min-height: 44px;
  padding: 0 11px;
}

textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.55;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-rule-strong);
}

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

.field > span {
  color: var(--color-ink-2);
  font-size: 12px;
  font-weight: 650;
}

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

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

.span-2 {
  grid-column: span 2;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--color-ink-2);
  background: var(--surface-muted);
  font-size: 11px;
  font-weight: 700;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--color-accent-soft);
}

.align-right {
  text-align: right !important;
}

.empty-cell {
  height: 112px;
  color: var(--ink-soft);
  text-align: center !important;
  vertical-align: middle !important;
}

.product-table th:nth-child(1) { width: 22%; }
.product-table th:nth-child(2) { width: 20%; }
.product-table th:nth-child(3) { width: 16%; }
.product-table th:nth-child(4) { width: 14%; }
.product-table th:nth-child(5) { width: 12%; }
.product-table th:nth-child(6) { width: 16%; }

.product-table {
  min-width: 1040px;
}

.product-identity,
.company-identity,
.contact-identity {
  display: grid;
  gap: 3px;
}

.product-identity strong,
.company-identity strong,
.contact-identity strong {
  font-size: 13px;
}

.product-identity span,
.company-identity span,
.contact-identity span,
.muted-text {
  color: var(--ink-soft);
  font-size: 12px;
}

.product-identity small,
.product-table-detail small {
  color: var(--color-ink-3);
  font-size: 11px;
}

.product-table-detail {
  display: grid;
  gap: 3px;
}

.product-table-detail strong,
.product-table-detail span,
.product-table-detail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-table-detail strong {
  font-size: 12px;
}

.product-table-detail span {
  color: var(--ink-soft);
  font-size: 12px;
}

.product-status-stack {
  display: grid;
  justify-items: start;
  gap: 6px;
}

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

.row-actions .button {
  min-height: 36px;
  padding: 0 11px;
  white-space: nowrap;
  font-size: 12px;
}

.status-chip,
.preview-chip,
.grade-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--color-ink-2);
  background: var(--surface-muted);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.status-chip.running,
.status-chip.queued {
  color: var(--color-warning);
  background: var(--amber-soft);
  border-color: var(--color-warning-soft);
}

.status-chip.completed,
.status-chip.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--color-success-soft);
}

.status-chip.failed,
.status-chip.risk {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--color-danger-soft);
}

.field > small {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.company-readonly-notice,
.company-conflict {
  margin-bottom: 14px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 4px;
  background: var(--color-accent-soft);
}

.company-conflict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.company-conflict strong,
.company-conflict span {
  display: block;
}

.company-conflict span {
  margin-top: 2px;
  color: var(--color-danger);
  font-size: 12px;
}

.company-profile-form {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.company-completeness {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(180px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.company-completeness strong,
.company-completeness span {
  display: block;
}

.company-completeness div > span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.company-completeness-track {
  height: 8px;
  overflow: hidden;
  background: var(--color-rule);
  border-radius: 4px;
}

.company-completeness-track span {
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 180ms ease;
}

.company-profile-section {
  padding: 24px 20px;
}

.company-profile-section + .company-profile-section {
  border-top: 1px solid var(--line);
}

.company-list-field {
  margin-top: 20px;
}

.company-list-heading {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

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

.company-list-heading strong {
  color: var(--color-ink-2);
  font-size: 12px;
}

.company-list-heading span {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 11px;
}

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

.repeatable-list.has-error {
  padding: 5px;
  border: 1px solid var(--danger);
  border-radius: 4px;
}

.repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.remove-company-list-item {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--danger);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 21px;
  line-height: 1;
}

.remove-company-list-item:hover {
  background: var(--danger-soft);
  border-color: var(--color-danger-soft);
}

.company-market-grid {
  max-width: 640px;
  margin-top: 20px;
}

.form-error-summary {
  margin: 18px 20px 0;
  padding: 12px 14px;
  color: var(--color-danger);
  background: var(--danger-soft);
  border: 1px solid var(--color-danger-soft);
  border-radius: 4px;
}

.form-error-summary ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.company-form-message {
  margin: 0;
  padding: 0 20px;
}

.company-submit-row {
  justify-content: flex-end;
  padding: 16px 20px 20px;
}

.preview-chip {
  color: var(--color-warning);
  background: var(--amber-soft);
  border-color: var(--color-warning-soft);
}

.grade-badge {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 14px;
}

.grade-a {
  color: var(--color-success);
  background: var(--success-soft);
  border-color: var(--color-success-soft);
}

.grade-b {
  color: var(--color-warning);
  background: var(--amber-soft);
  border-color: var(--color-warning-soft);
}

.grade-c {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border-color: var(--color-danger-soft);
}

.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workflow-stepper li {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--ink-soft);
  border-right: 1px solid var(--line);
}

.workflow-stepper li:last-child {
  border-right: 0;
}

.workflow-stepper li span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  color: var(--color-ink-2);
  background: var(--canvas);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-data);
  font-size: 12px;
}

.workflow-stepper li.active,
.workflow-stepper li.completed {
  color: var(--ink);
}

.workflow-stepper li.active span,
.workflow-stepper li.completed span {
  color: var(--color-white);
  background: var(--primary);
  border-color: var(--primary);
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.assistant-main {
  display: grid;
  gap: 16px;
}

.work-section,
.run-settings,
.detail-section {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.run-settings {
  position: sticky;
  top: 82px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title-row h2 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.data-provider-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -5px 0 14px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-provider-select {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.data-provider-select > span {
  color: var(--color-ink-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.data-provider-select select {
  width: min(220px, 36vw);
  min-height: 34px;
  padding-inline: 9px 28px;
  font-size: 12px;
}

.data-provider-status {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.data-provider-status.unavailable {
  color: var(--danger);
}

.data-provider-configure {
  flex: 0 0 auto;
}

.data-provider-credential-actions .danger {
  margin-right: auto;
}

.work-section .action-row {
  justify-content: flex-end;
  margin-top: 18px;
}

.profile-editor {
  display: grid;
  gap: 20px;
}

.profile-field-group {
  min-width: 0;
}

.profile-field-group + .profile-field-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.profile-group-title::before {
  width: 3px;
  height: 14px;
  flex: 0 0 3px;
  background: var(--primary);
  border-radius: 1px;
  content: "";
}

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

.profile-editor .field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.profile-field-grid .profile-summary-field {
  grid-column: 1 / -1;
}

#profileSection .split-actions {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.scoring-settings {
  display: grid;
  gap: 14px;
}

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

.scoring-settings details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.scoring-settings summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--primary);
  cursor: pointer;
  font-weight: 650;
}

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

.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: center;
}

.weight-row span {
  color: var(--ink-soft);
  font-size: 12px;
}

.weight-row input {
  min-height: 38px;
  font-family: var(--font-data);
  text-align: right;
}

.weight-total {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.weight-total strong {
  font-family: var(--font-data);
}

.progress-block {
  padding: 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 12px;
}

.progress-labels strong {
  font-family: var(--font-data);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--color-rule);
  border-radius: 999px;
}

.progress-value {
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 280ms ease;
}

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

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

#candidateMetrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.discover-page-summary {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-item {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 12px 14px;
  background: var(--surface);
}

.metric-item span {
  color: var(--ink-soft);
  font-size: 11px;
}

.metric-item strong {
  font-family: var(--font-data);
  font-size: 20px;
  line-height: 1.2;
}

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

.billing-rules-section,
.billing-ledger-section,
.billing-admin-section {
  margin-top: 18px;
}

.billing-table {
  min-width: 720px;
}

.billing-admin-table {
  min-width: 780px;
}

.billing-table th:nth-child(2),
.billing-table td:nth-child(2),
.billing-table th:nth-child(3),
.billing-table td:nth-child(3) {
  white-space: nowrap;
}

.billing-admin-tabs {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.billing-admin-tabs.single-tab {
  grid-template-columns: minmax(0, 1fr);
}

.billing-admin-table input[type="number"] {
  width: 112px;
  min-height: 36px;
}

.billing-config-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.billing-config-control label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.billing-user-cell {
  display: grid;
  gap: 2px;
}

.billing-user-cell small,
.billing-rule-meta {
  color: var(--ink-soft);
  font-size: 12px;
}

.billing-delta {
  color: var(--danger);
  font-family: var(--font-data);
  font-weight: 700;
}

.billing-delta.quota {
  color: var(--primary);
}

.user-management-tabs {
  width: min(620px, 100%);
  margin: 0 0 16px;
}

.user-admin-panel {
  padding: 0;
  overflow: hidden;
}

.user-admin-table {
  min-width: 860px;
}

.user-admin-table code {
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 12px;
}

.user-admin-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 250px;
}

.user-record-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(150px, 220px) auto 1fr;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.user-record-toolbar .toolbar-count {
  justify-self: end;
  align-self: center;
}

.record-pagination {
  min-height: 52px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.record-pagination .button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 20px;
}

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

.candidate-product-context {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.segmented {
  min-height: 44px;
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  padding: 3px;
  background: var(--color-rule);
  border: 1px solid var(--color-rule);
  border-radius: 5px;
}

.segmented button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--color-ink-2);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-weight: 650;
}

.segmented button.active {
  color: var(--ink);
  background: var(--color-white);
  box-shadow: 0 1px 3px var(--color-shadow-medium);
}

.candidate-toolbar {
  min-height: 44px;
  flex: 1 1 640px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(150px, 180px));
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
}

.candidate-toolbar input {
  max-width: 280px;
}

.candidate-toolbar select {
  max-width: 180px;
}

.candidate-table {
  min-width: 1080px;
}

.candidate-table th:nth-child(1) { width: 16%; }
.candidate-table th:nth-child(2) { width: 20%; }
.candidate-table th:nth-child(3) { width: 12%; }
.candidate-table th:nth-child(4) { width: 21%; }
.candidate-table th:nth-child(5) { width: 12%; }
.candidate-table th:nth-child(6) { width: 9%; }
.candidate-table th:nth-child(7) { width: 10%; }

.candidate-time {
  color: var(--ink-soft);
  font-family: var(--font-data);
  font-size: 12px;
  white-space: nowrap;
}

.company-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.company-monogram {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--color-white);
  background: var(--color-ink-2);
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
}

.probability-cell {
  display: grid;
  gap: 7px;
}

.probability-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.probability-head strong {
  font-family: var(--font-data);
  font-size: 16px;
}

.mini-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: var(--color-rule);
  border-radius: 999px;
}

.mini-progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.competitor-label {
  display: inline-flex;
  margin-top: 5px;
  padding: 2px 6px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--color-danger-soft);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.detail-breadcrumb {
  margin-bottom: 12px;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 20px 0 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.crm-handoff {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto;
  align-items: end;
  gap: 18px;
  margin: 20px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line-strong);
}

.crm-handoff h2 {
  margin: 3px 0 4px;
  font-size: 16px;
}

.crm-contact-select {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}

.crm-contact-select select {
  width: 100%;
  min-height: 38px;
}

.crm-lifecycle-status {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.candidate-journey {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.candidate-journey-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}

.candidate-journey-heading span:last-child {
  color: var(--ink-soft);
  font-weight: 500;
}

.candidate-journey-stages {
  display: grid;
  grid-template-columns: repeat(9, minmax(76px, 1fr));
  min-width: 760px;
  margin: 0;
  padding: 0 0 2px;
  list-style: none;
}

.candidate-journey-stage {
  position: relative;
  display: grid;
  grid-template-rows: 16px auto;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--color-ink-3);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.candidate-journey-stage::before {
  position: absolute;
  top: 7px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-rule);
  content: "";
}

.candidate-journey-stage:first-child::before {
  display: none;
}

.candidate-journey-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-rule-strong);
  border-radius: 50%;
  background: var(--surface);
}

.candidate-journey-stage.is-completed {
  color: var(--color-accent-hover);
  font-weight: 700;
}

.candidate-journey-stage.is-completed::before {
  background: var(--color-accent);
}

.candidate-journey-stage.is-completed .candidate-journey-marker {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: inset 0 0 0 3px var(--color-accent-soft);
}

.candidate-journey-stage.is-active {
  color: var(--color-warning);
  font-weight: 700;
}

.candidate-journey-stage.is-active .candidate-journey-marker {
  border-color: var(--color-warning);
  background: var(--color-warning-soft);
  box-shadow: 0 0 0 3px var(--color-warning-soft);
}

.candidate-journey-stage.is-skipped::before {
  height: 0;
  border-top: 2px dashed var(--color-rule-strong);
  background: transparent;
}

.candidate-journey-stage.is-skipped .candidate-journey-marker {
  border-style: dashed;
}

.crm-policy-settings {
  grid-column: 1 / -1;
}

.crm-handoff-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.detail-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-title-line h1 {
  margin: 0;
  font-size: 25px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.detail-score {
  min-width: 132px;
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 3px;
}

.detail-score strong {
  font-family: var(--font-data);
  font-size: 30px;
  line-height: 1;
}

.detail-score span {
  color: var(--ink-soft);
  font-size: 11px;
}

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

.research-content {
  display: grid;
  gap: 16px;
}

.research-block {
  display: grid;
  gap: 5px;
}

.research-block h3 {
  margin: 0;
  font-size: 12px;
}

.research-block p,
.research-block ul {
  margin: 0;
  color: var(--color-ink-2);
}

.research-block ul {
  padding-left: 19px;
}

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

.evidence-list a {
  color: var(--primary);
}

.question-form {
  display: grid;
  gap: 10px;
}

.question-form .button {
  justify-self: end;
}

.question-history {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.question-item {
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.question-item strong,
.question-item p {
  display: block;
  margin: 0;
}

.question-item p {
  margin-top: 5px;
  color: var(--color-ink-2);
}

.contact-section {
  margin-top: 18px;
}

.contact-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-page-summary {
  min-width: 72px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.contact-trash-list {
  display: grid;
  gap: 8px;
  min-height: 96px;
}

.contact-trash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.contact-trash-item > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.contact-trash-item span {
  color: var(--ink-soft);
  font-size: 12px;
}

.cost-note {
  margin: -8px 0 13px;
  color: var(--ink-soft);
  font-size: 11px;
}

.contact-provider-toolbar + .cost-note {
  margin-top: -7px;
}

.contact-pagination {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 8px 10px 8px 14px;
  color: var(--color-ink-2);
  background: var(--color-accent-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}

.contact-page-actions {
  display: flex;
  gap: 8px;
}

.contact-table {
  min-width: 1040px;
}

.contact-table th:nth-child(1) { width: 15%; }
.contact-table th:nth-child(2) { width: 18%; }
.contact-table th:nth-child(3) { width: 18%; }
.contact-table th:nth-child(4) { width: 11%; }
.contact-table th:nth-child(5) { width: 14%; }
.contact-table th:nth-child(6) { width: 22%; }

.contact-actions {
  gap: 6px;
}

.contact-detail-row,
.contact-detail-row:hover {
  background: var(--color-accent-soft) !important;
}

.contact-detail-row > td {
  padding: 0 !important;
  border-bottom-color: var(--line-strong);
}

.contact-detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.contact-detail-group {
  min-width: 0;
  padding: 20px;
}

.contact-detail-group + .contact-detail-group {
  border-left: 1px solid var(--line);
}

.contact-detail-heading {
  margin-bottom: 14px;
}

.contact-detail-heading h3,
.tool-result-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

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

.contact-fact-grid > div {
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
}

.contact-fact-grid > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.contact-fact-grid dt,
.verification-detail dt,
.contact-source-item dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.contact-fact-grid dd,
.verification-detail dd,
.contact-source-item dd {
  min-width: 0;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.contact-fact-grid a,
.contact-source-item a {
  color: var(--primary);
}

.verification-detail {
  margin-top: 14px;
}

.verification-detail > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.verification-detail dl,
.contact-source-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.verification-detail dl > div,
.contact-source-item dl > div {
  min-width: 0;
}

.contact-source-list {
  border-top: 1px solid var(--line);
}

.contact-source-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.contact-source-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--color-accent-soft);
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
}

.contact-source-item > div > strong {
  display: block;
  margin-bottom: 8px;
}

.tools-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-catalog {
  min-width: 0;
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
}

.tool-catalog-heading {
  display: grid;
  gap: 2px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.tool-catalog-heading span,
.tool-list-item small,
.tool-workspace-heading p {
  color: var(--ink-soft);
  font-size: 12px;
}

.tool-list {
  display: grid;
}

.tool-list-item {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  text-align: left;
}

.tool-list-item:hover {
  background: var(--color-accent-soft);
}

.tool-list-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.tool-list-item > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tool-list-item small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tool-list-item em {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.tool-workspace {
  min-width: 0;
  padding: 22px;
}

.tool-workspace-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tool-workspace-heading h2 {
  margin: 3px 0 4px;
  font-size: 20px;
}

.tool-workspace-heading p {
  margin: 0;
}

.tool-form {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.tool-result {
  min-width: 0;
  padding-top: 20px;
}

.tool-result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tool-result-table,
.tool-history-table {
  min-width: 760px;
}

.tool-result-table td:first-child {
  width: 34%;
  color: var(--ink-soft);
}

.tool-result-table code,
.tool-history-table code,
.tool-raw-result pre,
.contact-detail-panel code {
  font-family: var(--font-data);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tool-raw-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.tool-raw-result summary {
  padding: 11px 13px;
  cursor: pointer;
  font-weight: 700;
}

.tool-raw-result pre {
  max-height: 420px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: var(--color-rule);
  background: var(--color-rail);
  border-radius: 0 0 4px 4px;
}

.tool-result-error {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--color-danger-soft);
  border-radius: 4px;
}

.tool-history-section {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-history-table th:nth-child(1) { width: 15%; }
.tool-history-table th:nth-child(2) { width: 16%; }
.tool-history-table th:nth-child(3) { width: 13%; }
.tool-history-table th:nth-child(4) { width: 38%; }
.tool-history-table th:nth-child(5) { width: 18%; }

.email-context {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin-bottom: 12px;
  color: var(--color-ink-2);
  background: var(--primary-soft);
  border: 1px solid var(--color-accent-soft);
  border-radius: 4px;
  font-size: 12px;
}

.email-workspace {
  min-height: 650px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.draft-list {
  min-width: 0;
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
}

.draft-list-header {
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

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

.draft-list-header span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 11px;
}

.draft-list-item {
  width: 100%;
  min-height: 78px;
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.draft-list-item:hover,
.draft-list-item.active {
  background: var(--color-white);
}

.draft-list-item.active {
  box-shadow: none;
}

.draft-list-item span,
.draft-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-list-item span {
  font-weight: 650;
}

.draft-list-item small {
  color: var(--ink-soft);
}

.draft-editor {
  min-width: 0;
  padding: 22px;
}

.draft-editor-form {
  display: grid;
  gap: 15px;
}

.draft-editor-form textarea {
  min-height: 360px;
  font-family: var(--font-ui);
}

.draft-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  color: var(--ink-soft);
}

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

.empty-state.compact {
  min-height: 260px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.runtime-settings-form {
  margin-bottom: 18px;
}

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

.local-storage-note {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin: 16px 0 0;
  padding: 9px 12px;
  color: var(--color-ink-2);
  background: var(--color-accent-soft);
  border: 1px solid var(--line);
  font-size: 12px;
}

.runtime-settings-form .action-row {
  justify-content: flex-end;
  margin-top: 16px;
}

.preference-settings {
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.form-submit-row {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.toggle-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.toggle-row input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  accent-color: var(--primary);
}

.toggle-row span,
.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--ink-soft);
}

.dialog-shell {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-shell::backdrop {
  background: var(--color-overlay);
}

.compact-dialog {
  width: min(520px, calc(100vw - 32px));
}

.contact-search-dialog {
  width: min(820px, calc(100vw - 32px));
}

.contact-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.contact-filter-group {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.contact-filter-group legend {
  padding: 0;
  margin-bottom: 8px;
  color: var(--color-ink-2);
  font-size: 12px;
  font-weight: 650;
}

.contact-filter-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 10px;
}

.contact-department-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.contact-filter-options label {
  min-width: 0;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  color: var(--color-ink-2);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.contact-filter-options input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  accent-color: var(--primary);
}

.contact-location-fields {
  display: grid;
  grid-template-columns: 0.75fr 0.75fr 1.5fr;
  gap: 12px;
}

.product-dialog {
  width: min(920px, calc(100vw - 32px));
}

.import-dialog {
  width: min(980px, calc(100vw - 32px));
}

.import-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.import-steps li {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border-right: 1px solid var(--line);
  font-size: 12px;
}

.import-steps li:last-child {
  border-right: 0;
}

.import-steps li > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-data);
}

.import-steps li.active,
.import-steps li.completed {
  color: var(--ink);
  background: var(--primary-soft);
}

.import-steps li.active > span,
.import-steps li.completed > span {
  color: var(--color-white);
  background: var(--primary);
  border-color: var(--primary);
}

.import-preview {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.import-summary > div {
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 13px;
  background: var(--surface-muted);
}

.import-summary span {
  color: var(--ink-soft);
  font-size: 11px;
}

.import-summary strong {
  font-family: var(--font-data);
  font-size: 18px;
}

.import-company-preview {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  gap: 12px 20px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.import-company-preview > div {
  display: grid;
  align-content: start;
  gap: 4px;
}

.import-company-preview dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
}

.import-company-preview dl > div {
  min-width: 0;
}

.import-company-preview dt {
  color: var(--ink-soft);
  font-size: 11px;
}

.import-company-preview dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.import-company-preview .import-error-list {
  grid-column: 1 / -1;
}

.import-preview-table-wrap {
  max-height: 340px;
}

.import-preview-table {
  min-width: 760px;
}

.import-preview-table th:nth-child(1) { width: 16%; }
.import-preview-table th:nth-child(2) { width: 36%; }
.import-preview-table th:nth-child(3) { width: 12%; }
.import-preview-table th:nth-child(4) { width: 36%; }

.import-row-error {
  background: var(--color-danger-soft);
}

.import-error-list {
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}

.import-safety-note {
  margin-top: 18px;
  padding: 11px 13px;
  color: var(--color-ink-2);
  background: var(--color-accent-soft);
  border: 1px solid var(--line);
}

.import-safety-note strong,
.import-safety-note span {
  display: block;
}

.import-safety-note span {
  margin-top: 2px;
  font-size: 12px;
}

.dialog-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header button {
  min-width: 44px;
  min-height: 44px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
}

.dialog-body {
  max-height: calc(100dvh - 92px);
  padding: 20px;
  overflow-y: auto;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.rewrite-context {
  margin-bottom: 16px;
  padding: 10px 12px;
  color: var(--color-ink-2);
  background: var(--color-accent-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
}

.form-message {
  min-height: 22px;
  color: var(--ink-soft);
}

.form-message.error-text {
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 2000;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 15px;
  color: var(--color-white);
  background: var(--color-rail-raised);
  border: 1px solid var(--color-rail-rule);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.toast.success {
  background: var(--color-success);
  border-color: var(--color-success);
}

.skeleton-line {
  height: 12px;
  margin: 8px 0;
  background: var(--color-rule);
  border-radius: 2px;
  animation: skeleton 1.2s ease-in-out infinite alternate;
}

.skeleton-line.short {
  width: 62%;
}

@keyframes skeleton {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

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

@media (max-width: 1100px) {
  .assistant-layout,
  .settings-layout,
  .home-work-grid {
    grid-template-columns: 1fr;
  }

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

  .runtime-fact:nth-child(3n) {
    border-right: 0;
  }

  .runtime-fact:nth-child(-n + 3) {
    border-bottom: 1px solid var(--color-rail-rule);
  }

  .run-settings {
    position: static;
  }

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

  .crm-handoff {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  }

  .crm-handoff-actions {
    grid-column: 1 / -1;
  }

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

  .email-workspace {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .tools-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

  .contact-detail-group + .contact-detail-group {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 184px;
  }

  #workspace {
    padding: 22px 18px;
  }

  .context-bar {
    padding-inline: 18px;
  }

  .candidate-controls {
    align-items: stretch;
    flex-direction: column;
  }

  #candidateMetrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate-toolbar {
    flex-basis: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-toolbar input,
  .candidate-toolbar select {
    max-width: none;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .platform-login {
    grid-template-columns: 1fr;
  }

  .platform-login-brand {
    padding: 24px 20px;
  }

  .platform-login-form {
    width: calc(100% - 32px);
    padding: 32px 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    padding: 10px 12px;
  }

  .brand-block {
    padding-bottom: 10px;
  }

  .primary-nav,
  .utility-nav {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar,
  .utility-nav::-webkit-scrollbar {
    display: none;
  }

  .utility-nav {
    margin-top: 6px;
    padding-top: 0;
    border-top: 0;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 86px;
    padding-inline: 8px;
    text-align: center;
    font-size: 14px;
  }

  .connection-state {
    display: none;
  }

  .context-bar {
    position: static;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 10px 14px;
  }

  .platform-user {
    width: 100%;
    justify-content: space-between;
  }

  .context-item {
    flex: 1 1 130px;
  }

  .context-status {
    width: 100%;
    margin-left: 0;
  }

  #workspace {
    padding: 18px 12px 36px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .runtime-ledger-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .runtime-fact,
  .runtime-fact:nth-child(3n) {
    border-right: 1px solid var(--color-rail-rule);
    border-bottom: 1px solid var(--color-rail-rule);
  }

  .runtime-fact:nth-child(even) {
    border-right: 0;
  }

  .runtime-fact:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .readiness-line {
    align-items: flex-start;
  }

  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .page-actions .button {
    min-width: 0;
    width: 100%;
  }

  .company-conflict,
  .company-list-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .company-list-heading .text-button {
    align-self: flex-start;
  }

  .company-completeness {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .company-profile-section {
    padding: 20px 16px;
  }

  .company-form-message {
    padding-inline: 16px;
  }

  .company-submit-row {
    padding: 14px 16px 18px;
  }

  .company-submit-row .button {
    width: 100%;
  }

  .toolbar,
  .candidate-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .candidate-toolbar {
    grid-template-columns: 1fr;
  }

  .search-field {
    width: 100%;
    flex: 0 0 auto;
  }

  .toolbar-count {
    margin-left: 0;
  }

  .two-columns,
  .contact-filter-fields,
  .contact-location-fields,
  .profile-editor,
  .profile-field-grid,
  .settings-number-grid,
  .runtime-config-grid {
    grid-template-columns: 1fr;
  }

  .contact-filter-fields .span-2 {
    grid-column: span 1;
  }

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

  .span-2,
  .runtime-config-grid .span-2,
  .profile-field-grid .profile-summary-field {
    grid-column: auto;
  }

  #profileSection .split-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  #profileSection .split-actions .button {
    width: 100%;
  }

  .home-context-grid {
    grid-template-columns: 1fr;
  }

  .home-actions,
  .work-section .home-actions.split-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

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

  .workflow-stepper {
    grid-template-columns: 1fr;
  }

  .workflow-stepper li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-stepper li:last-child {
    border-bottom: 0;
  }

  .work-section,
  .run-settings,
  .detail-section {
    padding: 16px;
  }

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

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

  .segmented {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .user-record-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .user-record-toolbar .toolbar-count {
    justify-self: start;
  }

  .record-pagination {
    justify-content: center;
  }

  .segmented button {
    min-width: 0;
    padding: 0 7px;
  }

  .detail-header {
    grid-template-columns: 1fr;
  }

  .crm-handoff {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .crm-handoff-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .crm-handoff-actions .button {
    flex: 1 1 0;
  }

  .detail-score {
    justify-items: start;
  }

  .email-workspace {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .draft-list {
    max-height: 280px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .draft-editor {
    padding: 16px;
  }

  .draft-editor-form textarea {
    min-height: 300px;
  }

  .tools-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .tool-catalog {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .tool-list-item {
    min-height: 88px;
    border-right: 1px solid var(--line);
  }

  .tool-workspace,
  .tool-history-section,
  .contact-detail-group {
    padding: 16px;
  }

  .contact-fact-grid,
  .verification-detail dl,
  .contact-source-item dl {
    grid-template-columns: 1fr;
  }

  .contact-source-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
  }

  .dialog-shell {
    width: calc(100vw - 20px);
  }

  .import-steps li {
    min-height: 48px;
    justify-content: center;
    padding: 8px 5px;
    text-align: center;
  }

  .import-steps li > span {
    display: none;
  }

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

  .import-company-preview,
  .import-company-preview dl {
    grid-template-columns: 1fr;
  }

  .import-dialog .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .import-dialog .dialog-actions .button {
    width: 100%;
  }

  .contact-heading-actions,
  .contact-pagination,
  .contact-page-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .contact-page-summary {
    text-align: left;
  }

  .contact-page-actions .button {
    width: 100%;
  }

  .data-provider-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .data-provider-select {
    width: 100%;
    justify-content: space-between;
  }

  .data-provider-select select {
    width: min(70vw, 260px);
  }

  .data-provider-status {
    white-space: normal;
  }

  .data-provider-configure {
    width: 100%;
  }

  .data-provider-credential-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .data-provider-credential-actions .danger {
    margin-right: 0;
  }
}

/* Hallmark 2.8 workbench layer
 * Keeps the existing application contract while replacing its visual and
 * responsive structure. All declarations below consume locked design tokens.
 */

::selection {
  color: var(--color-ink);
  background: var(--color-selection);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
.brand-block strong,
.platform-login-brand strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-style: normal;
}

strong,
time,
code,
.runtime-fact,
.metric-item,
.home-context-item,
.toolbar-count,
.probability-cell,
.billing-summary-item,
.usage-delta,
.score-number {
  font-variant-numeric: tabular-nums;
}

button,
.button,
.nav-item,
.text-button,
.email-back {
  white-space: nowrap;
}

svg {
  flex: 0 0 auto;
}

.skip-link {
  z-index: var(--z-toast);
  color: var(--color-accent-ink);
  background: var(--color-ink);
  border-radius: var(--radius-control);
}

.platform-login {
  grid-template-columns: minmax(19rem, 0.72fr) minmax(0, 1.28fr);
  background: var(--color-paper);
}

.platform-login-brand {
  position: relative;
  gap: var(--space-sm);
  padding: var(--space-xl);
  color: var(--color-rail-ink);
  background: var(--color-rail);
}

.platform-login-brand::after {
  position: absolute;
  right: var(--space-xl);
  bottom: var(--space-xl);
  width: 5rem;
  height: 1px;
  background: var(--color-rail-rule);
  content: "";
}

.platform-login-brand div > span {
  color: var(--color-rail-muted);
}

.platform-login-form {
  width: min(27rem, calc(100% - var(--space-xl)));
  gap: var(--space-sm);
}

.platform-login-form h1 {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.12;
}

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--color-paper);
}

.sidebar {
  z-index: var(--z-context);
  padding: var(--space-sm) var(--space-xs) var(--space-xs);
  color: var(--color-rail-ink);
  background: var(--color-rail);
  border-right-color: var(--color-rail-rule);
}

.brand-block {
  gap: var(--space-xs);
  min-height: 3.5rem;
  padding: 0 var(--space-2xs) var(--space-sm);
  border-bottom-color: var(--color-rail-rule);
}

.brand-mark {
  color: var(--color-accent-ink);
  background: var(--color-brand-signal);
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
}

.brand-block strong {
  font-size: var(--text-md);
  font-weight: 600;
}

.brand-block div > span {
  color: var(--color-rail-muted);
}

.primary-nav,
.utility-nav {
  gap: var(--space-3xs);
  margin-top: var(--space-sm);
}

.utility-nav {
  padding-top: var(--space-sm);
  border-top-color: var(--color-rail-rule);
}

.nav-group-label {
  display: block;
  padding: 0 var(--space-xs);
  margin: 0 0 var(--space-3xs);
  color: var(--color-rail-muted);
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
}

.nav-item {
  gap: var(--space-xs);
  width: 100%;
  min-height: 2.75rem;
  padding: 0 var(--space-xs);
  color: var(--color-rail-muted);
  border-radius: var(--radius-control);
  font-weight: 520;
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.nav-item svg {
  order: -1;
  width: 1rem;
  height: 1rem;
  stroke-width: 1.8;
}

.nav-item:hover {
  color: var(--color-rail-ink);
  background: var(--color-rail-raised);
}

.nav-item.active {
  color: var(--color-rail-ink);
  background: var(--color-rail-selected);
  border-color: transparent;
}

.connection-state {
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-2xs) 0;
  color: var(--color-rail-muted);
}

.status-dot.online {
  background: var(--color-success);
}

.status-dot.offline {
  background: var(--color-danger);
}

.icon-button {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  flex: 0 0 2.75rem;
  padding: 0;
  color: var(--color-ink);
  background: transparent;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-control);
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

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

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 1.125rem;
  height: 1.125rem;
}

.sidebar-close,
.mobile-rail-toggle,
.sidebar-backdrop {
  display: none;
}

.context-bar {
  z-index: var(--z-context);
  gap: var(--space-lg);
  min-height: 4rem;
  padding: var(--space-2xs) var(--space-lg);
  background: var(--color-surface);
  border-bottom-color: var(--color-rule);
}

.context-item span {
  color: var(--color-ink-3);
}

.context-item strong {
  font-family: var(--font-display);
  font-weight: 550;
}

.platform-user {
  min-width: 0;
}

.platform-user .button {
  min-height: 2.75rem;
  gap: var(--space-2xs);
  padding: 0 var(--space-xs);
}

.platform-user .button svg {
  width: 1rem;
  height: 1rem;
}

#workspace {
  width: min(92rem, 100%);
  padding: var(--space-lg);
}

.view {
  min-width: 0;
}

.page-heading {
  align-items: end;
  gap: var(--space-md);
  padding: var(--space-xs) 0 var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-rule-strong);
}

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

.page-heading h1 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.18;
}

.page-heading .eyebrow {
  display: none;
}

.page-summary {
  margin-top: var(--space-2xs);
  color: var(--color-ink-2);
  font-size: var(--text-xs);
}

.eyebrow,
.section-kicker {
  color: var(--color-ink-3);
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: none;
}

.page-actions,
.action-row,
.split-actions,
.dialog-actions,
.form-submit-row {
  gap: var(--space-2xs);
}

.button {
  gap: var(--space-2xs);
  min-height: 2.75rem;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-control);
  font-weight: 600;
  transition:
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.button.small {
  min-height: 2.75rem;
  padding: 0 var(--space-xs);
}

.row-actions .button,
.record-pagination .button,
.segmented button,
.billing-admin-tabs button,
.user-management-tabs button,
.email-back,
.data-provider-select select,
.billing-admin-table input[type="number"],
.user-admin-table input[type="number"] {
  min-height: 2.75rem;
}

.record-pagination .button,
.row-actions .icon-button {
  min-width: 2.75rem;
}

.button.primary {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.button.primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.button.secondary {
  color: var(--color-ink);
  background: var(--color-surface);
  border-color: var(--color-rule-strong);
}

.button.secondary:hover:not(:disabled),
.button.tertiary:hover:not(:disabled) {
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.button.danger {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border-color: var(--color-danger);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled,
.button[aria-busy="true"] {
  opacity: 0.52;
}

.text-button,
.email-back {
  color: var(--color-accent);
}

.text-button:hover,
.email-back:hover {
  color: var(--color-accent-hover);
}

input,
select,
textarea {
  color: var(--color-ink);
  background: var(--color-surface-raised);
  border-color: var(--color-rule-strong);
  border-radius: var(--radius-control);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-ink-3);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-focus);
}

.field > span,
.contact-filter-group legend {
  color: var(--color-ink-2);
}

.runtime-ledger {
  margin-bottom: var(--space-lg);
  color: var(--color-rail-ink);
  background: var(--color-rail);
  border-color: var(--color-rail-rule);
  border-radius: var(--radius-surface);
}

.runtime-ledger-heading {
  min-height: 4.5rem;
  padding: var(--space-xs) var(--space-md);
  border-bottom-color: var(--color-rail-rule);
}

.runtime-ledger-heading h2 {
  font-weight: 600;
}

.runtime-label,
.runtime-timestamp {
  color: var(--color-rail-muted);
  font-family: var(--font-mono);
}

.runtime-facts {
  grid-template-columns: 1.35fr 1.35fr repeat(4, minmax(0, 1fr));
}

.runtime-fact {
  min-height: 6.75rem;
  padding: var(--space-sm);
  border-right-color: var(--color-rail-rule);
}

.runtime-fact::before {
  display: none;
}

.runtime-fact span,
.runtime-fact small {
  color: var(--color-rail-muted);
}

.runtime-fact strong {
  color: var(--color-rail-ink);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.readiness-line {
  padding: var(--space-xs) var(--space-md);
  color: var(--color-rail-muted);
  background: var(--color-rail-raised);
  border-top-color: var(--color-rail-rule);
}

.readiness-line.ready {
  color: var(--color-success-soft);
}

.readiness-line.warning {
  color: var(--color-warning-soft);
}

.readiness-line.error {
  color: var(--color-danger-soft);
}

.home-work-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(18rem, 0.88fr);
  gap: var(--space-lg);
}

.home-work-grid > .work-section {
  min-height: 0;
}

.work-section,
.run-settings,
.detail-section,
.company-profile-section,
.billing-admin-section {
  padding: var(--space-md) 0;
  background: transparent;
  border: 0;
  border-top: 2px solid var(--color-rule-strong);
  border-radius: 0;
}

.work-section + .work-section,
.detail-section + .detail-section,
.company-profile-section + .company-profile-section {
  margin-top: var(--space-md);
}

.section-title-row {
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.section-title-row > * {
  min-width: 0;
}

.section-title-row h2,
.section-title-row h3,
.tool-workspace-heading h2,
.detail-title-line h1 {
  overflow-wrap: anywhere;
  margin-top: var(--space-3xs);
  font-family: var(--font-display);
  font-weight: 600;
}

.home-context-grid {
  gap: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-rule);
  border-radius: 0;
}

.home-context-item {
  min-height: 5rem;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border-right: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}

.home-context-item:nth-child(even) {
  border-right: 0;
}

.home-context-item strong {
  font-family: var(--font-mono);
}

.toolbar {
  gap: var(--space-2xs);
  padding: 0 0 var(--space-sm);
  margin-bottom: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule);
  border-radius: 0;
}

.toolbar-count {
  color: var(--color-ink-2);
  font-family: var(--font-mono);
}

.table-scroll {
  overflow-x: auto;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule-strong);
  border-radius: 0;
}

.data-table {
  background: var(--color-surface);
}

.data-table th,
.data-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom-color: var(--color-rule);
}

.data-table th {
  color: var(--color-ink-2);
  background: var(--color-paper-2);
}

.data-table tbody tr:hover {
  background: var(--color-accent-soft);
}

.company-profile-form,
.company-completeness {
  background: transparent;
  border-color: var(--color-rule);
  border-radius: 0;
}

.company-profile-section {
  padding-inline: 0;
}

.company-list-field,
.profile-editor,
.company-conflict,
.company-readonly-notice {
  border-radius: var(--radius-surface);
}

.workflow-stepper {
  margin-bottom: var(--space-lg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-rule-strong);
  border-radius: 0;
}

.workflow-stepper li {
  min-height: 4.25rem;
  padding: var(--space-xs) var(--space-sm);
  border-right-color: var(--color-rule);
}

.workflow-stepper li.active,
.workflow-stepper li.completed {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

.workflow-stepper li.active span,
.workflow-stepper li.completed span {
  color: var(--color-accent-ink);
  background: var(--color-accent);
}

.assistant-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  gap: var(--space-lg);
}

.run-settings {
  position: sticky;
  top: 5.25rem;
}

.metric-strip,
.metric-strip.compact {
  gap: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-rule-strong);
  border-radius: 0;
}

.metric-item {
  min-width: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
}

.metric-item strong {
  font-family: var(--font-mono);
}

.probability-cell strong,
.detail-score strong {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mini-progress,
.company-completeness-track {
  overflow: hidden;
  background: var(--color-paper-3);
}

.mini-progress span,
.company-completeness-track span {
  background: var(--color-accent);
}

.tools-layout {
  grid-template-columns: minmax(13.5rem, 0.34fr) minmax(0, 1fr);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-rule-strong);
  border-radius: 0;
}

.tool-catalog {
  background: var(--color-paper-2);
  border-right-color: var(--color-rule);
}

.tool-list-item {
  min-height: 4.25rem;
  color: var(--color-ink);
  border-left: 0;
  border-bottom-color: var(--color-rule);
}

.tool-list-item:hover {
  background: var(--color-surface);
}

.tool-list-item.active {
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  border-left: 0;
}

.tool-workspace {
  padding: var(--space-lg);
}

.tool-raw-result,
.contact-detail-panel {
  border-radius: var(--radius-surface);
}

.email-workspace {
  grid-template-columns: minmax(15rem, 0.38fr) minmax(0, 1fr);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-rule-strong);
  border-radius: 0;
}

.draft-list {
  background: var(--color-paper-2);
  border-right-color: var(--color-rule);
}

.draft-list-item {
  border-left: 0;
  border-bottom-color: var(--color-rule);
}

.draft-list-item:hover,
.draft-list-item.active {
  background: var(--color-surface);
}

.draft-list-item.active {
  color: var(--color-accent-hover);
  background: var(--color-accent-soft);
  box-shadow: none;
  outline: 1px solid var(--color-accent);
  outline-offset: -1px;
}

.draft-editor {
  padding: var(--space-lg);
  background: var(--color-surface);
}

.settings-layout {
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  gap: var(--space-lg);
}

.local-storage-note,
.import-safety-note,
.rewrite-context,
.cost-note {
  color: var(--color-ink-2);
  background: var(--color-accent-soft);
  border: 1px solid var(--color-rule);
  border-left: 1px solid var(--color-rule);
  border-radius: var(--radius-control);
}

.segmented,
.billing-admin-tabs,
.user-management-tabs {
  padding: var(--space-3xs);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-surface);
}

.segmented button,
.billing-admin-tabs button,
.user-management-tabs button {
  min-height: 2.75rem;
  border-radius: var(--radius-control);
}

.status-chip,
.preview-chip,
.grade-badge,
.competitor-label {
  font-variant-numeric: tabular-nums;
}

.dialog-shell {
  z-index: var(--z-dialog);
  color: var(--color-ink);
  background: var(--color-surface-raised);
  border-color: var(--color-rule-strong);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-dialog);
}

.dialog-shell::backdrop {
  background: var(--color-overlay);
}

.dialog-header {
  border-bottom-color: var(--color-rule);
}

.dialog-header button {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.toast {
  z-index: var(--z-toast);
  color: var(--color-rail-ink);
  background: var(--color-rail-raised);
  border-color: var(--color-rail-rule);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-dialog);
}

.toast.error {
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.toast.success {
  background: var(--color-success);
  border-color: var(--color-success);
}

.skeleton-line {
  background: var(--color-paper-3);
}

@media (max-width: 72rem) {
  .runtime-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .runtime-fact,
  .runtime-fact:nth-child(3n) {
    border-right: 1px solid var(--color-rail-rule);
    border-bottom: 1px solid var(--color-rail-rule);
  }

  .runtime-fact:nth-child(3n) {
    border-right: 0;
  }

  .runtime-fact:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .assistant-layout,
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .run-settings {
    position: static;
  }
}

@media (max-width: 60rem) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: var(--z-drawer);
    inset: 0 auto 0 0;
    width: min(19rem, calc(100vw - 3rem));
    height: 100dvh;
    display: flex;
    padding: var(--space-sm) var(--space-xs);
    overflow-y: auto;
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: var(--shadow-drawer);
    transition:
      transform var(--duration-normal) var(--ease-out),
      visibility 0s linear var(--duration-normal);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .primary-nav,
  .utility-nav {
    display: grid;
    overflow: visible;
  }

  .utility-nav {
    margin-top: auto;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-rail-rule);
  }

  .nav-item {
    min-width: 0;
    padding-inline: var(--space-xs);
    text-align: left;
    font-size: var(--text-sm);
  }

  .connection-state {
    display: flex;
  }

  .sidebar-close {
    display: inline-grid;
    margin-left: auto;
    color: var(--color-rail-muted);
    border-color: var(--color-rail-rule);
  }

  .sidebar-close:hover {
    color: var(--color-rail-ink);
    background: var(--color-rail-raised);
    border-color: var(--color-rail-muted);
  }

  .mobile-rail-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: var(--z-drawer-backdrop);
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: var(--color-overlay);
    border: 0;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity var(--duration-normal) var(--ease-out),
      visibility 0s linear var(--duration-normal);
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }

  .context-bar {
    position: sticky;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: var(--space-xs);
    padding: var(--space-2xs) var(--space-sm);
  }

  .context-item:nth-of-type(2) {
    display: none;
  }

  .context-status {
    width: auto;
    margin-left: 0;
  }

  .platform-user {
    width: auto;
  }

  .platform-user > span {
    display: none;
  }

  #workspace {
    padding: var(--space-md) var(--space-sm) var(--space-xl);
  }

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

  .tools-layout,
  .email-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-catalog,
  .draft-list {
    max-height: 18rem;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-rule);
  }

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

  .tool-list-item {
    border-right: 1px solid var(--color-rule);
  }
}

@media (max-width: 48rem) {
  body {
    font-size: 15px;
  }

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

  .platform-login-brand {
    min-height: 8rem;
    padding: var(--space-md) var(--space-sm);
  }

  .platform-login-brand::after {
    display: none;
  }

  .platform-login-form {
    width: calc(100% - var(--space-lg));
    padding: var(--space-xl) 0;
  }

  .context-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .context-status {
    display: none;
  }

  .context-item strong {
    max-width: none;
  }

  #workspace {
    padding: var(--space-sm) var(--space-xs) var(--space-xl);
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    padding-top: var(--space-2xs);
  }

  .page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  }

  .page-actions .button {
    width: 100%;
    min-width: 0;
  }

  .runtime-ledger-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3xs);
  }

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

  .runtime-fact,
  .runtime-fact:nth-child(3n) {
    border-right: 1px solid var(--color-rail-rule);
    border-bottom: 1px solid var(--color-rail-rule);
  }

  .runtime-fact:nth-child(even) {
    border-right: 0;
  }

  .runtime-fact:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .home-context-item,
  .home-context-item:nth-child(even) {
    border-right: 0;
  }

  .section-title-row,
  .tool-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .candidate-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-count {
    margin-left: 0;
  }

  .two-columns,
  .contact-filter-fields,
  .contact-location-fields,
  .profile-editor,
  .profile-field-grid,
  .settings-number-grid,
  .runtime-config-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2,
  .contact-filter-fields .span-2,
  .runtime-config-grid .span-2,
  .profile-field-grid .profile-summary-field {
    grid-column: auto;
  }

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

  .workflow-stepper li {
    min-width: 0;
    justify-content: center;
    gap: var(--space-2xs);
    padding-inline: var(--space-2xs);
    border-right: 1px solid var(--color-rule);
    border-bottom: 0;
  }

  .workflow-stepper li strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-xs);
  }

  .workflow-stepper li:last-child {
    border-right: 0;
  }

  .work-section,
  .run-settings,
  .detail-section,
  .company-profile-section,
  .billing-admin-section {
    padding: var(--space-sm) 0;
  }

  .metric-strip,
  .metric-strip.compact,
  #candidateMetrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-scroll {
    overflow: visible;
    border-bottom: 0;
  }

  .data-table,
  .product-table,
  .candidate-table,
  .contact-table,
  .billing-table,
  .billing-admin-table,
  .user-table,
  .tool-result-table,
  .tool-history-table,
  .import-preview-table {
    width: 100%;
    min-width: 0;
    background: transparent;
    table-layout: auto;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .data-table tbody {
    display: grid;
    gap: var(--space-xs);
  }

  .data-table tbody tr {
    min-width: 0;
    display: grid;
    background: var(--color-surface);
    border: 1px solid var(--color-rule);
    border-radius: var(--radius-surface);
  }

  .data-table tbody tr:hover {
    background: var(--color-surface);
  }

  .data-table tbody td {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(6.5rem, 0.34fr) minmax(0, 1fr);
    gap: var(--space-xs);
    padding: var(--space-xs);
    border-bottom: 1px solid var(--color-rule);
    text-align: left !important;
  }

  .data-table tbody td::before {
    color: var(--color-ink-3);
    content: attr(data-label);
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 600;
  }

  .data-table tbody td:last-child {
    border-bottom: 0;
  }

  .data-table tbody td[colspan] {
    display: block;
  }

  .data-table tbody td[colspan]::before {
    content: none;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .draft-editor,
  .tool-workspace,
  .tool-history-section,
  .contact-detail-group {
    padding: var(--space-sm);
  }

  .dialog-shell {
    width: calc(100vw - var(--space-sm));
    max-height: calc(100dvh - var(--space-sm));
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .toast {
    right: var(--space-2xs);
    bottom: var(--space-2xs);
    max-width: calc(100vw - var(--space-sm));
  }
}

@media (max-width: 26rem) {
  .context-bar {
    gap: var(--space-2xs);
    padding-inline: var(--space-xs);
  }

  .context-item span {
    font-size: 0.625rem;
  }

  .context-item strong {
    font-size: var(--text-xs);
  }

  .platform-user .button {
    width: 2.75rem;
    padding: 0;
  }

  .platform-user .button span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

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

  .runtime-fact,
  .runtime-fact:nth-child(3n),
  .runtime-fact:nth-child(even) {
    border-right: 0;
    border-bottom: 1px solid var(--color-rail-rule);
  }

  .runtime-fact:last-child {
    border-bottom: 0;
  }

  .workflow-stepper li span {
    display: none;
  }

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

  .tool-list-item {
    border-right: 0;
  }

  .data-table tbody td {
    grid-template-columns: minmax(5.5rem, 0.42fr) minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop,
  .button,
  .icon-button {
    transform: none !important;
    transition-duration: 0.01ms !important;
  }
}
