/* Ospeli app shell. Brand kit v3.1 tokens; Nunito self-hosted for offline use.
   Colour use keeps text contrast at 4.5:1 or better: navy text on sand or white,
   white text only on navy. Sea, mango, coral and seafoam are fills and accents. */
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-style: normal; font-display: swap; src: url('fonts/nunito-latin-800-normal.woff2') format('woff2'); }

:root {
  /* Issue #159: "only light" stops a phone browser repainting the app dark by itself. A designed dark theme comes with the settings menu (#160). */
  color-scheme: only light;
  --navy: #0B2F4E;
  --sea: #0A9396;
  --sea-ink: #076467;   /* sea darkened for text and links on light backgrounds (6.6:1 on white) */
  --mango: #EE9B00;
  --coral: #E0583E;
  --seafoam: #94D2BD;
  --sand: #F6F1E7;
  --surface: #FFFFFF;
  --ink: #0B2F4E;
  --ink-soft: #44607A;
  --line: #E2DACB;
  --line-strong: #CFC5B2;
  --wash: #E6F3EF;
  --mango-tint: #FDF0D9; /* mango at about 15% on white, for notices (issue #62) */
  --danger: #B3261E;
  --radius: 12px;
  --font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --top: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; min-height: 100vh; overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--sea-ink); font-weight: 700; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 8px; }

/* top bar (navigation v2): the department chip, the date and time, search; the site name and the
   data badge sit on a slim second row that holds no control (messages show over it, issue #37). */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
.dept-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; min-width: 0; padding: 8px 14px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; flex: 0 1 auto; }
.dept-chip #dept-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-caret { flex: none; font-size: 1rem; }
.top-time { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; color: var(--ink-soft); font-weight: 700; font-size: .9375rem; }
.top-search { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--navy); font-weight: 800; font-size: .9375rem; text-decoration: none; margin-left: auto; flex: none; }
.top-search:hover { background: var(--wash); }
.hospital { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.hospital-name[hidden] { display: none; }
.hospital-name { font-weight: 700; color: var(--ink-soft); font-size: .92rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.badge-synthetic { color: var(--navy); background: #FDF1D9; border-color: var(--mango); }
.badge-warn { color: var(--navy); background: #FBE3DD; border-color: var(--coral); }
.badge-synthetic::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mango); }
.role select, .field select, .field input, .field textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 8px 10px; min-height: 44px; }

/* layout: on a phone the page with the dock floating over its foot; from 900 px a left rail. */
:root { --dock: 96px; --ribbon: 0px; }
/* --ribbon is the walk ribbon's height and gap while a walk runs (modules/ribbon.js measures it). */
html { scroll-padding-bottom: calc(var(--dock) + var(--ribbon) + 8px); }
.layout { display: block; min-height: calc(100vh - var(--top)); }
/* The dock: a rounded white bar, 68 px tall, 12 px from the screen edges, with five places in words.
   The chosen place has a short navy bar above its word. Walk is a raised navy square with the symbol. */
.dock { position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  height: 68px; display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: stretch; gap: 2px; padding: 0 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 6px 20px rgba(11, 47, 78, .14); }
.dock a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 44px;
  color: var(--ink-soft); font-weight: 800; font-size: .9375rem; text-decoration: none; border-radius: 16px; }
.dock a:hover { color: var(--navy); }
.dock a[aria-current] { color: var(--navy); }
.dock a[aria-current]:not(.dock-walk)::before { content: ""; position: absolute; top: 12px; width: 24px; height: 4px; border-radius: 2px; background: var(--navy); }
.dock a:not(.dock-walk) .dock-word { margin-top: 10px; }
.dock .dock-walk { width: 76px; height: 76px; margin-top: -16px; background: var(--navy); color: #fff; border-radius: 22px; box-shadow: 0 6px 16px rgba(11, 47, 78, .3); gap: 0; }
.dock .dock-walk:hover, .dock .dock-walk[aria-current] { color: #fff; }
.dock .dock-walk[aria-current] { outline: 3px solid var(--seafoam); outline-offset: 2px; }
.dock .dock-walk img { display: block; width: 34px; height: 34px; }
.dock a:focus-visible, .dept-chip:focus-visible, .top-search:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.nav-count { flex: none; min-width: 24px; padding: 2px 7px; border-radius: 999px; background: var(--mango); color: var(--navy); font-size: .9375rem; font-weight: 800; text-align: center; line-height: 1.3; }
.dock .nav-count { position: absolute; top: 4px; right: 4px; }
.soon-tag { white-space: nowrap; flex: none; font-size: .9375rem; font-weight: 700; color: var(--ink-soft); }
/* The department sheet: a sheet from the foot of the screen on a phone, a centred box on wide screens. */
.sheet { border: 0; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; color: var(--ink); background: var(--surface);
  border-radius: 20px 20px 0 0; margin: auto auto 0; }
.sheet::backdrop { background: rgba(11, 47, 78, .5); }
.sheet h2 { font-size: 1.3rem; }
.dept-list { display: grid; gap: 8px; margin: 12px 0; }
.dept-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center; text-align: left; min-height: 56px; padding: 8px 14px; border: 1.5px solid var(--line-strong);
  border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.dept-opt:hover { background: var(--wash); }
.dept-opt.is-on { border-color: var(--navy); border-width: 2.5px; }
.dept-opt-name { font-weight: 800; font-size: 1.0625rem; grid-column: 1; }
.dept-opt-hint { grid-column: 1; color: var(--ink-soft); font-size: .9375rem; }
.dept-opt-on { grid-column: 2; grid-row: 1 / span 2; font-weight: 800; font-size: .9375rem; color: #fff; background: var(--navy); border-radius: 999px; padding: 2px 10px; }
/* A first open (#187 item 1): "Walk a visit now" beside each department goes straight to Before you walk. */
.dept-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; align-items: stretch; }
.dept-walk { min-height: 56px; padding: 6px 10px; border: 2px solid var(--navy); border-radius: 14px; background: var(--wash); color: var(--navy);
  font: inherit; font-weight: 800; font-size: .9375rem; line-height: 1.2; cursor: pointer; }
.dept-walk:hover { background: var(--seafoam); }
.dept-walk:focus-visible, .dept-opt:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
/* Journey: the spine of stages, each with a coloured marker and its name in words, and its pages as chips. */
.journey { display: grid; gap: 16px; max-width: 720px; }
.j-search { font: inherit; width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); }
.j-spine { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.j-stage { position: relative; padding: 0 0 20px 40px; }
.j-stage::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 3px; border-radius: 2px; background: var(--line-strong); }
.j-stage:last-child::before { display: none; }
.j-stage:last-child { padding-bottom: 0; }
.j-marker { position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1; }
.j-arrive .j-marker { background: var(--sea); }
.j-test .j-marker { background: var(--mango); }
.j-stay .j-marker { background: var(--seafoam); }
.j-leave .j-marker { background: var(--coral); }
.j-stage h2, .j-box h2 { font-size: 1.0625rem; margin: 0 0 8px; padding-top: 2px; }
.j-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.j-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  color: var(--navy); font-weight: 800; font-size: 1rem; text-decoration: none; }
.j-chip[hidden] { display: none; }
.j-chip:hover { background: var(--wash); }
.j-chip.is-mine { background: var(--navy); border-color: var(--navy); color: #fff; }
.j-mine { font-size: .9375rem; font-weight: 700; color: #DCE6EE; }
.j-chip.is-planned { border-style: dashed; color: var(--ink-soft); }
.j-box .j-chips + .j-later { margin-top: 12px; }
.j-later summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; color: var(--navy); }
.j-later .meta { margin: 0 0 8px; }
/* A module page's own "Coming later (n)" (laterBox in diagnostics and facilities views): its planned lines together, closed. */
.later-box summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; color: var(--navy); }
.later-box[open] summary { margin-bottom: 4px; }
.later-list { margin: 0; padding-left: 20px; }
.later-list li { margin: 0 0 6px; color: var(--ink-soft); }
.is-empty { display: none; }
/* Me */
.me-row { display: block; text-decoration: none; color: var(--ink); margin-top: 12px; position: relative; padding-right: 40px; }
.me-row::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--ink-soft); }
.me-row h2 { margin: 0 0 2px; }
.me-row:hover { background: var(--wash); }
.me-role + .card, .me-row + .card { margin-top: 12px; }
.me-role .field { display: grid; gap: 4px; max-width: 26rem; }
.me-role .field label { font-weight: 700; }
.me-role select { width: 100%; }
.me-home { margin: 10px 0 0; }
.me-home a { display: inline-flex; align-items: center; min-height: 44px; }
.me-role-fixed { font-weight: 800; }
.now-foot { margin-top: 20px; text-align: center; }
/* Now: the flow strip (navigation v2). Stages left to right as tiles with the number there now (or
   "–", not counted yet, said in words under the strip); the longest wait between two stages is a
   striped mango connector with the coral forward arrow, and its minutes in words. */
.flow { margin: 0; }
.flow-strip { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr) 16px minmax(0, 1fr) 16px minmax(0, 1fr); align-items: stretch; }
.flow-tile { display: grid; align-content: center; justify-items: center; gap: 0; min-height: 52px; min-width: 0; padding: 4px; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--navy); font: inherit; text-decoration: none; text-align: center; cursor: pointer; }
.flow-tile:hover { background: var(--wash); }
.flow-tile[aria-expanded="true"] { border-color: var(--navy); border-width: 2.5px; }
.flow-name { font-weight: 800; font-size: .9375rem; line-height: 1.15; overflow-wrap: anywhere; }
.flow-n { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.flow-tile.is-none .flow-n { color: var(--ink-soft); }
.flow-conn { align-self: center; height: 4px; margin: 0 2px; border-radius: 2px; background: var(--line-strong); position: relative; }
.flow-conn.is-wait { height: 12px; margin: 0; background: repeating-linear-gradient(135deg, var(--mango) 0 4px, #F8CB70 4px 8px); color: var(--coral); font-weight: 800; font-size: 1.4rem; line-height: 0; display: flex; align-items: center; justify-content: flex-end; }
.flow-key { margin: 6px 0 0; font-size: .9375rem; line-height: 1.35; color: var(--ink-soft); }
.flow-wait { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; line-height: 1.3; font-size: .9375rem; font-weight: 700; }
.flow-swatch { flex: none; width: 22px; height: 10px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--mango) 0 4px, #F8CB70 4px 8px); }
.flow-arrow { flex: none; color: var(--coral); font-weight: 800; }
.flow-pick { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.flow-pick[hidden] { display: none; }
.flow-pick-h { margin: 0 0 4px; font-weight: 800; font-size: .9375rem; }
.flow-pick ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.flow-pick a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--navy); }
.flow-strip[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.flow-strip[data-n="1"].is-led { grid-template-columns: 16px minmax(0, 1fr); }
@media (max-width: 380px) { .flow-strip { grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr) 10px minmax(0, 1fr) 10px minmax(0, 1fr); } .flow-strip[data-n="1"].is-led { grid-template-columns: 10px minmax(0, 1fr); } .flow-tile { padding: 4px 2px; } }
.flow-unit { font-size: .9375rem; font-weight: 600; line-height: 1.15; color: var(--ink-soft); }
/* What the number counts, on screen (night 5 item 1): the unit and its words in one run of text. */
.flow-what { font-size: .9375rem; font-weight: 600; line-height: 1.15; color: var(--ink-soft); overflow-wrap: break-word; hyphens: manual; max-width: 100%; }
.flow-longest, .flow-also { font-size: .9375rem; font-weight: 800; line-height: 1.15; }
.flow-none { margin: 6px 0 0; font-size: .9375rem; line-height: 1.3; font-weight: 700; }
.flow-tile.is-apart { border-style: dashed; background: var(--sand); }
.flow-asof { font-weight: 800; color: var(--ink); }
.flow-asof.is-old, .needs-asof.is-old { color: var(--ink); }
.flow-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 12px; border: 1.5px solid var(--navy); border-radius: 12px; background: var(--surface); font-size: .9375rem; font-weight: 700; }
.flow-stale[hidden] { display: none; }
.flow-again { min-height: 44px; }
/* Needs you, in flow order: each card says where on the flow and which page, then its status in words. */
.section.needs { margin-top: 12px; }
.needs > h2 { margin-bottom: 8px; }
.needs-where { display: block; font-size: .9375rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.decision-list li > .needs-where { margin: 0 0 2px 2px; }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.needs-card { display: grid; gap: 6px; text-decoration: none; color: var(--navy); min-height: 44px; }
.needs-card:hover { background: var(--wash); }
.needs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.needs-asof { display: block; font-size: .9375rem; color: var(--ink-soft); }
.needs-decisions > .decisions { margin-bottom: 0; }
.chip-word { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--mango-tint); border: 1px solid var(--mango); color: var(--navy); font-weight: 700; font-size: .9375rem; }
.now-walk p { margin: 0 0 6px; font-weight: 700; }
.now-walk-link { display: inline-flex; align-items: center; min-height: 44px; }
/* Today: an agent's proposal waiting for this role (issue #52) */
.decisions { border-left: 6px solid var(--mango); margin-bottom: 16px; }
.decisions h2 { margin: 0 0 4px; }
.decision-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.decision-list a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); font-weight: 800; font-size: 1rem; text-decoration: none; background: var(--surface); }
.decision-list a::after { content: "›"; margin-left: auto; padding-left: 12px; font-size: 1.3rem; line-height: 1; }
.decision-list a:hover { background: var(--wash); }
/* The walk ribbon (navigation v2; issue #179): a navy band above the dock while a walk runs. One
   segment per step: done teal, the present wait striped mango, hands-on seafoam, still to come dim.
   Every colour has its words beside it. On wide screens it sits at the foot of the page, beside the rail. */
.walk-ribbon { position: fixed; z-index: 29; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 68px + 22px); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "segs segs" "head head" "now act";
  align-items: center; gap: 4px 10px; padding: 8px 8px 8px 12px; background: var(--navy); color: #fff; border-radius: 16px; box-shadow: 0 6px 18px rgba(11, 47, 78, .28); cursor: pointer; }
.walk-ribbon[hidden] { display: none; }
.wr-open { grid-area: now; display: flex; align-items: center; min-width: 0; min-height: 44px; color: #fff; text-decoration: none; font-weight: 700; font-size: .9375rem; line-height: 1.25; border-radius: 8px; }
.wr-open:hover { color: #fff; }
.wr-open:focus-visible, .wr-act:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
.wr-segs { grid-area: segs; display: flex; gap: 3px; height: 6px; margin-bottom: 2px; }
.wr-seg { flex: 1 1 0; min-width: 4px; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.wr-seg.is-done { background: var(--sea); }
.wr-seg.is-wait { background: repeating-linear-gradient(135deg, var(--mango) 0 5px, #F8CB70 5px 10px); }
.wr-seg.is-step { background: var(--seafoam); }
.wr-seg.is-paused { background: repeating-linear-gradient(135deg, #9FB1C2 0 5px, #6F8599 5px 10px); }
.wr-head { grid-area: head; display: flex; min-width: 0; font-size: .9375rem; line-height: 1.25; white-space: nowrap; }
.wr-title { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wr-step { flex: none; font-weight: 700; white-space: pre; }
.wr-now { color: #E8EEF3; }
.wr-clock { font-variant-numeric: tabular-nums; font-weight: 800; color: #fff; }
.wr-act { grid-area: act; min-height: 44px; max-width: 46vw; padding: 6px 14px; border: 0; border-radius: 12px; background: #fff; color: var(--navy); font: inherit; font-weight: 800; font-size: .9375rem; line-height: 1.15; cursor: pointer; }
.wr-act:disabled { opacity: .7; cursor: wait; }
.walk-ribbon[data-state="waiting"] .wr-act { background: var(--mango); }
/* #213: Ready (nothing timed before the arrival moment) and Done (the patient left) are not waiting. */
.walk-ribbon[data-phase="ready"] .wr-act, .walk-ribbon[data-phase="done"] .wr-act { background: #fff; }
.wr-seg.is-ready { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
.wr-nbox { display: none; font-weight: 800; color: #fff; }
/* A short phone (#182 item 11): one row, the words beside the button; the title is in the link's name. */
@media (max-width: 899px) and (max-height: 760px) {
  .walk-ribbon { grid-template-areas: "segs segs" "now act"; padding: 6px 6px 6px 12px; row-gap: 4px; }
  .wr-head { display: none; }
  .wr-nbox { display: inline; }
  .wr-open { line-height: 1.2; }
  .wr-act { max-width: 42vw; }
}
/* The dock's Walk while a walk runs: a live dot and the word "Running". */
.dock .dock-walk.is-running { outline: 3px solid var(--mango); outline-offset: 2px; }
.dock-live { position: absolute; top: 7px; right: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--mango); box-shadow: 0 0 0 2px var(--navy); animation: dock-live 1.6s ease-in-out infinite; }
@keyframes dock-live { 50% { opacity: .35; } }
main { padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--dock) + var(--ribbon) + 24px) max(16px, env(safe-area-inset-left)); max-width: 1120px; width: 100%; min-width: 0; }
main:focus { outline: none; }
.loading { color: var(--ink-soft); }

/* Wide screens: the dock is a left rail with the same five places; the top bar is one row. */
@media (min-width: 900px) {
  :root { --dock: 24px; --top: 65px; }
  .layout { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  main { grid-column: 2; grid-row: 1; }
  .dock { grid-column: 1; grid-row: 1; position: sticky; top: var(--top); left: auto; right: auto; bottom: auto; align-self: start; height: calc(100vh - var(--top));
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; padding: 16px 10px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .dock a { min-height: 60px; flex: none; }
  .dock .dock-walk { width: 76px; height: 76px; margin: 6px auto; }
  .walk-ribbon { left: calc(112px + 16px); right: 24px; bottom: 16px; max-width: 1080px; }
  .wr-act { max-width: 20rem; }
  .hospital { flex: 0 1 auto; order: 2; }
  .top-time { order: 3; margin-left: auto; }
  .top-search { order: 4; margin-left: 0; }
  .sheet { margin: auto; border-radius: 20px; }
}
@media (max-width: 899px) {
  /* The two-row top bar is sticky, so a message or heading the app scrolls to stops below it (issue #145). */
  html { scroll-padding-top: 116px; }
  .hospital { flex-basis: 100%; order: 5; }
}
@media (max-width: 560px) {
  .topbar { gap: 6px 8px; }
  /* 360 px: the chip, the time and Search share one row; the day's name gives way first. */
  .top-day { display: none; }
  .dept-chip { padding: 8px 12px; }
}

/* content */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { color: var(--ink-soft); margin: 0; }
.eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.eyebrow::before { content: ""; width: 16px; height: 4px; border-radius: 2px; background: var(--coral); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; color: var(--ink); text-decoration: none; font-weight: 400; border-left: 5px solid var(--sea); }
a.card:hover { border-color: var(--line-strong); border-left-color: var(--navy); box-shadow: 0 2px 10px rgba(11,47,78,.08); }
a.card.is-soon { border-left-color: var(--seafoam); }
a.card h3 { display: flex; justify-content: space-between; gap: 8px; }
.card .meta { font-size: .84rem; color: var(--ink-soft); }
.card .meta.notice { font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--seafoam); border-radius: var(--radius); padding: 10px 12px; }
.section { margin-top: 26px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat span { font-size: .84rem; color: var(--ink-soft); }
.pill { display: inline-block; font-size: .74rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--wash); color: var(--navy); white-space: nowrap; }
.pill-soon { background: #EEF2F5; color: var(--ink-soft); }
.pill-ok { background: #DDF1EA; color: #0B4A3A; }
.pill-bad { background: #FBE3DE; color: #8A2412; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer;
  background: var(--navy); color: #fff; border: 1.5px solid var(--navy); text-decoration: none; }
.btn:hover { background: #12406A; }
.btn-ghost { background: var(--surface); color: var(--navy); }
.btn-ghost:hover { background: var(--wash); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #FBE3DE; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap td[data-action] { min-width: 9.5rem; } /* the action is a sentence now (issue #65); the table scrolls sideways inside its box */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: #FBF8F2; }
tr:last-child td { border-bottom: 0; }
td code { font-size: .8rem; word-break: break-all; }

/* Issue #37: a message shows over the hospital row of the sticky top bar (no control there), at the
   row's right end on wider screens, so a short message never covers a button, a link or a field.
   A long message grows downward only, never over the role list or the Menu button. */
.hospital { position: relative; }
.toast { position: absolute; right: 0; top: 0; max-width: 100%; box-sizing: border-box;
  background: var(--navy); color: #fff; padding: 6px 14px; border-radius: 10px; font-weight: 700; font-size: .9375rem; line-height: 1.3;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.toast.show { opacity: 1; }
@media (min-width: 561px) { .toast { top: -6px; } }
.notice { border-left: 5px solid var(--mango); }
/* Phones: the audit table keeps its Action column readable; the check code shows on wider screens (issue #62). */
@media (max-width: 560px) { .col-hash { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* KPI tiles and definition dialog */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--seafoam); border-radius: var(--radius); padding: 12px 14px; min-height: 44px; }
.kpi-stale { grid-column: 1 / -1; margin: 0; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--mango); border-radius: var(--radius); padding: 10px 12px; }
.kpi:hover { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(11,47,78,.08); }
.kpi-on { border-top-color: var(--sea); }
.kpi-off { border-top-color: var(--coral); }
.kpi-name { font-weight: 700; font-size: .9rem; }
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.kpi-target { font-size: .8rem; color: var(--ink-soft); }
.kpi-dialog { border: 0; border-radius: 16px; padding: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); color: var(--ink); background: var(--surface); }
.kpi-dialog::backdrop { background: rgba(11, 47, 78, .45); }
.kpi-dialog-value { font-size: 1.5rem; font-weight: 800; }
.kpi-dialog dl { margin: 0 0 16px; display: grid; gap: 10px; }
.kpi-dialog dt { font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.kpi-dialog dd { margin: 0; }
a.card h3 .pill { flex: none; align-self: flex-start; }

/* Bed board */
.board-summary { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
.board-summary .stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.waiting-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.waiting-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--line); border-left: 5px solid var(--mango); border-radius: var(--radius); padding: 10px 12px; }
.waiting-item.is-picking { border-color: var(--navy); border-left-color: var(--navy); }
.btn-small { min-height: 44px; padding: 6px 12px; font-size: .9rem; }
.ward-tabs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin-bottom: 12px; }
.ward-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 44px; }
.ward-tab[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.ward-tab-name { font-weight: 800; }
.ward-tab-counts { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: .8rem; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.board-head h2 { margin: 0; }
.ward-counts { margin: 2px 0 0; font-size: .95rem; font-weight: 700; color: var(--ink-soft); }
.change-ward { margin: 0 0 10px; }
.change-ward > summary { min-height: 44px; display: flex; align-items: center; font-size: .95rem; font-weight: 800; cursor: pointer; color: var(--sea-ink); }
.change-ward[open] > summary { margin-bottom: 8px; }
.ward-first { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: .88rem; font-weight: 700; color: var(--navy); background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: 999px; padding: 6px 12px; min-height: 44px; cursor: pointer; }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
/* Engineering (item 7) */
.report-form { display: grid; gap: 4px; max-width: 640px; }
.report-form h2 { margin-top: 0; }
.report-form .field { display: grid; gap: 4px; margin-bottom: 8px; }
.report-form .field label, .report-form .label { font-weight: 700; }
.report-form select { min-height: 44px; width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
/* #23: grid items default to min-width: auto, so a long option name pushed the form past a 360 px screen. */
.report-form, .report-form .field, .report-form .prio-opt { min-width: 0; }
.prio { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.prio-opt { display: flex; gap: 8px; align-items: flex-start; border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px; min-height: 44px; cursor: pointer; background: var(--surface); }
.prio-opt:has(input:checked) { border-color: var(--navy); background: #EEF2F5; }
.prio-opt input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.prio-opt span { display: grid; }
.prio-opt small { color: var(--ink-soft); font-size: .88rem; }
.wo-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.wo { display: grid; gap: 4px; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: var(--surface);
  border: 1px solid var(--line); border-left: 6px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.wo:hover { box-shadow: 0 2px 10px rgba(11,47,78,.10); }
.wo.pr-urgent { border-left-color: var(--coral); }
.wo.pr-high { border-left-color: var(--mango); }
.wo.pr-routine { border-left-color: var(--sea); }
.wo-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wo-where { color: var(--ink-soft); font-size: .92rem; }
.wo-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sla { font-weight: 700; font-size: .92rem; white-space: nowrap; }
.sla-over { color: #A3301A; }
.chip.pr-urgent { background: #FBE3DE; color: #8A2412; }
.chip.pr-high { background: #FDE9C4; color: #5C3B00; }
.chip.pr-routine { background: #DDF1EA; color: #0B4A3A; }
.chip.wo-completed { background: #E4E4E4; color: #333; }
.chip.repeat { background: var(--navy); color: #fff; }
.label-link { overflow-wrap: anywhere; font-size: .85rem; }
.wo-dialog .field { display: grid; gap: 4px; margin: 0 0 12px; }
.wo-dialog .field label { font-weight: 700; }

/* Agent proposals waiting for a person (issue #17) */
.proposals { border-left: 5px solid var(--sea); margin: 12px 0; }
.proposals h2 { margin-top: 0; }
.proposal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.proposal-item { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proposal-actions select { min-height: 44px; font: inherit; font-size: .9rem; max-width: 100%; }
.audit-check { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.audit-note { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.audit-what { margin-bottom: 12px; }
.audit-what > summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; color: var(--sea-ink); }
.audit-what p, .audit-what li { font-size: .95rem; color: var(--ink-soft); }
.audit-what p { margin: 0 0 8px; }
.audit-what ul { margin: 0 0 8px; padding-left: 20px; }
.audit-what li b { color: var(--navy); }
.audit-what .trail-mark-now { font-weight: 800; color: var(--navy); overflow-wrap: anywhere; user-select: all; }
.trail-mark-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.trail-mark-form label { font-weight: 700; font-size: .95rem; flex-basis: 100%; }
.trail-mark-form input { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 10px; min-height: 44px; padding: 8px 10px; flex: 1 1 14rem; min-width: 0; max-width: 24rem; }
.audit-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.audit-filter select { min-height: 44px; font: inherit; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #FDF1D9;
  border: 1.5px solid var(--mango); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.banner:focus { outline: 3px solid var(--mango); outline-offset: 2px; }
.banner.held { background: #DDF1EA; border-color: var(--sea); flex-wrap: nowrap; }
.banner.held .btn { font-size: .95rem; min-width: 72px; justify-content: center; flex: none; }
.banner-wards { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.banner-wards .btn { min-height: 44px; }
.bed-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 142px), 1fr)); }
@media (max-width: 400px) { .bed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bed { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line-strong); border-radius: 10px; padding: 9px 10px; min-height: 88px; }
.bed:hover { box-shadow: 0 2px 10px rgba(11,47,78,.10); }
.bed-row { display: flex; justify-content: space-between; width: 100%; gap: 6px; }
.bed-no { font-size: 1.15rem; }
.bed-age, .bed-who, .bed-tag { font-size: .8rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.bed-tag { font-weight: 700; }
.bed.match { outline: 3px solid var(--sea); outline-offset: 1px; background: #E8F6F5; }
/* Find a bed: a bed that is not a match steps back with a flat sand tile and a plain edge, not
   opacity. It is still a live button, so its text keeps 4.5:1 or better (issue #90). */
.bed.dim { background: #F1EDE4; border-color: var(--line); border-left-color: var(--line-strong); box-shadow: none; }
.bed.dim .bed-no, .bed.dim .bed-age, .bed.dim .bed-who, .bed.dim .bed-tag { color: #4A5968; }
.bed.dim .chip { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: #3A4A5A; }
/* On a phone a chip keeps its words on one line while they fit; words longer than the line wrap inside it
   instead of pushing the page sideways (large text, 1.3x, at 360 px: Stores' stock-out chips, audit 28 Nov). */
.chip { display: inline-block; font-size: .76rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; color: var(--navy); background: #EEF2F5; }
@media (max-width: 640px) { .chip { white-space: normal; max-width: 100%; overflow-wrap: break-word; } }
.chip.st-occupied { background: #DCE6EF; }
.chip.st-expected-discharge { background: #FDE9C4; color: #5C3B00; }
.chip.st-vacated { background: #FBE3DE; color: #8A2412; }
.chip.st-cleaning { background: #DDF1EA; color: #0B4A3A; }
.chip.st-available { background: var(--sea-ink); color: #fff; }
.chip.st-allocated { background: #fff; border: 1.5px solid var(--sea-ink); color: var(--sea-ink); }
.chip.st-out-of-service { background: #E4E4E4; color: #333; }
.bed.st-occupied { border-left-color: var(--navy); }
.bed.st-expected-discharge { border-left-color: var(--mango); }
.bed.st-vacated { border-left-color: var(--coral); }
.bed.st-cleaning { border-left-color: var(--seafoam); }
.bed.st-available { border-left-color: var(--sea); }
.bed.st-allocated { border-left-color: var(--sea-ink); border-left-style: dashed; }
.bed.st-out-of-service { border-left-color: #8A8A8A; background: #F4F4F4; }
.bed-dialog .field { display: grid; gap: 4px; margin: 0 0 12px; }
.bed-dialog .field label { font-weight: 700; }
.bed-dialog .field select { width: 100%; }
.bed-dlg-state { margin: 0 0 12px; }
.bed-actions .btn { flex: 1 1 220px; }
.recent { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: .92rem; }
.legend { margin-top: 10px; }
@media (max-width: 640px) {
  .board-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .board-summary .stat { padding: 8px 10px; }
  .board-summary .stat span { font-size: .76rem; }
  .waiting-item { flex-wrap: nowrap; font-size: .92rem; }
  .waiting-item .btn { flex: none; }
}
@media (max-width: 640px) { .ward-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Process maps (backlog PM1) ---- */
.guide-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.guide-switch { min-height: 44px; }
.guide-switch[aria-pressed="false"] { background: var(--surface); color: var(--ink-soft); border-style: dashed; }
.map-chooser h2 { margin-top: 0; }
.chooser-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-top: 8px; }
.choice { display: grid; gap: 4px; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 14px; cursor: pointer; min-height: 44px; }
.choice:hover, .choice:focus-visible { border-color: var(--sea); background: var(--wash); }
.choice span { color: var(--ink-soft); font-size: .92rem; }
.choice .tag { justify-self: start; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--wash); color: var(--ink); border-radius: 999px; padding: 2px 8px; }
.choice.blank { border-style: dashed; }
.map-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.map-list a { display: grid; gap: 2px; padding: 12px 14px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.map-list a:hover, .map-list a:focus-visible { border-color: var(--sea); }
.map-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.map-head h2 { margin: 4px 0; }
.map-head .back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--sea-ink); }
.pm-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); grid-template-areas: "main guide" "steps guide"; align-items: start; }
.pm-main { grid-area: main; display: grid; gap: 12px; min-width: 0; }
.pm-guide { grid-area: guide; min-width: 0; }
.pm-steps { grid-area: steps; min-width: 0; display: grid; gap: 12px; }
.pm-steps > *, .pm-main > * { min-width: 0; }
@media (max-width: 900px) { .pm-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "guide" "steps"; } }
.pm-stats { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .pm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pm-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.pm-stat b { font-size: 1.45rem; line-height: 1.1; }
.pm-stat span { font-size: .9rem; color: var(--ink-soft); }
.pm-stat .was { font-weight: 700; color: var(--ink-soft); }
.pm-stat .was.better { color: var(--sea-ink); }
.guide-head.in-card { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.pm-stats.is-answer { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) { .page-head.on-map { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.walk-answer { display: grid; gap: 4px; margin: 0; border-left: 6px solid var(--navy); }
.walk-answer .wa-waste { font-size: 1rem; color: var(--ink); }
.walk-answer p { margin: 0; }
.walk-answer .wa-big { font-size: 1.05rem; }
.walk-answer .wa-big b { font-size: 1.9rem; line-height: 1.1; }
.walk-answer .wa-line { font-size: 1.05rem; }
.walk-answer .wa-note { font-size: .9375rem; color: var(--ink); margin-top: 4px; }
.walk-answer.is-warn { border-left-color: #EE9B00; }
/* A walk whose clock moved: the notice leads, so the time under it is not the biggest thing on the screen. */
.walk-answer.is-warn .wa-big b { font-size: 1.15rem; }
.walk-clock { background: #FDF3DC; border: 1.5px solid #EE9B00; border-radius: 10px; padding: 8px 10px; font-size: 1rem; color: var(--ink); }
.bars h3, .guide h3 { margin: 0 0 8px; }
.bar-row { display: grid; gap: 4px; margin-bottom: 8px; }
.bar-label { font-weight: 700; font-size: .95rem; }
.flowbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--sand); }
.flowbar i { display: block; height: 100%; }
/* Waiting is hatched, never colour alone (issue #124); planned waits and time not seen have their own patterns. */
.flowbar i.w, .legend .sw.w { background: repeating-linear-gradient(135deg, var(--mango) 0 4px, #F8CB70 4px 8px); }
.flowbar i.k, .legend .sw.k { background: var(--sea); }
.flowbar i.p, .legend .sw.p { background-color: var(--sand); box-shadow: inset 0 0 0 1.5px #5B6B7A; outline: 0; background-image: repeating-linear-gradient(90deg, transparent 0 5px, var(--mango) 5px 8px); }
.flowbar i.n, .legend .sw.n { background-color: #E3E6EA; background-image: radial-gradient(#5B6B7A 1.2px, transparent 1.4px); background-size: 6px 6px; }
.legend { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; color: var(--ink); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { display: inline-block; width: 16px; height: 14px; border-radius: 3px; flex: none; }
.linkish { font: inherit; font-weight: 800; color: var(--sea-ink); background: none; border: 0; padding: 0 2px; min-height: 44px; text-decoration: underline; cursor: pointer; }
.sugg { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sg { border: 1px solid var(--line); border-left: 4px solid var(--seafoam); border-radius: 10px; padding: 10px 12px; }
.sg.time { border-left-color: var(--mango); }
.sg p { margin: 4px 0; }
.sg .why { font-size: .88rem; color: var(--ink-soft); }
.sg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.steps-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.steps-head h3 { margin: 0; }
.steps-box { margin-top: 0; }
/* An empty list says what that means in one plain line (issue #84). */
.empty-state { margin: 0; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 1rem; }
.wo-note { margin: 8px 0; padding: 10px 12px; background: var(--mango-tint); border-left: 4px solid var(--mango); border-radius: 8px; color: var(--ink); font-size: 1rem; }
.scroll-hint { margin: 0 0 6px; }
.lanes { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lanes:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.lanegrid { display: grid; min-width: max-content; }
.lanename { position: sticky; left: 0; z-index: 1; background: var(--surface); font-weight: 700; font-size: .9rem; padding: 10px; display: flex; gap: 6px; align-items: flex-start; border-right: 1px solid var(--line); border-top: 1px dashed var(--line); }
.cell { padding: 8px 6px; border-top: 1px dashed var(--line); min-height: 64px; }
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; margin-top: 4px; }
.pm-step { display: grid; gap: 4px; width: 100%; text-align: left; font: inherit; font-size: .9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-left: 5px solid var(--sea); border-radius: 10px; padding: 8px 10px; cursor: pointer; min-height: 44px; }
.pm-step.hot { outline: 2px solid var(--navy); }
.pm-step.par { border-style: dashed; }
.pm-step .n { font-size: .78rem; font-weight: 800; color: var(--ink-soft); }
.pm-step .t { display: flex; gap: 8px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-soft); }
.pm-step .wt { color: #5C3B00; font-weight: 700; }
.pm-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.pm-list .wait { font-size: .88rem; color: var(--ink-soft); padding: 2px 0 2px 40px; }
.pm-list .wait.hot, .pm-list .wait.hot .wait-btn { color: var(--navy); font-weight: 800; }
.pm-list .wait.planned, .pm-list .wait.planned .wait-btn { color: var(--ink); }
.pm-list .wait.wait-pick { padding-left: 28px; }
.wait-btn { font: inherit; color: inherit; background: none; border: 0; border-radius: 8px; padding: 4px 12px; min-height: 44px; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; overflow-wrap: anywhere; }
.wait-btn:focus-visible { outline: 3px solid var(--sea); }
.wait-choice { margin: 2px 0 8px 12px; padding: 10px 12px; border: 1.5px dashed #5B6B7A; border-radius: 10px; background: var(--surface); display: grid; gap: 8px; font-weight: 400; color: var(--ink); }
.wait-choice p { margin: 0; font-size: .9375rem; }
.wait-choice .btn { min-height: 44px; justify-self: start; }
.pm-step .wt.planned { font-style: italic; }
.pm-list .row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pm-list .num { font-weight: 800; color: var(--ink-soft); text-align: center; }
.pm-list .what { display: grid; gap: 2px; min-width: 0; }
.pm-list .what span { font-size: .9rem; color: var(--ink-soft); }
.pm-list .ctl { display: flex; gap: 4px; }
.pm-list .icon { font: inherit; font-weight: 800; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--navy); cursor: pointer; }
.pm-list .icon:disabled { opacity: .35; cursor: default; }
@media (max-width: 400px) { .pm-list .row { grid-template-columns: 24px minmax(0, 1fr); } .pm-list .ctl { grid-column: 1 / -1; justify-content: flex-end; } }
.step-form { display: grid; gap: 8px; }
.step-form h3 { margin: 0; }
.step-form .field { display: grid; gap: 4px; min-width: 0; }
.step-form .field label { font-weight: 700; }
.step-form .field-note { margin: 0; font-size: .9375rem; color: var(--ink-soft); }
.name-question { border: 1.5px solid var(--line-strong); border-left: 5px solid #EE9B00; border-radius: 10px; padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; }
.name-question p { margin: 0; }
.name-question .btn { min-height: 44px; }
.step-form input:not([type="checkbox"]) { font: inherit; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; width: 100%; min-width: 0; color: var(--ink); background: var(--surface); }
.step-form .two { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.step-form .check { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.step-form .check input { width: 22px; height: 22px; accent-color: var(--navy); flex: none; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.more-sugg { margin-top: 10px; }
.more-sugg > summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; color: var(--sea-ink); }
.more-sugg[open] > summary { margin-bottom: 8px; }
.pm-list .row.changed { border-left: 5px solid var(--mango); }
.changed-note { font-size: .88rem; font-weight: 700; color: #5C3B00; padding: 2px 0 2px 40px; }
.pm-step.changed { background: #FFF6E5; }
.pm-step .changed-note { padding: 0; }
/* Edit map of a walked map opens on the step list (#182 item 23); each step's "Change" sits beside its name. */
.pm-layout.steps-first { grid-template-areas: "steps guide" "main guide"; }
@media (max-width: 900px) { .pm-layout.steps-first { grid-template-areas: "steps" "main" "guide"; } }
.pm-list .what .name-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.pm-list .what .name-line b { min-width: 0; overflow-wrap: anywhere; }
.pm-list .step-change { font: inherit; font-size: .9375rem; font-weight: 800; flex: none; min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--navy); cursor: pointer; }
.pm-list .step-change:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.pm-list li > .step-form { margin: 6px 0 4px; }
/* Phones: no text under 15 px on Edit map (#189 item 5). */
@media (max-width: 640px) {
  .pm-list .wait, .pm-list .what span, .sg .why, .changed-note, .lanename, .pm-stat span, .pm-step, .bar-label, .wait-choice p, .chip.walk-badge, .map-head .walk-when, .guide-head .meta { font-size: .9375rem; }
}

/* Agents screen (issues #25, #20). Text 15 px or more; every control at least 44 px tall. */
.ag-intro, .ag-text, .ag-status, .ag-row span, .ag-hint, .ag-dial-btn span, .ag-details summary span { font-size: .95rem; }
.ag-status { font-weight: 700; margin: 0 0 12px; min-height: 1.4em; }
.ag-status:empty { display: none; }
.ag-banner { background: var(--mango-tint); color: var(--navy); font-weight: 700; border-radius: 10px; border-left: 6px solid var(--coral); padding: 10px 14px; margin: 0 0 12px; }
.ag-card, .ag-details { margin-bottom: 12px; }
.ag-card h2 { margin-top: 0; font-size: 1.1rem; }
.ag-text { color: var(--ink-soft); margin: 10px 0 0; }
.ag-dial { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ag-dial-btn { font: inherit; text-align: left; display: grid; gap: 4px; align-content: start; min-height: 88px; padding: 12px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--navy); cursor: pointer; }
.ag-dial-btn b { font-size: 1.1rem; display: flex; gap: 8px; align-items: center; }
.ag-dial-btn span { color: var(--ink-soft); }
.ag-dial-btn[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.ag-dial-btn:disabled { opacity: .6; cursor: default; }
.ag-stop { width: 100%; margin-top: 10px; background: #C2412A; border-color: #C2412A; color: #fff; }
.ag-stop:hover { background: #A93522; }
.ag-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.ag-details summary { min-height: 52px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; cursor: pointer; }
.ag-details[open] { padding-bottom: 14px; }
.ag-details .ag-text:first-of-type { margin-top: 0; }
.ag-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.ag-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 52px; padding: 4px 0; border-top: 1px solid var(--line); }
.ag-agent > div { display: grid; gap: 2px; min-width: 0; }
.ag-agent b { display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.ag-agent span { color: var(--ink-soft); }
.ag-card > .btn { margin-top: 12px; }
.ag-switch { font: inherit; font-weight: 800; min-width: 72px; min-height: 44px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--navy); cursor: pointer; flex: none; }
.ag-switch[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.ag-switch:disabled { opacity: .6; cursor: default; }
.ag-dialog .field { display: grid; gap: 4px; margin: 0 0 12px; }
.ag-dialog .field label, .ag-wards-pick legend { font-weight: 700; }
.ag-dialog input[type="text"], .ag-dialog select { font: inherit; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; width: 100%; min-width: 0; background: #fff; color: var(--navy); }
.ag-hint { color: var(--ink-soft); }
.ag-wards-pick { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 0; min-width: 0; }
.ag-tick { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.ag-tick input { width: 22px; height: 22px; accent-color: var(--navy); flex: none; }
.ag-err { color: var(--danger); font-weight: 700; margin: 0 0 8px; }
.ag-err:empty { display: none; }
.ag-dialog-actions { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 20px; margin-bottom: -20px; }
@media (max-width: 420px) { .ag-dial { grid-template-columns: 1fr; } .ag-dial-btn { min-height: 64px; } }
.ag-agent .btn-small { font-size: .95rem; flex: none; }
.ag-card > .ag-stop { margin: 0 0 10px; }
.ag-card .ag-dial + .ag-stop { margin: 10px 0 0; }

/* Engineering: the "do next" card, the one-line summary, and lateness as a number with a small bar (issue #83) */
.eng .wo-queue, .eng .wo-queue .meta, .eng .wo-queue .chip, .eng .wo-queue .chip-btn { font-size: 1rem; }
.eng-next .page-head { margin-bottom: 4px; }
.eng-next .wo-queue > h2 { margin-bottom: 0; }
.wo-summary { margin: 0 0 10px; color: var(--ink); }
.wo-summary b { font-weight: 800; }
.next-card { display: grid; gap: 8px; background: var(--surface); border: 1.5px solid var(--navy); border-left: 8px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 14px 10px; margin: 0 0 16px; max-width: 640px; min-width: 0; }
.next-card.pr-urgent { border-left-color: var(--coral); }
.next-card.pr-high { border-left-color: var(--mango); }
.next-card.pr-routine { border-left-color: var(--sea); }
.next-card p, .next-card h3 { margin: 0; }
.next-card h3 { font-size: 1.45rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.next-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; color: var(--ink-soft); }
.next-tag { font-weight: 800; color: var(--navy); background: #DDF1EA; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.next-where { font-size: 1.05rem; }
.next-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.next-facts .chip { font-size: 1rem; padding: 2px 10px; }
.next-facts .wo-late { flex: 1 1 200px; }
.next-why { font-weight: 700; }
.btn.btn-big { width: 100%; min-height: 56px; font-size: 1.15rem; font-weight: 800; justify-content: center; }
.next-more { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.next-more .linkish, .next-outcomes .linkish { font-size: 1rem; padding: 0; }
.next-pos { color: var(--ink-soft); }
.next-rule { color: var(--ink-soft); font-size: .95rem; }
.next-outcomes { display: grid; gap: 8px; }
.next-ask { font-weight: 800; }
.next-outcomes .linkish { justify-self: start; }
.wo-controls { display: grid; gap: 8px; margin: 0 0 4px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; border: 1.5px solid var(--navy); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg[hidden] { display: none; }
.seg-btn { font: inherit; font-size: 1rem; font-weight: 700; min-height: 44px; padding: 4px 6px; color: var(--navy); background: var(--surface); border: 0; border-left: 1.5px solid var(--navy); cursor: pointer; }
.seg-btn:first-child { border-left: 0; }
.seg-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg-btn:focus-visible { outline-offset: -3px; }
.wo-group { margin: 14px 0 0; font-size: 1rem; font-weight: 800; }
.wo-group span { color: var(--ink-soft); font-weight: 700; }
.wo-groups .wo-list { margin-top: 6px; }
.wo-groups .wo-where { font-size: 1rem; }
.wo-late { display: grid; grid-template-columns: minmax(0, 16em) 88px; justify-content: space-between; align-items: center; gap: 10px; color: var(--ink); }
@media (min-width: 700px) { .wo-late { justify-content: start; } }
.wo-queue > [data-test="queue-rules"] { margin: 14px 0 0; }
.late-n { font-weight: 700; }
.late-bar { display: block; height: 8px; border-radius: 4px; background: #EFE9DC; box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.late-bar i { display: block; height: 100%; background: var(--mango); border-radius: 4px 0 0 4px; }
.chip.wo-started { background: #DDF1EA; color: #0B4A3A; }
.chip.wo-team { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }

/* ---- a device connected to its site's own server (app.js bootOnSite, modules/connect.js) ---- */
.connect { max-width: 26rem; margin: 1.5rem auto; display: grid; gap: .75rem; }
.connect h1 { margin: 0; font-size: 1.5rem; }
.connect p { margin: 0; font-size: 1rem; }
.connect input { font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; text-align: center; min-height: 56px; width: 100%; text-transform: uppercase; }
.connect input::placeholder { color: #8a99a8; font-weight: 400; }
.connect-btn { min-height: 52px; width: 100%; font-size: 1.125rem; }
.connect-msg { color: #0B2F4E; font-weight: 700; min-height: 1.5em; }
.connect-msg:not(:empty) { background: #fdf1d7; border-left: 4px solid #EE9B00; padding: .5rem .75rem; border-radius: 6px; }
.role-fixed { font-weight: 700; font-size: .9375rem; color: #0B2F4E; padding: .5rem .75rem; border: 1px solid #c9d3dc; border-radius: 10px; background: #fff; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-bar { order: 9; flex: 0 0 100%; margin: 0; padding: .5rem .75rem; background: #fdf1d7; border-left: 4px solid #EE9B00; border-radius: 6px; color: #0B2F4E; font-weight: 700; font-size: .9375rem; line-height: 1.35; }
.site-bar[hidden] { display: none; }
/* Locked export and its import (#93): a passphrase form inside the Export and Import cards. */
.locked-form { display: grid; gap: 6px; margin: 12px 0 0; max-width: 28rem; }
.locked-form[hidden] { display: none; }
.locked-form label { font-weight: 700; }
.locked-form input[type="password"] { font: inherit; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; width: 100%; min-width: 0; background: #fff; color: var(--navy); }
.locked-form .actions { margin-top: 6px; }
/* The recovery sheet for a locked export: on screen a plain card; printed alone on one page. */
.recovery-box { display: grid; gap: 8px; margin: 12px 0 0; }
.recovery-box[hidden] { display: none; }
.recovery-sheet { border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 14px; background: #fff; color: var(--navy); display: grid; gap: 10px; }
.recovery-sheet h3, .recovery-sheet h4 { margin: 0; font-size: 1.05rem; }
.recovery-sheet dl { margin: 0; display: grid; gap: 2px; }
.recovery-sheet dt { font-weight: 800; }
.recovery-sheet dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.recovery-sheet .rs-write { display: grid; gap: 4px; }
.recovery-sheet .rs-line { display: block; height: 34px; border-bottom: 1.5px solid var(--navy); }
.recovery-sheet .rs-write small, .recovery-sheet .rs-warn, .recovery-sheet li { font-size: 1rem; }
.recovery-sheet ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.recovery-sheet .rs-warn { margin: 0; }
.print-sheet-root { display: none; }
@media print {
  html.print-recovery body > *:not(.print-sheet-root) { display: none !important; }
  html.print-recovery body { background: #fff; }
  html.print-recovery .print-sheet-root { display: block; }
  html.print-recovery .recovery-sheet { border: 0; border-radius: 0; padding: 0; font-size: 12pt; gap: 14pt; color: #000; }
  html.print-recovery .recovery-sheet h3 { font-size: 16pt; }
  html.print-recovery .recovery-sheet .rs-line { height: 30pt; border-bottom: 1pt solid #000; }
}
.last-export { margin: 10px 0 0; font-size: .9375rem; color: var(--ink-soft); }
.last-export[data-old="true"] { color: var(--ink); font-weight: 700; border-left: 4px solid #EE9B00; padding-left: 8px; }
.device-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .9375rem; }
.device-notice span { flex: 1 1 240px; min-width: 0; }
.device-notice .btn { min-height: 44px; min-width: 64px; }
.connect .meta { font-size: .9375rem; }
html[data-site="connect"] .dept-chip, html[data-site="connect"] .top-time, html[data-site="connect"] .top-search, html[data-site="connect"] .hospital, html[data-site="connect"] .dock { display: none; }
/* The full-screen walk (modules/walk.js sets data-walk-full on <html> while it shows): no dock, no ribbon. */
html[data-walk-full] .dock, html[data-walk-full] .walk-ribbon { display: none; }
html[data-walk-full] { --dock: 0px; }
html[data-site="connect"] .layout { display: block; }
@media (max-width: 760px) {
  .role-fixed { margin-left: auto; max-width: 46vw; white-space: normal; text-align: right; line-height: 1.2; padding: .375rem .625rem; }
}
.proposal-actions { display: grid; gap: 10px; }
.proposal-actions .proposal-yes { min-height: 44px; justify-self: start; min-width: 8rem; }
.proposal-no { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proposal-no label { font-size: .9375rem; font-weight: 700; flex: 0 0 100%; }
.proposal-no select { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 10px; min-height: 44px; padding: 6px 10px; flex: 1 1 10rem; min-width: 0; }
.proposal-no .btn { min-height: 44px; }
/* No connection on a connected device (issue #86): the buttons cannot be tapped and look it, without see-through text. */
.proposal-actions .btn:disabled { background: var(--sand); color: var(--ink-soft); border: 1.5px dashed var(--line-strong); cursor: not-allowed; opacity: 1; }
.proposal-offline { justify-self: start; font-size: .9375rem; font-weight: 700; color: var(--navy); background: var(--mango-tint); border-left: 4px solid var(--mango); border-radius: 6px; padding: 4px 10px; }
.proposal-msg { margin: 8px 0; padding: 8px 12px; font-weight: 700; color: var(--navy); background: var(--mango-tint); border-left: 5px solid var(--coral); border-radius: 8px; }

/* Issue #13: a long unbroken word (a pasted web address) wraps inside its box in process maps;
   it may never widen the page. Role names in the swimlane keep to their 120 px column. */
.pm-step, .pm-list .what, .pm-list .wait, .changed-note, .lanename, .sg, .bar-label, .map-head h2, .pm-stat, .step-form .field-note, .name-question { overflow-wrap: anywhere; min-width: 0; }
.cell, .pm-list li { min-width: 0; }
/* Issue #13: on a phone, text a person acts on is never under 15 px. */
@media (max-width: 640px) {
  .bed-age, .bed-who, .bed-tag, .chip, .pill, .badge, .eyebrow, .kpi-target, .kpi-dialog dt, .card .meta, .stat span, .board-summary .stat span,
  th, td code, .ward-tab-counts, .pm-step .n, .pm-step .t, .choice .tag, .label-link { font-size: .9375rem; }
  /* Issue #13, rest (fixer, night 12): the hospital name, KPI names, filter and guide chips, small
     buttons, the waiting list, recent changes, meta lines, priority notes, example-card text and tables. */
  .hospital-name, .kpi-name, .chip-btn, .btn-small, .waiting-item, ol.recent li, .meta, .prio-opt small, .choice span, table { font-size: .9375rem; }
  .eyebrow { letter-spacing: .12em; }
  /* At 15 px the six bed filters took three rows at 360 px and pushed Find a bed's first match below the fold. */
  .chips .chip-btn { padding: 6px 9px; }
  /* Issue #145: the top bar keeps the phone rules too. The "Synthetic data" label is 15 px in
     sentence case with no letter spacing (in capitals it pushed the bar onto a third row), the role
     picker is 15 px, and the logo link is a 44 px target. */
  .topbar .badge { font-size: .9375rem; line-height: 20px; text-transform: none; letter-spacing: 0; padding: 2px 8px; gap: 5px; }
}

/* Walk mode (backlog PM2). One screen, one big button; the state reads at arm's length:
   coral tint while waiting, sea tint while a step runs (the map's own two colours). */
.walk-card { border-left: 5px solid var(--sea); }
.walk-card h2 { margin-top: 0; }
.walk-card .btn { min-height: 52px; font-size: 1.05rem; }
.walk { display: grid; gap: 12px; max-width: 560px; margin: 0 auto; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); }
.walk.is-waiting { background: #FDF0EC; border-color: #E0583E; }
.walk.is-step { background: #E6F4F3; border-color: #0A9396; }
.walk.is-paused { background: var(--sand); border-color: #5B6B7A; border-style: dashed; }
.walk-before { max-width: 560px; margin: 0 auto; display: grid; gap: 8px; }
.walk-before h1 { margin: 0; font-size: 1.25rem; }
.walk-before-list { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 1rem; line-height: 1.35; }
.walk-before-list li.first { font-weight: 800; }
.btn.walk-before-ok { width: 100%; min-height: 56px; font-size: 1.1rem; font-weight: 800; justify-content: center; border-radius: 14px; }
.walk-before-foot { margin: 0; font-size: .9375rem; color: var(--ink); }
.walk-before-foot a { display: inline-block; padding: 12px 6px; font-weight: 700; }
.walk-top h1 { margin: 0; font-size: 1.25rem; }
.walk-sub { margin: 0; font-size: 1rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.walk-now { display: grid; justify-items: center; gap: 0; text-align: center; padding: 4px 0; }
.walk-state { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.walk-timer { font-size: 4rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--navy); }
.walk-meta { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.walk-def { margin: 0; font-size: 1rem; color: var(--ink); text-align: center; }
.btn.walk-main { width: 100%; min-height: 76px; font-size: 1.5rem; font-weight: 800; justify-content: center; border-radius: 16px; }
.walk-side { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; min-height: 48px; }
.walk-side .btn { min-height: 48px; background: var(--surface); justify-content: center; text-align: center; line-height: 1.15; white-space: normal; padding-inline: 6px; min-width: 0; }
.walk-sheet { margin: 0; display: grid; gap: 6px; min-width: 0; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 8px 10px; }
.walk-sheet h2 { margin: 0; font-size: 1.1rem; }
.walk-sheet-hint { margin: 0; font-size: 1rem; color: var(--ink); }
.walk-sheet .field { display: grid; gap: 6px; min-width: 0; }
.walk-sheet .field label { font-weight: 800; }
.walk-sheet input:not([type="checkbox"]) { font: inherit; min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; width: 100%; min-width: 0; color: var(--ink); background: var(--surface); }
.walk-sheet .check { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.walk-sheet .check input { width: 28px; height: 28px; accent-color: var(--navy); flex: none; }
.walk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.walk-chip { min-height: 48px; font-size: 1rem; padding: 6px 12px; overflow-wrap: anywhere; text-align: left; }
.walk-chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.walk-end { display: grid; gap: 6px; margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.walk-end .walk-finish { min-height: 48px; background: var(--surface); justify-content: center; }
.walk-end .meta, .walk-foot { font-size: .9375rem; color: var(--ink); margin: 0; }
.walk-confirm { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.walk-confirm p { margin: 0; }
.walk-confirm .btn, .walk-sheet .btn { min-height: 48px; }
.walk-foot .linkish { font-weight: 700; }
.chip.walk-badge { background: #EE9B00; color: #0B2F4E; font-size: .9375rem; letter-spacing: .04em; text-transform: uppercase; }
.card .meta.walk-note { border-left-color: #EE9B00; margin-top: 8px; }

.page-head[hidden], [data-test="proposals"][hidden] { display: none; }
.walk-end .walk-finish:disabled { opacity: 1; color: #5B6B7A; border-color: var(--line); background: transparent; cursor: default; }
.walk-error { margin: 0; padding: 8px 10px; border-left: 5px solid #EE9B00; background: #FFF6E5; border-radius: 8px; color: var(--ink); }
.walk-when { margin: 4px 0; color: var(--ink); }

/* Repeat walks (issue #124 item 1): the list step on the walk screen, and the range on the map. */
.walk-next { margin: 0; display: grid; gap: 0; justify-items: center; text-align: center; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line-strong); }
.walk-next-n { font-size: .9375rem; color: var(--ink); }
.walk-next-name { font-size: 1.25rem; line-height: 1.2; color: var(--navy); overflow-wrap: anywhere; }
.walk-next-role { font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.walk-saved { margin: 0; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 10px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line); font-size: 1rem; color: var(--ink); }
.walk-saved span { min-width: 0; overflow-wrap: anywhere; flex: 1 1 160px; }
.walk-saved .walk-change { min-height: 44px; }
.walk-again-box { display: grid; gap: 4px; margin-top: 8px; }
.walk-again-box .meta { font-size: .9375rem; color: var(--ink); }
.btn.walk-again { min-height: 52px; font-size: 1.05rem; justify-content: center; }
.walk-answer .wa-count { font-weight: 800; }
.walk-answer .wa-walks { margin: 4px 0 0; padding-left: 18px; font-size: 1rem; color: var(--ink); display: grid; gap: 2px; }
@media (min-width: 641px) { .btn.walk-again { justify-self: start; padding-inline: 22px; } }
/* A repeat walk shows the list step as well, so on a phone the frame is tighter: the main button, "Did not happen" and Undo stay on a 360 by 640 screen. */
@media (max-width: 640px) {
  .walk.is-repeat { gap: 6px; padding: 10px 12px; }
  .walk.is-repeat .walk-top h1 { font-size: 1.05rem; display: inline; }
  .walk.is-repeat .walk-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
  .walk.is-repeat .walk-sub { font-size: .9375rem; }
  .walk.is-repeat .walk-timer { font-size: 3.5rem; line-height: 1; }
  .walk.is-repeat .walk-state { font-size: 1.25rem; line-height: 1.2; }
  .walk.is-repeat .btn.walk-main { min-height: 72px; }
  .walk.is-repeat .walk-side { gap: 6px; }
  .walk.is-repeat .walk-side .btn { min-height: 44px; padding-inline: 12px; }
}

/* Walk-first week (founder, 22 Nov 2026): the walk is full screen and its main button never leaves
   the screen. The bar is pinned to the bottom: the naming sheet (or the line saying what was saved),
   then Pause, Undo and one other choice in three places that never move, then the main button.
   modules/walk.js sets --walk-bar to the bar's height so the page keeps that much room under the walk. */
.walk { margin-bottom: var(--walk-bar, 0px); }
.walk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 8px; min-width: 0;
  padding: 10px max(12px, calc((100vw - 560px) / 2)) calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 2px solid var(--line-strong); box-shadow: 0 -6px 16px rgba(11, 47, 78, .14);
  max-height: calc(100dvh - 120px); display: flex; flex-direction: column; overflow: hidden; }
/* Only the naming sheet gives way when room is short (typing with the keyboard up): the clock, Pause and the main button stay. */
.walk-bar > * { flex: none; }
.walk-bar > .walk-sheet { flex: 0 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
.walk.is-waiting .walk-bar { background: #FDF0EC; border-top-color: #E0583E; }
.walk.is-step .walk-bar { background: #E6F4F3; border-top-color: #0A9396; }
.walk.is-paused .walk-bar { background: var(--sand); border-top-color: #5B6B7A; }
/* Wide screens: the bar is the foot of the walk card, and stays at the bottom of the window when the card is taller than it. */
@media (min-width: 900px) {
  .walk { margin-bottom: 0; }
  .walk-bar { position: sticky; bottom: 12px; left: auto; right: auto; padding: 10px 12px 12px; border: 2px solid var(--line-strong); border-radius: 14px; box-shadow: 0 4px 14px rgba(11, 47, 78, .12); max-height: calc(100vh - 140px); }
  .walk.is-waiting .walk-bar { border-color: #E0583E; } .walk.is-step .walk-bar { border-color: #0A9396; } .walk.is-paused .walk-bar { border-color: #5B6B7A; }
}
.btn.walk-main.is-long { font-size: 1.2rem; line-height: 1.15; white-space: normal; padding-block: 8px; text-align: center; }
.walk-top { display: grid; gap: 0; }
.walk-leave { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; width: 100%; justify-self: stretch; padding: 0 12px; font-weight: 800; font-size: 1rem; color: var(--navy); text-decoration: none; }
.walk-leave-mark { width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-3px) rotate(45deg); flex: none; }
.walk-resume { margin: 0; text-align: center; font-weight: 800; font-size: 1rem; color: var(--navy); }
.walk-keep { margin: 0; padding: 8px 10px; border-left: 5px solid #EE9B00; background: #FFF6E5; border-radius: 8px; font-size: 1rem; color: var(--ink); }
.walk-sheet-head { display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
.walk-sheet-head h2 { font-size: 1.05rem; }
.walk-sheet-hint { font-size: .9375rem; }
.walk-chips.is-row { min-height: 46px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: center; margin-inline: -10px; padding-inline: 10px; overscroll-behavior-x: contain; }
.walk-chips.is-row::-webkit-scrollbar { display: none; }
.walk-chips.is-row .walk-chip { flex: none; min-height: 44px; white-space: nowrap; }
.walk-row-word { flex: none; min-width: 36px; font-size: .9375rem; font-weight: 800; color: var(--ink); }
.walk-sheet-foot { display: flex; gap: 6px; }
/* "Waiting for what?" (#180): one row above the buttons. Its chips are sand with a mango edge, so they are not taken for step words. */
.walk-bar > .walk-reason { flex: none; align-items: center; gap: 6px; }
.walk-reason .walk-reason-word { flex: 1 0 100%; }
.walk-reason .walk-chip { min-height: 44px; }
/* A short phone has no room for three lines of reasons above the main button: one row that slides. */
@media (max-height: 720px) { .walk-bar > .walk-reason { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; } .walk-reason .walk-reason-word { flex: none; } .walk-reason .walk-chip { flex: none; white-space: nowrap; } }
/* The sheet's own buttons stay in sight while the sheet slides (Adoption lead, 26 Nov). */
.walk-bar > .walk-sheet .walk-sheet-foot { position: sticky; bottom: -8px; background: var(--surface); padding-block: 4px; z-index: 1; }
.walk-reason-word { font-weight: 800; white-space: nowrap; flex: none; font-size: .9375rem; }
.walk-reason-chip { background: var(--sand, #F6F1E7); border-color: #EE9B00; color: #0B2F4E; }
.walk-own { border-style: dashed; }
.walk-sheet .walk-error { margin: 0; font-weight: 700; }
.walk-sheet-foot .btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding-inline: 6px; font-size: .9375rem; justify-content: center; text-align: center; line-height: 1.15; white-space: normal; }
.walk-more-box { display: grid; gap: 8px; }
/* The tap-through walk sheet (27 Nov 2026): the department's step list as large rows in the page,
   above the pinned bar. A row's state is said in words and by its edge, never by colour alone. */
.walk-list { display: grid; gap: 6px; min-width: 0; }
.walk-list h2 { margin: 0; font-size: 1rem; color: var(--ink); font-weight: 800; }
.walk-list-hint { margin: 0; font-size: 1rem; color: var(--ink); }
.walk-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.walk-rowbtn { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; width: 100%; min-height: 60px; padding: 8px 12px 8px 8px; text-align: left; font: inherit; color: var(--navy);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: 14px; cursor: pointer; }
.walk-rowbtn:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
.walk-rowbtn:disabled { cursor: default; color: var(--ink); border-color: var(--line); background: transparent; }
.walk-rowbtn .wl-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid currentColor; font-weight: 800; font-size: 1rem; }
.walk-rowbtn .wl-what { display: grid; min-width: 0; }
.walk-rowbtn .wl-what b { font-size: 1.1rem; line-height: 1.2; overflow-wrap: anywhere; }
.walk-rowbtn .wl-role { font-size: .9375rem; color: var(--ink); overflow-wrap: anywhere; }
.walk-rowbtn .wl-state { font-size: .9375rem; font-weight: 800; color: var(--ink); text-align: right; max-width: 132px; }
.walk-rowbtn.is-next { border-color: #EE9B00; border-left-width: 8px; background: #FFF6E5; }
.walk-rowbtn.is-running, .walk-rowbtn.is-running:disabled { border-color: #0A9396; border-left-width: 8px; background: #0B2F4E; color: #fff; }
.walk-rowbtn.is-running .wl-role, .walk-rowbtn.is-running .wl-state { color: #fff; }
.walk-rowbtn.is-timed .wl-n { background: var(--navy); color: #fff; border-color: var(--navy); }
.walk-rowbtn.is-other { border-style: dashed; }
/* While a step is timed, only its own row stands out: the row offered next is as quiet as the rest. */
.walk-rowbtn.is-next:disabled { border-color: var(--line); border-left-width: 2px; background: transparent; }
/* Repeat walk: a list step marked "did not happen" is quiet and says so in words; it can still be started. */
.walk-rowbtn.is-did-not-happen { border-style: dotted; background: transparent; }
.walk-rowbtn.is-did-not-happen .wl-what b { font-weight: 600; }
.walk .nowrap { white-space: nowrap; }
.btn.walk-other { min-height: 44px; width: 100%; justify-content: center; background: var(--surface); border-style: dashed; font-size: 1rem; }
/* While something waits: a note that something happened in this wait, beside the clock (#219). It wraps under the clock only when the clock is too wide. */
.walk-now.has-note, .walk.has-list .walk-now.has-note, .walk-bar .walk-now.has-note { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 10px; }
.walk-now.has-note .walk-meta { flex-basis: 100%; }
.btn.walk-note-btn { min-height: 44px; min-width: 44px; padding: 4px 8px; margin-block: -4px; background: var(--surface); border-style: dashed; font-size: .9375rem; white-space: nowrap; }
/* The last-step line is one short line in the bar (#199): it must not push the list off a small phone. */
.walk-bar [data-test="walk-all-done"] { margin: 0; line-height: 1.15; }
/* A repeat walk's clock is larger: beside the note it gives way, so the bar keeps its height on a small phone. */
.walk.is-repeat .walk-now.has-note .walk-timer { font-size: 2.5rem; line-height: 1.1; }
.walk-from { color: var(--ink); font-size: .9375rem; }
.walk-flash.is-short { flex-wrap: nowrap; padding-block: 2px; }
.walk-flash.is-short span { flex: 1 1 auto; }
.walk-flash.is-short .walk-change { flex: none; padding-inline: 10px; }
.walk.has-list.has-flash .walk-meta { display: none; }
/* With the list on the page the bar is short: the state word and the clock share one line. */
.walk.has-list .walk-now { grid-template-columns: auto auto; justify-content: center; align-items: baseline; column-gap: 10px; padding: 0; }
.walk.has-list .walk-state { font-size: 1.25rem; }
.walk.has-list .walk-timer { font-size: 2.25rem; line-height: 1.1; }
.walk.has-list .walk-meta { grid-column: 1 / -1; font-size: .9375rem; }
.walk.has-list .walk-end { margin-top: 6px; }
@media (max-height: 720px) { .walk.has-list .walk-sub { display: none; } .walk.has-list { gap: 8px; padding-top: 8px; } .walk.has-list .btn.walk-main { min-height: 72px; } .walk.has-list .walk-bar { gap: 5px; padding-top: 6px; } .walk.has-list .btn.walk-other { min-height: 44px; } }
.walk-pick .walk-chips { max-height: 40vh; overflow-y: auto; }
.walk-saved.walk-flash { background: var(--surface); }
.walk-title { display: grid; gap: 4px; min-width: 0; }
.walk-before .walk-title input { min-height: 44px; padding-block: 6px; }
.walk-title label, .walk-rename label { font-weight: 800; }
.walk-title input, .walk-rename input { font: inherit; min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; width: 100%; min-width: 0; color: var(--ink); background: var(--surface); }
.walk-title .walk-chips.is-row { margin-inline: 0; padding-inline: 0; }
.walk-rename { display: grid; gap: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.walk-rename .btn { min-height: 48px; }
.walk-error .btn { margin-top: 6px; min-height: 44px; }
/* With the naming sheet (or the pick list) open, the state and the clock are one line above the buttons. */
.walk.has-sheet .walk-now { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 10px; padding: 0; }
.walk.has-sheet .walk-timer { font-size: 1.75rem; line-height: 1.1; }
.walk.has-sheet .walk-state { font-size: 1.25rem; }
.walk.has-sheet .walk-meta { display: none; }
.walk-bar .walk-now { padding: 0; }
/* 29 Nov 2026 (#199, #200): before the first tap of a walk that begins with an arrival the clock stands at 0:00; own steps in the list. */
.walk-bar .walk-now.is-ready, .walk.has-list .walk-now.is-ready { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline; column-gap: 10px; row-gap: 2px; }
.walk-now.is-ready .walk-meta { grid-column: 1 / -1; text-align: center; }
.walk-now.is-ready .walk-meta { font-size: 1rem; font-weight: 700; color: var(--navy); }
div.walk-rowbtn.is-own { cursor: default; }

@media (max-height: 720px) { .walk-bar .walk-timer { font-size: 3.5rem; line-height: 1; } .walk.has-sheet .walk-timer { font-size: 1.75rem; } }
.walk-side .walk-finish:disabled { opacity: 1; color: #5B6B7A; border-color: var(--line); background: transparent; cursor: default; }
.walk-bar .walk-confirm .form-actions { display: grid; gap: 6px; }
.walk-bar .walk-confirm .btn { justify-content: center; }
/* Walk list: steps after the visit sit under their own heading (28 Nov). */
.walk-after-head { margin-top: 8px; padding: 8px 4px 2px; border-top: 1.5px dashed var(--line-strong); font-size: .9375rem; color: var(--ink); }
.walk-after-head b { color: var(--navy); }
.bar-after { margin: 2px 0 0; font-size: .9375rem; color: var(--ink); }
/* "Check the names", the finish question of a first walk that kept the list's words (#170 point 3). */
.walk-check h1 { font-size: 1.375rem; margin: 0 0 2px; color: var(--navy); }
.walk-check h1:focus { outline: none; }
.walk-check .wc-lead { margin: 0 0 4px; font-size: 1rem; color: var(--ink); }
.walk-check .wc-foot { margin-bottom: 10px; font-size: .9375rem; }
.walk-bar .walk-confirm .wc-answers { grid-template-columns: 1fr 1fr; align-items: center; }
.walk-bar .walk-confirm .wc-answers > .btn:first-child { grid-column: 1 / -1; }
.wc-rows { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.wc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.wc-row.is-marked { border-style: dashed; border-color: var(--line-strong); }
.wc-what { min-width: 0; font-size: 1rem; color: var(--navy); overflow-wrap: anywhere; }
.wc-what .wc-role { color: var(--ink); }
.wc-what .wc-times, .wc-what .wc-mark { display: block; font-size: .9375rem; color: var(--ink); }
.wc-what .wc-mark { font-weight: 800; color: var(--navy); }
.wc-what .wc-mark::before { content: "◇ "; }
.wc-row .wc-change { min-height: 44px; min-width: 76px; justify-content: center; }
.wc-edit { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 4px; border-top: 1.5px solid var(--line); }
.wc-edit .wc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.wc-edit .walk-chip { min-height: 44px; }
.wc-edit .meta { margin: 0; font-size: .9375rem; }
/* Check the names: the person's own word for a step (ospeli/ospeli#220). One field and its button on one row. */
.wc-own { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; min-width: 0; }
.wc-own label { font-weight: 700; font-size: .9375rem; }
.wc-own-row { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.wc-own-row input { flex: 1 1 0; width: auto; min-width: 0; min-height: 44px; font-size: 1rem; }
.wc-own-row .btn { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
.wc-actions .wc-later { min-height: 44px; font: inherit; font-size: 1rem; font-weight: 700; color: var(--navy); text-decoration: underline; background: none; border: 0; cursor: pointer; justify-self: center; padding: 0 12px; }

/* Result page, crew night 9 (walk-first week, night 2): "Walk the next patient" is the main button
   on a walked map and in the list of maps; the headline first; one "How to read this". */
.map-list li.is-walked { display: grid; gap: 6px; }
.map-list a.btn.walk-again, .walk-again-box .btn.walk-again { display: flex; width: 100%; min-height: 52px; justify-content: center; text-align: center;
  background: var(--navy); color: #fff; border: 1.5px solid var(--navy); border-radius: 10px; font-weight: 800; font-size: 1.05rem; padding: 9px 16px; }
.map-list a.btn.walk-again:hover, .walk-again-box .btn.walk-again:hover { background: #12406A; }
.map-list a.btn.walk-again:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
@media (min-width: 641px) { .walk-again-box .btn.walk-again { width: auto; justify-self: start; padding-inline: 22px; } }
.walk-answer .wa-head { font-size: 1.15rem; line-height: 1.3; margin: 0; color: var(--navy); overflow-wrap: anywhere; }
.walk-answer .wa-head b { font-weight: 800; }
.walk-answer .read-this { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 2px; }
.walk-answer .read-this summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; color: var(--navy); font-size: 1rem; }
.walk-answer .read-this ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 1rem; color: var(--ink); }
@media print { .walk-answer .read-this > ul { display: grid; } .walk-again-box { display: none; } }
/* The answer's weight is on the longest wait; start to finish comes second. */
.walk-answer .wa-head { font-size: 1.3rem; line-height: 1.25; }
.walk-answer .wa-big b { font-size: 1.45rem; }
.walk-answer .read-this summary { list-style: none; gap: 8px; }
.walk-answer .read-this summary::-webkit-details-marker { display: none; }
.walk-answer .read-this summary::before { content: '▸'; color: var(--sea); font-size: 1.1rem; }
.walk-answer .read-this[open] summary::before { content: '▾'; }

/* ==== Result tab of a walked map (walk-first week, crew night 3: the one-screen result) ==========
   Tabs Result / Edit map, one bar per walk split by step, the step table, the actions row and the
   print page. Tokens only; text 15 px or more (13 px for captions); targets 44 px. */
.chip.walk-badge { text-transform: none; letter-spacing: 0; }
.map-head .map-tabs { flex: 1 1 100%; }
.map-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-top: 4px; }
.map-tab { font: inherit; font-size: 1rem; font-weight: 800; color: var(--ink-soft); background: none; border: 0; border-bottom: 4px solid transparent; min-height: 48px; padding: 0 18px; cursor: pointer; }
.map-tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }
.map-tab:focus-visible { outline: 3px solid var(--sea); outline-offset: -3px; border-radius: 8px 8px 0 0; }
@media (max-width: 640px) { .map-tab { flex: 1 1 0; padding: 0 8px; } }
.result-head { margin-bottom: 8px; }
.result-head h2 { overflow-wrap: anywhere; }
.result-head .walk-when { margin: 0; font-size: .9375rem; }
.result { display: grid; gap: 12px; min-width: 0; }
.result > * { min-width: 0; margin: 0; }
.result .pm-stats { margin: 0; }
/* Bars: waiting hatched in mango, hands-on solid sea, a thin gap between steps; the longest wait outlined in coral and said in words. */
.result-bars .bar-row { margin-bottom: 10px; }
.rbar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; background: var(--sand); }
.rbar i { display: block; height: 100%; flex: none; }
.rbar i.gap { box-shadow: inset 2px 0 0 var(--surface); }
.rbar i.w, .rsw.w { background: repeating-linear-gradient(135deg, var(--mango) 0 4px, #F8CB70 4px 8px); }
.rbar i.k, .rsw.k { background: var(--sea); }
.rbar i.p, .rsw.p { background-color: var(--sand); background-image: repeating-linear-gradient(90deg, transparent 0 5px, var(--mango) 5px 8px); box-shadow: inset 0 0 0 1px #5B6B7A; }
.rbar i.n, .rsw.n { background-color: #E3E6EA; background-image: radial-gradient(#5B6B7A 1.2px, transparent 1.4px); background-size: 6px 6px; }
.rbar i.is-longest, .rsw.is-longest { outline: 3px solid var(--coral); outline-offset: -3px; }
/* A moment (one tap, no hands-on): a navy mark of no width where it happened, never a hands-on part. */
.rbar i.m { position: relative; width: 0; overflow: visible; }
.rbar i.m::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: var(--navy); }
.rbar i.m.m-start::after { left: 0; }
.rbar i.m.m-end::after { left: -3px; }
.rsw.m { width: 4px !important; background: var(--navy); border-radius: 1px; }
.result-bars .legend .key { font-size: .9375rem; }
.rsw { display: inline-block; width: 18px; height: 14px; border-radius: 3px; flex: none; }
.bar-longest { margin: 2px 0 0; font-size: .9375rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
/* Step numbers under each bar, at the start of each step's segments, and the minutes scale under the bars (#189 item 3). */
.rnums, .rscale { position: relative; }
/* The numbers sit on the bar itself, at the start of each step, on a white tab so they read over the stripes. */
.result-bars .bar-row .rnums { height: 30px; margin-top: calc(-30px - 4px); pointer-events: none; }
.rnum { position: absolute; top: 4px; font-size: .9375rem; line-height: 22px; min-width: 14px; text-align: center; font-weight: 800; color: var(--navy); white-space: nowrap; padding: 0 3px; margin-left: 3px; background: #fff; border-radius: 4px; }
.rnum.is-longest { box-shadow: 0 0 0 2px var(--coral); }
.rscale { height: 1.5rem; margin: 0 0 4px; border-top: 1.5px solid #5B6B7A; }
.rtick { position: absolute; top: 0; font-size: .9375rem; line-height: 1.4rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; padding-left: 3px; border-left: 1.5px solid #5B6B7A; }
.rtick.end { transform: translateX(-100%); border-left: 0; border-right: 1.5px solid #5B6B7A; padding: 0 3px 0 0; }
.rnum-key { display: inline-block; font-weight: 800; color: var(--navy); padding: 0 4px; background: #fff; border: 1px solid #5B6B7A; border-radius: 4px; line-height: 1.2; }
.result-bars .legend { gap: 4px 10px; }
.result-bars .legend .rsw { width: 16px; }
@media screen and (max-width: 640px) { .result-bars .bar-row { margin-bottom: 6px; } .result-bars .legend { margin-top: 4px; } }
/* The step table: one column per walk; on a phone the newest three, on paper or a wide screen the newest six. */
.result-table-card h3 { margin: 0 0 6px; }
.rtable { width: 100%; table-layout: fixed; border-collapse: collapse; }
.rtable caption { caption-side: top; text-align: left; font-size: .9375rem; color: var(--ink-soft); padding: 0 0 6px; }
.rtable caption b { font-size: 1.02rem; color: var(--ink); margin-right: 4px; }
.rtable th, .rtable td { font-size: .9375rem; text-transform: none; letter-spacing: 0; text-align: left; vertical-align: top; padding: 6px 4px; border-top: 1px solid var(--line); overflow-wrap: anywhere; color: var(--ink); background: none; }
.rtable thead th { font-weight: 800; border-top: 0; }
.rtable th[scope="row"] { font-weight: 400; }
.rtable th[scope="row"] b { font-weight: 800; }
.rtable thead th:first-child { width: 34%; }
.rtable.cols-1 thead th:first-child { width: 50%; }
.rt-role { color: var(--ink-soft); }
.rt-only { display: block; font-weight: 800; color: #5C3B00; }
.rtable tr.is-extra > *, .rtable tr.is-again > * { background: var(--mango-tint); }
.rt-again { display: block; font-weight: 800; color: #5C3B00; }
.rtable td[data-status="did-not-happen"], .rtable td[data-status="not-timed"], .rtable td[data-status="not-on-walk"] { color: var(--ink-soft); font-style: italic; }
.rtable .old6 { display: none; }
.note-phone { display: none; }
@media screen and (max-width: 640px) { .rtable .old3 { display: none; } .note-phone { display: block; } .note-wide { display: none; } }
/* On a phone each step is a block: its name and role across the width, its cells side by side under it. */
/* A phone: the header, the headline and the first bar on the first screen, above the dock. */
@media screen and (max-width: 640px) {
  .result-head { margin-bottom: 4px; gap: 4px; }
  .result-head h2 { margin: 0; }
  .result-head .back { min-height: 44px; }
  .result-head .map-tab { min-height: 44px; }
  .result { gap: 10px; }
  .result .walk-answer, .result .result-bars { padding-top: 10px; padding-bottom: 10px; }
  .result-bars h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .result .walk-answer .wa-head { font-size: 1.2rem; }
  .result .walk-answer .wa-big b { font-size: 1.3rem; }
}
@media screen and (max-width: 640px) {
  .rtable, .rtable tbody, .rtable thead, .rtable caption { display: block; }
  .rtable tr { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); column-gap: 8px; border-top: 1px solid var(--line); padding: 4px 0; }
  .rtable.cols-2 tr { --cols: 2; }
  .rtable.cols-3 tr { --cols: 3; }
  .rtable th, .rtable td { border-top: 0; padding: 1px 0; line-height: 1.35; }
  .rtable th[scope="row"] { grid-column: 1 / -1; }
  .rtable thead th.rt-stephead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rtable thead tr { border-top: 0; }
  .rtable th[scope="row"] b { display: inline; }
  .rtable tr.is-extra, .rtable tr.is-again { background: var(--mango-tint); padding-inline: 6px; }
  .rtable tr.is-extra > *, .rtable tr.is-again > * { background: none; }
  .result-actions .ra-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .result-actions .ra-row .btn { flex: 1 1 auto; padding-inline: 6px; font-size: .9375rem; }
}
.result-extras { margin-top: 6px; border-top: 1px solid var(--line); }
.result-extras > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--navy); list-style: none; }
.result-extras > summary::-webkit-details-marker { display: none; }
.result-extras > summary::before { content: '▸'; color: var(--sea); }
.result-extras[open] > summary::before { content: '▾'; }
.result-extras[open] > summary { margin-bottom: 4px; }
.result-extras ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; }
.result-extras h3 { margin: 0 0 6px; }
/* Actions: "Walk the next patient" first and widest, then Print, Copy as text, Download CSV, Share. */
.result-actions { display: grid; gap: 8px; }
.result-actions .walk-again-box { display: grid; gap: 4px; }
.result-actions .walk-again-box p { margin: 0; }
.ra-row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ra-row .btn { min-height: 44px; justify-content: center; text-align: center; font-size: 1rem; }
.copy-buffer { position: fixed; left: -9999px; top: 0; }
/* The foot of the Result tab: "How to read this" and "Mark a change", two folds side by side; an open one takes the whole row. */
.result-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 18px; border-top: 1px solid var(--line-strong); padding-top: 2px; }
.result-foot > * { flex: 0 1 auto; min-width: 0; }
.result-foot > [open], .result-foot > .result-read:has(details[open]) { flex-basis: 100%; }
/* Before and after a change (#189 item 6): "Mark a change", the line between the bars, the Before · After · Difference table and its caveat. No colour says better or worse. */
.result-change > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; color: var(--navy); font-size: 1rem; list-style: none; }
.result-change > summary::-webkit-details-marker { display: none; }
.result-change > summary::before { content: '▸'; color: var(--sea); font-size: 1.1rem; }
.result-change[open] > summary::before { content: '▾'; }
.result-change .rc-body { display: grid; gap: 8px; padding: 4px 0 8px; }
.result-change .rc-body p, .result-change.is-marked p { margin: 0; font-size: .9375rem; color: var(--ink); }
.result-change .rc-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.result-change select { font: inherit; min-height: 44px; padding: 6px 10px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
.result-change .btn { min-height: 44px; justify-self: start; }
.result-change .rc-body[hidden] { display: none; }
.result-bars .rb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.result-bars .rb-foot > * { flex: 0 1 auto; min-width: 0; }
.result-bars .rb-foot > .result-change.is-marked, .result-bars .rb-foot > .result-change:has(.rc-body:not([hidden])), .result-bars .rb-foot > .result-read:has(details[open]) { flex-basis: 100%; }
.result-change .rc-open { min-height: 44px; padding-left: 12px; padding-right: 12px; }
.rt-reason { display: block; font-style: italic; color: var(--ink); }
.walk-answer .wa-reason { font-weight: 700; }
.result-change.is-marked { display: grid; gap: 6px; padding: 10px 12px; border: 1.5px dashed #5B6B7A; border-radius: 12px; background: var(--surface); }
/* Scrolled to, the line and the foot of the bars stop clear of the dock and ribbon with room to spare (review fix 6). */
.result .bar-change, .result-bars .rb-foot { scroll-margin-bottom: 12px; }
.bar-change { margin: 2px 0 8px; padding-top: 6px; border-top: 2px dashed var(--navy); font-size: .9375rem; font-weight: 800; color: var(--navy); }
.rcompare .rc-diff { font-weight: 800; }
.rcompare tr.is-total > * { border-top: 2px solid var(--line-strong); }
.rcompare thead th:first-child { width: 28%; }
/* Under about 600 px each step of the before-and-after table is a block (review fix 3): the step and role, then
   "Before (2 walks): …", "After (1 walk): …", "Difference: …", each on its own line. Still a table to a screen reader. */
@media screen and (max-width: 599px) {
  .rtable.rcompare tr { display: block; padding: 6px 0; }
  .rtable.rcompare thead tr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0; }
  .rtable.rcompare th[scope="row"], .rtable.rcompare td { display: block; font-size: .9375rem; line-height: 1.4; padding: 1px 0; }
  .rtable.rcompare td::before { content: attr(data-label) ": "; font-weight: 800; }
  .rtable.rcompare tr.is-total > * { border-top: 0; }
  .rtable.rcompare tr.is-total { border-top: 2px solid var(--line-strong); }
}
.rc-caveat { margin: 8px 0 0; font-size: .9375rem; font-weight: 700; color: var(--ink); }
.result-read .read-this summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; color: var(--navy); font-size: 1rem; list-style: none; }
.result-read .read-this summary::-webkit-details-marker { display: none; }
.result-read .read-this summary::before { content: '▸'; color: var(--sea); font-size: 1.1rem; }
.result-read .read-this[open] summary::before { content: '▾'; }
.result-read .read-this ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 1rem; color: var(--ink); }
.print-only { display: none; }
/* One A4 page, portrait: no dock, tabs, buttons or ribbon; hatching and the outline survive black and white. */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body:has(.result) { background: #fff; font-size: 10pt; line-height: 1.3; }
  body:has(.result) .topbar, body:has(.result) .dock, body:has(.result) .walk-ribbon, body:has(.result) .skip, body:has(.result) .page-head,
  body:has(.result) .proposals, body:has(.result) .toast, .result-head .back, .result-head .map-tabs, .result-actions, .note-phone { display: none !important; }
  body:has(.result) main { padding: 0; max-width: none; }
  body:has(.result) .layout { min-height: 0; display: block; }
  .result { gap: 6px; }
  .result .card { box-shadow: none; border: 1px solid #888; padding: 6px 8px; break-inside: avoid; background: #fff; }
  .result-head h2 { font-size: 14pt; margin: 0; }
  .walk-answer .wa-head { font-size: 12pt; }
  .walk-answer .wa-big, .walk-answer .wa-line { font-size: 10pt; }
  .walk-answer .wa-big b { font-size: 12pt; }
  .result-bars .bar-row { margin-bottom: 4px; }
  .rbar { height: 16px; border: 1px solid #555; }
  .rbar i.w, .rsw.w { background: repeating-linear-gradient(135deg, #222 0 1.5px, #fff 1.5px 5px); }
  .rbar i.k, .rsw.k { background: #8a8a8a; }
  .rbar i.p, .rsw.p { background: repeating-linear-gradient(90deg, #fff 0 3px, #222 3px 4.5px); }
  .result-bars .bar-row .rnums { height: 13px; margin-top: calc(-13px - 1px); }
  .rnum { top: 1px; font-size: 7.5pt; line-height: 11px; padding: 0 2px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rnum.is-longest { box-shadow: 0 0 0 1.5px #000; }
  .rscale { height: 11pt; margin: 0 0 2px; }
  .rtick { font-size: 8pt; line-height: 11pt; }
  .rbar i.is-longest, .rsw.is-longest { outline: 2.5px solid #000; outline-offset: -2.5px; }
  .bar-label, .bar-longest, .bar-after, .result-bars .legend .key { font-size: 9pt; }
  .rtable caption { font-size: 8pt; padding-bottom: 2px; }
  .rtable th, .rtable td { font-size: 8.5pt; padding: 2px 3px; }
  .rtable .old3 { display: table-cell; }
  .result-extras > summary { min-height: 0; }
  .result-extras::details-content { content-visibility: visible; display: block; }
  .rtable .old6 { display: none; }
  .note-wide { display: block; }
  .result-extras ul, .result-read .read-this ul { font-size: 8.5pt; gap: 1px; margin: 2px 0; }
  .result-read .read-this summary { min-height: 0; font-size: 10pt; }
  .result-read .read-this summary::before { content: none; }
  .result-read details.read-this::details-content { content-visibility: visible; display: block; }
  .print-only { display: block; font-size: 8.5pt; color: #333; }
  .rbar, .rbar i, .rsw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rbar i.m::after, .rsw.m { background: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rtable th[scope="row"] b { display: inline; }
  .rtable tr.is-extra > *, .rtable tr.is-again > * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rt-only, .rt-again { display: inline; margin-left: 4px; }
  .result .result-read { break-inside: auto; }
  .walk-answer { gap: 0; }
  .result-head .walk-when { font-size: 9pt; }
  .result-change { display: none !important; }
  .result-foot, .result-bars .rb-foot { display: block; border: 0; padding: 0; margin-top: 2px; }
  .rc-caveat, .bar-change { font-size: 8.5pt; margin: 1px 0; padding-top: 1px; }
  .rcompare th, .rcompare td { font-size: 8pt; line-height: 1.15; padding: 1px 3px; }
  .rcompare thead th:first-child { width: 27%; }
  .rcompare thead th:nth-child(2) { width: 24%; }
  .rcompare thead th:nth-child(3) { width: 19%; }
  .walk-answer .wa-same { display: none; }
  .rbar { height: 13px; }
  .result-bars .bar-row { gap: 1px; margin-bottom: 2px; }
  .result-extras ul, .result-read .read-this ul { font-size: 8pt; line-height: 1.25; }
  .rtable th, .rtable td { line-height: 1.2; }
  .result-extras { margin-top: 2px; }
  .result-extras > summary::before { content: none; }
  body:has(.result) .page, body:has(.result) main > * { margin-bottom: 0; }
  .result h3 { font-size: 10pt; margin: 0 0 2px; }
  .result .meta { font-size: 8.5pt; }
}
/* #150: the check a person gets on their own screen, shown with an agent's proposal of the same numbers. */
.proposal-check { margin: 6px 0 0; padding: 6px 10px; font-size: 1rem; font-weight: 700; color: var(--navy); background: var(--mango-tint); border-left: 5px solid var(--mango); border-radius: 6px; overflow-wrap: anywhere; }
/* Crew night 7 (shell): Now's words over numbers that are not the department's own, its first
   "Walk a visit now", and a page whose code is not saved on this device yet. */
.kpi-whose { margin: 0 0 4px; font-weight: 700; }
.now-walk-start { margin-top: 4px; }
.page-not-saved .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.now-walks-first { margin-bottom: 18px; }

/* The extra step's sheet with the keyboard open on a short screen (ospeli/ospeli#219 point 3): the
   buttons no longer sit over the field being typed in, and the row of Pause and Undo gives its room. */
@media (max-height: 420px) {
  .walk-bar > .walk-extra .walk-sheet-foot { position: static; }
  .walk-bar:has(#wk-xname:focus) .walk-side { display: none; }
}
