/**
 * The calendar's look (docs/CONTRACT.md section 12.4 and 12.7): every colour and size is a `--rc-*` property, which
 * takes the chrome's tokens in the admin (`.rooster-calendar--admin`) and neutral values on the front, where a product
 * or a theme sets them. FullCalendar's sheet (assets/build/calendar.css, handle rooster-calendar-lib, loaded before
 * this one) lays the grid out: its palette is these properties, and its parts carry our own class names (config.js).
 * 1.1.0, the owner's "very pale, very subtle": an event is a wash with its tone's ink and one stronger colour, its
 * start edge; nothing is a solid fill; today is said by its number, as the library's date calendar says it; the
 * toolbar is the library's outline button. Then cancelled, the marks, 24 px targets (WCAG 2.5.8), the skip link and
 * the live region, the controls, the legend, the notice line, the details dialog, the phone layout, forced colours and
 * print. Plain CSS, our own rules only, held by the library's stylelint and prettier.
 */

.rooster-calendar {
	/* The front's values; a product or a theme sets its own on the container or above it. */
	--rc-card: #fff;
	--rc-card-fg: #18181b;
	--rc-muted: #f4f4f5;
	--rc-muted-fg: #52525b;
	--rc-faint-fg: #71717a;
	--rc-border: #e4e4e7;
	--rc-control: #d4d4d8;
	--rc-accent: #1e63ce;
	--rc-accent-fg: #fff;
	--rc-ring: var(--rc-accent);
	--rc-now: #b42318;
	--rc-radius: 6px;
	--rc-radius-badge: 999px;
	--rc-text-xs: 0.75rem;
	--rc-text-sm: 0.875rem;
	--rc-text-base: 1rem;
	--rc-font: inherit;
	--rc-shadow: 0 10px 30px rgb(0 0 0 / 18%);

	/* A tint that is only just there: today's column, a selection. */
	--rc-tint: color-mix(in srgb, var(--rc-card-fg) 3%, var(--rc-card));

	/* The tones. Each has one strong colour (`-edge`: an event's start edge, its dot, its swatch); its wash (the fill)
	   and its ink (the text on the wash, at least 4.5:1) come from it and the card, so both schemes follow. */
	--rc-tone-primary-edge: var(--rc-accent);
	--rc-tone-success-edge: #067647;
	--rc-tone-warning-edge: #b54708;
	--rc-tone-destructive-edge: #b42318;
	--rc-tone-info-edge: #6941c6;
	--rc-tone-mono-edge: #71717a;
	--rc-tone-primary: color-mix(in srgb, var(--rc-tone-primary-edge) 7%, var(--rc-card));
	--rc-tone-primary-on: color-mix(in srgb, var(--rc-tone-primary-edge) 55%, var(--rc-card-fg));
	--rc-tone-success: color-mix(in srgb, var(--rc-tone-success-edge) 7%, var(--rc-card));
	--rc-tone-success-on: color-mix(in srgb, var(--rc-tone-success-edge) 55%, var(--rc-card-fg));
	--rc-tone-warning: color-mix(in srgb, var(--rc-tone-warning-edge) 7%, var(--rc-card));
	--rc-tone-warning-on: color-mix(in srgb, var(--rc-tone-warning-edge) 55%, var(--rc-card-fg));
	--rc-tone-destructive: color-mix(in srgb, var(--rc-tone-destructive-edge) 7%, var(--rc-card));
	--rc-tone-destructive-on: color-mix(in srgb, var(--rc-tone-destructive-edge) 55%, var(--rc-card-fg));
	--rc-tone-info: color-mix(in srgb, var(--rc-tone-info-edge) 7%, var(--rc-card));
	--rc-tone-info-on: color-mix(in srgb, var(--rc-tone-info-edge) 55%, var(--rc-card-fg));
	--rc-tone-mono: var(--rc-muted);
	--rc-tone-mono-on: var(--rc-muted-fg);

	/* The hues (1.1.1): colours that mean nothing by themselves, for what a product sorts by kind beside what it tones
	   by state. None is a tone's colour, so a calendar coloured by kind never reads as its states. Each has its strong
	   colour in both schemes (3:1 on the card); its wash and its ink come from it and the card, as a tone's. */
	--rc-tone-sky-edge: light-dark(#0284c7, #38bdf8);
	--rc-tone-teal-edge: light-dark(#0d9488, #2dd4bf);
	--rc-tone-rose-edge: light-dark(#db2777, #f472b6);
	--rc-tone-orange-edge: light-dark(#ea580c, #fb923c);
	--rc-tone-sky: color-mix(in srgb, var(--rc-tone-sky-edge) 8%, var(--rc-card));
	--rc-tone-sky-on: color-mix(in srgb, var(--rc-tone-sky-edge) 55%, var(--rc-card-fg));
	--rc-tone-teal: color-mix(in srgb, var(--rc-tone-teal-edge) 8%, var(--rc-card));
	--rc-tone-teal-on: color-mix(in srgb, var(--rc-tone-teal-edge) 55%, var(--rc-card-fg));
	--rc-tone-rose: color-mix(in srgb, var(--rc-tone-rose-edge) 8%, var(--rc-card));
	--rc-tone-rose-on: color-mix(in srgb, var(--rc-tone-rose-edge) 55%, var(--rc-card-fg));
	--rc-tone-orange: color-mix(in srgb, var(--rc-tone-orange-edge) 8%, var(--rc-card));
	--rc-tone-orange-on: color-mix(in srgb, var(--rc-tone-orange-edge) 55%, var(--rc-card-fg));
	--rc-cancelled: var(--rc-muted);
	--rc-cancelled-on: var(--rc-muted-fg);

	/* FullCalendar's palette: ours, and nothing of it a solid colour. */
	--fc-classic-primary: var(--rc-tint);
	--fc-classic-primary-foreground: var(--rc-card-fg);
	--fc-classic-event: var(--rc-tone-mono);
	--fc-classic-event-contrast: var(--rc-tone-mono-on);
	--fc-classic-background: var(--rc-card);
	--fc-classic-foreground: var(--rc-card-fg);
	--fc-classic-muted-foreground: var(--rc-muted-fg);
	--fc-classic-faint-foreground: var(--rc-faint-fg);
	--fc-classic-faint: var(--rc-tint);
	--fc-classic-muted: var(--rc-muted);
	--fc-classic-border: var(--rc-border);
	--fc-classic-strong-border: var(--rc-border);
	--fc-classic-today: var(--rc-tint);
	--fc-classic-highlight: var(--rc-tint);
	--fc-classic-now: var(--rc-now);
	--fc-classic-button: var(--rc-card);
	--fc-classic-button-border: var(--rc-control);
	--fc-classic-button-foreground: var(--rc-card-fg);
	--fc-classic-button-strong: var(--rc-muted);
	--fc-classic-button-strong-border: var(--rc-control);
	--fc-classic-button-outline: var(--rc-ring);
	position: relative;
	color: var(--rc-card-fg);
	font-family: var(--rc-font);
}

/* The admin: the chrome's tokens (light and dark follow its look). A wash is the chrome's own where it has one
   (success, info, warning's soft, the muted grey), else 6 % of the tone over the card; an ink is the chrome's ink for
   that wash (utilities.css, the ra-tone-* utilities). */
.rooster-calendar--admin {
	--rc-card: var(--ra-card, #fff);
	--rc-card-fg: var(--ra-card-foreground, #09090b);
	--rc-muted: var(--ra-muted, #f4f4f5);
	--rc-muted-fg: var(--ra-secondary-foreground, #52525b);
	--rc-faint-fg: var(--ra-secondary-foreground, #52525b);
	--rc-border: var(--ra-border, #e4e4e7);
	--rc-control: var(--ra-input, #e4e4e7);
	--rc-accent: var(--ra-accent, #2271b1);
	--rc-accent-fg: var(--ra-accent-on, #fff);
	--rc-now: var(--ra-destructive, #d63638);
	--rc-radius: var(--ra-radius-md, 6px);
	--rc-radius-badge: var(--ra-shape-badge, var(--ra-radius-md, 6px));
	--rc-text-xs: var(--ra-text-xs, 0.75rem);
	--rc-text-sm: var(--ra-text-sm, 0.8125rem);
	--rc-text-base: var(--ra-text-base, 0.875rem);
	--rc-font: var(--ra-font-sans, inherit);
	--rc-shadow: var(--ra-shadow-modal, 0 10px 30px rgb(0 0 0 / 18%));
	--rc-tone-primary-edge: var(--ra-primary, #3b82f6);
	--rc-tone-primary: color-mix(in srgb, var(--ra-primary, #3b82f6) 6%, var(--rc-card));
	--rc-tone-primary-on: var(--ra-primary-soft-foreground, #1e40af);
	--rc-tone-success-edge: var(--ra-success, #16a34a);
	--rc-tone-success: var(--ra-success-wash, #f0fdf4);
	--rc-tone-success-on: var(--ra-success-foreground, #166534);
	--rc-tone-warning-edge: var(--ra-warning, #d97706);
	--rc-tone-warning: var(--ra-warning-soft, #fff8e8);
	--rc-tone-warning-on: var(--ra-warning-soft-foreground, #c2410c);
	--rc-tone-destructive-edge: var(--ra-destructive, #d63638);
	--rc-tone-destructive: color-mix(in srgb, var(--ra-destructive, #d63638) 6%, var(--rc-card));
	--rc-tone-destructive-on: var(--ra-destructive-foreground, #b62e30);
	--rc-tone-info-edge: var(--ra-info, #6d28d9);
	--rc-tone-info: var(--ra-info-wash, #f5f3ff);
	--rc-tone-info-on: light-dark(
		color-mix(in srgb, var(--ra-info, #6d28d9) 75%, black),
		color-mix(in srgb, var(--ra-info, #8b5cf6) 60%, white)
	);
	--rc-tone-mono-edge: var(--ra-control-border, #85858e);
}

.rooster-calendar__mount a,
.rooster-calendar__mount button,
.rooster-calendar__mount [role="button"] {
	min-height: 24px;
	min-width: 24px;
}

/* The toolbar: the library's outline button (its recipe's sizes and tokens; kit/buttons.css), the view in use its
   "on" look. Each keeps its own corners (FullCalendar squares the joined edges of a group). */
.rooster-calendar .rooster-calendar__button {
	min-height: 32px;
	padding: 4px 12px;
	border: 1px solid var(--rc-control);
	border-radius: var(--rc-radius) !important;
	background: var(--rc-card);
	color: var(--rc-card-fg);
	font-size: var(--rc-text-sm);
	font-weight: 600;
	line-height: 1.3;
}

.rooster-calendar .rooster-calendar__button:hover {
	background: var(--rc-muted);
}

/* The view in use. Its words are the accent a fifth of the way to the card's text: the accent itself, which reads on
   the card, fell just under 4.5:1 on its own tint (Rooster One's purple: 4.48; 1.1.1). */
.rooster-calendar .rooster-calendar__button:is([aria-pressed="true"], [aria-selected="true"]) {
	border-color: var(--rc-accent);
	background: color-mix(in srgb, var(--rc-accent) 8%, var(--rc-card));
	color: color-mix(in srgb, var(--rc-accent) 80%, var(--rc-card-fg));
}

.rooster-calendar .rooster-calendar__button:focus-visible {
	outline: 2px solid var(--rc-ring);
	outline-offset: 2px;
}

.rooster-calendar .rooster-calendar__button + .rooster-calendar__button {
	margin-inline-start: 6px;
}

/* The grid's words, on the chrome's type scale: the period, a weekday, a day's number, an hour, "+n more". */
.rooster-calendar .rooster-calendar__period {
	font-size: var(--rc-text-base);
	font-weight: 600;
	line-height: 1.4;
}

.rooster-calendar .rooster-calendar__weekday,
.rooster-calendar .rooster-calendar__hour,
.rooster-calendar .rooster-calendar__more {
	color: var(--rc-muted-fg);
	font-size: var(--rc-text-xs);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.rooster-calendar .rooster-calendar__daynumber {
	color: var(--rc-card-fg);
	font-size: var(--rc-text-xs);
	font-variant-numeric: tabular-nums;
}

.rooster-calendar .rooster-calendar__daynumber.is-other {
	color: var(--rc-faint-fg);
}

/* Today: its number and its weekday say it (bold, underlined), not a colour. */
.rooster-calendar .is-today:is(.rooster-calendar__daynumber, .rooster-calendar__weekday) {
	color: var(--rc-card-fg);
	font-weight: 700;
	text-decoration: underline 2px;
	text-underline-offset: 4px;
}

.rooster-calendar .rooster-calendar__listday {
	font-size: var(--rc-text-sm);
	font-weight: 600;
}

/* An event. A bar and a box on the time grid are a wash with the tone's ink and one stronger colour, the start edge. */
.rooster-calendar .rooster-calendar__event {
	border-radius: calc(var(--rc-radius) - 2px);
	font-size: var(--rc-text-xs);
	line-height: 1.4;
}

.rooster-calendar .rooster-calendar__event:is(.rooster-calendar__event--bar, .rooster-calendar__event--box) {
	overflow: hidden;
	border-color: transparent;
	border-inline-start: 3px solid var(--rc-edge, var(--rc-tone-mono-edge));
}

/* Its words stay inside it: one line and an ellipsis (the whole text is its tooltip); a tall box and a line of the
   list may wrap. */
.rooster-calendar .rooster-calendar__inner {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rooster-calendar :is(.rooster-calendar__event--bar, .rooster-calendar__event--box) .rooster-calendar__inner {
	padding-inline: 4px;
}

.rooster-calendar
	:is(.rooster-calendar__event--box:not(.is-short), .rooster-calendar__event--row)
	.rooster-calendar__inner {
	white-space: normal;
}

/* A bar that began before this row, or runs past it: no edge and a mark where it comes from, square where it goes on. */
.rooster-calendar .rooster-calendar__event--bar.is-continued {
	border-inline-start-width: 0;
	border-start-start-radius: 0;
	border-end-start-radius: 0;
}

.rooster-calendar .rooster-calendar__event--bar.is-continuing {
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

.rooster-calendar__continued::before {
	content: "‹";
	margin-inline-end: 0.3em;
	color: var(--rc-edge, currentColor);
	font-weight: 700;
}

.rooster-calendar__continued:dir(rtl)::before {
	content: "›";
}

.rooster-calendar .rooster-calendar__dot {
	border-color: var(--rc-edge, var(--rc-tone-mono-edge));
}

.rooster-calendar__time {
	margin-inline-end: 0.35em;
	font-variant-numeric: tabular-nums;
}

.rooster-calendar .is-short .rooster-calendar__time {
	margin-inline: 0.35em 0;
}

/* A timed event in the month's grid: the dot and the time on the first row, the title on the second. */
.rooster-calendar .rooster-calendar__event--dot {
	flex-wrap: wrap;
	align-items: center;
	row-gap: 2px;
}

.rooster-calendar .rooster-calendar__event--dot > div:last-child {
	display: contents;
}

.rooster-calendar .rooster-calendar__event--dot .rooster-calendar__title {
	flex: 1 0 100%;
	min-width: 0;
}

.rooster-calendar__mark,
.rooster-calendar__cancelled {
	margin-inline-start: 0.35em;
	font-size: 0.85em;
	font-weight: 600;
}

.rooster-calendar__cancelled {
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* Cancelled: muted, struck through, and the word in the content and the name (never colour alone). */
.rooster-calendar .is-cancelled .rooster-calendar__title {
	text-decoration: line-through;
}

.rooster-calendar__skip:focus {
	position: absolute;
	top: 0;
	inset-inline-start: 0;
	z-index: 2;
	width: auto;
	height: auto;
	padding: 6px 10px;
	background: var(--rc-card);
	color: var(--rc-card-fg);
	/* stylelint-disable-next-line property-no-deprecated -- undoes WordPress's own .screen-reader-text */
	clip: auto;
	clip-path: none;
	outline: 2px solid var(--rc-ring);
}

.rooster-calendar__after {
	display: block;
	height: 0;
}

/* Until the library has measured its first rows: unseen, with what follows it, so nothing is seen to move. */
.rooster-calendar.is-settling .rooster-calendar__mount,
.rooster-calendar.is-settling .rooster-calendar__mount ~ * {
	visibility: hidden;
}

.rooster-calendar.is-ready [data-rc-calendar-fallback] {
	display: none;
}

.rooster-calendar__mount {
	max-width: 100%;
	overflow-x: hidden;
}

/* The controls: the zone switch and the "Colour by" choice. */
.rooster-calendar__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 0 0 12px;
	font-size: var(--rc-text-sm);
}

.rooster-calendar__zone-note {
	color: var(--rc-muted-fg);
}

.rooster-calendar__colour-by {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-inline-start: auto;
}

.rooster-calendar__colour-by > * {
	flex: none; /* the chrome's combobox takes its select's place beside the words */
}

.rooster-calendar__colour-by-label {
	font-weight: 600;
}

.rooster-calendar__select {
	min-height: 32px;
	padding: 2px 8px;
	border: 1px solid var(--rc-border);
	border-radius: var(--rc-radius);
	background: var(--rc-card);
	color: var(--rc-card-fg);
	font: inherit;
}

.rooster-calendar__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 24px;
}

.rooster-calendar__toggle-input {
	inline-size: 18px;
	block-size: 18px;
	margin: 0;
	accent-color: var(--rc-accent);
}

/* The legend of the colours in view, and the notice line. */
.rooster-calendar__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--rc-text-sm);
	color: var(--rc-muted-fg);
}

.rooster-calendar__legend[hidden],
.rooster-calendar__notice[hidden] {
	display: none;
}

.rooster-calendar__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.rooster-calendar__swatch {
	display: inline-block;
	width: 0.75em;
	height: 0.75em;
	border-radius: 2px;
	background-color: var(--rc-swatch, var(--rc-edge, currentColor));
}

.rooster-calendar__notice {
	margin: 8px 0 0;
	font-size: var(--rc-text-sm);
	color: var(--rc-muted-fg);
}

.rooster-calendar__notice.is-error {
	color: var(--rc-tone-destructive-on);
}

/* What a drop did (1.2.0): the sentence, then "Undo" beside it. */
.rooster-calendar__change {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	color: var(--rc-card-fg);
}

.rooster-calendar__change[hidden] {
	display: none;
}

/* An event being dragged (1.2.0): quiet. What moves under the pointer is the event as it is, lifted by a soft shadow
   and a hairline in its own edge colour (a stretch is drawn in the grid, `is-mirror`; a move is FullCalendar's copy of
   the event, which drag.js keeps in a home of the calendar's classes, `__dragging`, so the same tokens draw it); the
   days it would take are the grid's faint tint. An event shows only the grip of an edge it offers. */
.rooster-calendar .rooster-calendar__event.is-mirror,
.rooster-calendar__dragging > .rooster-calendar__event {
	outline: 1px solid var(--rc-edge, var(--rc-tone-mono-edge));
	box-shadow: 0 2px 8px color-mix(in srgb, var(--rc-card-fg) 14%, transparent);
	cursor: grabbing;
}

.rooster-calendar.rooster-calendar__dragging {
	position: static;
}

.rooster-calendar .is-fixed-start > .rooster-calendar__grip--start,
.rooster-calendar .is-fixed-end > .rooster-calendar__grip--end {
	display: none;
}

.rooster-calendar[aria-busy="true"] .rooster-calendar__event.is-movable {
	cursor: progress;
}

/* The tones, where one is named: its wash, its ink and its edge (an event's fill and text are FullCalendar's colour
   properties, set to the same; these are its edge and dot, the legend's swatch and the dialog's badges). */
.rooster-calendar .is-tone-primary {
	--rc-fill: var(--rc-tone-primary);
	--rc-ink: var(--rc-tone-primary-on);
	--rc-edge: var(--rc-tone-primary-edge);
}

.rooster-calendar .is-tone-success {
	--rc-fill: var(--rc-tone-success);
	--rc-ink: var(--rc-tone-success-on);
	--rc-edge: var(--rc-tone-success-edge);
}

.rooster-calendar .is-tone-warning {
	--rc-fill: var(--rc-tone-warning);
	--rc-ink: var(--rc-tone-warning-on);
	--rc-edge: var(--rc-tone-warning-edge);
}

.rooster-calendar .is-tone-destructive {
	--rc-fill: var(--rc-tone-destructive);
	--rc-ink: var(--rc-tone-destructive-on);
	--rc-edge: var(--rc-tone-destructive-edge);
}

.rooster-calendar .is-tone-info {
	--rc-fill: var(--rc-tone-info);
	--rc-ink: var(--rc-tone-info-on);
	--rc-edge: var(--rc-tone-info-edge);
}

/* The hues, named as a tone is. */
.rooster-calendar .is-tone-sky {
	--rc-fill: var(--rc-tone-sky);
	--rc-ink: var(--rc-tone-sky-on);
	--rc-edge: var(--rc-tone-sky-edge);
}

.rooster-calendar .is-tone-teal {
	--rc-fill: var(--rc-tone-teal);
	--rc-ink: var(--rc-tone-teal-on);
	--rc-edge: var(--rc-tone-teal-edge);
}

.rooster-calendar .is-tone-rose {
	--rc-fill: var(--rc-tone-rose);
	--rc-ink: var(--rc-tone-rose-on);
	--rc-edge: var(--rc-tone-rose-edge);
}

.rooster-calendar .is-tone-orange {
	--rc-fill: var(--rc-tone-orange);
	--rc-ink: var(--rc-tone-orange-on);
	--rc-edge: var(--rc-tone-orange-edge);
}

.rooster-calendar .is-tone-mono,
.rooster-calendar .is-tone-cancelled,
.rooster-calendar .is-cancelled {
	--rc-fill: var(--rc-tone-mono);
	--rc-ink: var(--rc-tone-mono-on);
	--rc-edge: var(--rc-tone-mono-edge);
}

/* The details dialog. */
.rooster-calendar__dialog {
	inline-size: min(32rem, calc(100vw - 32px));
	max-block-size: min(80vh, 40rem);
	padding: 0;
	border: 1px solid var(--rc-border);
	border-radius: calc(var(--rc-radius) + 4px);
	background: var(--rc-card);
	color: var(--rc-card-fg);
	box-shadow: var(--rc-shadow);
	font-family: var(--rc-font);
}

.rooster-calendar__dialog[open] {
	display: flex;
	flex-direction: column;
}

.rooster-calendar__dialog::backdrop {
	background: rgb(0 0 0 / 45%);
}

/* The dialog's head (1.2.2): the title and its badges are one row, the badges centred on the title's FIRST line and
   8 px after it; where the row is too narrow for both, the badges go under the title. The row starts at its top, and
   the badges' box is as tall as one line of the title, so a title of two lines keeps them beside its first. */
.rooster-calendar__dialog-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	padding: 16px 20px 8px;
}

/* From inside the calendar and its dialog, so the title is the package's own wherever the calendar stands: an admin
   screen styles every heading of its page (WordPress's `h2, h3`, and the chrome's rule for the headings of a product's
   own content, `.rooster-admin-adopt h2:not(...)`, which weighs two classes and an element), and those won over the
   class alone: 24 px above the title and 8 px below it, so it stood 8 px under its badges' line (the owner, 16 Nov
   2026, of Rooster One's offers: "the message ... has no alignment whatsoever"). */
.rooster-calendar .rooster-calendar__dialog .rooster-calendar__dialog-title {
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.rooster-calendar__badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	min-block-size: calc(1.125rem * 1.3); /* one line of the title */
}

/* A badge is the page's own badge (1.2.2): in the admin the chrome's recipe (its shape, its edge at a quarter of
   the tone, 2 px and 6 px of room, a line of 1.3), the look of a state's badge in a list beside the calendar; on the
   front the pill it was, with the same room. */
.rooster-calendar__badge {
	display: inline-flex;
	box-sizing: border-box;
	align-items: center;
	padding: 2px 6px;
	border: 1px solid color-mix(in srgb, var(--rc-edge, var(--rc-border)) 25%, transparent);
	border-radius: var(--rc-radius-badge);
	background: var(--rc-fill, var(--rc-tone-mono));
	color: var(--rc-ink, var(--rc-tone-mono-on));
	font-size: var(--rc-text-xs);
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}

.rooster-calendar__dialog-body {
	flex: 1 1 auto;
	min-block-size: 0;
	padding: 8px 20px 12px;
	overflow-y: auto;
}

.rooster-calendar__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 16px;
	margin: 0;
	font-size: var(--rc-text-sm);
}

.rooster-calendar__facts dt {
	color: var(--rc-muted-fg);
}

.rooster-calendar__facts dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.rooster-calendar__facts a,
.rooster-calendar__add-list a {
	color: inherit;
	text-decoration: underline;
}

.rooster-calendar__zone {
	display: block;
	color: var(--rc-muted-fg);
}

.rooster-calendar__dialog-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 12px 20px 16px;
	border-top: 1px solid var(--rc-border);
}

.rooster-calendar__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 4px 12px;
	border: 1px solid var(--rc-border);
	border-radius: var(--rc-radius);
	background: var(--rc-card);
	color: var(--rc-card-fg);
	font: inherit;
	font-size: var(--rc-text-sm);
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

.rooster-calendar__btn.is-primary {
	border-color: var(--rc-accent);
	background: var(--rc-accent);
	color: var(--rc-accent-fg);
}

.rooster-calendar__btn.is-ghost {
	border-color: transparent;
	background: transparent;
}

.rooster-calendar__btn:hover {
	background: var(--rc-muted);
}

.rooster-calendar__btn.is-primary:hover {
	background: color-mix(in srgb, var(--rc-accent) 88%, black);
	color: var(--rc-accent-fg);
}

.rooster-calendar__btn:focus-visible,
.rooster-calendar__add-list a:focus-visible {
	outline: 2px solid var(--rc-ring);
	outline-offset: 2px;
}

.rooster-calendar__add {
	position: relative;
}

.rooster-calendar__add summary {
	list-style: none;
}

.rooster-calendar__add summary::-webkit-details-marker {
	display: none;
}

.rooster-calendar__add-list {
	position: absolute;
	inset-inline-start: 0;
	bottom: 100%;
	z-index: 1;
	min-width: 12rem;
	margin: 0 0 4px;
	padding: 4px;
	border: 1px solid var(--rc-border);
	border-radius: var(--rc-radius);
	background: var(--rc-card);
	box-shadow: var(--rc-shadow);
	list-style: none;
}

.rooster-calendar__add-list a {
	display: block;
	min-height: 24px;
	padding: 4px 8px;
	text-decoration: none;
}

.rooster-calendar__add-list a:hover {
	background: var(--rc-muted);
}

.rooster-calendar__dialog-foot > [data-rc-calendar-close] {
	margin-inline-start: auto;
}

/* The fallback's list (no JavaScript). */
.rooster-calendar__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rooster-calendar__list > li {
	padding: 4px 0;
	border-bottom: 1px solid var(--rc-border);
}

.rooster-calendar__list > li.is-cancelled a,
.rooster-calendar__list > li.is-cancelled {
	text-decoration: line-through;
}

.rooster-calendar__empty {
	margin: 0;
	color: var(--rc-muted-fg);
}

/* Phones: the controls stack, the period's title wraps inside its row. */
.rooster-calendar.is-narrow .rooster-calendar__colour-by {
	margin-inline-start: 0;
}

.rooster-calendar.is-narrow .rooster-calendar__mount :has(> [role="heading"]) {
	min-width: 0;
}

.rooster-calendar.is-narrow .rooster-calendar__mount [role="heading"] {
	min-width: 0;
	overflow-wrap: anywhere;
}

@media (forced-colors: active) {
	.rooster-calendar__event {
		forced-color-adjust: none;
		border: 1px solid CanvasText;
		background: Canvas;
		color: CanvasText;
	}
}

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

@media print {
	.rooster-calendar__controls,
	.rooster-calendar__skip,
	.rooster-calendar__notice,
	.rooster-calendar__add {
		display: none;
	}
}
