/* Cleaning.
 *
 * Everything here inherits the app's tokens - warm greige grounds, walnut ink, the gold-amber accent,
 * Montserrat. Cleaning is a sibling of Maintenance and has to read as one; inventing a palette for it would
 * make one module look like a different product. Severity is carried by the app's own 0-3 status-pill scale
 * and nothing else: no new reds, no new greens, no gradients.
 *
 * Two deliberate departures from Maintenance:
 *
 * 1. The navigation. Maintenance is one shell with a tab group; cleaning is a set of separately-pushed routes,
 *    two of which (the walk, the schedule builder) take over the pane entirely and cannot live in a panel. So
 *    it gets a segmented marker in a shared header instead of tabs - the same control the sales report already
 *    uses for its two lenses, so the vocabulary is not new.
 *
 * 2. The walk screen. Maintenance's equivalent is desk-shaped, because a technician logs a round at a bench. A
 *    cleaning schedule is walked through a grow room wearing gloves, so that screen is built phone-first: one
 *    capped column, targets sized for a thumb, and nothing that needs a pointer.
 *
 * Selectors are scoped to their page element rather than left global. metric-card and friends are names
 * Maintenance also uses (scoped to maintenance-management), and two modules quietly redefining the same bare
 * element name is how one dashboard starts restyling the other.
 */

/* ---- Two palette corrections, applied throughout this file ----
 *
 * 1. NOT --plain-white. It is #ffffff in the light theme and #202028 in the dark one, which makes it the only
 *    cool-leaning token in a palette that is otherwise entirely warm: #252423 page, #282726 body, #292827
 *    cards, #3d3b35 rules, #d3ccb5 ink. This module was drawing ten surfaces on it - the schedule rows, the
 *    attention rows, the stop cards, the notices, the attestation slots, the active nav pill - so the dark
 *    theme showed a stack of navy slabs sitting on warm brown. Maintenance uses --plain-white exactly once,
 *    which is why the two modules did not look like the same product. Everything here is --blue-gray now.
 *
 * 2. NOT --soft-border-color. variables.css defines it in the light theme (#d7d2ce) and never redefines it
 *    for dark. An undefined custom property makes the whole declaration invalid at computed-value time, so
 *    `border: 1px solid var(--soft-border-color)` did not fall back to a default colour - it dropped the
 *    entire shorthand, taking border-style to none and border-width to 0. Nine rules in this file rendered
 *    borderless in the dark theme while looking correct in the light one. Worse, two of them set the
 *    criticality rail as `border-left-width` on that same shorthand, so the red and orange left edges that
 *    mark a critical schedule have never once been drawn in dark mode. --border-color is defined in both.
 *
 * The same missing token is used by table.css, members.css and markdown-editor.css, which are outside this
 * module and still affected; defining --soft-border-color in the dark block of variables.css would fix those
 * too, but that is an app-wide change and is deliberately not made here. */

/* ============================ Page frames ============================ */

cleaning-dashboard,
cleaning-schedules-page,
cleaning-tasks-page,
cleaning-builder-page,
cleaning-calendar-page {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 1.5rem;
	height: 100%;
	overflow-y: auto;
}

/* The grid takes whatever the header and the section row leave, rather than scrolling inside a scroller.
   Two nested scroll regions on one page is how a month gets half drawn with no way to see the rest.
 *
 * The explicit height is what makes that work. The app shell gives page content no bounded height - body
 * grows to its content - so the height: 100% in the shared rule above resolves to auto, and a calendar
 * sized as a percentage of it has nothing to measure. Bound to the viewport the way facilities.css,
 * members.css and pos.css already are. */
cleaning-calendar-page {
	overflow: hidden;
	height: calc(100dvh - var(--window-header-height) - 1rem);
}

/* The register keeps whatever scrolling #main already arranges - it gains the chrome and its spacing, and
   nothing else. Wrapping a paginated list in a second scroll region is how the pager ends up below the fold
   with no way to reach it. */
cleaning-records-page {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.5rem;
}

/* The one block on the dashboard that is genuinely read rather than scanned, so it gets a measure. */
.cleaning-no-schedules p {
	margin: 0;
	color: var(--light-global-font-color);
}

/* ============================ Module chrome ============================ */

cleaning-chrome {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* The record's own page is the one cleaning screen with no page frame around it - the sheet below indents
   itself with a margin instead - so the chrome had nothing supplying the inset the other five get from their
   frame's padding, and the title, facility pill and section tabs sat a padding-width up and to the left of
   where they sit everywhere else in the module. Matched to the sheet's own margin so the two share an edge.
   Scoped to the direct child of the shell because that is exactly what "not inside a page frame" means here:
   every framed screen puts its frame between #main and the chrome. */
#main > cleaning-chrome {
	padding: 1.5rem 1.5rem 0;
}

/* Names the facility being viewed beside the page title. Deliberately quieter than the h2 next to it - it
   qualifies the title rather than competing with it. Matches Maintenance's pill of the same name, which is
   scoped to that module and so cannot simply be reused. */
cleaning-chrome facility-name-pill {
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	background-color: var(--background-white);
	font-size: var(--font-size-small);
	white-space: nowrap;
	align-content: center;
}

/* The segmented section marker. An inset track with the current section lifted out of it, so "where am I"
   is answered by depth rather than by colour - which leaves the accent free to mean "the action to take". */
cleaning-nav {
	display: inline-flex;
	flex-wrap: wrap;
	align-self: flex-start;
	gap: 0.15rem;
	margin: 0 1rem;
	padding: 0.25rem;
	border-radius: 999px;
	background: var(--deep-background-color);
	box-shadow: var(--soft-container-inner-shadow);
}

cleaning-nav button {
	padding: 0.45rem 1.1rem;
	border: none;
	border-radius: 999px;
	background: transparent;
	font-family: var(--global-font-family);
	font-size: var(--font-size-normal);
	color: var(--light-global-font-color);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

cleaning-nav button:hover {
	color: var(--global-font-color);
}

cleaning-nav button[aria-current="page"] {
	background: var(--blue-gray);
	color: var(--global-font-color);
	font-weight: 600;
	box-shadow: var(--outline-button-shadow);
}

cleaning-nav button:focus-visible {
	outline: 2px solid var(--darker-primary-green);
	outline-offset: 2px;
}

/* ============================ Panels and bands ============================ */

cleaning-panel {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1.25rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
}

cleaning-panel panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--border-color);
}

cleaning-panel h3,
cleaning-panel h4 {
	margin: 0;
}

/* A band is a heading plus the figures it governs. The dashboard used to stack two identical strips of bare
   numbers with an unrelated panel between them, so a count of records carried the same weight as an overdue
   warning and nothing said which question either strip answered. */
cleaning-band {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

cleaning-band band-header {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0 0.25rem;
}

cleaning-band band-header h3 {
	margin: 0;
	font-size: var(--font-size-medium);
}

/* Two columns where there is room, one below it. Not a fixed count: at three the cards on a laptop are
   narrower than the sentence inside them. */
cleaning-split {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
	gap: 1.5rem;
	align-items: start;
}

/* ============================ Metric cards ============================ */

cleaning-dashboard cleaning-metric-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 1.25rem;
}

cleaning-dashboard metric-card {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1.25rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
}

cleaning-dashboard metric-header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

cleaning-dashboard metric-icon svg {
	width: 1.35rem;
	height: 1.35rem;
	opacity: 0.7;
}

/* Walnut at reduced weight rather than --light-text. The token Maintenance uses for the same label is
   #abaaa6 on an #eceae2 card, which is roughly 2:1 - a label that is legible on a design mock and not on a
   monitor in a grow room. Tracked-out small caps because it is a field name for the figure below it, which is
   the one place in this module that treatment earns. */
cleaning-dashboard metric-title {
	font-size: var(--font-size-small);
	font-weight: 600;
	color: var(--light-global-font-color);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

cleaning-dashboard metric-value {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	color: var(--global-font-color);
}

/* The unit rides with the number rather than being folded into the subtitle, so "1.5 days" reads as one
   quantity instead of a bare figure the reader has to go and find a scale for. */
cleaning-dashboard metric-unit {
	font-size: var(--font-size-medium);
	font-weight: 500;
	color: var(--light-global-font-color);
}

cleaning-dashboard metric-subtitle {
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* Zero is not a warning. A count that has nothing in it goes quiet rather than showing a coloured 0, which
   is the difference between "nothing is wrong" and "something is wrong and it is zero". */
cleaning-dashboard .muted-metric { color: var(--light-global-font-color); opacity: 0.7; }
cleaning-dashboard .attention-metric { color: var(--orange); }
cleaning-dashboard .danger-metric { color: var(--danger-red); }

/* ============================ Charts ============================ */

/* Evidence for the band above it, not a panel beside it.
 *
 * Deliberately given no card, no radius and no second shadow: the tiles above already sit in cards, and a
 * chart in an identical card would read as a seventh peer figure rather than as the working behind the third
 * one. A hairline and a caption is the whole treatment - the plot is the only thing here with any weight. */
band-evidence {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.35rem;
	padding: 0.9rem 0.25rem 0.25rem;
	border-top: 1px solid var(--border-color);
}

band-evidence evidence-caption {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

band-evidence evidence-caption h4 {
	margin: 0;
	font-size: var(--font-size-normal);
	font-weight: 650;
}

/* Chart.js is responsive here rather than fixed-size, so the canvas measures this box - which means the box
   has to have a height of its own or the plot collapses to nothing.
   
   Height grows with the number of bars instead of being fixed, because the alternative is a chart that draws
   three schedules as three slabs half a panel tall and twelve as an unreadable comb. --chart-rows is set
   inline by the view; the floor keeps a one-bar chart from being a sliver, and the clamp on --chart-rows is
   belt-and-braces for a row count the server capped at twelve anyway. */
chart-frame {
	display: block;
	position: relative;
	width: 100%;
	height: calc(3.5rem + (2.05rem * clamp(1, var(--chart-rows, 4), 12)));
}

/* The weekly columns are a fixed shape - twelve buckets whatever the data does - so they get a plain height
   rather than a row-driven one. */
chart-frame[data-fixed-height] { height: 15rem; }

/* Chart.js writes width/height onto the canvas itself while measuring; without this the canvas can drive the
   box it is supposed to be measuring and the pair grow each other on every resize. */
chart-frame > canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
}

/* The legend belongs to the chart above it, so it sits under the plot rather than floating in the band's own
   gap. Only the weekly chart has one - the other two plot a single series that their heading already names. */
band-evidence chart-legend {
	display: block;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* ============================ Attention list ============================ */

cleaning-attention-list,
cleaning-recent-list,
cleaning-task-list,
cleaning-stop-list,
cleaning-roster-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

cleaning-schedule-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.9rem 1.1rem 0.9rem 0.85rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
	border-left: 4px solid transparent;
}

/* Criticality earns a left edge rather than a badge: it orders the list, and a rule at the start of the row
   is readable at a glance without adding another thing to read. The transparent edge above keeps every row
   the same width, so a critical one does not sit a few pixels left of its neighbours. */
cleaning-schedule-row[data-criticality="Critical"],
schedule-list-row[data-criticality="Critical"] { border-left-color: var(--danger-red); }
cleaning-schedule-row[data-criticality="High"],
schedule-list-row[data-criticality="High"] { border-left-color: var(--orange); }

schedule-identity {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

/* The code is an identifier, not prose: monospaced figures so codes line up when several are read down a
   list, and a chip so it never reads as part of the name beside it. */
schedule-code {
	padding: 0.05rem 0.4rem;
	border: 1px solid var(--border-color);
	border-radius: 0.35rem;
	background: var(--background-white);
	font-size: var(--font-size-small);
	font-variant-numeric: tabular-nums;
	color: var(--light-global-font-color);
	white-space: nowrap;
}

.schedule-notes { margin-top: 0.25rem; }

schedule-note {
	padding: 0.1rem 0.45rem;
	border-radius: 0.35rem;
	background: var(--background-white);
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

schedule-note[data-tone="attention"] {
	color: var(--orange);
}

.schedule-actions { flex: 0 0 auto; }

/* The foot of a list that has been cut to three, so it has to be the way out rather than a remark about one.
   Deliberately not a fourth row: no border box, no white fill, just a hairline separating it from the rows it
   summarises - a card here would read as another schedule and cost the cap its point. The hover and focus
   tints are the recent-records rows', since it behaves the same way. */
cleaning-attention-overflow {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 1rem 0.35rem;
	margin-top: 0.25rem;
	border-top: 1px solid var(--border-color);
	font-size: var(--font-size-small);
	/* Full ink, not the muted grey the old footnote used. It is a link now, and a link nobody can read is worse
	   than no link - the size and the hairline are already carrying "this is subordinate to the rows". */
	color: var(--global-font-color);
	cursor: pointer;
}

cleaning-attention-overflow:hover,
cleaning-attention-overflow:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Amber, not the overdue red the rows above use. It reports lateness the reader cannot see yet; matching the
   pill on a genuinely overdue row would let a summary out-shout the thing it summarises. */
overflow-detail {
	flex: 0 0 auto;
	color: var(--orange);
	font-variant-numeric: tabular-nums;
}

/* Green rather than grey: "nothing is late" is a result, not an absence of data, and the one place on the
   dashboard where good news is worth seeing. Same treatment as Maintenance's no-attention-needed. */
cleaning-all-clear {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 1rem;
	border: 1px solid var(--success-green);
	border-radius: 0.6rem;
	background: var(--blue-gray);
	color: var(--success-green);
	font-size: var(--font-size-normal);
}

cleaning-all-clear svg {
	width: 1.25rem;
	height: 1.25rem;
	flex: 0 0 auto;
}

/* ============================ Recent records ============================ */

/* A grid, not a flex row: three columns keep the identifier, the time and the status in the same place down
   the list, so the eye scans a column instead of chasing a pill across a metre of empty card. */
cleaning-recent-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 1rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.6rem;
	background: var(--blue-gray);
	cursor: pointer;
}

cleaning-recent-row:hover,
cleaning-recent-row:focus-visible { background: var(--hover-gray); }

recent-identity {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	min-width: 0;
}

recent-when {
	font-size: var(--font-size-small);
	font-variant-numeric: tabular-nums;
	color: var(--light-global-font-color);
	white-space: nowrap;
}

/* ============================ Skipped cleans ============================ */

/* This was a ranked bar chart of the reason text. The reason is free text, so the bars came out as a column of
   ones and the chart claimed a ranking the data could not carry. It is a log now: the prose gets the room, and
   the only thing ranked is the per-schedule tally, which groups on a real field. */
cleaning-skip-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

cleaning-skip-entry {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.6rem;
	background: var(--blue-gray);
}

skip-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	min-width: 0;
}

skip-head row-layout { min-width: 0; }

skip-when {
	flex: 0 0 auto;
	font-size: var(--font-size-small);
	font-variant-numeric: tabular-nums;
	color: var(--light-global-font-color);
	white-space: nowrap;
}

/* Amber, and only past one. A schedule skipped once has nothing to say; the chip exists to make the fourth
   sighting of the same schedule impossible to read past, which is the finding this panel is for. */
skip-tally {
	flex: 0 0 auto;
	padding: 0.05rem 0.4rem;
	border-radius: 0.35rem;
	background: var(--background-white);
	font-size: var(--font-size-small);
	font-variant-numeric: tabular-nums;
	color: var(--orange);
	white-space: nowrap;
}

/* Prose, so it is set like prose: wrapped, not truncated, and held to a reading measure. Clipping it to one
   line would hide the half of a reason that says why - which is the whole content of the entry. */
skip-reason {
	display: block;
	max-width: 68ch;
	font-size: var(--font-size-normal);
	line-height: 1.45;
	color: var(--global-font-color);
	overflow-wrap: anywhere;
}

cleaning-skip-overflow {
	display: block;
	padding: 0.35rem 0.25rem 0;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* ============================ Section headers and empty states ============================ */

section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	padding: 0 0.25rem;
}

section-header h3 { margin: 0; }

/* An unknown element is display: inline until this file gives it a box, and a declared display beats the
   [hidden] attribute's user-agent rule - so toggling .hidden from script left the empty state on screen above
   the rows it says are not there. Every custom element in this file that script hides needs its own opt-out. */
cleaning-empty-state[hidden] { display: none; }

cleaning-empty-state {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 2rem 1.5rem;
	border: 1px dashed var(--border-color);
	border-radius: 1rem;
	background: var(--blue-gray);
}

cleaning-empty-state h3 { margin: 0; }

cleaning-empty-state p {
	max-width: 62ch; /* comfortable measure; this block is the one that is genuinely read */
	margin: 0;
	color: var(--light-global-font-color);
}

/* The good news, stated where the chart would have been. Quiet on purpose: a green banner every day is how a
   dashboard teaches people that its colours mean nothing. */
cleaning-all-clear {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1.5rem 1.25rem;
	border: 1px dashed var(--border-color);
	border-radius: 0.75rem;
	background: var(--blue-gray);
	color: var(--light-global-font-color);
}

cleaning-all-clear strong { color: var(--global-font-color); }

cleaning-all-clear span { max-width: 62ch; }

/* Says what is wrong with the data on the page, in the page's own voice, above the thing that is wrong. */
cleaning-notice {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--orange);
	border-radius: 0.6rem;
	background: var(--blue-gray);
	font-size: var(--font-size-normal);
	color: var(--global-font-color);
}

cleaning-notice svg {
	width: 1.25rem;
	height: 1.25rem;
	flex: 0 0 auto;
	color: var(--orange);
}

/* ============================ The schedules list ============================ */

/* A schedule is a row, not a card. Every one of them carries the same six facts, and a card sizes itself to
   whichever of them is longest - so a two-line name in one column and a description in the next put the stat
   strip at a different height in every card, and the list could not be read by scanning down. Maintenance's
   rounds were converted for this reason; the two lists now have the same shape on purpose.

   The columns are fixed rather than fluid so that the state, the figures and the action each form a readable
   column of their own down the page. Only the identity column flexes, because only the name varies. */
cleaning-schedule-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* The section row shares the rows' right-hand edge, so "New schedule" sits directly above the walk buttons.
   That edge is the row's own padding, not a measure: the rows fill the pane now, and the 88rem cap this
   replaces stopped the header a few hundred pixels short of the list it belongs to. */
cleaning-schedules-page > section-header {
	padding-right: 1.1rem;
}

schedule-list-row {
	display: grid;
	/* state | identity | figures | action rail.
	 *
	 * Identity is bounded rather than a bare 1fr. As 1fr it took every spare pixel in the pane and left them
	 * blank between the name and the figures - a schedule name is about 200px and the column was resolving to
	 * roughly 900px on a 1920 monitor, which is the hole this page was reported for. 34rem is around 75
	 * characters of description, past which the truncation is doing the work anyway.
	 *
	 * The figures stay a fixed 24rem here rather than taking a range. Grid shares free space equally between
	 * growable tracks, so giving this one a ceiling would take half of identity's growth away at the width
	 * where identity has least of it - on a 1280px laptop with the sidebar out there are only about 130px to
	 * share. Fixed means identity grows first, and only then the rail.
	 *
	 * Whatever is left lands in the last track, which right-aligns its contents. The surplus therefore pools
	 * at the same offset on every row, in front of a control, and reads as the margin round a button rather
	 * than as a gap in the middle of a sentence - and the walk buttons form one column down the pane's right
	 * edge, directly under "New schedule". */
	grid-template-columns: 9.5rem minmax(0, 34rem) 24rem minmax(auto, 1fr);
	align-items: center;
	gap: 1.25rem;
	padding: 0.9rem 1.1rem 0.9rem 0.85rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
	/* The criticality rail, declared on its own rather than as border-left-width on a `border` shorthand.
	   Same shape as maintenance's round-row, and robust: a shorthand that fails to parse takes the rail's
	   width to zero with it, which is exactly how this rail spent its life invisible in the dark theme. */
	border-left: 4px solid transparent;
}

/* The lead column. Fixed width so the pill's left edge is the same on every row - a pill that starts wherever
   its own label ends cannot be scanned as a column. */
schedule-due {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	min-width: 0;
}

schedule-due-detail {
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

schedule-description {
	display: block;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* Four facts about the schedule's history, two by two while the row is narrow enough that spreading them
   would leave each one a column too thin to hold a date. The container block below gives them a column each
   once there is room. */
schedule-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.35rem 1rem;
}

schedule-stat {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	min-width: 0;
	font-size: var(--font-size-small);
}

schedule-stat .text-light,
details-fact .text-light {
	color: var(--light-global-font-color);
}

schedule-stat strong {
	font-size: var(--font-size-normal);
	font-variant-numeric: tabular-nums;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Pinned to the end of its track, which is the end of the row. The gap in front of the button is what makes
   that last track a rail rather than a fourth column of content. The narrow block near the end of this file
   re-justifies this to space-between once the row has stacked, and still wins on source order. */
schedule-row-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.25rem;
}

schedule-list-row h4 {
	margin: 0;
	min-width: 0;
}

/* ---- The schedules list, once there is room for the figures to spread ----
 *
 * A viewport query, and it should be a container query. The list's own width is what actually decides whether
 * four date columns fit, and the app sidebar is ~290px and collapsible - so this threshold is wrong by the
 * width of the sidebar in whichever state the reader is not in.
 *
 * container-type: inline-size on cleaning-schedule-list was tried first and reverted on 2026-09-22. It works
 * for the layout and breaks the row's overflow menu: container-type applies layout containment, which makes
 * the list a containing block for position: fixed descendants, and each row's sl-dropdown is hoisted. Shoelace
 * then writes list-relative coordinates into a viewport-positioned popup - measured on the last row, the
 * trigger sat at (1844, 834) and the menu was placed at (1539, 605), roughly a third of the way up the list.
 * A menu that opens somewhere else is a worse defect than a breakpoint that is off by a sidebar, so the
 * breakpoint stays until either Shoelace's positioner accounts for containment or the dropdown stops hoisting.
 *
 * 100rem in a media query is 1600px (media-query rem is the initial 16px, NOT this app's ~14.3px root), which
 * leaves the identity column ~330px in the worst case - sidebar out, window exactly at the threshold.
 * Anything narrower renders exactly as it did.
 *
 * What changes is that the four figures leave their 2x2 block and become four columns of the row itself. That
 * reverses the older note above schedule-stats - "across the row they stop reading as one group" - and the
 * reversal is the point: at this width they are not read as a group inside one row, they are read as four
 * labelled columns down the list, which is the question this page answers. It also takes a line off the stat
 * block, so more schedules fit on a screen.
 *
 * display: contents rather than a nested grid, because the columns have to line up BETWEEN rows and each row
 * is its own independent grid - only track sizes that resolve identically in every row do that. Hence fixed
 * widths for the three short figures rather than fr. The one thing that would break the alignment is a row
 * gaining or losing a control: require-permission resolves per user rather than per row, so today every
 * action track is the same width. Check this block if that ever changes. */
@media (min-width: 100rem) {
	schedule-list-row {
		grid-template-columns:
			9.5rem                  /* state - unchanged, the pill column */
			minmax(18rem, 38rem)    /* identity */
			9rem                    /* last cleaned - "14 Sept 2026" under its label, with room to spare */
			9rem                    /* next due */
			6rem                    /* grace - "14 days" is the longest this is ever going to be */
			minmax(9rem, 20rem)     /* walked by - the only figure that is a list, so the only one given room */
			minmax(auto, 1fr);      /* the rail, as in the narrow arrangement */
	}

	/* The four schedule-stat children are promoted into the row's own grid. No markup change. */
	schedule-stats { display: contents; }
}

/* ============================ The filter modal ============================ */

/* One rhythm down the form. Every row is two equal columns and every control fills its column, so the labels
   form a single column down the left and the controls a single column down the middle - which is what a form
   of eight fields needs in order to be read rather than hunted through. */
.cleaning-filter-form form-row > form-column > sl-input,
.cleaning-filter-form form-row > form-column > input,
.cleaning-filter-form form-row > form-column > select {
	width: 100%;
}

filter-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border-color);
}

/* ============================ Shared form corrections ============================ */

/* split-field sizes its columns to their content (forms.css: grid-auto-columns: minmax(9rem, auto)). That is
   right inside a dense table row and wrong inside a form column: on the schedule builder it drew "How often"
   at two thirds the width of the "Becomes due" select directly above it, and "Starts on" and "Grace" at two
   further widths again - four right-hand edges down a column of three fields, which is what made that panel
   read as ragged. Equal halves that fill the column instead, and the full width when one half is hidden.

   Scoped to these two screens rather than corrected in forms.css, which every form in the app shares. */
cleaning-builder-page split-field,
.cleaning-task-modal split-field {
	grid-auto-columns: minmax(0, 1fr);
}

/* The primary action goes bottom-right, where the capture dialog and the schedule builder both put theirs.
   .modal-footer has no justify-content of its own, so this one sat bottom-left - the only save button in the
   module on that side of the screen. */
.cleaning-task-modal .modal-footer {
	justify-content: flex-end;
}

/* ============================ Tasks ============================ */

cleaning-task-section {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

cleaning-task-section h4 {
	margin: 0;
	font-size: var(--font-size-medium);
}

cleaning-task-section > p { margin: 0; }

/* Wider columns than a card grid would normally take, because what is in the card is a piece of writing.
   At 20rem the tracks came out around 286px on a full-width pane, which clipped the work instruction after
   roughly six words a line and turned the one thing this page exists to show into a shape. */
cleaning-task-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
	gap: 1rem;
}

cleaning-task-card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.1rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
}

.task-card-identity { min-width: 0; }

/* The instruction is the task. Shown on the card rather than hidden behind Edit, because a catalogue you
   cannot read is one nobody checks - and clamped, because some of these are a page long. Pushed to fill the
   card's slack so the edit button lines up across a row. */
/* Truncated by height and faded, not by line count.
 *
 * -webkit-line-clamp only counts the line boxes of the box it is set on, and a rendered work instruction is
 * block content - paragraphs and headings with margins of their own - so the clamp cut a card mid-word and
 * still let a sliver of the following paragraph show through the bottom padding. A max-height cuts wherever
 * the content actually reaches, and the mask says "there is more" instead of leaving a severed line to imply
 * it. The height is the same four lines the clamp intended, expressed in the line-height below. */
task-instructions {
	display: block;
	max-height: calc(4 * 1.5em + 1rem);
	overflow: hidden;
	mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4rem), transparent 100%);
	margin-top: auto;
	padding: 0.5rem 0.7rem;
	border-left: 2px solid var(--border-color);
	background: var(--background-white);
	border-radius: 0 0.4rem 0.4rem 0;
	font-size: var(--font-size-small);
	line-height: 1.5;
	color: var(--light-global-font-color);
}

task-instructions[data-missing] {
	border-left-color: var(--orange);
	color: var(--orange);
	font-style: italic;
}

/* A shipped task that has never been written up. Same slot, none of the alarm: this is the catalogue working
   as intended, and the line is an invitation rather than a defect report. */
task-instructions[data-unwritten] {
	color: var(--light-global-font-color);
	font-style: italic;
}

/* Cards in a row are the same height and their buttons line up along one band, rather than stepping down
   the row wherever a description happened to end. */
cleaning-task-card > nb-button { margin-top: auto; }

task-chip {
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border-color);
	border-radius: 1rem;
	background: var(--background-white);
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
	white-space: nowrap;
}

task-chip[data-tone="required"] {
	border-color: var(--darker-primary-green);
	color: var(--darker-primary-green);
}

.cleaning-task-meta { margin-top: 0.1rem; }

/* Rendered work instructions.
 *
 * Both surfaces above hold the output of UserContentMarkdownRenderer rather than a plain string, because the
 * instruction is authored through nb-markdown-editor. One block for the two of them: they are the same piece
 * of writing shown at two sizes - the catalogue card and the room it is read in - and letting them drift
 * apart is how the same SOP reads as two different documents.
 *
 * The editor's own surface (markdown-editor.css) sets the matching rules, so what the author sees while
 * writing is what the cleaner sees while working. Only the headings differ, and downwards: a heading inside a
 * clamped card cannot be allowed to eat the four lines the card has.
 */
task-instructions > *:first-child,
cleaning-stop-instructions > *:first-child { margin-top: 0; }

task-instructions > *:last-child,
cleaning-stop-instructions > *:last-child { margin-bottom: 0; }

task-instructions p,
cleaning-stop-instructions p { margin: 0 0 0.5rem; }

task-instructions h1,
task-instructions h2,
task-instructions h3,
cleaning-stop-instructions h1,
cleaning-stop-instructions h2,
cleaning-stop-instructions h3 {
	margin: 0.6rem 0 0.3rem;
	font-size: var(--font-size-normal);
	font-weight: 650;
	line-height: 1.3;
	color: var(--global-font-color);
}

task-instructions ul,
task-instructions ol,
cleaning-stop-instructions ul,
cleaning-stop-instructions ol {
	margin: 0 0 0.5rem;
	padding-left: 1.15rem;
}

task-instructions li,
cleaning-stop-instructions li { margin-bottom: 0.15rem; }

/* An ordered list is the shape a work instruction actually has, so the marker is given the weight of a step
   number rather than the browser's afterthought grey. */
cleaning-stop-instructions ol > li::marker {
	font-weight: 650;
	color: var(--global-font-color);
}

task-instructions blockquote,
cleaning-stop-instructions blockquote {
	margin: 0 0 0.5rem;
	padding-left: 0.6rem;
	border-left: 2px solid var(--darker-primary-green);
	color: var(--global-font-color);
}

task-instructions strong,
cleaning-stop-instructions strong { color: var(--global-font-color); }

task-instructions a,
cleaning-stop-instructions a { color: var(--link-blue); }

/* ============================ The walk ============================ */

/* The walk is a pane, not a page.
 *
 * This was height: 100% with overflow-y: auto, and neither did anything. The app shell hands page content no
 * bounded height - body grows to its content - so 100% resolved to auto, the element grew to 3947px on a
 * 24-stop roster, and its own overflow never engaged. Both bars are position: sticky, and sticky inside a
 * box that never scrolls is inert: the progress rail scrolled away at the first stop and the duration
 * fields and "Record this walk" sat three thousand pixels below the fold, on the one screen in this module
 * designed to be used one-handed while standing in a room.
 *
 * Bound to the viewport, the way facilities.css, members.css and pos.css already do it, and the way the
 * maintenance walk was fixed on 2026-09-21. The header and footer are then simply the first and last rows
 * of a flex column - always on screen, no sticky involved - and the stop list scrolls between them. */
cleaning-run-page {
	display: flex;
	flex-direction: column;
	height: calc(100dvh - var(--window-header-height) - 1rem);
	overflow: hidden;
}

/* The form wraps the stop list and the footer, so it sits between the pane and two of its three rows and has
   to pass the bounded height through. Left as a plain block it kept its own content height, the pane's
   overflow: hidden clipped it, and the footer was cut off the bottom of the screen rather than pinned to it. */
cleaning-run-page > form {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

/* One column, capped and centred. The 3rem outcome targets exist for a gloved thumb on a phone; left
   unbounded on a monitor the same rule produced four 340px slabs per stop and a note field a metre wide.
   Capping the column is what lets one screen serve both without a second layout. */
/* The header, the stops and the footer share one measure and one gutter, so the schedule name, the first
   stop and the submit button all start on the same vertical line. display, because an unknown element is
   inline by default and neither the cap nor the auto margins apply to an inline box - which left the sticky
   header pinned to the window edge while the stops below it sat in a centred column. */
cleaning-run-header run-header-inner,
run-body,
cleaning-run-footer run-footer-inner {
	display: block;
	box-sizing: border-box;
	width: min(48.5rem, 100%); /* 46rem of content plus the 1.25rem gutter either side */
	padding-inline: 1.25rem;
	margin: 0 auto;
}

/* The first row of the pane. No sticky: there is nothing for it to stick to now that the pane itself is
   what scrolls, and it was never doing anything anyway - see the note on cleaning-run-page. */
cleaning-run-header {
	flex: 0 0 auto;
	z-index: 3;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--border-color);
	background: var(--deep-background-color);
}

cleaning-run-header h2 {
	margin: 0;
	font-size: var(--font-size-xlarge);
}

.run-title { min-width: 0; }

/* The shape of the walk, kept in view while scrolling: how many stops are left to disagree with, and how
   many already do. Standing in a room halfway down the list, that is the question. */
cleaning-progress {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.6rem;
}

cleaning-progress-track {
	flex: 1 1 auto;
	height: 0.4rem;
	border-radius: 0.2rem;
	background: var(--background-white);
	box-shadow: var(--soft-container-inner-shadow);
	overflow: hidden;
}

cleaning-progress-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 0.2rem;
	background: var(--success-green);
	transition: width 0.2s ease, background 0.2s ease;
}

/* Amber the moment anything deviates, so the rail states the walk's outcome and not just its length. */
cleaning-progress[data-has-exceptions] cleaning-progress-fill {
	background: var(--orange);
}

cleaning-progress span {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
}

/* The one thing on this screen that scrolls. The measure moved to its children (see above) so the scrollbar
   sits at the edge of the pane rather than down the middle of a centred 48.5rem column. The 8rem of bottom
   padding that used to reserve room for the sticky footer is gone with it - the footer is a sibling row now
   and cannot cover anything. */
/* The one thing on this screen that scrolls, and still the element carrying the shared measure above - so
   the scrollbar runs down the edge of the 48.5rem column rather than the edge of the pane. That is the right
   trade here: this screen is designed for a phone, where the column IS the viewport, and the alternative was
   moving the measure onto run-body's children, which overrode cleaning-stop-list's own display: flex and
   collapsed the gaps between stops.
   The 8rem of bottom padding that used to reserve room for the sticky footer is gone - the footer is a
   sibling row now and cannot cover anything. */
run-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding-block: 1rem;
}

cleaning-run-intro {
	display: block;
	margin-bottom: 0.75rem;
	color: var(--light-global-font-color);
}

cleaning-stop {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.75rem;
	background: var(--blue-gray);
}

cleaning-stop-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* Only the ad-hoc head wraps, and only because it is the one that carries controls: room, task picker and two
   buttons in a pane a fifth of a modal wide will not sit on one line on a narrow screen. The walk's head has
   nothing to wrap and is left on one line. */
capture-stops cleaning-stop-head { flex-wrap: wrap; }

/* Walk order, not decoration: SortOrder is the physical route through the building, so this genuinely is a
   sequence and the number tells the cleaner where they are in it. A disc rather than a bare figure, because
   at a glance on a phone the number has to be findable before it can be read. */
cleaning-stop-order {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--deep-background-color);
	font-size: var(--font-size-small);
	font-variant-numeric: tabular-nums;
	color: var(--light-global-font-color);
}

.cleaning-stop-identity { min-width: 0; flex: 1 1 auto; }

/* The task picker sits where the task's name sits on a walked stop, and is sized to read as that line rather
   than as a form field: the row's heading is the room, and a full-height control under it would make the task
   look like the more important of the two. Full width of the identity column so a long SOP name is readable
   without opening the list. */
stop-task-field {
	display: block;
	min-width: 0;
	margin-top: 0.15rem;
}

stop-task-field select {
	width: 100%;
	max-width: 20rem;
	padding: 0.15rem 0.3rem;
	border: 1px solid var(--border-color);
	border-radius: 0.35rem;
	background: var(--background-white);
	color: var(--light-global-font-color);
	font-family: var(--global-font-family);
	font-size: var(--font-size-small);
}

stop-task-field select:focus-visible {
	outline: 2px solid var(--blue-gray);
	outline-offset: 1px;
}

/* Quiet by design. These are the row's own housekeeping - a second task here, or one row too many - next to
   the outcome, which is the answer the record is actually for. Anything with a filled background would compete
   with it on every row in the list. */
stop-row-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 0.25rem;
}

.stop-row-action {
	padding: 0.2rem 0.45rem;
	border: 1px solid transparent;
	border-radius: 0.35rem;
	background: none;
	color: var(--light-global-font-color);
	font-family: var(--global-font-family);
	font-size: var(--font-size-small);
	cursor: pointer;
}

.stop-row-action:hover {
	border-color: var(--border-color);
	background: var(--background-white);
	color: var(--global-font-color);
}

.stop-row-action:focus-visible {
	outline: 2px solid var(--blue-gray);
	outline-offset: 1px;
}

stop-optional {
	flex: 0 0 auto;
	padding: 0.1rem 0.5rem;
	border: 1px solid var(--border-color);
	border-radius: 1rem;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

cleaning-stop-instructions {
	display: block;
	padding: 0.5rem 0.7rem;
	border-left: 2px solid var(--border-color);
	background: var(--background-white);
	border-radius: 0 0.4rem 0.4rem 0;
	color: var(--light-global-font-color);
	font-size: var(--font-size-normal);
	line-height: 1.5;
}

/* Outcome: Shoelace's sl-radio-group, the component Maintenance's round screen already uses for the same
   question - so the two walk screens share one control instead of each keeping its own hand-rolled radios.
   Still real radios underneath, so it stays keyboard-navigable and posts before any JS loads.

   What is kept from the hand-rolled version is only the sizing: a 3rem target for a gloved thumb, four across
   on a desk and two on a phone. That measurement is the reason this screen exists at all. Capped rather than
   fluid - past about 30rem the four options stop reading as one control and start reading as four buttons
   that happen to be adjacent. */
cleaning-outcome-choice {
	display: block;
	max-width: 30rem;
}

/* The group's own legend carries the target's name for a screen reader and is not drawn - the stop's heading
   is already directly above it, and a visible one would say the same thing twice. */
sl-radio-group.cleaning-outcome-group::part(form-control-label) {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* The house wrapper is a rounded slab with a shadow, which is right where a radio group sits on a form and
   wrong here: a stop is already a card, so that would be a box drawn inside a box. Only the four targets. */
sl-radio-group.cleaning-outcome-group::part(form-control) {
	border-radius: 0;
	background: none;
	box-shadow: none;
}

/* Grid rather than the house flex-wrap, because every option has to be the same width. These are four answers
   to one question, and a "Failed" wider than "Done" ranks them when nothing about them is ranked. */
sl-radio-group.cleaning-outcome-group[separated-buttons]::part(button-group__base) {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.4rem;
	padding: 0;
}

sl-radio-group.cleaning-outcome-group[separated-buttons] sl-radio-button::part(button) {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
	/* Sized for a gloved thumb rather than a pointer. This is the measurement the whole screen exists for. */
	min-height: 3rem;
	height: auto;
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	background: var(--background-white);
	font-size: var(--font-size-small);
	line-height: 1.2;
	color: var(--light-global-font-color);
	/* The label wraps rather than being truncated: "Attention" at two-across on a small phone does not fit
	   on one line, and a clipped outcome is the one word on this screen that has to be readable. */
	white-space: normal;
	cursor: pointer;
	user-select: none;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

sl-radio-group.cleaning-outcome-group sl-radio-button::part(button):hover { color: var(--global-font-color); }

sl-radio-group.cleaning-outcome-group sl-radio-button::part(button):focus-visible {
	outline: 2px solid var(--darker-primary-green);
	outline-offset: 2px;
}

/* The selected state is filled, on the same four-step scale the status pills use - so an outcome on this
   screen and the same outcome on a record read as the same thing. The previous treatment set white text on
   a half-transparent green for Done and recoloured only the border for the other three, which failed contrast
   and made one option look like a different kind of control. */
/* The colour carries !important because the house rule for a checked radio button sets one too - it paints
   every checked button the primary green, which is right for a form and wrong for a control whose whole job
   is to say which of four states was chosen. */
sl-radio-group.cleaning-outcome-group sl-radio-button[data-outcome]::part(button--checked) {
	font-weight: 600;
	box-shadow: var(--soft-continer-outer-shadow);
}

sl-radio-group.cleaning-outcome-group sl-radio-button[data-outcome="Done"]::part(button--checked) {
	border-color: var(--status-pill-1-bullet-color);
	background: var(--status-pill-1-background);
	color: var(--status-pill-1-color) !important;
}

sl-radio-group.cleaning-outcome-group sl-radio-button[data-outcome="DoneWithAttention"]::part(button--checked) {
	border-color: var(--status-pill-2-bullet-color);
	background: var(--status-pill-2-background);
	color: var(--status-pill-2-color) !important;
}

sl-radio-group.cleaning-outcome-group sl-radio-button[data-outcome="Skipped"]::part(button--checked) {
	border-color: var(--status-pill-0-bullet-color);
	background: var(--status-pill-0-background);
	color: var(--status-pill-0-color) !important;
}

sl-radio-group.cleaning-outcome-group sl-radio-button[data-outcome="Failed"]::part(button--checked) {
	border-color: var(--status-pill-3-bullet-color);
	background: var(--status-pill-3-background);
	color: var(--status-pill-3-color) !important;
}

.cleaning-stop-detail summary {
	/* Comfortable to hit without a pointer, since this is the one control a gloved hand reaches for rarely. */
	padding: 0.4rem 0;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
	cursor: pointer;
}

.cleaning-stop-detail summary:hover { color: var(--global-font-color); }

/* Capped like the outcome control above it, and for the same reason: these are the fields a cleaner fills in
   on a phone, and a note box the width of a monitor invites a paragraph where a sentence was wanted. */
.cleaning-stop-detail-body {
	max-width: 30rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border-color);
}

/* form-field aligns its contents to the bottom, which is right when a row of fields all have one-line labels.
   Both boxes are sl-inputs now and so the same height, but top alignment is still what keeps the two labels
   on one line when a narrow column wraps one of them. */
.cleaning-stop-detail-body split-field form-field { justify-content: flex-start; }

/* The task's own dilution and contact time, said rather than typed into the fields below. It reads as a note
   because that is what it is - the record only carries what the cleaner actually entered. */
cleaning-stop-suggestion {
	display: block;
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--light-global-font-color);
	border-left: 2px solid var(--border-color);
	padding-left: 0.6rem;
}

.cleaning-stop-detail-body input:not([type="checkbox"]),
.cleaning-stop-detail-body textarea,
.cleaning-stop-detail-body sl-input {
	width: 100%;
}

/* The last row of the pane, so it is on screen at every scroll position without being positioned at all. */
cleaning-run-footer {
	flex: 0 0 auto;
	z-index: 3;
	padding: 0.85rem 0;
	border-top: 1px solid var(--border-color);
	background: var(--background-white);
	box-shadow: var(--continer-outer-shadow);
}

cleaning-run-footer run-footer-inner {
	display: flex;
	align-items: flex-end;
	gap: 1rem;
}

/* A grid rather than a flex row: three fields of very different natural widths in a row either overflow or
   collapse to one per line, and the date field is the one that must never wrap. */
run-footer-fields {
	display: grid;
	grid-template-columns: minmax(11rem, 1fr) minmax(6rem, 8rem) minmax(8rem, 1fr);
	gap: 0.5rem;
	flex: 1 1 auto;
	min-width: 0;
}

/* A fourth column only when the facility has equipment to name. Switched by an attribute the view sets rather
   than by auto-fit, because the duration column has to stay narrow whatever else is placed beside it. */
run-footer-fields[data-equipment="true"] {
	grid-template-columns: minmax(11rem, 1fr) minmax(6rem, 8rem) minmax(10rem, 1fr) minmax(8rem, 1fr);
}

run-footer-fields form-field {
	min-height: 0;
	padding: 0;
}

/* ============================ The register ============================ */

/* The records screen is a logbook, and this is its page.
 *
 * It replaced a six-column table under a record preview and a Pending/Approved/Rejected doughnut. The two
 * facts that decide everything on this screen - is the record signed, and how long did the signing take -
 * were split across a Status column and an Approval Date column that never referred to each other, so a
 * record countersigned 167 days after the work and one countersigned in a minute rendered identically. That
 * relationship is the thing a table cannot draw, which is why these are rows and not <td>s.
 *
 * No colour is introduced anywhere below. State is carried by the status-pill scale the whole app uses, and
 * everything this screen adds on top of it is drawn in ink weight and stroke style instead. */

cleaning-register {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

/* --- The tally: what the register says about itself ---------------------- */

/* A sentence whose numbers are the controls, rather than a strip of metric tiles or a row of filter chips.
   The reader wants two things from a count here - what it is, and to act on it - and a tile answers only the
   first. Only unfinished work gets a clause: a register of finished records is not a queue, so there is no
   "126 verified" button to press. */
register-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
}

register-tally {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.15rem 0.4rem;
	font-size: 0.95rem;
	color: var(--light-global-font-color);
	min-width: 0;
}

/* Buttons that read as prose, which is what nb-button's text-only design is for - a chip in the middle of a
   sentence stops the sentence being one. Its own underline is swapped for a border, so the marked state has
   something it can thicken; text-decoration cannot carry weight of its own.

   Sized and coloured through ::part(button), the part nb-button exposes, rather than by restyling the host -
   the host has no say over what is inside the shadow root. */
register-tally nb-button {
	display: inline-flex;
	align-self: baseline;
}

register-tally nb-button::part(button) {
	font-family: var(--global-font-family);
	font-size: 0.95rem;
	color: var(--global-font-color);
	text-decoration: none;
	padding: 0 0 0.1rem;
	border-bottom: 1px solid var(--border-color);
}

register-tally nb-button[tally-total]::part(button) {
	font-weight: 600;
	/* Read down against the entry codes below it, so the same figures line up. */
	font-variant-numeric: tabular-nums;
}

register-tally nb-button[tally-clause]::part(button) { font-weight: 500; }

register-tally nb-button::part(button):hover { border-bottom-color: var(--global-font-color); }

/* The active clause is marked by the rule under it thickening into the accent, not by a fill. A filled chip
   here would read as the primary action on a screen whose primary action is in the header. */
register-tally nb-button[aria-pressed="true"]::part(button) {
	border-bottom: 2px solid var(--darker-primary-green);
	font-weight: 600;
}

register-tally nb-button::part(button):focus-visible {
	outline: 2px solid var(--darker-primary-green);
	outline-offset: 3px;
}

/* Zero pending and zero rejected is a result, not an absence of data - the one this module exists to produce.
   Same treatment as the dashboard's all-clear, which is to say quiet and stated in words. */
register-tally tally-clear {
	display: inline;
	color: var(--global-font-color);
	font-weight: 500;
}

register-tally tally-connective { display: inline; }

register-tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
}

register-tools svg { width: 1.05rem; height: 1.05rem; }

/* --- The entries -------------------------------------------------------- */

/* One continuous surface with hairlines between entries, rather than a stack of separately shadowed cards.
   A logbook is a page of ruled lines; twelve cards would say these are twelve unrelated objects, when the
   whole value of the screen is reading down the column they form. */
register-entries {
	display: flex;
	flex-direction: column;
	background: var(--blue-gray-alternate);
	border: 1px solid var(--border-color);
	border-radius: 0.6rem;
	overflow: hidden;
}

register-entry {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 0.9rem 1.1rem;
	border-top: 1px solid var(--border-color);
	cursor: pointer;
	transition: background-color 0.12s ease;
}

register-entry:first-child { border-top: 0; }
register-entry:hover { background: var(--hover-gray); }

/* --- The head line: identity, date, scope, state ------------------------ */

entry-head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.3rem 0.85rem;
	min-width: 0;
}

/* The focusable control for the entry. The row also takes a click, but that is a pointer convenience; this is
   what a keyboard reaches and a screen reader announces, which is why it is a real button and not the row.
   Tabular figures because this is the one string here somebody matches against a printed sheet character by
   character - proportional digits make CLN-A11K and CLN-AI1K the same width and the same shape. */
register-entry button[entry-code] {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font-family: var(--global-font-family);
	font-size: 0.95rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	color: var(--global-font-color);
	cursor: pointer;
}

register-entry button[entry-code]:hover { text-decoration: underline; }

register-entry button[entry-code]:focus-visible {
	outline: 2px solid var(--darker-primary-green);
	outline-offset: 3px;
	border-radius: 2px;
}

entry-when {
	display: inline;
	font-size: 0.85rem;
	color: var(--light-global-font-color);
	font-variant-numeric: tabular-nums;
}

entry-scope {
	display: inline;
	font-size: 0.85rem;
	color: var(--light-global-font-color);
}

/* The exceptions are counted into the line rather than left to be found by opening the record: on a
   twenty-stop walk the one blocked drain is the only fact that changes what the verifier should do. Set in
   the ink colour so it separates from the stop count it follows without a colour of its own. */
entry-exceptions {
	display: inline;
	color: var(--global-font-color);
	font-weight: 600;
}

entry-exceptions::before { content: "· "; font-weight: 400; color: var(--light-global-font-color); }

/* The pill closes the line, so it sits at the far end however the rest wraps. */
entry-head status-pill { margin-left: auto; flex: 0 0 auto; }

/* --- The chain: two signatures and the measured gap --------------------- */

/* The element this screen exists for, and the record page's attestation strip at register scale.
 *
 * A cleaning record is evidence not for what it claims happened but because a second named person read it and
 * signed, and neither signature carries the one fact that says whether that check was real: the gap. Drawn
 * once per entry, the gaps become a column - a facility that verifies within the week shows a column of light
 * hairlines, one that signs six months late shows heavy ones, and an unverified record shows a broken rule
 * running into an empty slot. That is a property of the register as a whole and it is legible without reading
 * a single word of it. */
/* Capped, because past about this width the rule stops reading as a span between two names and starts reading
   as a page rule with text dropped on it. The head line above is deliberately not capped - the status pill
   belongs at the right edge, where it forms a column down the register. */
entry-chain {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
	max-width: 56rem;
}

chain-party {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	min-width: 0;
	flex: 0 1 auto;
}

party-role {
	display: block;
	font-size: 0.7rem;
	color: var(--light-global-font-color);
}

party-name {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--global-font-color);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

party-when {
	display: block;
	font-size: 0.75rem;
	color: var(--light-global-font-color);
	font-variant-numeric: tabular-nums;
}

/* An empty slot rather than a dash. The record is unfinished and the shape of what is missing is a signature,
   which a reader recognises before reading the words in it. */
chain-party[data-empty="true"] {
	border: 1px dashed var(--border-color);
	border-radius: 0.4rem;
	padding: 0.25rem 0.6rem;
}

chain-party[data-empty="true"] party-name {
	font-weight: 500;
	color: var(--light-global-font-color);
}

/* The rule itself: two segments with the elapsed time between them, so nothing has to be painted over the
   row's background and the label stays legible through the hover state. */
chain-rule {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1 1 4rem;
	min-width: 2.5rem;
}

/* Drawn in the ink at low opacity rather than in --border-color. The border token is a divider colour, and at
   divider strength on a card the connector disappears on exactly the records it should be reassuring about -
   a register whose healthy entries show no chain at all is telling the wrong story. */
chain-rule::before,
chain-rule::after {
	content: "";
	flex: 1 1 auto;
	border-top: 1px solid var(--light-global-font-color);
	opacity: 0.45;
}

rule-lag {
	display: inline;
	flex: 0 0 auto;
	font-size: 0.75rem;
	color: var(--light-global-font-color);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Weight, not colour, carries how long the check took. The stroke thickens and the figure darkens as the gap
   grows, so a page of entries shows its own discipline before any of it is read - and the module's rule that
   severity belongs to the status-pill scale and nothing else survives intact.
   
   Under a week is routine, under a month is worth a look, past a month is a control that has stopped working
   in practice whatever the record says. */
entry-chain[data-weight="slow"] chain-rule::before,
entry-chain[data-weight="slow"] chain-rule::after {
	border-top-color: var(--light-global-font-color);
	opacity: 1;
}

entry-chain[data-weight="slow"] rule-lag { color: var(--global-font-color); }

entry-chain[data-weight="late"] chain-rule::before,
entry-chain[data-weight="late"] chain-rule::after {
	border-top: 2px solid var(--global-font-color);
	opacity: 1;
}

entry-chain[data-weight="late"] rule-lag {
	color: var(--global-font-color);
	font-weight: 600;
}

/* A chain that has not closed is drawn broken. It is the one state that is not about duration, so it overrides
   whatever weight the elapsed time earned. */
register-entry[data-state="open"] chain-rule::before,
register-entry[data-state="open"] chain-rule::after {
	border-top-style: dashed;
}

/* nb-button's flat design is 2.75rem tall, which is right for a page-level action and too heavy repeated down
   a list. Taken in through ::part(button) so it keeps the component's surface, hover and press behaviour and
   only loses the height. */
entry-verb { display: flex; flex: 0 0 auto; }

entry-verb nb-button::part(button) {
	height: 2.1rem;
	padding: 0 1.1rem;
	font-size: 0.85rem;
}

/* --- Filter banner and empty states ------------------------------------- */

/* States what the register is a view of, and only for filters the modal built - a status filter is already
 * spelled out by the marked clause in the tally, and saying it twice on one screen is how two descriptions of
 * one restriction start to disagree.
 *
 * A list that does not say it is a subset is how somebody concludes there were three cleanings in March, and
 * the CSV export respects the filter too, so the screen and the file are both subsets and both have to say
 * so. Given its own row rather than a chip, because the sentence it carries ("verified, cleaned on or after
 * 1 March, in 2 rooms") does not fit in a chip and is the entire point. */
register-filter-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
	border-left: 3px solid var(--darker-primary-green);
	border-radius: 0 0.6rem 0.6rem 0;
	background: var(--background-white);
}

register-filter-banner svg {
	width: 1.1rem;
	height: 1.1rem;
	flex: 0 0 auto;
	color: var(--darker-primary-green);
}

register-filter-banner column-layout {
	flex: 1 1 auto;
	min-width: 0;
}

register-filter-banner strong { color: var(--global-font-color); }
register-filter-banner button { flex: 0 0 auto; }

/* An empty screen is an invitation to act, so both versions of it carry the way out - back to the whole
   register from a filter that matched nothing, or into the first record at a facility that has none. */
register-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
	padding: 3rem 1.5rem;
	text-align: center;
	background: var(--blue-gray-alternate);
	border: 1px solid var(--border-color);
	border-radius: 0.6rem;
}

register-empty p {
	margin: 0;
	max-width: 42ch;
	color: var(--light-global-font-color);
}

/* ============================ Filter modal ============================ */

/* Names each block of fields rather than separating them with a bare rule. A stack of <hr>s says "these are
   different" without saying different how, which on a filter is exactly the question. */
filter-group-label {
	display: block;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	font-size: var(--font-size-small);
	font-weight: 600;
	color: var(--light-global-font-color);
}

/* ============================ Ad-hoc capture ============================ */

/* The dialog is a fixed size, and that is the whole point of it.
 *
 * A modal sized by its contents is re-centred every time those contents change, so picking a fourth room
 * moved the room picker itself out from under the pointer. Fixing the box and letting one pane inside it
 * scroll is what makes the form hold still while it is filled in. max-height and min-height are reset rather
 * than left to .modal-body's percentages, which would fight the fixed height. */
.modal-body.cleaning-capture {
	/* rem, so the dialog tracks the root size global.css steps down at 1500px and 1100px - it shrinks with
	   the type rather than staying a fixed slab of pixels on a smaller screen. */
	width: min(80rem, 94vw);
	height: min(60rem, 90vh);
	max-width: none;
	max-height: none;
	min-height: 0;
	padding: 1.5rem 1.75rem;
	gap: 1rem;
}

.cleaning-capture .modal-head { gap: 2rem; }

.cleaning-capture .modal-content {
	display: flex;
	min-height: 0;
	padding: 0;
	/* Nothing scrolls at this level. The stop list owns the only scrollbar in the dialog. */
	overflow: hidden;
}

.cleaning-capture form {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 1rem;
	/* Both axes. min-height was set and min-width was not, and a flex item defaults to min-width: auto - so the
	   form refused to shrink below the products table's min-content width, overflowed the dialog by about
	   110px, and .modal-content's overflow: hidden cut the submit button in half. Only visible once a product
	   is added, which is why it survived to here. */
	min-height: 0;
	min-width: 0;
}

/* The session on the left, what it produced on the right. The split is not decoration: the room picker fills
   the pane beside it, and stacked they were a cause and an effect a screen apart. */
capture-panes {
	display: grid;
	grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
	gap: 1.5rem;
	flex: 1 1 auto;
	min-height: 0;
}

capture-session {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-height: 0;
	padding-right: 1.25rem;
	border-right: 1px solid var(--border-color);
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Nothing in a scrolling column may be shrunk to fit it. Flex children shrink by default, so when the rail
   was taller than the space it had, every field compressed a little instead of the rail scrolling - which put
   each label on top of the control above it. */
capture-session > *,
capture-stops cleaning-stop-list > cleaning-stop {
	flex: 0 0 auto;
}

/* form-field reserves 5rem for a label and a control, which is right on a full-page form and is most of why
   this modal was as tall as it was. Six of them in a rail is 30rem of mostly air. */
capture-session form-field {
	min-height: 0;
	padding: 0.4rem 0.25rem;
	gap: 0.35rem;
}

capture-stops {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-height: 0;
}

/* The one thing on the form that grows is the one thing that scrolls. */
capture-stops cleaning-stop-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: thin;
	padding-right: 0.4rem;
}

/* Bounded and scrolling, so naming a sixth product shortens nothing above it. */
capture-products {
	display: block;
	flex: 0 0 auto;
	max-height: 12rem;
	/* Horizontal too: the lot table carries four columns and a barcode field, and on a narrower dialog that is
	   wider than the space it has. Scrolling the band is what keeps the dialog's own width honest - without it
	   the table sets the width of everything above and below it. */
	overflow: auto;
	scrollbar-width: thin;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border-color);
}

capture-products form-field {
	min-height: 0;
	padding: 0 0 0.5rem;
	gap: 0.35rem;
}

/* The picker is one field among a table of the products it has produced, so it does not need the dialog's
   full width - and stretched to it, a single select reads as the band's main event rather than its control. */
capture-products form-field[slot="select"] { max-width: 24rem; }

capture-footer {
	display: flex;
	justify-content: flex-end;
	flex: 0 0 auto;
	padding-top: 0.9rem;
	border-top: 1px solid var(--border-color);
}

/* The stop list needs a heading of its own - rows that materialise the moment a room is picked read as a
   glitch otherwise. */
adhoc-stops-header {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	gap: 0.1rem;
}

adhoc-stops-header h4 {
	margin: 0;
	font-size: var(--font-size-medium);
}

/* The instruction that was carried on data-empty-message and never rendered, so an operator who opened the
   form saw a heading with nothing under it and no hint that picking a room was the next move. Shown only
   while the list is empty, which the server states on the list it renders. */
/* Fills the pane rather than sitting as a strip at the head of it: an empty right-hand column with a thin
   dashed box at the top reads as a broken layout, not as an invitation. */
capture-stops cleaning-stop-list[data-empty="true"]::before { flex: 1 1 auto; }

cleaning-stop-list[data-empty="true"]::before {
	content: attr(data-empty-message);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.25rem;
	border: 1px dashed var(--border-color);
	border-radius: 0.6rem;
	color: var(--light-global-font-color);
	font-size: var(--font-size-small);
}

/* ============================ Roster builder ============================ */

cleaning-builder-page form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

cleaning-roster-panel {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1.25rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
}

cleaning-roster-panel h3 { margin: 0; }

cleaning-roster-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) minmax(10rem, 14rem) auto auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--border-color);
	border-radius: 0.6rem;
	background: var(--blue-gray);
}

cleaning-roster-row form-field {
	min-height: 0;
	padding: 0;
}

.cleaning-roster-identity { min-width: 0; }

/* The room picker: every room in the facility, one press each.

   A strip rather than the dropdown that was here. Three clicks per room was the visible cost; the hidden one
   was that a closed dropdown cannot show coverage, and a roster is a coverage claim - the question "which
   room did we leave off" had no answer on screen.

   Above the roster, and divided from it by a hairline: it is a different kind of thing (the building) to the
   list below it (this schedule's route through it). The position is also what makes repeated pressing work -
   each stop added grows the list underneath, so a strip below the list moved after every press. */
cleaning-room-picker {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--border-color);
}

cleaning-room-picker picker-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

/* Capped and scrollable rather than unbounded: a large site can hold thirty rooms, and three rows of chips
   is a strip while eight is a second page nobody asked for. */
cleaning-room-picker picker-track {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	max-height: 11rem;
	overflow-y: auto;
}

/* The same control Maintenance's checklist filter uses, for the same reason: pressed is an outline and a
   lift off the ground, never a fill. The one filled accent on this screen is the button that commits the
   schedule, and a strip of gold chips underneath it would make the accent mean two things at once. */
cleaning-room-picker .room-chip {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.3rem 0.85rem;
	border: 1px solid var(--border-color);
	border-radius: 999px;
	background: transparent;
	font-family: var(--global-font-family);
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

cleaning-room-picker .room-chip:hover {
	color: var(--global-font-color);
	border-color: var(--light-global-font-color);
}

cleaning-room-picker .room-chip[aria-pressed="true"] {
	background: var(--background-white);
	border-color: var(--darker-primary-green);
	color: var(--global-font-color);
	font-weight: 600;
}

cleaning-room-picker .room-chip:focus-visible {
	outline: 2px solid var(--darker-primary-green);
	outline-offset: 2px;
}

/* A facility with no rooms cannot have a roster at all, so this says what to do rather than showing an
   empty strip that reads as a loading failure. */
cleaning-room-picker picker-empty {
	display: block;
	max-width: 62ch;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* The recurrence fields, revealed by the trigger. Both need the [hidden] opt-out for the reason the empty
   state above needs it: a declared display beats the attribute's user-agent rule. */
cleaning-recurrence-fields[hidden],
cleaning-recurrence-note[hidden] { display: none; }

/* form-column sets align-items: flex-start, so a child only fills the column if it says so - form-field
   carries width: 100% and this did not, which left every recurrence field about a hundred pixels short of
   the "Becomes due" select directly above them. */
cleaning-recurrence-fields {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	width: 100%;
}

/* Stated in the gap the four fields left, in the same quiet voice as a field's own hint - it explains an
   absence rather than warning about anything, so it takes no border, icon or tint. */
cleaning-recurrence-note {
	display: block;
	max-width: 46ch;
	padding: 0.1rem 0.15rem;
	font-size: var(--font-size-small);
	line-height: 1.45;
	color: var(--light-global-font-color);
}

/* A stop's task picker opens downwards to a fixed height, and the roster is near the bottom of this page -
   so the last row's panel had nowhere to open into. Room is added only while one is open, which keeps the
   page from carrying a screenful of empty space the rest of the time, and is scoped to this page rather
   than teaching the shared dropdown to flip. */
cleaning-builder-page:has(cleaning-roster-row .custom-select.active) {
	padding-bottom: 14rem;
}

/* ============================ Calendar ============================ */

/* The colour key itself is not styled here: <calendar-legend> / <legend-key> are already a shared component
   (unscoped element rules in absencemanagement.css, built from the same status-pill tokens the events take),
   and a second copy of them is exactly how two keys to one palette drift apart. Only its placement in this
   header row is cleaning's business - the shared rule leaves a bottom margin for a legend that sits above its
   calendar, which here would push it off the row's centre line. */
cleaning-calendar-page calendar-legend {
	margin-bottom: 0;
}

cleaning-calendar-page calendar-container {
	display: block;
	width: 100%;
	flex: 1;
	min-height: 0;
}

cleaning-calendar {
	display: block;
	width: 100%;
}

/* FullCalendar sizes itself against a definite ancestor height and a percentage height resolves to nothing
   without one, which collapses the grid. It now has one: the page above is bound to the viewport and
   calendar-container takes what the header and section row leave, so this is simply all of it.
 *
 * It used to be calc(100vh - 24rem), a guess at the height of everything above it. The guess ran about
 * eighty pixels short, and eighty pixels is a whole event slot: with six week rows at 69px the grid could
 * fit one event per day and collapsed the rest into "+3 more", so most of a busy month was a column of
 * links to things you could not see. !important stays, to beat the inline height FullCalendar writes. */
#cleaningCalendar {
	height: 100% !important;
	min-height: 30rem;
}

/* calendar.css strips the border off every event (.fc-h-event { border: none }), which would leave the
   borderColor the server sets inert. It is put back here because it is the only thing separating two events
   of the same state stacked in one day cell from reading as a single block - the colour comes from
   FullCalendar's inline border-color, which is why no colour is named. */
.fc .cleaning-event {
	border: 1px solid;
	border-radius: 0.35rem;
	padding: 0.1rem 0.3rem;
	overflow: hidden;
	cursor: pointer;
}

/* Nothing to open, so it does not offer to be opened. */
.fc .cleaning-event-projected { cursor: default; }

.fc .cleaning-event .cleaning-event-body {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	overflow: hidden;
}

.fc .cleaning-event .cleaning-event-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* The second line is context, so it steps back from the title rather than competing with it. Softened by
   opacity rather than given a colour of its own, which keeps it legible on all four pill backgrounds without
   a second palette to keep in step with the first. */
.fc .cleaning-event .cleaning-event-meta {
	display: flex;
	align-items: baseline;
	gap: 0.3rem;
	overflow: hidden;
	opacity: 0.8;
	font-size: var(--font-size-small);
}

/* Cleaned / Due / Planned / Skipped. The tag is on the event because colour alone cannot separate the kinds -
   an overdue schedule and a rejected record are legitimately the same red.
 *
 * Sentence case, not tracked-out capitals. Weight and size already separate it from the detail beside it,
 * and the house rule against all-caps micro-labels applies hardest here: on a full month the old treatment
 * put forty tracked-out capitalised words on one screen, which reads as shouting rather than as labelling. */
.fc .cleaning-event .cleaning-event-kind {
	flex: 0 0 auto;
	font-size: 0.68rem;
	font-weight: 700;
}

.fc .cleaning-event .cleaning-event-detail {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* A projected occurrence is arithmetic, not a commitment: it assumes every clean before it happens on its due
   date, and recording one re-anchors the whole sequence. Dashed and faded so it never reads as firmly as the
   occurrence that is actually owed. */
.fc .cleaning-event-projected {
	border-style: dashed;
	opacity: 0.72;
}

/* A skip is a decision that was taken, not one still to take - struck through so a month of them reads as a
   run of cleans that did not happen rather than as a run of cleans. */
.fc .cleaning-event-skip .cleaning-event-title {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

/* In list view FullCalendar renders its own row chrome and puts eventContent in the title cell, where a
   stacked two-line body just adds height - the row already has a date column doing that job. */
.fc .fc-list-event .cleaning-event-body {
	flex-direction: row;
	align-items: baseline;
	gap: 0.5rem;
}

/* A month cell gets one line per event, for the same reason.
 *
 * Two lines halved how many events a day could show, and a day grid answers "how many, and are they late"
 * before it answers "which ones": at six week rows the second line took a busy week down to a single event
 * with everything else behind "+3 more", so most of a real month was links to things nobody could see. The
 * detail was unreadable there anyway - about four words before it ellipsed - and it survives on the event's
 * tooltip, in list view, and on the record the event opens. */
.fc .fc-daygrid-event .cleaning-event-body {
	flex-direction: row;
	align-items: baseline;
	gap: 0.35rem;
}

.fc .fc-daygrid-event .cleaning-event-detail { display: none; }

/* The title takes the slack so the kind tag is never the thing that gets truncated - it is one word and it
   is the part that says whether this is a plan, a clean or a miss. */
.fc .fc-daygrid-event .cleaning-event-title { flex: 1 1 auto; min-width: 0; }
.fc .fc-daygrid-event .cleaning-event-meta { flex: 0 0 auto; }

/* ============================ The record ============================ */

/* One record, at two sizes.
 *
 * data-preview="true" is the panel above the records table, where the record is a peek at the row just
 * clicked; false is the record's own URL, where somebody has arrived cold. The preview is not a smaller
 * version of the page - it stops after the exceptions, because the question it answers is "is this worth
 * opening" and a full line table would push the table it belongs to off the screen. */
cleaning-record {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
	padding: 1.5rem;
	border-radius: 1rem;
	background: var(--blue-gray);
	box-shadow: var(--soft-continer-outer-shadow);
}

/* Inside the records page the chrome and the table already set the page's padding, and the panel sits in a
   container of its own - so the sheet drops its outer frame rather than nesting a card in a card. */
cleaning-record[data-preview="true"] {
	padding: 1.1rem 1.25rem;
	gap: 0.85rem;
	box-shadow: none;
	background: transparent;
}

/* The record's own page keeps the module chrome above it, so the sheet is what scrolls. */
cleaning-record[data-preview="false"] {
	margin: 1.5rem 1.5rem 0 1.5rem;
}

record-masthead {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--border-color);
}

record-identity {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

/* The one typographic move on this page. This code is the string somebody reads off a printed sheet and
   matches against a screen character by character, so it gets tabular figures - proportional digits make
   CLN-A11K and CLN-AI1K the same width and the same shape. */
record-code {
	font-size: var(--font-size-large);
	font-weight: 650;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--global-font-color);
}

record-verbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
	flex: 0 0 auto;
}

/* ---- The attestation strip ----
 *
 * The element this screen is built around, and the only place on the page that raises its voice.
 *
 * A cleaning record is not evidence because of what it claims happened - it is evidence because a second
 * named person read it and signed. Neither signature carries the one fact that says whether that check was
 * real: the gap between them. So the two are laid out as what they are, a sequence of two acts, with the
 * elapsed time on the rule that joins them.
 *
 * Two columns and a connector rather than a list, because the connector is the data. On a phone it becomes
 * one column and the rule turns vertical, which is the same statement rotated. */
record-attestation {
	display: grid;
	/* The connector gets a track of its own rather than sizing to the words on it. On auto it collapsed to
	   exactly the width of "open just now" plus its padding, leaving about a pixel of rule either side - so
	   the one element the strip is built around was invisible on every record. */
	grid-template-columns: 1fr 13rem 1fr;
	align-items: stretch;
	gap: 0;
	/* Capped, because this is a compact object rather than a band. Left to fill a 1280px pane the two
	   signatures sit half a screen apart with three short lines in each, and the rule between them stops
	   reading as a connector joining two acts and starts reading as the empty space between two labels -
	   which is the opposite of what it is there to say. */
	max-width: 58rem;
}

attestation-step {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--border-color);
	border-radius: 0.75rem;
	background: var(--blue-gray);
	min-width: 0;
}

/* An unsigned record is unfinished, and the shape of what is missing is a signature - so the empty slot is
   drawn as an empty slot rather than as a filled card with a dash in it. */
attestation-step[data-state="open"] {
	border-style: dashed;
	background: transparent;
}

attestation-step[data-state="rejected"] {
	border-color: var(--soft-danger-red);
}

step-role {
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

step-name {
	font-weight: 650;
	color: var(--global-font-color);
	overflow-wrap: anywhere;
}

attestation-step[data-state="open"] step-name {
	font-weight: 500;
	color: var(--light-global-font-color);
}

step-when {
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* The connector, and the lag written on it. This is the fact the page exists to make visible: a sign-off five
   months after the work is a control in name only, and until now there was nowhere on this screen it showed. */
attestation-gap {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0 0.6rem;
	min-width: 0;
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
	white-space: nowrap;
}

/* Drawn as a border rather than a filled box so the unsigned variant below can dash it. */
attestation-gap::before,
attestation-gap::after {
	content: "";
	flex: 1 1 1.25rem;
	height: 0;
	border-top: 1px solid var(--border-color);
}

/* A chain that has been started and not finished, drawn the way its empty slot is drawn. The rule is the
   record's claim that a second signature is coming; on an unsigned one that claim is still outstanding, and
   a solid line would say the opposite. */
attestation-gap[data-open="true"]::before,
attestation-gap[data-open="true"]::after {
	border-top-style: dashed;
}

/* ---- Callouts ---- */

/* Lifted out of the stop table rather than left to be found in it. On a twenty-stop walk the one blocked
   drain is a row like any other, and it is the only row that changes what the person signing should do. */
record-callout {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.9rem 1.1rem;
	border-left: 3px solid var(--border-color);
	border-radius: 0 0.6rem 0.6rem 0;
	background: var(--background-white);
}

record-callout[data-tone="attention"] { border-left-color: var(--orange); }
record-callout[data-tone="danger"] { border-left-color: var(--darker-danger-red); }

record-callout strong { color: var(--global-font-color); }

record-exception-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

record-exception {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

record-exception > span { min-width: 0; }

record-exception-overflow {
	font-size: var(--font-size-small);
	color: var(--light-global-font-color);
}

/* ---- Facts, sections, evidence, corrections ---- */

/* Three columns, fixed, with room for one of the facts to take the whole width.
 *
 * auto-fit gave each of the four facts an identical quarter of the pane, which is only right if the four
 * hold the same kind of value. They do not: three are short figures and the fourth is the room list, so a
 * twelve-room walk wrapped onto three lines inside a column of 370px while "24 recorded" sat beside it in
 * a column of the same width it did not need. */
record-facts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.85rem 1.5rem;
}

/* A list rather than a figure, so it gets the row to itself and reads as one line. */
record-fact[data-wide] {
	grid-column: 1 / -1;
}

record-fact {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

record-fact strong {
	color: var(--global-font-color);
	overflow-wrap: anywhere;
}

record-section {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border-color);
}

record-section h4 {
	margin: 0;
	font-size: var(--font-size-medium);
}

/* The only free prose on the record, so it gets a measure. Past about 70 characters a line the eye starts
   losing its place returning to the left edge, and a comment box is exactly where that happens. */
record-prose {
	display: block;
	max-width: 68ch;
	white-space: pre-line;
	color: var(--light-global-font-color);
	line-height: 1.55;
}

record-evidence-list {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

record-evidence-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
}

record-evidence-item a { color: var(--link-blue); }

record-correction-list {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

/* Append-only, and shown as such. A record whose corrections are invisible is one that quietly claims it
   always said this. */
record-correction {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.75rem 0.9rem;
	border-left: 2px solid var(--border-color);
	border-radius: 0 0.5rem 0.5rem 0;
	background: var(--background-white);
}

/* ============================ Record details ============================ */

/* The modal a verifier reads before signing. Facts, then what was cleaned, then what it was cleaned with -
   the order somebody checks them in, rather than the order the fields happen to sit on the model. */
.cleaning-details .modal-content {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	min-width: min(56rem, 80vw);
}

details-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 0.75rem 1.5rem;
	padding: 0.9rem 1rem;
	border-radius: 0.75rem;
	background: var(--blue-gray);
}

details-fact {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
	font-size: var(--font-size-small);
}

details-fact strong {
	font-size: var(--font-size-normal);
	overflow: hidden;
	text-overflow: ellipsis;
}

details-section {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

details-section h4 {
	margin: 0;
	font-size: var(--font-size-medium);
}

/* Prose the operator wrote, presented as prose. A comment in a readonly <textarea> is a scroll box the reader
   has to drag through, which is how a note explaining why a room was skipped goes unread. */
details-prose {
	display: block;
	max-width: 70ch;
	padding: 0.6rem 0.8rem;
	border-left: 2px solid var(--border-color);
	border-radius: 0 0.4rem 0.4rem 0;
	background: var(--blue-gray);
	line-height: 1.55;
	white-space: pre-line;
}

details-prose[data-tone="danger"] {
	border-left-color: var(--danger-red);
}

/* ============================ Phone ============================ */

/* ============================ The walk, on a bigger screen ============================ */

/* The walk is designed phone-first and stays a single column, because the stops are a route through a
   building and reading order is the point. What it should not do is render that column at phone width in the
   middle of a monitor: at 1600px the stops occupied 630px and the two-thirds either side were empty, which
   reads as a mobile screen someone forgot to lay out.
   
   So from tablet landscape up the measure widens and each stop turns sideways - identity and instruction on
   the left, the four answers on the right, at the width they already cap at. The outcome targets keep their
   3rem height, because a walk is walked with gloves on whatever it is being walked with. */
@media (min-width: 64rem) {
	cleaning-run-header run-header-inner,
	run-body,
	cleaning-run-footer run-footer-inner {
		width: min(76rem, 100%);
	}

	cleaning-run-page cleaning-stop {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"head    outcome"
			"guide   outcome"
			"detail  detail";
		align-items: start;
		column-gap: 1.5rem;
	}

	cleaning-run-page cleaning-stop-head { grid-area: head; }
	cleaning-run-page cleaning-stop-instructions { grid-area: guide; margin: 0; }

	cleaning-run-page cleaning-outcome-choice {
		grid-area: outcome;
		width: 26rem;
		max-width: 100%;
	}

	cleaning-run-page .cleaning-stop-detail { grid-area: detail; }

	/* The detail pane has the whole width to itself once the answers have moved out of the column, so the
	   note and the two measurements sit on one line instead of stacking under a 30rem cap meant for a phone. */
	cleaning-run-page .cleaning-stop-detail-body { max-width: none; }

	cleaning-run-page .cleaning-stop-detail-body > form-field textarea { max-width: 46rem; }
}

@media (max-width: 48rem) {
	cleaning-dashboard,
	cleaning-schedules-page,
	cleaning-tasks-page,
	cleaning-builder-page,
	cleaning-records-page {
		padding: 1rem 0.75rem;
		gap: 1.25rem;
	}

	/* The tools drop below the sentence rather than competing with it for a line that is already two lines
	   long on a phone. */
	register-tools {
		width: 100%;
		flex-wrap: wrap;
	}

	/* The chain turns vertical, which is the same statement rotated: the rule still runs between the two
	   parties and still carries the gap, it just runs down instead of across. Squeezing two names and an
	   elapsed time into a phone width leaves all three truncated and none of them readable. */
	entry-chain {
		flex-direction: column;
		align-items: stretch;
		gap: 0.4rem;
	}

	chain-rule {
		flex: 0 0 auto;
		flex-direction: column;
		gap: 0.3rem;
		align-items: flex-start;
		padding-left: 0.5rem;
	}

	chain-rule::before,
	chain-rule::after {
		flex: 0 0 0.7rem;
		width: 1px;
		border-top: 0;
		border-left: 1px solid var(--border-color);
	}

	entry-chain[data-weight="slow"] chain-rule::before,
	entry-chain[data-weight="slow"] chain-rule::after {
		border-left-color: var(--light-global-font-color);
	}

	entry-chain[data-weight="late"] chain-rule::before,
	entry-chain[data-weight="late"] chain-rule::after {
		border-left: 2px solid var(--global-font-color);
	}

	register-entry[data-state="open"] chain-rule::before,
	register-entry[data-state="open"] chain-rule::after {
		border-left-style: dashed;
	}

	/* The pill has no row of its own to sit at the end of once the head line wraps, so it returns to reading
	   order rather than floating to a right edge that is no longer there. */
	entry-head status-pill { margin-left: 0; }

	entry-verb button { width: 100%; }

	cleaning-record[data-preview="false"] {
		margin: 0 0.75rem 1rem;
		padding: 1.1rem;
	}

	/* The attestation strip turns vertical rather than squeezing two signatures into half a phone each - the
	   same statement rotated, with the connector still carrying the gap between them. */
	record-attestation { grid-template-columns: minmax(0, 1fr); }

	attestation-gap {
		flex-direction: column;
		padding: 0.4rem 0;
	}

	attestation-gap::before,
	attestation-gap::after {
		flex: 0 0 0.75rem;
		width: 0;
		height: auto;
		border-top: 0;
		border-left: 1px solid var(--border-color);
		animation: none;
	}

	attestation-gap[data-open="true"]::before,
	attestation-gap[data-open="true"]::after {
		border-left-style: dashed;
	}

	record-facts { grid-template-columns: minmax(0, 1fr); }

	record-masthead { flex-direction: column; }

	/* .page-header does not wrap, so on a phone the title cluster and the action cluster overflowed the row
	   and "Go back" was pushed off the screen entirely - on the one screen size where a way out matters most. */
	/* Tracks the frames' reduced padding above, so the chrome and the sheet keep sharing an edge on a phone. */
	#main > cleaning-chrome {
		padding: 1rem 0.75rem 0;
	}

	cleaning-chrome .page-header {
		flex-wrap: wrap;
		row-gap: 0.5rem;
	}

	cleaning-chrome .page-header row-layout {
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	cleaning-nav {
		align-self: stretch;
		margin: 0;
		overflow-x: auto;
		flex-wrap: nowrap;
	}

	cleaning-nav button { white-space: nowrap; }

	cleaning-schedule-row,
	cleaning-recent-row {
		grid-template-columns: minmax(0, 1fr);
		flex-direction: column;
		align-items: stretch;
	}

	/* The row's four columns stack. The state stays first, because on a narrow screen the question is still
	   "which of these is late" before it is "what is this one called". */
	schedule-list-row {
		grid-template-columns: minmax(0, 1fr);
		align-items: stretch;
		gap: 0.6rem;
	}

	schedule-row-actions { justify-content: space-between; }

	/* The due date drops under the schedule name rather than fighting a name, a code and a tally for the same
	   line - on a phone that row is what pushes the code chip off the panel. */
	skip-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.15rem;
	}

	.schedule-actions { justify-content: space-between; }

	recent-when { text-align: left; }

	/* Four labels do not fit across a phone; two rows of two stay thumb-sized instead of shrinking. */
	sl-radio-group.cleaning-outcome-group[separated-buttons]::part(button-group__base) {
		grid-template-columns: repeat(2, 1fr);
	}

	/* The capture dialog returns to one column and to sizing itself. Two panes side by side is a desk shape,
	   and a fixed-height box taller than the viewport is a scroll area inside a scroll area. */
	.modal-body.cleaning-capture {
		width: 100%;
		height: auto;
		max-height: 92%;
		padding: 1.25rem;
	}

	.cleaning-capture .modal-content { overflow-y: auto; }

	/* The dialog scrolls as one on a phone rather than holding two panes at a fixed height, so the panes are
	   sized by their content instead of by what is left over. */
	.cleaning-capture form { flex: 0 0 auto; }

	capture-panes {
		grid-template-columns: minmax(0, 1fr);
		gap: 1rem;
		flex: 0 0 auto;
	}

	/* The submit stays reachable while the form is scrolled, the same way the walk's footer does. */
	capture-footer {
		position: sticky;
		bottom: 0;
		background: var(--background-white);
	}

	capture-session {
		padding-right: 0;
		padding-bottom: 1rem;
		border-right: 0;
		border-bottom: 1px solid var(--border-color);
		overflow: visible;
	}

	capture-stops cleaning-stop-list { overflow: visible; }

	/* A 12rem scroll region nested inside a scrolling dialog is two scrollbars competing for one thumb. */
	capture-products {
		max-height: none;
		overflow: visible;
	}

	/* The schedule name is the one thing that says which walk this is, so it wraps rather than truncating
	   once there is no room for it on one line. */
	cleaning-run-header h2.truncate-single-line { white-space: normal; }

	.cleaning-details .modal-content { min-width: 0; }

	cleaning-roster-row {
		grid-template-columns: auto minmax(0, 1fr);
		row-gap: 0.5rem;
	}

	/* The cap comes off at this width. Twelve chips one or two to a line is five or six rows, which would
	   otherwise scroll inside a page that is already scrolling - and a nested scroller is how half the
	   building ends up unreachable with no sign that there is more. */
	cleaning-room-picker picker-track {
		max-height: none;
		overflow-y: visible;
	}

	cleaning-run-footer run-footer-inner {
		flex-direction: column;
		align-items: stretch;
	}

	/* Both templates, because the attribute selector above outranks the bare element and would otherwise keep
	   four columns on a phone. */
	run-footer-fields,
	run-footer-fields[data-equipment="true"] { grid-template-columns: minmax(0, 1fr); }

	schedule-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================ Motion ============================ */

/* Three moments, and nothing else in the module moves.
 *
 * 1. The walk arrives in walk order. SortOrder is a physical route through a building, so revealing the
 *    stops in sequence states the one thing the numbers are there to say. It is the only page-load
 *    animation in cleaning, and it is on the only screen where the order of the content is the content.
 * 2. A stop that appears because somebody just picked a room animates in; the ones already on screen do
 *    not. That is motion answering an action rather than decorating a redraw - cleaning.js rebuilds the
 *    whole list on every change, and re-animating every row each time would be a flicker, not feedback.
 * 3. The detail drawer opens rather than snapping, because a note box appearing instantly under a thumb is
 *    indistinguishable from the card having jumped.
 *
 * There is deliberately no entrance on the dashboard, the register or the schedule cards. Fade-and-rise on
 * every list is the house style of software that has nothing to say. */

@keyframes cleaning-stop-in {
	from {
		opacity: 0;
		transform: translateY(0.4rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* --stop-index is the row's position in the walk, set where the row is rendered. Capped at 12 so a
   thirty-stop schedule does not spend three seconds arriving - past a dozen the sequence has been read. */
cleaning-run-page cleaning-stop {
	animation: cleaning-stop-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
	animation-delay: calc(min(var(--stop-index, 0), 12) * 35ms);
}

/* Set on rows that were not in the list before the change that rebuilt it - the ad-hoc list is re-rendered
   whole on every room pick, so animating all of it would flicker the pane instead of answering the action. */
capture-stops cleaning-stop[data-new="true"] {
	animation: cleaning-stop-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1) backwards;
}

/* Pressed-state feedback, which is the only confirmation a gloved thumb gets - there is no hover on the
   screen this control was sized for. */
sl-radio-group.cleaning-outcome-group sl-radio-button::part(button):active { transform: scale(0.97); }

/* The drawer's contents arrive rather than appearing. <details> snaps its own height either way, so this is
   not a height animation - it is what makes the card growing read as the drawer opening rather than as the
   list having jumped under the thumb. */
.cleaning-stop-detail[open] > .cleaning-stop-detail-body {
	animation: cleaning-drawer-open 0.22s ease-out;
}

@keyframes cleaning-drawer-open {
	from {
		opacity: 0;
		transform: translateY(-0.3rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* The summary marker turns with the drawer, so the control says which way it is going. */
.cleaning-stop-detail summary {
	list-style: none;
	display: flex;
	align-items: center;
}

.cleaning-stop-detail summary::-webkit-details-marker { display: none; }

.cleaning-stop-detail summary::before {
	content: "";
	display: inline-block;
	width: 0.35rem;
	height: 0.35rem;
	margin-right: 0.5rem;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(-45deg) translate(-0.1rem, -0.1rem);
	transition: transform 0.2s ease;
}

.cleaning-stop-detail[open] summary::before {
	transform: rotate(45deg) translate(-0.05rem, -0.05rem);
}

/* The rule between the two signatures draws itself, once, on the record it belongs to.
 *
 * The single most deliberate piece of motion in the module, and it earns its place: the strip's whole claim
 * is that a record becomes evidence when a second person signs it, and the connector is the sentence that
 * says so. Drawing it makes the reader watch the join being made. An unsigned record does not animate -
 * there is nothing yet to join. */
record-attestation:has(attestation-gap + attestation-step:not([data-state="open"])) attestation-gap::before,
record-attestation:has(attestation-gap + attestation-step:not([data-state="open"])) attestation-gap::after {
	animation: attestation-draw 0.5s 0.15s ease-out backwards;
}

@keyframes attestation-draw {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

attestation-gap::before { transform-origin: right center; }
attestation-gap::after { transform-origin: left center; }

@media (prefers-reduced-motion: reduce) {
	cleaning-nav button,
	cleaning-recent-row,
	register-entry,
	.cleaning-stop-detail summary::before,
	cleaning-progress-fill { transition: none; }

	sl-radio-group.cleaning-outcome-group sl-radio-button::part(button) { transition: none; }

	cleaning-run-page cleaning-stop,
	capture-stops cleaning-stop[data-new="true"],
	.cleaning-stop-detail[open] > .cleaning-stop-detail-body,
	attestation-gap::before,
	attestation-gap::after { animation: none; }

	sl-radio-group.cleaning-outcome-group sl-radio-button::part(button):active { transform: none; }
}

/* ============================ Last cleaned, on the room cards ============================ */

/* Quiet by default. This is context on a card whose job is navigation, so it only raises its voice once the
 * gap is long enough that somebody should look - and never turns red, because a room can be legitimately
 * uncleaned for a fortnight and a card cannot know the schedule. */
.room-last-cleaned {
	color: var(--light-global-font-color);
}

.room-last-cleaned[data-stale="True"] {
	color: var(--orange);
}
