/* DAY/OS admin. One typeface (Atkinson Hyperlegible, built for legibility in glare and at a distance),
   a cold snow-and-spruce palette, and trail-sign shapes where the content really is a trail. */

@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); }

:root {
  --snowpack: #edf1f3;
  --powder: #ffffff;
  --spruce: #12303a;
  --spruce-soft: #1d4452;
  --quiet: #4f636d;
  --line: #d3dce1;
  --line-strong: #aebcc4;
  --trail-blue: #1b5fc1;
  --trail-blue-dark: #144a98;
  --open: #17703f;
  --open-tint: #e3f3ea;
  --hold: #8a5300;
  --hold-tint: #fbefd6;
  --closed: #b42318;
  --closed-tint: #fbe5e2;
  --focus: #e07a00;
  --radius: 6px;
  --rail: 232px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--snowpack);
  color: var(--spruce);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--trail-blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: var(--spruce);
  color: #fff;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 0 10px; }
.brand strong { display: block; font-size: 1.25rem; letter-spacing: 0.01em; }
.brand span { display: block; color: #b9ccd4; font-size: 0.875rem; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  color: #dbe7ec;
  text-decoration: none;
  padding: 10px 10px;
  border-radius: var(--radius);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.nav a:hover { background: var(--spruce-soft); color: #fff; }
.nav a[aria-current='page'] { background: #fff; color: var(--spruce); font-weight: 700; }
.who { padding: 0 10px; font-size: 0.875rem; color: #b9ccd4; display: grid; gap: 8px; }
.who b { color: #fff; font-weight: 700; overflow-wrap: anywhere; }
.who .btn { background: transparent; color: #fff; border-color: #8aa1ac; }
.who .btn:hover { background: var(--spruce-soft); border-color: #fff; }
.main { padding: 28px 32px 64px; max-width: 1180px; width: 100%; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { min-width: 0; position: static; height: auto; flex-direction: column; gap: 10px; padding: 12px; }
  .nav { flex-direction: row; overflow-x: auto; flex: none; padding-bottom: 4px; }
  .nav a { white-space: nowrap; }
  .who { grid-template-columns: 1fr auto; align-items: center; }
  .main { padding: 20px 16px 56px; }
}

/* ---------- page structure ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section { margin-top: 36px; }
.section > header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.section > header p { color: var(--quiet); font-size: 0.9375rem; }
.panel { background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.muted { color: var(--quiet); }
.small { font-size: 0.875rem; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.empty { padding: 28px 16px; color: var(--quiet); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--powder); }
.empty .btn { margin-top: 10px; }
.loading { color: var(--quiet); padding: 20px 0; }
.error-box { background: var(--closed-tint); color: #7a160d; border: 1px solid #e5aaa3; border-radius: var(--radius); padding: 12px 14px; }

/* ---------- controls ---------- */
.btn {
  font: inherit;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--powder);
  color: var(--spruce);
  cursor: pointer;
  font-weight: 700;
}
.btn:hover { border-color: var(--spruce); }
.btn:disabled, .btn.primary:disabled, .btn.danger:disabled { opacity: 1; background: #e3e7ec; border-color: #c9d0d8; color: #4a5562; cursor: not-allowed; box-shadow: none; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.dialog.nudge { animation: nudge 0.25s ease-in-out; }
@media (prefers-reduced-motion: reduce) { .dialog.nudge { animation: none; outline: 3px solid var(--focus, #1a5fb4); } }
.btn.primary { background: var(--trail-blue); border-color: var(--trail-blue); color: #fff; }
.btn.primary:hover { background: var(--trail-blue-dark); border-color: var(--trail-blue-dark); }
.btn.danger { color: var(--closed); border-color: #e0a7a0; }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: 0.875rem; }
.btn.link { background: none; border: none; color: var(--trail-blue); padding: 4px 6px; min-height: 0; text-decoration: underline; }

label.field, .field { display: grid; gap: 4px; font-weight: 700; font-size: 0.9375rem; align-content: start; }
.field .hint { font-weight: 400; color: var(--quiet); font-size: 0.8125rem; }
input, select, textarea {
  font: inherit;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--spruce);
  width: 100%;
  font-weight: 400;
}
textarea { min-height: 96px; resize: vertical; }
input[type='checkbox'] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--trail-blue); }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 700; min-height: 44px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.form .wide { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form label.field { min-width: 150px; flex: 1 1 150px; }
.inline-form .btn { flex: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  font: inherit; font-weight: 700; background: none; border: none; padding: 10px 16px; min-height: 44px; cursor: pointer;
  color: var(--quiet); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected='true'] { color: var(--spruce); border-bottom-color: var(--trail-blue); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.875rem; color: var(--quiet); font-weight: 700; background: #f7f9fa; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
tr.attention td { background: var(--hold-tint); }

/* ---------- status ---------- */
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.state::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); flex: none; }
.state[data-state='good']::before { background: var(--open); }
.state[data-state='warn']::before { background: #d98a00; }
.state[data-state='bad']::before { background: var(--closed); }
.state[data-state='good'] { color: var(--open); }
.state[data-state='warn'] { color: var(--hold); }
.state[data-state='bad'] { color: var(--closed); }
.state[data-state='neutral'] { color: var(--quiet); }
.mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.mark svg { flex: none; }

/* ---------- dashboard figures: plain numbers on a shared baseline, not a wall of cards ---------- */
.figures { display: flex; flex-wrap: wrap; gap: 24px 0; }
.figure { padding: 0 28px 0 0; margin-right: 28px; border-right: 1px solid var(--line-strong); min-width: 150px; }
.figure:last-child { border-right: none; }
.figure strong { display: block; font-size: 2.25rem; line-height: 1.1; }
.figure span { color: var(--quiet); }
.figure em { display: block; font-style: normal; font-size: 0.875rem; color: var(--quiet); margin-top: 2px; }

/* ---------- the gate: one answer, readable across a counter ---------- */
.gate {
  border-radius: var(--radius);
  padding: 28px 24px;
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: var(--powder);
  border: 2px dashed var(--line-strong);
  color: var(--quiet);
}
.gate strong { font-size: 2.75rem; line-height: 1.05; }
.gate span { font-size: 1.125rem; }
.gate[data-result='ok'], .gate[data-result='good'] { background: var(--open); border: 2px solid var(--open); color: #fff; }
.gate[data-result='bad'] { background: var(--closed); border: 2px solid var(--closed); color: #fff; }
.gate[data-result='warn'] { background: #f2b33d; border: 2px solid #c98800; color: #2c1c00; }
.scan-input { font-size: 1.5rem; min-height: 56px; letter-spacing: 0.04em; text-transform: uppercase; }
.codes { display: grid; gap: 8px; margin-top: 12px; }
.code { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.06em; background: #f7f9fa; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.code small { font-size: 0.875rem; font-weight: 400; letter-spacing: 0; color: var(--quiet); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- people picker, chips ---------- */
.picker { position: relative; }
.picker-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); max-height: 260px; overflow-y: auto; box-shadow: 0 6px 18px rgba(18, 48, 58, 0.18); }
.picker-results button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: none; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.picker-results button:hover, .picker-results button:focus-visible { background: var(--snowpack); }
.picker-hit { display: grid !important; gap: 2px; }
.picker-name { font-weight: 700; }
.picker-line { display: block; }
.picker-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.picker-empty { padding: 10px 12px; }
.chip { display: inline-flex; gap: 8px; align-items: center; background: var(--snowpack); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 700; }
.chip button { font: inherit; border: none; background: none; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; color: var(--quiet); }
.chip button:hover { background: var(--line); }

/* ---------- dialogs and toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 48, 58, 0.55); display: grid; place-items: start center; padding: 6vh 16px 16px; overflow-y: auto; z-index: 50; }
.dialog { background: var(--powder); border-radius: 10px; width: min(680px, 100%); padding: 24px; display: grid; gap: 16px; box-shadow: 0 18px 50px rgba(18, 48, 58, 0.35); }
.dialog.wide { width: min(920px, 100%); }
.dialog header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.dialog .footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.toasts { position: fixed; left: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--spruce); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.toast[data-kind='error'] { background: var(--closed); }
.toast[data-kind='warn'] { background: #6b4300; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.signin-side { background: var(--spruce); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.signin-side h1 { font-size: 2.5rem; line-height: 1.1; max-width: 12ch; }
.signin-side p { color: #c9d9df; max-width: 36ch; }
.signin-side .brand { padding: 0; margin-bottom: 20px; }
.signin-side h1 { margin-bottom: 12px; }
.main { min-width: 0; }
.signin-form { padding: 48px; display: grid; align-content: center; justify-items: start; gap: 16px; }
.signin-form form { display: grid; gap: 16px; width: min(380px, 100%); }
.ridge { width: 100%; height: auto; display: block; }
@media (max-width: 760px) { .signin { grid-template-columns: 1fr; } .signin-side { padding: 28px; } .signin-side h1 { font-size: 1.75rem; } .signin-form { padding: 28px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- segmented status control (lifts, trails) ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button { font: inherit; font-weight: 700; min-height: 40px; padding: 4px 14px; border: none; border-right: 1px solid var(--line-strong); background: #fff; color: var(--quiet); cursor: pointer; }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--snowpack); }
.seg button[aria-pressed='true'][data-tone='good'] { background: var(--open); color: #fff; }
.seg button[aria-pressed='true'][data-tone='warn'] { background: #f2b33d; color: #2c1c00; }
.seg button[aria-pressed='true'][data-tone='bad'] { background: var(--closed); color: #fff; }
.seg button:disabled { cursor: default; }
.page-note { color: var(--quiet); max-width: 62ch; }
.basket-total { font-size: 1.5rem; font-weight: 700; }
.week-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.day-block { margin-top: 20px; }
.day-block h3 { margin-bottom: 8px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.pick-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px; background: #fff; }
.hours { font-weight: 700; }

/* grid children default to min-width:auto, which lets a wide table push the whole page sideways */
.stack > *, .section, .day-block, .two-col > *, .form > * { min-width: 0; }

/* ---- patrol cases and team ---- */
.case h2 { font-size: 1.125rem; }
.case h4 { font-size: 0.9375rem; margin: 0; }
.case-head h1 { font-size: 1.5rem; }
.stack.tight { gap: 4px; }
.lock-note, .warn-note { background: var(--hold-tint); border: 1px solid var(--hold); color: var(--hold); border-radius: var(--radius); padding: 10px 14px; font-weight: 700; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: none; }
.problems { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.stamps .btn { min-height: 44px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--line-strong); display: grid; gap: 8px; }
.timeline li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.kv dt { color: var(--quiet); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.patient > h3 { font-size: 1.125rem; padding: var(--sp-2) 0 0; }
.note { border-top: 1px solid var(--line); padding-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sigpad { width: 100%; max-width: 480px; aspect-ratio: 8 / 3; background: #fff; border: 2px dashed var(--line-strong); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
.sig-img { max-width: 100%; border: 1px solid var(--line); background: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(80px, 2fr) 3ch; gap: 10px; align-items: center; }
.bars meter { width: 100%; height: 14px; }
@media (max-width: 700px) {
  .post-row { grid-template-columns: 1fr 1fr; }
  .case .btn { min-height: 44px; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: 6px; }
}

/* ---------- guest help page (public) ---------- */
.help-body { background: var(--snowpack); }
.help { max-width: 560px; margin: 0 auto; padding: 16px; }
.help-alert { border: 2px solid var(--closed); background: #fff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.help-alert p { margin: 4px 0 0; }
.help-msg { font-weight: 700; }
.help-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.help textarea, .help input { width: 100%; font: inherit; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.btn.big { min-height: 52px; font-size: 1.1rem; }
.help-noscript { max-width: 560px; margin: 16px auto; padding: 0 16px; font-weight: 700; }
.help-done { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.call-card { border: 1px solid var(--line-strong); border-left-width: 6px; border-radius: var(--radius); background: #fff; padding: 12px 14px; display: grid; gap: 6px; }
.call-card[data-priority='critical'] { border-left-color: var(--closed); }
.call-card[data-priority='high'] { border-left-color: #f2b33d; }
.call-card[data-priority='normal'] { border-left-color: var(--trail-blue); }
.call-card[data-priority='low'] { border-left-color: var(--line-strong); }
.call-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline li { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px; }

/* ---------- incident form (NSAAR layout) ---------- */
.nsaar-sec { display: block; }
.nsaar-sec > summary { font-size: 1.15rem; font-weight: 700; cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.nsaar-note { max-width: 70ch; margin: 4px 0 12px; }
.nsaar-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.nsaar-grid .wide { grid-column: 1 / -1; }
.req { color: var(--closed); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row.tight { gap: 6px; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; min-height: 36px; font-weight: 400; }
.check input { width: 20px; height: 20px; flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; }
.bodymap { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.bodymap .part { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid var(--line); }
.bodymap select { width: 5em; min-height: 36px; }
.settings-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.aid { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
fieldset.field { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; min-width: 0; }
fieldset.field legend { font-weight: 700; padding: 0 6px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
@media print {
  .rail, .who, .tabs, .btn, button, .footer, .toast { display: none !important; }
  .shell { display: block !important; }
  details > summary { list-style: none; }
  .panel { break-inside: avoid; border-color: #999; }
  input, select, textarea { border: none !important; background: none !important; }
  body { background: #fff; }
}

.input-row { display: flex; gap: 6px; align-items: stretch; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn { min-height: 44px; }

/* customer form */
.cust-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.cust-group legend { font-weight: 700; padding: 0 6px; }
.cust-group .form .wide { grid-column: 1 / -1; }
.cust-lines { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.cust-lines dt { color: var(--quiet); }
.cust-lines dd { margin: 0; }

/* "missing" items that jump to the field */
.problem-link { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--trail-blue); text-decoration: underline; text-align: left; cursor: pointer; min-height: 32px; }
.problem-link:hover { color: var(--spruce); }
.flash { outline: 3px solid var(--trail-blue); outline-offset: 4px; border-radius: 6px; }

/* patrol map */
.map-box { height: 60vh; min-height: 320px; border: 1px solid var(--line-strong); border-radius: var(--radius); isolation: isolate; background: var(--snowpack); }
.map-box.tall { height: 70vh; }
.map-readout { margin: 0; min-height: 1.5em; }
.map-pin { background: none; border: 0; }
.map-pin span { display: block; width: 26px; height: 26px; margin: 2px; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #c8321e; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55); transform: rotate(-45deg); }
.map-pin.sev-minor span { background: #2f7d4f; }
.map-pin.sev-moderate span { background: #d99a1c; }
.map-pin.sev-serious span { background: #d4561f; }
.map-pin.sev-critical span { background: #b3201a; }
.map-pop { display: grid; gap: 2px; min-width: 160px; }
@media print { .map-box { display: none; } }

/* ---------- the basket and checkout ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 4px; text-align: left; font: inherit; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px; min-height: 84px; cursor: pointer; align-content: start; }
.tile:hover, .tile:focus-visible { background: var(--snowpack); border-color: var(--spruce); }
.tile-price { font-size: 1.25rem; font-weight: 700; }
.basket { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.basket-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; gap: 6px; align-items: center; }
.line-price { font-weight: 700; min-width: 5ch; text-align: right; }
.who-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tender-row { flex-wrap: wrap; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.gear { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.gear .din { width: 5.5em; margin-left: auto; }
.receipt-head strong { font-size: 1.5rem; }
.change-due { font-size: 2rem; font-weight: 700; background: #fff4cf; border: 2px solid #c98800; border-radius: var(--radius); padding: 12px 16px; }
.basket-panel { position: sticky; top: 12px; }
.basket-total[data-state='good'] { color: var(--open); }
@media (max-width: 640px) { .basket-line { grid-template-columns: minmax(0, 1fr) auto; } .who-row { grid-template-columns: 1fr; } }

/* ---------- sell and gate: a calmer, roomier counter ---------- */
:root { --radius-lg: 12px; --lift: 0 1px 2px rgba(18, 48, 58, 0.06), 0 8px 24px rgba(18, 48, 58, 0.07); }
.card { background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--lift); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

.sell-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.sell-main { gap: 24px; }
@media (max-width: 1100px) { .sell-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 900px) { .sell-grid { grid-template-columns: 1fr; } }

/* menu: pill tabs, a quiet toolbar, big tap targets */
.sell-menu .tabs { border-bottom: none; gap: 6px; margin-bottom: 16px; padding-bottom: 2px; }
.sell-menu .tabs button { border: 1px solid transparent; border-radius: 999px; padding: 8px 18px; margin: 0; background: var(--snowpack); color: var(--spruce-soft); }
.sell-menu .tabs button:hover { border-color: var(--line-strong); }
.sell-menu .tabs button[aria-selected='true'] { background: var(--spruce); color: #fff; border-color: var(--spruce); }
.menu-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-bottom: 16px; }
.menu-tools .field { min-width: 170px; }
.menu-tools input, .menu-tools select { min-height: 44px; }

.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-height: 112px; padding: 14px 14px 12px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--trail-blue); }
.tile::after { content: '+'; position: absolute; right: 10px; top: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--trail-blue); background: #e8f0fb; }
.tile:hover, .tile:focus-visible { background: #fff; border-color: var(--trail-blue); box-shadow: 0 4px 14px rgba(27, 95, 193, 0.16); transform: translateY(-1px); }
.tile:active { transform: none; }
.tile strong { font-size: 1.0625rem; padding-right: 30px; line-height: 1.25; }
.tile-price { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

/* basket: the one strong element on the page */
.basket-panel { position: sticky; top: 16px; display: grid; gap: 14px; }
.basket-head { display: flex; align-items: center; gap: 10px; }
.count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--trail-blue); color: #fff; font-weight: 700; font-size: 0.875rem; display: inline-grid; place-items: center; }
.basket-empty { padding: 28px 8px; text-align: center; color: var(--quiet); border: 1px dashed var(--line-strong); border-radius: 10px; }
.basket { gap: 0; }
.basket-line { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'what price' 'qty remove'; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.basket-line:first-child { padding-top: 0; }
.basket-what { grid-area: what; min-width: 0; }
.basket-line .line-price { grid-area: price; font-size: 1.0625rem; }
.basket-line .qty { grid-area: qty; }
.basket-line > .btn.link { grid-area: remove; justify-self: end; color: var(--closed); font-size: 0.875rem; }
.basket-line > span:empty { grid-area: qty; }
.qty .btn { min-width: 36px; padding: 0; border-radius: 50%; }
.qty span { min-width: 2ch; text-align: center; font-weight: 700; }
.basket-summary { display: grid; gap: 4px; padding-top: 4px; }
.basket-summary .basket-total { font-size: 2rem; letter-spacing: -0.02em; align-items: baseline; }
.promo-row { display: grid; gap: 4px; }
.promo-input { display: flex; gap: 8px; }
.promo-input input { flex: 1; min-width: 0; }
.basket-panel .btn.big { width: 100%; }

/* sold today */
.order-list { list-style: none; margin: 0; padding: 0; }
.order-row { display: grid; grid-template-columns: 56px 56px auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.order-id { font-weight: 700; }
.order-total { text-align: right; }
.order-actions { display: inline-flex; gap: 6px; }
@media (max-width: 640px) { .order-row { grid-template-columns: auto auto 1fr; } .order-actions { grid-column: 1 / -1; } }

/* gate page */
.gate-page { max-width: 760px; margin: 0 auto; gap: 20px; }
.gate-page .scan-input { text-align: center; min-height: 72px; font-size: 1.75rem; border-width: 2px; border-radius: 12px; }
.gate-page .gate { min-height: 220px; display: grid; align-content: center; justify-items: center; text-align: center; border-radius: 16px; }
.gate-page .gate strong { font-size: 3.5rem; }

/* receipts, ticket slips and printing */
.print-area { display: grid; gap: 16px; justify-items: center; }
.sheet { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 8px; padding: 16px; font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 0.8125rem; line-height: 1.35; }
.receipt-sheet { width: 300px; max-width: 100%; }
.rc-head { text-align: center; margin-bottom: 8px; }
.rc-head strong { font-size: 1rem; display: block; }
.rc-meta { margin: 6px 0; }
.rc-lines { border-top: 1px dashed #000; border-bottom: 1px dashed #000; padding: 6px 0; margin: 6px 0; display: grid; gap: 6px; }
.rc-row { display: flex; justify-content: space-between; gap: 12px; }
.rc-sub { color: #333; padding-left: 8px; }
.rc-totals { display: grid; gap: 2px; }
.rc-total { font-weight: 700; font-size: 1rem; border-top: 1px solid #000; padding-top: 4px; margin-top: 2px; }
.rc-foot { text-align: center; margin-top: 10px; border-top: 1px dashed #000; padding-top: 8px; }
.slip { width: 340px; max-width: 100%; display: grid; gap: 8px; text-align: center; border: 2px solid #000; }
.slip header { display: grid; gap: 2px; }
.slip header strong { font-size: 1rem; }
.slip-who { font-size: 1.125rem; font-weight: 700; display: grid; }
.slip-who small { font-weight: 400; font-size: 0.8125rem; }
.slip-codes { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
.slip-codes svg { max-width: 100%; height: auto; }
.slip-code { letter-spacing: 0.12em; font-weight: 700; }
.slip.wristband { width: 420px; padding: 8px 12px; grid-template-columns: 1fr auto; text-align: left; align-items: center; }
.slip.wristband header, .slip.wristband .slip-when, .slip.wristband .slip-code { grid-column: 1 / -1; }
@media print {
  body:has(.print-overlay) > *:not(.print-overlay) { display: none !important; } /* only while a receipt or slip is open */
  .print-overlay { position: static; background: none; padding: 0; display: block; overflow: visible; }
  .print-overlay .dialog { box-shadow: none; border: 0; max-width: none; width: auto; padding: 0; }
  .print-overlay .dialog > header, .no-print { display: none !important; }
  .print-area { display: block; }
  .sheet { border-radius: 0; margin: 0 auto 12mm; break-inside: avoid; page-break-inside: avoid; }
  .slip { break-after: page; }
  .receipt-sheet { border: 0; padding: 0; }
}

/* photos, family, drawer, money */
.photo-field { display: grid; gap: 8px; justify-items: start; }
.photo-field .photo-preview { width: 96px; height: 120px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; background: #eef3f5; }
.photo-field .photo-empty { width: 96px; height: 120px; border-radius: 8px; border: 2px dashed var(--line); display: grid; place-items: center; text-align: center; color: var(--muted, #5b6b73); font-size: 0.8125rem; padding: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.family-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; }
.family-chip:hover { background: #eef6f9; }
.guardian-row { display: grid; gap: 4px; }
.waiver-text { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fafcfd; white-space: pre-wrap; font-size: 0.875rem; }
.drawer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.drawer-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.drawer-grid strong { font-size: 1.25rem; }
.drawer-grid small { color: var(--muted, #5b6b73); }
.variance-over { color: #17703f; font-weight: 700; }
.variance-short { color: #b3261e; font-weight: 700; }
.gate-person { display: flex; gap: 20px; align-items: center; justify-content: center; text-align: left; margin-top: 8px; }
.gate-person img { width: 160px; height: 200px; object-fit: cover; border-radius: 12px; border: 3px solid rgba(255, 255, 255, 0.85); }
.gate-person .gate-name { font-size: 2rem; font-weight: 700; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.0625rem; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfd; }
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.08em; word-break: break-all; }

.gear.match { background: #eef7f0; border-color: #9cc9a8; }
.sizing-note { padding: 8px 12px; background: #eef6f9; border-radius: 8px; }
.waiver-read summary { cursor: pointer; font-size: 0.875rem; }

/* ---------------------------------------------------------------- ski school */
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.board .panel.attention { border-left: 4px solid var(--warn, #b45309); }
.students { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.students .link { color: inherit; font-weight: 600; }
.level > summary { cursor: pointer; padding: 6px 0; }
.skills { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 4px; }
.credits { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.report-card { width: 640px; max-width: 100%; font-family: inherit; }
.report-card h2 { margin: 4px 0; }
.rcard-block { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.rcard-levels, .rcard-levels ul { list-style: none; padding-left: 0; margin: 4px 0; }
.rcard-levels ul { padding-left: 16px; }
.rcard-levels .passed::before { content: '\2713  '; }
.rcard-levels .todo { color: var(--muted, #666); }

/* the public booking page */
.book-body { background: var(--snowpack); }
.book { max-width: 640px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.book .field { display: grid; gap: 4px; }
.book input, .book select, .book textarea { width: 100%; font: inherit; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; box-sizing: border-box; }
.book input[type='checkbox'] { width: auto; min-height: 0; }
.book fieldset { border: 1px solid var(--line); }
.book .reference { font-size: 1.4rem; letter-spacing: 2px; }
@media print { .book-body { background: #fff; } }

.empty-day { font-weight: 600; }

/* ---------------------------------------------------------------- patrol: bedside card, quick vitals, stages, hand-off sheet
   A gloved thumb in the cold: 48 px or larger targets, one clear primary action, and status told in words as well as colour. */
:root { --watch: #8a5300; --watch-tint: #fbefd6; --alert: #b42318; --alert-tint: #fbe5e2; --ok-tint: #e3f3ea; }

.tabs { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tabs button { scroll-snap-align: start; white-space: nowrap; }
@media (max-width: 640px) {
  .tabs { gap: 6px; border-bottom: none; padding-bottom: 6px; }
  .tabs button { border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 16px; margin: 0; background: #fff; min-height: 44px; }
  .tabs button[aria-selected='true'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
}

.bedside { border-radius: 14px; border-left: 6px solid var(--trail-blue); box-shadow: var(--lift); gap: 14px; }
.bedside h3 { font-size: 1.375rem; line-height: 1.2; }
.bedside h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--quiet); }
.bedside .complaint { font-size: 1.0625rem; }
.bedside .sample { gap: 8px 16px; }
.bedside .sample .state { white-space: normal; }
.bedside .sample .state[data-state='bad'] { background: var(--alert-tint); padding: 4px 12px; border-radius: 999px; }
.vhead { align-items: baseline; }
.due { font-weight: 700; font-size: 0.9375rem; padding: 4px 12px; border-radius: 999px; }
.due:empty { display: none; }
.due[data-level='ok'] { background: var(--ok-tint); color: var(--open); }
.due[data-level='watch'] { background: var(--watch-tint); color: var(--watch); }
.due[data-level='alert'] { background: var(--alert-tint); color: var(--alert); }
.vstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .vstrip { grid-template-columns: repeat(6, 1fr); } }
.vtile { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 6px; text-align: center; display: grid; gap: 0; background: #fff; }
.vtile .vl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--quiet); font-weight: 700; }
.vtile .vv { font-size: 1.75rem; line-height: 1.15; }
.vtile .vf { font-size: 0.8125rem; font-weight: 700; min-height: 1.2em; }
.vtile[data-level='watch'] { background: var(--watch-tint); border-color: #e0b560; color: var(--watch); }
.vtile[data-level='alert'] { background: var(--alert-tint); border-color: #e0908a; color: var(--alert); }
.bed-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bed-actions .btn.big { min-height: 52px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row.quick .btn { min-height: 44px; }
.vtable { font-size: 0.9375rem; }
.vtable td[data-level='watch'] { background: var(--watch-tint); font-weight: 700; }
.vtable td[data-level='alert'] { background: var(--alert-tint); font-weight: 700; }
.fw { font-size: 0.75rem; }

.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.stage { display: grid; gap: 2px; align-content: center; justify-items: start; text-align: left; font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 64px; background: #fff; color: var(--spruce); }
.stage .sname { font-size: 0.8125rem; font-weight: 700; color: var(--quiet); }
.stage b { font-size: 1.125rem; }
.stage.done { background: var(--ok-tint); border-color: #a9d8bd; }
.stage.done .sname { color: var(--open); }
button.stage.todo { border-style: dashed; border-color: var(--trail-blue); color: var(--trail-blue-dark); cursor: pointer; font-weight: 700; }
button.stage.todo:hover { background: #eef4fd; }
button.stage:disabled { opacity: 0.6; }

details.paperwork { padding: 0; }
details.paperwork > summary { list-style: none; cursor: pointer; padding: 16px; display: grid; gap: 2px; font-size: 1.25rem; font-weight: 700; min-height: 56px; }
details.paperwork > summary::-webkit-details-marker { display: none; }
details.paperwork > summary::after { content: 'Show'; justify-self: start; margin-top: 4px; font-size: 0.875rem; color: var(--trail-blue-dark); text-decoration: underline; }
details.paperwork[open] > summary::after { content: 'Hide'; }
details.paperwork > div { padding: 0 16px 16px; }
details.more > summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }

/* quick vitals sheet */
.dialog.sheet { width: min(760px, 100%); }
@media (max-width: 640px) {
  .overlay:has(.dialog.sheet) { padding: 0; place-items: end center; }
  .dialog.sheet { border-radius: 18px 18px 0 0; width: 100%; max-height: 94vh; overflow-y: auto; padding: 16px; }
}
.vsheet { gap: 16px; }
.vgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .vgrid { grid-template-columns: repeat(4, 1fr); } .vgrid.two { grid-template-columns: repeat(2, 1fr); } }
.vstep { display: grid; gap: 4px; align-content: start; }
.vstep label { font-weight: 700; font-size: 0.9375rem; }
.step-row { display: grid; grid-template-columns: 52px 1fr 52px; gap: 6px; }
.step-btn { min-height: 56px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; font-size: 1.75rem; font-weight: 700; color: var(--spruce); cursor: pointer; }
.step-btn:active { background: var(--snowpack); }
.step-input { min-height: 56px; width: 100%; text-align: center; font: inherit; font-size: 1.5rem; font-weight: 700; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 0 4px; -moz-appearance: textfield; }
.step-input::-webkit-outer-spin-button, .step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-input[data-level='watch'] { background: var(--watch-tint); border-color: #e0b560; }
.step-input[data-level='alert'] { background: var(--alert-tint); border-color: #e0908a; }
.vstep .last { font-size: 0.8125rem; color: var(--quiet); }
.flag { font-size: 0.8125rem; font-weight: 700; min-height: 1.1em; }
.flag[data-level='watch'] { color: var(--watch); }
.flag[data-level='alert'] { color: var(--alert); }
.vblock { display: grid; gap: 6px; }
.chip { min-height: 48px; min-width: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--spruce); font: inherit; font-weight: 700; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
#v-pain .chip { min-width: 44px; padding: 0 10px; }

/* hand-off sheet */
.handoff { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 16px; box-shadow: var(--lift); max-width: 980px; }
.handoff-tools { position: sticky; top: 0; background: #fff; z-index: 2; padding-bottom: 8px; }
.hs-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-bottom: 3px solid var(--spruce); padding-bottom: 12px; }
.hs-head h1 { font-size: 1.875rem; }
.hs-head .eyebrow { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--quiet); font-weight: 700; }
.hs-meta { display: grid; gap: 2px; text-align: right; font-size: 0.9375rem; }
@media (max-width: 640px) { .hs-meta { text-align: left; } }
.hs-alert { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; background: var(--snowpack); border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; }
.hs-alert > div:first-child { background: var(--alert-tint); border-radius: 8px; padding: 6px 10px; margin: -6px 0; }
.hs-alert .k, .hs-sign .k { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--quiet); font-weight: 700; }
.danger-text { color: var(--alert); font-size: 1.125rem; }
.hs-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .hs-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.hs h3 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--spruce-soft); border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 6px; }
.hs { display: grid; gap: 6px; break-inside: avoid; }
.medbox { border: 1.5px solid var(--spruce); border-radius: 8px; padding: 6px 10px; }
.medbox.none { border-color: var(--line-strong); color: var(--quiet); }
.times li { display: flex; justify-content: space-between; }
.hs-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 8px; }
.hs-sign .line { border-bottom: 1.5px solid var(--spruce); min-height: 34px; padding-top: 6px; font-weight: 700; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .handoff { border: none; box-shadow: none; padding: 0; font-size: 10.5pt; gap: 10px; max-width: none; }
  .handoff-tools, .page-head, .tabs { display: none !important; }
  .hs-grid { grid-template-columns: 1fr 1fr; }
  .hs-alert { border-color: #000; }
  .vtable td[data-level='watch'], .vtable td[data-level='alert'] { background: none; text-decoration: underline; }
}

a.btn { text-decoration: none; }
.vtable td, .vtable th { white-space: nowrap; }
.bedside .plain li { display: flex; flex-wrap: nowrap; gap: 8px; align-items: flex-start; justify-content: space-between; }
.bedside .plain li .btn { flex: none; }
.case-head h1 { font-size: 1.5rem; }

/* ---- patrol home, new case button, offline banner */
.fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 20px; border-radius: 999px; border: none; background: var(--trail-blue); color: #fff; font: inherit; font-weight: 700; font-size: 1.0625rem; box-shadow: 0 6px 18px rgba(8, 35, 60, 0.35); cursor: pointer; }
.fab span { font-size: 1.5rem; line-height: 1; margin-top: -2px; }
.fab:focus-visible { outline: 3px solid var(--spruce); outline-offset: 3px; }
.offline-banner { position: sticky; top: 0; z-index: 60; background: #8a1f11; color: #fff; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.offline-banner[hidden] { display: none; }
.home-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.home-top .grow { flex: 1 1 260px; }
.home-top .grow input { width: 100%; min-height: 48px; font-size: 1rem; }
.nudges { display: grid; gap: 8px; }
.nudge { display: block; padding: 12px 14px; border-radius: 10px; background: var(--snowpack); border: 1.5px solid var(--line-strong); color: inherit; text-decoration: none; font-weight: 600; }
.nudge.warn { background: #fff3d6; border-color: #d9a400; }
a.nudge:hover { border-color: var(--trail-blue); }
.case-list { display: grid; gap: 8px; }
.case-row { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; background: #fff; min-height: 56px; }
.case-row:hover, .case-row:focus-visible { border-color: var(--trail-blue); box-shadow: var(--lift); }
.cr-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---- checklists, collision panel, forms */
.checklist { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.checklist summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checklist li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: none; }
.checklist li.done span:first-of-type { color: var(--quiet); }
.checklist .check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.checklist .check input, .checks .check input { width: 24px; height: 24px; flex: none; }
.checks { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.checks legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.parties li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.parties-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .parties-grid { grid-template-columns: 1fr 1fr; } }
.party-card { border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; break-inside: avoid; }
.party-card h4 { margin-bottom: 2px; }
.statement { font-size: 0.9375rem; line-height: 1.5; border-left: 4px solid var(--spruce); padding-left: 12px; }
.sigbox { min-height: 72px; display: flex; align-items: flex-end; }
.sigbox .sig-img { max-height: 70px; }
.takehome .lead-text { font-size: 1.125rem; }
.takehome .urgent h3 { color: var(--alert); border-bottom-color: var(--alert); }
.takehome .bullets { list-style: disc; padding-left: 22px; }
.takehome .bullets li { padding: 3px 0; font-size: 1.0625rem; }
.takehome .emergency { font-weight: 800; font-size: 1.25rem; border: 2px solid var(--alert); color: var(--alert); text-align: center; padding: 8px; border-radius: 10px; }
.bed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media print { .fab, .offline-banner, .handoff .chip-row { display: none !important; } }

/* ======================================================================================================
   Design pass: one spacing scale, one control size, roomier panels.
   Everything below overrides the earlier rules on purpose, so the scale lives in one place.
   Spacing scale: 4, 8, 12, 16, 24, 32, 48. Controls are 44 px (40 px for small), radius 8 px, panels 14 px.
   ====================================================================================================== */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --radius: 8px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 48, 58, 0.05);
}

/* shell: more air around the content, a calmer rail */
.rail { padding: 28px 16px 20px; gap: 28px; }
.brand strong { font-size: 1.375rem; }
.nav { gap: 4px; }
.nav a { padding: 10px 14px; border-radius: var(--radius); }
.who { padding: 0 6px; }
.main { padding: var(--sp-6) var(--sp-7) 120px; max-width: 1160px; }
.page-head { margin-bottom: var(--sp-5); gap: var(--sp-3) var(--sp-5); }
h1 { font-size: 2rem; letter-spacing: -0.01em; }
.page-head h1 { margin: 0; }
.section { margin-top: var(--sp-6); }
.section > header { margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); }

/* rhythm: stacks breathe, panels hold their content with room to spare */
.stack { gap: var(--sp-4); }
.stack.tight { gap: var(--sp-2); }
.row { gap: var(--sp-3); }
.spread { gap: var(--sp-3) var(--sp-5); }
.panel { padding: var(--sp-5); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel.stack { gap: 20px; }
.empty { padding: var(--sp-6) var(--sp-5); border-radius: var(--radius-lg); }
.case { gap: var(--sp-5); }
.case > section.stack { gap: var(--sp-4); }

/* controls: one height, one radius, the same gap everywhere */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px; padding: 0 18px; line-height: 1.2; border-radius: var(--radius); transition: background-color 0.12s, border-color 0.12s; }
.btn:hover { background: #f4f7f9; }
.btn.primary:hover { background: var(--trail-blue-dark); }
.btn.small { min-height: 40px; padding: 0 14px; }
.btn.big { min-height: 52px; padding: 0 22px; }
.btn.link { display: inline; min-height: 0; padding: 4px 6px; background: none; }
.btn.link:hover { background: none; }
.btn.quiet-danger { border-color: transparent; background: none; color: var(--closed); font-weight: 700; }
.btn.quiet-danger:hover { background: var(--closed-tint); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

label.field, .field { gap: var(--sp-2); font-weight: 700; }
.field .hint { margin-top: 0; line-height: 1.4; }
input, select, textarea { min-height: 46px; padding: 10px 12px; border-radius: var(--radius); }
textarea { padding: 12px; line-height: 1.5; }
input[type='datetime-local'], input[type='date'], input[type='time'] { min-width: 0; }
.form { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 20px; align-items: start; }
.inline-form { gap: var(--sp-3); }

/* tabs: pills, so many tabs read as a toolbar and not as a row of stray words */
.tabs { gap: var(--sp-2); border-bottom: none; margin-bottom: var(--sp-5); padding: 0 0 var(--sp-1); }
.tabs button { border: 1px solid transparent; border-radius: 999px; padding: 0 18px; min-height: 42px; margin: 0; color: var(--spruce-soft); background: transparent; }
.tabs button:hover { background: rgba(18, 48, 58, 0.07); }
.tabs button[aria-selected='true'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }

/* tables */
th, td { padding: 14px 18px; }
.table-wrap { border-radius: var(--radius-lg); }

/* dialogs: a header you can tell from the body, and a footer that is clearly the end */
.overlay { padding: 8vh 16px 24px; }
.dialog { padding: var(--sp-5) var(--sp-6) var(--sp-6); gap: var(--sp-5); border-radius: 16px; }
.dialog header { padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); align-items: center; }
.dialog header h2 { font-size: 1.375rem; }
.dialog form.stack { gap: var(--sp-5); }
.dialog .footer { padding-top: var(--sp-5); border-top: 1px solid var(--line); gap: var(--sp-3); }
.dialog .footer.row { justify-content: flex-end; }
@media (max-width: 640px) {
  .overlay { padding: 16px 12px; }
  .dialog { padding: var(--sp-5) var(--sp-4) var(--sp-5); }
  .dialog .footer .btn { flex: 1 1 auto; }
}

/* the case page */
.back { margin: 0 0 calc(var(--sp-2) * -1); }
.back a { color: var(--quiet); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.back a:hover { color: var(--trail-blue); text-decoration: underline; }
.case-head { padding: var(--sp-5) var(--sp-6); gap: var(--sp-4); }
.case-head .case-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--sp-3) var(--sp-5); }
.case-head h1 { font-size: 1.75rem; margin-bottom: var(--sp-1); }
.case-head .actions { padding-top: var(--sp-4); border-top: 1px solid var(--line); }

/* progress: the one strong element on the case page */
.progress { gap: var(--sp-4); border-left: 6px solid var(--trail-blue); }
.progress-top { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: center; justify-content: space-between; }
.progress-top h2 { margin-bottom: 2px; }
.pbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--open); border-radius: 999px; transition: width 0.3s; }
.psteps { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.pstep { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--spruce); font: inherit; font-weight: 700; font-size: 0.9375rem; cursor: pointer; }
.pstep:hover { border-color: var(--spruce); }
.pstep.done { background: var(--ok-tint); border-color: #a9d8bd; color: var(--open); }
.pstep.done::before { content: '\2713'; font-weight: 700; }
.pstep.next { border-color: var(--trail-blue); color: var(--trail-blue-dark); box-shadow: 0 0 0 3px rgba(27, 95, 193, 0.16); }
@media (prefers-reduced-motion: reduce) { .pbar > i { transition: none; } }

/* patient card: headings in plain sentence case, sections divided, buttons one size */
.bedside { padding: var(--sp-6); gap: var(--sp-5); border-radius: 16px; }
.bedside h4 { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--spruce); }
.bedside > .stack.tight { padding-top: var(--sp-5); border-top: 1px solid var(--line); gap: var(--sp-3); }
.bedside .plain li { padding: var(--sp-3) 0; }
.bedside .vhead { margin-bottom: calc(var(--sp-2) * -1); }
.vstrip { gap: var(--sp-3); }
.vtile { padding: var(--sp-4) var(--sp-2); }
.vtile .vl { text-transform: none; letter-spacing: 0; font-size: 0.875rem; }
.vtile .vv { font-size: 1.875rem; }
.bed-actions { display: grid; gap: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.bed-primary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 280px)); gap: var(--sp-3); }
.bed-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-3); }
.bed-secondary .btn { width: 100%; }
.bed-foot { display: flex; justify-content: flex-end; padding-top: var(--sp-2); }
.chip-row { gap: var(--sp-3); }
.stages { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.stage { padding: var(--sp-3) var(--sp-4); min-height: 72px; }
.checklist { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-lg); }
details.paperwork > summary { padding: var(--sp-5); }
details.paperwork > div { padding: 0 var(--sp-5) var(--sp-5); }
.nsaar-sec > summary { min-height: 48px; }
.nsaar-sec[open] > summary { margin-bottom: var(--sp-2); }
.nsaar-note { margin: var(--sp-1) 0 var(--sp-4); line-height: 1.5; }
.nsaar-grid { gap: var(--sp-4) var(--sp-5); }
.nsaar-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); padding-top: var(--sp-2); }
.hs-alert .k, .hs-sign .k, .hs-head .eyebrow, .hs h3 { text-transform: none; letter-spacing: 0; }
.hs h3 { font-size: 1rem; }

/* patrol home and lists */
.home-top { gap: var(--sp-3); margin-bottom: var(--sp-1); }
.nudges { gap: var(--sp-3); }
.nudge { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg); }
.case-list { gap: var(--sp-3); }
.case-row { padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg); gap: var(--sp-1); }
.cr-tags { margin-top: var(--sp-2); gap: var(--sp-3); }
.fab { right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); min-height: 56px; padding: 0 24px; }
.filters { gap: var(--sp-3); }

@media (max-width: 860px) { .main { padding: var(--sp-5) var(--sp-4) 112px; } }
@media (max-width: 640px) {
  .panel { padding: var(--sp-4) 18px; }
  .case-head { padding: var(--sp-4) 18px; }
  .bedside { padding: var(--sp-5) 18px; }
  .tabs { margin-bottom: var(--sp-4); }
  .fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.625rem; }
  th, td { padding: 12px 14px; }
}
@media print { .progress, .back { display: none !important; } }

/* time clock kiosk (manager side) */
.row.between { justify-content: space-between; align-items: center; }
.pair-code { font-size: 2rem; font-weight: 700; letter-spacing: 0.18em; text-align: center; padding: var(--sp-4); background: #eef3f5; border-radius: var(--radius); }
.kiosk-link { word-break: break-all; }
.punch-photo { width: 100%; max-width: 480px; border-radius: var(--radius); }
tr.row-warn td { background: #fff4e0; }
.check { display: flex; gap: var(--sp-2); align-items: center; min-height: 44px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.badge-card { display: grid; justify-items: center; gap: 8px; text-align: center; font-family: inherit; }
.badge-name { font-size: 1.125rem; font-weight: 700; }
@media print { .badge-grid { grid-template-columns: repeat(3, 1fr); } .badge-card { break-inside: avoid; border: 1px dashed #000; margin: 0; } }

/* ================= Menu: grouped icon rail, phone tab bar, jump-to palette ================= */
.shell { --rail-w: 272px; grid-template-columns: var(--rail-w) minmax(0, 1fr); transition: grid-template-columns .22s ease; }
.shell.collapsed { --rail-w: 76px; }
.frame { min-width: 0; display: block; }
.topbar, .tabbar { display: none; }
.ico { flex: none; }

.rail { background: #0e2830; padding: 20px 14px 16px; gap: 14px; border-right: 1px solid rgba(255,255,255,.04); }
.rail .brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 8px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, #2a6f86, #17485a); color: #fff; flex: none; }
.brand-text { min-width: 0; flex: 1; }
.rail .brand strong { font-size: 1.0625rem; line-height: 1.2; letter-spacing: 0; }
.rail .brand span { font-size: .8125rem; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-toggle { flex: none; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: #9db6c0; display: grid; place-items: center; cursor: pointer; }
.rail-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-toggle .ico { transition: transform .22s ease; }
.collapsed .rail-toggle .ico { transform: rotate(180deg); }

.rail-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); color: #a9c0ca; font: inherit; font-size: .9375rem; cursor: pointer; text-align: left; }
.rail-search:hover { background: rgba(255,255,255,.09); color: #fff; }
.rail-search .nav-label { flex: 1; }
kbd { font: inherit; font-size: .75rem; line-height: 1; padding: 4px 6px; border-radius: 6px; border: 1px solid rgba(127,150,160,.45); color: inherit; opacity: .85; background: transparent; }

.rail .nav { flex: 1; gap: 18px; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px; }
.nav-group { display: grid; gap: 2px; }
.nav-title { font-size: .8125rem; color: #7d9aa6; padding: 0 12px 4px; font-weight: 700; }
.rail .nav a, .rail-foot .nav-group a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
  color: #c6d8df; text-decoration: none; font-size: .9375rem; white-space: nowrap;
}
.rail .nav a:hover, .rail-foot a:hover { background: rgba(255,255,255,.07); color: #fff; }
.rail .nav a[aria-current='page'], .rail-foot .nav-group a[aria-current='page'] { background: rgba(255,255,255,.12); color: #fff; font-weight: 700; }
.rail .nav a[aria-current='page']::before, .rail-foot .nav-group a[aria-current='page']::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #6cc1ff; }
.rail .nav a[aria-current='page'] .ico, .rail-foot .nav-group a[aria-current='page'] .ico { color: #6cc1ff; }
.rail-foot { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 4px 0 6px; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #2a6f86; color: #fff; font-weight: 700; font-size: .8125rem; }
.who-text { min-width: 0; flex: 1; display: grid; }
.who-text b { font-size: .875rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { font-size: .8125rem; color: #8fa9b4; }
.rail-out { flex: none; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: #9db6c0; display: grid; place-items: center; cursor: pointer; }
.rail-out:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail :focus-visible { outline: 3px solid #6cc1ff; outline-offset: 1px; }

/* collapsed: icons only, with the name as a tooltip */
.collapsed .rail { padding-inline: 12px; }
.collapsed .brand-text, .collapsed .nav-label, .collapsed .rail-search kbd, .collapsed .who-text { display: none; }
.collapsed .rail .brand { flex-direction: column; padding: 0; gap: 8px; }
.collapsed .rail-search { justify-content: center; padding: 0; }
.collapsed .rail .nav a, .collapsed .rail-foot .nav-group a { justify-content: center; padding: 0; }
.collapsed .nav-title { height: 1px; padding: 0; margin: 4px 10px 8px; background: rgba(255,255,255,.1); font-size: 0; overflow: hidden; }
.collapsed .who { flex-direction: column; padding: 0; }
.collapsed .rail .nav a[aria-current='page']::before, .collapsed .rail-foot .nav-group a[aria-current='page']::before { left: -12px; }

/* jump-to palette */
.palette-overlay { place-items: start center; padding-top: min(14vh, 120px); }
.palette { width: min(600px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(8, 28, 36, .45); overflow: hidden; animation: pal-in .14s ease-out; }
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.palette-top { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--quiet); }
.palette-input { flex: 1; min-width: 0; height: 60px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.125rem; color: var(--spruce); }
.palette-input:focus-visible { outline: 0; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 420px); overflow-y: auto; }
.palette-heading { padding: 10px 12px 4px; font-size: .8125rem; font-weight: 700; color: var(--quiet); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 46px; border-radius: 10px; cursor: pointer; color: var(--spruce); }
.palette-item[aria-selected='true'] { background: #e8f1fb; color: var(--trail-blue-dark); }
.p-title { flex: 1; min-width: 0; }
.p-hint { font-size: .8125rem; color: var(--quiet); }
.palette-none { padding: 24px 12px; color: var(--quiet); }
.palette-foot { display: flex; gap: 18px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--quiet); background: #f6f9fa; }
.palette-foot kbd { margin-right: 4px; color: var(--quiet); }

/* phones: no rail; slim top bar, bottom tabs and a sheet of everything */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 56px; border-radius: 12px; color: var(--quiet); text-decoration: none; font: inherit; font-size: .75rem; background: transparent; border: 0; cursor: pointer; align-content: center; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab[aria-current='page'], .tab.on { color: var(--trail-blue-dark); background: #e8f1fb; font-weight: 700; }
.top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.top-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 360px; margin-left: auto; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--quiet); font: inherit; font-size: .9375rem; cursor: pointer; }
.top-search span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search kbd { display: none; }
.sheet-group { display: grid; gap: 8px; }
.sheet-group .nav-title { color: var(--quiet); padding: 0; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sheet-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 12px; background: #f1f5f7; color: var(--spruce); text-decoration: none; }
.sheet-item[data-current='true'] { background: #e8f1fb; color: var(--trail-blue-dark); font-weight: 700; }

@media (max-width: 860px) {
  .shell, .shell.collapsed { display: block; }
  .rail { display: none; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: rgba(237,241,243,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .tabbar { display: grid; }
  .main { padding-bottom: 120px; }
  .fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .rail, .topbar, .tabbar { display: none !important; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail .nav.nav-personal { flex: none; overflow: visible; margin: 0; padding: 0; gap: 0; }
.rail-foot .nav-group a { }
.dialog.menu-sheet { font-family: inherit; font-size: 1rem; line-height: 1.5; color: var(--spruce); }
.menu-sheet .btn { width: 100%; }
.menu-sheet header .btn { width: auto; }

/* Patrol access levels */
.levels .matrix { width: 100%; border-collapse: collapse; }
.levels .matrix th, .levels .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line, #e3e6ea); text-align: left; vertical-align: top; }
.levels .matrix .center { text-align: center; }
.levels .matrix thead th { position: sticky; top: 0; background: var(--bg, #fff); font-weight: 600; }
.levels .matrix .group-row th { background: var(--panel-alt, #f4f6f8); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.levels .matrix input[type=checkbox] { width: 20px; height: 20px; }

/* Terrain park */
.park-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.park-day { margin: 0; }
.park-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 16px; align-items: start; }
.park-side ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.park-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 6px 0; font: inherit; color: inherit; cursor: pointer; }
span.park-row { cursor: default; }
.park-banner { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff6df; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.park-map.placing { cursor: crosshair; outline: 3px solid #d98a00; }
.park-pin-wrap { background: none; border: 0; }
.park-pin { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 2px; border-radius: 6px; border: 3px solid #fff; color: #fff; font: 700 14px/1 system-ui, sans-serif; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55); background: #2f7d4f; }
.park-pin.st-needs_attention { background: #b87400; }
.park-pin.st-closed { background: #b3201a; }
.park-pin.uninspected { border-style: dashed; }
.park-pop .row { margin-top: 6px; }
@media (max-width: 800px) { .park-layout { grid-template-columns: 1fr; } }
.park-controls input, .park-controls select { width: auto; min-width: 0; flex: 0 1 auto; }
.park-controls input[type=date] { min-width: 150px; }
.park-controls .row { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.park-controls .row select { max-width: 190px; }
.park-controls > button { min-width: 40px; }
@media (min-width: 801px) { .park-map { height: 62vh; } }

/* ---- Patrol: sections, search and case lists ---- */
.psections { display: flex; gap: 8px; margin: 0 0 14px; overflow-x: auto; padding-bottom: 2px; }
.psections button { font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--spruce-soft); cursor: pointer; white-space: nowrap; }
.psections button:hover { border-color: var(--trail-blue); }
.psections button[aria-current='page'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.psec-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #d9a400; color: #1d1a10; font-size: 0.8125rem; line-height: 22px; text-align: center; }
.solo > div > .tabs { display: none; }
.psections + div .tabs { font-size: 0.9375rem; }
.search { position: relative; }
.search input { width: 100%; min-height: 48px; font-size: 1rem; padding-left: 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23587' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 14px center; }
.cases-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cases-bar { flex-wrap: nowrap; }
.cases-bar .grow { flex: 1 1 200px; min-width: 0; }
.cases-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.cases-filters select, .cases-filters input { min-height: 40px; width: auto; }
.cases-filters [hidden] { display: none; }
.fchips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.fchips button { font: inherit; font-size: 0.9375rem; font-weight: 600; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--spruce-soft); cursor: pointer; }
.fchips button[aria-pressed='true'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.cases-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 36px; }
.pill { font: inherit; font-size: 0.875rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--snowpack); cursor: pointer; }
.pill:hover { border-color: var(--alert); }
.btn.ghost { background: none; border-color: transparent; color: var(--trail-blue); text-decoration: underline; }
.menu-pop { position: relative; }
.menu-pop summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.menu-pop summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; z-index: 20; margin-top: 6px; min-width: 240px; padding: 10px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 12px; box-shadow: var(--lift); }
.menu-items .btn { width: 100%; justify-content: flex-start; }
@media (min-width: 900px) { .cases .case-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .cases .cr-meta { grid-column: 1; } .cases .cr-tags { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; margin: 0; } }

/* ================= Density and device pass: tighter on a desk, still easy to tap on a phone ================= */

/* Patrol: sections as one segmented switch beside the title, pages as quiet underline tabs */
.patrol-head { justify-content: flex-start; gap: 10px 20px; margin-bottom: 12px; }
.psections { margin: 0; gap: 2px; padding: 3px; background: #dde5ea; border-radius: 10px; overflow-x: auto; }
.psections button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--spruce-soft); font-weight: 700; }
.psections button:hover { background: rgba(255, 255, 255, 0.6); }
.psections button[aria-current='page'] { background: #fff; color: var(--spruce); box-shadow: 0 1px 3px rgba(18, 48, 58, 0.22); }
.psec-badge { min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; font-size: 0.75rem; padding: 0 5px; }
.pbody > div > div > .tabs { gap: 2px; margin: 0 0 14px; padding: 0; border-bottom: 1px solid var(--line-strong); }
.pbody > div > div > .tabs button { min-height: 38px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--quiet); font-size: 0.9375rem; }
.pbody > div > div > .tabs button:hover { background: rgba(18, 48, 58, 0.05); color: var(--spruce); }
.pbody > div > div > .tabs button[aria-selected='true'] { background: none; color: var(--spruce); border-bottom-color: var(--trail-blue); }

/* Access levels: names and ticks side by side, small enough to see the whole grid */
.levels .lv-legend { font-size: 0.875rem; color: var(--quiet); }
.levels .lv-legend summary { cursor: pointer; font-weight: 700; color: var(--spruce); }
.levels .lv-legend ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.levels .table-wrap { max-height: 72vh; overflow: auto; }
.levels .matrix { table-layout: fixed; min-width: 600px; }
.levels .matrix th, .levels .matrix td { padding: 5px 10px; vertical-align: middle; }
.levels .matrix thead th { top: 0; z-index: 3; background: #f3f6f8; font-size: 0.8125rem; text-align: center; white-space: normal; }
.levels .matrix thead th:first-child { text-align: left; }
.levels .matrix th:first-child, .levels .matrix td:first-child { width: 300px; }
.levels .matrix th.center, .levels .matrix td.center { width: 78px; }
.levels .matrix .lv-about { display: none; }
.levels .matrix tbody th { font-weight: 400; text-align: left; background: #fff; position: sticky; left: 0; z-index: 1; }
.levels .matrix .f-label { font-weight: 700; font-size: 0.9375rem; line-height: 1.25; }
.levels .matrix .f-about { color: var(--quiet); font-size: 0.8125rem; line-height: 1.3; }
.levels .matrix .group-row th { padding: 4px 10px; background: #e9eff2; font-size: 0.75rem; position: static; }
.levels .matrix tbody tr:not(.group-row):hover th, .levels .matrix tbody tr:not(.group-row):hover td { background: #f1f6fa; }
.levels .matrix input[type='checkbox'] { width: 18px; height: 18px; min-height: 18px; margin: 0; }
.levels .matrix.people th:first-child, .levels .matrix.people td:first-child { width: auto; }
.levels .matrix.people { min-width: 0; table-layout: auto; }
.levels .matrix.people select { min-height: 34px; padding: 4px 8px; width: auto; }

/* Desk and laptop: compact controls and rows so more records fit on screen */
@media (min-width: 861px) and (hover: hover) and (pointer: fine) {
  .main { padding: 20px 28px 48px; max-width: 1400px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.125rem; }
  .page-head { margin-bottom: 14px; }
  .section { margin-top: 22px; }
  .stack { gap: 12px; }
  .panel { padding: 14px 16px; }
  .panel.stack { gap: 12px; }
  .card { padding: 14px 16px; }
  .btn { min-height: 36px; padding: 0 14px; }
  .btn.small { min-height: 30px; padding: 0 10px; font-size: 0.8125rem; }
  .btn.big { min-height: 44px; }
  input, select { min-height: 36px; padding: 5px 10px; }
  textarea { min-height: 72px; padding: 8px 10px; }
  input[type='checkbox'] { width: 18px; height: 18px; min-height: 18px; }
  label.field, .field { gap: 3px; font-size: 0.875rem; }
  label.check, .check { min-height: 32px; }
  .form { gap: 10px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
  .inline-form, .row, .filters { gap: 8px; }
  th, td { padding: 7px 12px; }
  th { font-size: 0.8125rem; }
  .table-wrap { border-radius: 10px; }
  .tabs { margin-bottom: 12px; gap: 4px; }
  .tabs button { min-height: 34px; padding: 0 14px; }
  .nav a { min-height: 38px; padding: 6px 10px; }
  .rail { padding: 16px 10px; gap: 14px; }
  .case-list { gap: 8px; }
  .case-row { padding: 9px 14px; border-radius: 10px; }
  .cr-tags { margin-top: 2px; }
  .nudge { padding: 10px 14px; border-radius: 10px; }
  .home-top .grow input, .search input { min-height: 40px; font-size: 0.9375rem; }
  .cases-filters select, .cases-filters input { min-height: 34px; }
  .fchips button { min-height: 32px; padding: 0 12px; font-size: 0.875rem; }
  .cases-bar .grow { flex-basis: 260px; }
  .tile { min-height: 84px; padding: 10px 12px 8px 16px; }
  .tile-price { font-size: 1.25rem; margin-top: 4px; }
  .dialog { padding: 18px 22px 20px; gap: 14px; }
  .dialog form.stack { gap: 14px; }
  .dialog header h2 { font-size: 1.125rem; }
  .dialog .footer { padding-top: 14px; }
  .case-head { padding: 14px 18px; gap: 10px; }
  .case-head h1 { font-size: 1.5rem; }
  .bedside { padding: 18px; gap: 14px; }
  .nsaar-grid { gap: 10px 16px; }
  .fab { min-height: 48px; padding: 0 20px; right: 20px; bottom: 20px; }
}

/* Phones and small tablets: fewer margins, one column, tables become cards, taps stay big */
@media (max-width: 640px) {
  .main { padding: 12px 12px 104px; }
  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.125rem; }
  .page-head { margin-bottom: 12px; gap: 8px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .section { margin-top: 18px; }
  .stack { gap: 10px; }
  .panel, .card { padding: 12px 14px; }
  .panel.stack { gap: 10px; }
  .form { gap: 10px; grid-template-columns: 1fr; }
  label.field, .field { gap: 3px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  input, select { min-height: 44px; font-size: 1rem; }
  .row { gap: 8px; }
  .case-row { padding: 10px 12px; }
  .tabs { margin-bottom: 10px; }
  .patrol-head { display: grid; gap: 8px; }
  .psections { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .psections button { padding: 0 6px; justify-content: center; min-height: 40px; }
  .pbody > div > div > .tabs { margin-bottom: 10px; overflow-x: auto; flex-wrap: nowrap; }
  .pbody > div > div > .tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; min-height: 42px; padding: 0 12px; margin: 0 0 -1px; }
  .pbody > div > div > .tabs button[aria-selected='true'] { background: none; color: var(--spruce); border-bottom-color: var(--trail-blue); }
  .fchips button { min-height: 38px; padding: 0 12px; }
  .cases-filters { gap: 8px; }
  .cases-filters select { flex: 1 1 0; min-width: 0; }
  .dialog { padding: 14px 14px 16px; gap: 12px; }
  .bedside { padding: 14px; gap: 12px; }
  .case-head { padding: 12px 14px; }

  /* A table becomes a list of cards: the column name sits beside each value */
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt thead { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  table.rt tr { padding: 8px 12px; border-bottom: 1px solid var(--line); }
  table.rt tr:last-child { border-bottom: 0; }
  table.rt td { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 3px 0; border: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  table.rt td[data-label]::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-weight: 700; font-size: 0.8125rem; color: var(--quiet); }
  table.rt td.actions { justify-content: flex-end; padding-top: 6px; }
  .levels .matrix th:first-child, .levels .matrix td:first-child { width: 138px; }
  .levels .matrix th.center, .levels .matrix td.center { width: 58px; padding: 5px 2px; }
  .levels .matrix .lv-admin { display: none; }
  .levels .matrix .f-about { display: none; }
  .levels .matrix { min-width: 0; }
}
@media (max-width: 640px) {
  .cases .fchips { flex-wrap: nowrap; overflow-x: auto; display: flex; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .cases .fchips button { flex: none; white-space: nowrap; }
}
@media (max-width: 640px) { table.rt td:empty { display: none; } }

/* ================= Mountain operations: grooming, maintenance, reports ================= */
span.stack.tight { display: inline-flex; flex-direction: column; gap: 2px; }
.row.wrap { flex-wrap: wrap; }
.row .grow-end, .row.grow-end { margin-left: auto; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3, 12px); }
.stats .stat { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.stats .stat strong { font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats .stat span { font-size: .8rem; color: var(--muted, #5b6770); }
.chk-row { display: grid; grid-template-columns: 1fr 9.5rem; gap: 6px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chk-row > input { grid-column: 1 / -1; }
.wo-notes, .handoffs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wo-notes li { display: flex; flex-direction: column; gap: 1px; padding-left: 10px; border-left: 3px solid var(--line-strong); }
.handoffs li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; border-left: 4px solid var(--trail-blue, #1b5fc1); }
.handoffs li.acked { opacity: .7; border-left-color: var(--line-strong); }
.handoffs li p { margin: 6px 0; white-space: pre-wrap; }
textarea[readonly] { width: 100%; font: inherit; resize: vertical; }
@media (max-width: 640px) {
  .chk-row { grid-template-columns: 1fr; }
  .row .grow-end { margin-left: 0; }
}
@media print {
  .sidebar, .topbar, .tabs, .page-head, button, header .row { display: none !important; }
}
header > .row { flex-wrap: wrap; justify-content: flex-end; }
header > .row > input, header > .row > select { width: auto; min-width: 0; flex: 0 1 auto; }
@media (max-width: 640px) { header > .row { justify-content: flex-start; } header > .row > input[type='date'] { flex: 1 1 9rem; } }

/* ================= Documents ================= */
.role-grid { display: grid; grid-template-columns: 1fr 6rem 9rem; gap: 8px 12px; align-items: center; }
.role-grid input[type='checkbox'] { width: 20px; height: 20px; justify-self: start; }
a.btn.small { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 480px) { .role-grid { grid-template-columns: 1fr 4.5rem 6.5rem; } }

/* ================= Instructor availability calendar ================= */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted, #5b6770); padding: 2px 0; }
.cal-day { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 64px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface, #fff); font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.cal-day:disabled { opacity: .4; cursor: not-allowed; }
.cal-day.open { background: #e3f3ea; border-color: #9cc9b0; }
.cal-day.today .cal-n { text-decoration: underline; }
.cal-day[aria-pressed='true'] { outline: 3px solid var(--trail-blue, #1b5fc1); outline-offset: -2px; background: #e8f0fc; }
.cal-n { font-weight: 700; font-size: .95rem; }
.cal-t { font-size: .7rem; line-height: 1.2; color: #17703f; white-space: nowrap; }
.time-chip { display: inline-flex; gap: 8px; align-items: center; padding: 2px 4px 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; }
label.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
label.check input { width: 20px; height: 20px; }
@media (max-width: 560px) { .cal-day { min-height: 54px; padding: 3px 4px; } .cal-t { font-size: .62rem; } }
.snippet { color: var(--spruce); font-style: italic; }
.scanbar { margin: 6px 0 10px; }
input[type='search'][aria-label='Search documents'] { min-width: min(20rem, 100%); }

/* Platform console */
.platform { min-height: 100vh; padding: 1.5rem 1rem; }
.platform-box { max-width: 28rem; margin: 3rem auto; }
.platform-box.wide { max-width: 60rem; margin-top: 1rem; }
.app-row { align-items: flex-start; padding: .35rem 0; }
.app-row .hint { display: block; margin-left: 0; font-weight: 400; color: var(--muted, #52656d); }
.app-row b { display: block; }
.row.between { justify-content: space-between; align-items: center; }
.notice { background: var(--warn-bg, #fff4d6); border: 1px solid var(--warn, #c98a00); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.warn { color: var(--warn-ink, #8a5a00); }

/* ---------- self-serve demo ---------- */
.demo-pill { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 99px; background: var(--spruce); color: #fff; font-size: 0.875rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.demo-pill a { color: #fff; font-weight: 700; text-underline-offset: 3px; }
@media (max-width: 760px) { .demo-pill { left: 12px; right: 12px; bottom: 76px; border-radius: 12px; } }
.cred { width: min(420px, 100%); padding: 16px 18px; border: 2px solid var(--spruce); border-radius: var(--radius); background: #fff; }
.cred-h { font-weight: 700; margin-bottom: 8px; }
.cred dl { display: grid; gap: 6px; margin: 0; }
.cred-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
.cred-row dt { color: var(--quiet); }
.cred-row dd { margin: 0; overflow-wrap: anywhere; }
.cred code { font-size: 1rem; font-weight: 700; }

/* Rentals */
.callout { border: 1px solid var(--line-strong); border-left: 6px solid #d98a00; border-radius: var(--radius-lg); padding: 14px 16px; background: var(--powder); display: grid; gap: 10px; }
.card.stat { padding: 14px 16px; }
.card.stat .big { font-size: 1.7rem; font-weight: 700; }
.tag-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; width: 100%; }
.gear-tag { border: 1px dashed #000; padding: 8px; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.gear-tag svg { max-width: 100%; height: auto; }

/* Rental counter: pick gear from tiles, see the rental build up beside them */
.rent-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.rent-cart { position: sticky; top: 12px; display: grid; gap: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.rent-cart h2 { margin: 0; font-size: 1.1rem; }
.rent-pick { display: grid; gap: 10px; min-width: 0; }
.rent-find { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--powder); color: var(--spruce); font: inherit; font-weight: 700; cursor: pointer; }
.rchips.small .chip, .rchips .chip { min-height: 38px; padding: 0 12px; font-weight: 400; }
.chip .n { font-size: .8rem; font-weight: 400; color: var(--quiet); }
.chip.on { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.chip.on .n { color: #cfe0e6; }
.chip:focus-visible, .gear-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gear-tile { position: relative; display: grid; gap: 2px; text-align: left; padding: 10px 12px; min-height: 92px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--powder); color: var(--spruce); font: inherit; cursor: pointer; align-content: start; }
.gear-tile:hover { border-color: var(--trail-blue); }
.gear-tile .size { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.gear-tile .what { font-size: .95rem; }
.gear-tile .meta { display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--quiet); flex-wrap: wrap; }
.gear-tile .tag { background: var(--hold-tint); color: var(--hold); border-radius: 4px; padding: 0 5px; font-weight: 700; }
.gear-tile .grade { border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.gear-tile.on { background: var(--open-tint); border: 2px solid var(--open); padding: 9px 11px; }
.gear-tile .tick { position: absolute; top: 6px; right: 8px; color: var(--open); font-weight: 700; font-size: 1.1rem; }
@media (max-width: 900px) { .rent-layout { grid-template-columns: 1fr; } .rent-cart { position: static; max-height: none; } .rent-find { grid-template-columns: 1fr; } }
.cart-line { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.cart-line .row { flex-wrap: wrap; }

/* Rental pickup card and receipt code */
.rc-code { text-align: center; margin-top: 10px; display: grid; gap: 4px; justify-items: center; }
.rc-code svg { max-width: 100%; height: auto; }
.scan-bar { max-width: 560px; }
.pickup { border-left: 6px solid var(--trail-blue); display: grid; gap: 12px; }
.pickup h2, .pickup h3 { margin: 0; }
.pickup-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pickup-person { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.pickup-photo { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--snowpack); display: grid; place-items: center; font-weight: 700; color: var(--quiet); }

/* ---------- day board ---------- */
.board-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.board-clear { margin: 0; }
.board-alert { display: flex; gap: 14px; align-items: baseline; padding: 12px 16px; border-radius: var(--radius); border: 2px solid var(--line-strong); background: var(--powder); color: inherit; text-decoration: none; font-weight: 700; }
.board-alert:hover { background: #fff; }
.board-alert .ba-tag { flex: none; font-size: 0.8125rem; padding: 2px 10px; border-radius: 99px; border: 1.5px solid currentColor; }
.board-alert.stop { border-color: var(--closed); color: #7a1b13; background: #fdecea; }
.board-alert.warn { border-color: #d98a00; color: #5c3b00; background: #fff6e0; }
.board-alert.info { border-color: var(--line-strong); }
.board-edit { margin-bottom: 20px; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--powder); }
.board-edit[hidden] { display: none; }
.row.wrap { flex-wrap: wrap; }
.row.grow-end { margin-left: auto; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.bd-tile { background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.bd-tile > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bd-tile > header h2 { font-size: 1.125rem; margin: 0; }
.bd-tools { display: inline-flex; gap: 4px; }
.btn.icon { min-width: 36px; padding: 0 8px; font-weight: 700; }
.bd-list { list-style: none; margin: 0; padding: 0; }
.bd-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.bd-list li:last-child { border-bottom: none; }
.bd-tile .figures { gap: 12px 0; }
.bd-tile .figure { min-width: 0; padding-right: 18px; margin-right: 18px; }
.bd-tile .figure strong { font-size: 1.75rem; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.notes li.pinned { background: #fff6e0; margin: 0 -8px; padding: 8px; border-radius: 6px; }
.notes p { margin: 0 0 2px; }
.linklike { background: none; border: 0; padding: 0 6px; color: var(--trail-blue); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.875rem; }
.board-host { background: transparent; }
.board-host:fullscreen { background: #f4f8fa; padding: 28px; overflow: auto; }
.wall .bd-tile { padding: 22px 26px 26px; }
.wall .bd-tile > header h2 { font-size: 1.5rem; }
.wall .bd-list li, .wall .bd-tile p, .wall .notes li { font-size: 1.25rem; }
.wall .bd-tile .figure strong { font-size: 2.75rem; }
.wall .board-alert { font-size: 1.375rem; padding: 16px 22px; }
.wall-exit { margin-bottom: 14px; }
.wall .board-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }

/* help */
.help-link { display: inline-block; margin-top: 4px; font-size: 0.875rem; color: var(--trail-blue); }
.help-search { margin-bottom: var(--sp-4, 16px); max-width: 640px; }
.help-search input { width: 100%; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.help-card { background: var(--surface, #fff); border: 1px solid var(--line-strong, #c9d6dc); border-radius: var(--radius-lg, 10px); padding: 16px 18px; }
.help-card h2 { margin: 0 0 2px; font-size: 1.125rem; }
.help-card p { margin: 0 0 8px; font-size: 0.9rem; }
.help-card ul, .help-results { list-style: none; margin: 0; padding: 0; }
.help-card li, .help-results li { padding: 5px 0; }
.help-results li { border-bottom: 1px solid var(--line, #dde6ea); padding: 10px 0; }
.help-back { margin: 0 0 12px; }
.help-article { max-width: 46rem; }
.help-article h1 { margin: 0 0 8px; }
.help-intro { font-size: 1.0625rem; color: var(--ink-2, #1e4553); margin: 0 0 16px; }
.help-article ol { padding-left: 1.4rem; display: grid; gap: 10px; }
.help-tips, .help-related { margin-top: 20px; padding: 12px 16px; border-left: 4px solid var(--trail-blue, #1b5fc1); background: #eef4f8; border-radius: 6px; }
.help-tips h2, .help-related h2 { margin: 0 0 6px; font-size: 1rem; }
.help-tips ul, .help-related ul { margin: 0; padding-left: 1.2rem; }
.help-stuck { margin-top: 28px; padding: 12px 16px; border: 1px dashed var(--line-strong, #c9d6dc); border-radius: 8px; max-width: 46rem; }
@media print { .help-link, .help-search, .help-stuck { display: none !important; } }
.help-article > p:last-child { margin-top: 20px; }

/* Customer alerts, notes and data quality */
.cust-alerts { display: grid; gap: 8px; justify-items: start; }
.cust-alerts > .cust-alert { justify-self: stretch; }
.cust-alert { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border: 2px solid var(--line-strong); border-left-width: 8px; border-radius: 6px; background: var(--snowpack); }
.cust-alert[data-tone='bad'] { border-color: var(--closed); }
.cust-alert[data-tone='warn'] { border-color: #d98a00; }
.cust-alert[data-tone='good'] { border-color: var(--open); }
.cust-alert .btn { margin-left: auto; }
.flag-pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 0.8125rem; font-weight: 700; background: var(--snowpack); max-width: 100%; }
.flag-pill[data-kind='do_not_rent'], .flag-pill[data-kind='banned'] { border-color: var(--closed); color: var(--closed); }
.flag-pill[data-kind='unpaid_balance'], .flag-pill[data-kind='medical_alert'] { border-color: #d98a00; color: var(--hold); }
.flag-pill[data-kind='vip'] { border-color: var(--open); color: var(--open); }
.cust-note { padding: 8px 0; border-top: 1px solid var(--line); }
.cust-note p { margin: 4px 0; white-space: pre-wrap; }
.cust-quality { margin: 8px 0 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; }
.cust-quality summary { cursor: pointer; font-weight: 700; }

/* ---------- Area identity, grouped menu and one tab style (design review, release 1) ---------- */
:root {
  --g-home: #1b5fc1;
  --g-front: #2f6fd0;
  --g-mountain: #138a8f;
  --g-safety: #7a56c8;
  --g-programs: #b8581f;
  --g-office: #55687a;
}
/* A group's accent: on the menu rows... */
.nav-group[data-group='front'] { --area: var(--g-front); }
.nav-group[data-group='mountain'] { --area: var(--g-mountain); }
.nav-group[data-group='safety'] { --area: var(--g-safety); }
.nav-group[data-group='programs'] { --area: var(--g-programs); }
.nav-group[data-group='office'] { --area: var(--g-office); }
/* ...and on the page itself. */
[data-group='home'] { --area: var(--g-home); }
[data-group='front'] { --area: var(--g-front); }
[data-group='mountain'] { --area: var(--g-mountain); }
[data-group='safety'] { --area: var(--g-safety); }
[data-group='programs'] { --area: var(--g-programs); }
[data-group='office'] { --area: var(--g-office); }

/* Menu: foldable groups with the accent as a dot and as the current-page bar */
.nav-title { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; font: inherit; font-size: .8125rem; font-weight: 700; color: #9db6c0; padding: 6px 12px; min-height: 32px; cursor: pointer; border-radius: 8px; text-align: left; }
.nav-title:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-title span { display: inline-flex; align-items: center; gap: 8px; }
.nav-title span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--area, #6cc1ff); flex: none; }
.nav-title .ico { transition: transform .15s ease; }
.nav-group.folded .nav-title .ico { transform: rotate(-90deg); }
.nav-group.folded .nav-items { display: none; }
.nav-items { display: grid; gap: 2px; }
.nav-home { margin-bottom: 4px; }
.rail .nav-group[data-group] a[aria-current='page']::before { background: var(--area); }
.rail .nav-group[data-group] a[aria-current='page'] .ico { color: #fff; }
.rail .nav-group[data-group] a .ico { color: color-mix(in srgb, var(--area) 55%, #c6d8df); }
.rail .nav { overflow-y: auto; }
@media (prefers-reduced-motion: reduce) { .nav-title .ico { transition: none; } }
.collapsed .nav-title { height: 1px; padding: 0; margin: 4px 10px 8px; min-height: 0; background: rgba(255,255,255,.1); font-size: 0; overflow: hidden; pointer-events: none; }
.collapsed .nav-title .ico { display: none; }
.collapsed .nav-group.folded .nav-items { display: grid; }

/* Account button and its menu */
.rail-foot { position: relative; padding-top: 10px; gap: 0; }
.who { width: 100%; background: transparent; border: 0; color: inherit; font: inherit; text-align: left; border-radius: 10px; padding: 6px 8px; cursor: pointer; }
.who:hover { background: rgba(255,255,255,.07); }
.who > .ico { color: #9db6c0; flex: none; }
.who[aria-expanded='true'] > .ico { transform: rotate(180deg); }
.who-menu { position: absolute; left: 0; right: 0; bottom: calc(100% - 4px); background: #1d4452; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 5; display: grid; gap: 2px; }
.who-menu[hidden] { display: none; }
.who-menu .rail-out { width: 100%; height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; font: inherit; font-size: .9375rem; color: #c6d8df; }
.collapsed .who-menu { left: 100%; right: auto; bottom: 0; width: 220px; margin-left: 8px; }
.collapsed .who-menu .nav-label { display: inline; }
.collapsed .who { justify-content: center; }
.collapsed .who > .ico { display: none; }

/* Page title: icon, area name, accent */
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 > .ico { color: var(--area, var(--spruce)); flex: none; }
.area-name { font-size: .875rem; font-weight: 700; color: var(--area, var(--quiet)); margin-bottom: 2px; display: flex; align-items: center; gap: 8px; }
.area-name::before { content: ''; width: 24px; height: 4px; border-radius: 2px; background: var(--area); }

/* One tab style for sections: underline in the area's accent. Sell keeps big pills (tap work); Patrol keeps its own two levels. */
.tabs { gap: 2px; border-bottom: 1px solid var(--line-strong); padding: 0; margin-bottom: 20px; flex-wrap: nowrap; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 0 16px; min-height: 44px; margin: 0 0 -1px; color: var(--quiet); }
.tabs button:hover { background: rgba(18, 48, 58, 0.05); color: var(--spruce); }
.tabs button[aria-selected='true'] { background: none; color: var(--spruce); border-bottom-color: var(--area, var(--trail-blue)); }
.tabs { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
@media (min-width: 900px) { .tabs { mask-image: none; -webkit-mask-image: none; } }
.sell-menu .tabs button[aria-selected='true'] { border-color: var(--spruce); }

/* Dates and short fields do not need the whole page */
.field input[type='date'], .field input[type='datetime-local'], .field input[type='time'] { max-width: 15rem; }
.form .field input[type='date'], .dialog .field input[type='date'] { max-width: none; }

/* Phone: the Today controls sit in one row under the title */
@media (max-width: 640px) {
  .page-head .actions, .page-head > .row { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-head .actions .field, .page-head > .row .field { flex: 1 1 100%; }
  .page-head .actions .btn, .page-head > .row .btn { flex: 1 1 0; }
}
/* The page frame takes focus after each navigation so screen readers announce the new page; it should not draw a ring. */
main:focus, main:focus-visible, #main:focus, [tabindex='-1']:focus:not(input):not(button) { outline: none; }
.nav-group + .nav-group { margin-top: 2px; }
.msg-body { white-space: pre-wrap; font: inherit; background: var(--snowpack); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0; }

/* Weekly report: the day-by-day list needs room for "$1,234 · 56 guests" and some air under the buttons. */
.bars.week-bars li { grid-template-columns: 110px minmax(80px, 1fr) minmax(150px, 190px); }
.bars.week-bars li > span:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .bars.week-bars li { grid-template-columns: 90px 1fr; } .bars.week-bars li > span:last-child { grid-column: 1 / -1; text-align: left; } }

/* Product form: the days it is sold sit on one line across the whole form. */
.form fieldset.days { grid-column: 1 / -1; }
.form fieldset.days .row { flex-wrap: wrap; gap: 6px 18px; }

.brand-logo { max-height: 56px; max-width: 220px; }
.brand-hero { max-width: 100%; max-height: 140px; border-radius: 8px; }

.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card .big { font-size: 1.75rem; line-height: 1.1; }
.pace-bars { display: block; min-width: 120px; }

.more-details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.more-details[open] > summary { margin-bottom: 8px; }
.seg.tender-row .btn[aria-pressed='true'] { background: var(--trail-blue); border-color: var(--trail-blue); color: #fff; }
.cash-quick .btn { min-height: 52px; min-width: 88px; font-size: 1.05rem; }
.change-due { font-size: 1.6rem; font-weight: 800; }
[aria-invalid='true'] { border-color: #b3261e !important; box-shadow: 0 0 0 2px rgba(179, 38, 30, 0.25); }

/* Sell: a tap on a tile says "Added"; on phones and tablets the basket total and Checkout stay at the bottom */
.tile.added { outline: 3px solid var(--trail-blue); position: relative; }
.tile.added::after { content: attr(data-added); position: absolute; top: 6px; right: 8px; background: var(--trail-blue); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.mobile-basket-bar { display: none; }
@media (max-width: 900px) {
  .mobile-basket-bar:not([hidden]) { display: flex; position: sticky; bottom: 0; z-index: 20; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #d5dbe1; box-shadow: 0 -4px 14px rgba(10, 20, 35, .12); font-weight: 700; }
  .mobile-basket-bar .btn { min-height: 48px; }
}
.drawer-badge { display: inline-flex; align-items: center; }

/* Patrol: choices sized for gloves */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.btn.big-choice { min-height: 56px; font-size: 1.05rem; font-weight: 700; }
.btn.big-choice[aria-pressed='true'] { background: var(--trail-blue); border-color: var(--trail-blue); color: #fff; }
.sell-menu .tabs { flex-wrap: wrap; overflow-x: visible; mask-image: none; -webkit-mask-image: none; }

/* ---------- waivers ---------- */
.waiver-copy { white-space: pre-wrap; font-size: 0.9375rem; line-height: 1.55; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fafcfd; }
.sig-image { width: 100%; max-width: 360px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.link-box { display: inline-block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfd; word-break: break-all; font-size: 0.875rem; }
.waiver-panel { flex-wrap: wrap; align-items: center; }
.gate-waiver { margin-top: 6px; }
@media print { .waiver-copy { border: 0; padding: 0; background: none; } }

/* ---------- platform console: the Demos dashboard ---------- */
.platform-box.wider { max-width: 82rem; margin-top: 1rem; }
.demo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.demo-stat { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; }
.demo-stat b { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.demo-stat span { font-weight: 700; }
.demo-stat small { color: var(--quiet); }

/* ---------- the case page: wristband, three views, bedside tools ----------
   The wristband is the one bold element: a spruce band that stays at the top, so whoever holds the phone always sees whose
   record it is and what might hurt them. Everything under it stays quiet. */
.case { gap: var(--sp-4); }
.wristband { position: sticky; top: 0; z-index: 30; background: var(--spruce); color: #fff; border-radius: 14px; padding: 10px 14px 0; display: grid; gap: 6px; box-shadow: 0 6px 18px rgba(8, 35, 50, 0.22); }
.wristband .back { margin: 0; }
.wristband .back a { color: #cfe0e7; min-height: 32px; }
.wristband .back a:hover { color: #fff; }
.wb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 0.9375rem; }
.wb-case { font-weight: 700; letter-spacing: 0.01em; }
.wb-state { display: inline-flex; gap: 6px; margin-left: auto; }
.wristband .state { background: rgba(255, 255, 255, 0.94); border-radius: 999px; padding: 2px 10px; font-size: 0.8125rem; }
.wb-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.wb-name { font-size: 1.375rem; line-height: 1.2; }
.wb-sub { color: #cfe0e7; font-weight: 700; }
.wb-allergy { background: #fde7e4; color: #8e1b12; font-weight: 700; border-radius: 999px; padding: 2px 12px; }
.wb-unknown { color: #ffd9a0; font-weight: 700; font-size: 0.9375rem; }
.wb-more { color: #cfe0e7; font-size: 0.9375rem; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); margin: 4px -14px 0; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.modes [role='tab'] { font: inherit; font-weight: 700; color: #cfe0e7; background: none; border: none; min-height: 48px; cursor: pointer; border-bottom: 4px solid transparent; }
.modes [role='tab']:hover { color: #fff; }
.modes [role='tab'][aria-selected='true'] { color: #fff; border-bottom-color: #7fb2ff; }
.modes [role='tab']:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
@media (max-width: 640px) {
  .main:has(.wristband) { padding-top: 8px; }
  .wristband { border-radius: 0 0 14px 14px; margin: 0 -16px; padding: 8px 16px 0; }
  .modes { margin: 4px -16px 0; }
  .wb-name { font-size: 1.25rem; }
}

.pane { gap: var(--sp-4); }
.version-banner { background: var(--hold-tint); border: 1.5px solid #e0b560; color: #4d3200; border-radius: 12px; padding: 12px 16px; }
.outbox-strip { display: grid; gap: 8px; background: #fff7e8; border: 1.5px solid #e0b560; border-radius: 12px; padding: 12px 16px; }
.outbox-strip .refused { color: var(--alert); }
.outbox-refused { background: var(--alert-tint); color: var(--alert); border-radius: 10px; padding: 10px 12px; }

/* progress becomes a slim guide that sits between the wristband and the view */
.progress { padding: var(--sp-4) var(--sp-5); gap: var(--sp-3); }
.progress-top h2 { font-size: 1rem; color: var(--quiet); }
.progress-words p { color: var(--spruce); font-weight: 700; }
@media (max-width: 640px) {
  .psteps { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .pstep { white-space: nowrap; }
  .progress-top .btn { width: 100%; }
}

/* care */
.care-patients { align-items: center; }
.pswitch { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline-panel .stages { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 640px) {
  .timeline-panel .stages { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
  .timeline-panel .stage { flex: 0 0 132px; scroll-snap-align: start; }
}
.stage.queued { border-style: dashed; border-color: #e0b560; background: #fff7e8; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.tool { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; font: inherit; font-weight: 700; text-align: left; color: var(--spruce); background: #fff; border: 1.5px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.tool:hover { border-color: var(--spruce); }
.tool-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.tool.done { background: var(--ok-tint); border-color: #a9d8bd; }
.tool.done .tool-dot { background: var(--open); border-color: var(--open); }
.tool[data-tool='arrest'] { color: var(--alert); border-color: #e0908a; }
.log li .what { font-weight: 700; }
li.voided .what, tr.voided td:not(:last-child) { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--quiet); }
.void-note { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--alert); text-decoration: none; }
tr.voided .void-note { white-space: normal; }
.late-tag, .queued-tag { display: inline-block; margin-left: 6px; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.late-tag { background: #eef1f3; color: var(--quiet); }
.queued-tag { background: #fff0d4; color: #6b4300; }
li.queued, tr.queued { opacity: 0.85; }
.effect { color: var(--open); font-weight: 700; }
.btn.quiet { border-color: transparent; background: none; color: var(--quiet); font-weight: 700; }
.btn.quiet:hover { background: var(--snowpack); color: var(--spruce); }
.voided-patients { border-left: 6px solid var(--line-strong); }

/* bedside sheets */
.vsheet .q h4 { font-size: 0.9375rem; }
.vsheet .q label { font-weight: 700; }
.short-num { max-width: 140px; font-size: 1.25rem; font-weight: 700; text-align: center; }
.band-note { background: #eef4fd; color: var(--trail-blue-dark); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.pupil-row, .cms-row { display: grid; grid-template-columns: 88px 1fr; gap: 8px; align-items: center; }
.cms-row { grid-template-columns: 1fr; }
.cms-row > span { font-weight: 700; font-size: 0.9375rem; }
fieldset.cms { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
fieldset.cms legend { font-weight: 700; padding: 0 6px; }
details.gcs summary { gap: 12px; }
.arrest-top { display: grid; gap: 6px; background: var(--spruce); color: #fff; border-radius: 12px; padding: 14px 16px; }
.arrest-clock { font-size: 1.5rem; font-weight: 700; }
.arrest-cycle { font-weight: 700; }
.arrest-cycle[data-level='alert'] { color: #ffd0c9; }
.arrest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .arrest-grid { grid-template-columns: repeat(4, 1fr); } }
.arrest-btn { min-height: 64px; font-size: 1.0625rem; font-weight: 700; }
.arrest-btn.danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.arrest-btn.good { background: var(--open); border-color: var(--open); color: #fff; }
.arrest-log { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.refusal-block { background: var(--alert-tint); color: #7d1810; border: 1.5px solid #e0908a; border-radius: 10px; padding: 10px 12px; }

/* report: a section list beside the form on a wide screen */
.report-grid { display: grid; gap: var(--sp-4); }
.report-nav ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.report-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--spruce); font-weight: 700; text-decoration: none; white-space: nowrap; }
.report-nav a:hover { border-color: var(--spruce); }
@media (min-width: 1000px) {
  .report-grid { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .report-nav { position: sticky; top: 190px; }
  .report-nav ol { display: grid; gap: 2px; overflow: visible; }
  .report-nav a { border: none; border-radius: 8px; background: none; min-height: 40px; white-space: normal; }
  .report-nav a:hover { background: #fff; }
}
.from-note { font-size: 0.8125rem; font-weight: 700; color: var(--trail-blue-dark); }
.from-note.differs { color: var(--hold); }
.prefilled input, .prefilled textarea, .prefilled select, .prefilled .bodymap { background: #f2f7ff; }
.draft-row { align-items: center; }
.narrative-field textarea { min-height: 180px; }

@media print {
  .wristband { position: static; box-shadow: none; background: #fff; color: #000; border: 2px solid #000; }
  .wristband .state { border: 1px solid #000; }
  .modes, .progress, .outbox-strip, .tools, .bed-actions, .bed-foot, .report-nav, .chip-row.quick, .draft-row { display: none !important; }
  .case > .pane[hidden] { display: grid !important; }
  .case > .pane { break-before: page; }
  .bedside[hidden] { display: grid !important; }
  .btn.quiet, .btn.quiet-danger { display: none !important; }
  li.voided .what, tr.voided td { color: #000; }
}
.offline-banner:not([hidden]) ~ div .wristband { top: 64px; }
.bed-grid { display: grid; gap: var(--sp-5); }
.bed-now { gap: var(--sp-4); }
.bed-logs { gap: var(--sp-5); }
.bed-logs > .stack.tight, .bed-more { padding-top: var(--sp-4); border-top: 1px solid var(--line); gap: var(--sp-3); }
.bed-now .bed-actions { border-top: none; padding-top: 0; }
.bed-now .bed-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bedside .plain.log li { flex-wrap: wrap; }
.bedside .plain.log li > span:first-child { flex: 1 1 260px; min-width: 0; }
.bedside .plain.log li > .row, .bedside .plain.log li > .btn { margin-left: auto; flex: none; }
@media (min-width: 1100px) {
  .bed-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .bed-logs { border-left: 1px solid var(--line); padding-left: var(--sp-5); }
  .bed-logs > .stack.tight:first-child { border-top: none; padding-top: 0; }
  .bed-now .vstrip { grid-template-columns: repeat(3, 1fr); }
  .timeline-panel .stages { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
@media (max-width: 640px) {
  .bedside { padding: var(--sp-4); }
  .tools { grid-template-columns: 1fr 1fr; }
}
/* the bedside sheets share a class name with the printed receipt; keep the app's own type in them */
.dialog.sheet { font-family: inherit; font-size: 1rem; line-height: 1.5; color: var(--spruce); }
.report-grid > *, .pane > * { min-width: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* jumping to a section stops below the wristband instead of under it */
.pane [id], .pane details[data-section], .pane [data-field] { scroll-margin-top: 180px; }

/* ---------- Assets and fleet ----------
   The asset page reads like the plate on the machine: the tag, the name, the meters, then four big buttons for what
   people do standing beside it. Lists stay quiet; colour only marks what needs attention. */
.note-box { background: #eef4fd; border: 1px solid #c9dbf5; border-radius: 10px; padding: 10px 14px; }
.pair { display: grid; gap: var(--sp-4); }
.pair > * { min-width: 0; }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; align-items: start; } }
.plain.rows > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain.rows > li:last-child { border-bottom: none; }
.filters { flex-wrap: wrap; gap: 8px; }
.filters input[type=search] { min-width: min(320px, 100%); }
.tag-cell { font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
tr.status-out_of_service td:first-child { box-shadow: inset 4px 0 0 var(--closed); }
tr.status-needs_service td:first-child { box-shadow: inset 4px 0 0 #d98a00; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--spruce); }
.stat b { font-size: 1.75rem; line-height: 1.1; }
.stat span { color: var(--quiet); font-weight: 700; font-size: 0.9375rem; }
.stat.bad { border-color: #e0908a; background: var(--closed-tint); }
.stat.bad b { color: var(--closed); }
.stat.warn { border-color: #e0b560; background: var(--hold-tint); }
.stat.warn b { color: var(--hold); }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 4px 14px; background: #fff; font-weight: 700; color: var(--spruce-soft); }
.cat-chip .down { color: var(--closed); }

.asset-head { display: grid; gap: var(--sp-4); border-left: 6px solid var(--spruce); }
.asset-title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: flex-start; }
.asset-title h1 { font-size: 1.625rem; }
.asset-tag { display: inline-block; font-weight: 700; letter-spacing: 0.06em; border: 2px solid var(--spruce); border-radius: 6px; padding: 0 8px; margin-bottom: 6px; }
.asset-state { display: flex; gap: 8px; flex-wrap: wrap; }
.asset-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.asset-meters > div { background: var(--snowpack); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.asset-meters .k { font-size: 0.8125rem; color: var(--quiet); font-weight: 700; }
.asset-meters b { font-size: 1.5rem; line-height: 1.15; overflow-wrap: anywhere; }
.asset-meters b.small-b { font-size: 1.0625rem; }
.asset-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .asset-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.asset-actions .btn { width: 100%; }
.btn.warn-btn { border-color: #e0b560; color: #6b4300; background: #fff7e8; }
.btn.warn-btn:hover { background: var(--hold-tint); }
.attention { border-left: 6px solid #d98a00; }
.replace-flag { background: var(--hold-tint); border: 1.5px solid #e0b560; border-radius: 10px; padding: 10px 12px; color: #4d3200; }
.tag-panel svg.qr { border: 1px solid var(--line); border-radius: 8px; }
.tag-big { font-size: 1.5rem; letter-spacing: 0.06em; }
.wo-total { border-top: 1px solid var(--line); padding-top: 10px; }
.wo-sheet h3 { font-size: 1rem; }
.po-line { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 90px 110px auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .po-line { grid-template-columns: 1fr 1fr; } }
.ins-item { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ins-label { font-weight: 700; }
.chip.result-pass[aria-pressed='true'] { background: var(--open); border-color: var(--open); }
.chip.result-fail[aria-pressed='true'] { background: var(--closed); border-color: var(--closed); }
.chip.result-na[aria-pressed='true'] { background: var(--quiet); border-color: var(--quiet); }

/* QR label sheet: three across on letter paper, each label about 2.6 by 1.2 inches */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.label-card { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 8px; background: #fff; break-inside: avoid; }
.label-text { display: grid; gap: 1px; min-width: 0; }
.label-text b { font-size: 1.25rem; letter-spacing: 0.05em; }
.label-text span { overflow-wrap: anywhere; }
@media print {
  .labels-tools { display: none !important; }
  .labels { grid-template-columns: repeat(3, 2.6in); gap: 0.1in; }
  .label-card { height: 1.2in; border: 1px solid #000; }
  .asset-actions, .asset-page .btn { display: none !important; }
}
.cost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cost-grid > div { background: var(--snowpack); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; }
.cost-grid .k { font-size: 0.8125rem; color: var(--quiet); font-weight: 700; }
.cost-grid b { font-size: 1.125rem; }

/* Gate: phone helpers, the camera view and pairing codes */
.reader-tools { justify-content: center; gap: 8px; }
.camera-view { width: 100%; max-height: 50vh; background: #000; border-radius: 8px; object-fit: cover; }
.pair-code { font: 700 2.25rem/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.12em; text-align: center; padding: 12px; border: 2px dashed var(--line, #c7d9e3); border-radius: 10px; user-select: all; }

/* Injury network report (platform console) */
.print-only { display: none; }
.injury-report table.grid { font-size: 0.875rem; }
.injury-report table.grid th, .injury-report table.grid td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.injury-report table.grid thead th { vertical-align: bottom; white-space: normal; min-width: 64px; }
.injury-report table.grid tbody tr:last-child th, .injury-report table.grid tbody tr:last-child td { font-weight: 700; }
@media print {
  .print-only { display: block; }
  .injury-report .two-col { grid-template-columns: 1fr 1fr; gap: 16px; }
  .injury-report .figure strong { font-size: 1.5rem; }
}
label.net-check { align-items: flex-start; font-weight: 400; }
label.net-check input { margin-top: 3px; }
label.net-check .hint { display: block; font-weight: 400; }
.injury-report > .row select { width: auto; }

/* Guided tours (demo mountains) */
.tour-card { position: fixed; right: 20px; bottom: 96px; z-index: 70; width: min(380px, calc(100vw - 24px)); background: #fff; color: var(--ink, #12303a); border-radius: 14px; padding: 16px 18px; box-shadow: 0 14px 40px rgba(18, 48, 58, 0.32); border-top: 4px solid var(--trail-blue); display: grid; gap: 8px; }
.tour-card h2 { font-size: 1.125rem; margin: 0; }
.tour-card p { margin: 0; line-height: 1.45; }
.tour-card .tour-meta { font-size: 0.8125rem; color: var(--quiet); }
.tour-card .tour-hint { font-size: 0.8125rem; color: #8a5a00; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.tour-actions .tour-end { margin-left: auto; }
.tour-ring { outline: 3px solid var(--trail-blue) !important; outline-offset: 4px; border-radius: 8px; animation: tour-pulse 1.6s ease-out 2; }
@keyframes tour-pulse { 0% { box-shadow: 0 0 0 0 rgba(26, 102, 204, 0.45); } 100% { box-shadow: 0 0 0 14px rgba(26, 102, 204, 0); } }
@media (prefers-reduced-motion: reduce) { .tour-ring { animation: none; } }
body:has(.tour-card) .demo-pill { display: none; }
.tour-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tour-pick { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.tour-pick:hover, .tour-pick:focus-visible { border-color: var(--trail-blue); box-shadow: 0 0 0 2px var(--trail-blue); }
.tour-pick span { color: var(--quiet); font-size: 0.9375rem; }
.tour-pick small { color: var(--quiet); }
.demo-pill button { background: none; border: 0; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
@media (max-width: 760px) { .tour-card { left: 12px; right: 12px; width: auto; bottom: 76px; padding: 14px; } }
@media print { .tour-card { display: none; } }
.tour-card.tour-top { bottom: auto; top: 16px; }
@media (max-width: 760px) { .tour-card.tour-top { top: 12px; bottom: auto; } }

/* Inbox (team messages) */
.inbox { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 0; background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius-lg); min-height: 70vh; height: calc(100vh - 210px); overflow: hidden; }
.inbox-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-side > .row { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inbox-side h2 { font-size: 1rem; margin: 0; }
.inbox-list { overflow-y: auto; flex: 1; }
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-row { position: relative; display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.thread-row:hover { background: var(--snowpack); }
.thread-row[aria-current='page'] { background: #e8f0fb; box-shadow: inset 3px 0 0 var(--trail-blue); }
.thread-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-top small { color: var(--quiet); flex: none; }
.thread-last { color: var(--quiet); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 32px; }
.unread-dot { position: absolute; right: 16px; bottom: 12px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--trail-blue); color: #fff; font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread-empty { flex: 1; display: grid; place-items: center; color: var(--quiet); }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.thread-head h2 { font-size: 1.0625rem; margin: 0; }
.thread-head > .row { margin-left: auto; flex-wrap: wrap; }
.thread-back { display: none; font-size: 1.75rem; line-height: 1; text-decoration: none; color: var(--spruce); padding: 0 6px; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 16px 18px; background: var(--snowpack); }
.msg-older { text-align: center; margin-bottom: 8px; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { display: grid; gap: 4px; max-width: min(620px, 85%); justify-self: start; }
.msg.mine { justify-self: end; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; font-size: 0.8125rem; }
.msg-meta small { color: var(--quiet); }
.msg-remove { font-size: 0.75rem; padding: 0; }
.bubble { background: var(--powder); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 10px 14px; display: grid; gap: 8px; }
.msg.mine .bubble { background: #e3edfb; border-color: #c6d8f4; border-radius: 14px 14px 4px 14px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg.system { justify-self: center; max-width: 90%; display: flex; gap: 8px; color: var(--quiet); font-size: 0.8125rem; text-align: center; }
.msg-links { display: grid; gap: 6px; }
.link-card { display: flex; align-items: stretch; border: 1px solid var(--line); border-left: 4px solid var(--trail-blue); border-radius: 8px; background: var(--powder); min-width: 220px; }
.link-card .link-open { flex: 1; display: grid; gap: 1px; padding: 8px 12px; color: inherit; text-decoration: none; min-width: 0; }
.link-card a.link-open:hover strong { text-decoration: underline; color: var(--trail-blue); }
.link-card small { color: var(--quiet); font-size: 0.75rem; }
.link-card strong { overflow: hidden; text-overflow: ellipsis; }
.link-card span { color: var(--quiet); font-size: 0.875rem; }
.link-card.off { border-left-color: var(--line-strong); background: var(--snowpack); }
.link-card.off strong { font-weight: 500; color: var(--quiet); }
.link-remove { border: 0; background: none; font-size: 1.25rem; padding: 0 12px; color: var(--quiet); cursor: pointer; }
.composer { border-top: 1px solid var(--line); padding: 12px 18px; display: grid; gap: 8px; background: var(--powder); }
.compose-links { display: flex; flex-wrap: wrap; gap: 8px; }
.compose-links:empty { display: none; }
.compose-row { display: flex; gap: 10px; align-items: flex-end; }
.compose-row textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 200px; }
.pick-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.pick-list .pick span { display: grid; }
.pick-list .pick small { color: var(--quiet); text-transform: capitalize; }
.pick-head { margin: 8px 0 2px; font-size: 0.8125rem; color: var(--quiet); font-weight: 700; }
.share-btn .ico { vertical-align: -3px; }
.row.end { justify-content: flex-end; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--trail-blue); color: #fff; font-size: 0.75rem; font-weight: 700; display: inline-grid; place-items: center; }
.collapsed .nav-badge { position: absolute; margin: 0; top: 2px; right: 6px; min-width: 16px; height: 16px; font-size: 0.625rem; padding: 0 4px; }
.top-inbox { position: relative; display: none; color: var(--spruce); padding: 6px; }
.top-inbox .nav-badge { position: absolute; top: -2px; right: -4px; margin: 0; }
@media (max-width: 760px) {
  .top-inbox { display: inline-flex; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 190px); border-radius: 12px; }
  .inbox.has-thread .inbox-side { display: none; }
  .inbox:not(.has-thread) .inbox-thread { display: none; }
  .inbox-side { border-right: 0; }
  .thread-back { display: inline-block; }
  .thread-head > .row { width: 100%; }
  .msg { max-width: 92%; }
  .compose-row .btn { min-height: 44px; }
}
.nav a { position: relative; }
@media (max-width: 760px) {
  .inbox-head p.muted, .inbox-head .help-link { display: none; }
  .inbox { height: calc(100dvh - 210px); min-height: 420px; }
  .thread-head { flex-wrap: wrap; padding: 10px 12px; gap: 6px 10px; }
  .thread-head > .stack { flex: 1; min-width: 0; }
  .thread-head > .row { width: 100%; margin-left: 0; gap: 6px; }
  .thread-head > .row .btn { min-height: 34px; padding: 4px 10px; }
  .msg-scroll { padding: 12px; }
  .composer { padding: 10px 12px; }
}

/* Patrol case review */
.review-box { border: 2px solid var(--trail-blue); border-radius: 12px; padding: 16px; background: #f4f8fe; }
.review-box h2, .review-changes h2 { font-size: 1.0625rem; margin: 0; }
.review-box .check { font-weight: 400; align-items: flex-start; }
.review-box .check input { margin-top: 3px; }
.review-changes { border-left: 4px solid var(--hold); background: var(--hold-tint); border-radius: 8px; padding: 12px 16px; display: grid; gap: 6px; }
.review-changes ul { margin: 0; padding-left: 20px; }
.review-flag { border-left: 4px solid var(--closed); background: var(--closed-tint); border-radius: 8px; padding: 10px 14px; margin: 0; }
.review-history summary { cursor: pointer; color: var(--quiet); }
.review-history ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.comment-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 8px; align-items: center; }
.review-person { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.review-person:last-child { border-bottom: 0; }
.review-person .lead-pick { font-weight: 400; color: var(--quiet); min-height: 0; }
.review-people { max-height: 360px; }
.row.wrap { flex-wrap: wrap; }
@media (max-width: 760px) { .comment-row { grid-template-columns: 1fr; } .review-person { flex-wrap: wrap; } }

/* Version numbers and What's new */
.nav-badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border-radius: 50%; }
.who.has-new .avatar, .tab.has-new { position: relative; }
.who.has-new .avatar::after, .tab.has-new::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--trail-blue); box-shadow: 0 0 0 2px var(--spruce, #12323d); top: -1px; right: -1px; }
.tab.has-new::after { top: 8px; right: calc(50% - 16px); box-shadow: 0 0 0 2px #fff; }
.sheet-item .nav-badge.dot { margin-left: 0; }
.who-version { display: block; padding: 6px 12px 2px; font-size: .75rem; color: #8fa9b4; text-decoration: none; }
.who-version:hover { color: #fff; text-decoration: underline; }
.signin-version { margin: 8px 0 0; font-size: .75rem; color: var(--quiet); }
.version-line { margin-top: 20px; }
.whatsnew-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 640px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line-strong, #c9d6dc); border-radius: 8px; background: var(--surface, #fff); color: inherit; text-decoration: none; }
.whatsnew-link:hover { border-color: var(--trail-blue); }
.whatsnew-link b { color: var(--trail-blue-dark, #134a96); }
.new-pill { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--trail-blue); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.6; }
.releases { display: grid; gap: 28px; max-width: 46rem; }
.release header h2 { margin: 0; font-size: 1.25rem; }
.release header p { margin: 2px 0 10px; }
.release.is-new { padding-left: 14px; border-left: 4px solid var(--trail-blue); }
.release-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.release-notes li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 10px; align-items: start; line-height: 1.5; }
.release-notes .state { justify-self: start; }
@media (max-width: 520px) { .release-notes li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Staff and schedule ---------- */
.sched-head { display: grid; gap: 10px; margin-bottom: 14px; }
.week-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.week-nav .week-title { min-width: 10.5rem; text-align: center; }
.icon-btn { font-size: 1.25rem; line-height: 1; min-width: 40px; justify-content: center; }
.week-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.week-filter { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.week-filter select { min-height: 40px; }
.linkish { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--trail-blue); text-decoration: underline; cursor: pointer; }

/* department colours: the left edge of each shift, with the name always written beside it */
[data-dept] { --dept: #6b7c86; }
[data-dept='lifts'] { --dept: #1b5fc1; }
[data-dept='rentals'] { --dept: #7a4fd0; }
[data-dept='ski_school'] { --dept: #0f7f86; }
[data-dept='patrol'] { --dept: #b42318; }
[data-dept='food'] { --dept: #b45f00; }
[data-dept='guest_services'] { --dept: #b0306a; }
[data-dept='grooming'] { --dept: #3d6b1f; }
[data-dept='maintenance'] { --dept: #5c5f66; }
[data-dept='admin'] { --dept: #12303a; }

.sched-grid { display: grid; background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius-lg, 12px); overflow: hidden; }
.sg-row { display: grid; grid-template-columns: minmax(150px, 1.15fr) repeat(7, minmax(0, 1fr)) 64px; border-top: 1px solid var(--line); }
.sg-row:first-child { border-top: 0; }
.sg-headrow { background: #f7f9fa; position: sticky; top: 0; z-index: 1; }
.sg-row > div { padding: 8px; min-width: 0; }
.sg-row > div + div { border-left: 1px solid var(--line); }
.sg-headrow > div { display: grid; font-size: .875rem; color: var(--quiet); }
.sg-headrow b { color: var(--spruce); }
.sg-headrow small { font-size: .75rem; }
.sg-day.is-today { box-shadow: inset 0 3px 0 var(--trail-blue); background: #eef4fb; }
.sg-name { display: grid; align-content: start; gap: 2px; }
.sg-name a { font-weight: 700; color: var(--spruce); text-decoration: none; overflow-wrap: anywhere; }
.sg-name a:hover { text-decoration: underline; }
.sg-name small { color: var(--quiet); font-size: .75rem; line-height: 1.3; }
.sg-cell { display: flex; flex-direction: column; gap: 6px; position: relative; min-height: 56px; }
.sg-hours { text-align: right; font-weight: 700; font-size: .875rem; }
.sg-hours.is-over { color: var(--hold); background: var(--hold-tint); }
.sg-open { background: #fffaf0; }
.sg-open .sg-name b { color: var(--hold); }
.sg-toggle { grid-template-columns: 1fr; background: #f7f9fa; }
.sg-toggle > div { padding: 6px 12px; }

.shift-block { display: grid; gap: 1px; text-align: left; width: 100%; font: inherit; font-size: .8125rem; line-height: 1.3; color: var(--spruce); background: #fff;
  border: 1px solid var(--line-strong); border-left: 4px solid var(--dept); border-radius: 6px; padding: 5px 7px; cursor: pointer; }
.shift-block b { font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-block span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-block .sb-sub { color: var(--quiet); font-size: .75rem; white-space: normal; }
.shift-block:hover { border-color: var(--trail-blue); border-left-color: var(--dept); background: #f5f9ff; }
.shift-block.is-draft { border-style: dashed; border-left-style: solid; background: #fbfcfd; }
.shift-block.is-open { background: var(--hold-tint); border-color: #e3c27a; border-left-color: var(--dept); }
.cell-add { align-self: stretch; min-height: 28px; border: 1px dashed transparent; background: none; color: transparent; border-radius: 6px; font: inherit; font-size: 1.125rem; cursor: pointer; margin-top: auto; }
.sg-cell:hover .cell-add, .cell-add:focus-visible { border-color: var(--line-strong); color: var(--trail-blue); background: #f5f9ff; }
.sched-key { margin-top: 8px; }

.sched-phone { display: none; }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.day-strip button { display: grid; justify-items: center; gap: 0; padding: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--powder); font: inherit; color: var(--quiet); cursor: pointer; min-height: 60px; }
.day-strip button span { font-size: .75rem; }
.day-strip button b { font-size: 1.125rem; color: var(--spruce); }
.day-strip button small { font-size: .6875rem; min-height: 1em; }
.day-strip button small.has-open { color: var(--hold); font-weight: 700; }
.day-strip button.is-today { border-color: var(--trail-blue); }
.day-strip button[aria-selected='true'] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.day-strip button[aria-selected='true'] b, .day-strip button[aria-selected='true'] small { color: #fff; }
.day-title { margin: 4px 0 8px; }
.day-group { font-weight: 700; color: var(--quiet); font-size: .875rem; margin: 14px 0 6px; }
.day-list { display: grid; gap: 8px; }
.day-list .shift-block { font-size: .9375rem; padding: 10px 12px; }
.day-list .shift-block b { font-size: .9375rem; }

@media (max-width: 900px) {
  .sched-wide { display: none; }
  .sched-phone { display: block; }
  .week-bar { display: grid; }
  .week-nav { justify-content: space-between; }
  .week-actions .btn { flex: 1 1 auto; }
}

/* the shift dialog */
.shift-when { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .shift-when { grid-template-columns: 1fr 1fr; } .shift-when > :first-child { grid-column: 1 / -1; } }
.cand-box { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; margin: 0; }
.cand-box legend { font-weight: 700; padding: 0 6px; }
.cand-list { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.cand-group { display: grid; gap: 2px; margin-top: 6px; }
.cand-title { font-size: .8125rem; font-weight: 700; color: var(--quiet); margin: 4px 0 2px; }
.cand { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.cand:hover { background: var(--snowpack); }
.cand input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.cand-text { display: grid; }
.cand-sub { font-size: .8125rem; color: var(--quiet); }
.cand[data-tone='warn'] .cand-sub { color: var(--hold); }
.cand.is-blocked { cursor: not-allowed; opacity: .75; }
.cand.is-blocked:hover { background: none; }
.footer .footer-start { margin-right: auto; }
.day-seg { flex-wrap: wrap; }
.day-seg button[aria-pressed='true'] { background: var(--spruce); color: #fff; }

/* hours */
.hours-table .punch-row > td { background: #f7f9fa; padding: 8px 12px 12px; }
.hours-table .punch-row .table-wrap { background: var(--powder); }

/* staff list and person page */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar input[type=search] { flex: 1 1 240px; min-height: 44px; }
.filter-bar select { min-height: 44px; }
.filter-bar .btn.primary { margin-left: auto; }
.notice-box { border-left: 4px solid #d98a00; padding-left: 14px; }
.person-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--quiet); margin-top: 4px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.pcard { display: grid; gap: 10px; }
.pcard .card-head { margin: 0; }
.pcard .table-wrap { border: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.big-pair { display: flex; gap: 24px; }
.big-pair b { font-size: 1.5rem; }
.setup-h { margin-top: 12px; }
.week-filter select, .filter-bar select { width: auto; flex: 0 1 auto; }
.filter-bar input[type=search] { width: auto; }
.sg-row { grid-template-columns: minmax(150px, 1.15fr) repeat(7, minmax(0, 1fr)) 76px; }
.sg-hours { white-space: nowrap; }
.sg-cell:has(.shift-block) .cell-add { position: absolute; right: 4px; bottom: 4px; width: 26px; min-height: 26px; padding: 0; margin: 0; }
.sg-cell:has(.shift-block) { padding-bottom: 8px; }
.sg-cell { min-height: 48px; }
.sg-row.sg-toggle { grid-template-columns: 1fr; }
.sg-patrol { background: #fbf5f4; }
.shift-block.is-readonly { cursor: pointer; text-decoration: none; background: #fff; border-style: solid; }
.shift-block.is-readonly.is-open { background: var(--hold-tint); }
.shift-block.is-mine { border-width: 2px; border-color: var(--spruce); border-left-width: 4px; }
.shift-block:disabled { cursor: default; opacity: 1; color: var(--spruce); }
.sg-row.is-me .sg-name b { text-decoration: underline; }
.shift-when.two { grid-template-columns: 1fr 1fr; }
.perm-list { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }
.perm-group { margin: 10px 0 2px; font-size: .875rem; color: var(--quiet); }
.perm-row { display: grid; grid-template-columns: 1fr minmax(180px, 230px); gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.perm-row select { min-height: 40px; }
@media (max-width: 560px) { .perm-row { grid-template-columns: 1fr; gap: 4px; } }
.tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .75rem; font-weight: 700; color: var(--quiet); vertical-align: middle; }
.tag[data-kind='patrol'] { border-color: #e0a7a0; color: var(--closed); }

/* Patrol > Team > Cover */
.cover-setting { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--spruce); background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; }
.cover-setting input { width: 18px; height: 18px; }
.cover-section { margin-top: 24px; }
.cover-section > h3 { font-size: 1rem; margin: 0 0 10px; }
.cover-list { display: grid; gap: 8px; }
.cover-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; background: var(--powder); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 10px 10px; }
.cover-leaf { display: grid; justify-items: center; align-content: center; width: 56px; height: 60px; border-radius: 6px; background: var(--spruce); color: #fff; line-height: 1.05; }
.cover-leaf span { font-size: .6875rem; opacity: .85; }
.cover-leaf b { font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.cover-main { min-width: 0; display: grid; gap: 2px; }
.cover-main p { margin: 0; }
.cover-when b { font-size: .9375rem; }
.cover-who { font-size: .9375rem; }
.cover-why { font-size: .8125rem; color: var(--hold); }
.cover-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cover-history summary { cursor: pointer; font-weight: 600; }
.cover-past { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: .875rem; }
.shift-block .sb-cover { justify-self: start; font-size: .6875rem; font-weight: 600; color: var(--hold); background: var(--hold-tint); border-radius: 999px; padding: 0 6px; }
@media (max-width: 640px) {
  .cover-item { grid-template-columns: 48px 1fr; padding: 10px; }
  .cover-leaf { width: 48px; height: 54px; }
  .cover-actions { grid-column: 1 / -1; justify-content: stretch; }
  .cover-actions .btn { flex: 1; }
}

/* ---------------------------------------------------------------- Patrol operations (2026.10.11) */
.duty-me { border-left: 4px solid var(--line-strong); }
.duty-me.is-on { border-left-color: var(--open); }
.duty-me .row { margin-top: 10px; flex-wrap: wrap; }
.duty-me input, .duty-me select { max-width: 200px; }
.duty-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.duty-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.duty-list li:last-child { border-bottom: 0; }
.meter-bar { height: 10px; border-radius: 999px; background: var(--snowpack); overflow: hidden; margin: 8px 0; }
.meter-bar span { display: block; height: 100%; background: var(--open); }

.room { padding: 16px; }
.room-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 16px 16px 0; }
.room-head h1 { margin: 0; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.room-tile { display: grid; gap: 4px; min-height: 96px; padding: 14px; text-align: left; font: inherit; border-radius: 10px; border: 2px solid var(--line-strong); background: var(--powder); color: var(--spruce); cursor: pointer; }
.room-tile b { font-size: 1.125rem; }
.room-tile span { color: var(--quiet); font-size: .875rem; }
.room-tile.is-on { border-color: var(--open); background: var(--open-tint); }
.room-tile.is-on span { color: var(--open); font-weight: 700; }

.sweep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sweep-card { display: grid; gap: 8px; align-content: start; border-top: 4px solid var(--line-strong); }
.sweep-card.is-mine { border-top-color: var(--trail-blue); }
.sweep-card.is-clear { border-top-color: var(--open); }
.sweep-stops { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.sweep-stops li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.sweep-stops li.is-swept .stop-name { color: var(--open); }
.sweep-stops li.is-flag { background: var(--hold-tint); border-radius: 6px; padding: 4px 6px; }
.stop-mark { font-size: .875rem; color: var(--quiet); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.open-list { display: grid; gap: 8px; }
.open-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.open-row p { margin: 2px 0 0; }

.flag-list { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 6px; border: 1px solid #e3c27a; background: var(--hold-tint); border-radius: var(--radius); }
.lift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pre { white-space: pre-wrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.log-sec h3 { font-size: 1rem; margin: 0; }

.allergy-box { border: 2px solid var(--closed); background: var(--closed-tint); border-radius: 8px; padding: 10px 12px; }
.allergy-box h4 { color: var(--closed); margin: 0 0 6px; }
.allergy-box[data-hit='yes'] { box-shadow: 0 0 0 3px var(--closed); }
.allergy-box input[type='text'], .allergy-box input:not([type]) { margin-top: 6px; width: 100%; }
.tq-banner { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--closed); color: #fff; }
.hs-critical { border: 2px solid var(--closed); background: var(--closed-tint); border-radius: 8px; padding: 10px 14px; display: grid; gap: 4px; }
.hs-critical p { margin: 0; }
.hs-allergy { margin: 8px 0; font-size: 1.05rem; }
.my-call { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--powder); margin-bottom: 8px; }
.my-call.is-new { border: 2px solid var(--closed); background: var(--closed-tint); }
.search-who p { margin: 2px 0; }
.release-pack .kv th { text-align: left; padding: 4px 12px 4px 0; vertical-align: top; color: var(--quiet); font-weight: 600; }
.release-pack .kv td { padding: 4px 0; }
@media print {
  .no-print { display: none !important; }
  .page-break { break-after: page; }
}
@media (max-width: 640px) {
  .sweep-grid, .lift-grid, .log-grid { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Billing: the mountain's DAY/OS subscription ---------- */
.billing-standing.is-grace { border-left: 5px solid #f2b33d; }
.billing-standing.is-read_only { border-left: 5px solid var(--closed); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan-card { display: grid; gap: 6px; align-content: start; text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; min-height: 132px; }
.plan-card:hover:not(:disabled) { border-color: var(--spruce); }
.plan-card.on { border: 2px solid var(--open); padding: 13px 15px; background: var(--open-tint); }
.plan-card:disabled { cursor: default; }
.plan-card:disabled:not(.on) { opacity: 0.7; }
.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.plan-price small { font-size: 0.875rem; font-weight: 400; color: var(--quiet); }
.plan-blurb { font-size: 0.9rem; }
.plan-apps { font-size: 0.8rem; color: var(--quiet); }
.plan-current { justify-self: start; font-size: 0.8rem; font-weight: 700; color: var(--open); }
.addon-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 14px; margin: 0; display: grid; gap: 2px; }
.addon-list legend { font-weight: 700; padding: 0 6px; }
.addon { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.addon input { width: 20px; height: 20px; }
.addon-price { white-space: nowrap; font-weight: 700; }
.plan-total { font-size: 1.1rem; margin: 0; }
.pay-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.pay-way { display: grid; gap: 4px; align-content: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.pay-way p { margin: 0 0 8px; }
.pay-way .btn { justify-self: start; }
.billing-banner { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 10px 20px; font-size: 0.925rem; background: var(--hold-tint); color: #4a2d00; border-bottom: 1px solid #e9c98a; }
.billing-banner.is-read_only { background: var(--closed-tint); color: #6b130c; border-bottom-color: #efb3ab; }
.billing-banner.is-trial { background: #e8f0fb; color: var(--trail-blue-dark); border-bottom-color: #bcd0ee; }
.billing-banner a { font-weight: 700; color: inherit; text-underline-offset: 3px; }
@media print { .billing-banner { display: none; } }
/* Console badges (mountain status, billing) */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; background: var(--snowpack); color: var(--quiet); border: 1px solid var(--line); }
.badge.ok { background: var(--open-tint); color: var(--open); border-color: #b9dfc8; }
.badge.warn { background: var(--hold-tint); color: var(--hold); border-color: #e9c98a; }
.badge.bad { background: var(--closed-tint); color: var(--closed); border-color: #efb3ab; }

/* ---------- Today: the morning board (the same card the website shows) ---------- */
.bd-tile.bd-morning { grid-column: 1 / -1; padding: 0; overflow: hidden; border: 0; background: transparent; box-shadow: none; }
.bd-tile.bd-morning > header { display: none; }
.root-edit .bd-tile.bd-morning > header, .board-edit:not([hidden]) ~ .board-host .bd-morning > header { display: flex; }
.mboard { background: #12303a; color: #eaf3f7; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 rgba(18, 48, 58, 0.25), 0 18px 40px -24px rgba(18, 48, 58, 0.5); }
.mb-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.mb-h b { font-size: 1.35rem; font-weight: 700; }
.mb-h span { font-size: 0.875rem; color: #a9c2cd; }
.mb-s { padding: 4px 20px 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); column-gap: 40px; align-items: start; }
.mb-t { font-size: 0.875rem; color: #a9c2cd; padding: 14px 0 4px; }
.mb-t a { color: #a9c2cd; text-decoration: none; }
.mb-t a:hover { color: #fff; text-decoration: underline; }
.mb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.mb-n { font-weight: 700; }
.mb-d { font-size: 0.875rem; color: #a9c2cd; line-height: 1.4; }
.mb-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 99px; font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.mb-chip.good { background: #ddf1e6; color: #17543a; }
.mb-chip.warn { background: #fbebcf; color: #6b4200; }
.mb-chip.bad { background: #fbdedb; color: #8a1f17; }
.mb-chip.neutral { background: #dce9f0; color: #12303a; }
.mb-foot { display: grid; border-top: 1px solid rgba(255, 255, 255, 0.14); margin-top: 6px; }
.mb-foot a { padding: 14px 20px; border-left: 1px solid rgba(255, 255, 255, 0.14); color: #eaf3f7; text-decoration: none; }
.mb-foot a:first-child { border-left: 0; }
.mb-foot a:hover { background: rgba(255, 255, 255, 0.06); }
.mb-foot b { display: block; font-size: 2rem; line-height: 1; font-weight: 700; }
.mb-foot span { display: block; font-size: 0.8125rem; color: #a9c2cd; margin-top: 4px; }
@media (max-width: 640px) { .mb-row { grid-template-columns: minmax(0, 1fr); } .mb-chip { justify-self: start; } .mb-foot a { padding: 12px 12px; } .mb-foot b { font-size: 1.6rem; } .mb-s { grid-template-columns: minmax(0, 1fr); } }
.wall .mboard { font-size: 1.15rem; }

/* ---- sign-in tiers (2026.10.17): passkey sign-in, shared terminals, the patrol two-step notice, console access */
.signin-passkey { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.signin-passkey .btn { width: 100%; justify-content: center; }
.signin.terminal .signin-form h2 { font-size: 1.5rem; }
.signin.terminal input[name="pin"] { font-size: 1.4rem; letter-spacing: .3em; }
.banner.warn { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line-strong); border-left: 6px solid #d98a00; border-radius: var(--radius); background: #fff6df; }
.callout.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
[data-step-up] .row .btn.primary { min-width: 12rem; }
