/* VAMED+WWH HMS.
   ==========================================================================
   Colours and type from the brand guideline (8020_0401_BG): WWH Blue
   #181842, VAMED Blue #2A9BD4, Fusion Blue #445689, Deep Orange #F4511E.
   Roboto is the brand typeface; the guideline names Arial as the approved
   alternative, which is what a site without the font installed will use. No
   web font is loaded from the internet: a site may be offline for months.

   The rules this file follows, because a screen in a hospital is read
   standing up, between two rooms, by somebody who is tired:

   One spacing scale, used everywhere. Nothing is "about 0.9rem".
   One accent for "this needs you". Orange means attention and nothing else.
   Rows tall enough to hit and quiet enough to scan.
   Every action visible. Nothing important hides until the mouse finds it.
   Empty means empty, and says what would fill it.
   ========================================================================== */

:root {
  /* Brand */
  --wwh-blue: #181842;
  --vamed-blue: #2A9BD4;
  --fusion-blue: #445689;
  --deep-orange: #F4511E;
  --seg-ships: #AEC3E5;
  --seg-military: #3B4B21;
  --seg-land: #181842;

  /* Surfaces and text */
  --canvas: #F5F6F8;
  --bg: #FFFFFF;
  --sunken: #F3F4F7;
  --rule: #E7E9EF;
  --rule-strong: #D2D6E0;
  --ink: #14161F;
  --muted: #6A7083;
  --side: #14143A;

  /* Meaning */
  --attention: #D9430E;
  --attention-bg: #FEF1EB;
  --attention-rule: #F6CFC0;
  --ok: #17794A;
  --ok-bg: #EAF6EF;
  --ok-rule: #C3E3D1;
  --info-bg: #EDF6FC;
  --info-rule: #C9E4F4;

  /* Spacing scale. Every gap in this file is one of these. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 14px 36px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.06);

  color-scheme: light;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--vamed-blue); outline-offset: 2px; }

/* ========================================================== type ======== */
.section-label,
.tasks .task span,
.topbar .inline > span,
.field > span,
.trend b,
.bignum span,
.census span,
.chartsec h4,
.ward h4,
.side .lbl,
.board .lbl {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

.sub, .meta, .m, .fhint { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.hint {
  font-size: 13px; line-height: 1.5; color: var(--muted);
  margin: 0 0 var(--s3); max-width: 70ch;
}

/* ======================================================= top bar ======== */
.topbar {
  display: flex; align-items: center; gap: var(--s5);
  background: var(--bg); border-bottom: 1px solid var(--rule);
  padding: var(--s3) var(--s5);
  position: sticky; top: 0; z-index: 20;
}
.logo { height: 32px; width: auto; display: block; }
.topbar-title strong {
  font-weight: 700; font-size: 14px; letter-spacing: 0.01em; color: var(--wwh-blue);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.topbar .inline { display: flex; align-items: center; gap: var(--s2); }
.topbar select { width: auto; min-width: 10rem; }

.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius);
  background: var(--sunken); color: var(--muted); border: 1px solid var(--rule);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-rule); }
.badge.bad { background: var(--attention-bg); color: var(--attention); border-color: var(--attention-rule); }

/* ==================================================== workspaces ======== */
.workspaces {
  display: flex; gap: var(--s1); background: var(--bg);
  border-bottom: 1px solid var(--rule); padding: 0 var(--s5);
  flex-wrap: wrap; position: sticky; top: 57px; z-index: 19;
}
.workspaces .ws {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: var(--s3); cursor: pointer; white-space: nowrap; min-height: 0;
}
.workspaces .ws:hover { background: none; color: var(--wwh-blue); }
.workspaces .ws[aria-selected="true"] { color: var(--wwh-blue); border-bottom-color: var(--vamed-blue); }

/* ========================================================= stage ======== */
#stage { display: block; padding: var(--s5); max-width: 1360px; margin: 0 auto; }
#stage.record { max-width: 1000px; }

.stagehead { margin-bottom: var(--s4); }
.stagehead h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--wwh-blue); margin: 0 0 var(--s1);
}
.stagehead .hint { margin: 0; }

.twocol {
  display: grid; grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  gap: var(--s4); align-items: start;
}
@media (max-width: 1080px) { .twocol { grid-template-columns: minmax(0, 1fr); } }

/* ==================================================== task strip ======== */
/* What is waiting, in numbers. The first thing on every screen. */
.tasks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--s3); margin-bottom: var(--s5);
}
.tasks .task {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s3) var(--s4);
}
.tasks .task b {
  display: block; font-size: 26px; line-height: 1.15; font-weight: 700;
  color: var(--wwh-blue); font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.tasks .task span { display: block; margin-top: 2px; }
.tasks .task.urgent { border-color: var(--attention-rule); background: var(--attention-bg); }
.tasks .task.urgent b, .tasks .task.urgent span { color: var(--attention); }
.tasks .task.clickable { cursor: pointer; }
.tasks .task.clickable:hover { border-color: var(--vamed-blue); }

/* ====================================================== sections ======== */
.section-label {
  display: flex; align-items: center; gap: var(--s2);
  margin: var(--s5) 0 var(--s2); padding: 0; border: 0;
}
.section-label > span:first-child { color: var(--wwh-blue); }
.section-label .count {
  font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0;
  background: var(--sunken); border: 1px solid var(--rule);
  border-radius: 999px; padding: 1px 7px;
}
.section-label .right { margin-left: auto; display: flex; gap: var(--s2); }

.card {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s4); margin-bottom: var(--s4);
}
.card h2 {
  margin: 0 0 var(--s1); font-size: 15px; font-weight: 700;
  letter-spacing: 0; text-transform: none; color: var(--wwh-blue);
}

/* ========================================================= lists ======== */
.list {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: visible; margin: 0 0 var(--s4); display: block;
}
.list:empty { display: none; }

.item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); min-height: 52px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--sunken); }
/* A row that needs reading rather than scanning past. */
.item.flagged { border-left: 3px solid var(--attention); }
/* A row standing on its own still needs a frame. */
.rpane > .item, #stage > .item {
  border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: -1px;
}

.item .who { flex: 1 1 14rem; min-width: 0; }
.item .who b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.item .sub { display: block; }
.item .mrn {
  font-size: 12.5px; font-weight: 700; color: var(--fusion-blue);
  font-variant-numeric: tabular-nums; min-width: 5.5rem;
}
.item.clickable { cursor: pointer; }
.item.struck > .who > b { text-decoration: line-through; color: var(--muted); }
.item.overdue { box-shadow: inset 3px 0 0 var(--deep-orange); }
.item.called { background: var(--info-bg); }

.item .bedname {
  font-weight: 700; font-size: 12.5px; color: var(--fusion-blue);
  min-width: 4rem; letter-spacing: 0.02em;
}
.item .at {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px;
  color: var(--wwh-blue); min-width: 3rem;
}
.item .qn {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px;
  color: var(--wwh-blue); min-width: 2rem;
}
.item .vitrow {
  display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 2px;
}
.item .vitrow .bad { color: var(--attention); font-weight: 700; }
.item .tags { display: flex; gap: var(--s1); flex-wrap: wrap; }

/* Row actions: the first is a button, the rest sit behind a menu that is
   also always visible. Nothing a person needs waits for a hover. */
.rowacts { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.rowmenu { position: relative; }
.rowmenu > button { min-width: 34px; padding-left: 8px; padding-right: 8px; }
.rowmenu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--bg); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(24, 24, 66, 0.14);
  min-width: 14rem; padding: var(--s1); display: flex; flex-direction: column;
}
.rowmenu-list button {
  background: none; border: 0; text-align: left; font-family: inherit;
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  padding: var(--s2) var(--s3); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; min-height: 34px;
}
.rowmenu-list button:hover { background: var(--sunken); }
.rowmenu-list button.danger { color: var(--attention); border: 0; }
.rowmenu-list button:disabled { color: var(--muted); cursor: default; }
.rowmenu-list button:disabled:hover { background: none; }

/* ======================================================= buttons ======== */
button {
  font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--bg); color: var(--ink);
  padding: 7px 14px; min-height: 36px; cursor: pointer;
  transition: background .08s, border-color .08s;
}
button:hover { background: var(--sunken); }
button.primary { background: var(--wwh-blue); border-color: var(--wwh-blue); color: #fff; }
button.primary:hover { background: #24245C; }
button.ghost { background: none; border-color: var(--rule); color: var(--fusion-blue); }
button.ghost:hover { background: var(--sunken); }
button.danger { background: var(--bg); border-color: #E8B6A4; color: var(--attention); }
button.danger:hover { background: var(--attention-bg); }
button.small { font-size: 13px; padding: 5px 10px; min-height: 30px; }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { background: var(--bg); }

.actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.actionbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.findbar { display: flex; gap: var(--s2); margin-left: auto; }
.findbar input { min-width: 20rem; }

/* ========================================================= forms ======== */
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: var(--s1); flex: 1 1 11rem; min-width: 0; }
.field.narrow { flex: 0 0 6rem; }
.field.wide { flex: 1 1 100%; }

input, select, textarea {
  font-family: inherit; font-size: 14.5px; padding: 8px 10px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); min-height: 36px; width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--fusion-blue); }
.check { display: flex; align-items: center; gap: var(--s2); font-size: 14px; margin: var(--s3) 0; }
.check input { width: auto; min-height: 0; }
.fhint { margin-top: 2px; letter-spacing: 0; text-transform: none; font-weight: 400; }
form.prescribe { margin-top: var(--s2); }

/* ======================================================= dialogs ======== */
dialog {
  border: 1px solid var(--rule-strong); border-radius: 6px;
  box-shadow: 0 12px 40px rgba(24, 24, 66, 0.22);
  padding: var(--s5); max-width: 36rem; width: calc(100vw - var(--s6)); color: var(--ink);
}
dialog::backdrop { background: rgba(24, 24, 66, 0.4); }
dialog h3 { margin: 0 0 var(--s2); font-size: 18px; font-weight: 700; color: var(--wwh-blue); }
dialog .hint { margin-bottom: var(--s4); }
dialog .actions { margin-top: var(--s5); justify-content: flex-end; }
dialog .list { margin-bottom: 0; }

.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); }
.formgrid .field.wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .formgrid { grid-template-columns: 1fr; } }

/* ========================================================= empty ======== */
/* An empty list says what would fill it. "No data" teaches nobody. */
.empty {
  background: var(--bg); border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  color: var(--muted); font-size: 13.5px; padding: var(--s4); margin-bottom: var(--s4);
}

/* ========================================================== tags ======== */
.tag, .pill, .urg, .allergy-chip, .nka-chip, .flagchip {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.tag { background: var(--sunken); color: var(--muted); border-color: var(--rule); }
.tag.site { background: var(--info-bg); color: #0F5E86; border-color: var(--info-rule); }
.tag.warn, .pill.warn { background: var(--attention-bg); color: var(--attention); border-color: var(--attention-rule); }
.tag.merged { background: #EFEFF4; color: var(--fusion-blue); border-color: var(--rule); }
.pill.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-rule); }

.urg { text-transform: uppercase; background: var(--sunken); color: var(--muted); border-color: var(--rule); }
.urg.urgent { background: #FFF4E5; color: #9A5B00; border-color: #F3D9AE; }
.urg.emergency { background: var(--deep-orange); color: #fff; border-color: var(--deep-orange); }

.allergy-chip { background: var(--deep-orange); color: #fff; border-color: var(--deep-orange); margin-left: var(--s2); }
.allergy-chip.mild { background: #FFF4E5; color: #9A5B00; border-color: #F3D9AE; }
.nka-chip { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-rule); }

.flagchip {
  min-width: 2rem; text-align: center; border-radius: var(--radius);
  background: var(--sunken); color: var(--fusion-blue); border-color: var(--rule);
  font-variant-numeric: tabular-nums;
}
.flagchip.crit { background: var(--deep-orange); color: #fff; border-color: var(--deep-orange); }

.wait { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--muted); }
.wait.long { color: var(--attention); }

/* ======================================================== banner ======== */
.banner {
  background: var(--bg); border: 1px solid var(--rule); border-left: 4px solid var(--vamed-blue);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--s4); margin-bottom: var(--s3);
}
.banner.alert { border-left-color: var(--deep-orange); }
.banner .who { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.banner .who .mrn { font-size: 13px; font-weight: 700; color: var(--fusion-blue); font-variant-numeric: tabular-nums; }
.banner .who b { font-size: 19px; font-weight: 700; color: var(--wwh-blue); }
.banner .allerg { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.banner .age { margin-top: var(--s2); font-size: 12.5px; color: var(--muted); }

.bannerbar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--rule); border-left: 4px solid var(--vamed-blue);
  border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s3);
}
.bannerbar b { font-size: 16px; font-weight: 700; color: var(--wwh-blue); }
.bannerbar .sub { flex: 1 1 auto; }

/* ======================================================== record ======== */
.recordbar { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.recordbar .right { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }

.rtabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--rule); margin: var(--s4) 0 0; overflow-x: auto; }
.rtabs button {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: var(--s3) var(--s4); min-height: 0;
}
.rtabs button:hover { background: none; color: var(--wwh-blue); }
.rtabs button[aria-selected="true"] { color: var(--wwh-blue); border-bottom-color: var(--vamed-blue); }
.rpane { padding: var(--s4) 0 0; }
.rpane .section-label:first-child { margin-top: 0; }

.chartsec { margin-top: var(--s5); }
.chartsec h4 { margin: 0 0 var(--s2); color: var(--wwh-blue); }
.chartsec .entry {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin-bottom: -1px;
}
.chartsec .entry .t { font-weight: 600; }
.chartsec .entry.struck .t { text-decoration: line-through; color: var(--muted); }
.entryhead { display: flex; gap: var(--s3); align-items: center; }
.entryhead .t { flex: 1 1 auto; }
.prescribebox {
  background: var(--sunken); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s4); margin-top: var(--s5);
}
.prescribebox h4 { margin-bottom: var(--s1); }

.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }
.trend { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s3); }
.trend .tvals {
  display: flex; gap: var(--s2); font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--wwh-blue); font-size: 14px; margin: 2px 0;
}
.trend .tvals .bad { color: var(--attention); }
.trend .sub { font-size: 12px; }

/* ========================================================== beds ======== */
.ward { margin-bottom: var(--s4); }
.ward h4 { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s2); color: var(--wwh-blue); }
.ward h4 em { font-style: normal; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }
.bedgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--s2); }
.bed {
  text-align: left; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--bg); padding: var(--s2) var(--s3); min-height: 64px;
  display: flex; flex-direction: column; gap: 1px; font-weight: 400; box-shadow: var(--shadow);
}
.bed .bn { font-size: 12px; font-weight: 700; color: var(--fusion-blue); letter-spacing: 0.02em; }
.bed .bp { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.bed .bs { font-size: 11.5px; color: var(--muted); }
.bed.free { border-left: 3px solid var(--ok); }
.bed.occupied { border-left: 3px solid var(--fusion-blue); background: var(--sunken); }
.bed.cleaning { border-left: 3px solid #D9A400; }
.bed.blocked, .bed.isolation { border-left: 3px solid var(--deep-orange); }
.bed.reserved { border-left: 3px solid var(--vamed-blue); }
.bed.icu { background: var(--info-bg); }

.item.waiting { cursor: grab; }
.item.waiting:active { cursor: grabbing; }
.item.waiting .grip { color: var(--rule-strong); font-size: 15px; }
.item.waiting.dragging { opacity: 0.4; }
.placing .bed.free { outline: 2px dashed var(--vamed-blue); outline-offset: -2px; }
.bed.over { outline: 2px solid var(--vamed-blue); outline-offset: -2px; background: var(--info-bg); }
.bed.nodrop { outline: 2px solid var(--deep-orange); outline-offset: -2px; cursor: not-allowed; }

/* ======================================================== clinic ======== */
.clinicbar { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.clinicbar .on { background: var(--wwh-blue); border-color: var(--wwh-blue); color: #fff; }
.clinicname { font-size: 13.5px; font-weight: 600; color: var(--wwh-blue); margin: var(--s3) 0 var(--s1); }

.board { background: var(--wwh-blue); color: #fff; border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); }
.board .lbl { color: var(--seg-ships); }
.board .nums { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s2); }
.board .num { background: #fff; border-radius: var(--radius); padding: var(--s2) var(--s4); text-align: center; }
.board .num b { display: block; font-size: 28px; font-weight: 700; color: var(--wwh-blue); }
.board .num span { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.board .hint { color: var(--seg-ships); margin: 0; }

.roundrow {
  display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin-bottom: -1px; font-weight: 400; min-height: 56px;
}
.roundrow:hover { background: var(--sunken); }
.roundrow .nm { font-weight: 600; font-size: 14.5px; }
.roundrow .vit { display: flex; gap: var(--s3); flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.roundrow .vit .bad { color: var(--attention); font-weight: 700; }

/* ======================================================== census ======== */
.census { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.census div { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s3); }
.census b { display: block; font-size: 22px; font-weight: 700; color: var(--wwh-blue); font-variant-numeric: tabular-nums; }

/* ========================================================= audit ======== */
.audit { display: block; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s4); }
.aentry {
  display: flex; gap: var(--s3); padding: var(--s3) var(--s4);
  background: var(--bg); border-bottom: 1px solid var(--rule); align-items: flex-start;
}
.aentry:last-child { border-bottom: 0; }
.aentry .act { font-size: 12px; font-weight: 700; color: var(--fusion-blue); min-width: 13rem; word-break: break-word; }
.aentry .det { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.aentry.denied { background: var(--attention-bg); }
.aentry.denied .act { color: var(--attention); }

/* ======================================================== alerts ======== */
.alertbox {
  display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap;
  border: 1px solid var(--attention-rule); border-left: 4px solid var(--deep-orange);
  background: var(--attention-bg); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin-bottom: var(--s3);
}
.alertbox b { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--attention); }
.alertbox span { font-size: 13.5px; }
.alertbox .sub { margin-left: auto; }
.alertbox.clock_skew { border-color: var(--info-rule); border-left-color: var(--vamed-blue); background: var(--info-bg); }
.alertbox.clock_skew b { color: #0F5E86; }

.sessioncard {
  display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--rule); border-left: 4px solid var(--vamed-blue);
  border-radius: var(--radius); padding: var(--s3) var(--s4); margin: var(--s3) 0;
}
.sessioncard b { font-weight: 700; color: var(--wwh-blue); }
.sessioncard .sub { flex: 1 1 10rem; }

/* ======================================================= billing ======== */
.billcard {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s4); margin-bottom: var(--s3);
}
.billhead {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); margin-bottom: var(--s3);
}
.billhead b { font-weight: 700; color: var(--wwh-blue); font-variant-numeric: tabular-nums; }
.billhead .sub { flex: 1 1 8rem; }

/* ========================================================== sync ======== */
.synccard { background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); }
.syncrow { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; flex-wrap: wrap; }
.syncrow .arrow { color: var(--vamed-blue); font-weight: 700; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--s3); }
.stat b { display: block; font-size: 18px; font-weight: 700; color: var(--wwh-blue); }

/* ========================================================= sites ======== */
.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.site-tab {
  text-align: left; background: var(--bg); border: 1px solid var(--rule);
  border-top: 3px solid var(--rule-strong); border-radius: var(--radius);
  padding: var(--s3) var(--s4); cursor: pointer; font-weight: 400;
}
.site-tab .code { display: block; font-weight: 700; color: var(--wwh-blue); font-size: 14px; letter-spacing: 0.02em; }
.site-tab .name { display: block; font-size: 12.5px; color: var(--muted); }
.site-tab .meta { display: block; font-size: 12px; color: var(--fusion-blue); font-variant-numeric: tabular-nums; margin-top: 2px; }
.site-tab[data-code="SHIP-01"] { border-top-color: var(--seg-ships); }
.site-tab[data-code="FIELD-02"] { border-top-color: var(--seg-military); }
.site-tab[data-code="LAND-03"] { border-top-color: var(--seg-land); }
.site-tab[aria-selected="true"] { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--vamed-blue); }

/* =================================================== duplicate pairs ==== */
.pair {
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s4); margin-bottom: var(--s3);
}
.pair-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.pair-head .score { font-weight: 700; color: var(--wwh-blue); font-size: 16px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 760px) { .compare { grid-template-columns: 1fr; } }
.side { background: var(--sunken); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s3); }
.side .lbl { display: block; margin-bottom: var(--s1); }
.reasons { display: flex; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s2); }

/* ================================================= waiting room board === */
#stage.boardview { max-width: none; background: var(--wwh-blue); min-height: 78vh; padding: var(--s6); }
#stage.boardview .hint { color: var(--seg-ships); max-width: none; }
.bigboard { margin-bottom: var(--s6); }
.bigboard h3 {
  color: #fff; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; margin: 0 0 var(--s4); border-bottom: 2px solid var(--vamed-blue); padding-bottom: var(--s2);
}
.bignums { display: flex; gap: var(--s5); flex-wrap: wrap; }
.bignum { background: #fff; border-radius: 6px; padding: var(--s5) var(--s6); text-align: center; min-width: 9rem; }
.bignum b { display: block; font-size: 64px; line-height: 1; font-weight: 700; color: var(--wwh-blue); font-variant-numeric: tabular-nums; }
.bignum span { display: block; margin-top: var(--s2); font-size: 13px; }

/* ======================================================== toasts ======== */
.toasts {
  position: fixed; right: var(--s5); bottom: var(--s5); z-index: 50;
  display: flex; flex-direction: column; gap: var(--s2); max-width: 26rem;
}
.toast {
  background: var(--wwh-blue); color: #fff; border-radius: var(--radius);
  padding: var(--s3) var(--s4); font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(24, 24, 66, 0.28);
}
.toast.good { background: var(--ok); }
.toast.bad { background: var(--attention); }
.toast .t-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.toast .t-actions button { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.toast .t-actions button:hover { background: rgba(255, 255, 255, 0.28); }

/* The medium: three steps in the order a carrier performs them. Set apart
   from the in-process buttons above it, because they are a demonstration and
   this is the real thing. */
.media {
  margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--rule);
}
.media .hint { margin: 0 0 var(--s3); }
.media .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ======================================================== footer ======== */
.docfoot {
  display: flex; gap: var(--s4); flex-wrap: wrap;
  padding: var(--s4) var(--s5); border-top: 1px solid var(--rule);
  background: var(--bg); font-size: 12px; color: var(--muted);
}
.docfoot span:first-child { font-weight: 700; color: var(--wwh-blue); }

/* ======================================================= modules ======== */
.tabs { display: flex; gap: var(--s1); flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  font-size: 13.5px; font-weight: 600; color: var(--muted); padding: var(--s2) var(--s3); min-height: 0;
}
.tabs button:hover { background: none; color: var(--wwh-blue); }
.tabs button.on { color: var(--wwh-blue); border-bottom-color: var(--vamed-blue); }

/* The hidden attribute must win over every display rule above it. */
[hidden] { display: none !important; }

/* ==================================================== small screens ===== */
@media (max-width: 760px) {
  #stage { padding: var(--s4) var(--s3); }
  .topbar { padding: var(--s2) var(--s3); gap: var(--s3); }
  .workspaces { padding: 0 var(--s3); top: 53px; }
  .findbar { margin-left: 0; width: 100%; }
  .findbar input { min-width: 0; }
  .item { flex-wrap: wrap; }
  .rowacts { width: 100%; justify-content: flex-start; }
}

/* Who is at the keyboard, top right. Replaces the role picker, which let
   anybody claim any role by changing a dropdown. */
.whoami { display: flex; align-items: center; gap: var(--s3); }
.who-block { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.who-block b { font-size: 13px; color: var(--wwh-blue); }
.who-block span { font-size: 11px; color: var(--muted); }


/* ========================================================= label ======== */
/* On screen the label area does not exist. On paper it is the only thing
   that does. The page size itself is set from the chosen label dimensions
   at print time, because the printer is not known in advance. */
#label-area { display: none; }

@media print {
  body > *:not(#label-area) { display: none !important; }
  #label-area { display: block; }
  html, body { background: #fff; margin: 0; padding: 0; }
}

.label {
  box-sizing: border-box; padding: 2mm 3mm; overflow: hidden;
  font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.label .l-name {
  font-size: 11pt; font-weight: 700; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.label .l-line { font-size: 8pt; }
/* The number is what somebody reads out over a radio, so it is the biggest
   thing on the label and set in a face where 0 and O differ. */
.label .l-mrn {
  font-family: "Courier New", monospace; font-size: 14pt; font-weight: 700;
  letter-spacing: 0.05em;
}
.label .l-foot {
  display: flex; justify-content: space-between; gap: 3mm;
  font-size: 6.5pt; color: #333;
}
.item.muted { opacity: 0.62; }


/* ====================================================== chooser ========= */
/* One question, a few answers. Used where the next step is a choice, not a
   form: a stack of full-width targets that can be hit without aiming. */
.choices { display: flex; flex-direction: column; gap: var(--s2); grid-column: 1 / -1; }
.choices .choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: var(--s3) var(--s4); min-height: 52px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius);
  cursor: pointer;
}
.choices .choice:hover { background: var(--sunken); border-color: var(--vamed-blue); }
.choices .choice b { font-size: 14px; font-weight: 600; color: var(--wwh-blue); }
.choices .choice span { font-size: 12px; color: var(--muted); }
/* The one that cannot wait is the one that has to be found without reading. */
.choices .choice.urgent { border-color: var(--attention-rule); background: var(--attention-bg); }
.choices .choice.urgent b { color: var(--attention); }

/* ======================================================== language ====== */
/* Two originals, not a translation and its source. The switch sits with the
   person, because which language a site works in is a fact about the site. */
.langswitch { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.langswitch button {
  border: 0; border-radius: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; color: var(--muted);
}
.langswitch button[aria-pressed="true"] { background: var(--wwh-blue); color: #fff; }
.langswitch button + button { border-left: 1px solid var(--rule); }

/* ==========================================================================
   The frame and the second pass over every component.

   The first version of this file was correct and looked like a prototype:
   a title bar, a row of tabs, boxes with a coloured stripe down the left.
   This layer replaces the frame with the one working software uses (where
   you are and who you are down the side, the work in the middle, finding a
   patient always in reach) and tightens every component onto one radius,
   one elevation and one type scale.
   ========================================================================== */

/* ---------------------------------------------------------------- frame -- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--side); color: #B9BDDA;
  padding: var(--s4) var(--s3) var(--s3);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px var(--s2) var(--s4); }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; background: #fff;
  display: grid; place-items: center; overflow: hidden;
}
.brand-mark img { width: 28px; height: auto; display: block; }
.brand-name { min-width: 0; }
.brand-name b { display: block; color: #fff; font-size: 14.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; }
.brand-name i {
  display: block; font-style: normal; font-size: 11.5px; color: #8589B8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.workspaces {
  position: static; top: auto; z-index: auto;
  display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px;
  flex: 1 1 auto; overflow-y: auto;
  background: none; border: 0; padding: 0;
}
.workspaces .ws {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--radius);
  color: #B9BDDA; font-size: 13.5px; font-weight: 500;
  padding: 8px 10px; min-height: 36px; white-space: nowrap;
  transition: background .1s, color .1s;
}
.workspaces .ws svg {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.workspaces .ws:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.workspaces .ws[aria-selected="true"] {
  background: rgba(42, 155, 212, 0.2); color: #fff; font-weight: 600;
  box-shadow: inset 2.5px 0 0 var(--vamed-blue); border-bottom-color: transparent;
}
.ws-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: #6F74A3; padding: var(--s4) 10px var(--s1);
}

.side-foot {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: var(--s3);
}
.chainstate { display: flex; align-items: center; gap: 7px; padding: 0 var(--s2); font-size: 11.5px; color: #8FDDB1; }
.chainstate::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chainstate.bad { color: #FFB199; }

.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: #30327A; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; background: var(--info-bg); color: #0F5E86; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; background: var(--wwh-blue); }

.whoami { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.whoami .who-block { min-width: 0; }
.whoami .who-block b { display: block; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whoami .who-block span { display: block; font-size: 11.5px; color: #8E92C2; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--deep-orange); margin-left: auto; flex: none; }

.side-tools { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.side-out { background: none; border: 0; color: #8E92C2; font-size: 12px; font-weight: 500; padding: 4px 6px; min-height: 0; }
.side-out:hover { background: none; color: #fff; }
.sidebar .langswitch { border-color: rgba(255, 255, 255, 0.18); }
.sidebar .langswitch button { color: #8E92C2; }
.sidebar .langswitch button + button { border-left-color: rgba(255, 255, 255, 0.18); }
.sidebar .langswitch button[aria-pressed="true"] { background: #fff; color: var(--wwh-blue); }
.sidebar .langswitch button:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar .langswitch button[aria-pressed="true"]:hover { background: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.mainbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s4);
  height: 56px; padding: 0 28px;
  background: var(--canvas); border-bottom: 1px solid var(--rule);
}
.crumb { display: flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--muted); min-width: 0; }
.crumb-here { color: var(--ink); font-weight: 600; }
.crumb-link { cursor: pointer; }
.crumb-link:hover { color: var(--wwh-blue); text-decoration: underline; }
.crumb-sep { color: var(--rule-strong); }

.gsearch { position: relative; margin-left: auto; width: min(420px, 46vw); }
.gsearch[hidden] { display: none; }
.gsearch > svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round;
  pointer-events: none;
}
.gsearch input { padding-left: 34px; min-height: 36px; border-radius: 10px; border-color: var(--rule); background: var(--bg); }
.gresults {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); padding: 6px;
}
.grow {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--radius); padding: 8px; min-height: 0; font-weight: 400;
}
.grow:hover, .grow:focus-visible { background: var(--sunken); }
.gwho { min-width: 0; }
.gwho b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gwho i { display: block; font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gempty { padding: var(--s3); font-size: 13px; color: var(--muted); }

#stage { padding: var(--s5) 28px 56px; max-width: 1240px; width: 100%; margin: 0 auto; }
#stage.record { max-width: 980px; }

@media (max-width: 880px) {
  .app { grid-template-columns: 60px minmax(0, 1fr); }
  .brand-name, .workspaces .ws span, .ws-group, .whoami .who-block, .side-tools, .chainstate { display: none; }
  .workspaces .ws { justify-content: center; padding: 9px 0; }
  .whoami { justify-content: center; padding: 0; }
  .mainbar, #stage { padding-left: var(--s4); padding-right: var(--s4); }
}

/* ----------------------------------------------------------- page head -- */
.stagehead { margin-bottom: var(--s5); }
.stagehead h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 2px; }
.stagehead .hint { font-size: 13.5px; }

/* The numbers: one quiet strip instead of five boxes competing for the eye.
   Only a number that needs somebody is allowed colour. */
.tasks {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: var(--s5); overflow: hidden;
}
.tasks .task {
  flex: 1 1 8.5rem; background: none; border: 0; border-radius: 0; box-shadow: none;
  border-right: 1px solid var(--rule); padding: 14px var(--s4);
}
.tasks .task:last-child { border-right: 0; }
.tasks .task b { font-size: 24px; color: var(--ink); }
.tasks .task span { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin-top: 0; }
.tasks .task.urgent { background: var(--attention-bg); border-color: var(--rule); }
.tasks .task.urgent b { color: var(--attention); }
.tasks .task.urgent span { color: #A8431F; }
.tasks .task.clickable:hover { background: var(--sunken); }

/* ------------------------------------------------------------ sections -- */
.section-label {
  font-size: 13.5px; font-weight: 650; letter-spacing: 0; text-transform: none;
  margin: 28px 0 10px;
}
.section-label > span:first-child { color: var(--ink); }
.section-label .count { font-weight: 600; background: var(--sunken); border: 0; padding: 1px 8px; }

.card { border-radius: var(--radius-lg); padding: var(--s5); }

.list { border-radius: var(--radius-lg); }
.list > .item:first-child { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.list > .item:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }

.item { min-height: 50px; padding: 10px var(--s4); }
.item .who b { font-size: 14px; }
.item.flagged { border-left: 0; box-shadow: inset 3px 0 0 var(--attention); }
/* Rows that stand alone become cards of their own with air between them,
   instead of a stack of boxes sharing borders. */
.rpane > .item, #stage > .item, #stage .twocol > div > .item {
  border: 1px solid var(--rule); border-radius: 10px; margin-bottom: 6px; box-shadow: var(--shadow);
}
.item .mrn, .item .bedname { font-size: 12px; }

.roundrow { border-radius: 10px; margin-bottom: 6px; box-shadow: var(--shadow); min-height: 54px; }
.clinicname { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: var(--s4) 0 var(--s2); }

.empty { border-radius: 10px; background: transparent; border-color: var(--rule-strong); font-size: 13px; padding: 14px var(--s4); }

/* ------------------------------------------------------------- controls -- */
button {
  font-size: 13.5px; border-radius: var(--radius); border-color: var(--rule-strong);
  padding: 6px 13px; min-height: 34px;
}
button.primary { box-shadow: 0 1px 2px rgba(20, 20, 58, 0.25); }
button.primary:hover { background: #26266A; }
button.ghost { border-color: transparent; }
button.ghost:hover { background: var(--sunken); }
button.small { font-size: 12.5px; padding: 4px 10px; min-height: 28px; border-radius: 7px; }

input, select, textarea { font-size: 14px; border-radius: var(--radius); padding: 7px 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0; border-color: var(--vamed-blue); box-shadow: 0 0 0 3px rgba(42, 155, 212, 0.2);
}
.field > span { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #474C5E; }
.findbar input { min-width: 18rem; }
.actionbar { margin-bottom: var(--s5); }

/* -------------------------------------------------------------- dialogs -- */
dialog {
  border: 0; border-radius: 16px; padding: 28px;
  box-shadow: 0 24px 64px rgba(13, 14, 40, 0.32); max-width: 34rem;
}
dialog::backdrop { background: rgba(13, 14, 40, 0.5); }
dialog h3 { font-size: 18px; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 6px; }
dialog .hint { font-size: 13px; margin-bottom: var(--s5); }
dialog .actions { margin-top: 28px; }
.choices .choice { border-radius: 10px; padding: 12px var(--s4); }
.choices .choice b { color: var(--ink); }

/* ---------------------------------------------------------- the patient -- */
.banner {
  border-left: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow);
}
.banner.alert { border-color: var(--attention-rule); box-shadow: inset 0 3px 0 var(--deep-orange), var(--shadow); }
.pt-head { display: flex; align-items: center; gap: 14px; }
.pt-who { min-width: 0; }
.pt-who b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); line-height: 1.2; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 3px; font-size: 13px; color: var(--muted); }
.pt-meta span + span::before { content: "\00b7"; margin: 0 8px; color: var(--rule-strong); }
.pt-meta .mrn { font-weight: 700; color: var(--fusion-blue); font-variant-numeric: tabular-nums; }
.banner .allerg { margin-top: 14px; }
.banner .age { margin-top: 10px; font-size: 12px; }

.recordbar { margin-bottom: var(--s4); }

/* Record tabs as one segmented control: a place you are in, not a row of
   links you might follow. */
.rtabs {
  display: inline-flex; gap: 2px; border: 0; background: #E9EBF0; border-radius: 10px;
  padding: 3px; margin: var(--s4) 0 0; max-width: 100%;
}
.rtabs button {
  border: 0; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 14px; min-height: 30px;
}
.rtabs button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.5); }
.rtabs button[aria-selected="true"] {
  background: var(--bg); color: var(--ink); border-bottom-color: transparent;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
.rpane { padding-top: var(--s5); }

.chartsec .entry { border-radius: 10px; margin-bottom: 6px; }
.prescribebox { border-radius: var(--radius-lg); }
.trend { border-radius: 10px; }

/* ----------------------------------------------------------------- beds -- */
.ward h4 { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.bed { border-radius: 10px; padding: 10px var(--s3); min-height: 66px; }
.bed.free { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 var(--ok), var(--shadow); }
.bed.occupied { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 var(--fusion-blue); }
.bed.cleaning { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 #D9A400, var(--shadow); }
.bed.blocked, .bed.isolation { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 var(--deep-orange), var(--shadow); }
.bed.reserved { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 var(--vamed-blue), var(--shadow); }

/* --------------------------------------------------------------- pieces -- */
.bannerbar, .sessioncard, .alertbox { border-radius: 10px; }
.bannerbar, .sessioncard { border-left: 1px solid var(--rule); box-shadow: inset 3px 0 0 var(--vamed-blue), var(--shadow); }
.billcard { border-radius: var(--radius-lg); }
.audit { border-radius: var(--radius-lg); }
.census div { border-radius: 10px; }
.toast { border-radius: 10px; box-shadow: var(--shadow-pop); }
.rowmenu-list { border-radius: 10px; border-color: var(--rule); box-shadow: var(--shadow-pop); }


/* Two working columns of nearly equal weight: a queue row needs room for a
   name, a number and a reason on two lines, not four. */
.twocol { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s5); }
.findbar { flex: 1 1 auto; justify-content: flex-end; }
.findbar input { max-width: 26rem; }

/* ------------------------------------------------- who can take somebody -- */
/* The doctors, as people rather than as a number: a free one is the answer
   to "who can I send this to", which is the desk's question all day. */
.docstrip { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.doc {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 999px;
  padding: 5px 14px 5px 6px; box-shadow: var(--shadow);
}
.doc b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.doc span:not(.avatar) { display: block; font-size: 11.5px; color: var(--muted); }
.doc.free { border-color: var(--ok-rule); }
.doc.free span:not(.avatar) { color: var(--ok); font-weight: 600; }
.doc.free .avatar { background: var(--ok-bg); color: var(--ok); }
.doc.busy .avatar { background: var(--sunken); color: var(--muted); }

.segcount {
  margin-left: 6px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--wwh-blue); color: #fff; border-radius: 999px; padding: 1px 7px;
}
.filternote {
  display: flex; align-items: center; gap: var(--s3);
  font-size: 13px; color: var(--muted); margin-bottom: var(--s3);
}
.item > .avatar { flex: none; }
.item > .tag, .item > .pill, .item > .urg { flex: none; }

/* ------------------------------------------------------------ timeline -- */
/* A nurse's shift as one line down the page: when, where, what. The place
   stands first on every card because it is read while already walking. */
.timeline { position: relative; margin-bottom: var(--s5); }
.tl-group {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: var(--s5) 0 var(--s2) 104px;
}
.tl-group:first-child { margin-top: 0; }
.tl-group.late { color: var(--attention); }

.tl-entry { display: grid; grid-template-columns: 76px 28px minmax(0, 1fr); align-items: stretch; }
.tl-time { text-align: right; padding-top: 14px; }
.tl-time b { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.tl-time span { display: block; font-size: 11.5px; color: var(--muted); }

/* The rail: one line through every entry, one dot per task. */
.tl-dot { position: relative; }
.tl-dot::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--rule); }
.tl-dot::after {
  content: ""; position: absolute; left: 50%; top: 18px; width: 11px; height: 11px; margin-left: -5.5px;
  border-radius: 50%; background: var(--bg); border: 2.5px solid var(--fusion-blue);
}
.tl-entry.soon .tl-dot::after { border-color: var(--vamed-blue); background: var(--vamed-blue); }
.tl-entry.late .tl-dot::after, .tl-entry.urgent .tl-dot::after { border-color: var(--deep-orange); background: var(--deep-orange); }
.tl-entry.late .tl-time b, .tl-entry.urgent .tl-time b { color: var(--attention); }
.tl-entry.late .tl-time span, .tl-entry.urgent .tl-time span { color: var(--attention); }

.tl-card {
  display: flex; align-items: center; gap: var(--s4);
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 10px var(--s4); margin: 4px 0;
}
.tl-entry.late .tl-card, .tl-entry.urgent .tl-card { border-color: var(--attention-rule); box-shadow: inset 3px 0 0 var(--deep-orange), var(--shadow); }

.tl-where {
  flex: 0 0 96px; text-align: center; background: var(--sunken);
  border-radius: var(--radius); padding: 7px 6px;
}
.tl-where b { display: block; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; color: var(--wwh-blue); font-variant-numeric: tabular-nums; line-height: 1.15; }
.tl-where span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tl-what { flex: 1 1 auto; min-width: 0; }
.tl-kind { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tl-entry.critical .tl-kind { color: var(--attention); }
.tl-what b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.tl-what .sub { display: block; }

/* ---------------------------------------------------------------- calls -- */
/* The one control that is in the same place on every screen for every role.
   Red is used nowhere else in the frame. */
.sos {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  margin: var(--s3) 0; padding: 10px; min-height: 42px;
  background: #C62F12; border: 0; border-radius: var(--radius); color: #fff;
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.sos:hover { background: #DD3A1A; }
.sos svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.alarms { position: sticky; top: 56px; z-index: 19; }
.alarm {
  display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap;
  padding: 12px 28px; color: #fff;
}
.alarm.emergency { background: #C62F12; animation: alarm-pulse 1.2s ease-in-out infinite; }
.alarm.help { background: var(--fusion-blue); }
@keyframes alarm-pulse { 50% { background: #E24A22; } }
@media (prefers-reduced-motion: reduce) { .alarm.emergency { animation: none; } }
.alarm-text { flex: 1 1 20rem; min-width: 0; display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.alarm-text b { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }
.alarm-place { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.alarm-meta { font-size: 12.5px; opacity: 0.92; }
.alarm-acts { display: flex; gap: var(--s2); }
.alarm-go { background: #fff; border-color: #fff; color: #A12108; font-weight: 700; }
.alarm.help .alarm-go { color: var(--wwh-blue); }
.alarm-go:hover { background: #FFE9E3; }
.alarm-end { background: transparent; border-color: rgba(255, 255, 255, 0.65); color: #fff; }
.alarm-end:hover { background: rgba(255, 255, 255, 0.15); }

/* Picking a bed for an emergency: a grid of large targets, not a list to read. */
.formgrid.bedpick .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.formgrid.bedpick .choice { align-items: center; text-align: center; min-height: 60px; }
.formgrid.bedpick .choice b { font-size: 16px; font-variant-numeric: tabular-nums; }
.formgrid.bedpick .choice:last-child { grid-column: 1 / -1; background: var(--bg); border-color: var(--rule); }
.formgrid.bedpick .choice:last-child b { color: var(--ink); font-size: 14px; }

@media (max-width: 880px) { .sos span { display: none; } .alarm { padding: 10px var(--s4); } }

/* --------------------------------------------------------- reader test -- */
.readertest { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--s3); }
.rt-verdict { border-radius: 10px; padding: 12px var(--s4); font-size: 14px; font-weight: 600; }
.rt-verdict.wait { background: var(--sunken); color: var(--muted); }
.rt-verdict.ok { background: var(--ok-bg); color: var(--ok); }
.rt-verdict.warn { background: #FFF4E5; color: #9A5B00; }
.rt-verdict.bad { background: var(--attention-bg); color: var(--attention); }
.rt-raw {
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 0.06em;
  background: var(--sunken); border-radius: 10px; padding: 14px var(--s4); min-height: 56px; word-break: break-all;
}
.rt-facts { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ presence -- */
.away-toggle {
  width: 100%; background: transparent; border: 1px solid rgba(255, 255, 255, 0.18);
  color: #B9BDDA; font-size: 12.5px; font-weight: 600; min-height: 30px; padding: 4px 10px;
}
.away-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.away-toggle.on { background: #E0A100; border-color: #E0A100; color: #2A1E00; }
.away-toggle.on:hover { background: #F0B416; color: #2A1E00; }
.whoami.is-away .avatar { background: #6B5A1E; }
.alarm.away { background: #FFF4D6; color: #5A4300; border-bottom: 1px solid #F0D48A; padding-top: 8px; padding-bottom: 8px; }
.alarm.away .alarm-go { background: #5A4300; border-color: #5A4300; color: #fff; }
.alarm.away .alarm-go:hover { background: #3F2F00; }
.doc.away { border-color: #F0D48A; background: #FFFBEE; }
.doc.away span:not(.avatar) { color: #8A6A00; font-weight: 600; }
.doc.away .avatar { background: #FFF4D6; color: #8A6A00; }
@media (max-width: 880px) { .away-toggle { display: none; } }

/* -------------------------------------------------------------- history -- */
/* Everything that happened, one line each, by day. The icon says what kind
   of thing it was before the words do. */
.history { margin-top: var(--s4); }
.h-day {
  position: sticky; top: 56px; z-index: 2;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); background: var(--canvas); padding: var(--s3) 0 var(--s2);
}
.h-entry {
  display: grid; grid-template-columns: 52px 30px minmax(0, 1fr); gap: 0 var(--s2);
  padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.h-time { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.h-icon {
  width: 26px; height: 26px; padding: 5px; border-radius: 50%;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: var(--sunken); color: var(--muted);
}
.h-entry.clinical .h-icon { background: var(--info-bg); color: #0F5E86; }
.h-entry.med .h-icon { background: #EEF0FB; color: var(--fusion-blue); }
.h-entry.lab .h-icon, .h-entry.imaging .h-icon { background: #F1EEF9; color: #5A3E9A; }
.h-entry.alert .h-icon { background: var(--attention-bg); color: var(--attention); }
.h-entry.request .h-icon { background: #FFF4D6; color: #8A6A00; }
.h-body b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.h-entry.alert .h-body b { color: var(--attention); }
.h-detail { display: block; font-size: 13.5px; color: var(--ink); margin-top: 1px; white-space: pre-wrap; }
.h-by { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ======================================================= signing in ==== */
/* The door. It covers everything, because until a session exists there is
   nothing behind it that the server would answer anyway. Left the stage,
   right the form; on a phone only the form. */
.signin {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: #0b0b26; overflow: hidden;
}
.signin[hidden] { display: none; }

/* --- the stage ------------------------------------------------------------ */
.signin-stage {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 20% 10%, #1f2160 0%, #121238 45%, #0b0b26 100%);
  color: #fff;
}
.aurora {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; z-index: -1;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora.a1 { width: 520px; height: 520px; background: #2A9BD4; top: -160px; left: -120px; }
.aurora.a2 { width: 440px; height: 440px; background: #445689; bottom: -140px; right: -100px; animation-duration: 22s; animation-delay: -6s; }
.aurora.a3 { width: 300px; height: 300px; background: #F4511E; opacity: .22; top: 40%; left: 55%; animation-duration: 26s; animation-delay: -12s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 70px) scale(.95); }
}
.grid-floor {
  position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image:
    linear-gradient(rgba(124, 200, 239, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 200, 239, .08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 70%, #000 0%, transparent 70%);
  animation: gridpan 30s linear infinite;
}
@keyframes gridpan { to { background-position: 44px 44px, 44px 44px; } }

.sitemap {
  position: absolute; right: -2%; bottom: 6%; width: 78%; max-width: 680px;
  opacity: 0; animation: rise 1.2s .3s cubic-bezier(.2, .8, .2, 1) forwards;
}
.route { fill: none; stroke: url(#sg-line); stroke-width: 1.5; }
.route-dash {
  fill: none; stroke: rgba(124, 200, 239, .55); stroke-width: 1.5;
  stroke-dasharray: 2 10; stroke-linecap: round;
  animation: dash 2.4s linear infinite;
}
.route-dash.d2 { animation-duration: 3s; }
.route-dash.d3 { animation-duration: 2.7s; }
@keyframes dash { to { stroke-dashoffset: -48; } }
.packet { fill: #bfe6fb; filter: drop-shadow(0 0 6px #2A9BD4) drop-shadow(0 0 12px #2A9BD4); }
.packet.p2 { fill: #ffd2c2; filter: drop-shadow(0 0 6px #F4511E); }
.packet.p3 { fill: #fff; }
.node .core { fill: #16184a; stroke: #2A9BD4; stroke-width: 1.5; }
.node .glyph { fill: none; stroke: #bfe6fb; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node .pulse {
  fill: none; stroke: #2A9BD4; stroke-width: 1.5; transform-box: fill-box; transform-origin: center;
  animation: ping 2.8s cubic-bezier(0, .6, .4, 1) infinite;
}
.node.n2 .pulse { animation-delay: .9s; }
.node.n3 .pulse { animation-delay: 1.8s; }
.node .halo { animation: breathe 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.node text {
  fill: rgba(255, 255, 255, .75); font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-anchor: middle; font-family: inherit;
}
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.15); opacity: .7; } }

.stage-copy {
  position: absolute; top: 12%; left: 9%; right: 9%; max-width: 34rem;
}
.stage-copy > * { opacity: 0; animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards; }
.stage-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: #7cc8ef; padding: 6px 12px; border: 1px solid rgba(124, 200, 239, .35);
  border-radius: 999px; background: rgba(42, 155, 212, .1);
  animation-delay: .15s !important;
}
.stage-kicker::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7cc8ef;
  box-shadow: 0 0 10px #7cc8ef; animation: blink 1.6s ease-in-out infinite;
}
.stage-title {
  margin: 0; font-size: clamp(34px, 4.2vw, 60px); line-height: 1.04;
  font-weight: 800; letter-spacing: -.025em; color: #fff;
  animation-delay: .3s !important;
}
.stage-title .grad {
  background: linear-gradient(90deg, #7cc8ef, #2A9BD4 40%, #ff9a76 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s ease-in-out infinite alternate;
}
@keyframes sheen { to { background-position: 100% 0; } }
.stage-sub {
  margin: 0; max-width: 28rem; color: rgba(255, 255, 255, .62);
  font-size: 15px; line-height: 1.6; animation-delay: .45s !important;
}
.stage-ecg { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; opacity: .5; }
.stage-ecg svg { width: 100%; height: 100%; }
.stage-ecg path {
  fill: none; stroke: #2A9BD4; stroke-width: 1.6; stroke-linejoin: round;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  filter: drop-shadow(0 0 4px #2A9BD4);
  animation: trace 4s linear infinite;
}
@keyframes trace { 0% { stroke-dashoffset: 900; } 70%, 100% { stroke-dashoffset: -900; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* --- the form ------------------------------------------------------------- */
.signin-side {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: var(--s5); background: var(--canvas);
}
.signin-side::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 80% 0%, rgba(42, 155, 212, .12), transparent 70%),
              radial-gradient(50% 40% at 0% 100%, rgba(68, 86, 137, .10), transparent 70%);
}
.signin-card {
  position: relative; width: min(25rem, 100%);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 30px 70px rgba(20, 20, 58, .14), 0 4px 14px rgba(20, 20, 58, .06);
  padding: 40px 34px 30px;
  display: flex; flex-direction: column; gap: 14px;
  animation: cardin .9s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cardin { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.signin-card > * { opacity: 0; animation: rise .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.signin-card > :nth-child(1) { animation-delay: .25s; }
.signin-card > :nth-child(2) { animation-delay: .32s; }
.signin-card > :nth-child(3) { animation-delay: .39s; }
.signin-card > :nth-child(4) { animation-delay: .46s; }
.signin-card > :nth-child(5) { animation-delay: .53s; }
.signin-card > :nth-child(6) { animation-delay: .60s; }
.signin-card > :nth-child(7) { animation-delay: .67s; }
.signin-card > :nth-child(8) { animation-delay: .74s; }
.signin-card > :nth-child(9) { animation-delay: .81s; }
.signin-card .logo { height: 34px; width: auto; align-self: flex-start; margin-bottom: 10px; }
.signin-card h1 {
  font-size: 24px; line-height: 1.2; margin: 0; color: var(--wwh-blue);
  font-weight: 800; letter-spacing: -.02em;
}
.signin-sub { margin: -6px 0 8px; color: var(--muted); font-size: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); transition: color .2s;
}
.fld:focus-within > span { color: var(--vamed-blue); }
.signin-card input, .signin-card select {
  width: 100%; padding: 12px 14px; font-size: 15px; color: var(--ink);
  border: 1.5px solid var(--rule-strong); border-radius: 12px; background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.signin-card input:hover, .signin-card select:hover { border-color: #b6bccb; }
.signin-card input:focus, .signin-card select:focus {
  outline: none; border-color: var(--vamed-blue);
  box-shadow: 0 0 0 4px rgba(42, 155, 212, .16);
}
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0;
}
.pw-eye:hover { background: var(--sunken); color: var(--ink); }
.pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pw-eye.on { color: var(--vamed-blue); }

button.signin-go {
  position: relative; overflow: hidden; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; font-size: 15px; font-weight: 700; border: 0; border-radius: 12px;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #2A9BD4 0%, #445689 55%, #181842 100%);
  background-size: 180% 180%; background-position: 0% 50%;
  box-shadow: 0 10px 24px rgba(42, 155, 212, .32);
  transition: background-position .5s, transform .15s, box-shadow .25s;
}
button.signin-go:hover { background: linear-gradient(135deg, #2A9BD4 0%, #445689 55%, #181842 100%); background-size: 180% 180%; background-position: 100% 50%; box-shadow: 0 14px 30px rgba(42, 155, 212, .42); transform: translateY(-1px); }
.signin-go:active { transform: translateY(1px) scale(.99); }
.signin-go::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); animation: shine 3.6s 1.4s ease-in-out infinite;
}
@keyframes shine { 0% { left: -60%; } 40%, 100% { left: 130%; } }
.go-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.signin-go:hover .go-arrow { transform: translateX(4px); }
.go-spin {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.signin-go:disabled { cursor: progress; }
.signin-go:disabled .go-spin { display: block; }
.signin-go:disabled .go-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.signin-error {
  border-radius: 12px; border: 1px solid var(--rule);
  background: var(--sunken); color: var(--muted);
  padding: 10px 14px; font-size: 13px; line-height: 1.45;
  opacity: 1 !important; animation: none !important;
}
/* A refused sign-in is a problem. Having signed out is not, and colouring
   both the same teaches people to ignore the colour. */
.signin-error.bad {
  background: var(--attention-bg); color: var(--attention);
  border-color: var(--attention-rule);
}
.signin-side.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}
.signin-foot {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding-top: 16px;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: 12px; line-height: 1.5;
}
.dot-live {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(23, 121, 74, .5); animation: live 2s infinite;
}
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(23, 121, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 121, 74, 0); } }

/* --- the way in ----------------------------------------------------------- */
.signin-wipe {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(circle at var(--wx, 75%) var(--wy, 60%), #2A9BD4 0%, #181842 60%);
  clip-path: circle(0% at var(--wx, 75%) var(--wy, 60%));
}
.signin.leaving .signin-wipe { animation: wipe .75s cubic-bezier(.7, 0, .3, 1) forwards; }
.signin.leaving .signin-card { transform: scale(.96); opacity: .0; transition: all .4s; }
@keyframes wipe { to { clip-path: circle(150% at var(--wx, 75%) var(--wy, 60%)); } }
.signin.gone { animation: fadeout .45s ease forwards; }
@keyframes fadeout { to { opacity: 0; } }

@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; }
  .signin-stage { display: none; }
  .signin-side { background: radial-gradient(120% 70% at 50% 0%, #1f2160, #0b0b26); }
}
@media (prefers-reduced-motion: reduce) {
  .signin *, .signin *::before, .signin *::after { animation: none !important; opacity: 1 !important; transition: none !important; }
  .packet { display: none; }
}
