:root {
  --bg: #edf5f7;
  --surface: #ffffff;
  --surface-2: #e7f2f4;
  --surface-3: #f7fbfc;
  --text: #102631;
  --muted: #5e7078;
  --line: #cfe0e4;
  --accent: #0b7285;
  --accent-dark: #07566a;
  --accent-2: #b56223;
  --violet: #6571c8;
  --coral: #d76d42;
  --danger: #9f3434;
  --warn: #bd7a12;
  --success: #1f8a55;
  --info: #256fb2;
  --radius: 8px;
  --shadow-soft: 0 10px 30px rgba(13, 42, 50, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button,
.button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 650;
}

.button.primary,
button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.button.primary:hover,
button[type="submit"]:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 260px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand small,
small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

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

.nav a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: var(--radius);
}

.nav a.active,
.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topbar-action {
  background: #f6fbfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 750;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.topbar-action.active,
.topbar-action:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.identity-tools form {
  margin: 0;
}

.identity-tools label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 800;
  gap: 2px;
  text-transform: uppercase;
}

.scope-label {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 800;
  gap: 2px;
  min-width: 130px;
  text-transform: uppercase;
}

.scope-label strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  text-transform: none;
}

.identity-tools select {
  background: #f6fbfc;
  min-height: 34px;
  min-width: 150px;
  padding-right: 28px;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  min-height: 34px;
  padding: 0 10px;
}

.ghost-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.clinical-hero {
  align-items: end;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.48fr);
  margin-bottom: 20px;
}

.clinical-hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  letter-spacing: 0;
  line-height: 0.96;
  margin-bottom: 12px;
}

.clinical-hero p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 0;
  max-width: 760px;
}

.clinical-metrics {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.clinical-metrics div {
  border-left: 1px solid var(--line);
  padding: 16px;
}

.clinical-metrics div:first-child {
  border-left: 0;
}

.clinical-metrics strong {
  color: var(--accent);
  display: block;
  font-size: 34px;
  line-height: 1;
}

.clinical-metrics span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 6px;
}

.clinical-metrics .attention strong {
  color: var(--warn);
}

.clinical-dashboard {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.42fr);
  margin-bottom: 18px;
}

.medication-board,
.clinical-evidence {
  box-shadow: var(--shadow-soft);
}

.medication-board {
  padding: 0;
}

.board-head {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfc 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.board-title {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.board-title h2,
.evidence-head h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.board-title p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.text-link {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.science-icon,
.route-glyph {
  flex: 0 0 auto;
}

.science-icon.capsule {
  background: linear-gradient(90deg, var(--coral) 0 49%, #f6c178 51% 100%);
  border: 2px solid rgba(20, 58, 67, 0.08);
  border-radius: 999px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.34);
  height: 26px;
  transform: rotate(-22deg);
  width: 50px;
}

.medication-list {
  display: grid;
}

.medication-item {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 0.9fr);
  padding: 18px;
  position: relative;
}

.medication-item:first-child {
  border-top: 0;
}

.medication-item::before {
  background: var(--accent);
  bottom: 18px;
  content: "";
  left: 0;
  position: absolute;
  top: 18px;
  width: 4px;
}

.medication-item.warning::before,
.medication-item.old::before {
  background: var(--warn);
}

.medication-item.missing::before {
  background: #9cadb3;
}

.medication-identity {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 46px minmax(0, 1fr);
}

.medication-identity h3 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 5px;
}

.medication-identity p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.route-glyph {
  align-items: center;
  background: #e8f4f7;
  border: 1px solid #bfdce2;
  border-radius: 50%;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.route-glyph span {
  background: var(--accent);
  display: block;
}

.route-glyph.oral span,
.route-glyph.other span {
  border-radius: 999px;
  height: 14px;
  position: relative;
  transform: rotate(-24deg);
  width: 28px;
}

.route-glyph.oral span::after,
.route-glyph.other span::after {
  background: rgba(255, 255, 255, 0.64);
  content: "";
  height: 14px;
  left: 13px;
  position: absolute;
  top: 0;
  width: 2px;
}

.route-glyph.injection span,
.route-glyph.iv span {
  border-radius: 2px;
  height: 27px;
  transform: rotate(38deg);
  width: 5px;
}

.route-glyph.injection span::before,
.route-glyph.iv span::before {
  background: #f0b35b;
  border-radius: 999px;
  content: "";
  height: 9px;
  left: -5px;
  position: absolute;
  top: -6px;
  width: 15px;
}

.route-glyph.patch span {
  background: #f0b35b;
  border-radius: 6px;
  height: 20px;
  width: 26px;
}

.route-glyph.spray span {
  border-radius: 4px;
  height: 22px;
  position: relative;
  width: 12px;
}

.route-glyph.spray span::after {
  background: #f0b35b;
  border-radius: 999px;
  content: "";
  height: 5px;
  position: absolute;
  right: -10px;
  top: 2px;
  width: 14px;
}

.route-glyph.missing span {
  background: #8da1a8;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.medication-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.medication-fields div {
  background: #f7fbfc;
  border: 1px solid #dbe8eb;
  border-radius: var(--radius);
  padding: 10px;
}

.medication-fields dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.medication-fields dd {
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.medication-source {
  align-items: center;
  background: #f1f8f9;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
  justify-content: space-between;
  margin: 0 -18px -18px;
  padding: 12px 18px;
}

.medication-source > span {
  color: #3c5560;
  font-size: 13px;
  font-weight: 750;
}

.medical-safety-note {
  background: #fff9eb;
  border-top: 1px solid #efd8a5;
  color: #745214;
  font-size: 13px;
  margin: 0;
  padding: 13px 18px;
}

.clinical-evidence {
  display: grid;
  gap: 16px;
}

.evidence-visual {
  background: linear-gradient(180deg, #fafdfe 0%, #edf7f9 100%);
  border: 1px solid #d8e8eb;
  border-radius: var(--radius);
  padding: 10px;
}

.evidence-visual img {
  display: block;
  width: 100%;
}

.evidence-head {
  margin-bottom: 0;
}

.evidence-flow {
  counter-reset: none;
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.evidence-flow li {
  align-items: center;
  background: #f7fbfc;
  border: 1px solid #dbe8eb;
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px;
}

.evidence-flow li > span {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.evidence-flow strong,
.source-age h3 {
  font-size: 14px;
  margin: 0;
}

.source-age {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.source-age ul {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.source-age li {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.support-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.52fr);
  margin-bottom: 18px;
}

.clarify-panel {
  border-color: #e6c570;
}

.clinical-actions li {
  padding: 13px 0;
}

.source-list-compact a {
  color: var(--text);
  font-weight: 800;
}

.secondary-support {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  opacity: 0.94;
}

.triage-hero {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.triage-hero h1 {
  font-size: clamp(34px, 5vw, 50px);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 8px;
}

.triage-hero p {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.triage-strip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
}

.triage-strip div {
  border-left: 1px solid var(--line);
  padding: 14px 16px;
}

.triage-strip div:first-child {
  border-left: 0;
}

.triage-strip strong {
  color: var(--accent);
  display: block;
  font-size: 32px;
  line-height: 1;
}

.triage-strip span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 5px;
}

.triage-strip .attention strong {
  color: var(--warn);
}

.triage-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  margin-bottom: 16px;
}

.triage-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.triage-panel {
  box-shadow: var(--shadow-soft);
}

.triage-priority {
  padding: 0;
}

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

.triage-panel-head.compact {
  align-items: center;
  padding: 0 0 12px;
}

.triage-panel-head h2 {
  font-size: 20px;
  margin: 0;
}

.triage-panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.triage-panel-head a,
.triage-panel-head span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.triage-med-list {
  display: grid;
}

.triage-med-row {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 150px;
  padding: 14px 16px;
  position: relative;
}

.triage-med-row:first-child {
  border-top: 0;
}

.triage-med-row::before {
  background: var(--warn);
  bottom: 14px;
  content: "";
  left: 0;
  position: absolute;
  top: 14px;
  width: 4px;
}

.triage-med-row.missing::before {
  background: #9cadb3;
}

.triage-med-row.fresh::before {
  background: var(--success);
}

.triage-med-main {
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr);
  min-width: 0;
}

.triage-med-main .route-glyph {
  height: 34px;
  width: 34px;
}

.triage-med-main h3 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.triage-med-main dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.triage-med-main dl div {
  background: #f7fbfc;
  border: 1px solid #dbe8eb;
  border-radius: var(--radius);
  min-width: 0;
  padding: 8px;
}

.triage-med-main dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.triage-med-main dd {
  font-size: 13px;
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.triage-med-status {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.triage-med-status details {
  width: 100%;
}

.triage-med-status summary {
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.triage-med-status details p {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.mini-med-list {
  display: grid;
  gap: 10px;
}

.mini-med-row {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr);
}

.mini-med-row .route-glyph {
  height: 28px;
  width: 28px;
}

.mini-med-row strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.mini-med-row small {
  margin-top: 3px;
}

.source-age.compact {
  border-top: 0;
  display: grid;
  gap: 9px;
  padding-top: 0;
}

.source-age.compact li {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.triage-secondary {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.disclosure-panel {
  padding: 0;
}

.disclosure-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 15px 16px;
}

.disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary span {
  font-weight: 850;
}

.disclosure-panel > summary strong {
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  padding: 3px 9px;
}

.disclosure-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}

.disclosure-panel > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

.disclosure-panel > :last-child {
  margin-bottom: 16px;
}

.compact-timeline {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 4px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

.meds-hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 12px;
  max-width: 760px;
}

.meds-hero p {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 760px;
}

.meds-hero .button {
  margin-top: 8px;
  white-space: nowrap;
}

.meds-dashboard {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.64fr);
  margin-bottom: 18px;
}

.focus-grid,
.quiet-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.care-map-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4fbfb 100%);
  overflow: hidden;
}

.care-map-image {
  border: 1px solid #d8e8ea;
  border-radius: var(--radius);
  display: block;
  margin: 2px 0 14px;
  width: 100%;
}

.care-map-facts {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.care-map-facts div {
  background: #edf7f8;
  border: 1px solid #d6e8eb;
  border-radius: var(--radius);
  padding: 10px;
}

.care-map-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.care-map-facts dd {
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 4px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
  margin: 22px 0 8px;
}

.section-head p,
.empty {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat {
  padding: 16px;
}

.stat span {
  color: var(--muted);
}

.stat strong {
  display: block;
  font-size: 30px;
}

.stat.warn strong {
  color: var(--warn);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
  box-shadow: 0 1px 0 rgba(13, 42, 50, 0.02);
}

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

.panel-head h2 {
  margin-bottom: 0;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 150px);
  place-items: center;
}

.auth-panel {
  display: grid;
  gap: 14px;
  max-width: 420px;
  width: 100%;
}

.alert {
  border-radius: var(--radius);
  font-weight: 700;
  margin: 0;
  padding: 10px 12px;
}

.alert.error {
  background: #fff1f1;
  border: 1px solid #e6b3b3;
  color: var(--danger);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-list li,
.document-list li,
.task-list li,
.timeline-list li,
.fact-list li,
.memory-list li,
.source-list li,
.handoff-list li {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.review-list li:first-child,
.document-list li:first-child,
.task-list li:first-child,
.timeline-list li:first-child,
.fact-list li:first-child,
.memory-list li:first-child,
.source-list li:first-child,
.handoff-list li:first-child {
  border-top: 0;
}

.review-list p,
.fact-list p,
.memory-list p,
.handoff-list p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.fact-list li.approved,
.fact-list li.rejected,
.fact-list li.deferred {
  background: linear-gradient(90deg, transparent, var(--surface-2));
  border-radius: var(--radius);
  padding-left: 10px;
  padding-right: 10px;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 2px 8px;
  font-size: 12px;
  margin-bottom: 4px;
}

.pill.high {
  background: #fff3cf;
  color: #8a5a00;
}

.treatment-panel {
  padding: 0;
}

.treatment-panel .panel-head {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 18px;
}

.treatment-table {
  display: grid;
}

.treatment-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 1.2fr) minmax(62px, 0.4fr) minmax(118px, 0.75fr) minmax(58px, 0.4fr) minmax(124px, 0.8fr) minmax(96px, 0.55fr);
  padding: 14px 16px;
}

.treatment-row-head {
  border-top: 0;
  color: #40545c;
  font-size: 12px;
  font-weight: 800;
}

.treatment-row > span,
.treatment-name {
  min-width: 0;
}

.treatment-name {
  display: grid;
  gap: 3px 10px;
  grid-template-columns: auto minmax(0, 1fr);
}

.treatment-name strong,
.treatment-name small {
  grid-column: 2;
}

.treatment-name small,
.treatment-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-dot {
  align-self: center;
  background: var(--info);
  border-radius: 999px;
  display: inline-flex;
  height: 8px;
  width: 8px;
}

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

.status-dot.warning,
.status-dot.old {
  background: #e49b12;
}

.status-dot.missing {
  background: #aab8bd;
}

.reliability {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-self: start;
  padding: 5px 9px;
}

.reliability.fresh {
  background: #e1f3e8;
  color: #17643e;
}

.reliability.warning,
.reliability.old {
  background: #fff1d4;
  color: #8a5600;
}

.reliability.missing {
  background: #edf1f2;
  color: #53666d;
}

.safety-note {
  background: #f2f8f6;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 12px 18px;
}

.empty-state-large {
  display: grid;
  gap: 10px;
  padding: 28px 18px;
}

.empty-state-large p {
  color: var(--muted);
  margin: 0;
}

.today-panel {
  display: flex;
  flex-direction: column;
}

.action-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.action-stack li {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px 0;
}

.action-stack li:first-child {
  border-top: 0;
}

.action-stack small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.action-dot {
  background: #ddecf7;
  border: 1px solid #c5dceb;
  border-radius: 999px;
  height: 30px;
  width: 30px;
}

.action-dot.warn {
  background: #fff0ce;
  border-color: #e9c66e;
}

.today-form {
  grid-template-columns: minmax(0, 1fr);
  margin-top: auto;
}

.freshness-summary {
  align-items: baseline;
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.freshness-summary strong {
  color: var(--accent);
  font-size: 34px;
}

.freshness-summary span {
  color: var(--muted);
}

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

.freshness-list li {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.pipeline-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.pipeline-steps li {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 4px;
  padding: 12px;
  position: relative;
}

.pipeline-steps li:not(:last-child)::after {
  color: var(--muted);
  content: "→";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
}

.pipeline-steps span {
  color: var(--muted);
  font-size: 13px;
}

.text-action {
  display: inline-flex;
  font-weight: 700;
  margin-top: 14px;
}

.secondary-grid {
  align-items: start;
}

.stats-compact .stats-grid {
  margin: 0;
}

.pill.approved {
  background: #e1f0e8;
  color: #1d6b45;
}

.pill.rejected {
  background: #f6e4e4;
  color: var(--danger);
}

.pill.deferred {
  background: #fff2d8;
  color: #8a5a00;
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 110px 72px;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-form.stacked {
  grid-template-columns: minmax(0, 1fr) 140px 110px 72px;
}

.compact-form.today-form {
  grid-template-columns: minmax(0, 1fr);
}

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

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

.grid-form button {
  align-self: end;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 38px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.task-list li,
.timeline-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.timeline-list time {
  min-width: 94px;
  color: var(--accent-2);
  font-weight: 700;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
}

.upload-panel form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.capture-panel form {
  display: grid;
  gap: 14px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.camera-drop {
  border: 1px dashed #9db0aa;
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 26px;
  text-align: center;
}

.camera-drop strong {
  font-size: 18px;
}

.camera-drop span {
  color: var(--muted);
}

.camera-drop.compact {
  margin-top: 14px;
  padding: 16px;
}

.camera-drop.compact strong {
  font-size: 15px;
}

.file-input {
  display: none;
}

.button.full {
  width: 100%;
}

.button.danger {
  background: #fff;
  border-color: #e4b5b5;
  color: var(--danger);
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.button[disabled] {
  cursor: default;
  opacity: 0.82;
}

.button-spinner {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  border-top-color: #fff;
  display: none;
  height: 16px;
  margin-right: 8px;
  width: 16px;
}

.button.is-loading .button-spinner,
.button[aria-busy="true"] .button-spinner {
  display: inline-block;
}

.processing-note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 700;
  margin: 10px 0 0;
  padding: 10px 12px;
}

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

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

.check-list {
  list-style: disc;
  padding-left: 20px;
}

.check-list li {
  margin-bottom: 10px;
}

.preview-grid,
.page-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
}

.preview-item,
.page-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  display: grid;
  gap: 8px;
  overflow: hidden;
  padding: 8px;
}

.preview-item span,
.page-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preview-item img,
.page-preview img {
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  border-radius: 6px;
  object-fit: cover;
  width: 100%;
}

.file-preview {
  align-items: center;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  overflow-wrap: anywhere;
  padding: 10px;
  text-align: center;
}

.page-preview-card {
  display: grid;
  gap: 8px;
}

.page-preview-card form {
  margin: 0;
}

.page-preview-card button {
  min-height: 34px;
  padding: 0 10px;
}

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

.data-table th,
.data-table td {
  border-top: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
}

.meta-list div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

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

.meta-list dd {
  margin: 0;
}

.notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.review-state {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.review-state.approved strong {
  color: #1d6b45;
}

.review-state.rejected strong {
  color: var(--danger);
}

.digest-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.digest-card strong {
  color: var(--accent);
  display: block;
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}

.digest-card span {
  color: var(--muted);
  font-size: 13px;
}

.audit-details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.audit-details + .audit-details {
  margin-top: 10px;
}

.audit-details summary {
  cursor: pointer;
  font-weight: 700;
}

.memory-list.compact li {
  padding: 10px 0;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.chat-widget {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  padding: 16px;
}

.chat-widget-head {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.chat-widget-head h2 {
  margin-bottom: 0;
}

.chat-widget-head p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.chat-avatar {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: white;
  display: flex;
  flex: 0 0 38px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

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

.chat-form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  min-height: 118px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.chat-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 95, 0.12);
  outline: none;
}

.chat-actions {
  display: flex;
  justify-content: flex-end;
}

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

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts button {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--accent);
  min-height: 32px;
  padding: 0 10px;
}

.quick-prompts button:hover {
  border-color: var(--accent);
}

.chat-thread {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.chat-bubble {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.chat-bubble span,
.source-title {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.chat-bubble p {
  margin-bottom: 0;
}

.chat-bubble.user {
  background: var(--surface);
}

.chat-bubble.assistant {
  background: var(--surface-2);
  border-color: #c9d8d3;
}

.chat-placeholder {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
}

.chat-placeholder strong {
  color: var(--text);
}

.chat-placeholder p {
  margin-bottom: 0;
}

.source-title {
  margin-top: 14px;
}

.source-list {
  margin-top: 8px;
}

.chat-sources li {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 0;
}

.memory-overview {
  margin-bottom: 18px;
}

.memory-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  margin-bottom: 18px;
}

.memory-main,
.memory-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.memory-side {
  position: sticky;
  top: 92px;
}

.memory-priority {
  border-color: #d8bd67;
}

.memory-note {
  background: #fbfcfb;
}

.compact-notes {
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.compact-notes li {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.compact-notes li:first-child {
  border-top: 0;
  padding-top: 0;
}

.details-grid {
  display: grid;
  gap: 12px;
}

.current-state-list li.needs-review {
  background: #fff9e8;
  border-radius: var(--radius);
  padding-left: 10px;
  padding-right: 10px;
}

.medication-schedule li {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.medication-schedule li:first-child {
  border-top: 0;
}

.medication-schedule li.needs-review {
  background: #fff9e8;
  border-radius: var(--radius);
  padding-left: 10px;
  padding-right: 10px;
}

.schedule-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.schedule-note {
  color: var(--muted);
  margin-bottom: 10px;
}

.schedule-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.schedule-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.schedule-grid dt {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.schedule-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.medication-schedule small {
  color: var(--muted);
  display: block;
  margin-top: 10px;
}

.timeline-memory li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
}

.timeline-memory time {
  color: var(--accent-2);
  font-weight: 700;
}

.handoff-sheet {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

@media (max-width: 820px) {
  .shell,
  .topbar,
  .panel,
  .meds-hero,
  .meds-dashboard,
  .focus-grid,
  .quiet-grid,
  .treatment-panel,
  .treatment-table {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .topbar,
  .section-head,
  .upload-panel form,
  .meds-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .work-grid,
  .capture-grid,
  .digest-grid,
  .meds-dashboard,
  .focus-grid,
  .quiet-grid,
  .care-map-facts {
    grid-template-columns: 1fr;
  }

  .compact-form,
  .compact-form.stacked,
  .chat-form,
  .grid-form,
  .memory-layout,
  .schedule-grid,
  .timeline-memory li {
    grid-template-columns: 1fr;
  }

  .identity-tools {
    align-items: stretch;
    flex-direction: column;
    margin-left: 0;
    width: 100%;
  }

  .identity-tools select,
  .identity-tools button,
  .topbar-action {
    width: 100%;
  }

  .grid-form .wide {
    grid-column: auto;
  }

  .memory-side {
    position: static;
  }

  .shell {
    padding: 18px;
    width: 100%;
  }

  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .treatment-panel .panel-head {
    display: grid;
    gap: 10px;
  }

  .meds-hero h1 {
    font-size: 34px;
  }

  .meds-hero .button {
    width: 100%;
  }

  .care-map-image {
    max-height: 220px;
    object-fit: cover;
    object-position: center;
  }

  .treatment-row,
  .treatment-row-head {
    grid-template-columns: 1fr;
  }

  .treatment-row-head {
    display: none;
  }

  .treatment-row {
    align-items: start;
    gap: 8px;
  }

  .treatment-row > span {
    display: grid;
    gap: 2px;
  }

  .treatment-row > span[data-label]::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 800;
  }

  .brand {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  .clinical-hero,
  .clinical-dashboard,
  .support-grid,
  .secondary-support,
  .triage-layout {
    grid-template-columns: 1fr;
  }

  .clinical-metrics {
    max-width: 100%;
  }

  .clinical-evidence {
    order: 2;
  }
}

@media (max-width: 700px) {
  .topbar {
    gap: 12px;
    padding: 14px 18px;
  }

  .nav {
    flex-wrap: nowrap;
    max-width: 100%;
    gap: 3px;
    overflow-x: hidden;
    padding-bottom: 2px;
  }

  .nav a {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px;
  }

  .topbar-action {
    align-self: flex-start;
    min-height: 34px;
    padding: 6px 10px;
    width: auto;
  }

  .clinical-hero {
    gap: 16px;
  }

  .clinical-hero h1 {
    font-size: 38px;
  }

  .clinical-hero p {
    font-size: 15px;
  }

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

  .clinical-metrics div {
    border-left: 1px solid var(--line);
    border-top: 0;
    padding: 12px;
  }

  .clinical-metrics div:first-child {
    border-left: 0;
  }

  .clinical-metrics strong {
    font-size: 30px;
  }

  .clinical-metrics span {
    font-size: 11px;
  }

  .board-head,
  .medication-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .text-link {
    white-space: normal;
  }

  .medication-item {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .medication-fields {
    grid-template-columns: 1fr;
  }

  .medication-source {
    margin: 0 -16px -16px;
    padding: 12px 16px;
  }

  .evidence-visual {
    padding: 8px;
  }

  .triage-hero {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .triage-hero h1 {
    font-size: 36px;
  }

  .triage-hero .button {
    width: 100%;
  }

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

  .triage-strip div {
    border-top: 1px solid var(--line);
    padding: 12px;
  }

  .triage-strip div:nth-child(1),
  .triage-strip div:nth-child(2) {
    border-top: 0;
  }

  .triage-strip div:nth-child(odd) {
    border-left: 0;
  }

  .triage-med-row {
    grid-template-columns: 1fr;
  }

  .triage-med-main {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .triage-med-main dl {
    grid-template-columns: 1fr;
  }

  .triage-med-status {
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .triage-panel-head,
  .triage-panel-head.compact {
    align-items: flex-start;
    display: grid;
    gap: 6px;
  }
}

@media print {
  .topbar,
  .print-hide {
    display: none;
  }

  body {
    background: white;
  }

  .shell {
    max-width: none;
    padding: 0;
  }

  .handoff-sheet {
    border: 0;
  }
}
