/**
 * Measure detail.
 *
 * Shares the carve-out note treatment with the finder block but stands alone, so the note
 * rules are repeated here rather than depending on the finder's stylesheet being enqueued.
 */

/* Weights: the theme declares 400 Book, 500 Med, 600 Demi and 900 Hvy — there is no 700
   face, so font-weight: 700 falls up to Heavy. Use 600 for bold-looking text here. */

.block--measure-detail {
	--ceip-detail-rule: rgba(0, 0, 0, 0.12);
	--ceip-detail-panel: rgba(0, 0, 0, 0.04);
	/* What the page itself is painted on. The tint above is translucent, which is right for a
	   panel sitting in the flow; the mobile bar floats its panel over the measure, and over
	   body text a translucent panel is unreadable. That one composites the tint over this. */
	--ceip-detail-surface: #fff;
	/* The journey caption under a documents heading. Grey rather than the body colour, as in
	   the PDF, but the dark grey secondary text uses: the mid-grey it was came to 5.6:1, and
	   the client asked for more contrast. */
	--ceip-detail-step-caption: #4a5254;
	/* Secondary text, solid rather than faded with opacity: 8:1 on white, 7.3:1 on the panels.
	   The finder's --ceip-finder-muted is the same colour. */
	--ceip-detail-muted: #4a5254;
	/* Matches --ceip-finder-cta: deep enough to clear WCAG AA on the page background. */
	--ceip-detail-cta: #007847;
	/* The lighter brand green, used on hover. */
	--ceip-detail-cta-hover: #83bc5a;
	--ceip-detail-warning: #8a1c1c;
	--ceip-detail-warning-bg: rgba(138, 28, 28, 0.07);
	/* The owner's half of a documents section, tinted from the brand teal. */
	--ceip-detail-owner-panel: rgba(0, 126, 164, 0.06);
	--ceip-detail-owner-edge: rgba(0, 126, 164, 0.45);
	/* The block sat flush against whatever follows it on the page. Most visible with the
	   sticky sidebar, which travels to the foot of its column and came to rest touching the
	   footer band, but the main column ended flush too. */
	padding-bottom: 3rem;
}

/* Sidebar and main column --------------------------------

   Same proportions and breakpoint as the finder's step 2, so the two screens of the tool
   behave alike: one column until there is room for two, sidebar stacked above on narrow
   screens. The municipality picker, the project button and expected useful life sit in the
   sidebar; everything that depends on the chosen municipality stays in the main column. */

.measure-detail__layout {
	display: grid;
	/* minmax(0, 1fr) rather than 1fr in the single-column case too: a bare 1fr keeps the
	   track's automatic minimum, so one wide child can still stretch it past the viewport. */
	grid-template-columns: minmax(0, 1fr);
	gap: 1.875rem;
}

@media (min-width: 64em) {
	.measure-detail__layout {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		align-items: start;
	}
}

.measure-detail__sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* Follows the content while it scrolls, but only once there are two columns — stuck to the
   top of a stacked view it would cover what the visitor is reading. */
@media (min-width: 64em) {
	.measure-detail__sidebar {
		position: sticky;
		/* Clears the site's own sticky header, as the finder does, from the height
		   favourites.js measures. */
		top: var(--ceip-sticky-top, 8.25rem);
		align-self: start;
		/* Deliberately not clamped with max-height + overflow-y. That made the sidebar its
		   own scroll box, and setting either overflow axis forces the other from visible to
		   auto, so it reserved gutters and showed scrollbars inside a panel that had nothing
		   to scroll sideways. A nested scrollbar beside the page's own is worse than the
		   problem it guarded against. */
	}
}

/* Sidebar panels read as discrete cards, the same treatment as the finder's. */
.measure-detail__panel {
	padding: 1rem 1.125rem;
	border: 1px solid var(--ceip-detail-rule);
	border-radius: 4px;
	background: var(--ceip-detail-panel);
}

/* The body colour, as the finder's planner heading has it. It took the theme's h2 blue and
   then faded it, which came to 2.7:1 on the panel. */
.measure-detail__panel-heading {
	margin: 0 0 0.375rem;
	color: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* The picker is already a panel; drop its outer margins now that the sidebar spaces it. */
.measure-detail__sidebar .measure-detail__municipality {
	margin: 0;
}

/* The button now sits inside the project panel, so it needs separating from the list that
   follows it rather than the zero margin a bare sidebar child wanted. */
.measure-detail__project .measure-detail__add-wrap {
	margin: 0 0 0.875rem;
}

/* Saved-upgrade toggle ------------------------------------ */

.measure-detail__add-wrap {
	margin: 0 0 1rem;
}

.measure-detail__add {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
	border: 1px solid var(--ceip-detail-rule);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 0.9375rem;
	cursor: pointer;
}

.measure-detail__add:hover,
.measure-detail__add:focus-visible {
	background: var(--ceip-detail-panel);
}

/* The bookmark the cards carry, so one symbol means "in my project" on both screens. Stacked
   in one box and swapped by opacity rather than display, so the button does not resize by a
   pixel as its state changes - the same arrangement as .ceip-finder__icon. */
.measure-detail__add-icon {
	position: relative;
	display: inline-grid;
	flex: none;
	width: 0.9375rem;
	height: 0.9375rem;
}

.measure-detail__add-icon .ceip-icon {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
}

.measure-detail__add-icon .ceip-icon--bookmark-saved {
	opacity: 0;
}

/* Added carries the brand green here too, so the two blocks report the state alike. */
.measure-detail__add.is-added {
	border-color: var(--ceip-detail-cta);
	color: var(--ceip-detail-cta);
}

.measure-detail__add.is-added .ceip-icon--bookmark {
	opacity: 0;
}

.measure-detail__add.is-added .ceip-icon--bookmark-saved {
	opacity: 1;
}

/* Hero ---------------------------------------------------

   The hero names the section, matching the index page, so the two read as one place. Its
   title is not the page heading — the measure name below is — so it cannot be an h1 and
   pick up the 40px treatment for free. This restates it. The rule lives here because this
   stylesheet loads exactly where that hero exists: on a measure page. */

.measure-hero__title {
	margin: 0.375rem 0 0;
	font-size: 2.5rem;
	font-weight: 900;
	line-height: 1.1;
	text-transform: uppercase;
}

.measure-hero__title a {
	color: inherit;
	text-decoration: none;
}

.measure-hero__title a:hover,
.measure-hero__title a:focus-visible {
	text-decoration: underline;
}

/* The page heading, moved out of the hero. Sized under the hero's title so the section
   still reads as the larger of the two. */
.measure-detail__title {
	margin: 0 0 0.75rem;
	font-size: 2rem;
	font-weight: 600;
	line-height: 1.15;
}

.measure-detail__category {
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ceip-detail-muted);
}

.measure-detail__description {
	font-size: 1.0625rem;
}

.measure-detail__description > :first-child {
	margin-top: 0;
}

/* Municipality picker ------------------------------------ */

.measure-detail__municipality {
	margin: 2rem 0;
	padding: 1.25rem;
	border: 1px solid var(--ceip-detail-rule);
	border-radius: 4px;
	background: var(--ceip-detail-panel);
}

.measure-detail__label {
	display: block;
	margin-bottom: 0.625rem;
	font-weight: 600;
}

.measure-detail__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

/* :focus included so the theme's `select:focus` padding cannot outrank this. */
.measure-detail__select,
.measure-detail__select:focus {
	flex: 1 1 18rem;
	/* A select is as wide as its longest option — here "Town of Rocky Mountain House", about
	   450px — and min-width defaults to auto, so it refuses to shrink below that and pushes
	   the whole sidebar past the viewport on a phone. Let it shrink; the native control
	   truncates the selected text. */
	min-width: 0;
	max-width: 28rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--ceip-detail-rule);
	border-radius: 4px;
	background-color: #fff;
	/* Form controls do not inherit the page font; without this the select fell back to Arial. */
	font-family: inherit;
	color: inherit;
	font-size: 1rem;
	/* Not a ratio: Chrome sizes a select from font metrics but lays the selected text out with
	   line-height, so a taller line box is clipped and the descenders go with it. */
	line-height: normal;
}

/* A focus ring: the rule above gives :focus the resting border, and the theme takes the
   browser's outline away. As on the finder, :focus is repeated to outrank the theme's
   `select:focus:focus`. */
.measure-detail__select:focus-visible:focus {
	border-color: #007ea4;
	outline: 2px solid #007ea4;
	outline-offset: 1px;
}

/* Not-available notice ----------------------------------- */

.measure-detail__notice--excluded {
	margin: 2rem 0;
	padding: 1rem 1.125rem;
	border-left: 4px solid var(--ceip-detail-warning);
	border-radius: 0 4px 4px 0;
	background: var(--ceip-detail-warning-bg);
	color: var(--ceip-detail-warning);
}

.measure-detail__notice-title {
	margin: 0 0 0.25rem;
	font-weight: 600;
}

.measure-detail__notice-body {
	margin: 0;
	color: inherit;
}

/* Carve-out notes ---------------------------------------- */

.measure-detail__notes {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 2rem 0;
}

.measure-detail__note {
	padding: 0.875rem 1rem;
	border-left: 4px solid currentColor;
	border-radius: 0 4px 4px 0;
	background: var(--ceip-detail-panel);
}

.measure-detail__note-type {
	margin: 0 0 0.25rem;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.measure-detail__note-reason > :first-child {
	margin-top: 0;
}

.measure-detail__note-reason > :last-child {
	margin-bottom: 0;
}

.measure-detail__note--added-requirement {
	color: #8a5300;
}

.measure-detail__note--conditional-eligibility {
	color: #1c5d8a;
}

.measure-detail__note--bundling-rule {
	color: #5a3d8a;
}

/* Requirement sections ----------------------------------- */

.measure-detail__section {
	margin: 2.5rem 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ceip-detail-rule);
}

.measure-detail__heading {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
}

/* A documents heading, with the journey step it belongs to ------

   Icon left, heading and caption stacked beside it - the arrangement the PDF draws, so the
   page and the summary downloaded from it read the same way. Only the two document sections
   have a step; eligibility keeps the bare heading above. */

.measure-detail__section-head {
	display: flex;
	/* Top, not centre: the caption makes the text column two lines deep, and centring would
	   float the icon between them rather than against the heading it belongs to. */
	align-items: flex-start;
	gap: 0.875rem;
	margin-bottom: 0.75rem;
}

.measure-detail__step-icon {
	flex: none;
	width: 3.5rem;
	/* The eight icons are drawn at eight different aspect ratios, so height follows the
	   artwork rather than being squared off - the PDF fits each one into its box for the same
	   reason. The attributes on the tag reserve the space either way. */
	height: auto;
}

/* Their own margins go; the flex row and the caption below space them now.

   min-width: 0 for the same reason the finder's step row needs it: a flex item will not
   shrink below its longest word by default, and on a narrow phone the column left beside a
   56px icon is narrow enough for that to start pushing the row wider than the screen. */
.measure-detail__section-titles {
	min-width: 0;
}

.measure-detail__section-titles .measure-detail__heading {
	margin-bottom: 0.25rem;
}

/* The icon gives up a little width on a phone, where 56px of a 287px column is a fifth of
   the line and the caption beside it is wrapping to three. */
@media (max-width: 30em) {
	.measure-detail__step-icon {
		width: 2.75rem;
	}

	.measure-detail__section-head {
		gap: 0.625rem;
	}
}

/* Quiet, and not a heading: it places the section in the journey rather than naming it. */
.measure-detail__step-caption {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ceip-detail-step-caption);
}

.measure-detail__content ul {
	margin: 0.5rem 0;
	padding-left: 1.25rem;
	list-style: disc;
}

.measure-detail__content li {
	margin-bottom: 0.375rem;
}

/* A list's lead-in - "Must either:", "If replacing an existing system:" - set bold with room
   above it, so each group of conditions starts visibly. See ceip_format_rich_text(). The
   :first-child rule below still takes it to the top when it opens the section. */
.measure-detail__content .measure-detail__lead-in {
	margin: 1.25rem 0 0.25rem;
	font-weight: 600;
}

.measure-detail__content > :first-child {
	margin-top: 0;
}

.measure-detail__content > :last-child {
	margin-bottom: 0;
}

/* Documents: what you provide vs what your contractor itemises ----

   Two groups rather than one list, matching the PDF. The boxes are decorative: nothing
   stores their state, and a real checkbox nobody can save would be an unlabelled focusable
   control promising persistence that does not exist. The ul/li carry the "list of N things"
   meaning on their own. */

/* Plain: the box below already carries the colour, and a band above it made two tinted
   shapes stacked where one will do.

   At the body's size and colour, as in the PDF. It was a small faded capital label, which
   the client found hard to read and out of step with the page around it. */
.measure-docs__label {
	margin: 1.5rem 0 0.5rem;
	font-size: 1rem;
	font-weight: 600;
}

/* The owner's half gets the same offset box as the contractor's, tinted from the brand teal
   rather than grey, so the pair reads as two kinds of thing rather than two shades of one. */
.measure-docs__group--owner {
	margin: 0 0 0.875rem;
	padding: 0.75rem 0.875rem;
	border-left: 3px solid var(--ceip-detail-owner-edge);
	background: var(--ceip-detail-owner-panel);
}

.measure-docs__label:first-child {
	margin-top: 0;
}

.measure-docs__group--owner .measure-docs__checklist,
.measure-docs__doc .measure-docs__checklist {
	margin: 0;
}

/* .measure-detail__content ul above is a descendant selector and would otherwise put discs
   and its own indent back on these. */
.measure-detail__content .measure-docs__checklist {
	margin: 0;
	padding-left: 0;
	list-style: none;
}

.measure-docs__item {
	display: flex;
	gap: 0.625rem;
	margin-bottom: 0.5rem;
}

.measure-docs__item::before {
	content: "";
	flex: 0 0 auto;
	width: 0.875rem;
	height: 0.875rem;
	margin-top: 0.3em;
	/* Solid rather than faded to 45%, which left the boxes too faint to see on a print. */
	border: 1px solid var(--ceip-detail-muted);
	border-radius: 2px;
}

/* Set apart and indented, so a contractor's line items never read as the owner's to gather. */
.measure-docs__doc {
	margin: 0 0 0.875rem;
	padding: 0.75rem 0.875rem;
	border-left: 3px solid var(--ceip-detail-rule);
	background: var(--ceip-detail-panel);
}

.measure-docs__doc-heading {
	margin: 0 0 0.5rem;
	font-weight: 600;
}

/* Headings an editor wrote with # inside a section already headed by an h2. */
.measure-detail__subheading {
	margin: 1.25rem 0 0.5rem;
	font-size: 1rem;
	font-weight: 600;
}

@media print {
	.measure-docs__doc {
		background: none;
	}

	.measure-docs__item::before {
		opacity: 1;
	}
}

.measure-detail__eul-years {
	margin: 0 0 0.5rem;
	font-size: 1.125rem;
	font-weight: 600;
}

/* The municipality's maximum repayment term, where this upgrade outlasts it. In the program
   overview's blue, since it is a fact about the municipality's terms rather than the upgrade. */
.measure-detail__term-note {
	margin: 0.75rem 0 0;
	padding: 0.625rem 0.875rem;
	border-left: 3px solid var(--ceip-detail-owner-edge);
	background: var(--ceip-detail-owner-panel);
}

/* The notes under the figure: the same panel and edge as a contractor's document, with a
   label in the secondary colour, so they read as conditions on the figure rather than a second
   statement of it. */
.measure-detail__eul-notes {
	margin: 0.75rem 0 0;
	padding: 0.75rem 0.875rem;
	border-left: 3px solid var(--ceip-detail-rule);
	background: var(--ceip-detail-panel);
}

.measure-detail__eul-notes-label {
	margin: 0 0 0.375rem;
	color: var(--ceip-detail-muted);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

@media print {
	.measure-detail__eul-notes {
		background: none;
	}
}

/* My project ---------------------------------------------

   The finder's sidebar panel, minus the filter toggle: on a measure page the same space
   lists what else is in the project and offers the PDF. */

/* The upgrade you are reading, in the list with the rest of the project. Not a link - it
   would lead here - so it carries the weight instead, which is also what tells you where you
   are in the list. */
.measure-detail__project-current {
	font-weight: 600;
}

/* Rows and the remove buttons are blocks/upgrades/planner.css, shared with the finder; the
   type and the space before what follows are set here. */
.measure-detail__project-list {
	margin-bottom: 0.75rem;
	font-size: 0.9375rem;
}

.measure-detail__project-empty,
.measure-detail__project-note {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: var(--ceip-detail-muted);
}

/* Stranded saves --------------------------------------------

   The finder's prompt, in the panel that lists the project here. Same reasoning, same words;
   the colours come from this block's own tokens. */

.measure-detail__stranded {
	margin: 0 0 0.875rem;
	padding: 0.75rem 0.875rem;
	border-left: 3px solid var(--ceip-detail-owner-edge, rgba(0, 126, 164, 0.45));
	background: var(--ceip-detail-owner-panel, rgba(0, 126, 164, 0.06));
}

.measure-detail__stranded-text {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.45;
}

.measure-detail__stranded-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0.625rem 0 0;
}

.measure-detail__stranded-remove,
.measure-detail__stranded-keep {
	padding: 0.375rem 0.625rem;
	border: 1px solid #007ea4;
	border-radius: 4px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.measure-detail__stranded-remove {
	background: #007ea4;
	color: #fff;
}

.measure-detail__stranded-remove:hover,
.measure-detail__stranded-remove:focus-visible {
	background: #006d8e;
}

.measure-detail__stranded-keep {
	background: transparent;
	color: inherit;
}

.measure-detail__stranded-keep:hover,
.measure-detail__stranded-keep:focus-visible {
	background: rgba(0, 126, 164, 0.12);
}

.measure-detail__export {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.4375rem;
	margin: 0 0 0.5rem;
}

/* Matches the finder's export button, so the same action looks the same on both screens. */
.measure-detail__export-button {
	display: inline-flex;
	align-items: center;
	gap: 0.4375rem;
	padding: 0.5rem 0.875rem;
	border: 0;
	border-radius: 4px;
	background: var(--ceip-detail-cta);
	color: #fff;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}

.measure-detail__export-button::before {
	content: '\2197'; /* north-east arrow, standing in for an external-link glyph */
	font-size: 0.9375rem;
	line-height: 1;
}

/* White on the lighter green is about 2.3:1, under WCAG AA, so the label goes near-black. */
.measure-detail__export-button:hover:not([disabled]),
.measure-detail__export-button:focus-visible:not([disabled]) {
	background: var(--ceip-detail-cta-hover);
	color: #101010;
}

.measure-detail__export-button[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.measure-detail__export-hint,
.measure-detail__project-more {
	margin: 0;
	font-size: 0.875rem;
}

/* The shared rule above zeroes the margins; this link needs room on both sides — it sits
   between the project list and the download button, and ran flush against the button. The
   0.875rem below matches the gap the panel already uses around a button. */
.measure-detail__project-more {
	margin: 0.75rem 0 0.875rem;
}

/* Program overview ---------------------------------------

   Its look is shared with the finder, in blocks/upgrades/overview.css. Here it only needs
   room above, from the description; below it, the first section's own margin and rule do
   the work. */

.measure-detail__main > .ceip-overview {
	margin: 1.75rem 0 0;
}

@media (prefers-color-scheme: dark) {
	.block--measure-detail {
		--ceip-detail-rule: rgba(255, 255, 255, 0.22);
		--ceip-detail-owner-panel: rgba(120, 200, 230, 0.10);
		--ceip-detail-owner-edge: rgba(120, 200, 230, 0.55);
		--ceip-detail-panel: rgba(255, 255, 255, 0.07);
		--ceip-detail-surface: #1b1b1b;
		--ceip-detail-step-caption: #b9c1c3;
		--ceip-detail-muted: #b9c1c3;
		/* #007847 is too dark to read on the dark background; the brand's lighter green. */
		--ceip-detail-cta: #83bc5a;
		--ceip-detail-warning: #f08c8c;
		--ceip-detail-warning-bg: rgba(240, 140, 140, 0.12);
	}

	.measure-detail__select {
		background-color: transparent;
		color: inherit;
	}

	.measure-detail__note--added-requirement {
		color: #f0b866;
	}

	.measure-detail__note--conditional-eligibility {
		color: #7fc0ea;
	}

	.measure-detail__note--bundling-rule {
		color: #b79ce4;
	}
}

/* The sidebar, below the two-column breakpoint ------------

   The bar itself lives in blocks/upgrades/bar.css, shared with the finder. What is here is
   only what belongs to this screen: what the bar opens, and where it floats to. */

@media (max-width: 63.99em) {
	.measure-detail__layout {
		/* Not a grid below the breakpoint, where it is a single column anyway. A sticky grid
		   item is constrained to its own grid area, which here is just its own row - so the
		   sidebar could only stick for its own height. As a block the containing block is the
		   layout, which runs the length of the measure, which is how far it needs to stick. */
		display: block;
	}

	/* The picker rides up out of sight as the sidebar pins, rather than being hidden outright.
	   It sits above the bar in the sidebar, and the sidebar sticks high enough that the picker
	   ends up behind the site header - which is opaque and at z-index 1000, well above this -
	   leaving only the bar showing. Scroll back to the top and it is simply there again.

	   The alternative, display: none once stuck, changes the sidebar's height while it is
	   stuck; a sticky element keeps its space in the flow, so the measure below it would jump
	   up by the height of the picker at the moment it pinned. Nothing moves this way: the
	   sidebar's box is the same size throughout, only its resting place is higher.

	   view.js measures how far the bar sits down the sidebar and publishes it, because the
	   picker's height depends on the width it wraps at. */
	.measure-detail__sidebar {
		position: sticky;
		/* The measured header height, published by favourites.js and re-measured on resize:
		   the header restacks and is shorter on a phone. Less the distance down to the bar, so
		   that it is the bar, not the top of the sidebar, that comes to rest below the header. */
		top: calc(var(--ceip-sticky-top, 4.5rem) - var(--ceip-detail-dock-offset, 0px));
		/* Under the site header, which is what hides the picker, and over the measure, which is
		   what the project panel floats above. */
		z-index: 20;
		/* The grid's gap went with the grid. */
		margin-bottom: 1.875rem;
	}

	/* The panel hangs off the bar rather than sitting under it in the flow. Pushing the measure
	   down instead would move whatever was being read the moment the panel opened, and move it
	   back on close. */
	.measure-detail__project {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		margin-top: 0.375rem;
		/* The theme leaves these at content-box, which would make max-height mean "that, plus
		   the panel's own padding" - overhanging the screen by exactly the padding. */
		box-sizing: border-box;
		/* A long project is the one case this cannot show at once, so it scrolls inside itself
		   rather than off the bottom of the screen. */
		max-height: calc(100vh - var(--ceip-sticky-top, 4.5rem) - 3rem);
		overflow-y: auto;
		/* The panel's own tint is translucent, which is right in the flow and unreadable over
		   the text it now floats above. A background-image paints on top of the
		   background-color, so the pair is opaque where the tint alone is not. */
		background-color: var(--ceip-detail-surface);
		background-image: linear-gradient(var(--ceip-detail-panel), var(--ceip-detail-panel));
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	}

	/* Set by favourites.js, not by :has() on the button - a browser without :has() would leave
	   the panel unreachable, and there is no graceful version of that. */
	.measure-detail__sidebar[data-ceip-open="project"] .measure-detail__project {
		display: block;
	}
}
