/* ============================================================
   broker-ui.css — shared design-token layer (lane E2, ratified
   2026-08-31 design contract). Included verbatim by later lanes
   (E1, E3, E4, E5) so one widget gets one treatment everywhere.

   Scope rules:
   - Only `sb-`-prefixed tokens and component classes. No selectors for
     the frozen top nav (header bar, brand mark, session controls) — the
     frozen-surface guarantee rests on this selector hygiene, not the
     prefix alone. Grep app/priv/static/ before adding a new sb- name:
     .sb-popup-hook, .sb-plan-info, .sb-info-dot already exist in
     product-popup.js and must not collide.
   - Colors only from the existing product palette (see per-token
     provenance below). No invented hues.
   - --sb-ink #0F2537 is ratified by the E2 design contract and new
     to the codebase: it applies to sb- components only. Legacy
     #0F172A stays on untouched selectors, including the frozen
     header. Do not "harmonize" the legacy alias.

   Token provenance (values traced to the shipped product):
   - #002344   admin-dashboard.html --teal / brand.css --color-navy
   - #001A33   admin-dashboard.html --teal-dark
   - #F0F4F8   ratified E2 page token (slate page-background family)
   - #FFFFFF   --surface
   - #E2E8F0   --border
   - #475569   --ink-muted
   - #F1F5F9   account.html / admin-groups.html neutral chip fill
   - #EEF2F7   admin-dashboard.html rail-badge fill
   - #CBD5E1   quiet input/border gray
   - #298225   --green / --coral / brand accent green
   - #1F6A1C   --teal-light / --coral-light
   - #E9F6E8   --green-bg
   - #92400E   --yellow (estimate/warning ink)
   - #FEFCE8   --yellow-bg
   - #DC2626   --red
   - #991B1B   action-required / days-urgent ink
   - #FEF2F2   --red-bg
   - #298225   focus (product-popup.js outline)
   - radius 12px/8px, card shadow, system font stack: current dashboard
   ============================================================ */

:root {
  --sb-ink: #0F2537;
  --sb-navy: #002344;
  --sb-navy-hover: #001A33;
  --sb-page: #F0F4F8;
  --sb-surface: #FFFFFF;
  --sb-line: #E2E8F0;
  --sb-muted: #475569;
  --sb-muted-soft: #F1F5F9;
  --sb-utility-fill: #EEF2F7;
  --sb-disabled: #CBD5E1;
  --sb-green: #298225;
  --sb-green-hover: #1F6A1C;
  --sb-green-soft: #E9F6E8;
  --sb-amber: #92400E;
  --sb-amber-soft: #FEFCE8;
  --sb-red: #DC2626;
  --sb-red-ink: #991B1B;
  --sb-red-soft: #FEF2F2;
  --sb-focus: #298225;
  --sb-radius: 12px;
  --sb-radius-sm: 8px;
  --sb-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --sb-font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto,
    sans-serif;
}

/* ---- Structural helpers ------------------------------------ */

.sb-card {
  background: var(--sb-surface);
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  padding: 20px;
  box-shadow: var(--sb-shadow);
}

/* All money and counts render with tabular numerals. */
.sb-count {
  font-variant-numeric: tabular-nums;
}

/* Quiet hotkey numeral hint: reads as a keyboard key, never as a
   notification badge. Stays quiet in active and hover states. */
.sb-kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--sb-utility-fill);
  color: var(--sb-muted);
  border: 1px solid var(--sb-line);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Button hierarchy: exactly four semantic classes -------- */

.sb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--sb-radius-sm);
  font-family: var(--sb-font);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.sb-button svg {
  flex: 0 0 auto;
}

/* 1. Primary: solid navy. One per view. */
.sb-button-primary {
  background: var(--sb-navy);
  color: #ffffff;
}

.sb-button-primary:hover {
  background: var(--sb-navy-hover);
  color: #ffffff;
}

/* 2. Secondary: ghost outline navy. */
.sb-button-secondary {
  background: var(--sb-surface);
  color: var(--sb-navy);
  border: 1px solid var(--sb-navy);
}

.sb-button-secondary:hover {
  background: var(--sb-utility-fill);
  color: var(--sb-navy);
}

/* 3. Utility: quiet gray chip with icon. Compact geometry. */
.sb-button-utility {
  background: var(--sb-utility-fill);
  color: var(--sb-ink);
  border: 1px solid var(--sb-line);
  padding: 6px 10px;
  font-size: 0.82rem;
  min-height: 36px;
}

.sb-button-utility:hover {
  background: var(--sb-muted-soft);
  color: var(--sb-ink);
}

/* 4. Final/money: solid green, reserved for Send to Companion Life.
   Disabled is gray and muted with the reason one hover/click away
   (helper text referenced through aria-describedby). */
.sb-button-final {
  background: var(--sb-green);
  color: #ffffff;
}

.sb-button-final:hover {
  background: var(--sb-green-hover);
  color: #ffffff;
}

.sb-button-final[disabled],
.sb-button-final[disabled]:hover {
  background: var(--sb-disabled);
  color: var(--sb-muted);
  cursor: not-allowed;
}

/* Focus is never removed without replacement: every sb- button
   (including links styled as buttons) gets the shared focus ring. */
.sb-button:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 2px;
}

/* ---- Status chips: a vocabulary, not decoration ------------- */

.sb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Green: done / in force / completed item. */
.sb-chip-green {
  background: var(--sb-green-soft);
  color: var(--sb-green);
}

/* Amber: waiting on someone else (employer, employee, carrier). */
.sb-chip-amber {
  background: var(--sb-amber-soft);
  color: var(--sb-amber);
}

/* Gray: not started / neutral metadata. */
.sb-chip-gray {
  background: var(--sb-muted-soft);
  color: var(--sb-muted);
}

/* Red: broker must act NOW. Never a fresh-case default. */
.sb-chip-red {
  background: var(--sb-red-soft);
  color: var(--sb-red-ink);
}
/* ============================================================
   Lane E1 - shared list scaffold (My quotes + My groups)
   One mounted toolbar / KPI sentence / single-column card queue.
   Selector hygiene: sb- prefixed only; nothing here touches the
   frozen top-nav markup or its header button classes.
   ============================================================ */
.sb-list-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  background: var(--sb-page);
  min-height: 60vh;
}
.sb-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sb-list-heading__copy h1 {
  margin: 0 0 4px;
  color: var(--sb-ink);
  font-size: 2rem;
  letter-spacing: -0.02em;
}
.sb-list-heading__copy p {
  margin: 0;
  color: var(--sb-muted);
}
.sb-list-heading__action {
  flex: 0 0 auto;
}
/* Toolbar: one row - fixed search geometry, flexible joined segments,
   fixed sort geometry. */
.sb-list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.sb-list-search {
  position: relative;
  display: flex;
  align-items: center;
}
.sb-list-search__icon {
  position: absolute;
  left: 11px;
  color: var(--sb-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.sb-list-search__input {
  width: 100%;
  padding: 10px 12px 10px 32px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius-sm);
  background: var(--sb-surface);
  color: var(--sb-ink);
  font: inherit;
}
.sb-list-search__input:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 1px;
}
/* Joined segmented control: no gaps, no pills. Active is solid navy. */
.sb-list-segments {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius-sm);
  background: var(--sb-surface);
  overflow: hidden;
  min-height: 42px;
}
.sb-list-segment {
  border: 0;
  border-right: 1px solid var(--sb-line);
  background: transparent;
  color: var(--sb-muted);
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sb-list-segment:last-child {
  border-right: 0;
}
.sb-list-segment:hover {
  background: var(--sb-muted-soft);
  color: var(--sb-ink);
}
.sb-list-segment.is-active {
  background: var(--sb-navy);
  color: #ffffff;
}
.sb-list-segment:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: -2px;
}
.sb-list-sort {
  display: flex;
  align-items: center;
}
.sb-list-sort__select {
  padding: 10px 12px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius-sm);
  background: var(--sb-surface);
  color: var(--sb-ink);
  font: inherit;
  font-size: 0.88rem;
}
.sb-list-sort__select:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 1px;
}
/* SB-FIX-20260901 defect 4: intermediate widths put search + sort on a
   balanced first row and give the joined six-tab stage control the full
   second row. Flexible segments consume the row instead of wrapping onto
   a mostly blank line inside one grid cell. At 621-650px the tabs may form
   two balanced full-width rows (A4, accepted). */
@media (min-width: 621px) {
  .sb-list-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "search sort" "segments segments";
  }
  .sb-list-search {
    grid-area: search;
  }
  .sb-list-segments {
    grid-area: segments;
  }
  .sb-list-sort {
    grid-area: sort;
  }
  .sb-list-segment {
    flex: 1 1 auto;
  }
}
/* Quiet optional controls row (Hide empty, archived toggle). */
.sb-list-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-bottom: 12px;
}
.sb-list-hide-empty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sb-muted);
  cursor: pointer;
}
.sb-list-hide-empty input {
  width: 15px;
  height: 15px;
  accent-color: var(--sb-navy);
}
/* KPI line: one muted sentence. Each clause is inline-flex + nowrap so a
   number never orphans from its label; the whole line wraps between
   clauses, never inside one. */
.sb-list-kpis {
  margin: 0 0 18px;
  color: var(--sb-muted);
  font-size: 0.92rem;
}
.sb-list-kpi-part {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sb-list-kpi-part strong {
  color: var(--sb-ink);
  font-weight: 700;
}
/* Cards: exactly one column. */
.sb-list-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
/* Shared geometry for loading / empty / error / no-match regions. */
.sb-list-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--sb-muted);
  background: var(--sb-surface);
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
}
.sb-list-state[hidden] {
  display: none !important;
}
.sb-list-state h2 {
  margin: 0 0 8px;
  color: var(--sb-ink);
}
.sb-list-state p {
  margin: 0 0 20px;
}
.sb-list-nomatch button {
  min-width: 140px;
}
/* ---- Queue card: three fixed zones, no truncation ----------------- */
.sb-queue-card {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(360px, 2fr) minmax(210px, 0.85fr);
  gap: 20px;
  align-items: start;
  padding: 22px 24px;
}
/* Lineage deep links (#row-<id>) land on the article; announce the
   target with focus/border tokens only. */
.sb-queue-card:target {
  border-color: var(--sb-focus);
  box-shadow: 0 0 0 3px rgba(41, 130, 37, 0.18);
}
.sb-queue-card__identity {
  min-width: 0;
}
/* Company owns its own first line: bigger and heavier than every chip;
   chips never share its line. Wraps anywhere instead of truncating. */
.sb-queue-card__company {
  margin: 0 0 6px;
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sb-ink);
  overflow-wrap: anywhere;
}
.sb-queue-card__stage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sb-queue-card__lineage {
  color: var(--sb-muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.sb-queue-card__numbers {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-queue-card__total {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--sb-navy);
  font-variant-numeric: tabular-nums;
}
.sb-queue-card__total-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sb-muted);
  margin-left: 4px;
}
.sb-queue-card__total-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sb-muted);
}
.sb-queue-card__estimate {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sb-amber-soft);
  color: var(--sb-amber);
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}
/* Every plan renders in full: wrapping container, wrapping chips;
   text is never cut off, squeezed onto one line, or clipped. */
.sb-queue-card__plans {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sb-queue-card__plan-chip {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sb-muted-soft);
  color: var(--sb-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.sb-queue-card__actions {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
/* Staleness first line: clock icon + age + event label. */
.sb-queue-card__staleness {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--sb-muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  margin-bottom: 2px;
}
.sb-queue-card__staleness .sb-clock {
  font-size: 0.8rem;
}
/* Daily verbs (Edit plan options / Edit details / Refresh rates): they
   stay visible and never collapse into a kebab, but step down to quiet
   utilities so the one primary and one ghost keep the hierarchy. */
.sb-queue-card__verbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.sb-queue-card__verbs .sb-button-utility {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.78rem;
}
/* One solid primary, one ghost secondary, icon-only archive utility. */
.sb-queue-card__primary,
.sb-queue-card__secondary {
  width: 100%;
}
.sb-queue-card__archive {
  align-self: flex-end;
  padding: 6px 10px;
  min-height: 34px;
}
/* Disabled computed actions stay visible with their reason and no
   navigable href (affordances tell the truth). */
.sb-queue-card__primary[disabled],
.sb-queue-card__primary[disabled]:hover {
  background: var(--sb-disabled);
  color: var(--sb-muted);
  cursor: not-allowed;
}


/* ---- Danger zones (lane E5, reason MAJOR 6) ---------------------- */
/* Red is broker-must-act-now and the danger-zone border ONLY (design
   contract section 3). A card that holds destructive or irreversible
   actions wears the red-family border; nothing else does. */
.sb-danger-zone {
  border-color: var(--sb-red);
}

.sb-danger-zone .sb-danger-heading {
  color: var(--sb-red-ink);
}

/* Red-at-confirmation button: used ONLY as the final confirm action
   inside a danger-zone dialog (reset, transfer). Composed from the
   existing --sb-red tokens; no new hues. Disabled keeps the shared gray
   disabled treatment so a locked confirm never reads as armed. */
.sb-button-danger {
  background: var(--sb-red);
  color: #ffffff;
}

.sb-button-danger:hover {
  background: var(--sb-red-ink);
  color: #ffffff;
}

.sb-button-danger[disabled],
.sb-button-danger[disabled]:hover {
  background: var(--sb-disabled);
  color: var(--sb-muted);
  cursor: not-allowed;
}
.sb-queue-card__disabled-reason {
  color: var(--sb-muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: -2px;
  overflow-wrap: anywhere;
}
/* Corrupt quote cards: honest degraded geometry; no money, no queue
   facts, one View action. */
.sb-queue-card--corrupt .sb-queue-card__company {
  color: var(--sb-muted);
}
.sb-queue-card--corrupt .sb-corrupt-note {
  margin: 6px 0 0;
  color: var(--sb-muted);
  font-size: 0.9rem;
}
/* Version chain rows under a quote card: quiet, honest lineage. The
   footer zone spans all three card columns. */
.sb-queue-card__footer {
  grid-column: 1 / -1;
  min-width: 0;
}
.sb-queue-card__chain {
  padding-top: 10px;
  border-top: 1px dashed var(--sb-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-queue-card__chain[hidden] {
  display: none;
}
.sb-queue-card__chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--sb-muted);
}
.sb-chain-meta {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.sb-queue-card__chain-toggle {
  border: 0;
  background: none;
  padding: 0;
  color: var(--sb-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}
.sb-queue-card__chain-toggle:hover {
  color: var(--sb-navy);
}
.sb-ver-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sb-muted-soft);
  color: var(--sb-navy);
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
  flex: none;
}
.sb-ver-badge:hover {
  background: var(--sb-utility-fill);
}
/* ---- Responsive: wrap, never truncate ----------------------------- */
/* Near 860px: actions drop below identity + numbers as one row. */
@media (max-width: 880px) {
  .sb-queue-card {
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.6fr);
  }
  .sb-queue-card__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sb-queue-card__primary,
  .sb-queue-card__secondary {
    width: auto;
    flex: 1 1 200px;
  }
  .sb-queue-card__archive {
    margin-left: auto;
  }
}
/* Near 600px: everything stacks; actions full-width; chips wrap. */
@media (max-width: 620px) {
  .sb-list-page {
    padding: 24px 16px 56px;
  }
  .sb-list-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .sb-list-toolbar {
    grid-template-columns: 1fr;
  }
  .sb-list-segments {
    overflow-x: auto;
  }
  .sb-queue-card {
    grid-template-columns: 1fr;
  }
  .sb-queue-card__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .sb-queue-card__primary,
  .sb-queue-card__secondary {
    width: 100%;
    flex: none;
  }
  .sb-queue-card__archive {
    align-self: stretch;
  }
}
/* The hidden attribute must win over the display property above
   (author rules override the UA [hidden] rule); conditional actions
   like Save-as-my-default depend on it. */
.sb-button[hidden] {
  display: none;
}
/* Same guarantee for the composer/card containers: a display rule on
   the class must not defeat the hidden attribute. */
.sb-card[hidden],
.sb-composer[hidden],
.sb-body[hidden],
.sb-lint[hidden] {
  display: none;
}
/* ---- E4 outreach composer (dashboard Messages + Account editor) --
   One composer treatment everywhere (design contract section 6 and
   C8). Colors come only from the tokens above; no new hues. */
.sb-composer {
  display: grid;
  gap: 14px;
}
.sb-composer-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.sb-composer-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--sb-ink);
}
.sb-variant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sb-variant-chip {
  border: 1px solid var(--sb-line);
  background: var(--sb-surface);
  color: var(--sb-ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--sb-font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.sb-variant-chip[aria-pressed='true'] {
  background: var(--sb-navy);
  border-color: var(--sb-navy);
  color: #ffffff;
}
.sb-variant-chip:disabled {
  background: var(--sb-muted-soft);
  color: var(--sb-muted);
  cursor: not-allowed;
}
.sb-variant-chip:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 2px;
}
.sb-note {
  margin: 0;
  color: var(--sb-muted);
  font-size: 0.85rem;
}
.sb-review-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sb-amber);
  background: var(--sb-amber-soft);
  border-radius: var(--sb-radius-sm);
  padding: 8px 12px;
}
.sb-field {
  display: grid;
  gap: 6px;
}
.sb-field > label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sb-ink);
  letter-spacing: 0.04em;
}
.sb-input {
  padding: 9px 12px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius-sm);
  font-family: var(--sb-font);
  font-size: 0.92rem;
  background: var(--sb-surface);
  color: var(--sb-ink);
}
.sb-input:focus-visible,
.sb-body:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 1px;
}
.sb-body {
  min-height: 180px;
  padding: 10px 12px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius-sm);
  font-family: var(--sb-font);
  font-size: 0.92rem;
  line-height: 1.55;
  background: var(--sb-surface);
  color: var(--sb-ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-y: auto;
}
.sb-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sb-utility-fill);
  border: 1px solid var(--sb-line);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--sb-ink);
  vertical-align: baseline;
}
.sb-lint {
  background: var(--sb-amber-soft);
  border-radius: var(--sb-radius-sm);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.sb-lint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--sb-amber);
}
.sb-lint-row.is-ignored .sb-lint-message {
  text-decoration: line-through;
}
.sb-lint-ignore {
  background: var(--sb-surface);
  border: 1px solid var(--sb-line);
  color: var(--sb-ink);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--sb-font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.sb-lint-ignore:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 1px;
}
.sb-composer-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.sb-composer-footer .sb-button-primary {
  margin-left: auto;
}
/* Narrow viewports: footer actions wrap; Send never overlays content. */
@media (max-width: 560px) {
  .sb-composer-footer .sb-button-primary {
    margin-left: 0;
    flex: 1 1 100%;
  }
}

/* ---- SB-COMMLOG: Messages pane (variant A, timeline-forward) ----
   Pane header with the always-visible Compose button, the activity
   timeline hero with filter pills, and the carrier-message rows.
   Same token palette; no new hues. */

.sb-pane-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sb-pane-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--sb-navy);
}

.sb-pane-sub {
  margin: 4px 0 0;
  color: var(--sb-muted);
  font-size: 0.9rem;
}

.sb-card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--sb-navy);
}

/* Filter pills: quiet outlines; the active pill is solid navy, the
   same active treatment as the E1 segment control. */
.sb-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.sb-filter-pill {
  border: 1px solid var(--sb-line);
  background: var(--sb-surface);
  color: var(--sb-muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: var(--sb-font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.sb-filter-pill:hover {
  background: var(--sb-muted-soft);
  color: var(--sb-ink);
}

.sb-filter-pill.is-active {
  background: var(--sb-navy);
  border-color: var(--sb-navy);
  color: #ffffff;
}

.sb-filter-pill:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 2px;
}

/* Timeline: date groups, node icons with a connector line, title row,
   quiet meta, right-rail timestamp. */
.sb-timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.sb-tl-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sb-muted);
  letter-spacing: 0.03em;
  margin: 18px 0 6px;
}

.sb-tl-date:first-child {
  margin-top: 4px;
}

.sb-tl-event {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  position: relative;
}

.sb-tl-event:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 34px;
  bottom: -8px;
  width: 2px;
  background: var(--sb-line);
}

.sb-tl-node {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #ffffff;
  margin-top: 1px;
}

.sb-tl-node svg {
  width: 14px;
  height: 14px;
}

.sb-tl-navy {
  background: var(--sb-navy);
}

.sb-tl-green {
  background: var(--sb-green);
}

.sb-tl-amber {
  background: var(--sb-amber);
}

.sb-tl-gray {
  background: var(--sb-muted);
}

.sb-tl-body {
  flex: 1;
  min-width: 0;
}

.sb-tl-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--sb-ink);
}

.sb-tl-meta {
  color: var(--sb-muted);
  font-size: 0.85rem;
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.sb-tl-time {
  color: var(--sb-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* U1: honest window marker for the activity feed. Quiet microcopy in
   existing muted tokens; only visible when the loader hit its cap. */
.sb-tl-limit {
  margin: 10px 0 0;
  color: var(--sb-muted);
  font-size: 0.8rem;
}

/* Two-card row: Log a contact | Carrier messages. Stacks under 880px. */
.sb-records-lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

@media (max-width: 880px) {
  .sb-records-lower {
    grid-template-columns: 1fr;
  }
}

/* Carrier rows: doc icon, title + meta, status tag, View toggle. */
.sb-carrier-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-carrier-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sb-line);
}

.sb-carrier-row:last-child {
  border-bottom: none;
}

.sb-carrier-doc {
  flex: 0 0 auto;
  color: var(--sb-muted);
  display: grid;
  place-items: center;
  padding-top: 2px;
}

.sb-carrier-doc svg {
  width: 20px;
  height: 20px;
}

.sb-carrier-body {
  flex: 1;
  min-width: 0;
}

.sb-carrier-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sb-ink);
  overflow-wrap: anywhere;
}

.sb-carrier-meta {
  color: var(--sb-muted);
  font-size: 0.8rem;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.sb-carrier-detail {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--sb-muted-soft);
  border-radius: var(--sb-radius-sm);
  font-size: 0.85rem;
  color: var(--sb-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* View reads as a green text link but is a real button (no
   navigation; it toggles the inline detail). */
.sb-carrier-view {
  border: none;
  background: none;
  padding: 2px 0;
  color: var(--sb-green);
  font-family: var(--sb-font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.sb-carrier-view:hover {
  text-decoration: underline;
}

.sb-carrier-view:focus-visible {
  outline: 2px solid var(--sb-focus);
  outline-offset: 2px;
}
