:root {
  /* Colours taken from SHIFT's approved pāua artwork: deep navy, violet, electric blue, turquoise and pearl. The bright
     shell colours stay in the pāua surfaces; text uses the artwork's deepest shades so it stays readable. */
  --ink: #06083b;
  --ink-soft: #3d4a66;
  /* Links, button words and accents take the text colour: SHIFT's colour is the pāua, not a second accent. */
  --line: var(--ink);
  /* Outlines take the pāua's deep blue (9.2:1 on white). */
  --outline: #024c72;
  --bg: #ffffff;
  --card: #ffffff;
  --tint: #dff8f2;
  --edge: #c6c4cf;
  --edge-soft: #dff8f2;
  --danger: #b0122b;
  --danger-bg: #fdecef;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --ok: #0f6b4a;
  --ok-bg: #e3f6ee;
  --radius: 18px;
  /* Pāua: SHIFT's approved pāua artwork itself, at its own brightness and colour, on every pāua surface. */
  --paua: url("paua.jpg") center / cover no-repeat #331e6d;
  --paua-shade: var(--paua);
  /* The same shell at one fixed scale for every outline, frame and button, so they all look alike. */
  --paua-tile: url("paua.jpg") center / 420px auto repeat #024c72;
  /* For lettering filled with the shell on a card: deepened so the words read. */
  --paua-ink: linear-gradient(#06083b9c, #06083b9c), url("paua.jpg") center / 440px auto repeat #331e6d;
  /* White words on the shell are bold with a thin, crisp navy outline, so they read on its brightest pearl without a
     box or veil behind them. */
  --paua-glow: 1px 1px 0 #06083b, -1px -1px 0 #06083b, 1px -1px 0 #06083b, -1px 1px 0 #06083b, 0 0 2px #06083b, 0 2px 5px #06083bb3;
  font-synthesis: none;
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  /* A white page, so the pāua surfaces stand out; SHIFT's fern sits in the lower corner, behind the content. */
  background: url("fern-dark.webp") right -36px bottom -40px / 170px auto no-repeat, var(--bg);
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--line); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #2f8fe0; outline-offset: 2px; }

#app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 12px 8px;
}
/* The copyright line closes every page; the space below it keeps it clear of the fixed bottom menu. */
.copyright { max-width: 1180px; margin: 0 auto; padding: 8px 16px calc(96px + env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--ink-soft); }
@media (max-width: 760px) { .copyright { padding-bottom: calc(160px + env(safe-area-inset-bottom)); } }
@media print { .copyright { display: none; } }

/* Pāua surfaces ----------------------------------------------------------------- */
.paua { background: var(--paua-shade); color: #fff; text-shadow: var(--paua-glow); }
.paua-frame {
  border: 3px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--paua-tile) border-box;
}
.paua-text {
  background: var(--paua);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 40px; color: #fff;
  background: var(--paua-shade);
  box-shadow: 0 2px 8px #06083b40;
  text-shadow: var(--paua-glow);
}
.logo.small { width: 48px; height: 48px; font-size: 30px; border-radius: 12px; }

/* Cards and headers -------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 2px solid var(--outline);
  border-radius: var(--radius);
  padding: 16px;
}
.header-card { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.header-card h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.header-card .sub { color: var(--ink-soft); font-size: 17px; margin-top: 2px; }
.header-card .grow { flex: 1; min-width: 0; }

.entry { display: grid; gap: 18px; max-width: 760px; margin: 6vh auto 0; }
.entry .brand { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: 6px; }
.entry .brand p { margin: 0; font-size: 22px; color: var(--ink-soft); }
.entry .choice {
  text-align: left; padding: 28px; border-radius: 6px; margin: 0 16px;
  box-shadow: 0 6px 20px #06083b1a;
}
.entry .choice h2 { margin: 0 0 8px; font-size: 34px; font-weight: 800; letter-spacing: .5px; }
.entry .choice p { margin: 0; font-size: 19px; color: var(--ink-soft); max-width: 26ch; }

.banner {
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--tint);
  border: 2px solid #9fd0da;
  margin-bottom: 12px;
}
.banner strong { display: block; font-size: 20px; }
.banner.warn { background: var(--warn-bg); border-color: #f0cf7a; }
.banner.danger { background: var(--danger-bg); border-color: #f0a3b0; }

.section-title {
  margin: 0; padding: 10px 16px;
  font-size: 18px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  border-radius: var(--radius) var(--radius) 0 0;
}
.strip {
  border: 2px solid var(--outline);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--card);
  padding: 12px;
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin-bottom: 14px;
}
.pill {
  flex: none;
  scroll-snap-align: start;
  border: 2px solid var(--edge);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  white-space: nowrap;
}
.pill:hover, .pill.active { background: var(--tint); border-color: var(--outline); }

.grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-card {
  text-align: left;
  min-height: 190px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
}
.home-card h2 { margin: 6px 0 0; font-size: 24px; }
.home-card p { margin: 0; color: var(--ink-soft); }
.home-card .count {
  position: absolute; top: 14px; right: 14px;
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 999px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.icon-tile {
  width: 52px; height: 52px; border-radius: 12px;
  display: grid; place-items: center;
}
.icon-tile svg { width: 30px; height: 30px; }
.home-card .icon-tile { color: var(--line); background: var(--tint); }

/* Customise mode */
.customise-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.sortable { display: grid; gap: 8px; margin-bottom: 14px; }
.sort-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--card); border: 2px solid var(--edge); border-radius: 14px;
}
.sort-item.dragging { opacity: .85; border-color: var(--outline); box-shadow: 0 8px 24px #06083b33; }
.sort-item .handle { touch-action: none; cursor: grab; padding: 6px; border-radius: 8px; color: var(--ink-soft); }
.sort-item .label { flex: 1; font-weight: 700; }
.sort-item.is-hidden .label { color: var(--ink-soft); text-decoration: line-through; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--tint); color: var(--line); white-space: nowrap; }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.muted { background: #eef1f3; color: var(--ink-soft); }

/* Buttons and forms */
.btn {
  border: 2px solid var(--outline);
  background: var(--card);
  color: var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 700;
}
.btn.primary { background: var(--paua-tile); color: #fff; text-shadow: var(--paua-glow); font-weight: 800; border-color: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--line); font-weight: 700; padding: 4px; text-decoration: underline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
label.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-weight: 600; }
input[type=text], input[type=number], input[type=password], input[type=search], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  border: 2px solid var(--edge); border-radius: 12px; padding: 10px 12px; background: var(--card); width: 100%; min-width: 0;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--outline); outline: none; }

.list { display: grid; gap: 10px; }
.list-item {
  display: flex; gap: 14px; align-items: center;
  text-align: left; width: 100%;
  background: var(--card); border: 2px solid var(--outline); border-radius: var(--radius);
  padding: 14px;
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item h2, .list-item h3 { margin: 0; font-size: 20px; }
.list-item p { margin: 2px 0 0; color: var(--ink-soft); }
.list-item .icon-tile { background: var(--paua-shade); color: #fff; width: 60px; height: 60px; }
.chev { color: var(--ink); font-size: 26px; }

.page-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.page-title h1 { margin: 0; font-size: 24px; flex: 1; }
.back { border: 2px solid var(--outline); background: var(--card); border-radius: 12px; padding: 6px 12px; font-weight: 700; color: var(--line); }

table.data { width: 100%; border-collapse: collapse; background: var(--card); }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #dde9ec; vertical-align: top; }
table.data th { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; border: 2px solid var(--outline); border-radius: var(--radius); }
.flag-H, .flag-L { color: var(--danger); font-weight: 800; }

.empty { padding: 28px 12px; text-align: center; color: var(--ink-soft); }

/* Bottom navigation ---------------------------------------------------------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: #ffffffee;
  backdrop-filter: blur(6px);
  max-width: 1180px; margin: 0 auto;
}
.bottom-nav button {
  display: grid; place-items: center; gap: 2px;
  padding: 8px 4px;
  border: 2px solid var(--outline); border-radius: 16px;
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 15px;
}
.bottom-nav button svg { width: 28px; height: 28px; }
.bottom-nav button.active { background: var(--paua-shade); color: #fff; border-color: #06083b; text-shadow: var(--paua-glow); }

/* Patient header ------------------------------------------------------------------ */
.patient-header { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.patient-header .who { flex: 1 1 320px; min-width: 0; display: flex; gap: 14px; }
.patient-header h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.patient-header .ids { color: var(--ink-soft); margin-top: 4px; }
.patient-header .ids span { display: inline-block; }
.patient-header .ids span + span::before { content: "|"; margin: 0 8px; color: #9fb4bd; }
.patient-header .stay { margin-top: 4px; color: var(--ink-soft); }
.patient-header .stay b { color: var(--ink); }
.allergy { flex: 0 1 280px; display: grid; gap: 6px; }
.allergy-alert {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #c8193a, #9c0f28); color: #fff;
  border-radius: 14px; padding: 10px 14px; border: 0; text-align: left; width: 100%;
}
.allergy-alert svg { width: 30px; height: 30px; flex: none; }
.allergy-alert b { display: block; font-size: 13px; letter-spacing: .6px; }
.allergy-note { background: var(--tint); color: var(--ink-soft); border-radius: 12px; padding: 6px 12px; font-size: 14px; text-align: center; }
.allergy-none { background: var(--warn-bg); color: var(--warn); border: 2px solid #f0cf7a; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.allergy-nka { background: var(--ok-bg); color: var(--ok); border: 2px solid #9edcc1; border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.patient-alert {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #e0a526, #b87a0a); color: #1d1400;
  border-radius: 14px; padding: 8px 14px; border: 0; text-align: left; width: 100%; font-size: 14px;
}
.patient-alert svg { width: 26px; height: 26px; flex: none; }
.patient-alert b { display: block; font-size: 13px; letter-spacing: .6px; }
.patient-restriction {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #5a3fa0, #3b2878); color: #fff;
  border-radius: 14px; padding: 8px 14px; border: 0; text-align: left; width: 100%; font-size: 14px;
}
.patient-restriction svg { width: 26px; height: 26px; flex: none; }
.patient-restriction b { display: block; font-size: 13px; letter-spacing: .6px; }
.restriction-on { border-left: 6px solid #5a3fa0; }
.patient-whanau {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #2d6a4f;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-whanau svg { width: 24px; height: 24px; flex: none; color: #2d6a4f; }
.patient-whanau b { display: block; font-size: 13px; letter-spacing: .6px; color: #2d6a4f; }
.said { margin: 0; padding: 8px 12px; border-left: 4px solid #1f5f8b; background: var(--tint); border-radius: 0 10px 10px 0; font-style: italic; white-space: pre-wrap; }
.report-review { border-left: 6px solid #c0392b; }
.coding-row { text-align: left; width: 100%; }
.coding-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .coding-grid { grid-template-columns: minmax(0, 1fr); } }
.code-line { display: flex; align-items: center; gap: 10px; }
.code-line .grow { flex: 1; min-width: 0; }
.code-line .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; background: var(--tint); border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.code-principal .code { background: #5b4a8b; color: #fff; }
.source { border-left: 4px solid var(--tint); }
.checks-ok { border-left: 6px solid #2d6a4f; }
.checks-bad { border-left: 6px solid #c0392b; }
.patient-external {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #5b4a8b;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-external svg { width: 24px; height: 24px; flex: none; color: #5b4a8b; }
.patient-external b { display: block; font-size: 13px; letter-spacing: .6px; color: #5b4a8b; }
.external-unmatched { border-left: 6px solid #c0392b; }
.candidate { border-top: 1px solid var(--tint); padding-top: 6px; gap: 8px; flex-wrap: wrap; }
.candidate .tag { margin-right: 6px; }
.patient-access {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #1f5f8b;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-access svg { width: 24px; height: 24px; flex: none; color: #1f5f8b; }
.patient-access b { display: block; font-size: 13px; letter-spacing: .6px; color: #1f5f8b; }
.need-interpreter { border-left: 6px solid #1f5f8b; }
.booking-due { border-left: 6px solid #c0392b; }
.support-limit { border-left: 6px solid #c0392b; }
.patient-capacity {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #8a5a00;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-capacity svg { width: 24px; height: 24px; flex: none; color: #8a5a00; }
.patient-capacity b { display: block; font-size: 13px; letter-spacing: .6px; color: #8a5a00; }
.capacity-lacks { border-left: 6px solid #8a5a00; }
.abilities { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.patient-pref {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #b0417a;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-pref svg { width: 24px; height: 24px; flex: none; color: #b0417a; }
.patient-pref b { display: block; font-size: 13px; letter-spacing: .6px; color: #b0417a; }
.pref-quote { margin: 0; padding: 6px 12px; border-left: 4px solid #b0417a; font-size: 16px; }
.patient-leave {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #2f6fb0, #1d4f86); color: #fff;
  border-radius: 14px; padding: 8px 14px; border: 0; text-align: left; width: 100%; font-size: 14px;
}
.patient-leave.late { background: linear-gradient(180deg, #c0392b, #922b21); }
.patient-leave svg { width: 26px; height: 26px; flex: none; }
.patient-leave b { display: block; font-size: 13px; letter-spacing: .6px; }
.patient-diet {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1f8a5b, #146343); color: #fff;
  border-radius: 14px; padding: 8px 14px; border: 0; text-align: left; width: 100%; font-size: 14px;
}
.patient-diet svg { width: 26px; height: 26px; flex: none; }
.patient-diet b { display: block; font-size: 13px; letter-spacing: .6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 400; }
.meals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.meal { border: 1px solid #cfe3e6; border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.meal.missing { border-color: #d99a1c; background: #fff6e0; }
.meal.concern { border-color: #c0392b; background: #fdecea; }
.texture { border-left: 4px solid #1f8a5b; }
.bed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bed-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px; border-radius: 12px; border: 2px solid #cfe3e6; background: var(--card); font: inherit; }
.bed-cell.bed-available { border-color: #1f8a5b; }
.bed-cell.bed-reserved { border-color: #d99a1c; }
.bed-cell.bed-cleaning { background: #f1f4f5; }
.synthetic { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* Live Workstation ------------------------------------------------------------------- */
.workstation { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.destinations { display: grid; gap: 6px; align-content: start; }
.dest {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 6px; border: 2px solid var(--outline); border-radius: 12px;
  background: var(--card); font-weight: 800; font-size: 14px; text-align: center; line-height: 1.15;
  overflow-wrap: anywhere; min-width: 0;
}
.dest svg { width: 24px; height: 24px; flex: none; color: var(--line); }
.dest.active { background: var(--paua-shade); color: #fff; border-color: #06083b; text-shadow: var(--paua-glow); }

.dest.active svg { color: #fff; }
.dest-group {
  margin-top: 8px; padding: 0 2px; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: #331e6d; overflow-wrap: anywhere;
}
.dest-group:first-child { margin-top: 0; }
.home-group { display: grid; gap: 10px; margin-top: 14px; }
.home-group .section-title { border-radius: var(--radius); }
.live { border: 2px solid var(--outline); border-radius: var(--radius); background: var(--card); display: flex; flex-direction: column; min-height: 62vh; overflow: hidden; }
.live-title { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }
.live-title h2 { margin: 0; font-size: 22px; }
.live-body { flex: 1; padding: 14px; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.live-hint { color: #9fb4bd; text-align: center; padding: 40px 10px; }

@media (max-width: 760px) {
  /* On a phone the record's tabs run along the top, so the page is not as long as the list of tabs. */
  .workstation { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .destinations { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding: 4px 0 6px; scroll-snap-type: x proximity; position: sticky; top: 0; z-index: 5; background: var(--bg); }
  .dest { flex: none; padding: 8px 12px; font-size: 13px; border-radius: 10px; scroll-snap-align: start; white-space: nowrap; }
  #app { padding-left: 10px; padding-right: 10px; }
  .dest svg { display: none; }
  .dest span { overflow-wrap: normal; }
  .dest-group { display: none; }
  .live { min-height: 70vh; }
  .live-title { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .live-title h2 { font-size: 18px; }
  .header-card h1, .patient-header h1 { font-size: 24px; }
  .home-card { min-height: 160px; }
  .home-card h2 { font-size: 20px; }
}

/* Command box */
.command { border-top: 2px solid var(--edge-soft); padding: 10px 12px; display: grid; gap: 8px; background: #f8fcfd; }
.command-line { display: flex; gap: 8px; }
.command-line input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 17px; }
.suggest { display: flex; gap: 6px; overflow-x: auto; }
.suggest button { flex: none; border: 1px solid var(--edge); background: var(--card); border-radius: 999px; padding: 4px 10px; font-family: inherit; font-weight: 700; font-size: 14px; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; gap: 6px; align-items: center; border: 2px solid var(--edge); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px; background: var(--card); }
.toggle[aria-pressed=true] { background: var(--paua-tile); color: #fff; text-shadow: var(--paua-glow); font-weight: 800; border-color: var(--outline); }
.toggle.urgent[aria-pressed=true] { background: var(--danger); border-color: var(--danger); }
.period { display: flex; gap: 8px; flex-wrap: wrap; }
.period label { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 700; }
.period input { width: auto; padding: 4px 8px; }

/* .key sentence form */
.keyform { border: 2px solid var(--outline); border-radius: 14px; padding: 12px; background: var(--card); }
.keyform .title { font-weight: 800; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.sentence { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 18px; }
.sentence .slot { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sentence .slot b { font-weight: 800; }
.sentence .slot input, .sentence .slot select { width: auto; min-width: 70px; padding: 4px 8px; border-radius: 8px; font-size: 17px; }
.sentence .slot input.wide { min-width: 220px; }
.sentence .slot .unit { color: var(--ink-soft); font-size: 15px; }
.sentence .paren { color: #9fb4bd; }
.keyform textarea { font-size: 17px; }
@media (max-width: 760px) {
  .sentence .slot { display: flex; flex-wrap: wrap; width: 100%; }
  .sentence .slot input, .sentence .slot select { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .sentence .slot input.wide { min-width: 0; }
  .sentence .paren { display: none; }
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--tint); border: 1px solid #9fd0da; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: 14px; }
.chip button { border: 0; background: none; padding: 0 2px; font-weight: 800; }

/* Entries */
.entry-item { border: 2px solid var(--edge-soft); border-radius: 14px; padding: 10px 12px; background: var(--card); text-align: left; width: 100%; display: grid; gap: 4px; }
.entry-item.selected { border-color: var(--outline); box-shadow: 0 0 0 3px #2f8fe033; }
.entry-item.urgent { border-left: 6px solid var(--danger); }
.entry-item .text { font-size: 17px; }
.entry-item .meta { font-size: 13px; color: var(--ink-soft); }
.entry-item.error .text { text-decoration: line-through; color: var(--ink-soft); }
.entry-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tile { border: 2px solid var(--edge-soft); border-radius: 14px; padding: 10px 12px; background: var(--card); }
.tile h3 { margin: 0 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); }
.tile .big { font-size: 20px; font-weight: 800; }
.notice { font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 6px 10px; }

/* Dialogs and toast */
dialog { border: 2px solid var(--outline); border-radius: var(--radius); padding: 18px; max-width: min(520px, 92vw); width: 100%; }
dialog::backdrop { background: #0b2a3a66; }
dialog h2 { margin-top: 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 16px;
  max-width: min(560px, 92vw); box-shadow: 0 8px 24px #0006;
}
.toast.error { background: var(--danger); }

.signin { max-width: 440px; margin: 8vh auto 0; display: grid; gap: 14px; }
.signin form { display: grid; gap: 12px; }
.sort-item .handle svg { width: 22px; height: 22px; display: block; }
.card h3 { margin: 0; }
.card.urgent { border-left: 6px solid var(--danger); }

/* ED Board: the triage category as recorded by the triage nurse. */
.tag.ats { font-weight: 700; color: #fff; border-color: transparent; }
.tag.ats-1 { background: #b0122b; }
.tag.ats-2 { background: #c05600; }
.tag.ats-3 { background: #0f6b4a; }
.tag.ats-4 { background: #1d4f91; }
.tag.ats-5 { background: #5a6b78; }

/* Rostering decisions */
.candidate { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--tint); }
.candidate:first-of-type { border-top: 0; }

/* Pāua frames: a shell edge around the main working surfaces. */
.header-card, .patient-header, .live {
  border: 5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--paua-tile) border-box;
}

/* Pāua lettering in boxes: workstation tabs and card titles. Tab pills keep plain ink on their own fill, since a pill
   sits straight on the pāua. */
.dest span, .home-card h2, .list-item h2, .list-item h3 {
  background: var(--paua-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dest.active span { background: none; color: #fff; }
/* A chosen or hovered pill has a solid fill, so its words are plain ink (pāua lettering on a fill would vanish). */
.pill:hover, .pill.active { background: var(--tint); -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink); }
.dest.extra { border-style: dashed; }
.screen-row { padding: 6px 0; border-bottom: 1px solid var(--line-soft, #ddd); gap: 12px; }
.embed { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--outline); }

/* Admission and transfer of care */
.tag.paua { background: var(--paua-shade); color: #fff; text-shadow: var(--paua-glow); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 20px; height: 20px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.steps li { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #eef1f3; color: var(--ink-soft); }
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.steps li.now { background: var(--paua-shade); color: #fff; text-shadow: var(--paua-glow); }
.bed-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-block: 12px; }
.flow-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-block: 12px; }
.flow-sum .sum { background: var(--card); border: 2px solid var(--edge-soft); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.flow-sum .sum b { font-size: 24px; font-variant-numeric: tabular-nums; }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.bed { border: 2px solid var(--edge-soft); border-radius: 14px; padding: 10px; background: var(--card); display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.bed-available { border-color: var(--ok); background: var(--ok-bg); }
.bed-cleaning { border-color: var(--warn); background: var(--warn-bg); }
.bed-reserved { border-color: var(--outline); background: var(--tint); }
.bed-occupied { border-color: #c9d3da; }
.flow-sum .bed-available b { color: var(--ok); }
.flow-sum .bed-cleaning b { color: var(--warn); }

/* Discharge */
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.req { border: 2px solid var(--warn-bg); border-radius: 12px; padding: 8px 10px; display: grid; gap: 4px; background: #fffdf6; }
.req.met { border-color: var(--edge-soft); background: var(--card); }
.summary { white-space: pre-wrap; background: var(--tint); border-radius: 10px; padding: 8px 10px; }
.pre-wrap { white-space: pre-wrap; }

/* Escalation */
.esc { border-left-width: 6px; }
.esc-immediate { border-left-color: var(--danger); }
.esc-urgent { border-left-color: #c05600; }
.esc-routine { border-left-color: var(--outline); }
.esc.closed { opacity: .85; border-left-color: #c9d3da; }
.grow { flex: 1 1 160px; min-width: 0; }
.alert-raised { border-left: 6px solid #d99a1c; }
.patient-instrument {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #c0392b;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-instrument svg { width: 24px; height: 24px; flex: none; color: #c0392b; }
.patient-instrument b { display: block; font-size: 13px; letter-spacing: .6px; color: #c0392b; }
.instrument-flag { border-left: 6px solid #c0392b; }
.score-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.score { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
fieldset.item { border: 1px solid var(--outline); border-radius: 12px; padding: 8px 12px; display: grid; gap: 4px; margin: 0; }
fieldset.item legend { font-weight: 600; padding: 0 4px; }
dialog.wide { max-width: min(720px, 96vw); }
.patient-function {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #2d6a4f;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-function svg { width: 24px; height: 24px; flex: none; color: #2d6a4f; }
.patient-function b { display: block; font-size: 13px; letter-spacing: .6px; color: #2d6a4f; }
.function-row { display: grid; gap: 4px; }
.function-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; }
.function-worse { border-left: 6px solid #c0392b; }
.function-plan.open { border-left: 6px solid #2d6a4f; }
fieldset.function-item .row { flex-wrap: wrap; }
.patient-usual {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid #b35c00;
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-usual svg { width: 24px; height: 24px; flex: none; color: #b35c00; }
.patient-usual b { display: block; font-size: 13px; letter-spacing: .6px; color: #b35c00; }
.usual-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; }
.difference-noticed, .usual-outside { border-left: 6px solid #c0392b; }
.difference-acting { border-left: 6px solid #b35c00; }
.usual-area { display: grid; gap: 4px; }
.usual-different { border-left: 6px solid #b35c00; }
.usual-range input[type=number] { width: 6.5em; }
.team-line { display: flex; flex-wrap: wrap; gap: 4px 14px; background: none; border: 0; padding: 2px 0; text-align: left; font-size: 13px; color: var(--ink); cursor: pointer; }
.team-line .team-gap { color: #c0392b; font-weight: 700; }
.team-kind h3 { margin: 0; font-size: 15px; }
.team-missing { border-left: 6px solid #c0392b; }
.assignment { border-top: 1px solid var(--tint); padding-top: 6px; }
.assignment-proposed, .assignment-confirmed { border-left: 4px solid #e0a526; padding-left: 8px; }

/* Patient allocation */
.alloc-staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.alloc-staff { display: flex; flex-direction: column; gap: 4px; }
.alloc-heavy { border-left: 6px solid var(--warn); }
.alloc-warn { color: var(--warn); font-weight: 700; }
.alloc-none { border-left: 6px solid #c0392b; }
.chip.alloc-need { font-weight: 600; font-size: 13px; border-radius: 10px; }

/* Clinical status */
.patient-acuity {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid var(--ok);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-acuity svg { width: 24px; height: 24px; flex: none; color: var(--ok); }
.patient-acuity b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--ok); }
.patient-acuity.acuity-watch { border-color: var(--warn); }
.patient-acuity.acuity-watch svg, .patient-acuity.acuity-watch b { color: var(--warn); }
.patient-acuity.acuity-unwell, .patient-acuity.acuity-critical { border-color: var(--danger); background: var(--danger-bg); }
.patient-acuity.acuity-unwell svg, .patient-acuity.acuity-unwell b, .patient-acuity.acuity-critical svg, .patient-acuity.acuity-critical b { color: var(--danger); }
.tile.acuity-watch { border-left: 6px solid var(--warn); }
.tile.acuity-unwell, .tile.acuity-critical { border-left: 6px solid var(--danger); }
.tile.acuity-stable { border-left: 6px solid var(--ok); }
.acuity-now h3 { margin: 0; font-size: 17px; }
.acuity-overdue { outline: 2px dashed var(--warn); outline-offset: -2px; }
.acuity-implication { background: var(--tint); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.acuity-evidence { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 6px 0; font-size: 14px; }
.acuity-evidence dt { font-weight: 700; color: var(--ink-soft); }
.acuity-evidence dd { margin: 0; }
@media (max-width: 520px) { .acuity-evidence { grid-template-columns: 1fr; } .acuity-evidence dd { margin-bottom: 6px; } }
.acuity-choice { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--edge); border-radius: 12px; padding: 8px 12px; cursor: pointer; }
.acuity-choice:has(input:checked) { border-color: var(--outline); background: var(--tint); }
.acuity-choice.acuity-unwell:has(input:checked), .acuity-choice.acuity-critical:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: 6px; }

/* Deterioration */
.patient-deterioration {
  display: flex; align-items: center; gap: 10px;
  background: var(--danger); color: #fff; border: 2px solid var(--danger);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-deterioration svg { width: 24px; height: 24px; flex: none; }
.patient-deterioration b { display: block; font-size: 13px; letter-spacing: .6px; }
.patient-deterioration.det-responding, .patient-deterioration.det-reassessed { background: var(--danger-bg); color: var(--ink); }
.patient-deterioration.det-responding b, .patient-deterioration.det-reassessed b, .patient-deterioration.det-responding svg, .patient-deterioration.det-reassessed svg { color: var(--danger); }
.tile.det-detected, .tile.det-escalated { border-left: 6px solid var(--danger); }
.tile.det-responding, .tile.det-reassessed { border-left: 6px solid var(--warn); }
.det-episode h3 { margin: 0; font-size: 17px; }
.det-steps { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--edge); display: flex; flex-direction: column; gap: 10px; }
.det-step { position: relative; font-size: 14px; }
.det-step::before { content: ''; position: absolute; left: -21px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--outline); }
.det-step.det-detected::before, .det-step.det-escalated::before { background: var(--danger); }
.det-step.det-outcome::before { background: var(--ok); }

/* Incidents */
.tile.inc-reported { border-left: 6px solid var(--danger); }
.tile.inc-reviewed, .tile.inc-investigating, .tile.inc-actions { border-left: 6px solid var(--warn); }
.inc-action { padding: 4px 0; border-top: 1px solid #e3eef1; align-items: center; gap: 8px; }
.inc-overdue { color: var(--danger); }

/* Death */
.patient-death {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border: 2px solid var(--ink);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-death svg { width: 24px; height: 24px; flex: none; }
.patient-death b { display: block; font-size: 13px; letter-spacing: .6px; }
.tile.death-identified { border-left: 6px solid var(--danger); }
.tile.death-verified { border-left: 6px solid var(--warn); }
.tile.death-closed, .tile.death-entered_in_error { border-left: 6px solid var(--ink-soft); }
.death-event h3 { margin: 0; font-size: 17px; }
.death-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.death-facts dt { font-weight: 700; }
.death-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .death-facts { grid-template-columns: 1fr; } .death-facts dd { margin-bottom: 6px; } }

/* Clinical problems */
.patient-problems {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid var(--outline);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-problems svg { width: 24px; height: 24px; flex: none; color: var(--line); }
.patient-problems b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--line); }
.problem h3 { margin: 0; font-size: 17px; }
.tile.problem-active { border-left: 6px solid var(--danger); }
.tile.problem-concern, .tile.problem-provisional { border-left: 6px solid var(--warn); }
.tile.problem-resolved, .tile.problem-inactive, .tile.problem-ruled_out, .tile.problem-entered_in_error { border-left: 6px solid var(--ink-soft); }
.trend-choice { display: flex; align-items: center; gap: 6px; border: 2px solid var(--outline); border-radius: 12px; padding: 6px 12px; }
.trend-choice.trend-worsening:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); }
.trend-choice:has(input:checked) { background: var(--tint); }
dd.overdue { color: var(--danger); font-weight: 700; }

/* Symptoms */
.patient-symptoms {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid var(--warn);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-symptoms svg { width: 24px; height: 24px; flex: none; color: var(--warn); }
.patient-symptoms b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--warn); }
.patient-symptoms.high { border-color: var(--danger); background: var(--danger-bg); }
.patient-symptoms.high svg, .patient-symptoms.high b { color: var(--danger); }
.symptom h3 { margin: 0; font-size: 17px; }
.tile.symptom-recorded, .tile.symptom-intervention { border-left: 6px solid var(--warn); }
.tile.symptom-severe { border-left: 6px solid var(--danger); }
.tile.symptom-closed, .tile.symptom-entered_in_error { border-left: 6px solid var(--ink-soft); }
.score-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.score-pill { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-pill.score-low { background: var(--ok-bg); color: var(--ok); }
.score-pill.score-mid { background: #fff3dc; color: #8a5a00; }
.score-pill.score-high { background: var(--danger-bg); color: var(--danger); }
.score-scale { border: 0; padding: 0; margin: 0; }
.score-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.score-choice { position: relative; display: grid; place-items: center; height: 40px; border: 2px solid var(--outline); border-radius: 10px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.score-choice input { position: absolute; opacity: 0; pointer-events: none; }
.score-choice:has(input:checked).score-low { background: var(--ok-bg); border-color: var(--ok); }
.score-choice:has(input:checked).score-mid { background: #fff3dc; border-color: #b35c00; }
.score-choice:has(input:checked).score-high { background: var(--danger-bg); border-color: var(--danger); }
.score-choice:has(input:focus-visible) { outline: 3px solid var(--line); outline-offset: 2px; }

/* Interventions */
.patient-interventions {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid var(--danger);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-interventions svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-interventions b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.intervention h3 { margin: 0; font-size: 17px; }
.tile.intervention-active { border-left: 6px solid var(--ok); }
.tile.intervention-awaiting_authorisation, .tile.intervention-considered { border-left: 6px solid var(--warn); }
.tile.intervention-due { border-left: 6px solid var(--danger); }
.tile.intervention-ceased, .tile.intervention-declined, .tile.intervention-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Treatment plans */
.treatment h3 { margin: 0; font-size: 17px; }
.treatment-options, .treatment-components { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.treatment-options li, .treatment-components li { background: var(--tint); border: 2px solid transparent; border-radius: 10px; padding: 6px 10px; }
.treatment-options li.chosen { border-color: var(--ok); }
.treatment-options li.proposed { border-color: var(--warn); }
.treatment-options .tag { margin-left: 8px; }
.tile.treatment-active { border-left: 6px solid var(--ok); }
.tile.treatment-draft, .tile.treatment-awaiting_agreement, .tile.treatment-agreed { border-left: 6px solid var(--warn); }
.tile.treatment-off { border-left: 6px solid var(--danger); }
.tile.treatment-completed, .tile.treatment-stopped, .tile.treatment-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Pathways */
.patient-pathways, .patient-checks, .patient-caredue, .patient-resistant, .patient-site, .patient-declined, .patient-identity {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border: 2px solid var(--danger);
  border-radius: 14px; padding: 8px 14px; text-align: left; width: 100%; font-size: 14px;
}
.patient-pathways svg, .patient-checks svg, .patient-caredue svg, .patient-resistant svg, .patient-site svg, .patient-declined svg, .patient-identity svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-pathways b, .patient-checks b, .patient-caredue b, .patient-resistant b, .patient-site b, .patient-declined b, .patient-identity b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.pathway h3 { margin: 0; font-size: 17px; }
.pathway-steps, .pathway-deviations { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pathway-steps li, .pathway-deviations li { background: var(--tint); border: 2px solid transparent; border-radius: 10px; padding: 6px 10px; }
.pathway-steps li.overdue { border-color: var(--danger); background: var(--danger-bg); }
.pathway-steps .row { gap: 6px; flex-wrap: nowrap; }
.pathway-question legend { font-size: 14px; }
.tile.pathway-active { border-left: 6px solid var(--ok); }
.tile.pathway-suggested { border-left: 6px solid var(--warn); }
.tile.pathway-overdue { border-left: 6px solid var(--danger); }
.tile.pathway-completed, .tile.pathway-exited, .tile.pathway-declined, .tile.pathway-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Checklists */
.checklist h3 { margin: 0; font-size: 17px; }
.checklist-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist-items li { background: var(--tint); border: 2px solid transparent; border-radius: 10px; padding: 6px 10px; }
.checklist-items li.exception { border-color: var(--danger); background: var(--danger-bg); }
.checklist-items .row { gap: 6px; flex-wrap: nowrap; }
.tile.checklist-in_progress { border-left: 6px solid var(--ok); }
.tile.checklist-required { border-left: 6px solid var(--warn); }
.tile.checklist-overdue, .tile.checklist-exception { border-left: 6px solid var(--danger); }
.tile.checklist-completed, .tile.checklist-cancelled, .tile.checklist-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Recommendations */
.recommendation h3 { margin: 0; font-size: 17px; }
.tile.recommendation-communicated, .tile.recommendation-recommended { border-left: 6px solid var(--warn); }
.tile.recommendation-accepted, .tile.recommendation-modified, .tile.recommendation-implemented { border-left: 6px solid var(--ok); }
.tile.recommendation-declined, .tile.recommendation-not_implemented, .tile.recommendation-overdue { border-left: 6px solid var(--danger); }
.tile.recommendation-reviewed, .tile.recommendation-withdrawn, .tile.recommendation-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Requirements */
.requirement h3 { margin: 0; font-size: 17px; }
.tile.requirement-pending { border-left: 6px solid var(--warn); }
.tile.requirement-assigned, .tile.requirement-actioned { border-left: 6px solid var(--ok); }
.tile.requirement-deferred, .tile.requirement-cancelled, .tile.requirement-closed, .tile.requirement-entered_in_error { border-left: 6px solid var(--ink-soft); }
.tile.requirement-overdue { border-left: 6px solid var(--danger); }

/* Care due */
.caredue h3 { margin: 0; font-size: 17px; }
.tile.caredue-upcoming, .tile.caredue-due { border-left: 6px solid var(--warn); }
.tile.caredue-overdue { border-left: 6px solid var(--danger); }
.tile.caredue-scheduled { border-left: 6px solid var(--ok); }
.tile.caredue-completed, .tile.caredue-ceased, .tile.caredue-entered_in_error { border-left: 6px solid var(--ink-soft); }

/* Recalls */
.recall h3 { margin: 0; font-size: 17px; }
.tile.recall-scheduled { border-left: 6px solid var(--ink-soft); }
.tile.recall-invited { border-left: 6px solid var(--warn); }
.tile.recall-booked { border-left: 6px solid var(--ok); }
.tile.recall-done, .tile.recall-exited, .tile.recall-entered_in_error { border-left: 6px solid var(--ink-soft); }
.tile.recall-did_not_attend, .tile.recall-overdue { border-left: 6px solid var(--danger); }

/* Follow-ups */
.followup h3 { margin: 0; font-size: 17px; }
.tile.followup-required, .tile.followup-completed { border-left: 6px solid var(--warn); }
.tile.followup-accepted, .tile.followup-arranged, .tile.followup-scheduled { border-left: 6px solid var(--ok); }
.tile.followup-closed, .tile.followup-cancelled, .tile.followup-entered_in_error { border-left: 6px solid var(--ink-soft); }
.tile.followup-declined, .tile.followup-overdue { border-left: 6px solid var(--danger); }

/* Surveillance */
.surv h3 { margin: 0; font-size: 17px; }
.surv-check { padding: 8px 10px; border-radius: 8px; background: var(--tint); }
.tile.surv-active { border-left: 6px solid var(--ok); }
.tile.surv-waiting { border-left: 6px solid var(--warn); }
.tile.surv-ended { border-left: 6px solid var(--ink-soft); }
.tile.surv-alert { border-left: 6px solid var(--danger); }

/* Screening */
.screen h3 { margin: 0; font-size: 17px; }
.tile.screen-active { border-left: 6px solid var(--ok); }
.tile.screen-waiting { border-left: 6px solid var(--warn); }
.tile.screen-ended { border-left: 6px solid var(--ink-soft); }
.tile.screen-alert { border-left: 6px solid var(--danger); }

/* Infections */
.inf h3 { margin: 0; font-size: 17px; }
.tile.inf-active { border-left: 6px solid var(--warn); }
.tile.inf-waiting { border-left: 6px solid var(--warn); }
.tile.inf-ended { border-left: 6px solid var(--ink-soft); }
.tile.inf-alert { border-left: 6px solid var(--danger); }

/* Antimicrobials */
.amc h3 { margin: 0; font-size: 17px; }
.tile.amc-active { border-left: 6px solid var(--ok); }
.tile.amc-waiting { border-left: 6px solid var(--warn); }
.tile.amc-ended { border-left: 6px solid var(--ink-soft); }
.tile.amc-alert { border-left: 6px solid var(--danger); }
.site h3 { margin: 0; font-size: 17px; }
.site-where { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.tile.site-card-active { border-left: 6px solid var(--ok); }
.tile.site-card-waiting { border-left: 6px solid var(--warn); }
.tile.site-card-ended { border-left: 6px solid var(--ink-soft); }
.tile.site-card-alert { border-left: 6px solid var(--danger); }
.site-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.site-check { padding-left: 22px; position: relative; }
.site-check::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.site-check.site-ok::before { content: '✓'; color: var(--ok); }
.site-check.site-bad::before { content: '✕'; color: var(--danger); }
.site-check.site-todo::before { content: '○'; color: var(--ink-soft); }
.rdy h3 { margin: 0; font-size: 17px; }
.tile.rdy-ready { border-left: 6px solid var(--ok); }
.tile.rdy-waiting { border-left: 6px solid var(--warn); }
.tile.rdy-ended { border-left: 6px solid var(--ink-soft); }
.tile.rdy-alert { border-left: 6px solid var(--danger); }
.rdy-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rdy-item { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.rdy-item > span { padding-left: 22px; position: relative; flex: 1 1 200px; }
.rdy-item > span::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.rdy-item.rdy-COMPLETED > span::before { content: '✓'; color: var(--ok); }
.rdy-item.rdy-NOT_APPLICABLE > span::before { content: '–'; color: var(--ink-soft); }
.rdy-item.rdy-OUTSTANDING > span::before { content: '○'; color: var(--ink-soft); }
.rdy-item.rdy-OUTSTANDING.rdy-essential > span::before { color: var(--warn); }
.rdy-conditions { border-left: 3px solid var(--warn); padding-left: 8px; }
.var h3 { margin: 0; font-size: 17px; }
.tile.var-waiting { border-left: 6px solid var(--warn); }
.tile.var-active { border-left: 6px solid var(--ok); }
.tile.var-ended { border-left: 6px solid var(--ink-soft); }
.tile.var-alert { border-left: 6px solid var(--danger); }
.var-pair { display: grid; grid-template-columns: minmax(80px, max-content) 1fr; gap: 2px 10px; font-size: 14px; margin: 0; }
.var-pair dt { font-weight: 700; color: var(--ink-soft); }
.var-pair dd { margin: 0; }
.dcl h3 { margin: 0; font-size: 17px; }
.tile.dcl-waiting { border-left: 6px solid var(--warn); }
.tile.dcl-ended { border-left: 6px solid var(--ink-soft); }
.tile.dcl-alert { border-left: 6px solid var(--danger); }
.tile.dcl-ok { border-left: 6px solid var(--ok); }
.pri h3 { margin: 0; font-size: 17px; }
.tile.pri-l0 { border-left: 6px solid var(--danger); }
.tile.pri-l1 { border-left: 6px solid var(--warn); }
.tile.pri-l2, .tile.pri-l3, .tile.pri-l4 { border-left: 6px solid var(--ok); }
.tile.pri-ended { border-left: 6px solid var(--ink-soft); }
.pri-level { font-size: 18px; font-weight: 700; }
.pri-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.pri-clock.late { color: var(--danger); }

/* Identity matching */
.idm h3 { margin: 0; font-size: 17px; }
.tile.idm-unresolved { border-left: 6px solid var(--danger); }
.tile.idm-confirmed, .tile.idm-new, .tile.idm-resolved { border-left: 6px solid var(--ok); }
.idm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.idm-cand { border-left: 6px solid var(--warn); }
.idm-cand.enough { border-left-color: var(--ok); }
.idm-differ { color: var(--danger); font-weight: 700; }
dialog.idm-dialog { max-height: 90vh; overflow-y: auto; }
.dup-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.dup-side.kept { border-left: 6px solid var(--ok); }
.dup-side.gone { opacity: .7; }
.tile.dup-possible { border-left: 6px solid var(--danger); }
.tile.dup-not_duplicate, .tile.dup-reconciled { border-left: 6px solid var(--ok); }
.screen-row.chosen { background: var(--paua-shade, #06083b); color: #fff; text-shadow: var(--paua-glow); padding-inline: 8px; border-radius: 8px; }

.patient-breakglass { flex-wrap: wrap; }
.patient-breakglass .grow { flex: 1 1 140px; min-width: 0; }
.patient-breakglass .btn { margin-left: 34px; }
.bg-activity { margin: 0; padding-left: 18px; }
.bg-reviewed { opacity: .92; }

.rule-facts { margin: 0; padding-left: 18px; }
.rule-book summary { font-weight: 700; cursor: pointer; }
.rule-book .rule { border-top: 1px solid var(--tint); padding-top: 8px; }

/* Downtime */
.downtime-banner { display: block; width: 100%; margin-top: 10px; text-align: left; font: inherit; font-weight: 700; cursor: pointer; }
.paper-entry { padding: 10px 12px; border: 2px dashed #d99a00; border-radius: 12px; background: var(--warn-bg); }
.paper-entry .row > .field { flex: 1 1 180px; }
.dt-people { list-style: none; padding: 0; margin: 0; }
.dt-people > li { padding: 8px 0; border-top: 1px solid var(--tint); gap: 8px; flex-wrap: wrap; }

/* Data reconciliation: what another provider lists, compared with the record. */
.rec { border-top: 1px solid var(--tint); padding-top: 8px; }
.rec-list { list-style: none; margin: 0; padding: 0; }
.rec-item { border-left: 4px solid #d98e04; padding: 6px 10px; background: var(--tint); border-radius: 6px; display: grid; gap: 4px; }
.rec-item.rec-decided { border-left-color: #2e7d4f; }
.rec-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rec-compare > div { background: var(--tint); border-radius: 6px; padding: 8px 10px; }

/* Isolation precautions: shown on the record to everyone who opens it. */
.patient-isolation { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid #b8860b; background: #fff6dd; color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-isolation svg { width: 24px; height: 24px; flex: none; color: #8a6200; }
.patient-isolation b { display: block; font-size: 13px; letter-spacing: .6px; color: #8a6200; }
.precaution.pc-required { border-left: 6px solid #c0392b; }
.precaution.pc-in_place { border-left: 6px solid #b8860b; }
.ob-people { list-style: none; margin: 0; padding: 0; }
.ob-people li { border-top: 1px solid var(--tint); padding-top: 6px; flex-wrap: wrap; gap: 8px; }

/* Allergy list: suspected entries wait for a nurse or doctor to check them. */
.allergy-entry { border-left: 4px solid var(--danger, #b3261e); }
.allergy-entry.al-suspected { border-left-color: var(--warn, #b7791f); }

/* A "no" or a withdrawn consent, shown to everyone who opens the record. */
.patient-consent { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--danger); background: var(--danger-bg); color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-consent svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-consent b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.consent { border-left: 4px solid var(--line, #cfd8dc); }
.consent.cs-consented { border-left-color: #2e7d32; }
.consent.cs-refused, .consent.cs-withdrawn { border-left-color: var(--danger); }

/* Palliative care and the last days of life, shown to everyone who opens the record. */
.patient-eol { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid #5b4a8a; background: #f1eefa; color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-eol svg { width: 24px; height: 24px; flex: none; color: #5b4a8a; }
.patient-eol b { display: block; font-size: 13px; letter-spacing: .6px; color: #5b4a8a; }
.patient-eol.last { border-width: 3px; }
.eol { border-left: 4px solid #5b4a8a; }

/* A safeguarding concern: everyone sees that there is one, never what it is. */
.patient-safeguard { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid #7a1f5c; background: #fbeef6; color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-safeguard svg { width: 24px; height: 24px; flex: none; color: #7a1f5c; }
.patient-safeguard b { display: block; font-size: 13px; letter-spacing: .6px; color: #7a1f5c; }
.safeguard { border-left: 4px solid #7a1f5c; }
.warn-text { color: var(--warn); }

/* A complaint: kept apart from the clinical record. */
.complaint { border-left: 4px solid #b5651d; }

/* Lines, tubes and catheters in place. */
.patient-devices { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid #1b6f7a; background: #eaf6f7; color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-devices svg { width: 24px; height: 24px; flex: none; color: #1b6f7a; }
.patient-devices b { display: block; font-size: 13px; letter-spacing: .6px; color: #1b6f7a; }
.patient-devices.warn { border-color: #b5651d; background: #fdf3e7; }
.patient-devices.warn b, .patient-devices.warn svg { color: #9a4f10; }
.device { border-left: 4px solid #1b6f7a; }

/* Handover of responsibility for a person. */
.person-handover { border-left: 4px solid #1b6f7a; }

/* MDT meetings and case conferences. */
.conference { border-left: 4px solid #5b4a8a; }
.conference-actions { margin: 0; padding-left: 1.2rem; }
.conference-action { gap: 2px; }

/* Rehab episode. */
.rehab { border-left: 4px solid #2f7d4f; }
.rehab-goals { margin: 0; padding-left: 0; list-style: none; gap: 4px; }

/* Tests and results. */
.test-order { border-left: 4px solid #3a6ea5; }
.flag-C { color: var(--danger); font-weight: 900; }
tr.critical-row td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
tr.corrected td { text-decoration: line-through; opacity: 0.7; }
tr.corrected td:last-child, tr.corrected td:nth-child(5) { text-decoration: none; }
.patient-critical { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, #fff); color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-critical svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-critical b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.patient-procedure { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--warn); background: var(--warn-bg); color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-procedure svg { width: 24px; height: 24px; flex: none; color: var(--warn); }
.patient-procedure b { display: block; font-size: 13px; letter-spacing: .6px; }
.procedure { border-left: 4px solid var(--outline); }
.decision { border-left: 4px solid var(--ink-soft); }
.poisoning { border-left: 4px solid var(--danger); }
.trauma { border-left: 4px solid var(--danger); }
.trauma .survey { border-left: 3px solid var(--outline); padding-left: 8px; }
.trauma dl.abcde { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0 0; }
.trauma dl.abcde dt { font-weight: 600; color: var(--ink-soft); }
.trauma dl.abcde dd { margin: 0; }
.trauma ul.injuries { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 520px) { .trauma dl.abcde { grid-template-columns: 1fr; } .trauma dl.abcde dd { margin-bottom: 4px; } }
.patient-trauma { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--danger); background: var(--danger-bg); color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-trauma svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-trauma b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.poisoning .advice { border-left: 3px solid var(--outline); padding-left: 8px; }
.poisoning ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.poisoning ul.checks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; border: 1px solid var(--tint); border-radius: 10px; padding: 6px 10px; }
.poisoning ul.checks li.overdue { border-color: var(--warn); background: var(--warn-bg); }
.poisoning ul.checks li.done { opacity: .75; }
.patient-poison { display: flex; gap: 10px; align-items: center; text-align: left; border: 2px solid var(--danger); background: var(--card); color: var(--ink); border-radius: 14px; padding: 8px 14px; width: 100%; font-size: 14px; }
.patient-poison.overdue { background: var(--danger-bg); }
.patient-poison svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-poison b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.decision-chosen { border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 12px; padding: 8px 12px; }
.decision-chosen > b { color: var(--ok); }
tr.chosen td { background: var(--ok-bg); }
.feed { border-left: 4px solid #1f8a5b; }
.feed.blocked { border-left-color: var(--danger); }
.feed dl.feed-plan { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
.feed dl.feed-plan dt { font-weight: 600; color: var(--ink-soft); }
.feed dl.feed-plan dd { margin: 0; }
.feed ul.feed-given { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 520px) { .feed dl.feed-plan { grid-template-columns: 1fr; } .feed dl.feed-plan dd { margin-bottom: 4px; } }
.patient-feed { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #1f8a5b, #146343); color: #fff; border-radius: 14px; padding: 8px 14px; border: 0; text-align: left; width: 100%; font-size: 14px; }
.patient-feed.blocked { background: var(--danger-bg); color: var(--ink); border: 2px solid var(--danger); }
.patient-feed.blocked b, .patient-feed.blocked svg { color: var(--danger); }
.patient-feed svg { width: 26px; height: 26px; flex: none; }
.patient-feed b { display: block; font-size: 13px; letter-spacing: .6px; }
.safety-notice ul.notice-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.safety-notice ul.notice-items li { border-top: 1px solid var(--outline); padding-top: 6px; }

/* Safe staffing */
.staffing-shift .staff-role + .staff-role { border-top: 1px solid var(--outline); padding-top: 8px; }
.staffing-shift .staff-person { justify-content: space-between; flex-wrap: wrap; }
table.staffing-week td.short { color: var(--danger, #b3261e); font-weight: 600; }

/* Major incident */
.patient-major { display: flex; gap: 10px; align-items: center; border: 2px solid var(--danger); background: var(--danger-bg); color: var(--ink); border-radius: 14px; padding: 8px 14px; font-size: 14px; }
.patient-major svg { width: 24px; height: 24px; flex: none; color: var(--danger); }
.patient-major b { display: block; font-size: 13px; letter-spacing: .6px; color: var(--danger); }
.major-incident { border: 2px solid var(--danger); }
.major-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.prio-immediate { background: var(--danger); color: #fff; }
.prio-urgent { background: var(--warn-bg, #fff4d6); color: var(--ink); border: 1px solid var(--warn, #b26a00); }
.prio-delayed { background: var(--ok-bg); color: var(--ink); border: 1px solid var(--ok); }
.prio-dead { background: var(--ink); color: #fff; }

/* Withdrawal */
.withdrawal { border-left: 4px solid var(--warn); }
.withdrawal .advice { border-left: 3px solid var(--outline); padding-left: 8px; }
.withdrawal ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.withdrawal ul.checks li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; border: 1px solid var(--tint); border-radius: 10px; padding: 6px 10px; }
.withdrawal ul.checks li.overdue { border-color: var(--warn); background: var(--warn-bg); }
.withdrawal ul.checks li.done { opacity: .75; }

/* No bed found */
.no-bed { border-left: 4px solid var(--warn); padding-left: 8px; }
.tile.observation { border-left: 6px solid var(--accent, var(--ink)); }
.tile.observation.overdue { border-left-color: var(--danger); background: var(--danger-bg); }
.tile.privacy.overdue { border-left: 6px solid var(--danger); }
.tile.hold { border-left: 6px solid var(--warn); }

/* Home: one line of function tabs (down the left on a larger screen, along the top on a phone) and four pāua squares. */
.grid-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.home-tabs { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 8px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 2px; }
.home-tabs .dest { justify-content: flex-start; text-align: left; position: relative; }
.home-tabs .slider-count { margin-left: auto; }
.add-tab { border-style: dashed; }
.add-plus { width: 24px; height: 24px; flex: none; display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--line); }
@media (max-width: 760px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .home-tabs { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: none; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .home-tabs .dest { flex: none; white-space: nowrap; padding: 8px 12px; font-size: 13px; scroll-snap-align: start; }
  .home-tabs .dest svg { width: 20px; height: 20px; }
}
.slider-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); flex: none; }
.slider-icon svg { width: 20px; height: 20px; }
.slider-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--paua-tile); color: #fff; text-shadow: var(--paua-glow);
}
.add-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border, #0001); }
.add-text { flex: 1; min-width: 0; }

/* Nine pāua squares, three by three, filling a laptop screen, then Patient Records full width beneath them.
   A phone shows the first four, two by two. */
@media (min-width: 761px) {
  .home-screen { display: flex; flex-direction: column; height: calc(100svh - 44px - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 560px; }
  .home-screen > .home-layout { flex: 1; min-height: 0; align-items: stretch; }
  .home-screen .home-tabs { max-height: none; min-height: 0; position: static; }
  .home-screen .home-main { min-height: 0; }
  .home-screen .grid-cards.four { flex: 1; min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .home-screen .home-card { min-height: 0; overflow: hidden; }
  .home-tabs .phone-only { display: none; }
}
.home-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.records-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; border-radius: var(--radius);
  background: var(--paua-shade); color: #fff; text-shadow: var(--paua-glow); font-weight: 800; font-size: 18px; }
.records-btn svg { width: 24px; height: 24px; }
.records-btn:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* On a phone Home fits the screen: header, one tab row, the squares and Patient Records sit between the top and the
   bottom navigation. It uses the small viewport height, so Safari's toolbar growing or shrinking moves nothing. */
html, body { overflow-x: hidden; overflow-x: clip; }
@media (max-width: 760px) {
  .home-screen { display: flex; flex-direction: column; height: calc(100svh - 44px - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 400px; }
  .home-screen > .home-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch; }
  .home-screen .home-tabs { flex: none; position: static; }
  .home-screen .home-main { flex: 1; min-height: 0; gap: 10px; }
  .home-screen .grid-cards.four { flex: 1; min-height: 0; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .home-screen .home-card { min-height: 0; overflow: hidden; padding: 12px; }
  .home-screen .home-card p { display: none; }
  .home-screen .grid-cards.four > :nth-child(n+5) { display: none; }
  .home-screen .records-btn { flex: none; }
}

/* Each Home square, PERSONAL square and the PERSONAL / WORK choice is pāua across its whole surface,
   with light text and icons that stay readable. */
@media (min-width: 761px) { .grid-cards.personal-squares { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .personal-squares .home-card { min-height: 0; aspect-ratio: 4 / 3; padding: 12px; } .personal-squares .home-card p { display: none; } }
.entry .choice.paua-square { background: var(--paua-shade); border: 0; border-radius: var(--radius); color: #fff; text-shadow: var(--paua-glow); }
.entry .choice.paua-square h2 { color: #fff; }
.entry .choice.paua-square p { color: #fff; text-shadow: var(--paua-glow); font-weight: 700; }
.entry .choice.paua-square:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.home-card.paua-square { background: var(--paua-shade); border: 0; color: #fff; text-shadow: var(--paua-glow); }
.home-card.paua-square h2 { background: none; color: #fff; -webkit-background-clip: border-box; background-clip: border-box; }
.home-card.paua-square p { color: #fff; text-shadow: var(--paua-glow); font-weight: 700; }
.home-card.paua-square .icon-tile { background: #06083b8c; color: #fff; border: 1px solid #ffffff59; }
.home-card.paua-square .count { background: #fff; color: #06083b; text-shadow: none; }
.home-card.paua-square:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

/* Connection status: a small pill when all is well, a full-width bar when it is not. */
.conn { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 30; display: flex; justify-content: flex-end; pointer-events: none; }
.conn[hidden] { display: none; }
.conn-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; margin: 6px 8px; padding: 4px 12px; min-height: 32px; border-radius: 999px; border: 1px solid var(--outline); background: var(--surface, #fff); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e8b57; flex: none; }
.conn.degraded .conn-dot, .conn.reconnecting .conn-dot { background: #d9a200; }
.conn.offline .conn-dot { background: #c0392b; }
.conn.degraded, .conn.offline, .conn.reconnecting { justify-content: stretch; }
.conn.degraded .conn-pill, .conn.offline .conn-pill, .conn.reconnecting .conn-pill { flex: 1; margin: 0; border-radius: 0; border-width: 0 0 2px; padding: 8px 14px; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
.conn.degraded .conn-pill, .conn.reconnecting .conn-pill { background: var(--warn-bg); border-color: #f0cf7a; }
.conn.offline .conn-pill { background: var(--danger-bg); border-color: #f0a3b0; }
.conn-note { font-size: 14px; }
#app { padding-top: calc(44px + env(safe-area-inset-top)); }
.drop-over { outline: 3px dashed var(--line); outline-offset: 2px; }
.drop-slot { display: flex; align-items: center; justify-content: center; text-align: center; border: 2px dashed var(--outline); color: var(--ink-soft); background: var(--tint); min-height: 120px; }
@media (max-width: 760px) { .drop-slot { display: none; } }
input.recap-date { width: auto; }
.fhir-json { max-height: 60vh; overflow: auto; background: var(--tint); padding: 12px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* Night: SHIFT follows the device's own dark setting. The same tokens, darker; fixed light fills are dimmed to match. */
/* Dark: set by display.js from the Display choice, or the device's own setting. */
  html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #dff8f2;
    --ink-soft: #c6c4cf;
    --line: var(--ink);
    --outline: #02e1d4;
    --bg: #06083b;
    --card: #0b1450;
    --tint: #04286a;
    --edge: #096695;
    --edge-soft: #0a2a6a;
    --danger: #ff8597;
    --danger-bg: #3a1219;
    --warn: #f2c25c;
    --warn-bg: #33270b;
    --ok: #6fd6a8;
    --ok-bg: #0f3324;
    /* Shell lettering, lightened so it reads on the dark cards. */
    --paua-ink: linear-gradient(#ffffffa6, #ffffffa6), url("paua.jpg") center / 440px auto repeat #dff8f2;
  }
  /* Light teal and light ink fills take dark lettering at night. */
  html[data-theme="dark"] .quick-add, html[data-theme="dark"] .btn.primary, html[data-theme="dark"] .toggle[aria-pressed=true], html[data-theme="dark"] .prio-immediate, html[data-theme="dark"] .prio-dead, html[data-theme="dark"] .toast, html[data-theme="dark"] .patient-death, html[data-theme="dark"] .slider-count, html[data-theme="dark"] .patient-deterioration:not(.det-responding):not(.det-reassessed) { color: var(--bg); }
  html[data-theme="dark"] .tag.muted, html[data-theme="dark"] .steps li { color: var(--ink); }
  html[data-theme="dark"] .bottom-nav { background: #06083bee; }
  html[data-theme="dark"] .conn-pill { background: var(--card); }
  html[data-theme="dark"] .command, html[data-theme="dark"] .req, html[data-theme="dark"] .bed-cell.bed-cleaning, html[data-theme="dark"] .tag.muted, html[data-theme="dark"] .steps li { background: var(--tint); }
  html[data-theme="dark"] .meal.missing, html[data-theme="dark"] .score-pill.score-mid, html[data-theme="dark"] .score-choice:has(input:checked).score-mid, html[data-theme="dark"] .patient-isolation { background: var(--warn-bg); color: var(--ink); }
  html[data-theme="dark"] .meal.concern { background: var(--danger-bg); }
  html[data-theme="dark"] .patient-eol, html[data-theme="dark"] .patient-safeguard, html[data-theme="dark"] .patient-devices, html[data-theme="dark"] .patient-devices.warn { background: var(--tint); }
  html[data-theme="dark"] table.data th, html[data-theme="dark"] table.data td { border-bottom-color: var(--edge); }
  html[data-theme="dark"] .inc-action { border-top-color: var(--edge); }
  html[data-theme="dark"] .dest-group { color: var(--line); }
  html[data-theme="dark"] .team-line .team-gap { color: var(--danger); }
  /* Each banner keeps its own colour, lighter so it reads on the dark card. */
  html[data-theme="dark"] .patient-whanau b, html[data-theme="dark"] .patient-whanau svg, html[data-theme="dark"] .patient-function b, html[data-theme="dark"] .patient-function svg { color: #7fd6a6; }
  html[data-theme="dark"] .patient-external b, html[data-theme="dark"] .patient-external svg, html[data-theme="dark"] .patient-eol b, html[data-theme="dark"] .patient-eol svg { color: #c4b5f2; }
  html[data-theme="dark"] .patient-access b, html[data-theme="dark"] .patient-access svg { color: #8cc8f2; }
  html[data-theme="dark"] .patient-capacity b, html[data-theme="dark"] .patient-capacity svg, html[data-theme="dark"] .patient-isolation b, html[data-theme="dark"] .patient-isolation svg { color: var(--warn); }
  html[data-theme="dark"] .patient-pref b, html[data-theme="dark"] .patient-pref svg { color: #f2a0c8; }
  html[data-theme="dark"] .patient-safeguard b, html[data-theme="dark"] .patient-safeguard svg { color: #eaa0d2; }
  html[data-theme="dark"] .patient-instrument b, html[data-theme="dark"] .patient-instrument svg { color: var(--danger); }
  html[data-theme="dark"] .patient-usual b, html[data-theme="dark"] .patient-usual svg { color: #f5b26b; }
  html[data-theme="dark"] .patient-devices b, html[data-theme="dark"] .patient-devices svg { color: var(--line); }
  html[data-theme="dark"] .patient-devices.warn b, html[data-theme="dark"] .patient-devices.warn svg { color: #f5b26b; }
  html[data-theme="dark"] .patient-critical { background: var(--danger-bg); }

.quiet-flags { display: grid; gap: 6px; }
.quiet-flags > summary { cursor: pointer; font-weight: 700; color: var(--line); padding: 6px 2px; }
.header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Print: the content only, in black on white, with who printed it at the foot. */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  body, #app { background: #fff !important; color: #000 !important; padding: 0 !important; }
  .bottom-nav, .conn, #toast, button, .header-actions, .tab-strip, .quick-picks, input, select, textarea, dialog, .drop-slot, .dest-group, .logo { display: none !important; }
  .paua, .live-title, .section-title, .tag.paua, .home-card.paua-square, .steps li.now { background: none !important; color: #000 !important; text-shadow: none !important; }
  .card, .tile, .banner, [class^="patient-"], .header-card { background: #fff !important; color: #000 !important; border: 1px solid #999 !important; box-shadow: none !important; break-inside: avoid; }
  .header-card { border-image: none !important; }
  .dest span, .pill, .home-card h2, .list-item h2, .list-item h3 { background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: none; }
  details > summary { list-style: none; font-weight: 700; }
  .no-print { display: none !important; }
  .print-only { display: block; margin-top: 12mm; padding-top: 3mm; border-top: 1px solid #999; font-size: 9pt; color: #333; }
}
.wristband-result { border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; font-size: 16px; border: 3px solid; }
.wristband-result b { font-size: 20px; }
.wristband-result.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.wristband-result.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.wristband-result.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.scan-video { width: 100%; max-height: 240px; border-radius: 12px; background: #000; }
/* Safety huddle: one line per recorded safety item, coloured by how urgent it is. */
.huddle-lines { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.huddle-lines li.huddle-danger { color: var(--danger); font-weight: 600; }
.huddle-lines li.huddle-warn { color: var(--warn); }
.pre-wrap { white-space: pre-wrap; }
/* Medicines letter: large, plain lines that print well. */
.letter-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 12px; }
.letter-list li { border-left: 4px solid var(--line, #cfd8dc); padding-left: 12px; font-size: 17px; }
.letter-list .tag { margin-left: 8px; }

/* Display (client/lib/display.js): larger text scales the whole screen so nothing overlaps; high contrast keeps
   the same layout with plainer surfaces, darker lettering and firmer edges, in light and dark. */
html[data-text="large"] body { zoom: 1.15; }
html[data-text="larger"] body { zoom: 1.3; }
html[data-contrast="high"] {
  --ink: #000;
  --ink-soft: #1f2a30;
  --line: #00454f;
  --bg: #fff;
  --card: #fff;
  --tint: #eef6f8;
  --edge: #000;
  --edge-soft: #444;
  --danger: #8c0019;
  --danger-bg: #fff0f2;
  --warn: #5a3900;
  --warn-bg: #fff6dc;
  --ok: #00502f;
  --ok-bg: #eafaf2;
  --paua: #06083b;
  --paua-shade: #06083b;
  --paua-tile: #06083b;
  --paua-ink: #06083b;
  --paua-glow: none;
}
html[data-contrast="high"] .tile, html[data-contrast="high"] .card, html[data-contrast="high"] input, html[data-contrast="high"] select, html[data-contrast="high"] textarea { border-color: var(--edge); }
html[data-contrast="high"] .muted, html[data-contrast="high"] .small.muted { color: var(--ink-soft); }
html[data-contrast="high"] { --outline: var(--ink); }
/* Dark: set by display.js from the Display choice, or the device's own setting. */
  html[data-theme="dark"][data-contrast="high"] {
    --ink: #fff;
    --ink-soft: #e2ecef;
    --line: var(--ink);
    --bg: #000;
    --card: #000;
    --tint: #04286a;
    --edge: #fff;
    --edge-soft: #bbb;
    --danger: #ffadb9;
    --danger-bg: #2a0008;
    --warn: #ffd98a;
    --warn-bg: #241900;
    --ok: #9cf0c8;
    --ok-bg: #002414;
    --paua: #04286a;
    --paua-shade: #04286a;
    --paua-tile: #04286a;
    --paua-ink: #ffffff;
  }
  html[data-theme="dark"][data-contrast="high"] .bottom-nav { background: #000; }


/* The practice version's band (app.js) and the sign-in promise (entry.js). */
.practice-band { background: var(--warn-bg); color: var(--warn); border-bottom: 3px solid var(--warn); padding: 8px 16px; text-align: center; font-size: 15px; }
.practice-band b { letter-spacing: .5px; margin-right: 6px; }
/* On a phone the connection badge sits over the band's right end, so the band's words stop short of it. */
@media (max-width: 760px) { .practice-band { text-align: left; padding-right: 116px; } }
.practice-promise { border: 2px solid var(--warn); border-radius: 12px; padding: 10px 12px; background: var(--warn-bg); }
/* My shift: the most pressing items carry a coloured edge. */
.my-shift { list-style: none; margin: 0; padding: 0; }
.my-shift .shift-danger { border-left: 6px solid var(--danger); }
.my-shift .shift-warn { border-left: 6px solid var(--warn); }
/* Obs round: the fields two across on a phone, more on a wider screen. */
.rounds-fields { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Trends: measurements over time, drawn in the text colour so Display settings carry through. */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.trend { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.trend-chart { width: 100%; height: auto; color: var(--line); display: block; }
.trend-chart text { fill: var(--ink-soft); }
.trend-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.trend-table th, .trend-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--edge-soft); }

/* NZEWS: the chart's own colours (HQSC user guide 2017, table 2), always with the zone named in words. */
.nzews-band { border-radius: 12px; padding: 10px 14px; border: 2px solid var(--ink); color: #0d2a3a; }
.nzews-zone { display: inline-block; padding: 1px 8px; border-radius: 8px; border: 1px solid #0d2a3a55; color: #0d2a3a; }
.nzews-yellow { background: #ffff99; }
.nzews-orange { background: #ffe0ba; }
.nzews-red { background: #ffc0d8; }
.nzews-blue { background: #d1e8ff; }
.nzews-white, .nzews-none { background: var(--card); color: var(--ink); }
.nzews-off_chart, .nzews-not_on_chart { background: var(--warn-bg); }
.nzews-check { align-items: center; align-self: flex-end; gap: 8px; min-height: 48px; font-weight: 600; }
.nzews-check input { width: 22px; height: 22px; }

/* I'm worried: always there in the header, quiet until pressed. */
.patient-worry { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 10px 14px; border-radius: 14px;
  border: 2px dashed var(--outline); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.patient-worry svg { width: 24px; height: 24px; flex: none; }
.patient-worry b { display: block; font-size: 13px; letter-spacing: .6px; }

/* Quicker on a phone: one-tap answers, a jump to the entry box, and a filter that hides list items. */
.choice-taps { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.choice-tap { border: 2px solid var(--edge); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.choice-tap[aria-pressed="true"] { background: var(--paua-tile); border-color: var(--outline); color: #fff; text-shadow: var(--paua-glow); font-weight: 800; }
.quick-add { display: none; }
@media (max-width: 760px) {
  .quick-add { display: block; position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20; border: 0; border-radius: 999px; padding: 14px 20px;
    background: var(--paua-tile); color: #fff; text-shadow: var(--paua-glow); font: inherit; font-weight: 800; box-shadow: 0 4px 14px #0004; cursor: pointer; }
}
.list-item[hidden], .quick-add[hidden] { display: none; }

/* Guided first shift (practice website only). */
.guide-btn { position: fixed; left: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20; border: 2px solid var(--outline); background: var(--card); color: var(--line);
  border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 700; box-shadow: 0 4px 14px #0003; cursor: pointer; }
.guide-btn[hidden], .guide-panel[hidden] { display: none; }
.guide-panel { position: fixed; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 25; max-height: 70vh; overflow: auto; max-width: 520px; box-shadow: 0 8px 30px #0005; }
.guide-panel h2 { margin: 0; font-size: 20px; }
.guide-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.guide-steps li.done b { text-decoration: line-through; color: var(--ink-soft); }
.guide-tick { display: flex; gap: 8px; align-items: center; }
.guide-tick input { width: 22px; height: 22px; flex: none; }
@media print { .guide-btn, .guide-panel { display: none !important; } }

/* Blood pressure: systolic / diastolic as two number boxes, side by side. */
.bp-input { display: inline-flex; align-items: center; gap: 6px; }
.bp-input input.bp-part { width: 4.2em; min-width: 0; text-align: center; }
.bp-slash { font-size: 22px; font-weight: 700; color: var(--ink-soft); }

/* GP requests: ISBAR as a short labelled list. */
.isbar { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.isbar dt { font-weight: 800; color: var(--line); }
.isbar dd { margin: 0; }
.isbar-list { margin: 0; padding-left: 18px; }
.gp-request.gp-sent { border-left: 6px solid var(--danger); }
.gp-request.gp-seen { border-left: 6px solid var(--warn); }
.gp-request.gp-responded { border-left: 6px solid var(--ok); }
.gp-notes { margin: 0; padding-left: 18px; }

/* Screen watermark (client/lib/watermark.js), when the organisation turns it on: over the screen and any open dialog,
   letting every touch through, and printed with the page. */
html.wm body::after { content: ''; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; background-image: var(--wm); background-repeat: repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
html.wm dialog[open] { background-image: var(--wm); background-repeat: repeat; }
/* People who need high contrast see no watermark. */
html.wm[data-contrast="high"] body::after { display: none; }
html.wm[data-contrast="high"] dialog[open] { background-image: none; }
@media (forced-colors: active) { html.wm body::after { display: none; } html.wm dialog[open] { background-image: none; } }

/* SHIFT's fern at the right end of the My patients bar, silver on the shell: decoration only, not read by screen readers. */
.records-btn { position: relative; overflow: hidden; }
.records-btn::after { content: ''; position: absolute; right: 2px; top: 50%; width: 92px; height: 104px; transform: translateY(-50%); pointer-events: none;
  background: url("fern-dark.webp") center / contain no-repeat; }
@media (forced-colors: active) { .records-btn::after { display: none; } body { background-image: none; } }


/* Words on the pāua are bold; pāua-coloured lettering is heavier too, so both read easily. */
.paua, .paua-square, .records-btn, .bottom-nav button.active, .dest.active, .tag.paua, .steps li.now, .screen-row.chosen { font-weight: 800; }
.dest span, .home-card h2, .list-item h2, .list-item h3 { font-weight: 800; }

/* Boxes are outlined in pāua, like the header frame: a thin ring of the shell laid over each box's own border, so the box
   keeps its fill. Boxes whose border carries a safety colour (danger, warning, ok) keep that border and get no ring. */
:where(.card:not(.header-card):not(.patient-header), .list-item, .btn:not(.primary):not(.danger), .back, .pill, .dest:not(.active):not(.add-tab),
  .bottom-nav button:not(.active), .patient-problems, .keyform, .trend-choice) { position: relative; }
:where(.card:not(.header-card):not(.patient-header), .list-item, .btn:not(.primary):not(.danger), .back, .pill, .dest:not(.active):not(.add-tab),
  .bottom-nav button:not(.active), .patient-problems, .keyform, .trend-choice)::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: var(--paua-tile); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
:is(.acuity-choice.acuity-critical:has(input:checked), .acuity-choice.acuity-unwell:has(input:checked), .alloc-heavy, .bed-available, .bed-cleaning, .btn.danger, .card.urgent, .checklist-items li.exception, .consent.cs-refused, .consent.cs-withdrawn, .decision-chosen, .dup-side.kept, .entry-item.urgent, .esc-immediate, .feed.blocked, .gp-request.gp-responded, .gp-request.gp-seen, .gp-request.gp-sent, .idm-cand, .idm-cand.enough, .major-incident, .my-shift .shift-danger, .my-shift .shift-warn, .no-bed, .paper-entry, .pathway-steps li.overdue, .patient-acuity, .patient-acuity.acuity-critical, .patient-acuity.acuity-unwell, .patient-acuity.acuity-watch, .patient-caredue, .patient-checks, .patient-consent, .patient-critical, .patient-declined, .patient-deterioration, .patient-feed.blocked, .patient-identity, .patient-interventions, .patient-major, .patient-pathways, .patient-poison, .patient-procedure, .patient-resistant, .patient-site, .patient-symptoms, .patient-symptoms.high, .patient-trauma, .poisoning, .poisoning ul.checks li.overdue, .practice-band, .practice-promise, .prio-delayed, .rdy-conditions, .score-choice:has(input:checked).score-high, .score-choice:has(input:checked).score-low, .toggle.urgent[aria-pressed=true], .trauma, .treatment-options li.chosen, .treatment-options li.proposed, .trend-choice.trend-worsening:has(input:checked), .withdrawal, .withdrawal ul.checks li.overdue, .wristband-result.danger, .wristband-result.ok, .wristband-result.warn, .patient-consent)::before { display: none !important; }
/* Boxes that scroll or sit above the page take the ring as their own border instead. */
.live, .table-wrap { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--paua-tile) border-box; }
html[data-contrast="high"] :where(.card, .list-item, .btn, .back, .pill, .dest, .bottom-nav button, .patient-problems, .keyform, .trend-choice)::before { display: none; }
html[data-contrast="high"] :is(.live, .table-wrap) { border-color: var(--outline); background: var(--card); }
@media (forced-colors: active) { :where(.card, .list-item, .btn, .back, .pill, .dest, .bottom-nav button, .patient-problems, .keyform, .trend-choice)::before { display: none; } }
/* On the pāua, words stay white in dark mode too. */
html[data-theme="dark"] :is(.btn.primary, .toggle[aria-pressed=true], .choice-tap[aria-pressed="true"], .quick-add, .slider-count) { color: #fff; }
