/* ===========================================================================
   OneScan - the components, taken from the prototypes.

   Every value here is the prototypes' own. Where the app had invented
   something, the invention is gone.

   The shell is: a 230px sidebar in the customer's colour (DHL's yellow
   for DHL; layouts/theme sets it), a white 60px top bar carrying
   a search and the primary action, and the page on #f8fafc. On a phone the
   sidebar becomes an off-canvas drawer worked by a checkbox and a scrim,
   which is how the prototypes already solved it - no script.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* Hidden means hidden. Any rule that sets display -- .btn's inline-flex
   among them -- used to beat the browser's own [hidden], so the guest
   panel showed "Resend code" to a guest with no code. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  font-family: var(--font);
  color: var(--ink);
  font-size: var(--t-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
/* A link shows itself on hover in ink and an underline, never in the
   accent. DHL's own rules say no important words in DHL Red, and an
   underline does not depend on telling two colours apart. Kept as weak as
   a selector can be, so any component that colours its own links wins. */
:where(a):hover { color: var(--ink); }
:where(a:not([class])):hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: var(--t-28); letter-spacing: -0.025em; }
h2 { font-size: var(--t-20); }
h3 { font-size: var(--t-16); font-weight: 700; }

.mono { font-family: var(--font-code); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ===========================================================================
   Focus -- one ring for everything a keyboard can reach
   ---------------------------------------------------------------------------
   An ink ring 2px out, with a 2px white band between it and the thing
   focused. Ink shows on every light screen and the white band shows on the
   dark ones -- the door, a message -- so it reads on any ground at well
   over 3:1. On the coloured menu the ring takes the menu's own text
   colour, which clears 5.5:1 against any colour the branding guard
   accepts.

   Important on purpose: screens switch outlines off one by one, and a
   keyboard user has no other way of knowing where they are.
   =========================================================================== */

:focus-visible {
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-halo);
}
.toast   { --focus-ring: #ffffff;          --focus-halo: var(--ink); }

/* Things that clip their edges get the ring drawn just inside instead. */
.ecard > a:focus-visible, .ecard-split > a:focus-visible,
.tscroll > a:focus-visible, .tcard > details > summary:focus-visible,
.tabs a:focus-visible {
  outline-offset: -4px; box-shadow: none;
}

/* A box or a page that took focus so a keyboard starts inside it is not
   itself something to press, so it shows no ring. */
#main:focus-visible, .sheet-box:focus-visible, .drawer-box:focus-visible,
.panel-dark:focus-visible, [role="dialog"]:focus-visible {
  outline: none !important; box-shadow: none;
}

/* The first thing a keyboard reaches on every staff screen: past the
   fifteen-row menu, straight to the page. Out of sight until focused. */
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-ctrl);
  background: var(--ink); color: #ffffff;
  font-size: var(--t-14); font-weight: 600;
  transform: translateY(-300%);
}
.skip:focus, .skip:hover { transform: none; color: #ffffff; }

/* ===========================================================================
   Shell
   =========================================================================== */

.shell { display: flex; min-height: 100vh; }

.nav-cb, .nav-toggle { display: none; }

/* The rail, as DHL's brand hub draws it, in white: a rounded panel standing
   off the window's edge, the logo on a tile of the workspace's colour, then
   an icon over each label, the active one on a grey pill. No headings or
   rules between items -- a stage of the event is a gap. The customer's
   colour is not the menu's ground, so the words are plain ink. */
.sidebar {
  width: var(--sidebar); flex: none;
  margin: 12px 0 12px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 12px;
  position: sticky; top: 12px; height: calc(100vh - 24px); overflow-y: auto;
  z-index: 20;   /* sticky makes its own layer: the event card must clear the page */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.sidebar:hover, .sidebar:focus-within { scrollbar-color: var(--line-strong) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--line-strong); }

.sidebar .brand { display: flex; justify-content: center; padding: 0 0 18px; }
.brand-tile {
  display: flex; align-items: center; justify-content: center;
  width: 84px; min-height: 30px; padding: 6px 8px; border-radius: 4px;
  background: var(--brand); color: var(--on-brand);
}
.sidebar .brand img { max-width: 100%; max-height: 26px; width: auto; display: block; }
.sidebar .brand .mark {
  font-size: 11px; font-weight: 800; line-height: 1.2; text-align: center;
  color: var(--on-brand); overflow-wrap: anywhere;
}

.navi {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 84px; padding: 11px 4px 10px; margin: 0 0 6px; border-radius: 10px;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.25; text-align: center;
  color: var(--ink); background: none; border: none; cursor: pointer;
  transition: background .12s;
}
.navi .t { overflow-wrap: anywhere; }
.navi:hover { background: var(--surface-2); color: var(--ink); }
/* The active item on a tint of the workspace's colour: the brand shows in
   the menu without the menu being painted in it. */
.navi.active { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.navi.active .count { background: var(--surface); }
.navi .ic { width: 24px; height: 24px; flex: none; display: flex; align-items: center; justify-content: center; }
.navi .ic svg { width: 22px; height: 22px; stroke-width: 2.25; }
/* Where work is waiting: a small count on the icon's corner. */
.navi .count {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 18px; padding: 1px 5px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink); border: 1px solid var(--surface);
  font-size: 10px; font-weight: 700; line-height: 1.4; text-align: center;
}
.navi .count.hot { background: var(--action); color: var(--on-action); }

/* The workspace's items after an event's: a little space, not a heading. */
.nav-gap { height: 10px; flex: none; }

.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; align-items: center; }
.side-foot form { margin: 0; }
/* Nothing on the rail shrinks: a long menu scrolls instead. */
.sidebar > *, .side-foot > * { flex: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  flex: none; position: sticky; top: 0; z-index: 10;
  /* The ground behind the floating bar, so the page scrolls away under it
     instead of showing through the gap above it. */
  background: var(--ground); padding: 12px 12px 0 12px;
}
/* The bar itself floats like the rail beside it: a white rounded panel,
   level with the rail's top, rather than a flat strip across the window. */
.topbar-in {
  height: var(--topbar);
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 18px 0 22px;
}
.topbar .where { font-size: var(--t-14); font-weight: 600; }

.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-ctrl); padding: 10px 14px; min-width: 300px;
}
/* The search sits at the right with the help menu and the page action
   beside it, one cluster, rather than alone in the middle of the bar. */
.topbar .search { margin-left: auto; margin-right: 0; }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input {
  font-family: inherit; font-size: var(--t-14); border: none; outline: none;
  background: transparent; color: var(--ink); width: 100%;
}
/* The box shows the focus, not the bare field inside it. It used to show
   nothing at all: the field's outline was switched off and nothing took
   its place. */
.search:focus-within {
  border-color: var(--ink);
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-halo);
}
.search input:focus-visible { outline: none !important; box-shadow: none; }

.page { padding: 12px 12px 72px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head .lead { margin-top: 9px; font-size: var(--t-14); color: var(--text); line-height: 1.55; max-width: 72ch; }
/* The title on the workspace's colour, as DHL's own sites set a page's
   head on yellow: a flat highlight ground with black words (or whichever
   of black and white reads on another customer's colour). */
.page-head.on-colour {
  background: var(--brand); color: var(--on-brand);
  border-radius: var(--r-card); padding: 26px 28px; margin-bottom: 24px;
  align-items: center;
}
.page-head.on-colour h1 { color: var(--on-brand); }
.page-head.on-colour .lead { color: var(--brand-quiet); }
.page-head.on-colour .lead strong { color: var(--on-brand); }

/* ===========================================================================
   Sections, cards
   =========================================================================== */

.sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.sec-h > .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--muted); box-shadow: 0 0 0 3px var(--line);
}
.sec-h > .dot.ok   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.sec-h > .dot.wait { background: var(--wait); box-shadow: 0 0 0 3px var(--wait-bg); }
.sec-t {
  font-size: var(--t-13); font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.sec-c {
  font-size: var(--t-12); font-weight: 600; color: var(--muted);
  background: var(--surface-3); padding: 2px 9px; border-radius: var(--r-pill);
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.card-head {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--surface-2);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.card-head h3 { font-size: var(--t-14); font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
/* DHL's yellow as a small mark before each card's title: the colour runs
   through every screen without painting its panels. */
.card-head h3::before {
  content: ''; flex: none; width: 4px; height: 16px; border-radius: 2px; background: var(--brand);
}
.card-head .sub { margin-top: 4px; font-size: var(--t-13); color: var(--text); line-height: 1.5; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--surface-2); font-size: var(--t-13); color: var(--text); }
/* Previous / next under a list (partials/pager). */
.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* The row above a list: a choice of what to show, and a search box. Shared
   by every list; the guest list and nominations still carry their own copy. */
.list-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 16px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border-radius: var(--r-ctrl); padding: 3px; }
.seg a { padding: 6px 12px; border-radius: calc(var(--r-ctrl) - 2px); color: var(--muted); text-decoration: none;
         font-size: var(--t-13); font-weight: 500; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg .n { color: var(--muted); font-weight: 400; margin-left: 3px; }
.f-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.f-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.f-search .inp { padding-left: 34px; }
@media (max-width: 620px) { .f-search { max-width: none; flex: 1 1 100%; } }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-side { grid-template-columns: minmax(0,1fr) 330px; }

/* ===========================================================================
   Stat tiles
   =========================================================================== */

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; }
.stat .lbl { font-size: var(--t-12); color: var(--muted); }
.stat .num { font-size: var(--t-28); font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.stat .sub { font-size: var(--t-12); color: var(--muted); margin-top: 4px; font-weight: 500; }
.stat .num.ok  { color: var(--ok); }
.stat .num.bad { color: var(--bad); }
.stat .sub.warn{ color: var(--wait-text); }

/* ===========================================================================
   Buttons
   =========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: var(--t-14); font-weight: 600;
  color: var(--on-action); background: var(--action);
  border: 1px solid var(--action); padding: 11px 18px;
  border-radius: var(--r-ctrl); cursor: pointer; white-space: nowrap;
}
/* DHL CI: the primary call to action is filled red, on any ground. */
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--on-action); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Secondary on white: outlined in red (DHL CI allows red secondaries on
   the white ground only). On yellow or any coloured ground, .on-colour
   turns it black, as the CI asks. */
.btn-2 {
  background: var(--surface); color: var(--action-text);
  border: 1px solid var(--action-text); font-weight: 600;
  transition: background .12s, color .12s, border-color .12s;
}
.btn-2:hover { background: var(--action-wash); border-color: var(--action-text); color: var(--action-text); }
.on-colour .btn-2, .on-colour .btn-2:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

.btn-ghost { background: transparent; border-color: transparent; font-weight: 600; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }

/* Destructive: a tinted fill, so it never looks like the red secondary. */
.btn-bad { background: var(--bad-wash); color: var(--bad-text); border-color: var(--bad-edge); font-weight: 600; }
.btn-bad:hover { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-edge); }

.btn-sm { font-size: var(--t-13); padding: 7px 13px; border-radius: var(--r-ctrl); font-weight: 600; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { font-size: var(--t-16); padding: 14px 24px; }
.btn-lg svg { width: 18px; height: 18px; }

.btn[disabled], .btn.is-off {
  background: var(--surface-2); color: var(--muted);
  border-color: var(--line); cursor: not-allowed;
}
.btn[disabled]:hover { background: var(--surface-2); }

/* ===========================================================================
   Forms
   =========================================================================== */

.field { margin-bottom: 16px; }
.lbl { display: block; font-size: var(--t-12); font-weight: 600; color: var(--text); margin-bottom: 7px; }
/* 16px, not 14: Safari on iOS zooms the whole page when a field smaller
   than that takes focus. Tapping "Full name" in the walk-in sheet magnified
   it and the match list had to be pinched back out before it could be read
   -- mid-queue, on a phone. */
.inp, .sel, .ta {
  font-family: inherit; width: 100%; font-size: var(--t-16); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-ctrl); padding: 10px 13px;
  transition: border-color .12s, box-shadow .12s;
}
/* The ring itself is the shared one (Focus, near the top). A field also darkens its border,
   which shows even when a mouse opened a list. It used to swap its outline
   for a yellow border and glow: about 1.9:1 and 1.1:1 on white, nearly
   invisible, and DHL's yellow on every customer's forms. */
.inp:focus, .sel:focus, .ta:focus { border-color: var(--ink); }
.ta { min-height: 120px; resize: vertical; line-height: 1.6; }

/* An amount: the currency sits inside the box, in front of the figures. */
.money-in { position: relative; }
.money-in .money-sym { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
                       color: var(--muted); font-size: var(--t-14); pointer-events: none; }
.money-in .inp { padding-left: 40px; font-variant-numeric: tabular-nums; }
.cf-input[hidden] { display: none; }
.sel { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.hint { font-size: var(--t-12); color: var(--muted); margin-top: 6px; line-height: 1.5; }
.err  { font-size: var(--t-12); color: var(--bad-text); margin-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-14); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }

/* ===========================================================================
   Pills, tags, meters - the prototypes' own
   =========================================================================== */

.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  font-size: var(--t-12); font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.pill.ok   { background: var(--ok-bg);   color: var(--ok-text); }
.pill.ok   .dot { background: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info-text); }
.pill.info .dot { background: var(--info); }
.pill.wait { background: var(--wait-bg); color: var(--wait-text); }
.pill.wait .dot { background: var(--wait); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad-text); }
.pill.bad  .dot { background: var(--bad); }
.pill.none { background: var(--none-bg); color: var(--none-text); }
.pill.none .dot { background: var(--none); }
.pill.vip  { background: var(--vip-bg);  color: var(--vip-text); }

.tag {
  display: inline-flex; align-items: center; padding: 4px 11px;
  border-radius: 6px; font-size: var(--t-13); font-weight: 500;
  background: var(--surface-2); color: var(--text);
}
.tag.code {
  font-family: var(--font-code); font-size: var(--t-12);
  background: var(--ground); color: var(--text); border: 1px solid var(--line);
}

.meter { height: 7px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ok); transition: width .5s cubic-bezier(0,0,.2,1); }
.meter.warn > span { background: var(--wait); }
.meter.full > span { background: var(--bad); }

/* ===========================================================================
   Tables
   =========================================================================== */

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: var(--t-12); font-weight: 600;
  color: var(--muted); text-transform: none; letter-spacing: 0;
  background: var(--surface); padding: 11px 16px; height: 40px;
  border-top: 1px solid var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--surface-2); vertical-align: middle; }
.tbl tbody tr { transition: background-color .12s; }
.tbl tbody tr:hover { background: var(--ground); }
.tbl .nm  { font-weight: 600; }
.tbl .sub { font-size: var(--t-12); color: var(--muted); margin-top: 2px; }
.tbl .right { text-align: right; }
.tbl-wrap { overflow-x: auto; }

/* ===========================================================================
   Notices
   =========================================================================== */

.note { display: flex; gap: 11px; align-items: flex-start; border-radius: var(--r-card); padding: 14px 16px; font-size: var(--t-13); line-height: 1.55; }
.note .ic { width: 24px; height: 24px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; font-size: var(--t-14); font-weight: 700; color: #fff; }
.note .ic svg { width: 14px; height: 14px; }
.note.info { background: var(--info-bg); color: var(--info-text); } .note.info .ic { background: var(--info); }
.note.ok   { background: var(--ok-bg);   color: var(--ok-text); }   .note.ok   .ic { background: var(--ok); }
.note.wait { background: var(--note-bg); color: var(--note-ink); border: 1px solid var(--note-edge); } .note.wait .ic { background: #1a1a1a; }
.note.bad  { background: var(--bad-wash); color: var(--bad-text); border: 1px solid var(--bad-edge); } .note.bad .ic { background: var(--bad); }

.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 8px; }

/* ===========================================================================
   Modal, flash
   =========================================================================== */

.sheet { position: fixed; inset: 0; z-index: 90; background: rgba(15,23,42,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: os-fade var(--m-base) var(--e-standard) both; }
.sheet-box { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; animation: os-pop var(--m-slow) var(--e-spring) both; }
.sheet-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.sheet-body { padding: 20px; }
.sheet-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }

.flash {
  position: fixed; left: 50%; bottom: 28px; z-index: 95;
  padding: 12px 20px; border-radius: var(--r-ctrl);
  font-size: var(--t-14); font-weight: 600;
  box-shadow: 0 10px 30px rgba(15,23,42,0.16);
  max-width: calc(100vw - 40px);
  animation: os-flash-in var(--m-slow) var(--e-spring) both;
}
.flash.ok  { background: var(--ok);  color: #fff; }
.flash.bad { background: var(--bad); color: #fff; }
/* Centre and entrance in one move, so the transform cannot fight itself. */
@keyframes os-flash-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Messages: a stack at the bottom, newest last. Each can carry Undo. */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px 11px 18px; border-radius: var(--r-ctrl);
  font-size: var(--t-14); font-weight: 600; color: #fff;
  box-shadow: 0 10px 30px rgba(15,23,42,0.18);
  animation: os-toast-in var(--m-slow) var(--e-spring) both;
}
.toast.ok  { background: var(--ink); }
.toast.bad { background: var(--bad-text); }
.toast button {
  background: transparent; border: 0; color: var(--brand-on-dark); font: inherit; font-weight: 700;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
/* On the red message the brand colour has no contrast to lean on. */
.toast.bad button:not(.x) { color: #ffffff; text-decoration: underline; text-underline-offset: 2px; }
.toast button:hover { background: rgba(255,255,255,0.1); }
.toast .x { color: rgba(255,255,255,0.7); font-size: 18px; line-height: 1; font-weight: 400; }
.toast.going { opacity: 0; transition: opacity .25s; }
@keyframes os-toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* The in-page confirm sits over any sheet it guards. */
.sheet.os-confirm { z-index: 110; }
.os-confirm h3 { font-size: var(--t-16); margin: 0 0 8px; color: var(--ink); }
.os-confirm p  { margin: 0; color: var(--text); font-size: var(--t-14); line-height: 1.55; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: var(--bad-text); color: #fff; }

/* A field the server sent back, and why. */
.inp-bad, .inp.inp-bad, .sel.inp-bad, .ta.inp-bad { border-color: var(--bad) !important; box-shadow: 0 0 0 3px var(--bad-bg); }
.field-err { color: var(--bad-text); font-size: var(--t-12); font-weight: 500; margin-top: 5px; }

/* A button while its form is on its way. */
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid var(--on-action); border-right-color: transparent; border-radius: 50%;
  animation: os-spin .7s linear infinite;
}
.btn-2.is-busy::after, .btn-bad.is-busy::after { border-color: var(--ink); border-right-color: transparent; }
.btn.is-busy[data-busy-text] { color: inherit !important; }
.btn.is-busy[data-busy-text]::after { display: none; }
@keyframes os-spin { to { transform: rotate(360deg); } }

/* ===========================================================================
   Helpers
   =========================================================================== */

.row  { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col  { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.quiet { color: var(--text); }
.small { font-size: var(--t-13); }
.tiny  { font-size: var(--t-12); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt1 { margin-top: 8px; }  .mt2 { margin-top: 16px; }
.mt3 { margin-top: 20px; } .mt4 { margin-top: 24px; } .mt5 { margin-top: 32px; }

/* ===========================================================================
   The drawer - the prototypes' own mobile shell, no script
   =========================================================================== */

/* ---------------------------------------------------------- the dashboard
   The event cards, the filter tabs and the past-events grid, lifted from
   dashboard.html. The card lifts 2px on hover and takes an edge in the
   customer's colour; that is the prototypes' own hover, not a new idea. */

.tabs {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-3); border-radius: 9px; padding: 3px;
  width: fit-content; max-width: 100%; overflow-x: auto;
}
.tabs a {
  font-size: 12.5px; font-weight: 600; padding: 7px 14px;
  border-radius: 7px; color: var(--muted); white-space: nowrap;
  transition: background .12s, color .12s;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.ecard {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.ecard:hover {
  border-color: var(--brand); box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  transform: translateY(-2px); color: inherit;
}
.ecard.live { border-color: #a7f3d0; }

/* A card is two links: the event itself, and its next step along the
   bottom. Clicking an event's name used to open its floor plan or its
   setup -- wherever the next step happened to be -- never the event. */
.ecard > a, .ecard-split > a { display: block; }
a.ecard-foot:hover { text-decoration: underline; text-underline-offset: 2px; }

.ecard-split { display: flex; flex-wrap: wrap; }
.ecard-split > .l { flex: 1; min-width: 280px; padding: 24px 26px; border-right: 1px solid var(--surface-2); }
.ecard-split > .r { flex: 1.2; min-width: 280px; padding: 24px 26px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.ecard-body { padding: 20px 22px; flex: 1 0 auto; }
.ecard-foot {
  padding: 12px 22px; background: var(--ground);
  border-top: 1px solid var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--text);
}
/* A next step waiting on someone: the customer's own highlight, not a
   fixed amber that read as DHL's yellow on everyone's dashboard. */
.ecard-foot.act { background: var(--note-bg); border-top-color: var(--note-edge); color: var(--note-ink); }

.kpi-n { font-size: var(--t-20); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.kpi-l { font-size: var(--t-11); color: var(--muted); margin-top: 4px; }
.kpi3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--surface-2);
}

.chip {
  font-size: var(--t-12); color: var(--text); background: var(--surface-2);
  padding: 4px 10px; border-radius: 7px;
}
.bullet { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--wait); }
.bullet.bad { background: var(--brand-accent); }
.bullet.ok  { background: var(--ok); }

.bar { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ok); }

.tscroll { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow-x: auto; }
.trow {
  display: grid; grid-template-columns: 2fr 1.3fr 0.9fr 0.9fr 0.8fr 120px;
  gap: 16px; padding: 0 22px; align-items: center;
}
.trow.head {
  height: 42px; background: var(--ground); border-bottom: 1px solid var(--line);
  font-size: var(--t-11); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tscroll > a { display: block; border-bottom: 1px solid var(--surface-2); }
.tscroll > a:last-child { border-bottom: none; }
.tscroll > a:hover { background: var(--ground); color: inherit; }

/* --------------------------------------------------------- the help menu */
.help { position: relative; }
.help > summary {
  list-style: none; cursor: pointer; color: var(--muted);
  width: 34px; height: 34px; border-radius: var(--r-nav);
  display: flex; align-items: center; justify-content: center;
}
.help > summary::-webkit-details-marker { display: none; }
.help > summary:hover { background: var(--surface-2); color: var(--ink); }
.help-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: 310px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 18px 44px rgba(15,23,42,0.14);
  padding: 7px; animation: os-pop .14s ease both;
}
.help-head {
  font-size: var(--t-11); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px 6px;
}
.help-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; padding: 9px 10px; border-radius: 9px;
}
.help-item:hover { background: var(--surface-2); }
.help-item .hn {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: var(--brand); color: var(--on-brand);
  font-size: var(--t-11); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.help-item .ht { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.help-item .hd { display: block; font-size: var(--t-12); color: var(--muted); margin-top: 2px; }

@keyframes os-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- the users
   The prototype's access screen: six template cards, a grid-ruled table of
   people, and the permission matrix that opens under a row rather than in
   a modal - so the row you are changing stays in view above it. */

.g6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

.sub-label {
  font-size: var(--t-12); font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}

.mini {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px;
}
.mini .nm { font-size: 13.5px; font-weight: 700; }
.mini .sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--t-12); font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.avatar.boss { background: #1a1a1a;  color: var(--brand-on-dark); }
.avatar.mgr  { background: var(--brand-soft); color: var(--note-ink); }
.avatar.rep  { background: var(--info-bg); color: var(--info-text); }

.tmpl {
  font-size: var(--t-12); font-weight: 600; color: var(--text);
  background: var(--surface-2); padding: 3px 10px; border-radius: 7px;
}
.tmpl.boss { background: #1a1a1a; color: var(--brand-on-dark); }

.tcard {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.urow {
  display: grid; grid-template-columns: 1.8fr 1fr 1.2fr 0.9fr 90px;
  gap: 16px; padding: 12px 22px; align-items: center; font-size: var(--t-14);
}
.urow.head {
  height: 42px; padding-top: 0; padding-bottom: 0;
  background: var(--ground); border-bottom: 1px solid var(--line);
  font-size: var(--t-11); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tcard > .urow, .tcard > details { border-bottom: 1px solid var(--surface-2); }
.tcard > :last-child { border-bottom: none; }
.urow.locked { background: var(--brand-softest); }

.tcard > details > summary { list-style: none; cursor: pointer; }
.tcard > details > summary::-webkit-details-marker { display: none; }
.tcard > details > summary:hover { background: var(--ground); }
.tcard > details[open] > summary { background: #fbfcfe; }
.tcard > details[open] { background: #fbfcfe; }
.tcard > details[open] .do-edit { color: var(--ink); font-weight: 700; }

.panel {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  margin: 0 22px 20px; background: var(--surface);
  animation: os-open .16s ease both;
}
.panel-top {
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--surface-2);
}
.panel-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-top: 1px solid var(--surface-2);
  flex-wrap: wrap;
}

@keyframes os-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.mscroll { overflow-x: auto; }
.mgrid { min-width: 560px; }
.mrow {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 8px;
  padding: 9px 18px; align-items: center; font-size: 13.5px;
  border-bottom: 1px solid var(--surface-2);
}
.mrow:last-child { border-bottom: none; }
.mrow.head {
  padding: 12px 18px; background: var(--ground);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-11); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.mrow.head > :not(:first-child) { text-align: center; }

/* A tick that looks like the prototype's cell and is still a real
   checkbox underneath, so the keyboard and a screen reader both work. */
.grant {
  position: relative; width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--t-13); font-weight: 700; margin: 0 auto;
  background: var(--surface-2); color: var(--line-strong); cursor: pointer;
  transition: background .12s, color .12s;
}
.grant input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.grant::after { content: '–'; }
.grant:has(input:checked) { background: var(--ok-bg); color: var(--ok-text); }
.grant:has(input:checked)::after { content: '✓'; }
.grant.tuned:has(input:checked) { background: var(--vip-bg); color: var(--vip-text); }
.grant:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.grant.off { cursor: default; }

.swatch {
  display: inline-block; width: 11px; height: 11px; border-radius: 3px;
  background: var(--vip-bg); vertical-align: -1px; margin-right: 5px;
}

/* --------------------------------------------------------- org structure */
.org { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.org .reps {
  margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--surface-2);
  display: flex; flex-direction: column; gap: 9px;
}
.org .reps > div { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.org .reps .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--info); flex: none; }

/* ----------------------------------------------------------- the settings
   The email branding panel with its live preview, and the senders table,
   as settings.html draws them. The preview is the point of the screen:
   nobody should have to save and mail themselves an invitation to find
   out what a change did. */

.filebox {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-ctrl);
  padding: 12px 14px; background: var(--surface);
}
.thumb {
  width: 72px; height: 40px; object-fit: cover; border-radius: 6px;
  flex: none; border: 1px solid var(--line);
}
.empty-thumb {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
}
.inp-file { padding: 7px 10px; font-size: var(--t-12); max-width: 230px; }

.mailprev {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,23,42,0.06);
}
.mailprev img { display: block; width: 100%; height: auto; }
.mailprev .band {
  padding: 12px 18px; font-size: var(--t-13); font-weight: 600;
  color: var(--ink); border-bottom: 1px solid var(--surface-2);
}
.mailprev .band:empty { display: none; }
.mailprev .body { padding: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.mailprev .fake-btn {
  margin-top: 14px; height: 32px; border-radius: 8px;
  background: var(--brand); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--t-12); font-weight: 600;
}
.mailprev .fine {
  padding: 12px 18px; border-top: 1px solid var(--surface-2);
  font-size: 10.5px; color: var(--muted); line-height: 1.5;
  white-space: pre-line;
}

.srow {
  /* Room for Send test, Edit, Make default and Delete on one line. At
     150px even the first three spilled past the edge of the card. */
  display: grid; grid-template-columns: 1.6fr 1.8fr 0.9fr 1fr 260px;
  gap: 16px; padding: 14px 22px; align-items: center; font-size: var(--t-14);
  border-bottom: 1px solid var(--surface-2);
}
.srow.head {
  height: 40px; padding-top: 0; padding-bottom: 0;
  background: var(--ground); border-bottom: 1px solid var(--line);
  font-size: var(--t-11); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.srow.untested { background: var(--brand-softest); }

.tfoot {
  padding: 12px 22px; background: var(--ground);
  border-top: 1px solid var(--surface-2);
  font-size: var(--t-12); color: var(--muted); line-height: 1.5;
}

.btn-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  padding: 4px 6px; border-radius: 6px;
}
.btn-link:hover { background: var(--surface-2); color: var(--ink); }
/* Urgent says so in ink and weight, with the accent as a dot beside it.
   DHL's rules keep important words out of DHL Red, and a dot does not ask
   anyone to tell red from black. */
.btn-link.urgent { color: var(--ink); font-weight: 700; }
.btn-link.urgent::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--brand-accent); vertical-align: 1px;
}

/* A text button or link: red words, underlined (DHL CI). On yellow or any
   other coloured ground use .link-ink: CI keeps red words to white. */
.link { color: var(--action-text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--action-hover); }
.link-ink, .link-ink:hover { color: var(--ink); }

.swatch-in {
  width: 52px; height: 40px; padding: 2px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-ctrl);
  background: var(--surface);
}

/* ----------------------------------------------------- inside one event
   The event screens have their own shell in the prototypes, and it is a
   different shape: the coloured side carries the event itself -- its name,
   its date, its room -- rather than the workspace menu, and there is no
   top bar at all. The canvas is a shade darker than the workspace pages
   so the white panels on it read as pieces of equipment.

   Reuses .sidebar, .navi and .side-foot: it is the same sidebar with a
   different cargo, and two copies of it would drift. */

.ecanvas {
  /* clip, not auto: a scrolling box here would hold the event strip still
     inside itself instead of letting it stick to the window. */
  flex: 1; min-width: 0; overflow-x: clip;
  background: var(--ground); padding: 12px 12px 90px;
}
.ewrap { display: flex; flex-direction: column; gap: 24px; width: 100%; }

/* The way back to every event, at the top of the event's rail. */
.eback { margin-bottom: 6px; }

/* The strip at the top of every event screen: what this event is, so the
   screen never has to repeat it in its own heading. */
/* On the workspace's colour, as DHL uses yellow: a highlight ground with
   black words (or whichever of black and white reads on another colour). */
.ehead {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 18px 22px; color: var(--on-brand);
  background: var(--brand);
  border: none; border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.ehead .nm { font-size: 17px; font-weight: 800; letter-spacing: -0.015em; }
.ehead .bit { font-size: 13px; color: var(--brand-quiet); font-weight: 500; }
.ehead .end { font-size: 12px; color: var(--brand-quiet); }
.ehead .help > summary { color: var(--on-brand); }
.ehead-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ehead .help > summary { width: 30px; height: 30px; }

/* The guided tours on the door's dark header. */
.door-top .help > summary { color: rgba(255,255,255,0.75); }
.door-top .help > summary:hover { background: rgba(255,255,255,0.12); color: #ffffff; }
.door-top .help-menu { color: var(--ink); }

.ehamburger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; color: var(--ink);
}

@media (max-width: 1000px) {
  .ehamburger {
    display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 65;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
  .ecanvas { padding: 66px 16px 60px; }
}

@media (max-width: 1000px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--r-ctrl); background: var(--surface);
  }
  .nav-toggle svg { width: 19px; height: 19px; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar);
    margin: 0; border-radius: 0; border-width: 0 1px 0 0;
    transform: translateX(-100%); transition: transform .22s ease; z-index: 60;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  }
  .nav-cb:checked ~ .shell .sidebar { transform: translateX(0); }
  .nav-cb:checked ~ .scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(15,23,42,0.45); z-index: 55;
  }
  .scrim { display: none; }

  .topbar { padding: 10px 12px 0; }
  .topbar-in { padding: 0 12px; gap: 12px; }
  .topbar .search { min-width: 0; flex: 1; }
  .page { padding: 20px 16px 56px; }

  .g2, .g3, .g4, .g-side { grid-template-columns: 1fr; }
  .g6 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
}

@media (max-width: 620px) {
  /* The search used to vanish below this width. It stays, and the page
     name beside it gives way instead -- the page heading says it anyway. */
  .topbar .where { display: none; }
  .topbar .search { padding: 8px 11px; }
  .topbar .search input { font-size: var(--t-16); }  /* no zoom-on-focus on iOS */
  h1 { font-size: var(--t-20); }

  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }

  /* Tables become stacked cards, as agreed. */
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 12px; padding: 12px 16px; background: var(--surface); }
  .tbl td { border: none; padding: 5px 0; display: flex; justify-content: space-between; gap: 16px; }
  .tbl td::before {
    content: attr(data-label); flex: none;
    font-size: var(--t-12); font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .tbl td.right { text-align: left; }
  .tbl td:empty { display: none; }

  .btn { padding: 12px 18px; }
  .btn-sm { padding: 9px 14px; }

  /* Row lists stack instead of scrolling sideways. Each row becomes a small
     card: the first cell is its title, the rest wrap underneath. They used
     to be forced 620-760px wide inside a 360px screen. */
  .trow, .urow, .srow {
    display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0;
    padding: 14px 16px; height: auto !important;
  }
  .trow > :first-child, .urow > :first-child, .srow > :first-child { flex: 1 0 100%; }
  .trow > :last-child, .urow > :last-child, .srow > :last-child { margin-left: auto; }
  .trow.head, .urow.head, .srow.head { display: none; }
  .g6 { grid-template-columns: 1fr; }

  /* Long filter rows wrap, and every field takes the full width. */
  .row.wrap > .inp, .row.wrap > .sel { flex: 1 1 100%; }

  /* Pop-ups fill the screen edge to edge, with their buttons in reach. */
  .sheet { padding: 0; align-items: flex-end; }
  .sheet-box { max-width: none !important; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .sheet-foot { flex-wrap: wrap; }
  .sheet-foot .btn { flex: 1 1 auto; }
  .ecard-split > .l { border-right: none; border-bottom: 1px solid var(--surface-2); }
}

/* ===========================================================================
   Sending progress (layouts/sending): every send can be watched and stopped
   =========================================================================== */

.sending { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card, 12px);
           margin-bottom: 20px; overflow: hidden; }
.send-head { padding: 14px 20px 0; }
.send-head h3 { margin: 0; font-size: var(--t-16); }
.send-item { padding: 14px 20px 16px; display: grid; gap: 8px; }
.send-item + .send-item { border-top: 1px solid var(--surface-2); }
.send-top { display: flex; align-items: flex-start; gap: 12px; }
.send-top .pill { margin-left: 6px; vertical-align: 1px; }
.send-acts { display: flex; gap: 8px; flex: none; }
.send-bar { display: flex; height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.send-bar > span { display: block; height: 100%; transition: width .5s cubic-bezier(0,0,.2,1); }
.send-bar > .ok  { background: var(--ok); }
.send-bar > .bad { background: var(--bad); }
.bad-text { color: var(--bad-text); }

/* The guest list's panel folds under its header. The whole header is the
   control, so it is easy to hit on a phone; the chevron only shows which way. */
.sending-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center;
                          gap: 12px; padding: 14px 20px; }
.sending-fold > summary::-webkit-details-marker { display: none; }
.sending-fold > summary:hover { background: var(--surface-2); }
.sending-fold > summary:focus-visible { outline-offset: -2px; }
.sending-fold[open] > summary { padding-bottom: 0; }
.sending-fold[open] > summary:hover { background: none; }
.send-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sending-fold[open] .send-sum { visibility: hidden; }
.send-chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform .2s; }
.sending-fold[open] .send-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .send-chev { transition: none; } }

@media (max-width: 620px) {
  .send-top { flex-wrap: wrap; }
  .send-acts { width: 100%; }
  .send-acts .btn { flex: 1; }
}

/* ===========================================================================
   No scrolling behind a pop-up (set by onescan.js while one is open)
   =========================================================================== */

/* The page itself only. Hiding overflow on body as well made body the
   scroll box of the sticky sidebar: body never scrolls, so the sidebar
   slid up off the screen by however far the page was scrolled. */
html.os-scroll-lock { overflow: hidden; }
html.os-scroll-lock body { padding-right: var(--os-scrollbar, 0px); }
/* Scrolling to the end of a long box stops there instead of carrying on to
   the page behind it. */
.sheet-box, .drawer-box { overscroll-behavior: contain; }

/* People we hold, offered under the name or email box (osPersonSuggest).
   It floats over the form, so it is the one place here with a shadow. */
.ps-wrap { position: relative; }
.ps-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
           max-height: 280px; overflow-y: auto; padding: 4px;
           background: var(--surface); border-radius: var(--r-ctrl);
           box-shadow: 0 12px 28px rgba(15,23,42,.16); }
.ps-list[hidden] { display: none; }
.ps-list.up { top: auto; bottom: calc(100% + 4px); }
.ps-hit { padding: 8px 12px; border-radius: calc(var(--r-ctrl) - 2px); cursor: pointer; }
.ps-hit:hover, .ps-hit.active { background: var(--surface-2); }
.ps-hit.blocked { cursor: not-allowed; }
.ps-hit.blocked .ps-name, .ps-hit.blocked .ps-sub { color: var(--muted); }
.ps-name { font-weight: 600; font-size: var(--t-14); color: var(--ink); }
.ps-sub { font-size: var(--t-13); color: var(--text); overflow-wrap: anywhere; }
.ps-note { font-size: var(--t-12); color: var(--wait-text); margin-top: 2px; }

/* ===========================================================================
   Depth
   ---------------------------------------------------------------------------
   Cards lift off the grey ground with a soft shadow rather than being drawn
   round with a hairline: the hairline-on-flat-grey look read as dated. The
   border stays, transparent, so nothing moves.
   =========================================================================== */
.card, .stat, .ecard, .tscroll, .org {
  border-color: transparent; box-shadow: var(--shadow-card);
}
.ecard:hover { border-color: transparent; box-shadow: var(--shadow-lift); }
.sidebar { border-color: transparent; box-shadow: var(--shadow-card); }
.btn { transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn:not(.btn-2):not(.btn-ghost):not(.btn-bad):not([disabled]):hover { box-shadow: 0 4px 12px color-mix(in srgb, var(--action) 28%, transparent); }

/* ===========================================================================
   Colour through every screen (DHL CI: yellow is the highlight ground with
   black on it; red is for actions)
   =========================================================================== */
/* A figure tile opens with the same yellow mark as a card's title. */
.stat { position: relative; }
.stat::before {
  content: ''; position: absolute; left: 20px; top: 0; width: 28px; height: 4px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}
/* Table headers on a pale tint of the workspace's colour. */
.tbl th { background: var(--brand-softer); border-top-color: transparent; border-bottom-color: var(--note-edge); }
/* The chosen filter or tab sits on the colour itself. */
.seg a.on, .tabs a.on { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.seg a.on .n { color: var(--brand-quiet); }

/* ===========================================================================
   The phone
   =========================================================================== */
@media (max-width: 620px) {
  /* An event card needs the whole width: two to a row squeezed its name
     into one word a line. */
  .grid.ecards { grid-template-columns: 1fr; }

  /* A lone last tile in a two-up grid takes the row, rather than sitting
     beside a hole. */
  .g3 > .stat:last-child:nth-child(odd),
  .g4 > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* With a page action in the bar, the search takes its own row below:
     beside the button it was crushed to three letters. */
  .topbar-in { height: auto; min-height: var(--topbar); flex-wrap: wrap; padding: 10px 12px; row-gap: 10px; }
  .topbar-in:has(.btn) .search { order: 10; flex: 1 1 100%; }
  .topbar-in:has(.btn) .tour-slot { margin-left: auto; }

  /* The page's colour band and its padding scale down with the screen. */
  .page-head.on-colour { padding: 20px 18px; }
}

/* The event strip floats at the top while the screen scrolls under it.
   Once stuck it slims down and lifts, and the ground above it covers the
   page sliding past, so the strip reads as one floating bar. */
.ehead {
  position: sticky; top: 12px; z-index: 15;
  transition: padding .18s ease, box-shadow .18s ease;
}
.ehead::before {
  content: ''; position: absolute; left: -12px; right: -12px; top: -12px; height: 12px;
  background: var(--ground); pointer-events: none;
}
.ehead.is-stuck { padding-top: 11px; padding-bottom: 11px; box-shadow: var(--shadow-lift); }
.ehead.is-stuck .nm { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .ehead { transition: none; } }
@media (max-width: 1000px) {
  /* Clear of the menu button fixed in the corner. */
  .ehead.is-stuck { padding-left: 62px; }
}
@media (max-width: 620px) {
  /* On a phone the stuck strip keeps only the event's name: its four
     wrapped lines would take a quarter of the screen. */
  .ehead.is-stuck .bit, .ehead.is-stuck .ehead-r { display: none; }
  .ehead.is-stuck .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
}

/* ===========================================================================
   Paging under a list (partials/pager)
   =========================================================================== */
.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.pager-bare { margin-top: 16px; padding: 0 4px; }
.pager-sum { font-size: var(--t-13); color: var(--text); }
.pager-sum strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r-ctrl);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--t-13); font-weight: 600; color: var(--ink); text-decoration: none;
  font-variant-numeric: tabular-nums; transition: background .12s;
}
a.pg:hover { background: var(--surface-2); color: var(--ink); }
.pg.on { background: var(--brand); color: var(--on-brand); }
.pg-step { border: 1px solid var(--line-strong); }
.pg-step[aria-disabled] { color: var(--muted); border-color: var(--line); cursor: default; }
.pg-gap { min-width: 20px; padding: 0; color: var(--muted); }
@media (max-width: 620px) {
  .pager { justify-content: center; }
  .pg-word { display: none; }   /* the arrows alone; the numbers need the room */
}
