/* Ported from docs/wireframes/shared/components.css.

   DELIBERATELY NOT PORTED: the three .record-header risk-tier-attribute
   left-border rules (wireframe lines 278-280, keyed on the record header's
   risk-tier attribute — high / medium / low). They colour a container by
   risk tier, which §07 R12 bars as a prominence input. They were already
   dead in the wireframe — record.js renders .app-header-card — so carrying
   them across would have left a loaded surface for a future template to
   adopt with no review. Tier styling lives inside its badge and nowhere
   else. Pinned by tests/test_design_system.py. */

/* Retention Max — components.css  (Phase-1 reduced-scope console)
 * Domain UI primitives: risk badge, Case-State badge, Offer-Status badge,
 * filter chips, queue-row treatments, state legend, oversight strip,
 * notes composer, timeline.
 *
 * Two state vocabularies are kept VISUALLY DISTINCT (IA F-04 / entity-model M-2):
 *   - Case State  (Django-owned workflow)  → .case-state-*
 *   - Offer Status (pipeline-owned)         → .offer-status-*
 */

/* ── Risk-tier badge — color + icon + label, never color alone ── */
.risk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap; line-height: 1.2;
  border: 1px solid transparent;
}
.risk-badge .risk-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; font-size: 10px; font-weight: 900;
  border-radius: 50%; flex-shrink: 0;
}
.risk-badge-high   { background: var(--color-risk-high-bg); color: var(--color-risk-high-fg); border-color: var(--color-risk-high-line); }
.risk-badge-high   .risk-icon { background: var(--color-risk-high-line); color: white; }
.risk-badge-medium { background: var(--color-risk-med-bg);  color: var(--color-risk-med-fg);  border-color: var(--color-risk-med-line); }
.risk-badge-medium .risk-icon { background: var(--color-risk-med-line); color: white; }
.risk-badge-low    { background: var(--color-risk-low-bg);  color: var(--color-risk-low-fg);  border-color: var(--color-risk-low-line); }
.risk-badge-low    .risk-icon { background: var(--color-risk-low-line); color: white; }
.risk-badge-lg { padding: 4px 12px 4px 8px; font-size: 12px; }
.risk-badge-lg .risk-icon { width: 18px; height: 18px; font-size: 12px; }

/* Short-Term "manual review" classifier — adjacent to the tier, NOT a 4th risk level,
 * NOT rendered with risk-color semantics (IA §4.2). */
.short-term-flag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
  background: rgba(31,58,107,0.08); color: var(--color-navy-mid);
  border: 1px dashed var(--color-navy-mid);
}

/* ── Case State badge (Django-owned workflow) — square/rectangular ── */
.case-state {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 800; white-space: nowrap; line-height: 1.2;
  border: 1px solid transparent;
}
.case-state .cs-glyph { font-size: 11px; font-weight: 900; line-height: 1; }
.case-state-initial   { background: #EEF2FF; color: #3730A3; border-color: #C7D2FE; }
.case-state-aar       { background: #E0F2FE; color: #075985; border-color: #7DD3FC; }
.case-state-arr       { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.case-state-closed    { background: #E2E8F0; color: #334155; border-color: #CBD5E1; }
.case-state-canceled  { background: #F1F5F9; color: #64748B; border-color: #E2E8F0; }

/* ── Offer Status badge (pipeline-owned) — pill/rounded + dot ── */
.offer-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 800; white-space: nowrap; line-height: 1.3;
  border: 1px solid transparent;
}
.offer-status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.65; }
.offer-status-undecided { background: #F8FAFC; color: #475569; border-color: #E2E8F0; }
.offer-status-renewed   { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.offer-status-ntv       { background: #FFE4E6; color: #9F1239; border-color: #FECDD3; }
.offer-status-vacated   { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
/* D-55 seven-value enum. Grouped by the Case effect each drives (D-56):
   active = neutral greys/blues; drives-Closed = green/rose; drives-Canceled = slate.
   'Cancelled' is deliberately styled UNLIKE .case-state-canceled so the two never
   read as the same chip on one record (§05 R2 vocabulary collision). */
.offer-status-nooffer   { background: #F8FAFC; color: #64748B; border-color: #E2E8F0; border-style: dashed; }
.offer-status-expired   { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.offer-status-accepted  { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.offer-status-cancelled { background: #FFF1F2; color: #9F1239; border-color: #FECDD3; border-style: dashed; }
.offer-status-deleted   { background: #F1F5F9; color: #475569; border-color: #CBD5E1; text-decoration: line-through; }
/* An Offer Status the pipeline emits that D-55's enum does not name. Dotted, and
   deliberately not any of the seven palettes above: the chip must not imply a
   D-56 case effect the record does not have. Neutral is not the same as
   'Undecided', which is a real status with real semantics. See
   `cases.templatetags.case_tags.offer_status_class`. */
.offer-status-unmapped  { background: #FFFFFF; color: #475569; border-color: #CBD5E1; border-style: dotted; }

/* No-active-offer scoring state (D-64). Deliberately NOT green and NOT low-risk
   styling — an unscored record must not read as "safe". */
.risk-badge-none { background: #F8FAFC; color: #64748B; border-color: #E2E8F0; border-style: dashed; }
.risk-badge-none .risk-icon { background: #CBD5E1; color: #475569; }

/* Renewal blacklist (D-54) — displayed, gates nothing. */
.blacklist-flag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600; background: #FEF3C7;
  color: #92400E; border: 1px solid #FDE68A; white-space: nowrap; }
.pipeline-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-text-subtle); margin-left: 2px;
}

/* ── Assignment cell ────────────────────────────────────────── */
.assignee { font-weight: 800; }
.assignee-none { color: var(--color-severity-danger-fg); font-weight: 800; }
.assignee-you {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--color-brand-tint); color: var(--color-brand-hover);
}
.assignee-stale {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(245,184,46,0.18); color: #92400E; border: 1px solid rgba(245,184,46,0.5);
}

/* ── Filter toolbar — checkbox-dropdown (Decisions MAX pattern) ──
 * Quiet labeled dropdowns (search + Case State / Offer Status / Property [D-38] /
 * Days), NOT a wall of always-expanded pill chips. Active/open buttons carry the
 * cyan-tint treatment. Filters never key on risk tier or a barred proxy (§07 R12);
 * property/market is the D-38 view-filter carve-out (pending Sebra). */
.filter-toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 10px 12px; margin-bottom: 16px;
}
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-label { font-size: 11px; font-weight: 800; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.mock-input, .filter-search {
  min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  background: var(--color-surface); color: var(--color-text-primary);
}
.filter-search { min-width: 220px; flex: 0 1 300px; }
.filter-search::placeholder { color: var(--color-text-subtle); }
.mock-input:focus-visible, .filter-search:focus-visible,
.mock-input:focus, .filter-search:focus { outline: 2px solid var(--color-cyan); outline-offset: 0; border-color: transparent; }

.filter-dropdown { position: relative; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 4px 10px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text-primary);
  font-family: var(--font-body); font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.filter-btn:hover { background: var(--color-bg); }
.filter-btn:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.filter-dropdown.open .filter-btn,
.filter-btn.has-active { background: var(--color-cyan-tint); border-color: var(--color-cyan); color: var(--color-navy-dark); }
.filter-btn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(20,38,74,0.10); color: var(--color-navy-dark); font-size: 10px; font-weight: 800;
}
.filter-dropdown.open .filter-btn-count, .filter-btn.has-active .filter-btn-count { background: var(--color-cyan); color: white; }
.filter-btn-caret { font-size: 9px; color: var(--color-text-muted); }

.filter-dropdown-list[hidden] { display: none; }
.filter-dropdown-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  min-width: 230px; max-height: 340px; overflow: auto;
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(20,38,74,0.16); padding: 6px;
}
.filter-check-group { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); padding: 8px 8px 4px; }
.filter-check-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; min-height: 36px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer;
}
.filter-check-item:hover { background: var(--color-bg); }
.filter-check-item input { width: 16px; height: 16px; accent-color: var(--color-cyan); cursor: pointer; }
.filter-check-item:focus-within { outline: 2px solid var(--color-cyan); outline-offset: -2px; }
.filter-check-note { font-size: 10px; font-weight: 800; color: var(--color-text-subtle); padding: 4px 8px 6px; line-height: 1.4; border-top: 1px dashed var(--color-border); margin-top: 4px; }

.vdiv { width: 1px; align-self: stretch; min-height: 24px; background: var(--color-border); margin: 0 2px; }
.filter-clear-link { color: var(--color-cyan); text-decoration: none; font-size: 12px; font-weight: 800; padding: 8px 6px; min-height: 36px; display: inline-flex; align-items: center; background: transparent; border: none; cursor: pointer; font-family: var(--font-body); }
.filter-clear-link:hover { text-decoration: underline; color: var(--color-brand-hover); }
.filter-clear-link:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; border-radius: 2px; }
.filter-spacer { flex: 1 1 auto; }

/* Report-request affordance (captures the current filters into a ReportJob → S-13) */
.btn-export {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-navy-dark);
  font-family: var(--font-body); font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.btn-export:hover { background: var(--color-cyan-tint); border-color: var(--color-cyan); }
.btn-export:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }

/* Scope segmented control (S-01 own-assigned default vs all — NI-04 provisional) */
.scope-toggle { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.scope-toggle button {
  border: none; background: var(--color-surface); color: var(--color-text-muted);
  font-family: var(--font-body); font-size: 12px; font-weight: 800; cursor: pointer;
  padding: 6px 12px; min-height: 32px;
}
.scope-toggle button + button { border-left: 1px solid var(--color-border-strong); }
.scope-toggle button.active { background: var(--color-navy-mid); color: white; }
.scope-toggle button:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.provisional-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: #92400E; background: rgba(245,184,46,0.16); border: 1px dashed rgba(245,184,46,0.6);
  padding: 1px 6px; border-radius: 3px; cursor: help;
}

/* ── Queue-row auxiliary treatments ─────────────────────────── */
.queue-property { font-weight: 800; }
.queue-unit { color: var(--color-text-muted); font-weight: 800; }
.queue-resident { font-weight: 800; }
.queue-resident-more { color: var(--color-text-muted); font-weight: 800; font-size: 11px; }
.queue-days { font-variant-numeric: tabular-nums; font-weight: 800; }
.queue-days-urgent { color: var(--color-severity-danger-fg); }
.queue-days-warning { color: var(--color-severity-warning-fg); }
.queue-summary {
  font-size: 12px; color: var(--color-text-muted); font-weight: 800;
  padding: 6px 4px 10px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.queue-summary strong { color: var(--color-text-primary); }

/* ── State legend (shell affordance) ────────────────────────── */
.legend { margin-bottom: 12px; }
.legend > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; color: var(--color-text-muted);
  padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.legend > summary::-webkit-details-marker { display: none; }
.legend > summary::before { content: "▸"; color: var(--color-brand); }
.legend[open] > summary::before { content: "▾"; }
.legend > summary:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.legend-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
  padding: 14px; margin-top: 8px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.legend-col h4 { font-family: var(--font-body); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin: 0 0 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 800; }
.legend-item .legend-desc { color: var(--color-text-muted); }

/* ── Assign control (S-04, Manager-only) ────────────────────── */
.assign-cell { display: flex; align-items: center; gap: 8px; }

/* ── Fair-housing / provisional inline notes ────────────────── */
.fh-notice {
  font-size: 12px; color: #92400E; background: rgba(245,184,46,0.12);
  border-left: 3px solid var(--color-amber); padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 12px; font-weight: 800; line-height: 1.5;
}

/* ── Notes composer & timeline (used on S-03; primitives live here) ── */
.note-composer { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; margin-bottom: 12px; background: var(--color-brand-tint); }
.note-composer .form-textarea { background: var(--color-surface); }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline-entry { padding: 10px 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 3px solid var(--color-border); border-radius: var(--radius-sm); }
/* THREE visually distinct origins (no external/Entrata cyan collision):
 *   in-app external → cyan · in-app internal → navy · Entrata-inbound → amber */
.timeline-entry-external { border-left-color: var(--color-cyan); }
.timeline-entry-internal { border-left-color: var(--color-navy-mid); }
.timeline-entry-entrata  { border-left-color: var(--color-amber); }
.timeline-entry-blocker  { border-left-color: var(--color-blocker-line); border-left-width: 4px; background: #F3F4FF; }
.timeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.timeline-actor { font-weight: 800; font-size: 12px; color: var(--color-text-primary); }
.timeline-origin { font-size: 10px; font-weight: 800; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.timeline-time { font-size: 11px; color: var(--color-text-subtle); font-weight: 800; white-space: nowrap; }
.timeline-body { font-size: 13px; line-height: 1.4; color: var(--color-text-primary); font-weight: 700; white-space: pre-wrap; word-break: break-word; }
.origin-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.origin-external { background: rgba(43,174,199,0.15); color: #0E7490; }
.origin-internal { background: rgba(31,58,107,0.10); color: var(--color-navy-mid); }
.origin-entrata  { background: rgba(245,184,46,0.20); color: #92400E; }
.origin-blocker  { background: var(--color-blocker-bg); color: var(--color-blocker-fg); }

/* ── S-03 record detail ─────────────────────────────────────── */
.record-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 14px;
  border-left: 4px solid var(--color-border);
}
.record-header-left { min-width: 0; flex: 1; }
.record-title { font-family: var(--font-display); font-size: 22px; color: var(--color-navy-dark); margin-bottom: 4px; }
.record-subtitle { font-size: 13px; color: var(--color-text-muted); font-weight: 800; margin-bottom: 8px; }
.record-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.record-header-states { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Read-only viewer banner */
.readonly-banner {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 14px;
  border-radius: var(--radius-md); font-size: 12px; font-weight: 800; line-height: 1.4;
  background: #F1F5F9; color: #334155; border: 1px solid var(--color-border-strong);
}
.readonly-banner .rb-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--color-navy-mid); color: white; font-weight: 900; font-size: 11px; flex-shrink: 0;
}

/* .detail-columns / .detail-main / .detail-sidebar are defined once, below
   (the sticky 7fr/3fr layout). An earlier duplicate here declared a
   non-sticky 1.5fr/360px variant that the later block overrode entirely. */

/* Zone card + labels */
.zone { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 14px; }
.zone-label {
  display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 10px;
}
.zone-label .zone-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 3px;
  background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.zone-tag-readonly { background: #F1F5F9; color: #475569; }
.zone-tag-writable { background: var(--color-brand-tint); color: var(--color-brand-hover); border-color: var(--color-brand); }

/* Key-value grid for read-only fields */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 20px; font-size: 13px; }
.kv-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-label { font-size: 10px; font-weight: 800; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kv-value { font-size: 13px; color: var(--color-text-primary); font-weight: 800; overflow-wrap: anywhere; }
.kv-value.mono { font-variant-numeric: tabular-nums; }
.kv-value.neg { color: var(--color-severity-danger-fg); }
.kv-value.pos { color: var(--color-severity-success-fg); }

/* Case State controls (writable zone) */
.state-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.state-controls .divider-v { width: 1px; height: 24px; background: var(--color-border); }

/* Scoring panel — two tier */
.scoring-primary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.score-primary-item { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px; }
.score-primary-item .sp-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: 6px; }
.score-primary-item .sp-value { font-size: 15px; font-weight: 800; color: var(--color-text-primary); }
.score-prob { font-family: var(--font-display); font-size: 28px; color: var(--color-navy-dark); line-height: 1; font-variant-numeric: tabular-nums; }
.scoring-secondary { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--color-border); }
.scoring-secondary .ss-head { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-subtle); margin-bottom: 8px; }
.scoring-note { font-size: 11px; color: var(--color-text-muted); font-weight: 800; margin-top: 10px; line-height: 1.4; }
.regfd-marker {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 5px; border-radius: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(245,184,46,0.18); color: #92400E; border: 1px solid rgba(245,184,46,0.6); cursor: help;
}
.info-marker {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(31,58,107,0.08); color: var(--color-navy-mid);
}

/* Residents list (all resident types — D-37, context only) */
.residents-list { display: flex; flex-direction: column; gap: 4px; }
.resident-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; padding: 4px 0; border-bottom: 1px dashed var(--color-border); }
.resident-row:last-child { border-bottom: none; }
.resident-role { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }

/* Notes composer — external/internal segmented */
.seg { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: var(--color-surface); color: var(--color-text-muted); font-family: var(--font-body); font-size: 12px; font-weight: 800; cursor: pointer; padding: 6px 12px; min-height: 32px; }
.seg button + button { border-left: 1px solid var(--color-border-strong); }
.seg button.active { background: var(--color-navy-mid); color: white; }
.seg button:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -2px; }
.composer-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tag-pick {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted);
  font-family: var(--font-body); font-size: 11px; font-weight: 800; cursor: pointer; min-height: 26px;
}
.tag-pick:hover { background: var(--color-bg); }
.tag-pick.active { background: var(--color-navy-mid); border-color: var(--color-navy-mid); color: white; }
.tag-pick:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.correcting-note { font-size: 11px; font-weight: 800; color: var(--color-brand-hover); background: var(--color-brand-tint); padding: 4px 8px; border-radius: var(--radius-sm); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Timeline entry extras */
.timeline-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 10px; font-weight: 800; background: rgba(20,38,74,0.08); color: var(--color-navy-dark); }
.timeline-actions { margin-top: 6px; }
.timeline-correct { background: transparent; border: none; color: var(--color-brand); font-family: var(--font-body); font-size: 11px; font-weight: 800; cursor: pointer; padding: 2px 4px; }
.timeline-correct:hover { text-decoration: underline; }
.timeline-correct:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.correction-ref { font-size: 10px; font-weight: 800; color: var(--color-text-muted); font-style: italic; margin-bottom: 4px; }
.sync-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.sync-pending { background: rgba(245,184,46,0.16); color: #92400E; }
.sync-ok { background: var(--color-severity-success-bg); color: var(--color-severity-success-fg); }
.sync-fail { background: var(--color-severity-danger-bg); color: var(--color-severity-danger-fg); }
.sync-retry { background: transparent; border: none; color: var(--color-brand); font-family: var(--font-body); font-size: 10px; font-weight: 800; cursor: pointer; text-decoration: underline; padding: 0 0 0 4px; }

/* Inline activity log (this case) */
.activity-inline { list-style: none; margin: 0; padding: 0; }
.activity-inline li { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--color-border); font-size: 12px; font-weight: 800; align-items: baseline; }
.activity-inline li:last-child { border-bottom: none; }
.activity-inline .ai-time { color: var(--color-text-subtle); font-variant-numeric: tabular-nums; font-size: 11px; }
.activity-inline .ai-body { min-width: 0; }
.activity-inline .ai-actor { color: var(--color-text-primary); }
.activity-inline .ai-detail { color: var(--color-text-muted); }

/* ── S-08 dedicated Activity Log ────────────────────────────── */
.audit-cell-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--color-text-muted); }
.audit-action-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid; white-space: nowrap;
}
.aab-note   { background: #E0F2FE; color: #075985; border-color: #7DD3FC; }
.aab-state  { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
.aab-assign { background: #F3E8FF; color: #6B21A8; border-color: #C4B5FD; }
.aab-offer  { background: #D1FAE5; color: #065F46; border-color: #6EE7B7; }
.aab-sync   { background: #FEF3C7; color: #92400E; border-color: #F59E0B; }
.aab-system { background: #F1F5F9; color: #475569; border-color: #CBD5E1; }
.ai-actor-system { color: var(--color-text-muted); font-style: italic; }
.ai-actor-user   { color: var(--color-text-primary); }

/* ── S-06 Users ─────────────────────────────────────────────── */
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; margin-right: 4px; }
.role-pill-admin    { background: #F3E8FF; color: #6B21A8; }
.role-pill-manager  { background: #DBEAFE; color: #1E40AF; }
.role-pill-member   { background: #E0F2FE; color: #075985; }
.role-pill-read_only{ background: #F1F5F9; color: #475569; }
.user-status { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.user-status-active  { background: var(--color-severity-success-bg); color: var(--color-severity-success-fg); }
.user-status-invited { background: var(--color-brand-tint);  color: var(--color-brand-hover); }
.user-status-dormant { background: #F1F5F9;                  color: var(--color-text-muted); }

/* ── S-07 Config ────────────────────────────────────────────── */
.config-section { margin-bottom: 16px; }
/* The settings section's two-column shell: a fixed rail beside the content.
   Vertical rather than the `.detail-tabs` strip because this list is five
   entries with badges on two of them, and it grows — a horizontal strip either
   wraps to two lines or forces every label short enough to be ambiguous. */
.settings-layout { display: flex; align-items: flex-start; gap: 28px; }
.settings-content { flex: 1 1 auto; min-width: 0; }
/* `min-width: 0` above is load-bearing, not defensive: a flex item defaults to
   `min-width: auto`, so the Activity table's intrinsic width would push this
   column wider than its share and shove the rail off-screen instead of
   scrolling inside itself. */

.settings-subnav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 0 0 150px; position: sticky; top: calc(var(--nav-height) + 20px);
}
/* Sticky here is safe where it would not be on `.detail-tabs`. That one pins a
   horizontal bar directly under the navbar and has to hardcode --nav-height as
   its offset; this is a short column in its own gutter, so it can never cover
   content, and the 200-row Activity page is exactly the case where keeping the
   section list on screen earns it. */
.settings-subnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; font-size: 13px; font-weight: 800; color: var(--color-text-muted);
  text-decoration: none; border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}
.settings-subnav a:hover { color: var(--color-text-primary); background: rgba(20,38,74,0.03); }
/* Left rule + tint, not the strip's bottom underline — on a vertical rail an
   underline reads as a divider between entries rather than as a selection. */
.settings-subnav a.active {
  color: var(--color-cyan); border-left-color: var(--color-cyan); background: var(--color-cyan-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.settings-subnav a:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: -2px; }
.ssn-label { flex: 1 1 auto; }
/* Same visual as `.detail-tab .tab-count`, deliberately a SEPARATE rule: that
   one is scoped as a descendant of `.detail-tab`, so it does not reach here,
   and widening its selector to catch both would put case-detail's tab bar on
   the hook for every change made for this rail. */
.ssn-count {
  flex: 0 0 auto; font-size: 10px; font-weight: 800; border-radius: 9px; padding: 1px 6px;
  background: var(--color-blocker-bg); color: var(--color-blocker-fg);
}

/* Below the `.detail-columns` breakpoint the rail goes back to a horizontal
   row above the content — a 150px gutter beside a narrow column leaves the
   content unreadably thin. It also drops `sticky`, which in a stacked layout
   would pin the row over the content it scrolls past. */
@media (max-width: 1080px) {
  .settings-layout { flex-direction: column; gap: 16px; }
  .settings-content { width: 100%; }
  .settings-subnav {
    flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; position: static;
    width: 100%; border-bottom: 1px solid var(--color-border); padding-bottom: 4px;
  }
  .settings-subnav a { border-left: none; border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .settings-subnav a.active { border-left: none; border-bottom-color: var(--color-cyan); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .ssn-label { flex: 0 0 auto; }
}
/* The add-label form sat flush on the first taxonomy row — three block-level
   siblings with no spacing between them and none after. The label stays above
   the pair; the input and button share a line; the rule underneath is what
   separates a write control from the list it writes into. */
.config-add-form { margin: 12px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.caf-row { display: flex; align-items: center; gap: 8px; }
.caf-row .form-input { flex: 1 1 auto; min-width: 0; }
.caf-row .btn { flex: 0 0 auto; }
.tag-govern-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--color-surface);
}
.tag-govern-row.retired { opacity: 0.55; }
.tag-govern-row.retired .tgr-label { text-decoration: line-through; }
.tgr-label { font-weight: 800; font-size: 13px; }
/* The derived identifier, shown because it is what every Note FK points at.
   Muted and monospaced so it reads as machine-shaped and is never mistaken
   for the operator-facing label beside it. */
.tgr-slug { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
/* Pushed right by `margin-left: auto` rather than by `justify-content:
   space-between` on the row: a row now holds two to four children (label,
   optional slug, optional pending flag, actions), and space-between spread
   them across the full width instead of keeping the label group together. */
.tgr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.tgr-actions form { margin: 0; }
/* The two transcription fields inside the approval dialog. Stacked, because
   both are required and a side-by-side pair reads as one optional aside.

   `cases/partials/confirm.html` renders `extra_fields` inside `.assign-cell`,
   which is `display: flex` with NO wrap — so these two labelled inputs landed
   squeezed onto one line beside "Record approval" and "Cancel". The wrap is
   scoped with `:has()` rather than added to `.assign-cell` itself because that
   class has four other callers (toggle, override-close, reassign, assign),
   all of which hold buttons only; this way their computed styles are
   untouched. `flex: 1 1 100%` is what then claims the first line, dropping
   the buttons to the second. */
.assign-cell:has(.approve-fields) { flex-wrap: wrap; }
.approve-fields { flex: 1 1 100%; display: flex; flex-direction: column; gap: 2px; }
.approve-fields .form-label:not(:first-child) { margin-top: 8px; }
.config-locked-note {
  padding: 8px 12px; border-left: 3px solid var(--color-navy-mid); background: rgba(20,38,74,0.04);
  color: var(--color-text-primary); font-size: 12px; font-weight: 800; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 8px; line-height: 1.5;
}
.access-gate {
  padding: 40px 24px; max-width: 620px; margin: 30px auto; text-align: center;
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
}
.access-gate h2 { font-size: 20px; color: var(--color-navy-dark); margin-bottom: 10px; }
.access-gate p { color: var(--color-text-muted); font-weight: 800; line-height: 1.5; margin: 6px 0; }

/* ── S-03 App header card (design language) ─────────────────── */
.app-header-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: 16px;
}
.app-header-main { min-width: 0; }
.app-title { font-family: var(--font-display); font-size: 20px; color: var(--color-navy-dark); line-height: 1.2; }
.app-subtitle { font-size: 12px; color: var(--color-text-muted); font-weight: 800; margin-top: 4px; }
.app-header-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.badge-field { display: flex; align-items: center; gap: 6px; }
.badge-field-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-subtle); }

/* Focusable ⓘ info-affordance (header Offer Status badge tooltip) */
.info-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; color: var(--color-text-muted); background: var(--color-bg); border: 1px solid var(--color-border); cursor: help; }
.info-dot:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.info-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; width: 244px; padding: 8px 10px; background: var(--color-navy-dark); color: #fff; font-size: 11px; font-weight: 800; line-height: 1.45; text-transform: none; letter-spacing: normal; text-align: left; border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(20,38,74,0.28); opacity: 0; visibility: hidden; transition: opacity 100ms; }
.info-pop strong { color: var(--color-amber); }
.info-dot:hover .info-pop, .info-dot:focus .info-pop, .info-dot:focus-visible .info-pop { opacity: 1; visibility: visible; }

/* ── S-03 detail-columns + tabs (design language) ───────────── */
.detail-columns { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .detail-columns { grid-template-columns: 1fr; } }
.detail-main { min-width: 0; }

/* `top: var(--nav-height)`, not 0 — the nav is sticky (z-index 200) and this
 * strip is z-index 10, so at `top: 0` it scrolled up UNDERNEATH the nav and
 * disappeared, taking the record page's tab switching with it. */
.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; position: sticky; top: var(--nav-height); background: var(--color-bg); z-index: 10; }
.detail-tab {
  appearance: none; background: transparent; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 800; color: var(--color-text-muted);
  padding: 10px 14px; min-height: 44px; border-bottom: 2px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.detail-tab:hover { color: var(--color-text-primary); }
.detail-tab.active { color: var(--color-cyan); border-bottom-color: var(--color-cyan); }
.detail-tab:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: -2px; }
.detail-tab .tab-count { font-size: 10px; font-weight: 800; background: rgba(20,38,74,0.08); color: var(--color-navy-dark); border-radius: 9px; padding: 1px 6px; }
.detail-tab .tab-count-blocker { background: var(--color-blocker-bg); color: var(--color-blocker-fg); }
.detail-section { display: none; }
.detail-section.active { display: block; }

/* ── S-03 sticky metadata sidebar (conversation-metadata · §04 R8) ── */
.detail-sidebar { min-width: 0; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.sidebar-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px; }
.sidebar-section-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.metadata-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; align-items: baseline; }
.meta-label { color: var(--color-text-muted); font-weight: 800; }
.metadata-grid > span:not(.meta-label) { font-weight: 800; color: var(--color-text-primary); overflow-wrap: anywhere; }
.tenure-hero { font-family: var(--font-display); font-size: 20px; color: var(--color-navy-dark); line-height: 1.1; }
.tenure-hint { font-size: 11px; font-weight: 800; color: var(--color-text-subtle); margin-top: 4px; line-height: 1.4; }
.sidebar-assignment { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
/* Sidebar workflow-action buttons (Treatment C) — compact, stacked, full-width. */
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; }
.sidebar-actions .btn { justify-content: center; width: 100%; }
.sidebar-actions .form-select { width: 100%; }
/* The assign form stacks a picker directly on the Save/Cancel row; without
   this they touch, since neither `.form-select` nor `.sidebar-actions`
   carries a margin of its own. */
.sidebar-section form .sidebar-actions { margin-top: 10px; }

/* ── S-03 Blockers & attempts (derived read projection · D-41) ── */
.blockers-panel { display: flex; flex-direction: column; gap: 12px; }
.blocker-card { border: 1px solid var(--color-blocker-line); border-left: 4px solid var(--color-blocker-line); border-radius: var(--radius-md); background: #F3F4FF; padding: 12px 14px; }
.blocker-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.blocker-cat {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
  background: var(--color-blocker-bg); color: var(--color-blocker-fg); border: 1px solid var(--color-blocker-line);
}
.blocker-cat-flag { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #92400E; background: rgba(245,184,46,0.18); border: 1px dashed rgba(245,184,46,0.6); border-radius: 3px; padding: 1px 5px; cursor: help; }
.blocker-body { font-size: 13px; font-weight: 700; color: var(--color-text-primary); line-height: 1.4; }
.blocker-meta { font-size: 11px; font-weight: 800; color: var(--color-text-muted); margin-top: 4px; }
.blocker-attempts { margin-top: 10px; border-top: 1px dashed var(--color-border); padding-top: 8px; }
.blocker-attempts-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 6px; }
.attempt-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--color-border); font-size: 12px; }
.attempt-row:last-child { border-bottom: none; }
.attempt-tick { color: var(--color-cyan); font-weight: 900; flex-shrink: 0; }
.attempt-body { min-width: 0; }
.attempt-body .at-body { font-weight: 700; color: var(--color-text-primary); line-height: 1.4; }
.attempt-body .at-meta { font-size: 11px; font-weight: 800; color: var(--color-text-subtle); margin-top: 2px; }
.blocker-none { font-size: 12px; font-weight: 800; color: var(--color-text-muted); padding: 8px 0; }

/* Condensed Overview blockers callout (latest attempt only; full history on Communication) */
.zone-blockers { border-left: 4px solid var(--color-blocker-line); background: #F3F4FF; }
/* Alert-banner treatment when hoisted to the top of Overview (full main-column width). */
.zone-blockers-banner { border-color: var(--color-blocker-line); box-shadow: inset 3px 0 0 var(--color-blocker-line); }
.zone-blockers-banner .zone-label { color: var(--color-blocker-fg); }
.bsum-list { display: flex; flex-direction: column; gap: 10px; }
.bsum-item { border-top: 1px dashed var(--color-border); padding-top: 8px; }
.bsum-item:first-child { border-top: none; padding-top: 0; }
.bsum-head { margin-bottom: 4px; }
.bsum-body { font-size: 13px; font-weight: 700; color: var(--color-text-primary); line-height: 1.4; margin-bottom: 4px; }
.bsum-attempt { display: flex; gap: 6px; font-size: 12px; font-weight: 700; color: var(--color-text-muted); line-height: 1.4; }
.bsum-attempt .attempt-tick { color: var(--color-cyan); font-weight: 900; flex-shrink: 0; }
.bsum-attempt-meta { color: var(--color-text-subtle); font-weight: 800; }
.bsum-noattempt { font-size: 12px; font-weight: 800; color: var(--color-text-subtle); }

/* ── S-03 composer note-type + blocker-category picker ──────── */
.composer-type { display: inline-flex; align-items: center; gap: 6px; }
.blocker-fields { margin-top: 8px; padding: 10px; border: 1px dashed var(--color-blocker-line); border-radius: var(--radius-sm); background: #F3F4FF; }
.blocker-fields.hidden { display: none; }
.blocker-cat-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.blocker-cat-pick {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 12px; min-height: 30px;
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted);
  font-family: var(--font-body); font-size: 11px; font-weight: 800; cursor: pointer;
}
.blocker-cat-pick:hover { background: var(--color-bg); }
.blocker-cat-pick.active { background: var(--color-blocker-fg); border-color: var(--color-blocker-fg); color: white; }
.blocker-cat-pick:focus-visible { outline: 2px solid var(--color-cyan); outline-offset: 2px; }
.addresses-picker { margin-top: 8px; }
.terminal-note {
  padding: 10px 12px; border-left: 3px solid var(--color-navy-mid); background: rgba(20,38,74,0.04);
  color: var(--color-text-primary); font-size: 12px; font-weight: 800; line-height: 1.5;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 4px;
}


/* ── No-active-offer scoring state (D-64) ───────────────────────────────
   A common state under D-53, not an edge case. Styled as an explicit
   explanation rather than an empty panel, so it can never read as "no risk". */
.score-empty { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  background: #F8FAFC; border: 1px dashed #CBD5E1; border-radius: 8px; }
.score-empty-badge { flex: 0 0 auto; padding-top: 2px; }
.score-empty-body { flex: 1 1 auto; min-width: 0; }
.score-empty-title { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.score-empty-text { font-size: 12px; line-height: 1.55; color: #64748B; }

/* ── Ownership labelling on the two state fields (SS05 R2) ──────────────
   Case State (Django) and Offer Status (pipeline) sit side by side, and the
   D-55 enum introduced 'Cancelled' one letter from Case State 'Canceled'.
   Each field names its owner so the two can never be read as one control. */
.badge-field-owner { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: #E0E7FF; color: #3730A3; vertical-align: middle; }
.badge-field-owner-pipeline { background: #F1F5F9; color: #64748B; }

/* Why a case reached Closed — the three T5 paths log distinctly (D-58). */
.closed-reason { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 3px;
  font-size: 10px; font-weight: 600; background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }

.blacklist-flag-sm { padding: 0 4px; font-size: 10px; line-height: 1.5; }

/* Inbound entries are Tier-2 read-only (D-59) — the lock makes the structural
 * (not merely policy) read-only posture legible in the merged timeline. */
.origin-pill-lock { margin-left: 5px; font-size: 9px; opacity: .75; }

/* The household tooltip on the case list, hung off the resident-name link
 * (`static/js/resident_tooltip.js`). The cell shows the primary resident only.
 *
 * DOTTED UNDERLINE, matching decisions-export's `.has-coapplicants` cue — with
 * one necessary adjustment. There the name is plain text, so that rule sets the
 * whole `text-decoration` and `cursor: default`. Here the name is the record
 * LINK, so it already has a solid underline and a pointer: overriding only
 * `text-decoration-style` keeps the link reading as a link (colour + underline)
 * while the dotted variant carries the same "there is more here" signal. Do not
 * add `cursor: default` — it is genuinely clickable, unlike the reference's.
 *
 * NOT `.queue-resident-more` (line ~222), which is the WIREFRAME's version of
 * this cell and is dead — `docs/wireframes/shared/queue.js:96` renders it as
 * the static text `+N more`, with no tooltip and no way to see who the others
 * are. That numeral is the one thing this cell deliberately does not carry:
 * `household_size` is a familial-status proxy dispositioned `Omit` in
 * `docs/prd/appendix-a-data-dictionary.md`, barred as a display or count. The
 * similar class name is a hazard, not a relationship — nothing renders the
 * wireframe rule, and this is not a restyle of it. */
.has-co-residents { text-decoration-style: dotted; text-underline-offset: 3px; }

#resident-tooltip[hidden] { display: none; }
#resident-tooltip { position: fixed; z-index: 100; min-width: 140px; max-width: 260px;
  padding: 8px 12px; border-radius: var(--radius-lg); background: var(--color-navy-dark);
  color: #FFFFFF; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); pointer-events: none; }
/* The arrow follows the flip — pointing down from the box's underside when the
 * tooltip has been placed above its trigger near the bottom of a long list. */
#resident-tooltip::before { content: ""; position: absolute; left: 14px;
  border: 6px solid transparent; }
#resident-tooltip:not(.flipped)::before { top: -6px; border-top: none;
  border-bottom-color: var(--color-navy-dark); }
#resident-tooltip.flipped::before { bottom: -6px; border-bottom: none;
  border-top-color: var(--color-navy-dark); }

.resident-tooltip-list { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.6; }
.resident-tooltip-list li + li { margin-top: 4px; padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, .12); }

/* ── S-03 composer head: segmented visibility control + Case blocker ──────
 * D-81. The segmented control is RADIOS styled as segments, not buttons with
 * JS state: the sync hint below has to switch as the operator picks, and
 * doing that in CSS keeps the whole composer working with JavaScript off —
 * which matters because every other write control on this page is htmx, so a
 * JS-only affordance here would be the one thing that silently stops working.
 *
 * `.seg button` rules above still apply to the button form of this control
 * elsewhere; these add the label/radio form beside them rather than replacing
 * it. */
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.composer-mode { display: flex; align-items: center; gap: 8px; }
.composer-blocker { display: flex; align-items: center; gap: 6px; }
.composer-blocker .filter-label { margin: 0; }

.seg .seg-option {
  display: inline-flex; align-items: center; position: relative;
  background: var(--color-surface); color: var(--color-text-muted);
  font-family: var(--font-body); font-size: 12px; font-weight: 800;
  cursor: pointer; padding: 6px 12px; min-height: 32px;
}
.seg .seg-option + .seg-option { border-left: 1px solid var(--color-border-strong); }
.seg .seg-option:hover { background: var(--color-bg); }
/* The radio itself is removed from the visual flow but NOT from the
 * accessibility tree (no `display:none`), so the group stays keyboard- and
 * screen-reader-operable. */
.seg .seg-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg .seg-option:has(input:checked) { background: var(--color-navy-mid); color: white; }
.seg .seg-option:has(input:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: -2px; }

/* The hint names the CONSEQUENCE of the current pick. Driven off `:has()` so
 * it tracks the radio live; without JS there is no other way to keep it
 * truthful, and a stale hint is worse than none. */
.composer-mode-hint > span { display: none; }
.note-composer:has(#mode-external:checked) .composer-mode-hint .hint-external { display: inline; }
.note-composer:has(#mode-internal:checked) .composer-mode-hint .hint-internal { display: inline; }

/* Inline select — sits in a control row rather than owning its own line. */
.form-select-inline { width: auto; font-size: 11px; font-weight: 800; padding: 3px 26px 3px 8px; min-height: 26px; }

/* Tag chips: the checkbox posts, CSS paints. `.tag-pick.active` above is the
 * same treatment for the JS/button form of this control; this drives it from
 * the checked state so the markup stays a plain form. */
.tag-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tag-pick { position: relative; }
.tag-pick:has(input:checked) { background: var(--color-navy-mid); border-color: var(--color-navy-mid); color: white; }
.tag-pick:has(input:focus-visible) { outline: 2px solid var(--color-brand); outline-offset: 2px; }

/* ── S-03 Case blocker panel (D-79) ────────────────────────────────────── */
/* Cleared is a DIFFERENT state from "never had a blocker": the panel stays,
 * loses the blocker accent, and keeps the history. A panel that vanished on
 * clear would assert the case was never blocked. */
.blocker-card-cleared { border-color: var(--color-border); border-left-color: var(--color-border-strong); background: var(--color-bg); }
.blocker-card-cleared .blocker-none { font-size: 13px; font-weight: 800; color: var(--color-text-muted); }

details.hist > summary { list-style: none; cursor: pointer; }
details.hist > summary::-webkit-details-marker { display: none; }
details.hist > summary { padding: 0; }
details.hist .hist-body { border-top: 1px dashed var(--color-border); margin-top: 8px; padding-top: 6px; }
details.hist .hist-body .blocker-meta:first-child { margin-top: 0; }
