/* ────────────────────────────────────────────────────────────────────────
   Dhanvantari Clinical · MOBILE design system
   Adapted from desktop tokens.css + shell.css (KEEP teal/cyan/Bricolage/Lexend)
   Reshaped for phones: single-column, sheet modals, ≥44px touch targets,
   16px base font, scroll-snap card lists, sticky sub-headers, bottom nav.
   Demo data verbatim from desktop. NOT real PHI.
   ──────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=Lexend:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surfaces */
  --bg:        #F7F9FB;
  --bg2:       #FFFFFF;
  --bg3:       #EEF2F6;
  --card:      #FFFFFF;
  --card-h:    #FAFBFD;
  --row-h:     #F1F5F9;

  /* Brand (kept verbatim from desktop) */
  --teal:      #0FA888;
  --teal-d:    rgba(15,168,136,.08);
  --teal-g:    rgba(15,168,136,.18);
  --cyan:      #0891B2;
  --blue:      #2563EB;

  /* Status colors */
  --critical:  #D14343;
  --critical-d:rgba(209,67,67,.08);
  --warn:      #D97706;
  --warn-d:    rgba(217,119,6,.10);
  --ok:        #059669;
  --ok-d:      rgba(5,150,105,.08);
  --info:      #2563EB;
  --info-d:    rgba(37,99,235,.08);
  --violet:    #7C3AED;

  /* Text */
  --t1:        #0F172A;
  --t2:        #475569;
  --t3:        #94A3B8;
  --t4:        #CBD5E1;

  /* Borders */
  --bdr:       #E5E9F0;
  --bdr-h:     #CBD5E1;

  /* Radii */
  --r:   12px;
  --rs:  8px;
  --rxs: 6px;

  /* Type */
  --fd: 'Bricolage Grotesque', system-ui, sans-serif;
  --fb: 'Lexend', system-ui, sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing */
  --s1: 4px;  --s2: 8px;  --s3: 12px;  --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px;  --s8: 48px;

  /* Shadows */
  --sh1: 0 1px 2px rgba(15,23,42,.04);
  --sh2: 0 2px 6px rgba(15,23,42,.06);
  --sh3: 0 4px 16px rgba(15,23,42,.08);

  /* Mobile-specific */
  --tap:    44px;        /* min touch target */
  --top-h:  56px;        /* topbar height */
  --sub-h:  44px;        /* sticky sub-header */
  --bot-h:  68px;        /* bottom nav */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fb);
  font-size: 16px;
  line-height: 1.5;
  color: var(--t1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--bot-h);
  min-height: 100vh;
}

/* ─── Watermark / banner ─────────────────────────────────────────── */
.watermark {
  position: sticky; top: 0; z-index: 60;
  background: var(--critical-d);
  color: var(--critical);
  font-family: var(--fm);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  padding: 6px var(--s4);
  border-bottom: 1px solid rgba(209,67,67,.18);
}

/* ─── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 27px; z-index: 50;
  height: var(--top-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center;
  padding: 0 var(--s4);
  gap: var(--s3);
}
.topbar .back {
  width: var(--tap); height: var(--tap);
  border: none; background: transparent;
  font-size: 22px; color: var(--t1); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: -10px;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.topbar .brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  color: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-weight: 800; font-size: 16px;
  flex-shrink: 0;
}
.topbar .title {
  font-family: var(--fd); font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .crumb { font-size: 11px; color: var(--t3); font-family: var(--fm); }

/* ─── Sticky sub-header (context bar) ─────────────────────────────── */
.subhead {
  position: sticky; top: calc(27px + var(--top-h)); z-index: 40;
  background: var(--bg2);
  border-bottom: 1px solid var(--bdr);
  padding: 10px var(--s4);
  font-size: 12.5px; color: var(--t2);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden;
}
.subhead .label {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--t3);
}
.subhead .ctx {
  font-weight: 600; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis;
}

/* ─── Main / page-head ───────────────────────────────────────────── */
.main { padding: var(--s4); }
.page-head { margin-bottom: var(--s4); }
.tag-mono {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--teal);
  display: block;
}
.page-head h1 {
  font-family: var(--fd);
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.2; margin: 8px 0 6px;
}
.page-head .sub { font-size: 13px; color: var(--t2); line-height: 1.45; }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  margin-bottom: var(--s4);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--s4);
  border-bottom: 1px solid var(--bdr);
  gap: var(--s3);
}
.card-head h3 {
  margin: 0; font-family: var(--fd);
  font-size: 14px; font-weight: 700; letter-spacing: -0.005em;
}
.card-head .meta {
  font-family: var(--fm); font-size: 10.5px; color: var(--t3);
}
.card-body { padding: var(--s4); }
.card-body.flush { padding: 0; }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid var(--bdr);
  background: var(--bg2);
  border-radius: 100px;
  color: var(--t1);
  font-family: var(--fb); font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn:active { background: var(--row-h); transform: scale(.98); }
.btn.primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn.primary:active { background: #0c8a70; }
.btn.crit { background: var(--critical); color: white; border-color: var(--critical); }
.btn.lg { min-height: 50px; font-size: 15px; padding: 12px 22px; }
.btn.sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }

/* ─── Pills ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px; font-weight: 600;
  font-family: var(--fb);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill.ok       { background: var(--ok-d); color: var(--ok); }
.pill.warn     { background: var(--warn-d); color: var(--warn); }
.pill.crit     { background: var(--critical-d); color: var(--critical); }
.pill.info     { background: var(--info-d); color: var(--info); }
.pill.brand    { background: var(--teal-d); color: var(--teal); }
.pill.neutral  { background: var(--bg3); color: var(--t2); border-color: var(--bdr); }

/* ─── Helpers ────────────────────────────────────────────────────── */
.muted { color: var(--t3); }
.small { font-size: 12px; }
.mono  { font-family: var(--fm); }
.spacer { flex: 1; }
.id { font-family: var(--fm); font-size: 12px; font-weight: 600; color: var(--t2); }

/* ─── Avatar ────────────────────────────────────────────────────── */
.user-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.brand-mark {
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-weight: 800;
  flex-shrink: 0;
}

/* ─── List rows (replaces wide tables) ───────────────────────────── */
.list-rows { display: flex; flex-direction: column; }
.row-card {
  display: block;
  padding: 14px var(--s4);
  border-bottom: 1px solid var(--bdr);
  text-decoration: none; color: var(--t1);
  min-height: var(--tap);
  scroll-snap-align: start;
  transition: background .15s;
}
.row-card:active { background: var(--row-h); }
.row-card:last-child { border-bottom: none; }
.row-card .top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.row-card .name {
  font-weight: 600; font-size: 15px;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-card .kvs {
  display: grid; grid-template-columns: auto 1fr;
  gap: 3px 10px;
  font-size: 12.5px; color: var(--t2);
  margin-top: 4px;
}
.row-card .kvs .k {
  font-family: var(--fm); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--t3);
}
.row-card .kvs .v { font-weight: 500; color: var(--t1); }
.row-card .footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 11.5px; color: var(--t3);
}

/* Scroll-snap container for card lists */
.snap-list {
  scroll-snap-type: y proximity;
  overflow-y: auto;
}

/* ─── KV grid (for stacked label/value blocks) ───────────────────── */
.kv-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px var(--s3);
  font-size: 13.5px;
}
.kv-grid .k {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--t3);
  align-self: center;
}
.kv-grid .v { font-weight: 500; color: var(--t1); word-break: break-word; }

/* ─── Stat boxes (1x2 or 2x2 grid on mobile) ─────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.stat {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: var(--s4);
}
.stat-label {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--t3);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--fd); font-size: 26px; font-weight: 700;
  color: var(--t1); letter-spacing: -0.02em; line-height: 1;
}
.stat-value .unit { font-size: 14px; font-weight: 500; color: var(--t3); margin-left: 3px; }
.stat-meta { font-size: 11px; color: var(--t3); margin-top: 4px; }
.stat-delta.up    { color: var(--critical); }
.stat-delta.down  { color: var(--info); }
.stat-delta.flat  { color: var(--t3); }

/* ─── Filter chip strip (horizontal scroll) ──────────────────────── */
.chip-strip {
  display: flex; gap: 8px;
  padding: 10px var(--s4);
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg2);
  border-bottom: 1px solid var(--bdr);
  position: sticky; top: calc(27px + var(--top-h));
  z-index: 35;
}
.chip-strip::-webkit-scrollbar { display: none; }
.chip-strip .pill {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12.5px;
}

/* ─── Tube/sample visuals (accession) ────────────────────────────── */
.tube {
  display: inline-block;
  width: 28px; height: 56px;
  border-radius: 4px 4px 12px 12px;
  vertical-align: middle;
  position: relative;
  flex-shrink: 0;
}
.tube::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 8px; border-radius: 4px 4px 0 0;
}
.tube.purple { background: linear-gradient(180deg, #c4b5fd 0%, #7c3aed 100%); } .tube.purple::before { background: #7c3aed; }
.tube.red    { background: linear-gradient(180deg, #fca5a5 0%, #b91c1c 100%); } .tube.red::before    { background: #b91c1c; }
.tube.blue   { background: linear-gradient(180deg, #bfdbfe 0%, #1d4ed8 100%); } .tube.blue::before   { background: #1d4ed8; }
.tube.gold   { background: linear-gradient(180deg, #fde68a 0%, #b45309 100%); } .tube.gold::before   { background: #b45309; }

/* ─── Result row (mobile-stacked, replaces CBC table) ────────────── */
.result-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--rs);
  padding: 12px var(--s4);
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center; gap: 10px;
}
.result-card .name { font-weight: 600; font-size: 14px; }
.result-card .meta { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.result-card .v {
  font-family: var(--fm); font-weight: 700; font-size: 16px;
  text-align: right;
}
.result-card .v.high { color: var(--critical); }
.result-card .v.low  { color: var(--info); }
.flag-H, .flag-L {
  font-family: var(--fm); font-weight: 700; font-size: 11px;
  padding: 2px 6px; border-radius: 3px; margin-left: 6px;
}
.flag-H { background: var(--critical-d); color: var(--critical); }
.flag-L { background: var(--info-d); color: var(--info); }

/* ─── Critical alert card (vertical) ─────────────────────────────── */
.crit-card {
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: var(--s4);
  margin-bottom: var(--s3);
  border-left: 4px solid var(--critical);
}
.crit-card.ack { border-left-color: var(--warn); opacity: 0.85; }
.crit-banner {
  background: linear-gradient(90deg, var(--critical-d), transparent);
  border-left: 4px solid var(--critical);
  padding: var(--s4);
  border-radius: var(--rs);
  margin-bottom: var(--s4);
  display: flex; align-items: center; gap: var(--s3);
}
.crit-banner .num {
  font-family: var(--fd); font-size: 32px; font-weight: 800;
  color: var(--critical); line-height: 1;
}

/* Vertical timeline (mobile) */
.vtimeline { display: flex; flex-direction: column; margin-top: var(--s3); }
.vtimeline .step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0; position: relative;
}
.vtimeline .step::before {
  content: ''; position: absolute; left: 9px; top: 28px; bottom: -8px;
  width: 2px; background: var(--bdr);
}
.vtimeline .step:last-child::before { display: none; }
.vtimeline .dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg2); border: 2px solid var(--bdr);
  flex-shrink: 0; z-index: 1;
}
.vtimeline .step.done .dot { background: var(--ok); border-color: var(--ok); }
.vtimeline .step.now .dot {
  background: var(--critical); border-color: var(--critical);
  animation: pulse 1.4s infinite;
}
.vtimeline .step.now .lbl { color: var(--critical); font-weight: 600; }
.vtimeline .step.done .lbl { color: var(--ok); }
.vtimeline .lbl { font-size: 13px; padding-top: 1px; }
.vtimeline .lbl .t { font-family: var(--fm); font-size: 11px; color: var(--t3); display: block; margin-top: 2px; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(209,67,67,.18); }
  50%     { box-shadow: 0 0 0 8px transparent; }
}

/* ─── Bottom sheet modal ─────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 90;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-radius: 18px 18px 0 0;
  z-index: 100;
  transform: translateY(100%);
  transition: transform .25s ease-out;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 -6px 30px rgba(15,23,42,.18);
}
.sheet.open { transform: translateY(0); }
.sheet .grab {
  width: 40px; height: 4px; background: var(--t4);
  border-radius: 100px;
  margin: 10px auto 6px;
}
.sheet .body { padding: var(--s4) var(--s4) var(--s6); }
.sheet h3 { margin: 0 0 var(--s3); font-family: var(--fd); font-size: 18px; }

/* ─── Bottom nav ─────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bot-h);
  background: var(--bg2);
  border-top: 1px solid var(--bdr);
  display: flex;
  z-index: 70;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-family: var(--fb); font-size: 10.5px; font-weight: 500;
  color: var(--t3); text-decoration: none;
  min-height: var(--tap);
}
.bottom-nav a .ico {
  font-size: 22px; line-height: 1;
}
.bottom-nav a.active { color: var(--teal); }
.bottom-nav a.active .ico {
  background: var(--teal-d);
  border-radius: 8px;
  padding: 2px 8px;
}

/* ─── Sibling navigation (prev/next at screen bottom) ────────────── */
.siblings {
  display: flex; gap: 8px;
  margin-top: var(--s5); margin-bottom: var(--s4);
}
.siblings a {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 12px var(--s3);
  text-decoration: none;
  color: var(--t1);
  font-size: 13px;
  min-height: var(--tap);
  display: flex; align-items: center;
  gap: 6px;
}
.siblings a:active { background: var(--row-h); }
.siblings a.next { justify-content: flex-end; text-align: right; }
.siblings a .arrow { color: var(--teal); font-weight: 700; }
.siblings a .nano { font-family: var(--fm); font-size: 10px; color: var(--t3); display: block; }

/* ─── Patient strip (mobile compact) ─────────────────────────────── */
.patient-strip {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 12px var(--s4);
  margin-bottom: var(--s4);
  display: flex; align-items: center; gap: var(--s3);
}
.patient-strip .who { flex: 1; min-width: 0; }
.patient-strip .who .nm { font-weight: 600; font-size: 15px; }
.patient-strip .who .meta { font-size: 12px; color: var(--t3); margin-top: 2px; }

/* ─── Levey-Jennings SVG container (mobile) ──────────────────────── */
.lj-wrap {
  width: 100%; overflow-x: auto;
  scrollbar-width: thin;
}
.lj-wrap svg { min-width: 600px; height: 240px; display: block; }

/* ─── Bench/load bars ────────────────────────────────────────────── */
.bench-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--bdr);
}
.bench-row:last-child { border-bottom: none; }
.bench-row .top {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; margin-bottom: 6px;
}
.bench-row .top .name { font-weight: 500; color: var(--t1); }
.bench-row .top .pct { font-family: var(--fm); font-size: 12px; color: var(--t2); }
.bench-row .bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
}
.bench-row .bar > span {
  display: block; height: 100%; border-radius: 3px;
}

/* ─── TAT bars (compact mobile) ──────────────────────────────────── */
.tat-bars {
  display: flex; gap: 4px;
  height: 96px; align-items: flex-end;
  margin-bottom: 8px;
}
.tat-bars > div { flex: 1; border-radius: 4px 4px 0 0; min-width: 18px; }
.tat-labels {
  display: grid; grid-template-columns: repeat(8, 1fr);
  font-family: var(--fm); font-size: 9.5px; color: var(--t3);
  text-align: center;
}

/* ─── Compliance cards (NABL) ────────────────────────────────────── */
.compl-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: var(--s4);
  position: relative; overflow: hidden;
}
.compl-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.compl-card.ok::after   { background: var(--ok); }
.compl-card.warn::after { background: var(--warn); }
.compl-card.crit::after { background: var(--critical); }
.compl-pct {
  font-family: var(--fd); font-size: 28px; font-weight: 700;
  color: var(--t1); letter-spacing: -0.02em;
  margin-top: 4px;
}

/* ─── Audit event row ────────────────────────────────────────────── */
.event-row {
  display: flex; gap: 12px; padding: 12px var(--s4);
  border-bottom: 1px solid var(--bdr);
  align-items: flex-start;
}
.event-row:last-child { border-bottom: none; }
.event-time {
  font-family: var(--fm); font-size: 11px; color: var(--t3);
  flex-shrink: 0; width: 60px;
}
.event-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 600; font-size: 14px;
}
.event-icon.ok   { background: var(--ok-d); color: var(--ok); }
.event-icon.warn { background: var(--warn-d); color: var(--warn); }
.event-icon.info { background: var(--info-d); color: var(--info); }
.event-icon.crit { background: var(--critical-d); color: var(--critical); }
.event-row .body { flex: 1; min-width: 0; }
.event-row .body b { font-weight: 600; font-size: 13.5px; display: block; line-height: 1.3; }
.event-row .body .det { font-size: 12px; color: var(--t2); margin-top: 3px; line-height: 1.4; }
.event-row .hash { font-family: var(--fm); font-size: 10.5px; color: var(--t3); flex-shrink: 0; }

/* ─── Hub / index cards ──────────────────────────────────────────── */
.hub-section { margin-top: var(--s5); }
.hub-section .label {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--t3);
  margin-bottom: var(--s3);
  padding: 0 4px;
}
.hub-card {
  display: block;
  padding: 14px var(--s4);
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  margin-bottom: 10px;
  text-decoration: none; color: var(--t1);
  min-height: var(--tap);
  transition: all .15s;
}
.hub-card:active { background: var(--row-h); }
.hub-card .num {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--t3);
  margin-bottom: 4px;
}
.hub-card .ttl {
  font-family: var(--fd); font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.25;
  display: flex; justify-content: space-between; align-items: center;
}
.hub-card .ttl .arr { color: var(--teal); font-size: 18px; }
.hub-card .desc { font-size: 12.5px; color: var(--t2); margin-top: 4px; line-height: 1.45; }

/* ─── Fields (forms) ─────────────────────────────────────────────── */
.field { margin-bottom: var(--s3); }
.field label {
  display: block;
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--t3);
  margin-bottom: 6px;
}
.field textarea, .field input {
  width: 100%;
  border: 1px solid var(--bdr);
  border-radius: var(--rs);
  padding: 12px;
  font-family: var(--fb); font-size: 14px;
  background: var(--bg2);
  color: var(--t1);
  min-height: var(--tap);
  resize: vertical;
}
.field textarea { min-height: 90px; }

/* ─── Report (printable view) ────────────────────────────────────── */
.report-paper {
  background: white; border: 1px solid var(--bdr); border-radius: var(--r);
  padding: var(--s5); box-shadow: var(--sh2);
  font-family: var(--fb); font-size: 13px;
}
.report-paper h2 { font-family: var(--fd); font-size: 18px; font-weight: 700; margin: 14px 0 6px; }
.report-paper h3 {
  font-family: var(--fd); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--teal);
  margin: 18px 0 8px; padding-bottom: 6px;
  border-bottom: 1.5px solid var(--teal);
}
.rp-result {
  display: grid; grid-template-columns: 1fr auto;
  padding: 8px 0;
  border-bottom: 1px solid var(--bdr);
  font-size: 12.5px;
  gap: 4px 10px;
}
.rp-result:last-of-type { border-bottom: none; }
.rp-result .nm { font-weight: 500; }
.rp-result .v { font-family: var(--fm); font-weight: 700; text-align: right; }
.rp-result .ref { font-size: 11px; color: var(--t3); grid-column: 1 / -1; margin-top: 2px; }
.rp-flag-h { color: var(--critical); }
.rp-flag-l { color: var(--info); }
.qr {
  width: 56px; height: 56px;
  background: repeating-conic-gradient(#0F172A 0deg 90deg, white 90deg 180deg) 0 0 / 8px 8px;
  border-radius: 4px;
}

/* ─── Welcome (hub) ──────────────────────────────────────────────── */
.welcome {
  background: linear-gradient(135deg, var(--card) 0%, var(--teal-d) 100%);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: var(--s5);
  margin-bottom: var(--s4);
  position: relative; overflow: hidden;
}
.welcome::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--teal-g) 0%, transparent 70%);
  pointer-events: none;
}
.welcome h1 {
  font-family: var(--fd); font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  margin: 10px 0 8px;
}
.welcome h1 em { color: var(--teal); font-style: normal; }
.welcome p {
  font-size: 13.5px; color: var(--t2); line-height: 1.55;
  margin-bottom: var(--s3);
}
.welcome .meta {
  font-family: var(--fm); font-size: 11px; color: var(--t3);
  letter-spacing: 0.5px;
  display: flex; flex-wrap: wrap; gap: 4px var(--s3);
  padding-top: var(--s3); border-top: 1px solid var(--bdr);
  margin-top: var(--s3);
  position: relative; z-index: 1;
}

/* How-to */
.howto {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: var(--s4);
  margin-bottom: var(--s4);
}
.howto h3 {
  margin: 0 0 var(--s3); font-family: var(--fd);
  font-size: 16px; font-weight: 700;
}
.howto-step {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--bdr);
  align-items: flex-start;
}
.howto-step:last-child { border-bottom: none; }
.howto-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--teal); color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fd); font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.howto-body b {
  font-weight: 600; font-size: 13px; display: block;
  margin-bottom: 2px; color: var(--t1);
}
.howto-body span { font-size: 12.5px; color: var(--t2); line-height: 1.5; }

/* Section divider */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: var(--s5) 4px var(--s3);
}
.section-divider .line { flex: 1; height: 1px; background: var(--bdr); }
.section-divider h2 {
  margin: 0;
  font-family: var(--fd); font-size: 12px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--t3);
}

/* ─── Utilities ──────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.center { text-align: center; }

/* Range bar (mini) */
.range-bar {
  position: relative; height: 4px;
  background: var(--bg3); border-radius: 2px;
  flex: 1; min-width: 80px;
}
.range-bar .normal { position: absolute; height: 100%; background: var(--ok-d); border-radius: 2px; }
.range-bar .marker { position: absolute; width: 8px; height: 8px; border-radius: 50%; top: -2px; transform: translateX(-50%); }

/* ────────────────────────────────────────────────────────────────────────
   ICU MOBILE — shared patterns across 5 ICU screens
   (central-station, alert-rules, family-comms, audit-trail, index)
   Tokens use mobile.css :root (above). Inline blocks in each file keep
   only page-specific body padding + watermark override.
   ──────────────────────────────────────────────────────────────────────── */

/* ICU watermark variant — fixed black bar at top */
.watermark.icu-fixed {
  position: fixed; top: 0; left: 0; right: 0;
  background: #0F172A; color: #fff;
  font-family: var(--fm); font-size: 10px;
  text-align: center; padding: 5px 10px;
  letter-spacing: 0.5px; z-index: 200;
  border-bottom: none;
}

/* ICU subhead (single-line crumb + title, optional live indicator) */
.icu-subhead {
  position: sticky; top: 24px; z-index: 100;
  background: var(--bg2); border-bottom: 1px solid var(--bdr);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
}
.icu-subhead .crumb {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--t3); letter-spacing: 0.4px; text-transform: uppercase;
}
.icu-subhead .crumb a { color: var(--teal); text-decoration: none; }
.icu-subhead .ttl {
  font-family: var(--fd); font-weight: 700;
  font-size: 16px; line-height: 1.2; color: var(--t1);
}
.icu-subhead .live {
  margin-left: auto; font-family: var(--fm); font-size: 10.5px;
  color: var(--ok); display: flex; align-items: center; gap: 5px;
}
.icu-subhead .live::before {
  content: ''; width: 7px; height: 7px;
  background: var(--ok); border-radius: 50%;
  animation: icu-live-pulse 2s infinite;
}
@keyframes icu-live-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}

/* ICU page header (tag, h1, sub) */
.icu-page { padding: 14px 16px 20px; }
.icu-page-tag {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--teal); letter-spacing: 0.5px;
  text-transform: uppercase; font-weight: 600;
}
.icu-page-h1 {
  font-family: var(--fd); font-weight: 700;
  font-size: 22px; line-height: 1.2; margin: 8px 0 6px;
}
.icu-page-h1.compact { font-size: 20px; }
.icu-page-h1 em { color: var(--teal); font-style: italic; }
.icu-page-sub {
  font-size: 13px; color: var(--t2);
  line-height: 1.5; margin-bottom: 16px;
}
.icu-page-sub.compact { font-size: 12.5px; margin-bottom: 14px; }

/* ICU stat strip (2-col) */
.icu-stat-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 16px;
}
.icu-stat {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--rs); padding: 12px;
}
.icu-stat .lbl {
  font-family: var(--fm); font-size: 10px;
  color: var(--t3); letter-spacing: 0.4px;
  text-transform: uppercase; margin-bottom: 4px;
}
.icu-stat .v {
  font-family: var(--fd); font-weight: 700;
  font-size: 22px; line-height: 1.1; color: var(--t1);
}
.icu-stat .meta {
  font-size: 11px; color: var(--t2);
  margin-top: 3px; line-height: 1.4;
}
.icu-stat.crit .v { color: var(--critical); }
.icu-stat.warn .v { color: var(--warn); }

/* ICU section header (h3 + meta on right) */
.icu-section-h {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px;
}
.icu-section-h h3, .icu-section-h > span:first-child {
  font-family: var(--fd); font-weight: 700; font-size: 16px;
  margin: 0;
}
.icu-section-h .meta {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--t3); font-weight: 400;
}

/* ICU action row (button row) */
.icu-action-row {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.icu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--rs); padding: 10px 14px;
  font-family: var(--fb); font-size: 13px; font-weight: 600;
  color: var(--t1); text-decoration: none; cursor: pointer;
  min-height: 44px; flex: 1;
}
.icu-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.icu-btn.sm { padding: 8px 12px; font-size: 12px; min-height: 38px; flex: 0 0 auto; }

/* ICU pill — variant with thicker border */
.icu-pill {
  font-family: var(--fm); font-size: 10.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 100px;
  letter-spacing: 0.3px; white-space: nowrap;
}
.icu-pill.crit    { background: var(--critical-d); color: var(--critical); }
.icu-pill.warn    { background: var(--warn-d); color: var(--warn); }
.icu-pill.ok      { background: var(--ok-d); color: var(--ok); }
.icu-pill.brand   { background: var(--teal-d); color: var(--teal); }
.icu-pill.neutral { background: var(--bg3); color: var(--t2); }
.icu-pill.info    { background: rgba(37,99,235,.10); color: var(--info); }

/* ICU bed card (central-station) */
.icu-beds {
  display: flex; flex-direction: column; gap: 10px;
  scroll-snap-type: y mandatory;
}
.icu-bed {
  background: var(--card); border: 1px solid var(--bdr);
  border-left: 4px solid var(--bdr-h);
  border-radius: var(--r); padding: 14px 14px 12px;
  scroll-snap-align: start;
}
.icu-bed.critical { border-left-color: var(--critical); }
.icu-bed.watch    { border-left-color: var(--warn); }
.icu-bed.stable   { border-left-color: var(--ok); }
.icu-bed.empty,
.icu-bed.cleaning {
  background: var(--bg3); border-style: dashed;
  opacity: 0.65; text-align: center; padding: 18px;
}
.icu-bed-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.icu-bed-id {
  font-family: var(--fm); font-size: 11px; font-weight: 700;
  color: var(--t3); letter-spacing: 0.5px;
}
.icu-bed-name {
  font-weight: 600; font-size: 15px;
  line-height: 1.3; margin-bottom: 3px;
}
.icu-bed-diag {
  font-size: 12px; color: var(--t2);
  margin-bottom: 12px; line-height: 1.4;
}
.icu-bed-foot {
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid var(--bdr);
  display: flex; justify-content: space-between;
  align-items: center; font-size: 11.5px; color: var(--t2);
  gap: 8px; flex-wrap: wrap;
}
.icu-bed-foot a {
  color: var(--teal); font-weight: 600;
  text-decoration: none; min-height: 32px;
  display: flex; align-items: center;
}

/* ICU vital boxes (large readout — 32px display number) */
.icu-vitals {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 10px;
}
.icu-vitals2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 10px;
}
.icu-vital {
  background: var(--bg3); border-radius: var(--rs);
  padding: 8px 6px; text-align: center;
}
.icu-vital .lbl {
  font-family: var(--fm); font-size: 9.5px;
  color: var(--t3); letter-spacing: 0.3px;
  text-transform: uppercase;
}
.icu-vital .v {
  font-family: var(--fd); font-size: 32px; font-weight: 700;
  line-height: 1; color: var(--t1); margin-top: 3px;
}
.icu-vital .u { font-size: 9.5px; color: var(--t3); margin-top: 2px; }
.icu-vital.crit .v { color: var(--critical); }
.icu-vital.warn .v { color: var(--warn); }

/* ICU rule card (alert-rules) */
.icu-rule {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px;
}
.icu-rule.silenced { opacity: 0.85; }
.icu-rule-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.icu-rule-head b { flex: 1; min-width: 120px; font-size: 14px; }
.icu-severity-pill {
  padding: 3px 9px; border-radius: 100px;
  font-size: 10.5px; font-weight: 600;
  font-family: var(--fm); letter-spacing: 0.3px;
}
.icu-severity-pill.crit   { background: var(--critical-d); color: var(--critical); }
.icu-severity-pill.high   { background: var(--warn-d); color: var(--warn); }
.icu-severity-pill.paused { background: var(--bg3); color: var(--t3); }
.icu-toggle {
  width: 40px; height: 22px; background: var(--ok);
  border-radius: 100px; position: relative;
  cursor: pointer; flex-shrink: 0;
}
.icu-toggle::after {
  content: ''; position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; background: white;
  border-radius: 50%; box-shadow: var(--sh1);
}
.icu-toggle.off { background: var(--bdr-h); }
.icu-toggle.off::after { left: 2px; right: auto; }
.icu-rule-cond {
  font-family: var(--fm); background: var(--bg3);
  padding: 10px 12px; border-radius: var(--rs);
  font-size: 12px; line-height: 1.7; color: var(--t1);
  word-break: break-word;
}
.icu-rule-cond .kw    { color: var(--violet); font-weight: 600; }
.icu-rule-cond .op    { color: var(--critical); font-weight: 700; }
.icu-rule-cond .num   { color: var(--info); font-weight: 700; }
.icu-rule-cond .field { color: var(--teal); font-weight: 600; }
.icu-rule-foot {
  font-size: 11.5px; color: var(--t2);
  margin-top: 10px; line-height: 1.5;
}
.icu-rule-foot i { font-style: italic; color: var(--t1); }

/* ICU bundle template card */
.icu-bundle {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 12px 14px;
  margin-bottom: 8px; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.icu-bundle b { flex: 1; min-width: 120px; font-size: 13.5px; }
.icu-bundle .desc {
  flex-basis: 100%; font-size: 11.5px;
  color: var(--t2); margin-top: 4px; line-height: 1.4;
}

/* ICU patient strip (alert-rules) */
.icu-patient-strip {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 14px;
  margin-bottom: 16px; display: flex;
  gap: 12px; align-items: center;
}
.icu-patient-strip .name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.icu-patient-strip .meta {
  font-family: var(--fm); font-size: 11px;
  color: var(--t3); margin-top: 3px; line-height: 1.4;
}
.icu-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--teal-g); color: var(--teal);
  font-family: var(--fd); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icu-patient-meta-grid {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--rs); padding: 12px;
  margin-bottom: 18px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px;
}
.icu-patient-meta-grid .lbl {
  font-family: var(--fm); font-size: 10px;
  color: var(--t3); letter-spacing: 0.3px;
  text-transform: uppercase;
}
.icu-patient-meta-grid .v { font-weight: 600; color: var(--t1); margin-top: 2px; }
.icu-patient-meta-grid .v.crit { color: var(--critical); }

/* ICU comms timeline (family-comms) */
.icu-timeline { display: flex; flex-direction: column; gap: 10px; }
.icu-tl-msg {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 12px 14px;
}
.icu-tl-msg.code-blue {
  background: var(--critical-d);
  border-color: rgba(209,67,67,.3);
}
.icu-tl-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 8px; font-size: 11px;
}
.icu-tl-time { font-family: var(--fm); font-size: 11px; color: var(--t3); font-weight: 500; }
.icu-tl-to   { color: var(--t2); font-family: var(--fm); font-size: 10.5px; margin-bottom: 8px; }
.icu-tl-status { margin-left: auto; }
.icu-tl-body { font-size: 13.5px; line-height: 1.6; color: var(--t1); }
.icu-tl-foot {
  font-size: 11px; color: var(--t2);
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(209,67,67,.2); line-height: 1.4;
}
.icu-tl-foot b { color: var(--t1); }

/* ICU consent + compliance (family-comms) */
.icu-consent-bar {
  background: var(--ok-d); border: 1px solid rgba(5,150,105,.3);
  border-radius: var(--r); padding: 12px 14px;
  margin-bottom: 16px; font-size: 12.5px; line-height: 1.5;
}
.icu-consent-bar .row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.icu-consent-bar .row b { font-size: 13px; }
.icu-consent-bar .audit {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--t3); margin-top: 6px;
}
.icu-compliance {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); overflow: hidden; margin-top: 18px;
}
.icu-compliance .head {
  padding: 12px 14px; border-bottom: 1px solid var(--bdr);
  font-family: var(--fd); font-weight: 700; font-size: 14px;
}
.icu-compliance table { width: 100%; border-collapse: collapse; font-size: 13px; }
.icu-compliance td { padding: 10px 14px; border-bottom: 1px solid var(--bdr); }
.icu-compliance tr:last-child td { border-bottom: none; }
.icu-compliance td:last-child { text-align: right; font-family: var(--fm); font-weight: 700; }

/* ICU code-blue banner (audit-trail) */
.icu-code-blue-banner {
  background: linear-gradient(135deg, var(--critical-d), transparent);
  border-left: 4px solid var(--critical);
  padding: 14px; border-radius: var(--r);
  margin-bottom: 16px; display: flex;
  flex-direction: column; gap: 10px;
}
.icu-cb-row { display: flex; gap: 14px; align-items: center; }
.icu-cb-time {
  font-family: var(--fd); font-size: 38px; font-weight: 800;
  color: var(--critical); line-height: 1; flex-shrink: 0;
}
.icu-cb-content { flex: 1; }
.icu-cb-title { font-weight: 600; font-size: 14px; color: var(--critical); line-height: 1.3; }
.icu-cb-meta { font-size: 11.5px; color: var(--t2); margin-top: 4px; line-height: 1.4; }
.icu-cb-meta b { color: var(--t1); }

/* ICU filter strip (horizontal scroll pills) */
.icu-filter-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px 14px;
  margin: 0 -16px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.icu-filter-strip::-webkit-scrollbar { display: none; }
.icu-filter-strip .icu-pill {
  font-size: 11px; padding: 6px 12px;
  flex-shrink: 0; border: 1px solid var(--bdr);
  background: var(--card); color: var(--t2);
}
.icu-filter-strip .icu-pill.crit    { background: var(--critical-d); color: var(--critical); border-color: rgba(209,67,67,.2); }
.icu-filter-strip .icu-pill.warn    { background: var(--warn-d); color: var(--warn); border-color: rgba(217,119,6,.2); }
.icu-filter-strip .icu-pill.ok      { background: var(--ok-d); color: var(--ok); border-color: rgba(5,150,105,.2); }
.icu-filter-strip .icu-pill.brand   { background: var(--teal-d); color: var(--teal); border-color: rgba(15,168,136,.2); }
.icu-filter-strip .icu-pill.info    { background: rgba(37,99,235,.10); color: var(--info); border-color: rgba(37,99,235,.2); }
.icu-filter-strip .icu-pill.neutral { background: var(--bg3); color: var(--t2); }
.icu-pill.sm { padding: 3px 9px; font-size: 10.5px; }

/* ICU event row (audit-trail) */
.icu-events { display: flex; flex-direction: column; gap: 8px; }
.icu-event {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 12px 14px;
}
.icu-event.crit { background: var(--critical-d); border-color: rgba(209,67,67,.2); }
.icu-event.warn { background: var(--warn-d); border-color: rgba(217,119,6,.2); }
.icu-event-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.icu-event-time {
  font-family: var(--fm); font-size: 11.5px;
  color: var(--t3); font-weight: 500;
}
.icu-event.crit .icu-event-time { color: var(--critical); font-weight: 600; }
.icu-event.warn .icu-event-time { color: var(--warn); font-weight: 600; }
.icu-event-title {
  font-weight: 600; font-size: 13.5px; margin-top: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.icu-event.crit .icu-event-title { color: var(--critical); }
.icu-event.warn .icu-event-title { color: var(--warn); }
.icu-event-meta {
  font-size: 12px; color: var(--t2);
  margin-top: 5px; line-height: 1.5;
}
.icu-event-meta i { font-style: italic; color: var(--t1); }
.icu-event-meta b { color: var(--t1); }
.icu-sig {
  font-family: var(--fm); font-size: 10px; color: var(--t3);
  padding: 3px 6px; background: var(--bg3);
  border-radius: 4px; margin-left: auto;
}

/* ICU signature card (audit-trail) */
.icu-sig-card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 14px; margin-top: 18px;
}
.icu-sig-card h3 { font-family: var(--fd); font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.icu-sig-card .meta { font-family: var(--fm); font-size: 10.5px; color: var(--t3); margin-bottom: 14px; }
.icu-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.icu-sig-stat .lbl {
  font-family: var(--fm); font-size: 10px;
  color: var(--t3); letter-spacing: 0.3px; text-transform: uppercase;
}
.icu-sig-stat .v {
  font-family: var(--fd); font-size: 22px;
  font-weight: 700; line-height: 1.1; margin-top: 3px;
}
.icu-sig-stat.ok .v { color: var(--ok); }
.icu-merkle { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bdr); }
.icu-merkle .lbl {
  font-family: var(--fm); font-size: 10px;
  color: var(--t3); letter-spacing: 0.3px;
  text-transform: uppercase; margin-bottom: 5px;
}
.icu-merkle .v {
  font-family: var(--fm); font-size: 11.5px;
  color: var(--t1); word-break: break-all;
}

/* ICU swipe nav (prev/next floating) */
.icu-swipe-nav {
  position: fixed; bottom: 60px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: 0 16px; pointer-events: none; z-index: 90;
}
.icu-swipe-nav a {
  pointer-events: auto;
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: 100px; padding: 8px 14px;
  font-family: var(--fm); font-size: 11.5px;
  color: var(--teal); font-weight: 600; text-decoration: none;
  box-shadow: var(--sh2); min-height: 40px;
  display: flex; align-items: center; gap: 5px;
}

/* ICU bottom-nav (4-tab grid; differs from base .bottom-nav layout) */
.icu-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-top: 1px solid var(--bdr);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 95;
}
.icu-bottom-nav a {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; text-decoration: none; color: var(--t2);
  font-size: 10.5px; font-family: var(--fm);
  min-height: 48px; justify-content: center; padding: 4px;
}
.icu-bottom-nav a.active { color: var(--teal); }
.icu-bottom-nav .dot { font-size: 18px; line-height: 1; }

/* ICU compose FAB (family-comms) */
.icu-compose-fab {
  position: fixed; bottom: 120px; right: 16px;
  background: var(--teal); color: #fff; border: none;
  border-radius: 100px; padding: 14px 22px;
  font-family: var(--fb); font-weight: 600; font-size: 14px;
  box-shadow: var(--sh2); min-height: 48px; z-index: 91;
  text-decoration: none;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.icu-fab {
  position: fixed; bottom: 120px; right: 16px;
  background: var(--teal); color: #fff; border: none;
  border-radius: 100px; padding: 12px 20px;
  font-family: var(--fb); font-weight: 600; font-size: 14px;
  box-shadow: var(--sh2); min-height: 48px; z-index: 91;
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
}

/* ICU bottom-sheet (family-comms compose) */
.icu-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 300; display: none;
  animation: icu-fade .15s ease-out;
}
.icu-sheet-backdrop.open { display: block; }
.icu-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg2);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12);
  z-index: 301; max-height: 85vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.icu-sheet.open { transform: translateY(0); }
.icu-sheet-handle {
  width: 36px; height: 4px;
  background: var(--bdr-h); border-radius: 100px;
  margin: 10px auto 6px;
}
.icu-sheet-head {
  padding: 8px 16px 14px; border-bottom: 1px solid var(--bdr);
  display: flex; align-items: center; justify-content: space-between;
}
.icu-sheet-head h3 { font-family: var(--fd); font-weight: 700; font-size: 16px; margin: 0; }
.icu-sheet-head .meta { font-family: var(--fm); font-size: 10.5px; color: var(--t3); }
.icu-sheet-body { padding: 14px 16px; }
.icu-tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.icu-tpl {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--rs); padding: 10px 12px;
  cursor: pointer; min-height: 60px;
}
.icu-tpl.active { border-color: var(--teal); background: var(--teal-d); }
.icu-tpl .nm { font-weight: 600; font-size: 12.5px; }
.icu-tpl .desc { font-size: 10.5px; color: var(--t2); margin-top: 3px; line-height: 1.3; }
.icu-preview {
  background: var(--bg3); border: 1px solid var(--bdr);
  border-radius: var(--rs); padding: 12px;
  font-family: var(--fm); font-size: 12px; line-height: 1.6; color: var(--t1);
}
.icu-hint { font-size: 11px; color: var(--t3); margin-top: 6px; }
.icu-sheet-foot {
  padding: 12px 16px; border-top: 1px solid var(--bdr);
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; background: var(--bg2);
  position: sticky; bottom: 0;
}
.icu-sheet-foot .name { font-size: 11.5px; color: var(--t2); }
@keyframes icu-fade { from { opacity: 0; } to { opacity: 1; } }

/* ICU index-page tags + cards */
.icu-tag {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--teal); letter-spacing: 0.5px;
  text-transform: uppercase; font-weight: 600;
  margin-top: 14px; display: inline-block;
}
.icu-h1 {
  font-family: var(--fd); font-weight: 700;
  font-size: 26px; line-height: 1.2; margin: 8px 0 8px;
}
.icu-h1 em { color: var(--teal); font-style: italic; }
.icu-sub { font-size: 14px; color: var(--t2); line-height: 1.5; margin-bottom: 20px; }
.icu-stat-strip {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 24px;
}
.icu-cards { display: flex; flex-direction: column; gap: 12px; }
.icu-card-link { display: block; text-decoration: none; color: inherit; }
.icu-card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 18px;
  border-left: 4px solid var(--teal);
  box-shadow: var(--sh1);
  transition: transform .15s, box-shadow .15s;
}
.icu-card:active { transform: scale(0.98); }
.icu-card.alert  { border-left-color: var(--critical); }
.icu-card.audit  { border-left-color: var(--violet); }
.icu-card.family { border-left-color: var(--cyan); }
.icu-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.icu-card-icon {
  width: 42px; height: 42px; border-radius: var(--rs);
  background: var(--teal-d); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.icu-card.alert  .icu-card-icon { background: var(--critical-d); color: var(--critical); }
.icu-card.audit  .icu-card-icon { background: rgba(124,58,237,.10); color: var(--violet); }
.icu-card.family .icu-card-icon { background: rgba(8,145,178,.10); color: var(--cyan); }
.icu-card-title {
  font-family: var(--fd); font-weight: 700; font-size: 17px;
  line-height: 1.2; flex: 1;
}
.icu-card-arrow { color: var(--t3); font-size: 18px; }
.icu-card-desc {
  font-size: 13px; color: var(--t2);
  line-height: 1.5; margin-top: 6px;
}
.icu-card-meta {
  font-family: var(--fm); font-size: 11px;
  color: var(--t3); margin-top: 10px; letter-spacing: 0.3px;
}
.icu-section-h-h2 {
  font-family: var(--fd); font-size: 16px; font-weight: 700;
  margin: 24px 0 10px;
}
.icu-parent-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: 12px;
  color: var(--teal); text-decoration: none; font-weight: 600;
  margin-top: 18px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: 100px; min-height: 40px;
}

/* ICU index page crumb (different from subhead crumb) */
.icu-crumb {
  font-family: var(--fm); font-size: 10.5px;
  color: var(--t3); letter-spacing: 0.5px; text-transform: uppercase;
}
.icu-crumb a { color: var(--teal); text-decoration: none; }

/* ICU forms (used inside compose sheet) */
.icu-field { margin-bottom: 14px; }
.icu-field label {
  display: block;
  font-family: var(--fm); font-size: 10.5px;
  color: var(--t3); letter-spacing: 0.4px;
  text-transform: uppercase; margin-bottom: 6px; font-weight: 600;
}
.icu-field select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--bdr); border-radius: var(--rs);
  font-family: var(--fb); font-size: 13px;
  background: var(--bg2); min-height: 44px; color: var(--t1);
}

/* ───────────────────────────────────────────────────────────────────────
   PHONE-FRAME PRESENTATION (desktop viewports only)
   Copies Artha-praan's pattern EXACTLY: page itself does not scroll;
   .dh-phone is a fixed-size device frame with real border + radius.
   Bottom nav, topbar, watermark, chip-strip become natural flex children
   (flex-shrink:0 at top/bottom). The .main section gets flex:1 +
   overflow-y:auto so it is the ONLY scrollable region.
   ─────────────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  html, body { height: 100%; overflow: hidden; }
  html {
    background: linear-gradient(180deg, #1a1d24 0%, #0e1015 100%);
    padding-top: 34px;  /* clearance for back-bar */
  }
  body {
    background: transparent;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Device frame: fixed dimensions, real black bezel, no inner scroll
     (children scroll instead via flex:1 on .main). transform creates a
     containing block so any straggling position:fixed FAB anchors here. */
  body > .dh-phone {
    width: 390px;
    height: 820px;
    max-height: calc(100vh - 60px);
    min-height: 560px;
    flex-shrink: 0;
    background: var(--bg);
    border: 10px solid #000;
    border-radius: 46px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translate(0, 0);
    box-shadow:
      0 30px 80px rgba(0,0,0,.6),
      0 0 0 1px rgba(255,255,255,.06),
      inset 0 0 0 1px rgba(255,255,255,.04);
  }
  /* Notch: positioned absolute INSIDE the device frame, top edge */
  body > .dh-phone::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 24px;
    background: #000;
    border-radius: 14px;
    z-index: 100;
    pointer-events: none;
  }

  /* Top-of-phone elements: stick at top via natural flex order, no scroll */
  body > .dh-phone > .watermark,
  body > .dh-phone > .topbar,
  body > .dh-phone > .chip-strip,
  body > .dh-phone > .page-head {
    flex-shrink: 0;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
  }
  /* Push first content element down to clear notch */
  body > .dh-phone > :first-child:not(.bottom-nav) {
    margin-top: 32px;
  }

  /* Main scrolls. Flex:1 takes the remaining space between top and nav. */
  body > .dh-phone > .main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  body > .dh-phone > .main::-webkit-scrollbar { width: 3px; }
  body > .dh-phone > .main::-webkit-scrollbar-track { background: transparent; }
  body > .dh-phone > .main::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 2px; }

  /* Bottom nav: last flex child, locked at bottom of phone via flex order */
  body > .dh-phone > .bottom-nav {
    flex-shrink: 0;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto;
    z-index: 10;
  }
}
