/* ==========================================================================
	WikicliQ — common stylesheet
	One file shared by every page.

	Contents
	 1. Design tokens
	 2. Base
	 3. Page layout
	 4. Site header and section tabs
	 5. Buttons
	 6. Form controls
	 7. Labels, counters, dots, icons
	 8. Menus (dropdowns built on <details>)
	 9. Side navigation
	10. Filter bar
	11. Item list
	12. Pagination
	13. Site footer
	14. Page head
	15. Editor
	16. Rendered text
	17. Dialog
	18. Page message
	19. Landing page
	20. Type-specific editors
	21. Reference sheet
	22. Steps
	23. Notice page
	24. Compact layout
	25. Search in the header
	26. Filters button, icon only
	27. The page behind an open popover does not scroll
	28. Editing in place, on a phone
	29. Events

	Breakpoints (mobile first)
	480px   paired fields sit side by side
	600px   filter bar and footer go onto one row
	900px   side navigation moves from chips above the list to a left column
	899px and below: compact layout (menu drawer, Filters sheet, summary line). See section 24.
	========================================================================== */


/* 1. Design tokens
	========================================================================== */

:root {
	/* Surfaces: off-white page, slightly greyer header */
	--color-paper: #F9FAFA;
	--color-shade: #EEF1F2;
	--color-surface: #FFFFFF;

	/* Text: three depths of one cerulean hue */
	--color-cerulean: #007BA7;          /* links and titles */
	--color-ink: #0B4A63;               /* body text */
	--color-muted: #49707F;             /* secondary text */

	/* Lines */
	--color-border: #D3DBDF;
	--color-border-muted: #E4E9EB;
	--color-border-control: #7F9AA6;    /* text inputs */

	/* Accent: banana. Fills, bars and highlights only, never text. */
	--color-banana: #FFE135;
	--color-banana-soft: #FFF6C4;
	--color-banana-deep: #F2CC0C;       /* hover on banana fills */
	--color-banana-edge: #C9A800;       /* border around banana fills */

	/* Errors */
	--color-danger: #B3261E;

	/* Completed mark on a to-do */
	--color-done: #1F8A65;
	--color-done-soft: #DDF3EA;

	/* Tags that say what a line of formatted text is. Fill and edge for each. */
	--tag-title: #D9EEF6;
	--tag-title-edge: #9CCBDD;
	--tag-heading: #DDF1EC;
	--tag-heading-edge: #A3D3C7;
	--tag-bold: #FFF6C4;
	--tag-bold-edge: #E3CF6A;
	--tag-link: #E9E3F7;
	--tag-link-edge: #C3B5E6;

	/* Category swatches. A Category stores a swatch number 1 to 8. */
	--swatch-1: #E9B90C;
	--swatch-2: #007BA7;
	--swatch-3: #3FA796;
	--swatch-4: #D9543A;
	--swatch-5: #8367C7;
	--swatch-6: #7A9A2E;
	--swatch-7: #C2528B;
	--swatch-8: #7C8B93;

	/* Type */
	--font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--text-tiny: 0.75rem;               /* 12px  labels, counters */
	--text-meta: 0.8125rem;             /* 13px  meta rows */
	--text-small: 0.875rem;             /* 14px  controls, navigation */
	--text-body: 1rem;                  /* 16px */
	--text-title: 1.25rem;              /* 20px  item titles */
	--text-h2: 1.5rem;                  /* 24px */
	--text-h1: 2rem;                    /* 32px */

	/* Shape and space */
	--radius: 6px;
	--radius-large: 10px;
	--control-height: 34px;
	--page-max: 1216px;
	--page-gutter: 16px;
	--shadow-overlay: 0 8px 24px rgba(11, 74, 99, 0.14);
}

@media (min-width: 600px) {
	:root {
		--page-gutter: 24px;
	}
}


/* 2. Base
	========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font-family: var(--font-body);
	font-size: var(--text-body);
	line-height: 1.5;
}

h1,
h2,
h3 {
	margin: 0 0 0.5em;
	font-weight: 600;
	line-height: 1.25;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-title); }

p {
	margin: 0 0 1em;
}

a {
	color: var(--color-cerulean);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

:focus-visible {
	outline: 2px solid var(--color-cerulean);
	outline-offset: 2px;
}

::selection {
	background: var(--color-banana);
	color: var(--color-ink);
}

mark {
	background: var(--color-banana-soft);
	color: inherit;
	border-radius: 2px;
}

pre,
code {
	font-family: var(--font-mono);
	font-size: 0.875em;
	tab-size: 3;
}

[hidden] {
	display: none !important;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: var(--page-gutter);
	top: -100px;
	z-index: 100;
	padding: 8px 14px;
	background: var(--color-banana);
	color: var(--color-ink);
	font-weight: 600;
	border-radius: var(--radius);
}

.skip-link:focus {
	top: 8px;
}


/* 3. Page layout
	========================================================================== */

.container {
	width: 100%;
	max-width: var(--page-max);
	margin-inline: auto;
	padding-inline: var(--page-gutter);
}

.page {
	padding-block: 16px 0;
}

/* Two columns: side navigation and content. One column on small screens. */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
}

@media (min-width: 900px) {
	.page {
		padding-block: 32px 0;
	}

	.layout {
		grid-template-columns: 232px minmax(0, 1fr);
		gap: 48px;
	}
}


/* 4. Site header and section tabs
	========================================================================== */

.site-header {
	background: var(--color-shade);
	border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-block: 12px 8px;
}

.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--color-ink);
	font-weight: 700;
	white-space: nowrap;
}

.site-logo:hover {
	text-decoration: none;
}

.site-logo__mark {
	width: 28px;
	height: 28px;
	flex: none;
}

/* Search box in the header: hidden on small screens, where the
	magnifier button links to the search page instead. */
.site-search {
	display: none;
	position: relative;
	flex: 0 1 480px;
	margin-left: 12px;
}

.site-search .icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--color-muted);
	pointer-events: none;
}

.site-search .input {
	padding-left: 32px;
}

.site-header__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

@media (min-width: 600px) {
	.site-search {
		display: block;
	}

	.site-header__tools .site-header__search-link {
		display: none;
	}
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: none;
	border-radius: 50%;
	background: var(--color-cerulean);
	color: #FFFFFF;
	font-size: var(--text-tiny);
	font-weight: 600;
	letter-spacing: 0.02em;
}

.avatar:hover {
	text-decoration: none;
}

/* Section tabs. The active tab carries the banana bar. */
.site-nav {
	overflow-x: auto;
	scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
	display: none;
}

.site-nav__list {
	display: flex;
	gap: 4px;
	margin: 0 0 0 -10px;
	padding: 0;
	list-style: none;
}

.site-nav__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	padding: 5px 10px;
	border-radius: var(--radius);
	color: var(--color-ink);
	font-size: var(--text-small);
	white-space: nowrap;
}

.site-nav__link:hover {
	background: rgba(11, 74, 99, 0.08);
	text-decoration: none;
}

.site-nav__link[aria-current="page"] {
	font-weight: 600;
}

.site-nav__link[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -8px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--color-banana-deep);
}


/* 5. Buttons
	========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: var(--control-height);
	padding: 0 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
	color: var(--color-ink);
	font-family: inherit;
	font-size: var(--text-small);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
}

.btn:hover {
	background: var(--color-shade);
	text-decoration: none;
}

.btn--primary {
	background: var(--color-banana);
	border-color: var(--color-banana-edge);
}

.btn--primary:hover {
	background: var(--color-banana-deep);
}

.btn--small {
	min-height: 28px;
	padding: 0 10px;
	font-size: var(--text-meta);
}

.btn--large {
	min-height: 44px;
	padding: 0 22px;
	font-size: var(--text-body);
}

.btn[aria-disabled="true"],
.btn:disabled {
	background: transparent;
	color: var(--color-muted);
	opacity: 0.6;
	cursor: default;
}

/* A toggle that is switched on, such as a pinned item */
.btn[aria-pressed="true"] .icon {
	fill: var(--color-banana);
	stroke: var(--color-banana-edge);
}

/* Square button that holds only an icon */
.icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: none;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: transparent;
	color: var(--color-ink);
	cursor: pointer;
}

.icon-btn:hover {
	background: rgba(11, 74, 99, 0.08);
}

/* The same button with no outline, for use inside a bar */
.icon-btn--plain {
	border-color: transparent;
}

/* An icon that is itself the control: click it to change what it shows */
.icon-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex: none;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: var(--color-muted);
	cursor: pointer;
}

.icon-toggle:hover {
	background: rgba(11, 74, 99, 0.08);
}

.icon-toggle .icon {
	width: 18px;
	height: 18px;
}

/* Two or more buttons joined into one control. The chosen one is tinted banana. */
.segmented {
	display: inline-flex;
}

.segmented .btn {
	position: relative;
	border-radius: 0;
}

.segmented .btn + .btn {
	margin-left: -1px;
}

.segmented .btn:first-child {
	border-radius: var(--radius) 0 0 var(--radius);
}

.segmented .btn:last-child {
	border-radius: 0 var(--radius) var(--radius) 0;
}

.segmented .btn[aria-pressed="true"] {
	z-index: 1;
	border-color: var(--color-banana-edge);
	background: var(--color-banana-soft);
}

/* Unread marker */
.icon-btn__dot {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 11px;
	height: 11px;
	border: 1px solid var(--color-banana-edge);
	border-radius: 50%;
	background: var(--color-banana);
}


/* 6. Form controls
	========================================================================== */

.input {
	display: block;
	width: 100%;
	min-height: var(--control-height);
	padding: 5px 12px;
	border: 1px solid var(--color-border-control);
	border-radius: var(--radius);
	background: var(--color-surface);
	color: var(--color-ink);
	font-family: inherit;
	font-size: 1rem;                    /* 16px stops iOS zooming on focus */
	line-height: 1.4;
}

.input::placeholder {
	color: var(--color-muted);
	opacity: 1;
}

.input:focus-visible {
	outline-offset: 0;
	border-color: var(--color-cerulean);
}

.input[aria-invalid="true"] {
	border-color: var(--color-danger);
}

/* A field is a label, its control, and an optional hint */
.field {
	margin-bottom: 16px;
}

.field__label {
	display: block;
	margin-bottom: 6px;
	font-size: var(--text-small);
	font-weight: 600;
}

/* Label and its value on one line, for fixed text */
.field--inline {
	display: flex;
	align-items: center;
	gap: 10px;
}

.field--inline .field__label {
	margin-bottom: 0;
}

/* Fixed text shown in place of a control */
.field__value {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.field__value .icon {
	color: var(--color-muted);
}

.field__hint {
	margin: 6px 0 0;
	color: var(--color-muted);
	font-size: var(--text-meta);
}

/* What is wrong with the field's value, shown under it after a failed save.
	The field itself is marked with aria-invalid, which draws its border red. */
.field__error {
	margin: 6px 0 0;
	color: var(--color-danger);
	font-size: var(--text-small);
}

/* Two short fields that sit side by side when there is room */
.field-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 12px;
}

@media (min-width: 480px) {
	.field-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.select {
	-webkit-appearance: none;
	appearance: none;
	min-height: var(--control-height);
	padding: 0 30px 0 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0h8L4 5z' fill='%230B4A63' fill-opacity='.7'/%3E%3C/svg%3E") no-repeat right 11px center;
	color: var(--color-ink);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.select:hover {
	background-color: var(--color-shade);
}

.select--small {
	min-height: 28px;
	padding-left: 10px;
}

@media (min-width: 600px) {
	.input {
		font-size: var(--text-small);
	}

	.select {
		font-size: var(--text-small);
	}

	.select--small {
		font-size: var(--text-meta);
	}
}


/* 7. Labels, counters, dots, icons
	========================================================================== */

/* Outlined pill next to a title: the asset's type */
.label {
	display: inline-block;
	margin-left: 2px;
	padding: 0 8px;
	border: 1px solid var(--color-border);
	border-radius: 2em;
	color: var(--color-muted);
	font-size: var(--text-tiny);
	font-weight: 500;
	line-height: 20px;
	white-space: nowrap;
	vertical-align: middle;
}

/* Filled pill holding a number */
.counter {
	display: inline-block;
	min-width: 20px;
	padding: 0 6px;
	border-radius: 2em;
	background: rgba(11, 74, 99, 0.1);
	color: var(--color-ink);
	font-size: var(--text-tiny);
	font-weight: 500;
	line-height: 20px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* Category swatch */
.dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	flex: none;
	border-radius: 50%;
	background: var(--swatch-8);
}

.dot--1 { background: var(--swatch-1); }
.dot--2 { background: var(--swatch-2); }
.dot--3 { background: var(--swatch-3); }
.dot--4 { background: var(--swatch-4); }
.dot--5 { background: var(--swatch-5); }
.dot--6 { background: var(--swatch-6); }
.dot--7 { background: var(--swatch-7); }
.dot--8 { background: var(--swatch-8); }

.dot--none {
	border: 1.5px solid var(--color-border-control);
	background: transparent;
}

/* Chip: a small rounded tag for showing a Category or a Group */
.chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px;
	border: 1px solid var(--color-border);
	border-radius: 2em;
	background: var(--color-surface);
	font-size: var(--text-small);
	white-space: nowrap;
}

.chip .icon {
	color: var(--color-muted);
}

/* Icons come from the <symbol> sprite at the top of <body> */
.icon {
	width: 16px;
	height: 16px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sprite {
	display: none;
}


/* 8. Menus (dropdowns built on <details>)
	========================================================================== */

.menu {
	position: relative;
}

.menu > summary {
	list-style: none;
}

.menu > summary::-webkit-details-marker {
	display: none;
}

/* Caret */
.menu > summary::after {
	content: "";
	width: 0;
	height: 0;
	margin-left: 2px;
	border: 4px solid transparent;
	border-top-color: currentColor;
	border-bottom-width: 0;
	opacity: 0.7;
}

.menu__value {
	font-weight: 400;
}

.menu__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 20;
	width: max-content;
	min-width: 220px;
	max-width: calc(100vw - 2 * var(--page-gutter));
	padding: 6px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
	box-shadow: var(--shadow-overlay);
}

.menu--right .menu__panel {
	left: auto;
	right: 0;
}

.menu__title {
	margin: 0;
	padding: 6px 10px;
	color: var(--color-muted);
	font-size: var(--text-meta);
	font-weight: 600;
}

.menu__item {
	position: relative;
	display: block;
	padding: 7px 10px;
	border-radius: var(--radius);
	color: var(--color-ink);
	font-size: var(--text-small);
	white-space: nowrap;
}

.menu__item:hover {
	background: var(--color-shade);
	text-decoration: none;
}

/* A menu that picks one value leaves room for a check mark */
.menu--select .menu__item {
	padding-left: 32px;
}

.menu--select .menu__item[aria-current="true"] {
	font-weight: 600;
}

.menu--select .menu__item[aria-current="true"]::before {
	content: "";
	position: absolute;
	left: 13px;
	top: 50%;
	width: 6px;
	height: 11px;
	border: solid var(--color-cerulean);
	border-width: 0 2px 2px 0;
	transform: translateY(-65%) rotate(45deg);
}

.menu__divider {
	height: 1px;
	margin: 6px 0;
	border: 0;
	background: var(--color-border-muted);
}


/* 9. Side navigation
	Small screens: each section is a row of chips that scrolls sideways.
	900px and up: a quiet left column.
	========================================================================== */

.side-nav {
	display: grid;
	gap: 8px;
}

.side-nav__section {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.side-nav__heading {
	flex: none;
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-meta);
	font-weight: 600;
	line-height: 1.5;
}

.side-nav__list {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 2px;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: none;
}

.side-nav__list::-webkit-scrollbar {
	display: none;
}

.side-nav__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px;
	border: 1px solid var(--color-border);
	border-radius: 2em;
	background: var(--color-surface);
	color: var(--color-ink);
	font-size: var(--text-small);
	white-space: nowrap;
}

.side-nav__link:hover {
	background: var(--color-shade);
	text-decoration: none;
}

/* A row can also be a <label> wrapping a radio button, for choosing a value */
label.side-nav__link {
	cursor: pointer;
}

.side-nav__link:has(input:focus-visible) {
	outline: 2px solid var(--color-cerulean);
	outline-offset: 2px;
}

.side-nav__link .icon {
	color: var(--color-muted);
}

.side-nav__link[aria-current="true"],
.side-nav__link:has(input:checked) {
	border-color: var(--color-banana-edge);
	background: var(--color-banana-soft);
	font-weight: 600;
}

.side-nav__count {
	color: var(--color-muted);
	font-size: var(--text-meta);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

.side-nav__manage {
	display: none;
}

@media (min-width: 900px) {
	.side-nav {
		display: block;
	}

	.side-nav__section {
		display: block;
		margin-bottom: 28px;
	}

	.side-nav__heading {
		margin-bottom: 6px;
		padding-inline: 10px;
	}

	.side-nav__list {
		display: block;
		padding: 0;
		overflow: visible;
	}

	.side-nav__link {
		gap: 10px;
		padding: 6px 10px;
		border: 0;
		border-radius: var(--radius);
		background: transparent;
	}

	.side-nav__link[aria-current="true"],
	.side-nav__link:has(input:checked) {
		background: var(--color-shade);
	}

	.side-nav__link[aria-current="true"]::before,
	.side-nav__link:has(input:checked)::before {
		content: "";
		position: absolute;
		left: -8px;
		top: 5px;
		bottom: 5px;
		width: 4px;
		border-radius: 2px;
		background: var(--color-banana-deep);
	}

	.side-nav__count {
		margin-left: auto;
	}

	.side-nav__manage {
		display: inline-block;
		margin: 6px 0 0 10px;
		font-size: var(--text-meta);
	}
}


/* 10. Filter bar
	========================================================================== */

.filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--color-border-muted);
}

.filter-bar__search {
	flex: 1 1 100%;
}

@media (min-width: 600px) {
	.filter-bar__search {
		flex: 1 1 220px;
	}
}

/* Pushes whatever follows to the far end of the row */
.filter-bar__push {
	margin-left: auto;
}


/* 11. Item list
	The app's one list view: rows separated by hairlines, not a table and not
	cards. Used for assets, search results, members, and any other list.
	========================================================================== */

.item-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A list with no filter bar above it draws its own top rule */
.item-list--ruled {
	border-top: 1px solid var(--color-border-muted);
}

.item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding-block: 22px;
	border-bottom: 1px solid var(--color-border-muted);
}

.item__main {
	min-width: 0;
}

.item__title {
	margin: 0 0 4px;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.item__summary {
	max-width: 68ch;
	margin: 0 0 12px;
	font-size: 0.9375rem;
}

.item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0;
	padding: 0;
	color: var(--color-muted);
	font-size: var(--text-meta);
	list-style: none;
}

.item__meta li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.item__actions {
	flex: none;
}

/* The pin button is icon-only until there is room for its word */
.item__actions .btn__text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

@media (min-width: 600px) {
	.item {
		gap: 24px;
		padding-block: 24px;
	}

	.item__title {
		font-size: var(--text-title);
	}

	.item__actions .btn__text {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
	}
}

/* Shown in place of the list when a search or filter matches nothing */
.empty-state {
	padding: 56px 16px;
	border-bottom: 1px solid var(--color-border-muted);
	text-align: center;
}

.empty-state__title {
	margin: 0 0 4px;
	font-size: var(--text-title);
}

.empty-state__text {
	margin: 0 0 16px;
	color: var(--color-muted);
}


/* 12. Pagination
	========================================================================== */

.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding-block: 20px;
}

.pagination__status {
	margin-right: auto;
	color: var(--color-muted);
	font-size: var(--text-meta);
}


/* 13. Site footer
	========================================================================== */

.site-footer {
	margin-top: 40px;
	border-top: 1px solid var(--color-border-muted);
	color: var(--color-muted);
	font-size: var(--text-meta);
}

.site-footer--flush {
	margin-top: 0;
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-block: 20px 32px;
}

.site-footer__name {
	margin: 0;
}

.site-footer__nav {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.site-footer__inner {
		flex-direction: row;
		justify-content: space-between;
	}
}


/* 14. Page head
	The row at the top of a data entry page: where you are, the title field,
	and the page's actions at the far end.
	========================================================================== */

.page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 20px;
}

.page-head__path {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 320px;
	min-width: 0;
}

.page-head__sep {
	color: var(--color-muted);
}

.page-head__title {
	flex: 0 1 440px;
	min-width: 0;
	font-weight: 600;
}

.page-head__path .label {
	flex: none;
}

.page-head__name {
	margin: 0;
	font-size: var(--text-title);
}

.page-head__actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

@media (min-width: 900px) {
	.page-head {
		margin-bottom: 28px;
	}
}


/* 15. Editor
	A bordered box: a greyer header strip with Edit and Preview tabs,
	then numbered lines of monospaced text on a white surface.
	========================================================================== */

.editor {
	--editor-font-size: 1rem;           /* 16px stops iOS zooming on focus */
	--editor-line: 24px;

	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
}

@media (min-width: 600px) {
	.editor {
		--editor-font-size: 0.875rem;
		--editor-line: 22px;
	}
}

/* The whole box shows focus while the text is being edited */
.editor:has(.editor__text:focus-visible),
.editor:has(.block__text:focus) {
	border-color: var(--color-cerulean);
	box-shadow: 0 0 0 1px var(--color-cerulean);
}

.editor__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 47px;
	padding-inline: 8px;
	border-bottom: 1px solid var(--color-border);
	border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
	background: var(--color-shade);
}

/* A short line of text in the top bar, such as a format or a count */
.editor__status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 18px;
	margin: 0;
	padding: 8px 4px 8px 8px;
	font-size: var(--text-small);
	list-style: none;
}

.editor__status li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Edit and Preview are two radio buttons drawn as tabs.
	The chosen one carries the banana bar, like the section tabs. */
.editor__tabs {
	position: relative;
	display: flex;
	gap: 4px;
}

.editor__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	margin-block: 8px;
	padding: 5px 12px;
	border-radius: var(--radius);
	font-size: var(--text-small);
	cursor: pointer;
	user-select: none;
}

.editor__tab:hover {
	background: rgba(11, 74, 99, 0.08);
}

.editor__view:checked + .editor__tab {
	font-weight: 600;
}

.editor__view:checked + .editor__tab::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -8px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--color-banana-deep);
}

.editor__view:focus-visible + .editor__tab {
	outline: 2px solid var(--color-cerulean);
	outline-offset: 2px;
}

/* Edit view: line number gutter beside the text */
.editor__edit {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
}

.editor__gutter,
.editor__text,
.editor__mirror,
.editor__read {
	font-family: var(--font-mono);
	font-size: var(--editor-font-size);
	line-height: var(--editor-line);
	tab-size: 3;
}

.editor__gutter {
	min-width: 44px;
	padding-block: 12px;
	color: var(--color-muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
	user-select: none;
}

/* One span per line. Its height is set to match the line beside it,
	so a wrapped line keeps a single number. */
.editor__gutter span {
	display: block;
	padding-inline: 12px;
}

.editor__text {
	display: block;
	width: 100%;
	min-height: 360px;
	margin: 0;
	padding: 12px 16px 12px 4px;
	border: 0;
	border-radius: 0 0 calc(var(--radius) - 1px) 0;
	background: transparent;
	color: var(--color-ink);
	white-space: pre-wrap;
	overflow-wrap: break-word;
	overflow-y: hidden;
	resize: none;
}

.editor__text:focus-visible {
	outline: none;
}

/* Hidden copy of the text, used only to measure how tall each line is */
.editor__mirror {
	position: absolute;
	top: 0;
	left: 0;
	padding: 0 16px 0 4px;
	overflow: hidden;
	visibility: hidden;
	pointer-events: none;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

.editor--nowrap .editor__text {
	white-space: pre;
	overflow-x: auto;
}

.editor--nowrap .editor__mirror {
	white-space: pre;
}

/* The same edit view in the page's own font, for lists.
	The gutter then holds a bullet for each line. */
.editor__edit--prose .editor__gutter,
.editor__edit--prose .editor__text,
.editor__edit--prose .editor__mirror {
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 26px;
}

/* A box that is only as tall as its content */
.editor--compact .editor__text {
	min-height: 0;
}

/* View mode, plain text: the same numbered lines, read-only */
.editor__read {
	padding-block: 12px;
	counter-reset: line;
}

.editor__line {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	column-gap: 4px;
	min-height: var(--editor-line);
	padding-right: 16px;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	counter-increment: line;
}

.editor__line::before {
	content: counter(line);
	padding-inline: 12px;
	color: var(--color-muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
	user-select: none;
}

/* View mode, everything else: content shown as a formatted page */
.editor__body {
	padding: 14px 24px 16px;
}

/* Tabs in the top bar that swap the content below, such as a recipe's three parts */
.tab-panel {
	display: none;
}

.editor:has(.editor__view[value="ingredients"]:checked) .tab-panel[data-tab="ingredients"],
.editor:has(.editor__view[value="prep"]:checked) .tab-panel[data-tab="prep"],
.editor:has(.editor__view[value="instructions"]:checked) .tab-panel[data-tab="instructions"] {
	display: block;
}

/* Preview view replaces the edit view and the wrap setting */
.editor__preview {
	display: none;
	min-height: 384px;
	padding: 20px 24px 24px;
}

.editor:has(.editor__view[value="preview"]:checked) .editor__preview {
	display: block;
}

.editor:has(.editor__view[value="preview"]:checked) .editor__edit,
.editor:has(.editor__view[value="preview"]:checked) .editor__options {
	display: none;
}

/* Line of small print under the editor */
.editor-note {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 24px;
	margin: 10px 0 0;
	color: var(--color-muted);
	font-size: var(--text-meta);
}

.editor-note p {
	margin: 0;
}


/* 16. Rendered text
	Content the EndUser wrote, shown as a formatted page.
	========================================================================== */

.prose {
	max-width: 72ch;
}

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

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

.prose h1 {
	margin: 0 0 0.5em;
	font-size: var(--text-h2);
}

.prose h2 {
	margin: 1.6em 0 0.5em;
	font-size: var(--text-title);
}

/* Formatted Knowledge keeps each line the EndUser typed on its own line */
.prose--lines p {
	margin-bottom: 0.3em;
}

.prose--lines h2 {
	margin-top: 1.2em;
}

.prose h3 {
	margin: 1.4em 0 0.4em;
	font-size: var(--text-body);
}

.prose ul,
.prose ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

.prose li {
	margin-bottom: 0.3em;
}

.prose code {
	padding: 0.15em 0.4em;
	border-radius: 4px;
	background: var(--color-shade);
}


/* 17. Dialog
	An overlay for short data entry, built on the native <dialog> element.
	Same colors as the editor box: greyer top bar, white body, thin border.
	========================================================================== */

.dialog {
	width: min(480px, calc(100vw - 32px));
	max-height: min(640px, 85vh);
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	color: var(--color-ink);
	box-shadow: 0 16px 48px rgba(11, 74, 99, 0.22);
}

.dialog::backdrop {
	background: rgba(11, 74, 99, 0.4);
}

.dialog[open] {
	animation: dialog-in 140ms ease-out;
}

@keyframes dialog-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.dialog[open] {
		animation: none;
	}
}

/* The page behind stays put while a dialog is open */
html:has(dialog[open]) {
	overflow: hidden;
}

.dialog__form {
	display: flex;
	flex-direction: column;
	max-height: inherit;
}

.dialog__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 8px 6px 20px;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-shade);
}

.dialog__title {
	margin: 0;
	font-size: var(--text-body);
	font-weight: 600;
}

/* Close button: a borderless icon button with a drawn X */
.dialog__close {
	border-color: transparent;
}

.dialog__close::before,
.dialog__close::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 1.5px;
	border-radius: 1px;
	background: currentColor;
}

.dialog__close::before {
	transform: rotate(45deg);
}

.dialog__close::after {
	transform: rotate(-45deg);
}

.dialog__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 14px 20px 16px;
	overflow-y: auto;
}

.dialog__body .field {
	margin-bottom: 0;
}

.dialog__body .field-row {
	row-gap: 14px;
}

.dialog__error {
	margin: 0;
	color: var(--color-danger);
	font-size: var(--text-small);
}

.dialog__footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 20px;
	border-top: 1px solid var(--color-border-muted);
}

@media (max-width: 419px) {
	.dialog__body {
		padding: 12px 16px 16px;
	}

	.dialog__footer {
		flex-direction: column-reverse;
		padding-inline: 16px;
	}

	.dialog__footer .btn {
		width: 100%;
		min-height: 40px;
	}
}


/* 18. Page message
	One line at the top of a page confirming what just happened.
	========================================================================== */

.page-message {
	margin: 0 0 16px;
	padding: 9px 14px;
	border: 1px solid var(--color-banana-edge);
	border-radius: var(--radius);
	background: var(--color-banana-soft);
	font-size: var(--text-small);
}


/* 19. Landing page
	The signed-out home page: a short pitch beside a sample of the wiki,
	then plain bands of text separated by hairlines.
	========================================================================== */

/* Signed-out header: one row, no section tabs */
.site-header--public .site-header__inner {
	padding-block: 12px;
}

.site-header__link {
	padding-inline: 6px;
	color: var(--color-ink);
	font-size: var(--text-small);
	font-weight: 600;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
	padding-block: 16px 40px;
}

.hero__headline {
	margin: 0 0 16px;
	font-size: clamp(2rem, 1.25rem + 3.2vw, 3rem);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.hero__lede {
	max-width: 46ch;
	margin: 0 0 24px;
	font-size: 1.125rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.hero__note {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

@media (min-width: 900px) {
	.hero {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		align-items: center;
		gap: 64px;
		padding-block: 32px 72px;
	}
}

/* A sample of the wiki, drawn with the real list rows */
.sample {
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

.sample__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-shade);
	font-size: var(--text-small);
	font-weight: 600;
}

.sample__bar .icon {
	color: var(--color-muted);
}

.sample__tag {
	margin-left: auto;
	color: var(--color-muted);
	font-weight: 400;
}

.sample .item-list {
	padding-inline: 20px;
}

.sample .item:last-child {
	border-bottom: 0;
}

.sample .item__title {
	color: var(--color-cerulean);
}

/* A band is one full-width section of the landing page */
.band {
	padding-block: 40px;
	border-top: 1px solid var(--color-border-muted);
}

.band__title {
	margin: 0 0 20px;
	font-size: var(--text-h2);
}

@media (min-width: 900px) {
	.band {
		padding-block: 56px;
	}
}

/* Features: a ruled grid of name and one sentence */
.feature-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 48px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.feature {
	padding-block: 18px;
	border-top: 1px solid var(--color-border-muted);
}

.feature__name {
	margin: 0 0 4px;
	font-size: 1.125rem;
}

.feature__text {
	margin: 0;
	font-size: 0.9375rem;
}

@media (min-width: 600px) {
	.feature-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.feature-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Two blocks of text side by side */
.split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px 64px;
}

.split__title {
	margin: 0 0 6px;
	font-size: var(--text-title);
}

.split__text {
	max-width: 52ch;
	margin: 0;
}

@media (min-width: 900px) {
	.split {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Closing band: a sentence and the sign-up button */
.cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 32px;
}

.cta .band__title {
	margin-bottom: 6px;
}

.cta__text {
	margin: 0;
}


/* 20. Type-specific editors
	The pieces that go inside the editor box for each type of entity:
	formatted text with tags, to-do rows, and rows with columns.
	========================================================================== */

/* Something that turns into an edit box when clicked */
.editable {
	display: block;
	width: 100%;
	padding: 6px 8px;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: text;
}

.editable:hover {
	background: rgba(11, 74, 99, 0.06);
}

/* Formatted text, edit mode: one row per line, with a tag at the left edge
	saying what the line is. The tag is a small colored drop-down. */
.blocks {
	margin: 0;
	padding: 10px 16px 14px 12px;
	list-style: none;
}

.block {
	--tag-fill: var(--color-shade);
	--tag-edge: var(--color-border);

	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	align-items: baseline;
	column-gap: 8px;
	padding-block: 3px;
}

.block[data-type="title"] {
	--tag-fill: var(--tag-title);
	--tag-edge: var(--tag-title-edge);
}

.block[data-type="heading"] {
	--tag-fill: var(--tag-heading);
	--tag-edge: var(--tag-heading-edge);
}

.block[data-type="bold"] {
	--tag-fill: var(--tag-bold);
	--tag-edge: var(--tag-bold-edge);
}

.block[data-type="link"] {
	--tag-fill: var(--tag-link);
	--tag-edge: var(--tag-link-edge);
}

.tag {
	-webkit-appearance: none;
	appearance: none;
	justify-self: start;
	max-width: 100%;
	padding: 0 20px 0 8px;
	border: 1px solid var(--tag-edge);
	border-radius: var(--radius);
	background: var(--tag-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0h8L4 5z' fill='%230B4A63' fill-opacity='.6'/%3E%3C/svg%3E") no-repeat right 7px center;
	color: var(--color-ink);
	font-family: inherit;
	font-size: var(--text-tiny);
	font-weight: 600;
	line-height: 20px;
	cursor: pointer;
}

.block__text {
	min-width: 0;
	padding: 2px 6px;
	border-radius: 4px;
	outline: none;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.block__text:focus {
	background: rgba(0, 123, 167, 0.07);
}

.block__text:empty::before {
	content: attr(data-placeholder);
	color: var(--color-muted);
}

.block[data-type="title"] .block__text {
	font-size: var(--text-h2);
	font-weight: 600;
	line-height: 1.25;
}

.block[data-type="heading"] .block__text {
	font-size: var(--text-title);
	font-weight: 600;
	line-height: 1.3;
}

.block[data-type="bold"] .block__text {
	font-weight: 600;
}

.block[data-type="link"] .block__text {
	color: var(--color-cerulean);
	text-decoration: underline;
}

/* A Link line also has a box for the address it points to */
.block__url {
	display: none;
	grid-column: 2;
	max-width: 420px;
	margin: 4px 0 4px 6px;
}

.block[data-type="link"] .block__url {
	display: block;
}

/* To-do rows: a status box, then the text. No gaps between statuses. */
.todo {
	margin: 0;
	padding: 0;
	list-style: none;
}

.todo__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 2px;
	padding: 3px 12px 3px 8px;
	border-bottom: 1px solid var(--color-border-muted);
}

.todo__row:last-child {
	border-bottom: 0;
}

.todo__row[data-status="done"] .editable {
	color: var(--color-muted);
	text-decoration: line-through;
}

/* The three status marks. The same colors are used in the count above the rows. */
.status--attention,
.todo__row[data-status="attention"] .icon-toggle {
	--icon-fill: var(--color-banana);
	--icon-mark: var(--color-ink);
	color: var(--color-banana-edge);
}

.status--open,
.todo__row[data-status="open"] .icon-toggle {
	color: var(--color-border-control);
}

.status--done,
.todo__row[data-status="done"] .icon-toggle {
	--icon-fill: var(--color-done-soft);
	color: var(--color-done);
}

/* Rows with columns, such as named events and recipe ingredients */
.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.data-table th {
	padding: 8px 12px;
	border-bottom: 1px solid var(--color-border-muted);
	color: var(--color-muted);
	font-size: var(--text-meta);
	font-weight: 600;
	text-align: left;
	white-space: nowrap;
}

.data-table td {
	height: 44px;
	padding: 4px 12px;
	border-bottom: 1px solid var(--color-border-muted);
}

.data-table tbody tr:last-child td {
	border-bottom: 0;
}

/* Cells whose content is a click-to-edit button or an edit box sit closer to the edge */
.data-table--editable th {
	padding-inline: 12px;
}

.data-table--editable td {
	padding-inline: 4px;
}

.data-table__icon {
	width: 44px;
}

.data-table td.data-table__icon {
	padding-inline: 8px 0;
}

.data-table__date {
	width: 172px;
}

.data-table__short {
	width: 22%;
}

/* Column heading that sorts the rows when clicked */
.sort {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: -2px -6px;
	padding: 2px 6px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.sort:hover {
	background: rgba(11, 74, 99, 0.08);
}

.sort::after {
	content: "";
	border: 4px solid transparent;
	border-top-width: 0;
	border-bottom-color: transparent;
}

th[aria-sort] .sort {
	color: var(--color-ink);
}

th[aria-sort="ascending"] .sort::after {
	border-bottom-color: currentColor;
}

th[aria-sort="descending"] .sort::after {
	border-width: 4px 4px 0;
	border-top-color: currentColor;
}

/* Month and day side by side, for a date with no year */
.date-fields {
	display: flex;
	gap: 6px;
}

.date-fields .input {
	width: 64px;
}


/* 21. Reference sheet
	Used only by types.html, the page that shows every type of entity in
	view mode and in edit mode. Not part of the app.
	========================================================================== */

.type {
	margin-bottom: 48px;
	scroll-margin-top: 16px;
}

.type__ref {
	margin: 0 0 14px;
	padding-top: 14px;
	border-top: 1px solid var(--color-border-muted);
	color: var(--color-muted);
	font-size: var(--text-meta);
	font-weight: 600;
}

.type .page-head {
	min-height: var(--control-height);
	margin-bottom: 12px;
}

/* Each section shows one mode at a time */
.type[data-mode="view"] .when-edit,
.type[data-mode="edit"] .when-view {
	display: none !important;
}

.ref-intro {
	max-width: 68ch;
	margin: 0 0 28px;
}

@media (min-width: 900px) {
	.side-nav--sticky {
		position: sticky;
		top: 24px;
		align-self: start;
	}
}


/* 22. Steps
	Where the EndUser is in a short sequence, such as signing up.
	Shown, not clicked. The current step carries the banana bar, like a tab.
	========================================================================== */

.steps {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 0 18px;
	font-size: var(--text-small);
	list-style: none;
}

.steps__step {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 6px;
	color: var(--color-muted);
	white-space: nowrap;
}

/* A short line joins each step to the one before it */
.steps__step + .steps__step {
	margin-left: 26px;
}

.steps__step + .steps__step::before {
	content: "";
	position: absolute;
	left: -20px;
	top: 50%;
	width: 14px;
	height: 1px;
	background: var(--color-border-control);
}

/* The number in a circle. A finished step shows a check mark instead. */
.steps__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	flex: none;
	border: 1px solid var(--color-border-control);
	border-radius: 50%;
	font-size: var(--text-tiny);
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.steps__mark .icon {
	width: 12px;
	height: 12px;
	stroke-width: 2;
}

.steps__step[data-state="done"] {
	color: var(--color-ink);
}

.steps__step[data-state="done"] .steps__mark {
	border-color: var(--color-done);
	background: var(--color-done-soft);
	color: var(--color-done);
}

.steps__step[aria-current="step"] {
	color: var(--color-ink);
	font-weight: 600;
}

.steps__step[aria-current="step"] .steps__mark {
	border-color: var(--color-banana-edge);
	background: var(--color-banana);
}

.steps__step[aria-current="step"]::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--color-banana-deep);
}

/* On a narrow screen only the current step keeps its words */
@media (max-width: 599px) {
	.steps {
		padding-inline: 10px;
	}

	.steps__step:not([aria-current="step"]) .steps__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
}


/* 23. Notice page
	A page that says one thing, such as "Check your email". One narrow box
	in the upper part of the page, with the footer held at the bottom.
	========================================================================== */

/* Put this on <body> for a page with little content, so the footer
	sits at the bottom of the window and not halfway up it */
.page-fill {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.page-fill > main {
	flex: 1 0 auto;
}

.notice-page {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: clamp(24px, 11vh, 112px) 40px;
}

/* The box: same family as the editor and the dialog.
	Greyer top bar, white body, thin border. */
.notice {
	width: 100%;
	max-width: 560px;
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-large);
	background: var(--color-surface);
}

.notice__bar {
	border-bottom: 1px solid var(--color-border);
	background: var(--color-shade);
}

.notice__body {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 18px;
	padding: 26px 24px 24px;
}

/* The icon sits on a tile shaped and colored like the logo mark */
.notice__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--color-cerulean);
	color: var(--color-banana);
}

.notice__icon .icon {
	width: 26px;
	height: 26px;
	stroke-width: 1.4;
}

.notice__title {
	margin: 1px 0 8px;
	font-size: var(--text-h2);
	line-height: 1.2;
	text-wrap: balance;
}

.notice__text {
	margin: 0;
}

.notice__text strong {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.notice__detail {
	margin: 10px 0 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

.notice__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 12px 24px;
	border-top: 1px solid var(--color-border-muted);
}

.notice__help {
	margin: 0;
	color: var(--color-muted);
	font-size: var(--text-small);
}

.notice__actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

/* One quiet line under the box for the way out */
.notice-alt {
	width: 100%;
	max-width: 560px;
	margin: 14px 0 0;
	padding-inline: 25px;
	color: var(--color-muted);
	font-size: var(--text-small);
}

@media (max-width: 419px) {
	.notice__body {
		column-gap: 14px;
		padding: 20px 16px;
	}

	.notice__icon {
		width: 40px;
		height: 40px;
		border-radius: 10px;
	}

	.notice__icon .icon {
		width: 22px;
		height: 22px;
	}

	.notice__title {
		font-size: var(--text-title);
	}

	.notice__footer {
		padding-inline: 16px;
	}

	.notice__actions {
		width: 100%;
	}

	.notice__actions .btn {
		width: 100%;
		min-height: 40px;
	}

	.notice-alt {
		padding-inline: 17px;
	}
}

/* Used only by notice.html: the strip that switches between examples.
	Not part of the app. */
.proto {
	width: 100%;
	max-width: 560px;
	margin-top: auto;
	padding-top: 56px;
}

.proto__label {
	margin: 0 0 8px;
	color: var(--color-muted);
	font-size: var(--text-meta);
}

.proto__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.proto .btn[aria-pressed="true"] {
	border-color: var(--color-banana-edge);
	background: var(--color-banana-soft);
}


/* ==========================================================================
	Post Launch Addition 3: phone layout for the asset list.
	Append everything below to the end of static/styles.css, after section 23,
	unchanged. Then add these three lines to the Contents list at the top:
		24. Compact layout
		25. Search in the header
		26. Filters button, icon only
	and this line under Breakpoints:
		899px and below: compact layout (menu drawer, Filters sheet, summary line). See section 24.
	========================================================================== */


/* 24. Compact layout
	Phones and small tablets, below 900px. Same markup as the desktop; no script.
	- The section tabs become a drawer, opened by the menu button in the header
	- The left grouping becomes the Filters sheet, opened by the Filters button,
	  and a one-line summary of the current filters stands in for it
	The drawer and the sheet use the browser's popover attribute, which opens
	and closes them (including Escape and a tap outside) without any script.
	At 900px and up both are ordinary page sections again.
	========================================================================== */

/* Pieces that exist only for the compact layout */
.site-header__menu,
.site-nav__head,
.filter-bar__filters,
.summary-line,
.side-nav__sheet-head,
.side-nav__section--compact {
	display: none;
}

/* The browser draws a popover as a floating box. At 900px and up the
	section tabs and the left grouping are not floating, so undo that. */
@media (min-width: 900px) {
	.site-nav[popover],
	.side-nav[popover] {
		position: static;
		inset: auto;
		width: auto;
		height: auto;
		margin-block: 0;
		border: 0;
		background: transparent;
		color: inherit;
	}

	.site-nav[popover] {
		display: block;
		padding-block: 0;
	}

	.side-nav[popover] {
		display: block;
		margin: 0;
		padding: 0;
		overflow: visible;
	}
}

@media (max-width: 899px) {

	/* ----- Header: one row, with a menu button at the far right ----- */

	.site-header__inner {
		padding-block: 10px;
	}

	.site-header__menu {
		display: inline-flex;
	}

	/* Closed, the drawer and the sheet take no space at all */
	.site-nav[popover]:not(:popover-open),
	.side-nav--sheet:not(:popover-open) {
		display: none;
	}

	/* The footer's seven links wrap instead of pushing the page wider than the screen */
	.site-footer__nav {
		flex-wrap: wrap;
		gap: 6px 20px;
	}

	/* ----- Drawer: the section tabs, sliding in from the right ----- */

	.site-nav:popover-open {
		position: fixed;
		inset: 0 0 0 auto;
		width: min(300px, 85vw);
		height: 100%;
		max-width: none;
		max-height: none;
		margin: 0;
		padding: 0;
		border: 0;
		border-left: 1px solid var(--color-border);
		background: var(--color-surface);
		color: var(--color-ink);
		overflow-y: auto;
	}

	.site-nav::backdrop,
	.side-nav--sheet::backdrop {
		background: rgba(11, 74, 99, 0.4);
	}

	/* Same greyer bar as the dialog, the editor and the sheet */
	.site-nav__head,
	.side-nav--sheet .side-nav__sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: sticky;
		top: 0;
		z-index: 1;
		padding: 8px var(--page-gutter);
		border-bottom: 1px solid var(--color-border);
		background: var(--color-shade);
	}

	.site-nav__title,
	.side-nav__sheet-title {
		margin: 0;
		font-size: var(--text-body);
		font-weight: 600;
	}

	.site-nav:popover-open .site-nav__list {
		flex-direction: column;
		gap: 0;
		margin: 0;
		padding-block: 6px;
	}

	.site-nav:popover-open .site-nav__link {
		margin: 0;
		padding: 11px var(--page-gutter);
		border-radius: 0;
		font-size: var(--text-body);
	}

	.site-nav:popover-open .site-nav__link .counter {
		margin-left: auto;
	}

	/* The current section: shaded, with the banana bar at its left edge */
	.site-nav:popover-open .site-nav__link[aria-current="page"] {
		background: var(--color-shade);
	}

	.site-nav:popover-open .site-nav__link[aria-current="page"]::after {
		top: 7px;
		bottom: 7px;
		left: 0;
		right: auto;
		width: 4px;
		height: auto;
		border-radius: 0 2px 2px 0;
	}


	/* ----- Filter bar: Filters, the summary line, and New on one row ----- */

	.filter-bar {
		flex-wrap: nowrap;
		align-items: center;
	}

	.filter-bar .menu--select {
		display: none;
	}

	.filter-bar__filters {
		display: inline-flex;
		flex: none;
	}

	.filter-bar .menu--right {
		flex: none;
	}

	/* The filters that are set, as plain text with an icon or dot and an x.
		No border and no fill. Scrolls sideways rather than wrapping. */
	.summary-line {
		display: flex;
		align-items: center;
		gap: 4px 14px;
		flex: 1 1 auto;
		min-width: 0;
		margin: 0;
		padding: 0 2px;
		overflow-x: auto;
		list-style: none;
		scrollbar-width: none;
	}

	.summary-line::-webkit-scrollbar {
		display: none;
	}

	.summary-line__item {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		flex: none;
		font-size: var(--text-small);
		white-space: nowrap;
	}

	.summary-line__item .icon {
		color: var(--color-muted);
	}


	/* ----- Filters sheet: the left grouping, sliding up from the bottom ----- */

	.side-nav--sheet:popover-open {
		display: block;
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		max-width: none;
		max-height: min(85vh, 680px);
		margin: 0;
		padding: 0 var(--page-gutter) 20px;
		border: 0;
		border-radius: 12px 12px 0 0;
		background: var(--color-surface);
		color: var(--color-ink);
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.side-nav--sheet .side-nav__sheet-head {
		margin: 0 calc(-1 * var(--page-gutter)) 14px;
	}

	.side-nav--sheet .side-nav__section,
	.side-nav--sheet .side-nav__section--compact {
		display: block;
		margin-bottom: 18px;
	}

	/* Headings line up with the words of the entries below them */
	.side-nav--sheet .side-nav__heading,
	.side-nav--sheet .side-nav__subheading {
		margin: 0 0 4px;
		padding-inline: 13px;
	}

	.side-nav--sheet .side-nav__subheading {
		margin-top: 10px;
		color: var(--color-muted);
		font-size: var(--text-meta);
		font-weight: 600;
	}

	/* Two columns, filled down the first column, then the second: seven entries
		make four in the first column and three in the second. --rows is half the
		number of entries, rounded up, worked out by the :has() lines below for
		lists of up to 24 entries. */
	.side-nav--sheet .side-nav__list {
		--rows: 1;

		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: repeat(var(--rows), auto);
		grid-auto-flow: column;
		column-gap: 8px;
		padding: 0;
		overflow: visible;
	}

	.side-nav--sheet .side-nav__list:has(> li:nth-child(3)) { --rows: 2; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(5)) { --rows: 3; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(7)) { --rows: 4; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(9)) { --rows: 5; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(11)) { --rows: 6; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(13)) { --rows: 7; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(15)) { --rows: 8; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(17)) { --rows: 9; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(19)) { --rows: 10; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(21)) { --rows: 11; }
	.side-nav--sheet .side-nav__list:has(> li:nth-child(23)) { --rows: 12; }

	/* An entry is plain text. Only the selected one keeps the banana pill. */
	.side-nav--sheet .side-nav__link {
		width: fit-content;
		max-width: 100%;
		margin-block: 1px;
		padding: 6px 12px;
		border-color: transparent;
		background: transparent;
	}

	.side-nav--sheet .side-nav__link[aria-current="true"] {
		border-color: var(--color-banana-edge);
		background: var(--color-banana-soft);
	}

	/* Shared with: the first and last entries (Anyone and Only you) make the
		first column; the Groups between them make the second */
	.side-nav--sheet .side-nav__list--ends {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-rows: none;
		grid-auto-flow: row dense;
	}

	.side-nav--sheet .side-nav__list--ends > li {
		grid-column: 2;
	}

	.side-nav--sheet .side-nav__list--ends > li:first-child,
	.side-nav--sheet .side-nav__list--ends > li:last-child {
		grid-column: 1;
	}

	/* Sort by: three entries on one line, at the left, centre and right */
	.side-nav--sheet .side-nav__list--spread {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-rows: none;
		grid-auto-flow: row;
	}

	.side-nav--sheet .side-nav__list--spread > li:nth-child(2) {
		justify-self: center;
	}

	.side-nav--sheet .side-nav__list--spread > li:last-child {
		justify-self: end;
	}
}

/* A small round x that removes one filter from the summary line */
.chip__clear {
	position: relative;
	display: inline-flex;
	width: 22px;
	height: 22px;
	flex: none;
	margin-left: -2px;
	border-radius: 50%;
	color: var(--color-muted);
}

.chip__clear:hover {
	background: var(--color-shade);
}

.chip__clear::before,
.chip__clear::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 10.25px;
	width: 10px;
	height: 1.5px;
	border-radius: 1px;
	background: currentColor;
}

.chip__clear::before {
	transform: rotate(45deg);
}

.chip__clear::after {
	transform: rotate(-45deg);
}


/* 25. Search in the header
	600px and up: the search box sits in the header row.
	Below 600px: only the magnifier shows. Pressing it opens the same search
	box as a bar across the top of the screen (a popover), so there is still
	only one search box in the page. Escape, Cancel or a tap outside closes it.
	========================================================================== */

.site-search__cancel {
	display: none;
}

@media (min-width: 600px) {
	.site-search[popover] {
		position: relative;
		inset: auto;
		width: auto;
		height: auto;
		margin: 0 0 0 12px;
		padding: 0;
		border: 0;
		background: transparent;
		color: inherit;
		overflow: visible;
	}
}

@media (max-width: 599px) {
	.site-search:popover-open {
		display: flex;
		align-items: center;
		gap: 8px;
		position: fixed;
		inset: 0 0 auto 0;
		width: 100%;
		max-width: none;
		height: auto;
		margin: 0;
		padding: 10px var(--page-gutter);
		border: 0;
		border-bottom: 1px solid var(--color-border);
		background: var(--color-shade);
		color: var(--color-ink);
	}

	.site-search::backdrop {
		background: rgba(11, 74, 99, 0.4);
	}

	.site-search:popover-open .icon {
		left: calc(var(--page-gutter) + 10px);
	}

	.site-search:popover-open .input {
		flex: 1 1 auto;
		min-width: 0;
	}

	.site-search:popover-open .site-search__cancel {
		display: inline-flex;
		flex: none;
	}
}


/* 26. Filters button, icon only
	When two or more filters are set, the Filters button drops its word and
	count, leaving room for the summary line. One filter or none: the full button.
	========================================================================== */

@media (max-width: 899px) {
	.filter-bar:has(.summary-line__item:nth-child(2)) .filter-bar__filters {
		width: var(--control-height);
		padding: 0;
	}

	.filter-bar:has(.summary-line__item:nth-child(2)) .filter-bar__filters-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}
}


/* 27. The page behind an open popover does not scroll
	A popover is not modal, so the browser lets the page behind the search bar, the drawer or the
	Filters sheet keep scrolling. While one is open, the page stays where it is.
	========================================================================== */

html:has(:popover-open) {
	overflow: hidden;
}


/* ==========================================================================
	Post Launch Fix 4: the List editor on a phone.
	Append everything below to the end of static/styles.css, after section 27,
	unchanged. Then add this line to the Contents list at the top:
		28. Editing in place, on a phone
	========================================================================== */


/* 28. Editing in place, on a phone
	Below 900px the action buttons (Delete, Cancel, Save) move down to sit directly above the
	editor box: title, then Category and "Shared with", then the buttons, then the editor.
	The markup does not change, so 900px and up is exactly as before. The form, its page-head,
	its layout and the layout's right-hand column stop drawing boxes of their own
	(display: contents), which lets their pieces be put in order as one column.
	Put the class editor-form on any form that should do this.
	========================================================================== */

@media (max-width: 899px) {
	.editor-form {
		display: flex;
		flex-direction: column;
	}

	.editor-form > .page-head,
	.editor-form > .layout,
	.editor-form > .layout > div {
		display: contents;
	}

	/* 1. The title row, and its error message */
	.editor-form .page-head__path {
		order: 1;
		flex: none;
		margin-bottom: 14px;
	}

	.editor-form > .field__error {
		order: 2;
		margin: -8px 0 12px;
	}

	/* 2. Category and "Shared with" */
	.editor-form .side-nav {
		order: 3;
		margin-bottom: 14px;
	}

	/* 3. The buttons: Delete at the left, away from Save; Cancel and Save at the right */
	.editor-form .page-head__actions {
		order: 4;
		margin: 0 0 10px;
	}

	.editor-form .page-head__actions > [data-open-dialog] {
		margin-right: auto;
	}

	/* 4. The editor box and everything under it */
	.editor-form > .layout > div > * {
		order: 5;
	}
}


/* ==========================================================================
	Post Launch Fix 5: the Events page.
	Append everything below to the end of static/styles.css, after section 28,
	unchanged. Then add this line to the Contents list at the top:
		29. Events
	========================================================================== */


/* 29. Events
	The Events table is read-only. A tap or click on a row opens the event's
	dialog (Edit event); the plus sign opens the same dialog empty (New event).
	The trash can at the end of a row asks once, in a small dialog, then
	deletes. Below 640px the table is drawn as a list, one event per row, in
	the style of the asset list: the kind's icon at the left, the title (and
	its Group) on the first line, the date and time under it in the smaller
	grey style, and the trash can at the right. The sort headings stay, as one
	short line above the rows. 640px and up is a table, as before.
	========================================================================== */

/* The trash can column: as narrow as its button */
.event__delete {
	width: 44px;
	text-align: right;
}

.data-table td.event__delete {
	padding-inline: 0 4px;
}

.event__delete .icon-btn {
	color: var(--color-muted);
}

.event__delete .icon-btn:hover {
	color: var(--color-danger);
}

/* The event dialog: the date's three boxes on one line, and Kind beside Shared with */
#event-dialog .date-fields {
	display: flex;
	gap: 6px;
}

#event-dialog .date-fields .input {
	width: 72px;
}

#event-dialog .date-fields .input--year {
	width: 84px;
}

#event-dialog .field-row .select {
	width: 100%;
}

#event-dialog .field-row .field--inline {
	align-self: end;
	min-height: var(--control-height);
}

#event-dialog .event__clock .input {
	width: 64px;
}

@media (max-width: 639px) {
	#event-area .data-table,
	#event-area .data-table thead,
	#event-area .data-table tbody {
		display: block;
	}

	/* The sort headings: "From today" and "Name" on one line */
	#event-area .data-table thead tr {
		display: flex;
		gap: 20px;
		padding: 8px 12px;
		border-bottom: 1px solid var(--color-border-muted);
	}

	#event-area .data-table thead th {
		padding: 0;
		border: 0;
	}

	#event-area .data-table thead th.data-table__icon,
	#event-area .data-table thead th.event__time,
	#event-area .data-table thead th.event__delete {
		display: none;
	}

	/* One event: icon | title, then date and time under it | trash can */
	#event-area .event-row {
		display: grid;
		grid-template-columns: 44px auto minmax(0, 1fr) auto;
		grid-template-areas:
			"kind text text delete"
			"kind date time delete";
		align-items: center;
		padding: 8px 4px 8px 0;
		border-bottom: 1px solid var(--color-border-muted);
	}

	#event-area .event-row:last-child {
		border-bottom: 0;
	}

	#event-area .event-row td {
		display: block;
		height: auto;
		padding: 0;
		border: 0;
	}

	#event-area .event-row td.data-table__icon {
		grid-area: kind;
		width: auto;
		padding-left: 8px;
	}

	#event-area .event-row td:nth-child(2) {
		grid-area: date;
	}

	#event-area .event-row td:nth-child(3) {
		grid-area: text;
	}

	#event-area .event-row td.event__time {
		grid-area: time;
		width: auto;
	}

	#event-area .event-row td.event__delete {
		grid-area: delete;
		width: auto;
	}

	#event-area .event-row .editable {
		width: auto;
		padding: 2px 6px;
	}

	#event-area .event-row td:nth-child(2) .editable,
	#event-area .event-row td.event__time .editable {
		color: var(--color-muted);
		font-size: var(--text-small);
	}

	#event-area .event-row td.event__time .editable {
		padding-left: 0;
	}
}
