.dsbn-dos {
	--dsbn-dos-cat-creed-bg: #dceaf7;
	--dsbn-dos-cat-creed-ink: #0e4a75;
	--dsbn-dos-cat-canada-bg: #fbe0e0;
	--dsbn-dos-cat-canada-ink: #8f2020;
	--dsbn-dos-cat-cultural-bg: #e8e2f5;
	--dsbn-dos-cat-cultural-ink: #4d3585;
	--dsbn-dos-cat-international-bg: #d8efe9;
	--dsbn-dos-cat-international-ink: #14614f;
	--dsbn-dos-cat-wellbeing-bg: #fbeed6;
	--dsbn-dos-cat-wellbeing-ink: #744e0c;
	--dsbn-dos-cat-other-bg: #e8eaee;
	--dsbn-dos-cat-other-ink: #3b444f;

	box-sizing: border-box;
	font-family: var(--dsbn-font-body);
	color: var(--dsbn-color-ink);
}

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

/* --- Month navigation --- */

.dsbn-dos__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.dsbn-dos .dsbn-dos__month {
	flex: 1 1 auto;
	margin: 0;
	text-align: center;
	font-family: var(--dsbn-font-heading);
	font-size: clamp(1.5rem, 3.5vw, 2.25rem);
	font-weight: var(--dsbn-fw-medium);
	line-height: var(--dsbn-lh-tight);
	color: var(--dsbn-color-ink);
}

/* Appearance comes from .dsbn-btn/.dsbn-btn--ghost; only sizing and the
   disabled fallback are set here. */
.dsbn-dos__nav-control {
	flex: 0 0 auto;
	padding: 0.55rem 1.1rem;
	font-size: 0.95rem;
}

.dsbn-dos__nav-control.is-disabled {
	border: 2px solid var(--dsbn-color-line);
	border-radius: var(--dsbn-radius-btn);
	color: var(--dsbn-color-ink);
	opacity: 0.35;
}

/* --- Month-long events --- */

/* Beats `.pg-contents :where(ul, ol) li+li { margin-top: 1.5rem }`
   (css/style.css) -- a bare single class loses to it on specificity, which
   previously staggered every list item but the first. */
.dsbn-dos__monthlong-list .dsbn-dos__monthlong-item,
.dsbn-dos__legend .dsbn-dos__legend-item,
.dsbn-dos__list .dsbn-dos__list-day,
.dsbn-dos__list .dsbn-dos__list-events li {
	margin: 0;
}

.dsbn-dos__monthlong {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.75rem;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--dsbn-color-line);
	background: var(--dsbn-color-surface-alt);
}

.dsbn-dos__monthlong-label {
	flex: 0 0 auto;
	font-size: 0.8rem;
	font-weight: var(--dsbn-fw-semibold);
	color: var(--dsbn-color-primary);
}

.dsbn-dos__monthlong-list {
	display: flex;
	flex: 1 1 12rem;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.3rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Inherits .dsbn-dos__event, so an all-month observance reads as the same
   kind of object as a dated one. They carry no category (the legacy data
   had none), so they take the neutral tint. */
/* Two classes deliberately: .dsbn-dos__event is declared later in this file
   and would otherwise win the margin at equal specificity, insetting these
   tags 4px against the label above them. */
.dsbn-dos__monthlong-list .dsbn-dos__monthlong-button {
	width: auto;
	margin: 0;
	padding: 0.25rem 0.55rem;
}

/* --- Legend --- */

.dsbn-dos__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	margin: 0;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--dsbn-color-line);
	background: var(--dsbn-color-surface-alt);
	list-style: none;
	font-size: 0.8rem;
}

.dsbn-dos__legend-item {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
}

.dsbn-dos__legend-swatch {
	width: 0.9rem;
	height: 0.9rem;
	border-radius: 0.25rem;
	background: var(--dsbn-dos-cat-other-bg);
}

/* --- Grid --- */

/* One card holds the all-month band, the grid (or the narrow-width list)
   and the legend, so they read as a single object instead of three blocks
   stacked with gaps between them. */
.dsbn-dos__calendar {
	border: 1px solid var(--dsbn-color-line);
	border-radius: var(--dsbn-radius-sm);
	overflow: hidden;
}

.dsbn-dos__weekdays,
.dsbn-dos__week {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* Row 1 holds the day numbers; each further row is one lane of event bars. */
.dsbn-dos__week {
	/* The trailing track is minmax(gap, 1fr), not a fixed size, and there is
	   no align-content:start -- otherwise a week whose lanes total less than
	   min-height leaves the surplus unallocated, and the day backgrounds
	   (which span row TRACKS, not container space) stop short of the week's
	   bottom. That painted a 47px cell inside a 112px row on event-free
	   weeks. */
	grid-template-rows: auto repeat(var(--dsbn-dos-lanes, 1), auto) minmax(0.45rem, 1fr);
	row-gap: 0.25rem;
	min-height: 7rem;
}

.dsbn-dos__weekday {
	padding: 0.6rem 0.5rem;
	background: var(--dsbn-color-primary);
	color: #fff;
	font-size: 0.85rem;
	font-weight: var(--dsbn-fw-semibold);
	text-align: center;
}

.dsbn-dos__weekday abbr {
	text-decoration: none;
	border: 0;
}

/* Backgrounds and cell borders only. Spanning the full row height puts them
   behind every lane, so a bar can cross a day boundary without a border
   cutting through it. */
.dsbn-dos__day {
	grid-row: 1 / -1;
	border-right: 1px solid var(--dsbn-color-line);
	background: var(--dsbn-color-surface);
}

.dsbn-dos__day--edge {
	border-right: 0;
}

.dsbn-dos__day--pad {
	background: var(--dsbn-color-surface-alt);
}

.dsbn-dos__week:not(:last-child) .dsbn-dos__day {
	border-bottom: 1px solid var(--dsbn-color-line);
}

.dsbn-dos__daynum {
	grid-row: 1;
	padding: 0.4rem 0.5rem 0.2rem;
	font-size: 0.85rem;
	font-weight: var(--dsbn-fw-semibold);
	color: var(--dsbn-color-ink);
	text-align: right;
}

.dsbn-dos__dayname {
	display: none;
}

/* Painted after the day backgrounds, so the bar sits over the cell borders
   it spans -- that continuity is the whole point of the multi-day bar. */
.dsbn-dos__event {
	appearance: none;
	position: relative;
	z-index: 1;
	display: block;
	width: auto;
	margin: 0 0.25rem;
	padding: 0.25rem 0.45rem;
	border: 0;
	border-radius: 0.25rem;
	background: var(--dsbn-dos-cat-other-bg);
	color: var(--dsbn-dos-cat-other-ink);
	font-family: inherit;
	font-size: 0.8rem;
	line-height: 1.3;
	text-align: left;
	overflow: hidden;
	cursor: pointer;
	transition: filter var(--dsbn-transition);
}

/* The clamp lives here, not on the button: a grid item blockifies
   `-webkit-box` to `flow-root`, which silently disables line-clamp and lets
   overflow:hidden slice text mid-line instead. */
.dsbn-dos__event-label {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	overflow-wrap: break-word;
}

/* Runs in from the previous week / on into the next. Only the corner is
   squared -- the inset stays, so a continuing bar never butts against the
   grid's own border. */
.dsbn-dos__event.is-continued {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.dsbn-dos__event.is-continues {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.dsbn-dos__event:hover,
.dsbn-dos__event:focus-visible {
	filter: brightness(0.94);
}

.dsbn-dos__event.is-cat-creed,
.dsbn-dos__legend-swatch.is-cat-creed {
	background: var(--dsbn-dos-cat-creed-bg);
	color: var(--dsbn-dos-cat-creed-ink);
}

.dsbn-dos__event.is-cat-canada,
.dsbn-dos__legend-swatch.is-cat-canada {
	background: var(--dsbn-dos-cat-canada-bg);
	color: var(--dsbn-dos-cat-canada-ink);
}

.dsbn-dos__event.is-cat-cultural,
.dsbn-dos__legend-swatch.is-cat-cultural {
	background: var(--dsbn-dos-cat-cultural-bg);
	color: var(--dsbn-dos-cat-cultural-ink);
}

.dsbn-dos__event.is-cat-international,
.dsbn-dos__legend-swatch.is-cat-international {
	background: var(--dsbn-dos-cat-international-bg);
	color: var(--dsbn-dos-cat-international-ink);
}

.dsbn-dos__event.is-cat-wellbeing,
.dsbn-dos__legend-swatch.is-cat-wellbeing {
	background: var(--dsbn-dos-cat-wellbeing-bg);
	color: var(--dsbn-dos-cat-wellbeing-ink);
}

/* --- Actions and notes --- */

.dsbn-dos__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
	margin-top: 1.5rem;
}

/* Sizing comes from .dsbn-btn; this only matches the ghost variant's
   colours, which .dsbn-btn--ghost scopes to `a`. */
.dsbn-dos__print {
	border-color: var(--dsbn-color-line);
	color: var(--dsbn-color-ink);
}

.dsbn-dos__print:hover,
.dsbn-dos__print:focus-visible {
	border-color: var(--dsbn-color-primary);
	background: color-mix(in srgb, var(--dsbn-color-primary) 8%, transparent);
	color: var(--dsbn-color-primary);
}

.dsbn-dos__note {
	margin-top: 1.25rem;
	font-size: 0.8rem;
	font-style: italic;
	color: var(--dsbn-color-ink);
}

.dsbn-dos__empty {
	padding: 2rem;
	border: 1px solid var(--dsbn-color-line);
	border-radius: var(--dsbn-radius-sm);
	background: var(--dsbn-color-surface-alt);
	text-align: center;
}

/* --- Narrow-width day list --- */

.dsbn-dos__list {
	display: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dsbn-dos__list-day {
	margin: 0;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--dsbn-color-line);
	background: var(--dsbn-color-surface);
}

.dsbn-dos__list-day:last-child {
	border-bottom: 0;
}

.dsbn-dos__list-date {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.95rem;
	font-weight: var(--dsbn-fw-semibold);
	color: var(--dsbn-color-ink);
}

.dsbn-dos__list-events {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dsbn-dos__list-events li {
	margin: 0;
}

.dsbn-dos__list .dsbn-dos__event {
	display: block;
	margin: 0;
	padding: 0.5rem 0.6rem;
	font-size: 0.9rem;
	overflow: visible;
	border-radius: 0.25rem;
}

/* --- Modal body rows --- */

.dsbn-dos-detail {
	margin: 0;
}

.dsbn-dos-detail__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.75rem;
	margin-bottom: 0.75rem;
}

.dsbn-dos-detail__label {
	flex: 0 0 7rem;
	font-weight: var(--dsbn-fw-semibold);
	color: var(--dsbn-color-primary);
}

.dsbn-dos-detail__value {
	flex: 1 1 12rem;
	margin: 0;
}

/* --- Mobile: the grid becomes a day list --- */

@media (max-width: 767px) {
	.dsbn-dos__grid {
		display: none;
	}

	.dsbn-dos__list {
		display: block;
	}

	/* Two classes so this isn't out-specified by the margin reset above. */
	.dsbn-dos__list .dsbn-dos__list-day {
		padding: 0.9rem 1rem;
	}

	.dsbn-dos__list-date {
		margin-bottom: 0.55rem;
		font-size: 1rem;
	}

	.dsbn-dos__list-events {
		gap: 0.45rem;
	}

	/* 44px min — WCAG 2.5.5 touch target, same guideline the theme's own
	   controls cite. These were 35px. */
	.dsbn-dos__list .dsbn-dos__event {
		display: flex;
		align-items: center;
		min-height: 2.75rem;
		padding: 0.6rem 0.8rem;
	}

	/* The all-month band matches the day list at this width -- same label
	   size, same tag treatment and the same 44px target. Left at the
	   grid's smaller scale it read as a different, lesser component. */
	.dsbn-dos__monthlong {
		gap: 0.5rem;
		padding: 0.9rem 1rem;
	}

	.dsbn-dos__monthlong-label {
		flex: 1 0 100%;
		font-size: 1rem;
	}

	.dsbn-dos__monthlong-list {
		flex: 1 1 100%;
		gap: 0.45rem;
	}

	.dsbn-dos__monthlong-list .dsbn-dos__monthlong-button {
		display: flex;
		align-items: center;
		min-height: 2.75rem;
		padding: 0.6rem 0.8rem;
		font-size: 0.9rem;
	}

	.dsbn-dos__legend {
		gap: 0.5rem 1rem;
		padding: 0.9rem 1rem;
		font-size: 0.85rem;
	}

	/* Title on its own line, the two controls split beneath it -- three
	   items side by side is too tight at this width. */
	.dsbn-dos__nav {
		flex-wrap: wrap;
		gap: 0.75rem;
	}

	.dsbn-dos .dsbn-dos__month {
		order: -1;
		flex: 1 0 100%;
	}

	.dsbn-dos__nav-control {
		flex: 1 1 0;
		justify-content: center;
		padding: 0.5rem 0.75rem;
		font-size: 0.9rem;
	}
}

/* --- High contrast: flatten the category tints, keep the labels --- */

/* high-contrast.css forces `button { color: #FFFFFF !important }`, so these
   pills go dark rather than fighting it for a light treatment. */
html.dsbn-high-contrast .dsbn-dos__event {
	background: #000;
	border: 1px solid #fff;
	border-left-width: 4px;
}

/* The legend only encodes colour, which this palette removes; the category
   still reads in every modal. */
html.dsbn-high-contrast .dsbn-dos__legend {
	display: none;
}

/* --- Print / PDF --- */

@media print {
	/* Landscape gives each day cell enough width to hold a wrapped title,
	   which is what lets the whole month sit on one page. Tight margin buys
	   the vertical room a 6-week month with dense weeks needs. */
	@page {
		size: landscape;
		margin: 0.7cm;
	}

	body:has(.dsbn-dos) .dsbn-site-header,
	body:has(.dsbn-dos) .dsbn-utility-bar,
	body:has(.dsbn-dos) .dsbn-primary-nav,
	body:has(.dsbn-dos) .dsbn-site-footer,
	body:has(.dsbn-dos) .dsbn-inside-hero,
	body:has(.dsbn-dos) .dsbn-inside-sidebar,
	body:has(.dsbn-dos) .dsbn-inside-nav,
	body:has(.dsbn-dos) .dsbn-inside-breadcrumb,
	body:has(.dsbn-dos) #emergency_notification,
	body:has(.dsbn-dos) .emergency-notification,
	body:has(.dsbn-dos) .goog-te-banner-frame,
	body:has(.dsbn-dos) .skiptranslate,
	.dsbn-dos__actions,
	.dsbn-dos__nav-control {
		display: none !important;
	}

	/* The inside-page layout is a 2-col grid whose sidebar TRACK (and gap)
	   still reserve ~440px even after the sidebar element is hidden -- that
	   was squeezing the calendar into a narrow column, forcing titles to
	   wrap and the month onto a second page. Collapse it to full width. */
	body:has(.dsbn-dos) .dsbn-inside-layout {
		display: block !important;
		padding-block: 0 !important;
	}

	.dsbn-dos {
		width: 100%;
		max-width: none;
		font-size: 7.5pt;
	}

	.dsbn-dos__nav {
		margin-bottom: 0.2rem;
	}

	.dsbn-dos .dsbn-dos__month {
		font-size: 15pt;
	}

	/* Page one is always just the calendar: the grid prints first, the legend
	   sits under it, and the all-month list is forced onto page two. */
	.dsbn-dos__calendar {
		display: flex;
		flex-direction: column;
		border: 0;
		overflow: visible;
	}

	.dsbn-dos__grid {
		order: 1;
		display: block !important;
		border: 2px solid var(--dsbn-color-line);
	}

	.dsbn-dos__legend {
		order: 2;
		border: 0;
		border-top: 1px solid var(--dsbn-color-line);
		padding: 0.3rem 0 0;
		background: transparent;
		font-size: 7pt;
	}

	.dsbn-dos__monthlong {
		order: 3;
		break-before: page;
	}

	.dsbn-dos__list {
		display: none !important;
	}

	.dsbn-dos__weekdays,
	.dsbn-dos__week {
		display: grid !important;
		grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
	}

	.dsbn-dos__weekday {
		padding: 2pt 1pt;
		font-size: 7pt;
	}

	/* A modest per-week floor so a near-empty week still shows full-height
	   grid lines; dense weeks grow past it to fit every title uncut. Kept
	   small enough that a 6-week month with heavy weeks still lands on one
	   page. */
	.dsbn-dos__week {
		min-height: 0.7in;
		row-gap: 0;
		break-inside: avoid;
	}

	/* Grid rules at 2px. At these fractional column positions a 1px line lands
	   mid-pixel and Chrome's print rasteriser washes it out -- unevenly, so
	   some columns read as ruled and others blank. 2px always keeps one whole
	   pixel, so every rule renders the same. */
	.dsbn-dos__day {
		border-right: 2px solid var(--dsbn-color-line) !important;
		border-bottom: 2px solid var(--dsbn-color-line) !important;
		background: #fff !important;
	}

	.dsbn-dos__day--edge {
		border-right: 0 !important;
	}

	.dsbn-dos__week:last-child .dsbn-dos__day {
		border-bottom: 0 !important;
	}

	.dsbn-dos__weekdays {
		border-bottom: 2px solid var(--dsbn-color-line);
	}

	.dsbn-dos__day--pad {
		background: #eef0f3 !important;
	}

	.dsbn-dos__daynum {
		padding: 2pt 3pt 0;
		font-size: 7pt;
	}

	.dsbn-dos__weekdays,
	.dsbn-dos__week,
	.dsbn-dos__day,
	.dsbn-dos__day--pad,
	.dsbn-dos__weekday,
	.dsbn-dos__event,
	.dsbn-dos__legend-swatch {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* No click target on paper, so the full title has to show -- drop the
	   two-line clamp and let the row grow to fit. */
	.dsbn-dos__event {
		margin: 1pt 2pt;
		padding: 1pt 3pt;
		font-size: 7pt;
		line-height: 1.2;
		overflow: visible;
	}

	.dsbn-dos__event-label {
		display: block;
		-webkit-line-clamp: unset;
		line-clamp: unset;
		overflow: visible;
	}

	/* All-month observances as a plain tight list on page two, not big tags. */
	.dsbn-dos__monthlong {
		display: block;
		padding: 0;
		border: 0;
		background: transparent;
	}

	.dsbn-dos__monthlong-label {
		display: block;
		margin-bottom: 0.35rem;
		font-size: 11pt;
	}

	.dsbn-dos__monthlong-list {
		display: block;
		columns: 2;
		column-gap: 2rem;
		font-size: 9pt;
	}

	.dsbn-dos .dsbn-dos__monthlong-list .dsbn-dos__monthlong-item {
		display: list-item;
		margin: 0 0 0.1rem 1.1rem;
		list-style: disc;
		break-inside: avoid;
		line-height: 1.35;
	}

	.dsbn-dos__monthlong-list .dsbn-dos__monthlong-button {
		display: inline;
		margin: 0;
		padding: 0;
		border: 0 !important;
		background: transparent !important;
		color: inherit !important;
		font: inherit;
	}

	.dsbn-dos__monthlong-list .dsbn-dos__event-label {
		display: inline;
	}

	.dsbn-dos__note {
		margin-top: 0.5rem;
		font-size: 7.5pt;
	}
}
