:root {
    /* Clarksons Brand Guidelines v1.0, Sep 2026. The nine named colours, verbatim.
       "Never tint, screen or recolour the red. #EB1946 at full strength only" - so there
       is no --accent-bright any more: a hover changes to Ink rather than to another red.
       Flag pink is the ONE sanctioned red wash, and it is reserved for things that are
       actually flagged. Ordinary hover and selection use Card alt, because "if everything
       on the page is red, nothing on the page is". */
    --accent:        #EB1946;  /* Clarksons Red - accents, headings, rules, key numbers. Never body copy. */
    --pick:          #ECECEE;  /* Card alt - hover and selection */
    --flag:          #FFE3E9;  /* Flag pink - behind a red-flagged row or callout */
    --ground:        #FFFFFF;
    --surface:       #FFFFFF;
    --surface-2:     #F4F4F5;  /* Card - panel and card fills on white */
    --line:          #E2E2E4;  /* Rule - hairlines and table borders */
    --line-strong:   #C9C9CE;
    --ink:           #1A1A1A;  /* Ink - headings and body text, instead of pure black */
    --ink-2:         #55555A;  /* Muted - secondary text, captions, table body */
    --ink-3:         #808086;  /* Grey - footers, source lines, metadata */
    /* There is no green and no amber in this brand - the nine colours are the whole
       palette. The guide's own logic supplies the mapping: "mostly white and ink, with
       red pointing at the one thing that matters". So a state that is FINE goes quiet
       (Ink on Card) and a state that NEEDS SOMEBODY goes red. The variables keep their
       names because 57 call sites carry the meaning correctly already; only what they
       resolve to has changed. */
    --ok:            #1A1A1A;  /* was green. Fine is the default and should not shout. */
    --ok-soft:       #F4F4F5;  /* Card */
    --wait:          #EB1946;  /* was amber. Needs attention IS what red is for. */
    --wait-soft:     #FFE3E9;  /* Flag pink */
    /* Red IS the alert colour in this brand, and Flag pink is its background. That is
       the guide's own answer to a question the concept had been inventing. */
    --alert:         #EB1946;
    --alert-soft:    #FFE3E9;
    --label-paper:   #FFFFFF;
    --label-ink:     #1A1A1A;
    --shadow:        0 1px 2px rgba(16,32,31,.06), 0 8px 24px rgba(16,32,31,.07);
    --radius:        10px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      /* The guide defines dark exactly: "a black background with #1C1C1E cards and
         #C6C6CB body text". The red does NOT lift for dark - full strength only - and it
         does not have to, because it is never body copy. */
      --accent:        #EB1946;
      --pick:          #2A2A2E;
      --flag:          #3A1520;
      --ground:        #000000;
      --surface:       #1C1C1E;  /* Dark card */
      --surface-2:     #242427;
      --line:          #323236;
      --line-strong:   #4A4A50;
      --ink:           #F2F2F4;
      --ink-2:         #C6C6CB;  /* the guide's dark body text */
      --ink-3:         #8E8E95;
      --ok:            #F2F2F4;
      --ok-soft:       #242427;
      --wait:          #EB1946;
      --wait-soft:     #3A1520;
      --alert:         #EB1946;
      --alert-soft:    #3A1520;
      --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    }
  }
  :root[data-theme="dark"] {
    /* The guide defines dark exactly: "a black background with #1C1C1E cards and
       #C6C6CB body text". The red does NOT lift for dark - full strength only - and it
       does not have to, because it is never body copy. */
    --accent:        #EB1946;
    --pick:          #2A2A2E;
    --flag:          #3A1520;
    --ground:        #000000;
    --surface:       #1C1C1E;  /* Dark card */
    --surface-2:     #242427;
    --line:          #323236;
    --line-strong:   #4A4A50;
    --ink:           #F2F2F4;
    --ink-2:         #C6C6CB;  /* the guide's dark body text */
    --ink-3:         #8E8E95;
    --ok:            #F2F2F4;
    --ok-soft:       #242427;
    --wait:          #EB1946;
    --wait-soft:     #3A1520;
    --alert:         #EB1946;
    --alert-soft:    #3A1520;
    --shadow:        0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }

  html, body { height: 100%; }
  body {
    margin: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--ground);
    color: var(--ink);
    font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
  }
  * { box-sizing: border-box; }

  /* Double-tap zoom, killed properly.
     A staff code like 7731 puts two taps on the SAME key inside iOS's double-tap
     window, so Safari zooms the page instead of taking the second digit. Guided Access
     does not stop this and neither would user-scalable=no - it is a separate gesture
     from pinch. touch-action: manipulation disables double-tap zoom only; panning and
     pinch-to-zoom still work, so nothing accessible is taken away.
     Applied to everything tappable rather than just the keypad: the same trap is
     waiting on any repeated tap - two visitors in a row on the same host tile, +15
     minutes twice on a room panel, a person tapped twice on the board. */
  button, a, label, select, input, summary,
  [role="button"], [data-board], [data-key], [data-go], [data-acc] {
    touch-action: manipulation;
  }
  button { font: inherit; color: inherit; }
  :where(button, input, select, a, [tabindex]):focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
  }
  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  }

  .cond { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; letter-spacing: .01em; }
  /* Kept as a class name because the markup uses it, but there is no monospace face
     any more - the guide allows Arial and Calibri only. Every use of it was a timestamp,
     a phone number or a code, and all of those wanted tabular figures rather than a
     typewriter. Arial has them. Nothing becomes ambiguous: the pairing alphabet already
     excludes B I O S Z 0 1 2, and a staff code is four digits. */
  .mono { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-variant-numeric: tabular-nums; }
  .num  { font-variant-numeric: tabular-nums; }
  .eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: .13em;
    text-transform: uppercase; color: var(--ink-3);
  }

  /* ---------- demo chrome ---------- */
  .demobar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 16px;
    /* Ink, not red. A full-width red bar is the opposite of "accents only", and it
       would have competed with the one thing red is for on these screens. */
    background: var(--ink); color: #fff;
    border-bottom: 1px solid rgba(0,0,0,.18);
  }
  :root[data-theme="dark"] .demobar,
  :root[data-theme="dark"] .demobar,
  :root:not([data-theme="light"]) .demobar { background: #1C1C1E; color: #F2F2F4; }
  .demobar .tag {
    font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: 3px 7px; border: 1px solid currentColor; border-radius: 3px; opacity: .85;
  }
  .demobar .who { font-weight: 600; font-size: 14px; margin-right: auto; }
  /* Actions in the bar, not labels. These were using .tag - the style for "Concept"
     and "Alpha" - so two of the most-used controls in the admin area read as
     decoration and went unnoticed. They now match the buttons beside them. */
  .demobar .barlink {
    font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none;
    color: inherit; padding: 8px 14px; border-radius: 7px;
    background: rgba(255,255,255,.16); white-space: nowrap;
  }
  .demobar .barlink:focus { background: rgba(255,255,255,.3); }
  @media (hover: hover) { .demobar .barlink:hover { background: rgba(255,255,255,.3); } }
  .seg { display: flex; background: rgba(255,255,255,.16); border-radius: 7px; padding: 2px; gap: 2px; }
  :root[data-theme="dark"] .seg,
  :root:not([data-theme="light"]) .seg { background: rgba(0,0,0,.18); }
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .seg { background: rgba(255,255,255,.16); } }
  .seg button {
    border: 0; background: transparent; color: inherit; cursor: pointer;
    padding: 5px 11px; border-radius: 5px; font-size: 13px; font-weight: 600; white-space: nowrap;
  }
  .seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
  /* Everything in the bar one height: the dropdown, this switch and the Guide/Users buttons (21 Oct 2026). */
  .demobar .seg { box-sizing: border-box; height: 36px; }
  .demobar .seg button { padding-top: 0; padding-bottom: 0; }
  /* The branch dropdown in the bar is drawn by the page, not by Safari, at the height of the Guide and Users
     buttons beside it (Geoff, 21 Oct 2026: "dropdown box is old style and not height formatted as the newer
     style"). Safari's own control was 29px with its double arrow; the buttons are 36. Only the colour changes
     with the theme below - "background" there would wipe the arrow. */
  .picker {
    -webkit-appearance: none; appearance: none; box-sizing: border-box; height: 36px; cursor: pointer;
    background-color: rgba(255,255,255,.16); color: inherit; border: 0;
    border-radius: 7px; padding: 0 34px 0 14px; font: inherit; font-size: 13.5px; font-weight: 600; line-height: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffffff' stroke-opacity='.85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
  }
  .picker:focus { outline: none; background-color: rgba(255,255,255,.3); }
  :root[data-theme="dark"] .picker,
  :root:not([data-theme="light"]) .picker { background-color: rgba(0,0,0,.18); }
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .picker { background-color: rgba(255,255,255,.16); } }
  .picker option { color: var(--ink); background: var(--surface); }

  .stage { padding: 16px; max-width: 1140px; margin: 0 auto; }

  /* A bound device fills its screen. Without this a short screen - the staff keypad,
     a confirmation - stops two thirds down and the rest is page background, which
     reads as a web page rather than something mounted on a wall.
     A screen built from ONE panel (the kiosk steps) fills the height and centres its
     content. Screens built from several blocks (the board, the roll call) are lists
     and stay top-aligned, because centring a list is worse than leaving room under it. */
  .stage.device { min-height: 100dvh; display: flex; flex-direction: column; margin: 0; max-width: none; }
  .stage.device > #view { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  /* The FIRST panel grows to fill whatever height is left. Not :only-child - several
     screens append a second panel conditionally (the badge-printed confirmation), and
     a rule that matched only one of them would fill the screen on one visit and not
     the next. Content stays top-aligned: centring it would push the top of a long
     screen out of reach on a short device. */
  .stage.device > #view > .panel:first-child { flex: 1 1 auto; }
  /* The idle screen is not a .panel, so the rule above never reached it, and the
     touch-device rule below sizes it for the concept - 150px short, to leave room
     for a demo bar a device page does not have. So the frame stopped two thirds
     down and the footer anchored to ITS bottom sat part way up the iPad. Fill the
     view instead, and bleed over the stage padding so the white idle screen meets
     the edges rather than sitting in a 16px band of page background. */
  .stage.device > #view > .idlewrap { flex: 1 1 auto; min-height: 0; margin: -16px; }
  .note {
    font-size: 12.5px; color: var(--ink-3); margin: 0 0 14px;
    display: flex; gap: 7px; align-items: baseline;
  }
  .note b { color: var(--ink-2); font-weight: 600; }

  /* ---------- generic surfaces ---------- */
  .panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .pad { padding: 20px; }
  @media (max-width: 480px) { .pad { padding: 15px; } }

  h1, h2, h3 { margin: 0; text-wrap: balance; }
  .kiosk-h1 { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: clamp(28px, 6vw, 44px); font-weight: 700; line-height: 1.05; }
  .kiosk-sub { color: var(--ink-2); margin: 6px 0 0; font-size: clamp(14px, 2.4vw, 17px); }

  /* ---------- kiosk ---------- */
  .kioskfill {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 150px);
  }
  .kioskfill > .actions:last-child { margin-top: auto; padding-top: 22px; }
  .kioskfill .agreement { flex: 1 1 auto; height: auto; min-height: 210px; }
  @media (max-width: 700px) { .kioskfill { min-height: calc(100vh - 190px); } }

  /* ---------- print: only the record, nothing else ---------- */
  @media print {
    .demobar, .note, .actions, .hint, .subnav { display: none !important; }
    body, .stage { background: #fff !important; padding: 0 !important; max-width: none !important; }
    .paper { box-shadow: none !important; border: 0 !important; max-width: none !important; padding: 0 !important; }

    /* Browsers drop background colours when printing unless told not to. The header row
       is now white Arial on an ink fill, so without this the roll call prints with an
       INVISIBLE header - white on white - and the Flag pink behind a missing person
       disappears with it. Both are the two things on the page that must survive. */
    .paper, .paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .paper tr.missing td, .paper tbody tr.missing:nth-child(even) td { background: #FFE3E9 !important; }

    /* "Repeat the header row when a table runs over a page" - the guide's table rule,
       and it matters here more than in a report: Auckland has forty staff, so a roll
       call runs to a second page, and a page of names with no header is a page nobody
       can sign for. Rows must not split across the break either. */
    .paper thead { display: table-header-group; }
    .paper tr { break-inside: avoid; page-break-inside: avoid; }
    .paper h3 { break-after: avoid; page-break-after: avoid; }
    .paper .signgrid { break-inside: avoid; page-break-inside: avoid; }
  }
  .steps { display: flex; gap: 5px; margin-bottom: 16px; }
  .steps i {
    height: 3px; flex: 1; border-radius: 2px; background: var(--line);
  }
  .steps i.on { background: var(--accent); }

  .bigbtns { display: grid; gap: 11px; margin-top: 22px; }
  @media (min-width: 620px) { .bigbtns { grid-template-columns: repeat(3, 1fr); } }
  .bigbtn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    padding: 20px; border-radius: var(--radius); cursor: pointer; text-align: left;
    border: 1.5px solid var(--line-strong); background: var(--surface-2);
    transition: border-color .12s, background .12s, transform .08s;
  }
  @media (hover: hover) { .bigbtn:hover { border-color: var(--accent); background: var(--pick); } }
  .bigbtn:active { transform: translateY(1px); }
  .bigbtn .t { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 25px; font-weight: 700; }
  .bigbtn .d { font-size: 13px; color: var(--ink-2); }
  /* The company choice (24 Oct 2026): each company's logo with its name under it; one without a logo is its name, the
     same height, so the row lines up. */
  /* Livelier (Geoff, 24 Oct 2026: "can we make the companies page more alive?"): white cards that rise in one after
     another, a red bar that grows along the bottom on touch, and logos big enough to read from a step back. */
  .bigbtns.cos { gap: 16px; margin-top: 28px; }
  /* Four companies make two rows of two, not three and an orphan. */
  @media (min-width: 620px) { .bigbtns.cos.c2 { grid-template-columns: repeat(2, 1fr); } .bigbtns.cos.c2 .bigbtn.co { min-height: 230px; } }
  .bigbtn.co {
    position: relative; overflow: hidden; align-items: center; justify-content: center; text-align: center; gap: 14px;
    min-height: 200px; padding: 24px 18px 26px; background: #fff; border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.18);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
    animation: coIn .42s cubic-bezier(.2,.8,.2,1) both;
  }
  .bigbtn.co::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
  }
  .bigbtn.co:nth-child(2) { animation-delay: .07s; } .bigbtn.co:nth-child(3) { animation-delay: .14s; }
  .bigbtn.co:nth-child(4) { animation-delay: .21s; } .bigbtn.co:nth-child(n+5) { animation-delay: .28s; }
  @media (hover: hover) { .bigbtn.co:hover { background: #fff; border-color: var(--line-strong); transform: translateY(-3px); } .bigbtn.co:hover::after { transform: scaleX(1); } }
  .bigbtn.co:active { transform: scale(.97); border-color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
  .bigbtn.co:active::after { transform: scaleX(1); }
  .bigbtn.co img { height: 96px; width: auto; max-width: 92%; object-fit: contain; mix-blend-mode: multiply; }
  .bigbtn.co .t { font-size: 24px; }
  .bigbtn.co.withlogo .t { font-size: 16px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
  .bigbtn.co .wm { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 700; font-size: 30px; letter-spacing: .1em; line-height: 1; }
  .bigbtn.co .wm em { display: block; font-style: normal; font-size: .42em; letter-spacing: .34em; color: #6B6B6B; margin-top: .45em; }
  @keyframes coIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .bigbtn.co { animation: none; } .bigbtn.co, .bigbtn.co::after { transition: none; } }

  .keypad-wrap { width: min(340px, 100%); margin: 20px auto 0; flex: none; }
  .digits {
    font-size: 30px; font-weight: 600; letter-spacing: .04em; text-align: center;
    padding: 14px; border-radius: var(--radius); min-height: 62px;
    border: 1.5px solid var(--line-strong); background: var(--surface-2);
  }
  .digits .ph { color: var(--ink-3); font-weight: 400; }
  .miss {
    margin: 11px 0 0; padding: 11px 13px; font-size: 13.5px; border-radius: 8px;
    background: var(--wait-soft); border: 1px solid var(--wait); color: var(--ink-2);
  }
  .keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
  .key {
    padding: 17px 0; border-radius: 9px; cursor: pointer;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 27px; font-weight: 700;
    border: 1.5px solid var(--line-strong); background: var(--surface);
  }
  @media (hover: hover) { .key:hover { border-color: var(--accent); background: var(--pick); color: var(--accent); } }
  /* Clear and backspace were 15px beside 27px digits - unreadable at arm's length on
     an iPad. Same weight as the digits now; still muted, so they read as controls
     rather than as a thirteenth digit. */
  .key.alt { font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif; font-size: 21px; font-weight: 700; color: var(--ink-2); }
  /* Twice the size again, at Geoff's request from the iPad: the glyph is the whole
     label, and at 30px it read as a smudge from standing height. The line-height
     holds the key at the digits' height rather than letting the glyph grow the row. */
  .key.alt.del { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 54px; font-weight: 400; line-height: 27px; }

  /* Every dropdown, one look (Geoff, 21 Oct 2026: "check all dropdowns and make them nicer"): drawn by the page
     rather than the browser, one arrow, the same border and corners as the text boxes. 40px unless the boxes
     beside it are taller - .field and .fld make it 48. The list it opens is the NICE SELECT block's .nsel-menu.
     The colour is set as background-color everywhere below: the "background" shorthand would wipe the arrow. */
  select:not(.picker) {
    -webkit-appearance: none; appearance: none; box-sizing: border-box; cursor: pointer; max-width: 100%;
    font: inherit; font-size: 14px; line-height: 1.2; color: var(--ink);
    height: 40px; padding: 0 36px 0 12px; border: 1.5px solid var(--line-strong); border-radius: 8px;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23808086' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
  }
  @media (hover: hover) { select:not(.picker):not(:disabled):hover { border-color: var(--ink-3); } }
  select:not(.picker):not(:disabled):focus, select:not(.picker):not(:disabled)[aria-expanded="true"] { border-color: var(--accent); outline: none; }
  select:not(.picker):disabled { opacity: .55; cursor: default; }
  select option, select optgroup { color: var(--ink); background-color: var(--surface); }
  .nsel-menu {
    position: fixed; z-index: 2000; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
    max-width: min(440px, calc(100vw - 16px)); padding: 5px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 11px;
    box-shadow: 0 14px 34px rgba(0,0,0,.18), 0 2px 7px rgba(0,0,0,.08);
    font-size: 14px; line-height: 1.3; animation: nselIn .12s ease-out;
  }
  @keyframes nselIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) { .nsel-menu { animation: none; } }
  .nsel-opt {
    position: relative; padding: 8px 14px 8px 32px; border-radius: 7px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; -webkit-user-select: none;
  }
  .nsel-opt.on { background: var(--pick); }
  .nsel-opt[aria-selected="true"] { font-weight: 700; }
  .nsel-opt[aria-selected="true"]::before {
    content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 5px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(-45deg);
  }
  .nsel-opt[aria-disabled="true"] { color: var(--ink-3); cursor: default; }
  /* A dropdown marked data-search gets a box to type into at the top of its list (30 Oct 2026). */
  .nsel-q {
    position: sticky; top: -5px; z-index: 1; display: block; width: 100%; box-sizing: border-box; margin: -5px 0 4px;
    padding: 9px 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
    border: 0; border-bottom: 1px solid var(--line); border-radius: 11px 11px 0 0; outline: none;
  }
  .nsel-none { padding: 8px 14px; color: var(--ink-3); }
  .nsel-group { padding: 9px 14px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

  .fields { display: grid; gap: 13px; margin-top: 4px; }
  @media (min-width: 620px) { .fields.two { grid-template-columns: 1fr 1fr; } }
  .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
  .field .req { color: var(--alert); }
  .field input {
    padding: 12px 13px; font-size: 16px; border-radius: 8px;
    border: 1.5px solid var(--line-strong); background: var(--surface);
    color: var(--ink); width: 100%;
  }
  .field select { height: 48px; font-size: 16px; padding-left: 13px; width: 100%; }
  .field input::placeholder { color: var(--ink-3); }
  .field input:focus { border-color: var(--accent); }
  .field.bad input { border-color: var(--alert); background: var(--alert-soft); }
  .hint { font-size: 12px; color: var(--ink-3); line-height: 1.55; }

  /* The server's own forms - the admin login, device pairing, device registration and the
     contactless check-in a visitor fills in on their own phone - mark up their fields as
     .lbl and .fld. Nothing ever defined either, so every one of them rendered as browser
     defaults: the label an inline span sitting BESIDE the input rather than above it, and
     the input at whatever size the browser chose.

     That is why the pairing screen read "Pairing code [box]" on an iPad and only looked
     right on a phone, where it was narrow enough to wrap. The visitor check-in form had
     the same problem and nobody had looked at it on a handset.

     16px on the input for the same reason as everything else touchable: below that, iOS
     zooms the page the moment it takes focus. */
  .lbl {
    display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
    margin: 0 0 5px;
  }
  .fld {
    display: block; width: 100%; font: inherit; font-size: 16px;
    padding: 12px 13px; border-radius: 8px; color: var(--ink);
    border: 1.5px solid var(--line-strong); background: var(--surface);
  }
  .fld:focus { border-color: var(--accent); outline: none; }
  .fld::placeholder { color: var(--ink-3); }
  /* One height for a text box, a date and a dropdown side by side (Geoff, 16 Oct 2026: "make the visitor
     type the same height as the other cells"). Safari draws its own select and date controls otherwise. */
  input.fld, select.fld { box-sizing: border-box; height: 48px; line-height: 1.2; }
  select.fld {
    -webkit-appearance: none; appearance: none; padding: 0 38px 0 13px; font-size: 16px; width: 100%; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23808086' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
  }
  input.fld[type="date"] { -webkit-appearance: none; appearance: none; }
  .lbl + .fld { margin-bottom: 14px; }

  .yesno { display: flex; gap: 8px; }
  .yesno button {
    flex: 1; padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600;
    border: 1.5px solid var(--line-strong); background: var(--surface);
  }
  .yesno button[aria-pressed="true"] { border-color: var(--accent); background: var(--pick); color: var(--accent); }

  .photo {
    display: flex; align-items: center; gap: 14px; padding: 14px; flex-wrap: wrap;
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  }
  /* 62px was about 12mm on an iPad, and the live preview was the same size - a
     visitor was being asked to frame their face in a postage stamp. The preview is
     the size of a face on a screen at arm's length; the captured shot a little
     smaller, because by then it only needs to be recognisable. */
  .photo .frame {
    width: 132px; height: 132px; border-radius: 8px; flex: none;
    background: var(--surface-2); border: 1px solid var(--line-strong);
    display: grid; place-items: center; overflow: hidden;
  }
  .photo .frame.live { width: 240px; height: 240px; }
  .photo .frame span { font-size: 26px; }
  /* On the roll call: small, but enough to match a face at an assembly point. */
  .pshot {
    width: 38px; height: 38px; border-radius: 6px; object-fit: cover; flex: none;
    border: 1px solid var(--line); background: var(--surface-2);
  }
  .photo .frame img, .photo .frame video {
    width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
  }
  /* The front camera faces the visitor, so an unmirrored preview reads as backwards
     to the person looking at it. Mirror the PREVIEW only - the captured frame is not
     flipped, because a badge photo should match the person, not their reflection. */
  .photo .frame video { transform: scaleX(-1); }
  .sigwrap {
    margin-top: 13px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    background: var(--surface-2); padding: 11px 13px;
  }
  .sigwrap.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
  .sigpad {
    width: 100%; max-width: 560px; height: 210px; display: block; margin-top: 8px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--line-strong);
    touch-action: none; cursor: crosshair;
  }
  .sighead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .sighead .lbl2 { font-weight: 600; font-size: 13.5px; flex: 1 1 auto; }
  .camerr {
    margin-top: 8px; font-size: 12.5px; color: var(--alert); font-weight: 600;
  }
  .photo .frame.shot { background: var(--accent); color: var(--surface); }

  .hostgrid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  .host {
    padding: 13px; border-radius: var(--radius); cursor: pointer; text-align: left;
    border: 1.5px solid var(--line); background: var(--surface-2);
  }
  @media (hover: hover) { .host:hover { border-color: var(--accent); background: var(--pick); } }
  .host[aria-pressed="true"] { border-color: var(--accent); background: var(--pick); }
  .host .n { font-weight: 600; }
  .host .r { font-size: 12px; color: var(--ink-3); }
  .host .st { font-size: 11px; font-weight: 600; margin-top: 4px; }
  .host .st.out { color: var(--wait); }
  .host .st.in { color: var(--ok); }
  .host .cv { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
  /* Which branch, and which device, at the top of every evacuation screen (23 Oct 2026). Slim, for a phone. */
  /* A pinned bar, edge to edge, with the red rule under it: iOS paints a solid status bar above a pinned top bar and
     fades it above scrolling content (the VTR lesson, 8 Oct 2026). */
  .evac-id { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
    margin: -16px -16px 12px; padding: 10px 16px; border-bottom: 3px solid var(--accent); background: var(--surface);
    font-size: 14px; color: var(--ink-2); line-height: 1.3; }
  .evac-id b { color: var(--ink); font-size: 15px; }
  .evac-id .dv { margin-left: auto; color: var(--ink-3); font-size: 13px; }
  @media print { .evac-id { display: none !important; } }

  .agreement {
    height: 190px; overflow-y: auto; padding: 15px; font-size: 13.5px;
    border: 1.5px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2); color: var(--ink-2);
  }
  .agreement h4 { margin: 14px 0 5px; font-size: 13px; color: var(--ink); }
  .agreement h4:first-child { margin-top: 0; }
  .agreement p { margin: 0 0 8px; }
  .tick {
    display: flex; gap: 11px; align-items: flex-start; padding: 13px;
    border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
    cursor: pointer; margin-top: 11px;
  }
  .tick[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
  .tick[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); }
  .tick .box {
    width: 22px; height: 22px; flex: none; border-radius: 5px; margin-top: 1px;
    border: 2px solid var(--line-strong); display: grid; place-items: center;
    font-size: 14px; font-weight: 700; color: transparent;
  }
  .tick[aria-pressed="true"] .box { background: var(--ok); border-color: var(--ok); color: var(--surface); }

  .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
  .btn {
    padding: 13px 22px; border-radius: 8px; font-weight: 600; font-size: 15px;
    cursor: pointer; border: 1.5px solid transparent;
  }
  .btn.primary { background: var(--accent); color: #fff; }
  /* #EB1946 is the same in both themes, so white on red works in both and the
     theme-flipping overrides that used to be here are gone. */
  /* No second red exists - full strength only - so the hover goes to Ink. Ink and
     Surface both flip with the theme, so the pair stays legible in either; a
     hard-coded #fff here turned the button white-on-white in dark mode. */
  @media (hover: hover) { .btn.primary:hover { background: var(--ink); color: var(--surface); } }
  .btn.primary:disabled { opacity: .42; cursor: not-allowed; }
  .btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
  @media (hover: hover) { .btn.ghost:hover { border-color: var(--accent); color: var(--accent); } }
  .btn.wide { flex: 1; min-width: 140px; text-align: center; }

  /* ---------- badge / label ---------- */
  .done-wrap { display: grid; gap: 18px; }
  @media (min-width: 760px) { .done-wrap { grid-template-columns: 300px 1fr; align-items: start; } }
  .label {
    background: var(--label-paper); color: var(--label-ink);
    border: 1px solid var(--line-strong); border-radius: 5px;
    padding: 15px; box-shadow: var(--shadow);
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  }
  /* The captured photo, on the badge the visitor is handed. Floated so the details
     wrap around it exactly as they do on the printed label. */
  .label .lshot {
    float: right; width: 74px; height: 88px; object-fit: cover; margin: 0 0 6px 12px;
    border: 1px solid var(--line-strong); border-radius: 3px; background: #EEE;
  }
  .label .lname {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 31px; font-weight: 700;
    line-height: 1.05; margin-bottom: 1px; word-break: break-word;
  }
  .label .lco { font-size: 12px; margin-bottom: 11px; }
  .label hr { border: 0; border-top: 1px dashed #B0B0B0; margin: 10px 0; }
  .label .row { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin-bottom: 3px; }
  .label .row b { font-weight: 600; }
  .label .k { color: #666; }
  .label .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 11px; }
  .label .qr { width: 56px; height: 56px; flex: none; }
  .label .stamp { font-size: 9px; color: #666; letter-spacing: .04em; }
  .labelcap { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }

  .notif { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .notif .hd {
    padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
    font-size: 12px; font-weight: 600; color: var(--ink-2);
    display: flex; justify-content: space-between; gap: 10px; align-items: center;
  }
  .notif .bd { padding: 14px; }
  .esc { display: grid; gap: 8px; margin-top: 12px; }
  .escrow {
    display: flex; gap: 11px; align-items: center; padding: 10px 12px;
    border-radius: 8px; border: 1px solid var(--line); font-size: 13px; background: var(--surface-2);
  }
  .escrow.live { border-color: var(--wait); background: var(--wait-soft); }
  .escrow.done { border-color: var(--ok); background: var(--ok-soft); }
  .escrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
  .escrow.live .dot { background: var(--wait); animation: pulse 1.1s ease-in-out infinite; }
  .escrow.done .dot { background: var(--ok); }
  .escrow .t { flex: 1; min-width: 0; }
  .escrow .when { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

  /* ---------- room panel ---------- */
  .room-shell { display: grid; gap: 16px; }
  @media (min-width: 860px) { .room-shell { grid-template-columns: 1.35fr 1fr; align-items: start; } }
  .roomstate { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
  /* Free is the non-event. It gets an ordinary card and an ordinary hairline, so that
     from down the corridor the only panel doing anything is the one you cannot use. */
  /* Free in green, the way busy is in red (Geoff, 19 Oct 2026: "make the free block green too"). Outside the
     brand palette on purpose, like the resting panel and the test screen. */
  .roomstate.free { background: #E7F6EC; border-color: #1E9E57; }
  .roomstate.busy { background: var(--alert-soft); border-color: var(--alert); }
  .roomstate .rn { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: clamp(30px, 5.5vw, 42px); font-weight: 700; line-height: 1.05; }
  .roomstate .rs { font-size: 18px; font-weight: 600; margin-top: 2px; }
  .roomstate.free .rs { color: #157A43; }
  .roomstate.busy .rs { color: var(--alert); }
  /* Cannot see the calendar: neither Free nor Busy, so neither colour. */
  .roomstate.unknown { background: var(--surface-2); border-color: var(--line-strong); }
  .roomstate.unknown .rs { color: var(--ink-2); }
  .roomstate .rd { font-size: 14px; color: var(--ink-2); margin-top: 9px; }
  .quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
  .quick button {
    padding: 17px 5px; border-radius: 9px; cursor: pointer; text-align: center;
    border: 1.5px solid var(--line-strong); background: var(--surface);
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 24px; font-weight: 700;
  }
  .quick button small { display: block; font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif; font-size: 10.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; }
  @media (hover: hover) { .quick button:not(:disabled):hover { border-color: var(--accent); background: var(--pick); color: var(--accent); } }
  .quick button:disabled { opacity: .34; cursor: not-allowed; }
  .bookings { display: grid; gap: 0; }
  .bk {
    display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
  }
  .bk:last-child { border-bottom: 0; }
  .bk .bt { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; padding-top: 1px; }
  .bk .bw { font-weight: 600; }
  .bk .bo { font-size: 12px; color: var(--ink-3); }
  /* On a room that IS booked, red is already carrying the panel state. These three were
     also red, so the screen had five red things competing and the one that mattered -
     "In use" - stopped being the loudest. NOW is a positional marker and WALK-UP is
     provenance; neither is an alert. */
  .bk.now .bw { color: var(--ink); }
  .chip {
    display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; padding: 2px 6px; border-radius: 3px; vertical-align: 2px;
  }
  .chip.now { background: var(--ink); color: var(--surface); }
  .chip.walk { background: var(--pick); color: var(--ink-2); }

  /* ---------- evacuation ---------- */
  .evac-top { display: grid; gap: 11px; grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
  @media (max-width: 520px) { .evac-top { grid-template-columns: 1fr 1fr; } }
  .tile { padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
  .tile .v { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 38px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
  .tile .k { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
  .tile.out { border-color: var(--alert); background: var(--alert-soft); }
  .tile.out .v { color: var(--alert); }
  .tile.in { border-color: var(--line); background: var(--surface-2); }
  .tile.in .v { color: var(--ink); }

  .group { margin-bottom: 18px; }
  .grouphd {
    display: flex; align-items: baseline; gap: 9px; margin-bottom: 7px;
    padding-bottom: 5px; border-bottom: 2px solid var(--line-strong);
  }
  .grouphd h3 { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 21px; font-weight: 700; }
  .grouphd .c { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: auto; }
  .person {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 12px 13px; border-radius: 8px; cursor: pointer; margin-bottom: 6px;
    border: 1.5px solid var(--line); background: var(--surface);
  }
  @media (hover: hover) { .person:hover { border-color: var(--accent); } }
  .person.ok { border-color: var(--line); background: var(--surface-2); }
  .person .mark {
    width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
    border: 2px solid var(--line-strong); font-size: 15px; font-weight: 700; color: transparent;
  }
  .person.ok .mark { background: var(--ok); border-color: var(--ok); color: var(--surface); }
  .person .pn { font-weight: 600; }
  .person .pm { font-size: 12px; color: var(--ink-3); }
  .person .pm.likely { display: inline-block; margin-top: 4px; padding: 2px 7px; border-radius: 4px; background: var(--wait-soft); color: var(--ink); font-weight: 600; }
  .person .pr { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
  .person .pr .tel { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-variant-numeric: tabular-nums; }
  /* nowrap because a badge is one word by intent. Without it "SYSTEM TEST" broke over two
     lines in the records table on a phone and doubled the height of every row. */
  .badge-sm {
    font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px; background: var(--surface-2); color: var(--ink-3);
    border: 1px solid var(--line); white-space: nowrap; display: inline-block;
  }
  .badge-sm.stale { background: var(--pick); color: var(--ink-2); border-color: var(--line-strong); }
  .badge-sm.flag  { background: var(--flag); color: var(--accent); border-color: var(--accent); font-weight: 700; }

  .empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }

  /* ---------- settings ---------- */
  /* The Rules tab (24 Oct 2026). */
  .rulegrid { display: grid; gap: 16px; margin-top: 16px; }
  @media (min-width: 900px) { .rulegrid { grid-template-columns: 1fr 1fr; } }
  .rulecard h3 { margin: 0 0 8px; font-size: 17px; }
  .rulecard ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
  .rulecard li + li { margin-top: 6px; }
  .rulecard .rulenote { list-style: none; margin-left: -18px; font-size: 12.5px; color: var(--ink-3); }
  .rulenum { width: 64px; padding: 4px 6px; font: inherit; border: 1px solid var(--line-strong); border-radius: 6px; text-align: center; }
  .rulemsg { padding: 12px 0; border-top: 1px solid var(--line); }
  .rulemsg .lab strong { display: block; } .rulemsg .lab span { font-size: 12.5px; color: var(--ink-3); }
  .rulemsg textarea { margin-top: 8px; width: 100%; resize: vertical; }
  .rulemsg .msgex { margin-top: 8px; font-size: 13.5px; background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
  .rulemsg .msgex span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-right: 6px; }
  .setrow {
    display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
    padding: 17px 0; border-bottom: 1px solid var(--line);
  }
  .setrow:last-child { border-bottom: 0; }
  .setrow.missing {
    background: var(--alert-soft); border-left: 4px solid var(--alert);
    padding: 15px 14px; border-radius: 8px; margin: 6px 0;
    border-bottom-color: transparent;
  }
  .setrow.missing .lab strong { color: var(--alert); }
  .setrow .warn {
    display: block; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--alert);
  }
  .setrow .lab { flex: 1 1 210px; min-width: 0; }
  .setrow .lab strong { display: block; font-size: 14.5px; }
  .setrow .lab span { font-size: 12.5px; color: var(--ink-3); }
  .setrow .ctl { flex: 0 1 auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  /* For a control that is a table or anything else tall: the label sits above it and the
     content gets the full width, instead of a short label reserving a column it cannot
     fill and squeezing the table into what is left. */
  .setrow.stacked { display: block; }
  .setrow.stacked .lab { margin-bottom: 11px; }
  .setrow.stacked .lab span { max-width: 68ch; }
  .setrow.stacked .ctl { display: block; }
  .setrow input[type="time"] {
    font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2);
    border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 9px 11px;
    font-variant-numeric: tabular-nums;
  }
  .daypick { display: flex; gap: 5px; flex-wrap: wrap; }
  .daypick button {
    width: 42px; padding: 9px 0; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
    border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-3);
  }
  .daypick button[aria-pressed="true"] { border-color: var(--accent); background: var(--pick); color: var(--accent); }

  .asleep {
    position: fixed; inset: 0; z-index: 60; background: #05100F; color: #DCE7E5;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 9px; text-align: center; padding: 30px; cursor: pointer;
  }
  .asleep .clock {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: clamp(60px, 16vw, 128px);
    font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: #F2F7F6;
  }
  /* The wall clock. These are screens mounted in receptions and beside doors, and a
     device showing the time is the cheapest way for somebody to trust that it is awake
     and current rather than a frozen page nobody has noticed died. */
  .wallclock {
    font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .01em;
    white-space: nowrap;
  }
  .wallclock .ap {
    font-size: .68em; font-weight: 600; letter-spacing: .05em; margin-left: .14em;
    text-transform: uppercase; opacity: .68;
  }
  /* One footer row rather than two independent corners. Both sat at bottom:5%, but the
     QR carries a two-line caption so the code itself floated well above the clock and the
     pair read as two unrelated things. Aligned on one baseline, they read as a footer. */
  .idlefoot {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 4%; padding: 0 5% 4.5%;
  }
  .idleclock { font-size: clamp(11px, 2.6cqw, 17px); color: #6B6B6B; padding-bottom: 2px; }
  .buildstamp { display: block; font-size: 10px; color: #9A9A9E; letter-spacing: .04em; text-align: left; }
  .roomclock { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
  .board-head .wallclock { font-size: 20px; color: var(--ink-2); }
  .asleep .clock .ap {
    font-size: .3em; font-weight: 600; letter-spacing: .06em; margin-left: .12em;
    text-transform: uppercase; color: #9FB6B3; vertical-align: .55em;
  }
  .asleep .where { font-size: 17px; font-weight: 600; letter-spacing: .02em; color: #9FB6B3; }
  .asleep .re { font-size: 14px; color: #6F8785; margin-top: 16px; }
  .asleep .tap {
    margin-top: 26px; padding: 15px 26px; border: 1.5px solid #365049; border-radius: 30px;
    font-size: 15px; font-weight: 600; color: #BFD4D1;
  }
  /* The kiosk's: a big red button, so a resting kiosk reads as the place to sign in, not one more clock on the table
     (Geoff, 24 Oct 2026: "my granddaughter asked why we have so many clocks on the table"). */
  .asleep .tap.signin {
    margin-top: 34px; padding: 22px 52px; border: 0; border-radius: 14px; background: #EB1946; color: #fff;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: clamp(24px, 3.6vw, 38px); font-weight: 700;
    box-shadow: 0 8px 28px rgba(235, 25, 70, .35);
  }
  /* The room's state on a resting panel: busy is the one thing worth reading from the corridor. */
  .asleep .roomrest {
    margin-top: 18px; padding: 12px 26px; border-radius: 12px; font-weight: 700;
    font-size: clamp(20px, 4.6vw, 34px); letter-spacing: .01em;
  }
  /* The room's name on the clock screen, three times the usual 17px (Geoff, 19 Oct 2026: "make the name of
     the room larger, like tripple" - "only change the clock screen room size"). A long name wraps. */
  .asleep .roomname { font-size: 51px; line-height: 1.05; color: #DCE7E5; text-wrap: balance; max-width: 92vw; }
  .asleep .roomrest.busy { background: #EB1946; color: #fff; }
  /* Free is green (Geoff, 19 Oct 2026) - outside the brand palette on purpose, like the test screen: from the
     corridor, red and green is the whole message. */
  .asleep .roomrest.free { background: #1E9E57; color: #fff; }
  .asleep .roomrest.unknown { background: #55555A; color: #fff; }
  /* Today's meetings under the room's state on the clock screen (Geoff, 5 Nov 2026: "a preview of meetings booked
     for the day so you notice it without having to tap the screen"). The one on now is marked; finished ones are gone. */
  .asleep .restday { margin-top: 20px; display: grid; grid-template-columns: auto auto; width: fit-content; max-width: 92vw; text-align: left; }
  .asleep .restday .rdh { grid-column: 1 / -1; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6F8785; padding: 0 14px 6px; }
  /* Centred under the room's state (Geoff, 5 Nov 2026: "can we just center the meeting"): two columns only as wide as
     what is in them, so the time and the name sit together and the block centres as one. */
  .asleep .rdr { display: contents; }
  .asleep .rdr > span { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid #1C2E2B; font-size: clamp(17px, 2.7vw, 23px); color: #DCE7E5; }
  .asleep .rdr .t { font-variant-numeric: tabular-nums; font-weight: 600; color: #9FB6B3; white-space: nowrap; padding-right: 22px; }
  .asleep .rdr .w { font-weight: 600; white-space: nowrap; min-width: 0; max-width: 56vw; }
  .asleep .rdr .w b { font-weight: inherit; overflow: hidden; text-overflow: ellipsis; }
  .asleep .rdr.now > span { background: rgba(235, 25, 70, .18); border-top-color: transparent; }
  .asleep .rdr.now > span:first-child { border-radius: 10px 0 0 10px; color: #fff; }
  .asleep .rdr.now > span:last-child { border-radius: 0 10px 10px 0; }
  .asleep .rdr.now + .rdr > span { border-top-color: transparent; }
  .asleep .rdr .nowtag { flex: 0 0 auto; background: #EB1946; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 10px; }
  .asleep .rdmore { grid-column: 1 / -1; text-align: center; font-size: 14px; color: #6F8785; padding: 8px 14px 0; }

  /* ---------- in/out board ---------- */
  .board-head {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .board-head .tally { display: flex; gap: 18px; margin-right: auto; }
  .board-head .tally div { display: flex; align-items: baseline; gap: 6px; }
  .board-head .tally b {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 30px; line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  .board-head .tally .i b { color: var(--ink); }
  .board-head .tally .o b { color: var(--wait); }
  .board-head .tally span { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
  .placement {
    display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2);
    padding: 7px 11px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2);
    cursor: pointer;
  }
  .placement .sw {
    width: 34px; height: 19px; border-radius: 10px; background: var(--line-strong);
    position: relative; flex: none; transition: background .15s;
  }
  .placement .sw::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
    border-radius: 50%; background: var(--surface); transition: transform .15s;
  }
  .placement[aria-pressed="true"] .sw { background: var(--accent); }
  .placement[aria-pressed="true"] .sw::after { transform: translateX(15px); }

  .board-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
  .pt {
    text-align: left; padding: 15px; border-radius: var(--radius); cursor: pointer;
    border: 1.5px solid var(--line); background: var(--surface); position: relative;
    border-left-width: 5px; border-left-color: var(--line-strong);
  }
  @media (hover: hover) { .pt:hover { border-color: var(--accent); border-left-color: var(--accent); } }
  .pt.in  { border-left-color: var(--ok); }
  .pt.out { border-left-color: var(--wait); background: var(--surface-2); }
  .pt.locked { cursor: default; opacity: .78; }
  @media (hover: hover) { .pt.locked:hover { border-color: var(--line); border-left-color: var(--wait); } }
  /* Room for the Outlook badge, which is absolutely positioned top-right. Without it a
     long name runs underneath it - "Tracey Prentice" was the one that showed it. Reserved on
     every tile rather than only the badged ones, so names wrap in the same place whether
     somebody's leave came from Outlook or the board. */
  .pt .pn {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 22px;
    font-weight: 700; line-height: 1.12; padding-right: 62px;
  }
  .pt .pr { font-size: 12px; color: var(--ink-3); margin-bottom: 9px; }
  .pt .ps { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
  .pt.in .ps { color: var(--ok); }
  .pt.out .ps { color: var(--wait); }
  .pt .ps .d { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
  .pt .pc { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
  /* Smaller cards for the long lists on a crowded board - nobody in yet, and field staff (Geoff, 30 Oct 2026:
     "we need to make the cards smaller"). Twenty-four full cards pushed the board three screens long first thing
     in the morning. Away cards stay full size: they carry the reason and the cover, and there are few of them. */
  .board-grid.compact { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .board-grid.compact .pt { padding: 9px 11px; border-left-width: 4px; }
  .board-grid.compact .pt .pn { font-size: 16px; padding-right: 0; }
  .board-grid.compact .pt .src ~ .pn { padding-right: 44px; }
  .board-grid.compact .pt .pr { font-size: 11.5px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .board-grid.compact .pt .ps { font-size: 12px; }
  .board-grid.compact .pt .pc { margin-top: 2px; }
  .board-grid.compact .pt .src { top: 8px; right: 8px; }
  .pt .src {
    position: absolute; top: 11px; right: 11px; font-size: 9.5px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
    border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; background: var(--surface);
  }

  .scrim {
    position: fixed; inset: 0; background: rgba(8,18,20,.5); z-index: 50;
    display: grid; place-items: center; padding: 16px;
  }
  .sheet {
    width: min(460px, 100%); max-height: 88%; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 22px;
  }
  .sheet h2 { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 27px; font-weight: 700; line-height: 1.1; }
  .sheet .sub { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0; }
  .chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
  .chipbtn {
    padding: 9px 13px; border-radius: 18px; cursor: pointer; font-size: 13.5px; font-weight: 500;
    border: 1.5px solid var(--line-strong); background: var(--surface); white-space: nowrap;
  }
  /* A chip that is really a link (Print the staff door code) takes the text colour a button chip does, not the
     browser's link blue (Geoff, 19 Oct 2026). */
  a.chipbtn { color: inherit; text-decoration: none; display: inline-block; }
  @media (hover: hover) { .chipbtn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); } }
  /* A button that cannot be pressed has to look it (Geoff, 17 Oct 2026: "the 1 1/2 and 2 hour buttons ...
     dont work" - they were off, because the room was booked again sooner, and looked exactly like the rest). */
  .chipbtn:disabled { opacity: .38; border-style: dashed; cursor: not-allowed; }
  .chipbtn[aria-pressed="true"] { border-color: var(--accent); background: var(--pick); color: var(--accent); font-weight: 600; }
  .sheet .grp { margin-top: 17px; }
  .sheet .grp > .eyebrow { display: block; margin-bottom: 2px; }
  .chipbtn.more::after { content: " \25BE"; opacity: .6; }
  .chipbtn.more[aria-expanded="true"]::after { content: " \25B4"; opacity: .6; }
  .picklist {
    margin-top: 9px; border: 1.5px solid var(--line-strong); border-radius: 10px;
    overflow: hidden; background: var(--surface-2);
  }
  .picklist button {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 13px 15px; font-size: 14.5px; background: transparent;
    border: 0; border-bottom: 1px solid var(--line);
  }
  .picklist button:last-child { border-bottom: 0; }
  @media (hover: hover) { .picklist button:hover { background: var(--pick); color: var(--accent); } }
  .picklist button[aria-pressed="true"] { background: var(--pick); color: var(--accent); font-weight: 600; }
  /* Type-to-search in place of a long select (27 Oct 2026): the list drops over the form rather than
     pushing it down, scrolls past eight or so, and looks like every other dropdown's list (.nsel-menu). */
  .field.prfield { position: relative; }
  .prdrop {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; box-sizing: border-box;
    max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding: 5px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 11px;
    box-shadow: 0 14px 34px rgba(0,0,0,.18), 0 2px 7px rgba(0,0,0,.08); font-size: 14px; line-height: 1.3;
  }
  .prdrop button {
    position: relative; display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
    padding: 8px 14px 8px 32px; border: 0; border-radius: 7px; background: transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .prdrop button.on { background: var(--pick); }
  @media (hover: hover) { .prdrop button:hover { background: var(--pick); } }
  .prdrop button[aria-pressed="true"] { font-weight: 700; }
  .prdrop button[aria-pressed="true"]::before {
    content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 5px;
    border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(-45deg);
  }
  .prdrop .sub { color: var(--ink-3); font-weight: 400; }
  .prdrop .none { padding: 9px 14px; font-size: 13.5px; color: var(--ink-3); }
  .coverline {
    display: flex; align-items: center; gap: 12px; margin-top: 6px;
    padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  }
  .coverline .who { font-weight: 600; flex: 1; min-width: 0; }
  /* One person on the roll call who is not accounted for. On a phone the name column and
     the box you type into were side by side, which left about 150px to write in - on the
     screen somebody is using one-handed, in an evacuation. Stacked, the box gets the width
     of the card. */
  @media (max-width: 620px) {
    .evacrow { flex-wrap: wrap; gap: 9px; }
    .evacrow > * { flex: 1 1 100% !important; }
    .evacrow input { padding: 12px 13px !important; }
  }
  .daterow {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 15px; border-top: 1px solid var(--line); background: var(--surface);
  }
  .daterow label { font-size: 14.5px; flex: 1; min-width: 0; }
  .daterow input[type="date"] {
    font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-2);
    border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 9px 11px;
    min-width: 0; max-width: 100%;
  }
  .linkish {
    border: 0; background: transparent; color: var(--accent); cursor: pointer;
    font-size: 13.5px; font-weight: 600; padding: 2px 2px; text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* ---------- roll call export document ----------
     This one is a DOCUMENT, not a screen, so it follows the brand guide's type table
     exactly: 21pt Arial Bold title, red section headings over a hairline, Calibri 11.5pt
     body, an ink header row in white Arial bold 8.5pt, alternating rows, hairline Rule
     borders and an 8pt grey footer. Sized in pt rather than px because it is printed
     and signed - pt is what the guide specifies and what a printer honours. */
  .paper {
    background: #fff; color: #1A1A1A; width: min(780px, 100%); margin: 0 auto;
    padding: 30px 34px; border: 1px solid var(--line-strong); border-radius: 3px;
    box-shadow: 0 6px 26px rgba(0,0,0,.14);
    font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif; font-size: 11.5pt; line-height: 1.45;
  }
  /* Kicker: Arial Bold, caps, +1.4pt tracking, 8.5pt, Clarksons Red. */
  .paper .kicker {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 700; font-size: 8.5pt;
    letter-spacing: 1.4pt; text-transform: uppercase; color: #EB1946;
  }
  .paper h2 {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 21pt; font-weight: 700;
    line-height: 1.08; margin: 0 0 2px; color: #1A1A1A;
  }
  /* Section heading: Arial Bold 15pt red, hairline rule beneath. */
  .paper h3 {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15pt; font-weight: 700; color: #EB1946;
    margin: 20px 0 0; padding-bottom: 4px; border-bottom: 1px solid #E2E2E4;
  }
  .paper .docref {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8pt; color: #808086; font-variant-numeric: tabular-nums;
  }
  .paper .rule { border: 0; border-top: 2px solid #EB1946; margin: 14px 0; }
  .paper .rule.thin { border-top: 1px solid #E2E2E4; }
  .paper .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; margin: 14px 0; }
  .paper .facts div span {
    display: block; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8.5pt; font-weight: 700;
    letter-spacing: 1.4pt; text-transform: uppercase; color: #EB1946;
  }
  .paper .facts div b { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 12pt; font-weight: 700; color: #1A1A1A; }
  .paper table {
    width: 100%; border-collapse: collapse; font-size: 11pt; margin-top: 6px; table-layout: fixed;
  }
  .paper th, .paper td {
    padding: 6px 8px; text-align: left; vertical-align: middle;
    background: transparent; border: 0; border-bottom: 1px solid #E2E2E4;
  }
  .paper td { color: #1A1A1A; }
  /* Table header row: Arial Bold on an ink fill, 8.5pt, white. */
  .paper thead th {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8.5pt; font-weight: 700; letter-spacing: .9pt;
    text-transform: uppercase; color: #FFFFFF; background: #1A1A1A;
    border-bottom: 0;
    /* Deliberately NOT nowrap. This is a fixed-layout table with set column widths, so
       a header that outgrows its column has to wrap - clipping it silently loses the
       word, and "ACCOUNTED FO" is what a warden would be signing under. It already
       happened once when the header type grew to the guide's 8.5pt. */
  }
  /* Alternating white and light rows, per the guide's table rule. */
  .paper tbody tr:nth-child(even) td { background: #F4F4F5; }
  /* NOT .tick - that is the site rules agreement control, and it is display:flex. */
  .paper th.acc, .paper td.acc { width: 132px; text-align: center; }
  .paper td.acc { font-size: 13pt; font-weight: 700; line-height: 1; }
  /* Flag pink behind a red-flagged row. The guide names this colour for exactly this,
     and it has to beat the alternating fill or every second missing person loses it. */
  .paper tr.missing td, .paper tbody tr.missing:nth-child(even) td { background: #FFE3E9; }
  .paper td:first-child { width: 27%; }
  .paper .signgrid { display: grid; gap: 22px 26px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 8px; }
  .paper .signgrid + .signgrid { margin-top: 20px; }
  .paper .signbox .lbl {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8.5pt; font-weight: 700;
    letter-spacing: 1.4pt; text-transform: uppercase; color: #EB1946;
  }
  .paper .signbox .line { border-bottom: 1px solid #1A1A1A; height: 30px; margin-top: 2px; }
  .paper .signbox .sub { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8pt; color: #808086; margin-top: 3px; }
  .paper .foot { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 8pt; color: #808086; margin-top: 18px; }

  /* ---------- evacuation broadcast ---------- */
  .bcast {
    position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2vh; text-align: center; padding: 5vw;
    color: #fff; animation: bcastflash 1.05s steps(1, end) infinite;
  }
  /* A system test is gold, with dark text (Geoff, 17 Oct 2026: "system test screens were gold and said system
     testing"). Deliberately outside the brand palette: a test has to be told apart from an evacuation at a
     glance across a room, and black was too close to the flashing red-and-black of the real thing. */
  .bcast.test { animation: none; background: #F2B330; color: #1A1A1A; }
  .bcast.test .eyebrow2, .bcast.test .meta { color: rgba(26,26,26,.78); }
  .bcast.test .where { background: rgba(255,255,255,.35); }
  @keyframes bcastflash { 0%, 49% { background: #EB1946; } 50%, 100% { background: #1A1A1A; } }
  @media (prefers-reduced-motion: reduce) { .bcast { animation: none; background: #EB1946; } }
  .bcast .eyebrow2 {
    font-size: clamp(12px, 2.4vw, 19px); font-weight: 700; letter-spacing: .3em;
    text-transform: uppercase; color: rgba(255,255,255,.8);
  }
  .bcast h1 {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 700; line-height: .95;
    font-size: clamp(38px, 11vw, 116px); letter-spacing: .01em;
  }
  .bcast .where {
    font-size: clamp(15px, 3vw, 27px); font-weight: 600; max-width: min(36ch, 88vw); text-wrap: balance;
    background: rgba(0,0,0,.26); padding: 2vh 4vw; border-radius: 10px;
  }
  .bcast .meta { font-size: clamp(11px, 1.8vw, 15px); color: rgba(255,255,255,.75); }
  .bcast .stopbtn {
    margin-top: 1vh; background: #fff; color: #EB1946; border: 0; cursor: pointer;
    font-weight: 700; font-size: clamp(13px, 2.2vw, 17px); padding: 1.6vh 5vw; border-radius: 6px;
  }
  .bcast.test .stopbtn { color: #1A1A1A; }
  .alarmbox.testmode { border-color: #C98F12; background: #FFF4D6; }

  .alarmbox { border: 2px solid var(--alert); border-radius: var(--radius); padding: 18px; background: var(--alert-soft); }
  /* A test must not look like the real thing. Ink, matching the test broadcast, which
     is also Ink rather than red. */


  /* ---------- kiosk idle screen ---------- */
  /* The concept used to draw the idle screen inside a bezel with a home button, at
     640px, with a Flip button under it. It looked like an iPad and nothing like the
     iPad: on the device the screen is the whole viewport, so the footer sat in a
     different place and the two could not be compared. Geoff, 25 Sep: "make the
     screen to the right look the same as the build." So the concept now lays it out
     the way a bound device does - fill the view, footer at the real bottom - and
     orientation is the shape of whatever it is opened on, as it is on the wall.
     The 150px is the demo bar plus stage padding; a device page has neither and
     overrides this under .stage.device. */
  .idlewrap { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 150px); }
  .idleframe {
    position: relative; width: 100%; flex: 1 1 auto; min-height: 0;
    background: #fff; container-type: size;
  }
  .idlescreen {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4%; padding: 6%;
    text-align: center; overflow: hidden; background: #fff;
  }
  .brandmain {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 700;
    font-size: clamp(22px, 6.5cqw, 46px); letter-spacing: .06em; color: #1A1A1A; line-height: 1;
  }
  .brandmain em { display: block; font-style: normal; font-size: .42em; letter-spacing: .34em; color: #6B6B6B; margin-top: .3em; }
  .brandrow { display: flex; gap: 5%; flex-wrap: wrap; justify-content: center; align-items: center; }
  .brandsub {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 600; font-size: clamp(10px, 2.6cqw, 17px);
    letter-spacing: .08em; color: #55555A; border-bottom: 2px solid #EB1946; padding-bottom: 2px;
  }
  .idlecta {
    background: #EB1946; color: #fff; border: 0; cursor: pointer;
    font-family: Calibri, Carlito, "Segoe UI", system-ui, sans-serif; font-weight: 700; letter-spacing: .04em;
    font-size: clamp(12px, 3cqw, 19px); padding: 3.5% 7%; border-radius: 4px;
  }
  /* Every :hover in this file sits inside @media (hover: hover). iOS keeps the LAST touch
     as a hover until the next one, so on an iPad this red button went black on refresh and
     stayed black until somebody touched something else. A screen that cannot hover gets
     no hover styles at all. */
  @media (hover: hover) { .idlecta:hover { background: #1A1A1A; } }
  .idleqr { width: 17%; max-width: 92px; text-align: center; }
  .arrival {
    position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
    padding: 9px 16px; background: #1A1A1A; color: #F2F2F4; font-size: 14px; text-align: left;
  }
  .arrival span { flex: 1 1 auto; min-width: 0; }
  .arrival button {
    font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 6px;
    border: 1px solid #55555A; background: transparent; color: inherit; cursor: pointer;
  }
  .idleqr .qr { width: 100%; height: auto; display: block; }

  /* On a touch device the frame IS the device. Stop drawing one around it, and
     drop the furniture that exists to explain the concept to somebody reading it
     on a laptop - the per-screen description, the orientation preview button and
     the artwork placeholder note. On real hardware they only eat the screen, and
     orientation is decided by turning the iPad over. The demo bar stays: it is
     how you move between the five screens while testing. */
  @media (hover: none) and (pointer: coarse) {
    /* iOS zooms the whole page whenever a focused field is under 16px, and then you are
       typing into a viewport that has moved. Found on a warden's phone: the roll call's
       "what was established" box is 14px, so tapping it zoomed the page mid-evacuation.
       Fifteen fields were under 16px; rather than chase each one, nothing on a touch
       device goes below it. Desktop admin keeps its compact sizing. */
    input, select, textarea { font-size: 16px !important; }
    #viewNote, .placeholdernote { display: none; }
    .idlewrap { min-height: calc(100dvh - 150px); }
  }
  .idleqr span { display: block; font-size: 9px; color: #6B6B6B; margin-top: 4px; line-height: 1.3; }
  .placeholdernote {
    font-size: 11.5px; color: var(--ink-3); text-align: center; max-width: 52ch;
  }

  .labpaper.landscape .lname { font-size: 26px; }
  .labpaper.landscape .lrow { display: flex; gap: 4mm; align-items: flex-start; }
  .labpaper.landscape .lmain { flex: 1 1 auto; min-width: 0; }
  .labpaper.landscape .lside { flex: 0 0 auto; text-align: center; }
  .labpaper.landscape .lphoto {
    width: 20mm; height: 25mm; background: #EEE; border: 1px solid #BBB; border-radius: 1mm;
    display: grid; place-items: center; font-size: 8px; color: #888;
  }
  .labpaper.landscape .qr { width: 17mm; height: 17mm; }

  /* ---------- logo uploads ---------- */
  .logogrid { display: grid; gap: 11px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .logoslot {
    border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
    background: var(--surface-2); padding: 13px; text-align: center;
  }
  .logoslot.filled { border-style: solid; border-color: var(--accent); background: var(--surface); }
  .logoslot .well {
    height: 62px; display: grid; place-items: center; margin-bottom: 9px;
    background: #fff; border-radius: 6px; border: 1px solid var(--line); overflow: hidden;
  }
  .logoslot .well img { max-width: 92%; max-height: 54px; object-fit: contain; }
  .logoslot .well span { font-size: 11px; color: #9AA; letter-spacing: .1em; }
  .logoslot .nm { font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
  .logoslot label {
    display: inline-block; cursor: pointer; font-size: 12.5px; font-weight: 600;
    color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  }
  .logoslot input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
  /* Sized against the screen (it is a size container), not percentages of a row with no height of its own - an uploaded
     division logo came out a few pixels tall (24 Oct 2026). By width: the height unit (cqh) resolved to 0 here. */
  .idlescreen img.grouplogo { height: clamp(80px, 17cqw, 260px); width: auto; max-width: 62cqw; object-fit: contain; }
  /* One row, and bigger (Geoff, 24 Oct 2026: "front page logos are still small"); multiply melts a logo's own white
     background into the screen, for files uploaded before trimming. */
  .idlescreen img.sublogo { height: clamp(52px, 11cqw, 150px); width: auto; max-width: 29cqw; object-fit: contain; mix-blend-mode: multiply; }
  .idlescreen .brandrow.logos { flex-wrap: nowrap; gap: 4cqw; }

  /* ---------- badge designer ---------- */
  .labdesign { display: grid; gap: 20px; }
  @media (min-width: 900px) { .labdesign { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: start; } }
  .labstage {
    display: grid; place-items: start center; padding: 18px; overflow-x: auto;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
    background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 8px 8px;
  }
  .labpaper {
    background: #FFFFFF; color: #0A0A0A; padding: 4mm; box-shadow: 0 2px 10px rgba(0,0,0,.18);
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; overflow: hidden; flex: none;
  }
  .labpaper .lname {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-weight: 700; line-height: 1.05; margin-bottom: 1px;
  }
  .labpaper .lco { font-size: 12px; margin-bottom: 3mm; }
  .labpaper hr { border: 0; border-top: 1px dashed #B0B0B0; margin: 2mm 0; }
  .labpaper .row { display: flex; justify-content: space-between; gap: 3mm; font-size: 10px; margin-bottom: 1mm; }
  .labpaper .k { color: #666; }
  .labpaper .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 3mm; margin-top: 3mm; }
  .labpaper .qr { width: 15mm; height: 15mm; flex: none; }
  .labpaper .stamp { font-size: 8px; color: #666; letter-spacing: .04em; }

  /* ---------- admin ---------- */
  .subnav {
    display: flex; gap: 2px; margin-bottom: 16px; flex-wrap: wrap;
    border-bottom: 2px solid var(--line);
  }
  .subnav button {
    border: 0; background: transparent; cursor: pointer; color: var(--ink-3);
    padding: 10px 15px; font-size: 14px; font-weight: 600;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
  }
  @media (hover: hover) { .subnav button:hover { color: var(--ink); } }
  .subnav button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
  .subnav .grouplabel {
    font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
    color: var(--ink-3); align-self: center; padding: 0 9px 0 3px;
  }
  .subnav .grouplabel + button { margin-left: -6px; }
  /* Break before Configuration so the two groups are deliberate rows. Left to wrap on
     its own, the last tab orphans onto a line by itself and the grouping disappears. */
  .subnav-break { flex-basis: 100%; height: 0; }
  .subnav { row-gap: 2px; }

  /* The Guide is prose, so it gets a reading measure - and the CARDS get the same one,
     because the fault was not that the intro was narrow but that it did not match what sat
     under it. One column, everything aligned, and no card body running to 130 characters a
     line either. */
  /* The Guide fills the page box, the same width as the tabs and heading above it (Geoff, 16 Oct 2026:
     "the previous header width was ok, but you weren't using it for the text below"). Full window width
     and two columns were both tried and both read badly. */
  .daystrip { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .daystrip .chipbtn { flex: 0 0 auto; }
  .rbtime { margin-top: 8px; display: grid; gap: 8px; }
  .rbtime .lbl { font-size: 13px; color: var(--ink-2); }
  .rbtime .chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .rbtime .rbhours .chipbtn, .rbtime .rbmins .chipbtn { min-width: 52px; justify-content: center; }
  .room-shell { touch-action: pan-y; }
  /* Bigger on the wall (Geoff, 5 Nov 2026, from a photo of the Boardroom panel: "make the Longer button bigger and the
     buttons behind it, make the free until statement text larger and just the right side column needs to have bigger
     font, 1/2 the ipad is empty"). Scoped to the room panel: the same classes are used on the kiosk and admin pages. */
  .room-shell .roomstate .rs { font-size: 24px; }
  .room-shell .roomstate .rd { font-size: 19px; line-height: 1.4; margin-top: 12px; }
  .room-shell .roomclock { font-size: 17px; }
  .room-shell .quick { gap: 12px; }
  .room-shell .quick button { padding: 26px 6px; font-size: 32px; border-radius: 12px; }
  .room-shell .quick button small { font-size: 13px; margin-top: 3px; }
  .room-shell .chips { gap: 10px; margin-top: 14px !important; }
  .room-shell .chipbtn { padding: 13px 22px; border-radius: 28px; font-size: 18px; font-weight: 600; }
  @media (min-width: 860px) { .room-shell { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
  .room-shell .daystrip { gap: 8px; flex-wrap: wrap; overflow-x: visible; }
  .room-shell .daystrip .chipbtn { padding: 10px 16px; font-size: 17px; }
  .room-shell .hint { font-size: 16px; line-height: 1.45; }
  .room-shell .eyebrow { font-size: 13.5px; }
  .room-shell .panel .bk { gap: 18px; padding: 14px 0; font-size: 20px; }
  .room-shell .panel .bk .bt { font-size: 18px; padding-top: 2px; }
  .room-shell .panel .bk .bo { font-size: 16px; margin-top: 2px; display: inline-block; }
  .room-shell .panel .chip { font-size: 12px; }
  .room-shell .panel .empty { font-size: 19px; }
  .room-shell .btn { font-size: 19px; padding: 15px 26px; }
  .guidewrap { max-width: none; }
  /* One column, full width (Geoff, 16 Oct 2026: "not two columns wide, hard as shit to read"). */
  .guidegrid > .panel { break-inside: avoid; }
  .guidetools { display: flex; flex-wrap: wrap; gap: 10px; }
  .guidewrap .gp { margin: 0 0 12px; max-width: none; }
  .guidewrap .gp:last-child { margin-bottom: 0; }
  .guidetools .btn { text-decoration: none; }
  .guidetools .guideq { flex: 1 1 260px; min-width: 0; max-width: 420px; font: inherit; font-size: 15px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
  /* Printed (and the PDF the build makes from /guide): A4, compact, no boxes - a document rather than a
     screen, so it is a few pages rather than nine (Geoff, 16 Oct 2026). */
  @media print {
    @page { size: A4; margin: 13mm 14mm 14mm; }
    html, body { background: #fff !important; }
    body { padding: 0 !important; }
    .demobar, .guidetools, .subnav, .note, #viewNote { display: none !important; }
    .guidewrap { font-size: 10pt; color: #1A1A1A; }
    .guidewrap .logtop { margin: 0 0 2mm; border: 0; padding: 0; }
    .guidewrap .logtop h2 { font-size: 17pt; }
    .guidewrap > .hint { font-size: 9pt !important; margin: 0 0 2mm !important; }
    .guidewrap .eyebrow { font-size: 8pt; color: #EB1946 !important; margin: 4mm 0 1.5mm !important;
      padding-bottom: 1mm; border-bottom: 0.6pt solid #EB1946; break-after: avoid; }
    .guidewrap .panel { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important;
      padding: 0 !important; margin: 0 0 2.6mm !important; break-inside: auto; orphans: 3; widows: 3; }
    .guidewrap .panel h3 { font-size: 10.5pt !important; margin: 0 0 0.6mm !important; color: #000 !important; break-after: avoid; }
    .guidewrap .panel > div { font-size: 9pt !important; line-height: 1.33 !important; color: #2A2A2A !important; orphans: 3; widows: 3; }
    .guidewrap .gp { margin: 0 0 1.2mm; }
  }
  .guidewrap .hint { max-width: none; }

  .logtop {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px;
  }
  .logtop h2 { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 30px; font-weight: 700; line-height: 1; }
  .logtop .cnt { font-size: 13px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }

  /* On site (21 Oct 2026): everybody signed in at a branch right now, visitors as cards with their photo. */
  .onsite-site { margin: 0 0 26px; }
  .onsite-site h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
  .onsite-site h3 .cnt { font-size: 13px; font-weight: 400; color: var(--ink-3); }
  .onsite-sub { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 8px; }
  .onsite-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
  .onsite-card { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; }
  .onsite-card .shot { width: 88px; height: 88px; flex: none; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
  .onsite-card .shot.none { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--ink-3); }
  .onsite-card .who { min-width: 0; flex: 1; }
  .onsite-card .nm { font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
  .onsite-card .co { font-size: 13px; color: var(--ink-2); margin: 1px 0 6px; overflow-wrap: anywhere; }
  .onsite-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 12.5px; }
  .onsite-card dt { color: var(--ink-3); }
  .onsite-card dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
  .onsite-card dd a { color: inherit; }
  .onsite-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
  .onsite-staff div { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 13.5px; min-width: 0; }
  .onsite-staff b { display: block; font-weight: 700; overflow-wrap: anywhere; }
  .onsite-staff span { color: var(--ink-3); font-size: 12px; }
  .onsite-none { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 0; }

  .filters {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    padding: 13px 15px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  }
  .filters input[type="search"] {
    flex: 1 1 210px; min-width: 0; font: inherit; font-size: 14.5px;
    padding: 9px 12px; border-radius: 8px; color: var(--ink);
    border: 1.5px solid var(--line-strong); background: var(--surface-2);
  }
  .filters select { background-color: var(--surface-2); }

  .tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  /* Eight columns never fit a phone, and the wrapper scrolls - but a table cut off flush
     at the edge looks broken rather than scrollable. Tighter cells fit more, and the
     shadow on the right edge only appears while there is something to scroll to. */
  @media (max-width: 620px) {
    .tablewrap {
      background:
        linear-gradient(to right, var(--surface) 30%, transparent),
        linear-gradient(to left, var(--surface) 30%, transparent) 100% 0,
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) 100% 0;
      background-repeat: no-repeat;
      background-size: 32px 100%, 32px 100%, 14px 100%;
      background-attachment: local, local, scroll;
    }
    table.log th, table.log td { padding: 9px 9px; }
    table.log th { font-size: 9.5px; letter-spacing: .06em; }
  }
  table.log { border-collapse: collapse; width: 100%; font-size: 14px; }
  table.log th {
    text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
    text-transform: uppercase; color: var(--ink-3); padding: 11px 13px;
    border-bottom: 2px solid var(--line); white-space: nowrap; background: var(--surface-2);
  }
  table.log td { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
  table.log tr.r { cursor: pointer; }
  @media (hover: hover) { table.log tr.r:hover td { background: var(--surface-2); } }
  table.log tr.r.open td { background: var(--pick); }
  table.log tr:last-child td { border-bottom: 0; }
  table.log .d { font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
  table.log .nm { font-weight: 600; white-space: nowrap; }
  table.log .still { color: var(--ok); font-weight: 600; }
  table.log .still.nosign { color: var(--wait); }
  table.log .mtgend { font-size: 11.5px; color: var(--ink-3); }

  .detail { padding: 0; }
  .detail .inner {
    padding: 16px 18px; background: var(--surface-2); border-left: 4px solid var(--ink);
  }
  .dgrid { display: grid; gap: 14px 26px; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
  .dgrid div span {
    display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px;
  }
  .dgrid div b { font-weight: 600; font-size: 14px; }
  .dgrid div .mono { font-size: 13px; }

  .exportbox {
    margin-top: 14px; padding: 14px 15px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line);
  }
  .exportbox pre {
    margin: 9px 0 0; padding: 12px; border-radius: 8px; overflow-x: auto;
    background: var(--surface-2); border: 1px solid var(--line);
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 11.5px; line-height: 1.65; color: var(--ink-2);
  }
