/* Desktop screens (dispatch): dense, mouse and keyboard, a large screen. Builds on the tablet's colours (tablet.css). */
.desk {
    --lvl-red: #c8102e;
    --lvl-yellow: #e0a100;
    --lvl-green: #1f8a4c;
    --lvl-non_injury: #5b6b80;
    /* D296: refused care: never assessed, so none of the three colours. */
    --lvl-refused: #8a8f98;
    --lvl-unknown: #b8c2cf;
    --st-available: #1f8a4c;
    --st-responding: #e0a100;
    --st-onscene: #c8102e;
    --st-firstaid: #7c3aed;
    --st-unavailable: #9aa5b4;
    --st-returning: #b7791f;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.35;
}

.desk-top {
    display: flex; align-items: center; gap: 14px;
    height: 52px; padding: 0 20px;
    background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--rule);
}
.desk-top .wordmark { font-size: 1.1rem; }
.desk-top .module { padding-left: 14px; }
.desk-resort { color: var(--muted); }
.desk-top .spacer { flex: 1; }
.desk-link { color: var(--muted); }
.desk-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px;
    margin: 0; padding: 6px 20px; background: var(--warn-bg); color: var(--warn-ink); font-size: 0.85rem;
}
.desk-main { max-width: none; padding: 14px 20px 32px; }
/* D426: on a phone (staff off the desk see their own cards there) the bar wraps, the resort name goes, and a wide table
   scrolls inside its own box instead of the whole page. */
@media (max-width: 700px) {
    .desk-top { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; row-gap: 6px; }
    .desk-resort, .desk-top .spacer { display: none; }
    .desk-main { padding: 12px 12px 32px; }
    .desk-main table { display: block; max-width: 100%; overflow-x: auto; }
    .desk-main .gear { white-space: normal; }
}

.desk h2 { font-size: 1rem; margin: 0 0 10px; }
.desk .muted { color: var(--muted); }

/* ---------- Today strip (R45) ---------- */

.desk-summary {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 28px;
    padding: 10px 16px; margin-bottom: 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.sum-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.sum-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sum b { font-size: 1.15rem; margin-right: 3px; }
.sum[class*="lvl-"]::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--lvl); }
.sum-clock { margin-left: auto; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.lvl-red { --lvl: var(--lvl-red); }
.lvl-yellow { --lvl: var(--lvl-yellow); }
.lvl-green { --lvl: var(--lvl-green); }
.lvl-non_injury { --lvl: var(--lvl-non_injury); }
.lvl-refused { --lvl: var(--lvl-refused); }
.lvl-unknown { --lvl: var(--lvl-unknown); }

/* ---------- Three columns ---------- */

/* D168: the new call is wider on a wide screen, so its answers sit on fewer rows and a call fits without scrolling. */
.desk-grid { --intake-width: clamp(340px, 24vw, 460px); display: grid; grid-template-columns: var(--intake-width) minmax(0, 1fr) var(--side-width); gap: 14px; align-items: start; }
.side-cols { display: grid; grid-template-columns: 250px 270px; gap: 14px; align-items: start; }
.desk-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
/* D85: two columns beside the board, the patrollers and the gear; below 1800 px the gear goes under the patrollers. */
.desk-main { --side-width: 534px; }
@media (max-width: 1799px) {
    .desk-main { --side-width: 260px; }
    .side-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
    .desk-grid { grid-template-columns: 1fr; }
}
/* D152: the board fits the window like a console: the page never scrolls, each column scrolls on its own, and Take call
   stays in view below the questions. A narrow window keeps one column and the page scrolls. */
@media screen and (min-width: 1101px) {
    .desk:has(.desk-grid) { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }
    .desk:has(.desk-grid) .desk-main { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; padding-bottom: 14px; }
    .desk-grid { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
    .desk-grid > .desk-panel, .side-cols { max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
    .desk-grid > .intake { display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden; }
    .intake form { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
    .intake-body { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
    .intake-actions { flex: none; margin: 0 -14px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
    .intake-actions .d-hint { margin-bottom: 0; }
    /* D157: the days and filters stay at the top of the calls as they scroll. */
    .desk-grid > .board .board-top { position: sticky; top: -14px; z-index: 3; margin: -14px -14px 10px; padding: 14px 14px 2px; background: var(--surface); border-bottom: 1px solid var(--line); }
}
@media screen and (min-width: 1800px) {
    .side-cols { height: 100%; grid-template-rows: minmax(0, 1fr); overflow: visible; }
    .side-cols > .desk-panel { max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
}
/* D176: on a tall screen the new call is a narrow column the whole height, beside the day's counts too, and the calls get
   the width. Its answers take more rows, which a tall screen has room for: a call of one person fits without scrolling. */
@media screen and (min-width: 1101px) and (min-height: 1150px) {
    .desk:has(.desk-grid) .desk-main {
        display: grid; grid-template-columns: 320px minmax(0, 1fr) var(--side-width);
        grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "intake summary summary" "intake board side";
        gap: 14px; align-items: start;
    }
    .desk-main > .desk-grid { display: contents; }
    .desk-main > .desk-summary { grid-area: summary; margin: 0; }
    .desk-grid > .intake { grid-area: intake; }
    .desk-grid > .board { grid-area: board; }
    .desk-grid > .side-cols { grid-area: side; }
}

/* ---------- Intake ---------- */

.d-field { display: block; margin-bottom: 12px; }
.d-label, .gps-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.d-chips .d-label { margin: 0 4px 0 0; }
.d-chips.where-detail { margin-top: 6px; padding: 6px 0 2px 10px; border-left: 3px solid var(--line); }
.d-chip {
    padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: var(--ink); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.d-chip:hover { border-color: var(--navy); }
.d-chip.on { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }
.d-chip[class*="lvl-"] { border-left: 6px solid var(--lvl); }
.d-chip[class*="lvl-"].on { background: var(--lvl); border-color: var(--lvl); color: #fff; }
.d-input {
    width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.d-input:focus { outline: 2px solid var(--focus); border-color: transparent; }
.d-button {
    padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.d-button:hover:not(:disabled) { border-color: var(--navy); }
.d-button:disabled { opacity: 0.5; cursor: not-allowed; }
.d-button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.d-button.primary:hover:not(:disabled) { background: var(--brand-dark); }
.d-button.small { padding: 4px 8px; font-size: 0.8rem; font-weight: 500; }
.d-button.ghost { background: transparent; }
.intake .d-button.primary { width: 100%; padding: 10px; font-size: 1rem; }
.d-hint, .gps-hint { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }

/* D151: the start questions at the desk, the tablet's own, sized for the panel; nothing is marked missing at a call. */
.call-steps { display: grid; gap: 0; margin-bottom: 12px; }
.call-steps .step { padding: 10px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.call-steps .step:last-child { border-bottom: 1px solid var(--line); }
.call-steps .step h2 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.call-steps .num { width: 18px; height: 18px; font-size: 0.7rem; }
.call-steps .group, .call-steps .group.pad { padding: 0; background: none; overflow: visible; border-radius: 0; }
.call-steps .group > * + *::before { content: none; }
.call-steps .chips { gap: 6px; margin-top: 6px; }
.call-steps .chips:first-child { margin-top: 0; }
.call-steps .chip {
    min-height: 0; min-width: 0; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 0.85rem; font-weight: 400;
}
.call-steps .chip.yn { min-width: 42px; padding: 3px 8px; }
.call-steps .chip-hint { font-size: 0.7rem; }
.call-steps .yes-nos { gap: 2px; margin-top: 8px; }
.call-steps .yes-nos.incident { grid-template-columns: minmax(0, 1fr); }
.call-steps .yes-no { gap: 6px; padding: 2px 0; border-left: 0; }
.call-steps .yn-label { font-size: 0.85rem; font-weight: 500; }
.call-steps .yn-buttons { gap: 4px; }
.call-steps .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.call-steps .card { padding: 8px 10px; border-width: 1px; border-radius: 8px; }
.call-steps .card h3 { margin: 0 0 6px; font-size: 0.85rem; }
.call-steps .cards + .together { margin-top: 6px; }
.call-steps .step-detail { margin-top: 6px; padding: 4px 0 2px 10px; background: none; border-radius: 0; }
.call-steps .detail-label, .call-steps .quick-label { margin: 0 0 4px; font-size: 0.8rem; color: var(--muted); }
.call-steps .quick-row { padding: 6px 0 2px; }
.call-steps .group-foot { margin: 0; font-size: 0.8rem; }
.call-steps .stepper { gap: 6px; margin-top: 6px; }
.call-steps .stepper output { min-width: 70px; }
.call-steps .where-more { margin-top: 10px; }
.call-steps .where-more .d-field:last-child { margin-bottom: 0; }
.call-steps .caller-says { display: grid; gap: 4px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.call-steps .caller-says .d-label { margin: 4px 0 0; }
.intake .cancel-change { width: 100%; margin-top: 6px; }

/* D168: a call fits one screen: each label on its answers' row, and chips sized for a mouse, not a finger. */
.intake-body .d-field { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 4px; margin-bottom: 6px; }
.intake-body .d-field > .d-label { margin: 0; }
.intake-body .d-field > :not(.d-label) { grid-column: 2; }
.intake-body .d-chips { gap: 4px; }
.intake-body .d-chip { padding: 2px 7px; font-size: 0.8rem; }
.intake-body .d-input { padding: 4px 8px; font-size: 0.85rem; }
.call-steps { margin-bottom: 8px; }
.call-steps .step { padding: 6px 0; }
.call-steps .step h2 { margin-bottom: 3px; }
.call-steps .chips { gap: 4px; margin-top: 4px; }
.call-steps .chip { padding: 2px 7px; font-size: 0.8rem; }
.call-steps .chip.yn { min-width: 36px; padding: 1px 8px; }
.call-steps .yes-nos { margin-top: 4px; }
.call-steps .yes-no { padding: 1px 0; }
.call-steps .card { padding: 6px 8px; }
.call-steps .card h3 { margin-bottom: 4px; }
/* D196: the place's own questions (on snow: where on snow, the run, the exact location; a lift and where on it) in one box
   under the places, as each person's card is under Who, every label in the panel's label column. */
.call-steps .step-detail, .call-steps .where-more { margin-top: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.call-steps .step-detail:has(+ .where-more) { border-bottom: 0; border-radius: 8px 8px 0 0; }
.call-steps .step-detail + .where-more { margin-top: 0; padding-top: 0; border-top: 0; border-radius: 0 0 8px 8px; }
.call-steps .step-detail { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: start; column-gap: 8px; }
.call-steps .step-detail .detail-label { margin: 3px 0 0; font-weight: 600; }
.call-steps .step-detail .chips { margin-top: 0; }
.call-steps .caller-says { gap: 3px; margin-top: 6px; padding-top: 4px; }
.call-steps .caller-says .d-label { margin: 0; }
.call-steps .caller-says .d-chips .d-label { margin-right: 2px; }
/* The people count beside its question, and no Person A title for one person. D175: who on its row, under 18 on the next,
   its Yes and No beside it like the panel's other answers. */
.call-steps .step:first-child { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.call-steps .step:first-child h2 { margin: 0; }
.call-steps .cards > .card:only-child h3 { display: none; }
.call-steps .card > .group { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; }
.call-steps .card > .group > .yes-nos { margin-top: 0; }
.call-steps .card > .group > :not(.chips) { flex-basis: 100%; }
.call-steps .card > .group > .yes-nos .yes-no { justify-content: flex-start; column-gap: 10px; }
.intake .intake-actions .d-button.primary { padding: 7px; }
/* D153: the patrollers already on the call, one click to put one with this person. */
.move-here { gap: 4px; }
.d-link { font-weight: 600; color: var(--focus); }

/* ---------- Live calls (R38) ---------- */

.board-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
/* D172: once the board has room for two, the cards sit side by side, as many columns as fit (four on an ultrawide
   screen), in the list's order row by row. A narrow card puts the step under the number and the patrollers beside it;
   the open card spans two columns and keeps the wide layout for its steps, people and treatment. */
.call-list { container: calls / inline-size; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 8px 10px; align-items: start; }
.call {
    display: grid;
    grid-template-columns: 90px minmax(0, 1.3fr) minmax(0, 1fr) 100px minmax(210px, 1.2fr);
    grid-template-areas: "name name name name name" "id what where stage pats" "acts acts acts acts acts";
    gap: 6px 12px; align-items: start;
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--line); border-left: 8px solid var(--lvl); border-radius: 8px;
    background: var(--surface); cursor: pointer;
}
@container calls (min-width: 1130px) {
    .call:not(.selected) {
        grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "name name name" "id what where" "stage pats pats" "acts acts acts";
    }
    .call.selected { grid-column: span 2; }
}
/* D393: a calls column too narrow for the wide card (a tablet, a small laptop): the same stacked card, open or not. */
@container calls (max-width: 700px) {
    .call {
        grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "name name name" "id what where" "stage pats pats" "acts acts acts";
    }
}
.call:hover { border-color: var(--navy); border-left-color: var(--lvl); }
.call.selected { box-shadow: 0 0 0 2px var(--focus); }
/* D131: the call's name as patrol says it on the radio. */
.call-name { grid-area: name; font-weight: 700; font-size: 1.02rem; }
/* D142: the call sign first, as said on the radio, then the person's name, lighter; D213: a call sign that is the first
   name is shown once, bold in the name. */
.roster-sign { margin-right: 6px; font-weight: 700; color: var(--ink); }
.roster-sign + .roster-full, .roster-full.with-sign { font-weight: 400; color: var(--muted); }
.roster-full > .roster-sign { margin-right: 0; }
.roster-find { margin: 6px 0 2px; }
.shift-sign { margin-left: 6px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.call-id { grid-area: id; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.call-what { grid-area: what; display: flex; flex-direction: column; }
.call-kind { font-weight: 600; }
.call-note { color: var(--muted); }
.call-reported { font-size: 0.85rem; font-weight: 600; }
.call-heard { font-size: 0.85rem; }
.d-chip.small { padding: 3px 8px; font-size: 0.8rem; }
.call.lvl-unknown { border-left-style: dashed; }
.call-where { grid-area: where; display: flex; flex-direction: column; gap: 2px; }
.run-name { display: inline-flex; align-items: center; gap: 8px; }
.run-input { position: relative; display: block; }
.run-input .run-grade { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.call-stage { grid-area: stage; display: flex; flex-direction: column; gap: 2px; }
.stage-pill { align-self: start; padding: 2px 8px; border-radius: 999px; background: #ececec; font-weight: 600; font-size: 0.85rem; }
.stage-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.call.overdue .stage-pill { background: var(--warn-bg); color: var(--warn-ink); }
.call.overdue .stage-time { color: var(--warn-ink); font-weight: 700; }
.call.overdue .stage-time::after { content: " over limit"; font-weight: 500; }
.call-pats { grid-area: pats; display: flex; flex-wrap: wrap; gap: 4px; }
.pat { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px 1px 8px; border-radius: 999px; background: #ececec; font-size: 0.85rem; white-space: nowrap; }
.pat-x { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--muted); padding: 0 4px; }
.call-pats { flex-direction: column; align-items: flex-start; }
.pat { gap: 6px; max-width: 100%; flex-wrap: wrap; }
.pat.arrived { background: var(--ok-bg); color: var(--ok-ink); }
.pat.responding { background: var(--warn-bg); color: var(--warn-ink); }
.pat-time { font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.pat-arrive { border: 1px solid currentColor; border-radius: 999px; background: var(--surface); color: inherit; font: inherit; font-size: 0.75rem; padding: 0 6px; cursor: pointer; }
/* D223: the × that takes a piece of gear off a call. */
.gear-off { padding: 0 3px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.gear-off:hover { color: var(--ink); }
.tag-1035 { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 0.75rem; font-weight: 700; }
/* D174: a menu that opens under its button and floats over the board (the browser's popover: a click elsewhere or Escape
   closes it); above the button when there is no room below. Without anchor positioning it opens in the middle. */
.pop-menu { flex-direction: column; min-width: 12rem; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.pop-menu:popover-open { display: flex; }
.pop-menu button { padding: 7px 12px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.pop-menu button:hover, .pop-menu button:focus-visible { background: #f0f0f0; outline: none; }
/* D180: what patrol asked for, short until sent or met; Ask for opens patrollers by number, the gear, EMS, its own words. */
.call-needs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.need { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; }
.need.open { background: var(--warn-bg); border-color: var(--lvl-yellow); color: var(--warn-ink); font-weight: 600; }
.need.met { color: var(--muted); }
.need.met > span:first-child::before { content: "\2713  "; color: var(--st-available); }
.need .undo { padding: 0 4px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.need-menu { min-width: 16rem; max-width: 22rem; }
.need-menu .d-label { padding: 6px 12px 0; }
.need-group { display: flex; flex-wrap: wrap; gap: 0 2px; padding-bottom: 2px; }
.pop-menu .need-group button { padding: 5px 10px; }
/* D195: what is asked and still short, checked as on the call; the menu stays open until Done. */
.pop-menu.need-menu button.on { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.pop-menu.need-menu button.on::before { content: "\2713  "; }
.pop-menu .need-group .need-done { margin-left: auto; background: var(--navy); color: var(--navy-ink); font-weight: 600; }
.pop-menu .need-group .need-done:hover, .pop-menu .need-group .need-done:focus-visible { background: var(--navy); opacity: 0.9; }
.need-other { display: flex; gap: 6px; padding: 6px 8px 4px; }
.need-other .d-input { flex: 1; min-width: 0; }
/* D182, D183: a note from the radio under the steps; the EMS steps under the way to the base. */
.call-note-add { display: flex; gap: 6px; margin-top: 8px; }
.call-note-add .d-input { flex: 1; min-width: 0; }
.ems-steps { margin-top: 8px; }
/* D184: a search's zones, each one's 10-4 to the description. */
.zone-acks { margin-top: 8px; }
/* D188: all stations called for a call nobody was sent to; cover asked for a hut or a zone; a zone with nobody free. */
.all-stations, .cover-ask, .cover-asked { margin-left: 6px; }
.all-stations.muted, .cover-asked { font-size: 0.8rem; }
.zone-count.none-free, .zone-count.none-free b { color: var(--warn-ink); font-weight: 700; }
/* D180: the strip over the calls: what is short now, the most serious first, each for how long. */
/* D191: at the bottom of the new call, what is still going on with nobody covering it: how long, and a reminder when due. */
.watching { flex: none; margin: 0 -14px; padding: 8px 14px 12px; border-top: 1px solid var(--line); }
.watching .d-label { margin-bottom: 2px; }
.watching ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; max-height: 12rem; overflow-y: auto; scrollbar-width: thin; }
.watching li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.85rem; }
.watch-time { min-width: 3.6rem; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.watch-what { padding: 0; font-weight: 600; }
.watch-reminded { color: var(--muted); }
.watching li.due { padding: 2px 6px; margin: 0 -6px; border-radius: 6px; background: var(--warn-bg); }
.watching li.due .watch-reminded { color: var(--warn-ink); font-weight: 600; }
@media screen and (min-width: 1101px) {
    /* The new call reaches the bottom of the window, so what is going on sits at the bottom left. */
    .desk-grid > .intake:has(.watching) { align-self: stretch; }
    .intake .watching { margin-top: auto; }
}

/* D190: a scenario replay's bar under the top bar: its clock and controls, the words said last, what the board refused. */
.replay-bar { padding: 6px 16px 8px; border-bottom: 1px solid var(--line); background: var(--warn-bg); }
.replay-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.replay-clock { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.replay-controls .spacer { flex: 1; }
.replay-said { margin: 4px 0 0; font-size: 0.9rem; }
.replay-at { font-weight: 700; font-variant-numeric: tabular-nums; }
.replay-refused { margin-top: 4px; font-size: 0.85rem; color: var(--warn-ink); }
.replay-refused ul { margin: 2px 0 0; padding-left: 18px; }

/* D180, D186: what is short now and what is still open share one warning panel. */
.short-now, .still-open { border: 1px solid var(--lvl-yellow); border-radius: 8px; background: var(--warn-bg); }
.short-now { margin-top: 8px; padding: 6px 10px; }
.short-now h3 { margin: 0 0 2px; color: var(--warn-ink); }
.short-now ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; max-height: 9.5rem; overflow-y: auto; }
.short-now li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.85rem; }
.short-now .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl, var(--lvl-yellow)); flex: none; }
.short-now .short-what { padding: 0; font-weight: 600; }
.short-now .d-button { padding: 1px 8px; font-size: 0.75rem; }
.short-since { margin-left: auto; font-weight: 700; color: var(--warn-ink); white-space: nowrap; }
@supports (anchor-name: --menu) {
    .pop-menu { inset: auto; margin: 4px 0; position-area: bottom span-right; position-try-fallbacks: flip-block; }
}
.pat-x:hover { color: var(--alert); }
.call-acts { grid-area: acts; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* D171: the level patrol radios in once on scene, beside the next step; a row per person when there are several.
   D172: at the end of the row, or under the buttons on a card too narrow for both. */
.call-level { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: auto; }
.call-level .d-chips { align-items: center; justify-content: flex-end; gap: 4px; }
/* D124: each person of a call with several: their level's colour, what they have, their own patrollers. */
.pat-person { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.pat-person + .pat-person { margin-top: 4px; }
.person-tag {
    padding: 1px 8px; border: 2px solid var(--lvl, var(--line)); border-radius: 6px; background: var(--lvl, var(--surface));
    color: #fff; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.person-tag.lvl-unknown { background: var(--surface); border-style: dashed; color: var(--ink); }
.person-tag.on { outline: 2px solid var(--focus); outline-offset: 1px; }
.person-tag.all { background: #ececec; border-color: #ececec; color: var(--ink); font-weight: 600; cursor: default; }
.person-what { font-size: 0.8rem; color: var(--muted); }
/* D126: a person's own case on the board, under the call's number. */
.call-id .case-tag { align-self: flex-start; margin: 2px 0; cursor: default; }

.call-detail {
    grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
    padding-top: 8px; border-top: 1px dashed var(--line); cursor: default;
}
.detail-cols { flex-basis: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.detail-cols section { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-cols section + section { border-left: 1px solid var(--line); padding-left: 16px; }
.detail-cols h3 { margin: 0; }
.detail-cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* D125: with several people, each is their own case under the call: level, patrollers, treatment, EMS details. */
.person-case { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px 12px; border-left: 4px solid var(--lvl, var(--line)); border-top: 1px dashed var(--line); }
.person-case.lvl-unknown { border-left-style: dashed; }
.case-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.detail-cols .d-hint { margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.timeline b { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
    .detail-cols { grid-template-columns: 1fr; }
    .detail-cols section + section { border-left: 0; padding-left: 0; }
}
/* D205: the open card's last row: the incident form on the left, Flag for management review in the corner. */
.call-foot { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.call-rare { margin-left: auto; }
.people-count { display: inline-flex; align-items: center; gap: 6px; }
/* D208, D231: a reckless skier's name and pass as patrol reads them, and whether the file has them already. */
.on-file { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.on-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.on-file-row .d-input { width: 12em; }
.on-file-found { padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink, #7a4a00); }
/* D208: the file of who was warned for a closed area. */
.violation-counts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0; padding: 0; list-style: none; font-size: 0.9rem; }
.violation-find { max-width: 320px; margin: 4px 0 10px; }
.violation-table td { vertical-align: top; }
.seen-tag { margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink, #7a4a00); white-space: nowrap; }
.people-count b { min-width: 1ch; text-align: center; font-variant-numeric: tabular-nums; }

/* EMS details (R38): what dispatch tells the ambulance, per person, with the sets of vitals taken. */
.ems { flex-basis: 100%; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.ems .d-field { margin: 0; }
.ems-person { display: flex; flex-direction: column; gap: 8px; }
.ems-person + .ems-person { padding-top: 10px; border-top: 1px dashed var(--line); }
.ems-person h4 { margin: 0; font-size: 0.95rem; }
.ems-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; }
.ems-row .d-chips { margin-top: 2px; }
.ems-age { display: flex; flex-direction: column; }
.ems-age .d-input { width: 5.5em; }
/* D197: the weight in the tablet's units box, sized like the panel's other answers; nature of injury beside its cause. */
.ems-weight .measure { gap: 4px; }
.ems-weight .measure .input { width: 5em; min-height: 0; padding: 7px 10px; border-width: 1px; border-radius: 8px; }
.ems-weight .measure .unit { display: none; }
.ems-weight .measure .chip { min-width: 0; min-height: 0; padding: 3px 8px; font-size: 0.8rem; }
.ems-nature .d-field:first-child { flex: 2 1 18em; }
.ems-nature .d-field:last-child { flex: 1 1 12em; }
.ems-nature .d-input { width: 100%; }
.ems-pickup .d-chips { align-items: center; }
.ems-pickup .d-input.small { width: 8.5em; }
/* D161: how the person reached the base, and how they leave it when EMS is called. */
.to-base { margin-top: 8px; align-items: center; gap: 4px; }
.ems-leaves .d-field .d-input, .ems-heli .d-field .d-input { min-width: 14em; }
.vitals { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; }
.vitals-row { display: grid; grid-template-columns: 6.5rem repeat(5, minmax(3rem, 4.5rem)) repeat(2, minmax(4.5rem, 1fr)) 3.5rem; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.vitals-row.head { color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.vitals-row.new .d-input { width: 100%; min-width: 0; padding: 3px 6px; }
.ems-say { padding: 8px 10px; border-radius: 6px; background: #f2f2f2; }
.ems-say p { margin: 2px 0 0; }

.undo { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 1rem; line-height: 1; padding: 0 2px; }
.undo:hover { color: var(--alert); }
/* D154: every step of the call from the start, Now on the steps to come; a time moves a minute at a time, always in order. */
.step-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.step-row { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 28px; }
.step-time { font-variant-numeric: tabular-nums; }
.step-row.open .step-name { color: var(--muted); }
.step-tools { display: inline-flex; align-items: center; gap: 4px; }
/* More specific than .d-chip.small, which comes later. */
.step-tools .d-chip.small, .step-row .d-chip.step-now { min-width: 30px; padding: 1px 8px; }
.step-row .d-chip.step-now { padding: 0 7px; font-size: 0.75rem; }
.step-tools .d-chip:disabled { opacity: 0.35; cursor: default; }
.step-note { font-size: 0.8rem; color: var(--muted); }
/* D156: a step asked of a call with no patroller on it. */
.no-patroller { margin: 6px 0 0; font-size: 0.8rem; }
.call-acts .no-patroller { flex-basis: 100%; margin: 0; }
/* D155: the level with the description, optional; one row per person when there are several. */
.call-level-pick .d-chips { align-items: center; gap: 4px; }
.call-level-pick .level-who { min-width: 5.5em; font-size: 0.85rem; }

/* ---------- Off the board ---------- */

.ended-head { margin-top: 18px; }
.ended { margin: 0; padding: 0; list-style: none; }
.ended li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.ended .dot, .roster .dot, .gear-column .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lvl, var(--st)); flex: none; }
.tag { padding: 1px 8px; border-radius: 999px; background: #ececec; font-size: 0.8rem; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Roster (R40) ---------- */

.zone { margin-top: 10px; padding: 6px 8px; border: 1px dashed transparent; border-radius: 8px; }
.zone.drop { border-color: var(--navy); background: #f2f2f2; }
.zone-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; margin: 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.zone-head > span:first-child { white-space: nowrap; }
/* D207: the zone name folds the zone; the arrow points down when open, right when folded. */
.zone-fold { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.zone-fold::before { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 1px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; }
.zone-fold[aria-expanded="false"]::before { margin-bottom: 0; transform: rotate(-45deg); }
.zone-fold:hover::before { border-color: var(--navy); }
.zone.folded .zone-head { border-bottom-color: transparent; padding-bottom: 0; }
.zone-count { font-size: 0.8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
/* D88: patrollers in a zone against what it needs today, the category of those not full-time, and the shift screen. */
.zone-need { margin-left: 6px; font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.zone-need.short { color: var(--warn-ink, #7a4a00); font-weight: 700; }
.roster-role { margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #ececec; font-size: 0.7rem; font-weight: 600; }
.roster-qual { margin-left: 6px; padding: 0 5px; border: 1px solid var(--st-firstaid); border-radius: 4px; color: var(--st-firstaid); font-size: 0.68rem; font-weight: 600; }
.roster-category { margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.7rem; font-weight: 500; color: var(--muted); }
.shift-zones .mgmt-card.short h2 .zone-need { color: var(--warn-ink, #7a4a00); font-weight: 700; }
.shift-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.shift-zones h2 { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 1rem; }
/* D122: the zones with who is in each, the staff not on the shift in a column per category, a name dragged or clicked
   and then its zone; each category has a colour, on its column and on its names in the zones. */
.shift-hint { margin: 4px 0 0; font-size: 0.9rem; }
.shift-hint .link { padding: 0 0 0 8px; }
.mgmt-grid.shift-zones { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: start; }
.shift-zone.target, .shift-pool.target { cursor: pointer; }
.shift-zone.target:hover, .shift-pool.target:hover, .shift-zone.drop, .shift-pool.drop { background: #f2f2f2; border-color: var(--navy); border-style: dashed; }
.shift-names { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; }
.shift-names li { display: block; padding: 0; cursor: grab; }
.shift-name {
    display: flex; align-items: baseline; justify-content: space-between; gap: 6px; width: 100%;
    padding: 3px 8px; border: 1px solid var(--line); border-left: 4px solid var(--cat); border-radius: 6px;
    background: var(--surface); color: var(--ink); font: inherit; font-size: 0.85rem; text-align: left; cursor: grab;
}
.shift-name:hover { border-color: var(--navy); border-left-color: var(--cat); }
.shift-name.held { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }
.shift-name.found { outline: 2px solid var(--focus); }
/* D426: in a narrow zone the status goes under the name instead of past the card. */
.shift-name { flex-wrap: wrap; }
.shift-status { margin-left: auto; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.shift-name.held .shift-status { color: inherit; }
.shift-put { margin-top: 8px; }
.shift-pool-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 0; }
.shift-pool-head h2 { margin: 0; }
.shift-pool-head .d-input { width: 240px; max-width: 100%; }
.shift-pool { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 16px; margin-top: 8px; padding: 8px; border: 1px dashed transparent; border-radius: 10px; }
.shift-pool > .shift-put { grid-column: 1 / -1; justify-self: start; margin: 0; }
.shift-col h3 { display: flex; align-items: center; margin: 0; font-size: 0.95rem; }
.shift-col h3 .muted { margin-left: 6px; font-weight: 500; font-size: 0.8rem; }
.shift-col .shift-names { flex-direction: row; flex-wrap: wrap; align-content: flex-start; max-height: 42vh; overflow-y: auto; }
.shift-col .shift-name { width: auto; }
/* D127: teams: a row to move one together, names grouped by team in the staff columns, a lead's role on their name. */
.shift-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.shift-teams .d-label { margin-right: 4px; }
.shift-team-drag[draggable="true"] { cursor: grab; }
.shift-team-drag .d-chip:disabled { opacity: 0.5; cursor: default; }
.shift-col-names { max-height: 42vh; overflow-y: auto; }
.shift-col .shift-col-names .shift-names { max-height: none; overflow: visible; }
.shift-team { margin: 8px 0 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.shift-role { margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #ececec; font-size: 0.7rem; font-weight: 600; color: var(--ink); }
.shift-name.held .shift-role { background: rgba(255, 255, 255, 0.2); color: inherit; }
.cat-swatch { width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; background: var(--cat); }
.cat-0 { --cat: #1c1c1c; }
.cat-1 { --cat: #2563eb; }
.cat-2 { --cat: #1f8a4c; }
.cat-3 { --cat: #9aa5b4; }
.zone-count b { color: var(--st-available); }
.zone-empty { margin: 6px 0 0; font-size: 0.8rem; }
.roster-list li[draggable="true"] { cursor: grab; }
.roster-list { margin: 4px 0 0; padding: 0; list-style: none; }
.roster-list li { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.roster-pick {
    flex: 1; display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; text-align: left;
    padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; color: inherit; cursor: pointer;
}
/* D216: a row pointed at lights up as a tile that can be dragged, with a grip at its right and a grab hand when there is
   nothing to click, so moving a patroller to another zone or a hut is as plain as it is possible. */
.roster-list li:hover > .roster-pick, .roster-list li:focus-within > .roster-pick { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 6%, var(--surface)); }
.roster-pick:disabled { cursor: default; }
.roster-list li[draggable="true"] > .roster-pick { padding-right: 22px; }
.roster-list li[draggable="true"] > .roster-pick:disabled { cursor: grab; }
.roster-list li[draggable="true"]::after { content: "⠿"; position: absolute; right: 7px; top: 50%; transform: translateY(-50%); font-size: 0.95rem; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity 0.1s; }
.roster-list li[draggable="true"]:hover::after { opacity: 0.8; }
/* While a name is dragged: every zone shows it takes a drop, the one under the mouse more, the dragged row is lifted and
   no card is in the way. */
.roster.dragging .zone:not(.join) { border-color: color-mix(in srgb, var(--navy) 45%, var(--surface)); }
.roster.dragging .roster-card { display: none; }
.roster-list li.lifted { opacity: 0.45; }
/* D218: the call card or the person's case a name is dragged over takes it. */
.call.drop, .person-case.drop { outline: 2px dashed var(--navy); outline-offset: 2px; }
.roster-name { font-weight: 600; }
.roster-status { grid-column: 2; font-size: 0.8rem; color: var(--muted); }
.st-available { --st: var(--st-available); }
.st-responding { --st: var(--st-responding); }
.st-onscene { --st: var(--st-onscene); }
.st-clinic { --st: var(--st-firstaid); }
.st-returning { --st: var(--st-returning); }
.st-unavailable { --st: var(--st-unavailable); }
.st-unavailable .roster-name { color: var(--muted); font-weight: 500; }
/* D215: pointing at a row (or focusing it) opens a card under the name: the rest about them (category, qualifications)
   and what to do with them, Not available with its reason, Available, To the hut, Out of the hut, Gear back (D123, D177,
   D185). It comes after a moment, so a mouse going down the list does not flash one per row, and nothing in the row
   moves or is covered. */
.roster-card { position: absolute; left: 24px; right: 0; top: 100%; z-index: 5; display: flex; flex-direction: column; gap: 5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14); font-size: 0.8rem; visibility: hidden; opacity: 0; transition: opacity 0.1s, visibility 0s 0.1s; }
.roster-list li:hover > .roster-card, .roster-list li:focus-within > .roster-card { visibility: visible; opacity: 1; transition-delay: 0.25s; }
/* D218: the card lies over the rows under it, so only its own lines take the mouse; a click beside them reaches the row
   below, and the card goes as the mouse leaves. */
.roster-card { pointer-events: none; }
.roster-card > * { pointer-events: auto; }
.card-about { color: var(--muted); }
/* The doings one under the other, Not available last at the bottom, its reasons under it. */
.card-acts { display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; }
.card-about + .card-acts { padding-top: 5px; border-top: 1px solid var(--line); }
.card-act { padding: 3px 6px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 0.8rem; color: var(--ink); text-align: left; cursor: pointer; }
.card-act:hover, .card-act[aria-expanded="true"] { background: #ececec; }
.card-why { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 6px; }
.card-why .link { padding: 0 4px; font-size: 0.8rem; }
/* D177, D178: a zone's hut first, with the patroller up there, who goes first; a hut with nobody free in it is flagged
   so dispatch sends someone up. */
.hut { margin-top: 6px; padding-top: 4px; border: 1px solid var(--line); border-left: 4px solid var(--st-available); border-radius: 8px; background: var(--surface); }
.hut:not(.ready) { border-left-color: var(--lvl-yellow); }
.hut.drop { border-color: var(--navy); border-style: dashed; background: #f2f2f2; }
.hut-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; padding: 0 8px; font-size: 0.78rem; font-weight: 600; }
.hut-state { font-weight: 500; color: var(--muted); }
.hut:not(.ready) .hut-state { color: var(--warn-ink); font-weight: 700; }
.hut .roster-list { margin: 0; }
/* D179: an empty hut: who came down, and one click to send cover up. */
.hut-cover { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 8px 8px; font-size: 0.8rem; }

/* ---------- Review queue (R19, R43, R44) ---------- */

.review-grid { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .review-grid { grid-template-columns: 1fr; } }
.review-list h2 { margin-top: 14px; }
/* D166: forms collected on their own and not attached yet, at the top of the review list. */
.loose-forms li, .map-change-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.loose-forms li > span:first-child { display: flex; flex-direction: column; }
.loose-actions { display: flex; align-items: center; gap: 8px; }
.review-list h2:first-child { margin-top: 0; }
.small { font-size: 0.8rem; }
.review-items, .map-change-list { margin: 0; padding: 0; list-style: none; }
.review-item {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-bottom: 6px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.review-item:hover { border-color: var(--navy); }
.review-item.on { box-shadow: 0 0 0 2px var(--focus); }
.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.review-head p { margin: 0; }
.review-detail h3 { font-size: 0.95rem; margin: 18px 0 6px; }
.status-pill { padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; background: #ececec; }
.status-pill.st-submitted { background: var(--warn-bg); color: var(--warn-ink); }
.status-pill.st-approved, .status-pill.st-closed { background: var(--ok-bg); color: var(--ok-ink); }
.status-pill.st-returned { background: #fde2e4; color: var(--alert-dark); }
.review-forms { margin: 0; padding: 0; list-style: none; }
.review-forms li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.review-forms li > span:first-child { flex: 1; }
.review-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.review-history { margin: 0; padding-left: 18px; font-size: 0.9rem; }

/* ---------- Management (R45) ---------- */

.mgmt-title { font-size: 1.3rem; margin-bottom: 4px; }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.mgmt-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
/* D167: the map's changes waiting for management. */
.map-waiting { margin: 10px 0 0; }
.map-changes h2 { margin: 16px 0 6px; font-size: 1rem; }
.map-change-list li.approved > span:first-child { color: var(--ok-ink); font-weight: 600; }
.map-change-list li.dismissed > span:first-child { color: var(--muted); text-decoration: line-through; }
/* D163: the calls of today, the last 7 days and the season, side by side. */
.mgmt-summary { margin-top: 14px; }
.mgmt-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mgmt-table th, .mgmt-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.mgmt-table th:first-child { text-align: left; font-weight: 500; }
.mgmt-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.mgmt-table tr.total td, .mgmt-table tr.total th { font-weight: 700; }
.mgmt-table .dot { display: inline-block; margin-right: 6px; }
/* D303: the calls as the patrol counts them: care given, no injury, nothing required, each with its parts under it. */
.mgmt-table tr.group th, .mgmt-table tr.group td { font-weight: 600; }
.mgmt-table tr.sub th { padding-left: 24px; }
.mgmt-card ul { margin: 0; padding: 0; list-style: none; }
.mgmt-card li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.mgmt-card li b { margin-left: auto; }
/* R40, D82: gear counted by kind; the resort's first kinds (toboggans, trauma packs, pain management, Vac Mats) above a line. */
.gear-lines { margin: 0 0 6px; padding: 0; list-style: none; }
.gear-line, .gear-caches li.gear-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 3px 0; }
.gear-column .cache { padding: 6px 0 4px; }
.gear-column .cache + .cache { border-top: 1px dashed var(--line); }
.gear-column .cache-name { display: block; margin-bottom: 4px; font-size: 0.85rem; font-weight: 600; }
/* D217, D220: the gear rows look and move like the patrollers' (the same list, tile, grip and lifted look): a dot for the
   state of a kind in its cache, full, short, more than usual (gear left there for now) or none, and the count at the
   right. While a piece is dragged every cache shows a dashed edge, the one under the mouse filled. */
.gear-column .cache-name { margin-bottom: 0; }
/* D221: the cache's head says when it was last confirmed as counted; amber after a day or never, with Confirm in view,
   otherwise Confirm shows when the cache is pointed at. */
.cache-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.cache-check { font-size: 0.75rem; color: var(--muted); }
.cache-check.stale { color: var(--warn-ink, #7a4a00); font-weight: 600; }
.d-button.cache-confirm { margin-left: auto; padding: 1px 7px; font-size: 0.72rem; opacity: 0; }
.cache:hover .cache-confirm, .cache:focus-within .cache-confirm, .cache-check.stale ~ .cache-confirm { opacity: 1; }
.gear-list { margin: 0; }
.gear-list li { padding: 1px 0; }
.gear-list .roster-pick { grid-template-columns: 10px 1fr auto; padding-top: 3px; padding-bottom: 3px; }
.gear-list li.full { --st: var(--st-available); }
.gear-list li.short { --st: var(--lvl-yellow); }
.gear-list li.extra { --st: var(--navy); }
.gear-list li.none { --st: var(--line); }
.gear-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.gear-list li.short .gear-n { color: var(--warn-ink, #7a4a00); }
.gear-list li.extra .gear-n { color: var(--navy); }
.gear-list li.none .roster-name, .gear-list li.none .gear-n { color: var(--muted); font-weight: 400; }
/* D226: what is out of the caches heads the column: a piece at a call (amber), left at the clinic, out somewhere (grey),
   with the tally under the head; the rows drag like the others but take no click. */
.gear-out li.at-call { --st: var(--st-responding); }
.gear-out li.left { --st: var(--st-firstaid); }
.gear-out li.somewhere { --st: var(--st-unavailable); }
.gear-pick.still { cursor: grab; }
.gear-tally { margin: 4px 0 0; font-size: 0.75rem; color: var(--muted); }
/* D227: the nearest runs to the caller's coordinates, under the GPS box, each with its distance. */
.gps-near { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: -2px 0 8px; }
.gps-near .d-chip b { margin-left: 4px; font-weight: 500; color: var(--muted); }
.gps-near .d-chip.on b { color: inherit; }
.gear-column.dragging .cache { outline: 1px dashed color-mix(in srgb, var(--navy) 45%, var(--surface)); outline-offset: 2px; border-radius: 6px; }
.gear-column.dragging .cache.drop { outline-color: var(--navy); background: #f2f2f2; }
/* D229: each zone's "somewhere else" shows while a piece is dragged; dropped there, a box names the place. */
.gear-column .cache.staging { display: none; margin-top: 6px; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 6px; }
.gear-column .cache.staging .cache-name { font-weight: 500; color: var(--muted); }
.gear-column.dragging .cache.staging { display: block; }
.gear-column .cache.staging.drop { border-color: var(--navy); background: #f2f2f2; }
.staging-name { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.staging-name .d-input { flex: 1; min-width: 0; }
.gear-line.extra .gear-count { color: var(--navy); }
.gear-acts { display: inline-flex; gap: 4px; justify-self: end; }
.gear-line.after-first { margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--line); }
.mgmt-grid.gear-caches { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.gear-line .gear-kind { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-line .gear-count { min-width: 3.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.gear-line.short .gear-count { color: var(--warn-ink, #7a4a00); }
.gear-line.empty .gear-kind, .gear-line.empty .gear-count { color: var(--muted); font-weight: 400; }
.d-button.step { min-width: 30px; padding-left: 0; padding-right: 0; }
.gear-add { display: flex; gap: 6px; margin-top: 8px; }
.gear-add .d-input { flex: 1; min-width: 0; }
.gear-away-list, .gear-math { margin: 12px 0 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.gear-loose { color: var(--warn-text, #7a4b00); }
.gear-math .d-hint { margin: 4px 0 0; }
.gear-away-list h2, .gear-math h2 { margin: 0 0 6px; font-size: 1rem; }
.gear-away-list ul, .gear-math ul { margin: 0; padding: 0; list-style: none; }
.gear-away-list li, .gear-math li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.gear-caches h2 { margin: 0 0 6px; font-size: 1rem; }
.mgmt-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lvl); }
.mgmt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.mgmt-zone { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.mgmt-zone .d-input { width: auto; max-width: 100%; }
.mgmt-calls { margin-top: 12px; }
.mgmt-calls .time { font-variant-numeric: tabular-nums; min-width: 3rem; }

/* R43, R44, R49: returning with questions, corrections and voiding. */
.status-pill.st-voided { background: #e6e6e6; color: #444; text-decoration: line-through; }
.review-box { margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.review-box h4 { margin: 0 0 4px; font-size: 0.95rem; }
.review-box .d-field { margin-top: 8px; }
.review-box > .d-button { margin-top: 8px; }
.ask-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .ask-row { grid-template-columns: 1fr; } }
.question-list { margin: 8px 0; padding-left: 18px; font-size: 0.9rem; }
.question-list li { margin: 2px 0; }
.fix-input { margin: 6px 0; }
.void-box summary { cursor: pointer; font-weight: 600; }
.d-hint.checkout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.d-hint.warn { color: var(--warn-ink); background: var(--warn-bg); padding: 6px 10px; border-radius: 8px; }

/* R45: adding someone from the staff list to today's shift. */
.zone.join .join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 6px 0 2px; }
.zone.join .join-row select:first-child { grid-column: 1 / -1; }
.zone.join .join-row select { min-width: 0; width: 100%; }

/* R49: paperwork still open the day after. */
.tag.late { background: #fde2e4; color: #9b1028; }

/* R37: level and stage filters on the live board. */
/* D157: when, level and stage; a hidden level or stage is struck through. D206: side by side on one line, wrapping only
   when the pane is too narrow for them. */
.board-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 4px 0 10px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-row .d-label { margin: 0; }
.filter-row .d-chip b { margin-left: 2px; font-variant-numeric: tabular-nums; }
.filter-row .d-chip.off { opacity: 0.45; text-decoration: line-through; }
.filter-row .day-pick { width: auto; padding: 3px 6px; font-size: 0.82rem; }
.past-days { margin: 0 0 8px; }
.d-chip.small { padding: 3px 10px; font-size: 0.82rem; }
.board-head .d-link { margin-left: auto; }

/* R41: the day view, a timeline and a map of the day's calls. */
.day-view h2 { font-size: 1rem; margin: 18px 0 6px; }
/* D128: a day picker (shift, day view), and who worked the day with the calls they were sent to. */
.shift-day { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
.day-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* The day itself reads a little larger than the buttons around it. */
.day-picker .d-input.small { width: auto; font-size: 0.9rem; }
.day-crews { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.day-crew { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.day-crew h3 { margin: 0 0 4px; font-size: 0.9rem; }
.day-crew ul { list-style: none; margin: 0; padding: 0; }
.day-crew li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 2px 0; font-size: 0.85rem; }
.day-calls { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
/* D129: the schedule, a week of the regular staff: a cell per person and day, a row per team. */
.schedule-wrap { overflow-x: auto; }
.schedule-grid { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.schedule-grid th, .schedule-grid td { padding: 2px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.schedule-grid thead th { font-weight: 600; white-space: nowrap; }
.schedule-grid thead th span { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.schedule-grid thead th.today { box-shadow: inset 0 -3px 0 var(--navy); }
.schedule-grid tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.schedule-sum td.short { color: var(--warn-ink, #7a4a00); font-weight: 700; }
.schedule-cat th { padding-top: 14px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.schedule-team th { font-weight: 600; }
.schedule-team select { width: auto; margin-left: 8px; }
.schedule-cell { width: 100%; min-width: 76px; height: 28px; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; background: transparent;
    color: var(--ink); font: inherit; font-size: 0.75rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-cell.on { background: color-mix(in srgb, var(--lvl-green) 16%, var(--surface)); border-color: var(--lvl-green); }
.schedule-cell.team { font-weight: 600; }
.schedule-cell.team.on { background: color-mix(in srgb, var(--navy) 10%, var(--surface)); border-color: var(--navy); }
.schedule-cell:disabled { cursor: default; opacity: 0.55; }
/* D143: approved time off blocks a day; a day asked off waits for an answer; each person's week in hours and overtime. */
.schedule-cell.away { opacity: 1; color: var(--muted); background: repeating-linear-gradient(135deg, #f1f1f1 0 6px, var(--surface) 6px 12px); }
.schedule-cell.asked { border-style: dashed; border-color: var(--warn-ink, #7a4a00); color: var(--warn-ink, #7a4a00); }
.schedule-cell.on.asked { color: inherit; }
.schedule-hours { white-space: nowrap; text-align: right !important; font-variant-numeric: tabular-nums; padding-left: 10px !important; }
.schedule-hours b, .schedule-hours .muted { margin-left: 6px; }
.schedule-hours.overtime b { color: var(--warn-ink, #7a4a00); }
.schedule-size { margin-left: 6px; font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.schedule-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.schedule-week { margin: 6px 0 8px; }
.schedule-short { margin-left: 8px; color: var(--warn-ink, #7a4a00); font-weight: 600; }
.schedule-filled { display: block; margin-top: 4px; color: var(--muted); }
.timeoff-ask { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; margin: 8px 0; }
.timeoff-ask .d-field { margin-bottom: 0; }
.timeoff-ask select.d-input, .timeoff-ask input.d-input { width: auto; }
.timeoff h2 { margin: 18px 0 6px; font-size: 1rem; }
.timeoff-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.timeoff-table th, .timeoff-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.timeoff-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.timeoff-table tbody th { font-weight: 500; white-space: nowrap; }
.timeoff-clash { color: var(--warn-ink, #7a4a00); }
.timeoff-answers { display: inline-flex; gap: 6px; }
.setup-week label, .setup-overtime { display: inline-flex; align-items: center; gap: 6px; }
.setup-left { white-space: nowrap; }
.setup-left .muted { margin-right: 6px; font-size: 0.8rem; }

/* D144: the daily logs: a checklist gone through each day, lines kept as written, and the day's record printed. */
.log-page h2, .day-view h2 { margin-top: 18px; }
.log-sheet, .log-lines { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.log-sheet th, .log-sheet td, .log-lines th, .log-lines td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.log-sheet tbody th, .log-lines tbody th { font-weight: 500; }
.log-group th { padding-top: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.log-missing { color: var(--warn-ink, #7a4a00); }
.setup-recheck { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
/* D389: a thing past its delay, and one not yet. */
.log-due { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: var(--warn-bg, #fff1d6); color: var(--warn-ink, #7a4a00); font-size: 0.82rem; font-weight: 600; }
.log-again { margin-left: 8px; color: var(--muted); font-size: 0.82rem; }
.log-missed { margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; background: var(--warn-bg); color: var(--warn-ink, #7a4a00); }
.day-log-lines summary { cursor: pointer; margin: 2px 0 6px; color: var(--muted); }
.log-actions { white-space: nowrap; text-align: right !important; }
.log-actions .d-chip { margin-left: 4px; }
.log-lines thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
/* D181: the dispatch log of a day: kinds shown or hidden, a search, each call's lines marked with its level's colour. */
.log-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.log-filters .d-input { flex: 0 1 280px; margin-left: auto; }
.day-log-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-log-table thead th:nth-child(2) { width: 30%; }
.day-log-table thead th:nth-child(3) { width: 18%; }
.day-log-table td:last-child { white-space: nowrap; }
/* D186: a call off the board is closed once nothing waits; the day's calls still open, at the top of the log. */
.tag.ok { background: #e6f4ea; color: var(--st-available); }
.still-open { margin: 10px 0; padding: 8px 12px; }
.still-open h2 { margin: 0 0 2px; font-size: 1rem; }
.still-open ul { margin: 4px 0 0; padding: 0 0 0 4px; list-style: none; }
.still-open li { padding: 2px 0 2px 8px; border-left: 4px solid var(--lvl, var(--line)); font-size: 0.9rem; }
.day-log-table tr[class*="lvl-"] th { border-left: 4px solid var(--lvl); }
.day-log-table tr.kind-shift th, .day-log-table tr.kind-logs th { border-left: 4px solid var(--line); color: var(--muted); }
/* D290: the lift a person works today, above every lift log. */
.log-my-lift { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.log-my-lift .d-label { margin: 0; font-weight: 600; }
.log-my-lift .d-input { width: auto; min-width: 14em; }
.log-record { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.log-record > .d-input { width: 16em; }
.log-break { flex-basis: 100%; height: 0; }
/* D301: the checklist's heading with its new round button. */
.log-check-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.log-check-head h2 { margin-right: auto; }
.day-log { margin: 6px 0 12px; }
.day-log h3 { margin: 8px 0 4px; font-size: 0.95rem; }
/* The logs of a day line up, one under the other: time, what, done, note, by. */
.day-log .log-lines { table-layout: fixed; }
.day-log .log-lines td:nth-child(1) { width: 4.5em; }
.day-log .log-lines th { width: 30%; }
.day-log .log-lines td:nth-child(3) { width: 14%; }
.day-log .log-lines td:nth-child(5) { width: 18%; }

@media print {
    .desk-top, .desk-banner, .day-picker, .no-print, .shift-day { display: none !important; }
    .desk-panel { border: 0; padding: 0; }
    a.d-link { color: inherit; text-decoration: none; }
}
/* D130, D136: volunteer days as the roster the volunteers know: a calendar of the months, each open day with how many are
   rostered (blue with someone, green once full), the day picked beside it to sign up or to place everyone in a zone. */
.roster-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin: 8px 0 12px; }
.roster-me .d-input { width: auto; min-width: 16em; }
.roster-months { display: flex; align-items: center; gap: 6px; }
.roster-months .d-input { width: auto; }
/* The calendar and the day's panel side by side; its own name, since the board's patroller column is .roster. */
.roster-days { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.roster-calendar { max-height: 72vh; overflow-y: auto; padding-right: 6px; }
.roster-month { margin: 10px 0 4px; padding: 4px; text-align: center; font-size: 1rem; background: color-mix(in srgb, var(--navy) 8%, var(--surface)); border-radius: 6px; }
.roster-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.roster-weekday { padding: 2px 4px; text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.roster-day { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 64px; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; font: inherit; font-size: 0.75rem; text-align: left; color: var(--muted); background: transparent; }
.roster-day .roster-date { font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.roster-day.open { cursor: pointer; color: var(--ink); border-color: var(--line); background: var(--surface); }
.roster-day.open.some { background: color-mix(in srgb, #5b6ee0 20%, var(--surface)); border-color: color-mix(in srgb, #5b6ee0 45%, var(--surface)); }
.roster-day.open.full { background: color-mix(in srgb, var(--lvl-green) 28%, var(--surface)); border-color: var(--lvl-green); }
.roster-day.open.past { opacity: 0.55; }
.roster-day.open.on { box-shadow: 0 0 0 2px var(--navy); }
.roster-mine { margin-top: auto; padding: 0 5px; border-radius: 4px; background: var(--navy); color: var(--navy-ink); font-weight: 600; }
.roster-panel { position: sticky; top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.roster-panel h2 { margin: 0 0 2px; font-size: 1.1rem; }
.roster-panel h3 { margin: 12px 0 4px; font-size: 0.85rem; color: var(--muted); }
.roster-count { margin: 0 0 8px; color: var(--muted); }
.roster-names { margin: 0; padding-left: 18px; }
.roster-zones { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.roster-place { max-width: none; }
.roster-place th[scope="row"] { color: var(--ink); font-weight: 500; white-space: nowrap; }
@media (max-width: 900px) { .roster-days { grid-template-columns: minmax(0, 1fr); } }
/* D132: the reviewer's day summary, the one place with the guests' names, and its search. */
.review-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; }
/* D357: the guests' names, on the reviewers' own screen. */
.review-guests { font-weight: 600; }
.review-head .review-guests { margin: 2px 0; }
.tag.flag { background: var(--ink); color: #fff; }
.review-flag { margin: 2px 0; font-weight: 600; }
.review-call { font-weight: 400; }
.day-summary .shift-day .d-input[type="search"] { width: auto; min-width: 18em; }
.day-summary-table { border-collapse: collapse; width: 100%; }
.day-summary-table th, .day-summary-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.day-summary-table thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.day-summary-table .summary-person { display: flex; align-items: center; gap: 6px; }
.day-summary-table .summary-person .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lvl, var(--lvl-unknown)); flex: none; }
.day-summary-table mark { background: color-mix(in srgb, var(--lvl-yellow) 35%, transparent); color: inherit; padding: 0 1px; border-radius: 2px; }
.timeline-chart, .map-chart { width: 100%; height: auto; display: block; background: var(--surface, #fff); }
.timeline-chart .hour { stroke: var(--line); stroke-width: 1; }
.timeline-chart .now { stroke: var(--alert, #c8102e); stroke-width: 2; stroke-dasharray: 4 3; }
.timeline-chart .hour-label { font-size: 11px; fill: #5c5c5c; text-anchor: middle; }
.timeline-chart .row-label { font-size: 11px; fill: #111111; text-anchor: end; }
.timeline-chart .span { fill: var(--lvl, var(--lvl-unknown)); }
.timeline-chart .span.ended { opacity: 0.45; }
.timeline-chart .span-label { font-size: 10px; font-weight: 700; fill: #fff; }
.map-chart { max-width: 820px; border: 1px solid var(--line); border-radius: 10px; background: #f7f7f7; }
.map-chart .run { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.map-chart .grade-easiest { stroke: #1f8a4c; }
.map-chart .grade-more_difficult { stroke: #1d5fbf; }
.map-chart .grade-most_difficult, .map-chart .grade-extreme { stroke: #1b1b1b; }
.map-chart .grade-extreme { stroke-dasharray: 6 3; }
/* A lift: its cable between the stations, a tick for each tower (D263). */
.map-chart .lift polyline { fill: none; stroke: #2b3442; stroke-linejoin: round; }
.map-chart .lift-line { stroke-width: 2; }
.map-chart .lift-towers { stroke-width: 7; stroke-dasharray: 1.6 16; }
.map-chart .lift-name { font-style: italic; font-weight: 600; fill: #2b3442; paint-order: stroke; stroke: #f7f7f7; stroke-width: 3px; pointer-events: none; }
.map-chart .spot { fill: var(--lvl, var(--lvl-unknown)); stroke: #fff; stroke-width: 2; }
/* D403: the season's heat map on management's incidents: the map, the runs with the most calls beside it. */
.task-about { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 8px 0; }
.task-pass { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 8px 0 16px; }
.heat { display: grid; grid-template-columns: minmax(0, 820px) minmax(180px, 260px); gap: 16px; align-items: start; }
.heat-map .run { opacity: 0.35; }
.heat-spots { mix-blend-mode: multiply; }
.heat-side h3 { margin: 0 0 6px; }
.heat-top { margin: 0 0 8px; padding-left: 1.2rem; }
.heat-top li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
@media (max-width: 900px) { .heat { grid-template-columns: 1fr; } }
.map-chart .ended .spot { opacity: 0.5; }
.map-chart .spot-label { font-size: 11px; font-weight: 700; fill: #fff; text-anchor: middle; }
/* D263, D264: the resort map for management: the list beside a Leaflet map over topographic tiles. */
.resort-map .map-layers { margin: 10px 0 0; }
.resort-map .map-periods { display: inline-flex; gap: 6px; margin-left: 14px; }
.map-swatch { display: inline-block; flex: none; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; background: var(--sw, #8a94a3); border: 1px solid rgba(255, 255, 255, 0.7); }
.map-swatch.swatch-run, .map-swatch.swatch-grade { border-radius: 2px; height: 4px; vertical-align: 3px; --sw: #1d5fbf; }
.map-swatch.swatch-lift { border-radius: 0; height: 2px; border: 0; vertical-align: 3px; background: #2b3442; }
.map-swatch.swatch-station { border-radius: 2px; --sw: #4a5566; }
.map-swatch.swatch-call { --sw: var(--lvl-red); }
.map-swatch.grade-easiest { --sw: #1f8a4c; }
.map-swatch.grade-more_difficult { --sw: #1d5fbf; }
.map-swatch.grade-most_difficult, .map-swatch.grade-extreme { --sw: #1b1b1b; }
.map-swatch.grade-na { --sw: #8a94a3; }
.kind-lodge { --sw: #7a4b1e; }
.kind-building { --sw: #5f6b7a; }
.kind-food { --sw: #c2410c; }
.kind-patrol { --sw: #b91c1c; }
.kind-ski_school { --sw: #6d28d9; }
.kind-toilets { --sw: #0e7490; }
.kind-parking { --sw: #1d4ed8; }
.map-moves { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.map-moves span { flex: 1 1 auto; }
.resort-map-body { display: grid; grid-template-columns: minmax(240px, 300px) 1fr; gap: 14px; margin-top: 14px; }
.map-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.map-detail { position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.map-detail h2 { margin: 0 28px 2px 0; font-size: 1.05rem; }
.map-detail p { margin: 0 0 8px; }
.map-detail .d-button { margin: 0 6px 6px 0; }
.map-detail-close { position: absolute; top: 6px; right: 6px; }
.map-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 56vh; border: 1px solid var(--line); border-radius: 10px; }
.map-list button { display: flex; align-items: center; gap: 2px; width: 100%; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; cursor: pointer; }
.map-list li:last-child button { border-bottom: 0; }
.map-list button:hover { background: #f1f3f6; }
.map-list button.on { background: var(--navy); color: var(--navy-ink); }
.map-list-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list-note { flex: none; font-size: 0.78rem; opacity: 0.7; margin-left: 6px; }
.map-main { min-width: 0; }
.resort-leaflet { height: 72vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #eef0f2; }
.resort-leaflet .map-run { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.resort-leaflet .grade-easiest { stroke: #1f8a4c; }
.resort-leaflet .grade-more_difficult { stroke: #1d5fbf; }
.resort-leaflet .grade-most_difficult, .resort-leaflet .grade-extreme { stroke: #1b1b1b; }
.resort-leaflet .grade-extreme { stroke-dasharray: 8 5; }
.resort-leaflet .grade-na { stroke: #6b7280; }
.resort-leaflet .map-lift, .resort-leaflet .map-lift-towers { fill: none; stroke: #2b3442; }
/* D327: one zone's runs in bold, the others faded. */
.resort-leaflet .map-run.zone-on { stroke-width: 6; opacity: 1; }
.resort-leaflet .map-run.zone-off { opacity: 0.3; }
.map-list-name .run-grade, .map-detail h2 .run-grade { margin-left: 6px; }
.resort-leaflet .map-run.selected, .resort-leaflet .map-lift.selected { stroke-width: 6; opacity: 1; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 2px #f59e0b); }
.resort-leaflet .map-lift-towers.selected { stroke: #111; }
.resort-leaflet .map-hit { stroke: #000; cursor: pointer; }
.resort-leaflet .map-station { fill: #4a5566; fill-opacity: 1; stroke: #fff; }
.resort-leaflet .map-call { fill: var(--lvl, var(--lvl-unknown)); fill-opacity: 0.95; stroke: #111; }
.resort-leaflet .map-call.ended { fill-opacity: 0.6; }
.resort-leaflet .map-place { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sw); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); color: #fff; font: 700 12px/1 system-ui, sans-serif; cursor: pointer; }
.resort-leaflet .map-place.selected { outline: 3px solid #f59e0b; outline-offset: 1px; }
.resort-leaflet .map-vertex { border-radius: 50%; background: #fff; border: 2px solid #111; cursor: grab; }
.resort-leaflet .map-mid { border-radius: 50%; background: rgba(255, 255, 255, 0.85); border: 1px dashed #111; cursor: copy; }
.resort-leaflet .map-mid::after { content: "+"; display: block; text-align: center; font: 700 11px/12px system-ui, sans-serif; }
.resort-leaflet .map-move { border-radius: 50%; background: #f59e0b; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); cursor: move; }
.resort-leaflet .map-move::after { content: "\2725"; display: block; text-align: center; color: #fff; font: 700 15px/24px system-ui, sans-serif; }
/* D265: the card works on one thing at a time: names, shape or position, a run's spots. */
.map-sections { margin: 4px 0 10px; }
.map-field { display: flex; flex-direction: column; gap: 3px; margin: 0 0 6px; font-size: 0.85rem; color: var(--muted, #5b6573); }
.map-field .d-input { color: var(--ink, #111); }
.map-names { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.map-name-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.map-name-row .d-input:first-child { grid-column: 1 / -1; }
.map-name-row .d-button { justify-self: start; }
.map-names > .d-button { align-self: flex-start; }
.map-spot-list { margin: 0 0 8px; padding-left: 18px; }
.map-spot-list li { margin: 2px 0; }
.map-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.map-swatch.swatch-spot { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); --sw: #0f766e; border-color: #fff; }
.resort-leaflet .map-spot { background: #0f766e; border: 2px solid #fff; border-radius: 2px; transform-origin: center; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); cursor: pointer; }
.resort-leaflet .map-spot.mine { background: #f59e0b; }
.resort-leaflet .map-spot.selected { background: #f59e0b; outline: 3px solid #111; }
.resort-leaflet .map-spot-label { padding: 1px 5px; font: 600 11px/1.3 system-ui, sans-serif; color: #0b3b37; background: rgba(255, 255, 255, 0.85); border: 0; box-shadow: none; }
.resort-leaflet .map-spot-label::before { display: none; }
.resort-leaflet:not(.labels) .map-spot-label:not(.mine) { display: none; }
.resort-leaflet.placing, .resort-leaflet.placing .leaflet-interactive { cursor: crosshair; }
@media (max-width: 900px) { .resort-map-body { grid-template-columns: 1fr; } .map-list { max-height: 30vh; } }
g.lvl-unknown { --lvl: var(--lvl-unknown); }

/* R40: equipment on the board. */
.d-input.small { padding: 2px 6px; font-size: 0.8rem; width: auto; }
.call-gear { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; grid-column: 2 / -1; }
.call-gear .gear { white-space: nowrap; }
.gear { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; background: #f0f0f0; }
.gear.arrived { background: var(--ok-bg); color: var(--ok-ink); }

/* R51: a staff task, the part only. */
fieldset.task-fields { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.task-page .step { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.task-page .step h2 { font-size: 1rem; margin: 0 0 6px; }

/* D121: the resort setup: tabs, a form for the resort, tables for the staff, zones and runs, a card per cache. */
.setup-actions { display: flex; gap: 8px; }
.setup-tabs { margin: 12px 0 14px; }
.setup-problems { margin: 8px 0; padding: 8px 10px 8px 28px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 0.85rem; }
.setup-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; max-width: 900px; }
.setup-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.setup-form small { font-weight: 400; color: var(--muted); }
/* D435: a heading across the grid, before the employer's details. */
.setup-form .setup-subhead { grid-column: 1 / -1; margin: 12px 0 0; font-size: 1rem; }
.d-input.short { width: 6em; }
/* D249: a position as typed, "51.44190, -116.16220" (its width the add form's or the table's). */
.d-input.position { font-variant-numeric: tabular-nums; }
.setup-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.setup-add .d-input { width: auto; flex: 0 1 240px; }
.setup-categories { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.setup-categories .link { margin-left: 4px; border: 0; background: none; cursor: pointer; color: var(--muted); }
/* D173: a list of the record with the resort's own added at its end; what each list does, just under it. */
.setup-categories .setup-add { flex-wrap: nowrap; gap: 6px; margin: 0 0 0 6px; }
.setup-categories .setup-add .d-input { flex: 0 1 200px; }
.setup-hint { max-width: 900px; margin: -6px 0 18px; }
/* D178: the zones table has room for each zone's hut and keeps the zone names whole. */
.setup-table.setup-zones { max-width: 1120px; }
.setup-zones td:first-child .d-input { min-width: 150px; }
.setup-hut { display: flex; align-items: center; gap: 6px; }
.setup-hut .d-input { flex: 0 0 190px; }
.setup-table { width: 100%; max-width: 900px; border-collapse: collapse; font-size: 0.85rem; }
.setup-table th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; color: var(--muted); }
/* D262: a heading that sorts the list; the one sorting it is darker, with its arrow. */
.setup-table th .setup-sort { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.setup-table th .setup-sort:hover, .setup-table th .setup-sort.on { color: var(--ink); }
.setup-table th .setup-sort:hover { text-decoration: underline; }
.setup-table td { padding: 3px 6px; border-bottom: 1px solid var(--rule); }
/* D135: the staff table describes each person, their roles open under their row; the teams table names each person. */
.setup-table.setup-staff { max-width: none; }
.setup-table.setup-staff .d-input { min-width: 0; }
.setup-roles td { background: var(--bg); padding: 6px 8px; }
.setup-roles .d-label { margin-right: 6px; }
.teams .setup-table th[scope="row"] { color: var(--ink); font-weight: 500; white-space: nowrap; }
.setup-table td .d-input:not(.short) { width: 100%; }
/* D249: runs, lifts and places have room for their positions beside the name and the kind; the buttons keep only theirs. */
.setup-table.setup-lines { max-width: 1180px; }
.setup-table td .d-input.position { width: 12em; }
.setup-lines td:has(> .d-button, > .d-input.position) { width: 1%; white-space: nowrap; }
.setup-add + .d-hint[role="status"] { margin: -4px 0 10px; }
/* D250: a list's search with a zone beside it, as wide as the list; a run's grade a little apart from its name. */
.setup-filter { display: flex; gap: 8px; align-items: center; max-width: 1180px; }
.setup-filter select.d-input { flex: 0 0 auto; width: auto; min-width: 12em; }
.log-sheet th .run-grade { margin-left: 6px; }
/* D334: My work and Sign-offs. */
.my-who h2 { margin-bottom: 2px; }
.my-days tr.on th, .my-days tr.on td:nth-child(2) { font-weight: 600; }
.my-days tr.offered td:nth-child(2) { color: var(--focus); }
.my-acts { text-align: right; }
.my-signoffs { list-style: none; padding: 0; display: grid; gap: 6px; }
.my-signoffs li { display: flex; gap: 10px; align-items: baseline; }
.my-signoffs li.to-do span { color: var(--attention); }
.sign-off-done { color: var(--muted); font-size: 0.9rem; }
.schedule-offers { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0; }
.schedule-offer { display: inline-flex; gap: 6px; align-items: center; }
/* D333: a run's features: on the run check every day, with how they should look. */
.map-field.map-check { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.map-spot-daily { margin-left: 6px; }
.log-look { display: inline-block; margin-left: 8px; font-weight: 400; }
.log-look summary { cursor: pointer; color: var(--focus); font-size: 0.9rem; }
.log-look img { display: block; max-width: 280px; margin-top: 6px; border-radius: 6px; }
/* D331: hazards: the report, top to bottom, then those to fix, yours first. */
.hazard-report { display: grid; gap: 10px; max-width: 720px; margin-bottom: 24px; }
.hazard-where { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hazard-send { display: flex; align-items: center; gap: 12px; }
.hazard-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.hazard { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.hazard:not(:has(.hazard-photo)) { grid-template-columns: 1fr auto; }
.hazard.to-send { border-left: 4px solid var(--attention); }
.hazard.yours { border-left: 4px solid var(--focus); }
.hazard-photo { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
.hazard-what { display: grid; gap: 3px; }
.hazard-status { font-weight: 600; }
.hazard-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 320px; }
.setup-hazard-routes { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 10px 0; }
.setup-hazard-routes label { display: flex; gap: 6px; align-items: center; }
@media (max-width: 700px) { .hazard { grid-template-columns: 1fr; } .hazard-where { grid-template-columns: 1fr; } }
/* D326: a run's difficulty picked with its trail sign in front. */
.grade-pick { position: relative; display: block; }
.grade-pick .run-grade { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.grade-pick select { padding-left: 48px; }
.d-chip .run-grade { margin-right: 2px; }
/* On a chip that is on (dark), the black signs keep a light edge. */
.d-chip.on .run-dot { box-shadow: 0 0 0 1.5px #fff; }
.setup-caches { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.setup-cache { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.setup-cache-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.setup-cache-head .d-input { width: auto; min-width: 0; }
.setup-cache-head .d-input:first-child { flex: 1 1 auto; font-weight: 600; }
.setup-cache-head select.d-input { flex: 0 1 40%; }
.setup-cache .d-button.small:last-child { margin-top: 6px; }

/* D204: the record read on the review desk, every answer once; Ask and Correct beside the answer, the box they open under it. */
.review-only { margin: 6px 0 2px; }
.review-record { margin: 4px 0 18px; }
.review-record .fr-part { margin-top: 18px; font-size: 1.1rem; }
.review-record .fr-fields > div { padding: 2px 6px; border-radius: 6px; }
.review-record .fr-fields > div:hover { background: #f4f4f6; }
/* D377: a needed answer still missing is boxed in red, as on the forms. */
.review-record .fr-fields > div.missing, .review-record .fr-fields > div.missing:hover { margin: 2px 0; background: var(--gap-bg); box-shadow: inset 0 0 0 2px var(--alert); }
.review-record .fr-fields > div.missing dd { color: var(--alert-dark); font-weight: 600; }
.review-record .fr-fields > div.asked:not(.missing) { box-shadow: inset 3px 0 0 var(--warn-ink); }
.review-record dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.review-record dd .fr-text, .review-record dd .fr-parts { flex: 1 1 auto; }
.review-record .row-tool { padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 0.78rem; line-height: 1.5; cursor: pointer; }
.review-record .row-tool:hover { border-color: var(--navy); color: var(--navy); }
.review-record .fr-asked { grid-column: 1 / -1; margin: 2px 0 4px; font-size: 0.9rem; color: var(--warn-ink); }
.review-record .fr-under { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.review-record .fr-under .d-input { flex: 1 1 18em; }
.review-record .fr-under .fix-input { flex: 1 1 100%; }
.review-record .row-tool { opacity: 0.55; }
.review-record .fr-fields > div:hover .row-tool, .review-record .row-tool:focus-visible { opacity: 1; }

/* ---------- D266: management's side menu, Find anything, and what waits ---------- */

.desk-main.with-nav { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.mgmt-page { min-width: 0; }
.mgmt-nav { position: sticky; top: 12px; z-index: 1100; display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-height: calc(100vh - 24px); }
.mgmt-nav-groups { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.mgmt-nav h2 { margin: 0 0 2px; font-size: inherit; }
/* D284: every part's header the same, bolder, opening and closing it. */
.mgmt-nav-group + .mgmt-nav-group { padding-top: 8px; border-top: 1px solid var(--rule); }
.mgmt-nav-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border: 0; border-radius: 7px; background: none; color: var(--ink); font-family: inherit; font-size: 0.8rem; font-weight: 800; line-height: 1.6; text-transform: uppercase; letter-spacing: 0.06em; text-align: left; cursor: pointer; }
.mgmt-nav-head:hover { background: var(--rule); }
.mgmt-nav-head .mgmt-count { text-transform: none; letter-spacing: 0; }
/* D284, D285: the arrow of a part that opens and closes, turned by its button's aria-expanded. */
.chevron { flex: none; width: 0.42rem; height: 0.42rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.12s; }
[aria-expanded="false"] > .chevron { transform: rotate(-45deg); }
.mgmt-nav ul { margin: 0; padding: 0; list-style: none; }
.mgmt-nav-group a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.mgmt-nav-group a:hover { background: var(--rule); }
.mgmt-nav-group a.on { background: var(--navy); color: var(--navy-ink); font-weight: 600; }
.mgmt-count { margin-left: auto; min-width: 1.4rem; padding: 0 6px; border-radius: 999px; background: var(--rule); color: var(--ink); font-size: 0.75rem; font-weight: 700; line-height: 1.35rem; text-align: center; font-variant-numeric: tabular-nums; }
.mgmt-count.urgent { background: var(--warn-bg); color: var(--warn-ink); box-shadow: inset 0 0 0 1px #e8b764; }
.mgmt-nav-group a.on .mgmt-count { background: var(--navy-ink); color: var(--navy); box-shadow: none; }

.mgmt-find { position: relative; }
.mgmt-find .d-input { width: 100%; padding-right: 3.6rem; }
.mgmt-find-key { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--muted); font: 600 0.68rem/1.4 system-ui, sans-serif; pointer-events: none; }
.mgmt-find-results { position: absolute; z-index: 1200; left: 0; top: calc(100% + 4px); width: min(440px, calc(100vw - 40px)); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); }
.mgmt-find-results li.none { padding: 10px; color: var(--muted); font-size: 0.88rem; }
.mgmt-find-results button { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.mgmt-find-results button.on { background: var(--rule); }
.mgmt-find-kind { grid-row: span 2; align-self: start; padding: 1px 0; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.mgmt-find-kind.k-run, .mgmt-find-kind.k-spot, .mgmt-find-kind.k-lift, .mgmt-find-kind.k-place { color: #0b3b37; background: #e3f3f1; border-color: #a7d8d2; }
.mgmt-find-kind.k-person, .mgmt-find-kind.k-team { color: #1e3a8a; background: #e8eefc; border-color: #b6c6f2; }
.mgmt-find-name { font-weight: 600; }
.mgmt-find-note { font-size: 0.8rem; color: var(--muted); }

/* The overview: what waits for management first. */
.mgmt-todo { margin-top: 14px; }
.mgmt-todo h2 { display: flex; align-items: baseline; gap: 8px; }
.mgmt-todo ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mgmt-todo li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.mgmt-todo li.urgent { background: var(--warn-bg); border-color: #e8b764; color: var(--warn-ink); }
.mgmt-todo li b { min-width: 2ch; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.mgmt-todo li span { flex: 1; min-width: 14rem; }
.mgmt-todo .calm { margin: 0; color: var(--ok-ink); background: var(--ok-bg); padding: 8px 10px; border-radius: 8px; }

@media (max-width: 900px) {
    .desk-main.with-nav { grid-template-columns: minmax(0, 1fr); }
    .mgmt-nav { position: static; max-height: none; }
    .mgmt-nav-groups { overflow: visible; }
    .mgmt-nav-group ul { display: flex; flex-wrap: wrap; gap: 2px; }
}
@media print { .mgmt-nav { display: none; } .desk-main.with-nav { display: block; } }
/* D267: management's daily work in four parts and the resort setup; a glance card per part on the overview;
   the daily logs at a glance; the setup's own page. */
.mgmt-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 0; }
.mgmt-glance { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mgmt-glance a.mgmt-card { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; transition: border-color 0.12s, box-shadow 0.12s; }
.mgmt-glance a.mgmt-card:hover { border-color: var(--navy); box-shadow: 0 2px 10px rgb(0 0 0 / 0.08); }
.mgmt-glance ul { flex: 1; }
.mgmt-glance-go { margin-top: 10px; color: var(--navy); font-size: 0.88rem; font-weight: 600; }
.mgmt-glance-go::after { content: " \2192"; }
.log-glance-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.log-glances h3, .log-glance-grid h3 { margin: 12px 0 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.log-glance-grid .mgmt-sub { margin-top: 18px; }
.log-glance-grid .calm { margin: 0; color: var(--ok-ink); background: var(--ok-bg); padding: 6px 10px; border-radius: 8px; font-size: 0.9rem; }
.mgmt-card .log-standing li { flex-wrap: wrap; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mgmt-card .log-standing li b { margin-left: 0; }
.log-standing-what { color: var(--warn-ink); font-weight: 600; }
.log-standing .muted { margin-left: auto; font-size: 0.85rem; }
.mgmt-card .log-glance-list li { gap: 10px; padding: 5px 0; flex-wrap: wrap; }
.log-glance-list .d-link { min-width: 11rem; }
.log-glance-bar { flex: 0 0 90px; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.log-glance-bar span { display: block; height: 100%; background: var(--ok-ink); }
.log-glance-sum { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.log-glance-list .log-missed { margin-left: 0; }
.setup-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
.setup-home-part { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; transition: border-color 0.12s, box-shadow 0.12s; }
.setup-home-part:hover { border-color: var(--navy); box-shadow: 0 2px 10px rgb(0 0 0 / 0.08); }
.setup-home-part h2 { margin: 0; font-size: 1rem; }
.setup-home-part span { color: var(--muted); font-size: 0.88rem; }
/* D273: the gear checks: counted gear below its usual count on the sheet, what is missing until restocked. */
.log-short { margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; background: var(--rule); color: var(--muted); }
/* D383: who an issue is with, under who raised it. */
.log-with { display: block; font-size: 0.82rem; }
.log-stands { display: block; color: var(--warn-ink, #7a4a00); font-size: 0.85rem; }
/* D283: a note of the day that stands no more (a hazard marked): kept on the row, quiet. */
.log-note { display: block; color: var(--muted); font-size: 0.85rem; }
.cache-missing { margin: 4px 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cache-missing li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink, #7a4a00); font-size: 0.85rem; }
/* D274: the few words an action asks for, on its own row. */
.log-row-note { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.log-row-note .d-input { width: 18em; }
.log-row-what { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
/* D275: All there, done for the day: grayed until something is found missing. */
.log-actions .d-chip.rests { opacity: 0.45; cursor: default; }
/* D279: the run check by zone, the runs checked as time permits on asking; the zones' extras in the setup. */
.log-groups { margin: 0 0 10px; flex-wrap: wrap; }
.log-others { margin: 8px 0 0; }
/* D285: a zone opens to its other things to check, a child list under its row. */
.setup-open { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.setup-parent.open td { border-bottom-color: transparent; background: var(--bg); }
.setup-child td { padding-top: 0; background: var(--bg); }
.setup-child-box { margin: 0 0 6px 24px; padding: 8px 12px; border-left: 3px solid var(--navy); background: var(--surface); border-radius: 0 8px 8px 0; max-width: 560px; }
.setup-child-title { margin: 0 0 6px; font-weight: 700; font-size: 0.88rem; }
.setup-child-list { margin: 0 0 8px; padding: 0; list-style: none; }
.setup-child-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.setup-check-add { display: flex; gap: 6px; margin-top: 4px; }
/* D382: a lift's or a place's daily checks, the usual ones one click each. */
.setup-check-usual { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.setup-table td .setup-check-add input.d-input { flex: 1 1 260px; min-width: 200px; width: auto; }
.setup-daily { text-align: center; }
/* D280: the issues the run check reported, on the board under what is short now. */
.short-now.run-issues { margin-top: 8px; }
/* D401: a wide board: what is short in two columns of lines, the run check's reports beside it. */
.board-top { container: boardtop / inline-size; }
@container boardtop (min-width: 1000px) {
    .board-alerts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 10px; align-items: start; }
    .board-alerts > .short-now:only-child { grid-column: 1 / -1; }
    .board-alerts > .short-now:not(.run-issues) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
    .board-alerts > .short-now.run-issues:only-child ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
}
/* D282: the grades the run check asks for every day, the resort's. */
.setup-daily-grades { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }

/* D366: the terrain parks today: each park's opening, its features with how they should look and their inspection. */
.park-one { margin: 0 0 20px; }
.park-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.park-head h2 { margin: 0; }
.park-why { max-width: 260px; }
.park-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.park-feature { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; }
.park-photo { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.park-what { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; }
.park-what .tag { align-self: flex-start; }
.park-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.park-acts .d-input.small { max-width: 220px; }
.park-add { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line, #e3e3e3); }
.park-where.desk { display: contents; }

/* D374: a feature measured now and then, on its row. */
.park-measure { display: flex; flex-wrap: wrap; align-items: end; gap: 6px 10px; flex-basis: 100%; }
.park-measure .d-input.small { max-width: 90px; }
/* D395: a time box holding what is no time of day. */
.time-box.invalid { outline: 2px solid #b3261e; outline-offset: 1px; }
