:root {
  color-scheme: light;
  --bg: #fafafa;
  --bg-accent: #eef2f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --text: #1a202c;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #0a0f1e;
  --primary-soft: #e2e8f0;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --radius-card: 6px;
  --radius-control: 4px;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #e2e8f0;
}

*::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.shell {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.landing-shell {
  min-height: calc(100vh - 44px);
  display: grid;
  grid-template-columns: minmax(360px, 2fr) minmax(420px, 3fr);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 24px;
  overflow: hidden;
  background: #fafafa;
}

.landing-brand {
  background: #0a0f1e;
  color: #ffffff;
}

.landing-brand-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
}

.landing-wordmark-wrap {
  display: grid;
  gap: 8px;
}

.landing-wordmark {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.landing-wordmark-rule {
  width: 32px;
  height: 1px;
  background: #1e3a5f;
}

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

h1 {
  max-width: 12ch;
  font-size: clamp(40px, 5vw, 48px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 34ch;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.4;
  color: #94a3b8;
}

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

.landing-copy {
  max-width: 460px;
  margin: auto 0;
}

.landing-proof-points {
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

.landing-access {
  background: #fafafa;
}

.landing-access-inner {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.access-form {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

[data-view-section] {
  display: grid;
  gap: 10px;
}

#clinician-view-section {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.clinician-mode-shell {
  display: grid;
  gap: 12px;
}

.clinician-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #1e3a5f;
  border-radius: 999px;
  background: transparent;
}

.mode-toggle-button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-toggle-button.is-active {
  background: #1e3a5f;
  color: #ffffff;
  border-color: #1e3a5f;
  box-shadow: none;
}

.clinician-workspace {
  display: grid;
  gap: 10px;
  grid-template-columns: 200px minmax(480px, 1fr) 420px;
  align-items: start;
}

.clinician-cohort-workspace {
  display: grid;
  gap: 10px;
}

.clinician-cohort-panel {
  display: grid;
  gap: 10px;
}

.clinician-cohort-panel .surface-display {
  white-space: normal;
}

.cohort-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.clinician-primary,
.clinician-secondary,
.clinician-cohort-panel {
  align-self: start;
}

.clinician-sidebar {
  align-self: start;
  position: sticky;
  top: 18px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.clinician-sidebar h2 {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.clinician-sidebar .card-copy {
  margin-top: 0;
  margin-bottom: 10px;
  max-width: none;
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
}

.clinician-primary {
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.clinician-secondary {
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.clinician-patient-picker {
  min-width: 220px;
  flex: 1 1 240px;
}

.clinician-inline-actions {
  align-items: end;
}

#admin-view-section {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

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

.card-wide {
  width: 100%;
}

.workflow-card {
  display: grid;
  gap: 12px;
}

.workflow-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.workflow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workflow-stack {
  gap: 12px;
}

.workflow-section {
  display: grid;
  gap: 8px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.workflow-actions {
  display: grid;
  gap: 8px;
}

.workflow-optional {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
  padding: 8px 10px;
}

.workflow-optional summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.workflow-optional[open] summary {
  margin-bottom: 8px;
}

.card-copy {
  max-width: 60ch;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.access-card-header {
  display: grid;
  gap: 0;
  margin-bottom: 4px;
}

.access-card-header h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a202c;
}

.stack {
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

label span {
  display: inline-block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.access-form label span {
  margin-bottom: 6px;
  color: #64748b;
}

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

.access-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #ffffff;
  color: #1a202c;
  padding: 0 12px;
  font-size: 14px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.access-form input:focus {
  outline: none;
  border-color: #0a0f1e;
  box-shadow: 0 0 0 3px rgba(10, 15, 30, 0.08);
}

.sign-in-button {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 4px;
  background: #0a0f1e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.sign-in-button:hover {
  opacity: 0.92;
}

.access-footnote {
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

#auth-status {
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: #991b1b;
}

.workspace-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 12px 16px;
  background: #0a0f1e;
  border-color: #0a0f1e;
}

.workspace-topbar-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-topbar-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffffff;
}

.workspace-topbar-title-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.workspace-topbar-divider,
.workspace-topbar-actions-divider {
  width: 1px;
  height: 18px;
  background: #1e3a5f;
}

.workspace-topbar-title {
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
}

.workspace-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.workspace-signout {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.workspace-signout:hover {
  text-decoration: underline;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 116px;
  resize: vertical;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 13px;
}

button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  border-color: var(--primary);
  background: var(--bg-accent);
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.button-primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

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

.surface-display,
pre {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
  padding: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-display,
.alerts-display {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: var(--text);
}

.summary-display {
  margin-top: 0;
  padding: 8px 20px 12px;
}

.alerts-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.patient-list-display,
.timeline-display {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: var(--text);
}

.patient-list-stack {
  display: grid;
  gap: 0;
  max-height: 70vh;
  overflow: auto;
}

.patient-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  justify-items: start;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  transition: all 0.15s ease;
  color: #9ca3af;
}

.patient-list-item:hover {
  background: #f1f5f9;
}

.patient-list-item:has(.patient-alert-badge) .patient-list-name {
  color: #374151;
  font-weight: 600;
}

.patient-list-item:has(.patient-alert-badge) .patient-list-id {
  color: #6b7280;
}

.patient-list-id-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.patient-list-item.is-selected {
  background: #ffffff;
  box-shadow: inset 2px 0 0 #0a0f1e;
}

.patient-list-item.is-selected .patient-list-name {
  color: #111827;
  font-weight: 600;
}

.patient-list-item.is-selected .patient-list-id {
  color: #64748b;
}

.patient-list-id {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}

.patient-list-name {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  line-height: 1.25;
}

.patient-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: auto;
  border-radius: 999px;
  background: #dc6b6b;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
}

.clinical-timeline {
  position: relative;
}

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

.clinical-event {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-left: 10px;
}

.clinical-event::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  bottom: -8px;
  width: 1px;
  background: var(--line);
}

.clinical-event::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.clinical-event-key::after {
  background: var(--primary);
}

.clinical-event-date {
  font-size: 11px;
  color: var(--text-soft);
  padding-top: 2px;
}

.clinical-event-body {
  display: grid;
  gap: 2px;
}

.clinical-event-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.clinical-event-summary {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.timeline-more {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.timeline-more summary,
.alert-details-group summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.not-indicated-group summary {
  cursor: pointer;
}

.alert-details-group {
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

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

.timeline-panels {
  margin-top: 10px;
}

.timeline-panels-compact {
  margin-top: 0;
}

.timeline-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.timeline-panel h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.summary-stack,
.alert-stack {
  display: grid;
  gap: 8px;
}

.summary-header,
.alert-card-header,
.surface-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.summary-header-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.surface-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.surface-title {
  margin-top: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.surface-subtitle {
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
  white-space: normal;
}

.surface-section {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.summary-stack > .surface-section:last-child {
  margin-bottom: 0;
}

.rail-section-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.rail-section-header {
  display: grid;
  gap: 0;
}

.rail-section-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
}

.rail-section-copy,
.rail-section-count {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.rail-section-count {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 1px 6px;
  border: 0;
  border-radius: 4px;
  background: #0a0f1e;
  color: #ffffff;
  font-size: 10px;
}

.clinical-summary-block {
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-width: 0;
  flex: 0 0 auto;
}

.alerts-section-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.12);
}

.clinical-summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.clinical-summary-item {
  color: #1a202c;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
}

.context-grid {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
}

.context-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}

.context-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.context-label {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.context-value-group {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.context-value {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
}

.context-meta {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.therapy-options-section {
  margin: 16px 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.therapy-options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.therapy-options-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nccn-version-badge {
  font-size: 10px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.position-breadcrumb {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.35;
}

.position-breadcrumb span + span::before {
  content: " › ";
  color: #cbd5e1;
}

.therapy-option {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.therapy-option:last-child {
  border-bottom: none;
}

.therapy-option-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 0;
  line-height: 1.3;
}

.therapy-option-status-pill {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #166534;
  background: #f0fdf4;
  padding: 2px 6px;
  border-radius: 999px;
}

.therapy-option-reason {
  font-size: 12px;
  color: #475569;
  margin-left: 16px;
  margin-top: 0;
  line-height: 1.35;
}

.therapy-option-reason-pending {
  font-style: italic;
}

.therapy-option-ref {
  font-size: 10px;
  color: #94a3b8;
  margin-left: 16px;
  margin-top: 0;
  opacity: 1;
}

.therapy-option-blocked-reason {
  font-size: 11px;
  color: #991b1b;
  margin-left: 16px;
  margin-top: 0;
}

.option-indicator-indicated {
  color: #0d9488;
}

.option-indicator-fulfilled {
  color: #16a34a;
}

.option-indicator-eligible {
  color: #3b82f6;
}

.option-indicator-pending {
  color: #94a3b8;
}

.option-indicator-blocked {
  color: #d97706;
}

.option-indicator-not-indicated {
  color: #94a3b8;
}

.not-indicated-toggle {
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
  margin-top: 8px;
  text-decoration: underline;
}

.surface-section-title {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.surface-body,
.surface-meta,
.alert-meta {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.biomarker-implication {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 4px;
  padding: 8px 12px;
  background: #f0fdf4;
  border-left: 3px solid #0d9488;
  border-radius: 0 4px 4px 0;
}

.biomarker-implication-dot {
  color: #0d9488;
  font-size: 10px;
  margin-top: 2px;
  flex-shrink: 0;
}

.biomarker-implication-text {
  font-size: 12px;
  color: #134e4a;
  font-style: italic;
  line-height: 1.5;
}

.meta-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px 12px;
}

.meta-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.meta-value {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: #1a202c;
  font-weight: 600;
}

.meta-value.is-positive {
  color: #0f766e;
}

.meta-value.is-negative {
  color: #475569;
}

.meta-value.is-unknown {
  color: #94a3b8;
  font-style: italic;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge-neutral {
  color: #475467;
  background: #f8fafc;
  border-color: var(--line);
}

.badge-danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.badge-warning {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.badge-attention {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.badge-success {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

.alert-card {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--surface);
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.alert-highlighted {
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.18),
    0 6px 18px rgba(15, 23, 42, 0.04);
  border-color: rgba(37, 99, 235, 0.3);
}

.cohort-groups {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.cohort-group {
  display: grid;
  gap: 8px;
  white-space: normal;
}

.cohort-group .alert-stack {
  gap: 8px;
}

.cohort-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cohort-group-toggle {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 8px 10px;
  text-align: left;
}

.cohort-group-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cohort-group-title-danger {
  color: #b42318;
}

.cohort-group-title-warning {
  color: #b54708;
}

.cohort-group-title-attention {
  color: #a15c07;
}

.cohort-group-chevron {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.cohort-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.cohort-alert-card {
  padding: 0;
  white-space: normal;
}

.cohort-alert-button {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  white-space: normal;
}

.cohort-patient-context {
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--text-muted);
}

.cohort-alert-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
}

.cohort-alert-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cohort-alert-meta-inline {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.due-chip {
  display: inline-block;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.due-chip-normal {
  background: #f3f4f6;
  color: #374151;
}

.due-chip-soon {
  background: #ffedd5;
  color: #9a3412;
}

.due-chip-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.cohort-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cohort-stat-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.cohort-stat-value {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0a0f1e;
}

.cohort-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.cohort-stat-neutral .cohort-stat-value {
  color: var(--text);
}

.cohort-stat-high .cohort-stat-value {
  color: #b42318;
}

.cohort-stat-overdue .cohort-stat-value {
  color: #7f1d1d;
}

.cohort-stat-due-soon .cohort-stat-value {
  color: #b54708;
}

.cohort-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cohort-filter-button {
  border-radius: 4px;
  padding: 6px 10px;
  background: #f1f5f9;
  color: #475569;
  transition: all 0.15s ease;
}

.cohort-filter-button.is-active {
  border-color: #0a0f1e;
  background: #0a0f1e;
  color: #ffffff;
}

.cohort-table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.cohort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cohort-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cohort-table-status-column {
  white-space: nowrap;
}

.cohort-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.cohort-table-row {
  cursor: pointer;
}

.cohort-table-row:hover {
  background: #f8fafc;
}

.cohort-table-patient {
  font-weight: 600;
  color: var(--text);
}

.alert-danger {
  border-left-color: var(--danger);
  background: #ffffff;
}

.alert-warning {
  border-left-color: var(--warning);
  background: #ffffff;
}

.alert-neutral {
  border-left-color: #65a30d;
}

.alert-title {
  margin-top: 2px;
  font-size: 0.9rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text);
}

.alert-reason {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
}

.decision-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 8px 0;
  font-size: 13px;
  line-height: 1.35;
  flex-wrap: wrap;
}

.decision-action {
  color: #1a202c;
  font-weight: 600;
}

.decision-separator {
  color: #94a3b8;
}

.decision-status {
  font-weight: 500;
}

.decision-status-ready {
  color: #065f46;
}

.decision-status-pending {
  color: #92400e;
}

.decision-status-blocked {
  color: #991b1b;
}

.decision-readiness-details {
  margin: 6px 0 0;
}

.decision-readiness-details summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.alert-card-body {
  display: grid;
  gap: 6px;
}

.alerts-section-card .alert-stack {
  gap: 8px;
}

.escalation-window {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.escalation-window-danger {
  border-color: #fecaca;
  background: #fff5f5;
}

.escalation-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.progress-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #dc2626 100%);
  min-width: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: width 0.15s ease;
}

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

.readiness-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.readiness-confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.readiness-confidence-label {
  font-size: 11px;
  color: var(--text-muted);
}

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

.readiness-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.readiness-icon {
  flex: 0 0 auto;
}

.readiness-label {
  color: var(--text);
}

.readiness-reason {
  color: var(--text-muted);
  font-size: 11px;
}

.readiness-reason-documented {
  color: #b42318;
}

.readiness-reason-schema {
  color: var(--text-muted);
  font-style: italic;
}

.decision-readiness-block {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.readiness-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.readiness-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
}
.readiness-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.confidence-high {
  background: #d1fae5;
  color: #065f46;
}
.confidence-medium {
  background: #fef3c7;
  color: #92400e;
}
.confidence-low {
  background: #fed7aa;
  color: #9a3412;
}
.confidence-insufficient {
  background: #f3f4f6;
  color: #6b7280;
}
.readiness-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.readiness-field {
  font-size: 0.8rem;
  padding: 2px 0;
}
.readiness-present {
  color: #065f46;
}
.readiness-missing-doc {
  color: #991b1b;
}
.readiness-missing-schema {
  color: #6b7280;
}
.readiness-reason {
  font-style: italic;
  opacity: 0.8;
}

.surveillance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

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

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

.risk-card-header {
  display: grid;
  gap: 2px;
}

.risk-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.risk-card-subtitle {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.risk-metric-list,
.risk-missing-list {
  display: grid;
  gap: 4px;
}

.risk-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.risk-metric-label {
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.risk-metric-value {
  font-size: 14px;
  line-height: 1.35;
  color: #1a202c;
}

.risk-progress-bar {
  margin-top: 2px;
}

.risk-progress-fill {
  background: linear-gradient(90deg, #64748b 0%, #0f766e 100%);
}

.risk-missing-item,
.risk-unavailable {
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.risk-unavailable {
  font-style: italic;
}

.surveillance-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px 12px;
}

.surveillance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.surveillance-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.surveillance-meta-grid {
  display: grid;
  gap: 2px;
}

.surveillance-meta,
.surveillance-footnote {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.alert-details {
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  padding-bottom: 0;
}

.alert-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.alert-details[open] summary {
  margin-bottom: 4px;
}

.cohort-alert-card .alert-card-body {
  gap: 3px;
}

.cohort-alert-card .surface-kicker {
  font-size: 11px;
  line-height: 1.15;
}

.cohort-alert-card .alert-details {
  margin-top: 0;
}

.cohort-alert-card .alert-details p:last-child {
  margin-bottom: 0;
}

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

#view-status,
#auth-status,
#patient-create-status,
#patient-summary-status,
#cohort-alert-status,
#timeline-status {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 24px, 1200px);
    padding-top: 18px;
  }

  .landing-shell {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-brand-inner,
  .landing-access-inner {
    padding: 24px;
  }

  .landing-copy {
    margin: 12px 0 24px;
  }

  h1 {
    max-width: none;
  }

  .summary-header,
  .alert-card-header,
  .surface-section-header,
  .workflow-header,
  .workspace-topbar {
    flex-direction: column;
  }

  .timeline-grid,
  .timeline-panels {
    grid-template-columns: 1fr;
  }

  #clinician-view-section,
  #admin-view-section {
    grid-template-columns: 1fr;
  }

  .clinician-workspace {
    grid-template-columns: 1fr;
  }

  .clinician-mode-header {
    flex-direction: column;
    align-items: stretch;
  }

  .cohort-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .risk-calculation-grid {
    grid-template-columns: 1fr;
  }

  .clinician-sidebar {
    position: static;
  }

  .clinical-event {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-left: 12px;
  }

  .cohort-alert-meta {
    justify-items: start;
  }
}
