:root {
	--ink: #1f2933;
	--muted: #6b7280;
	--line: #d9dee3;
	--accent: #2563eb;
	--danger: #b91c1c;
	--bg: #f9fafb;
	/* the top bar's height: the sidebar starts under it */
	--topbar: 3.5rem;
	--sidebar: 13rem;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ink);
	background: var(--bg);
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: var(--topbar);
	padding: 0 1rem;
	background: #fff;
	border-bottom: 1px solid var(--line);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--ink);
	text-decoration: none;
}

.whoami {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}

/* the account menu: the avatar and name open it */
.account {
	position: relative;
}

.account-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0.2rem 0.4rem;
	border-radius: 999px;
	white-space: nowrap;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
	background: #f3f4f6;
}

.account-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 0.4rem);
	z-index: 20;
	min-width: 18rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
}

.account-menu[hidden] {
	display: none;
}

.account-details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.35rem 1rem;
	margin: 0;
	font-size: 0.9rem;
}

.account-details dt {
	color: var(--muted);
	white-space: nowrap;
}

.account-details dd {
	margin: 0;
	/* an id or an email is never split over two lines: the menu widens instead */
	white-space: nowrap;
}

/* every way the person signs in, under the details */
.account-heading {
	margin: 0.9rem 0 0.5rem;
	padding-top: 0.75rem;
	font-size: 0.85rem;
	border-top: 1px solid var(--line);
}

.account-logins {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.account-login {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
}

.login-icon {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 0.1rem;
}

.account-login-name {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	font-weight: 600;
	font-size: 0.9rem;
}

.account-login-meta,
.account-note {
	color: var(--muted);
	font-size: 0.8rem;
	/* an id or an email is never split over two lines: the menu widens instead */
	white-space: nowrap;
}

.account-note {
	max-width: 22rem;
	margin: 0.75rem 0 0;
	line-height: 1.4;
	white-space: normal;
}

.badge {
	padding: 0.05rem 0.45rem;
	border-radius: 999px;
	background: #e8eefc;
	color: var(--accent);
	font-size: 0.7rem;
	font-weight: 600;
}

/* on a phone the name is not at the right edge: the panel spans the screen under the top bar */
@media (width <= 600px) {
	.account {
		position: static;
	}

	.account-menu {
		position: fixed;
		top: 3.5rem;
		right: 1rem;
		left: 1rem;
		min-width: 0;
		overflow-x: auto;
	}

	/* the top bar's Settings and Sign out keep only their icons */
	.button-label {
		display: none;
	}
}

button.with-icon {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

/* the top bar's Settings and Sign out: quiet, like the account button beside them */
.topbar button.with-icon {
	padding: 0.3rem 0.6rem;
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 999px;
}

.topbar button.with-icon:hover {
	background: #f3f4f6;
}

button.with-icon .login-icon,
.account-button .login-icon {
	margin-top: 0;
}

/* the settings dialog: one field, its hint under it */
.settings {
	width: min(28rem, calc(100vw - 2rem));
}

.settings label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}

.settings input {
	width: 100%;
	font: inherit;
}

.settings-hint {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	color: var(--muted);
}

.content {
	max-width: 1100px;
	margin: 0 auto;
	/* room under the last row so the + button never hides it */
	padding: 1rem 1.5rem 6rem;
}

/* ─── landing page ─────────────────────────────────────────────────────── */

.landing {
	min-height: 100vh;
	background: var(--bg);
}

.landing-grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
	align-items: start;
	min-height: 100vh;
}

.scene {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 2.5rem;
	color: #fff;
	background:
		radial-gradient(60% 40% at 20% 20%, rgb(244 114 182 / 25%), transparent 70%),
		radial-gradient(50% 40% at 80% 80%, rgb(96 165 250 / 25%), transparent 70%),
		linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #0f172a 100%);
}

.scene-art {
	flex: 1;
	min-height: 0;
	width: 100%;
	object-fit: contain;
	object-position: center;
	filter: drop-shadow(0 20px 40px rgb(0 0 0 / 35%));
}

.scene-copy {
	position: relative;
	max-width: 30rem;
	padding: 1.25rem 1.5rem;
	border-radius: 16px;
	background: rgb(15 23 42 / 55%);
	backdrop-filter: blur(6px);
	box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
}

.scene-kicker {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #c7d2fe;
}

.scene-copy h2 {
	margin: 0 0 0.5rem;
	font-size: 1.6rem;
	line-height: 1.2;
}

.scene-copy p {
	margin: 0;
	color: #e0e7ff;
}

.panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.5rem;
	background:
		radial-gradient(40% 30% at 100% 0%, rgb(99 102 241 / 8%), transparent 70%),
		var(--bg);
}

.card {
	width: 100%;
	max-width: 420px;
	padding: 2rem 2rem 1.5rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgb(30 41 59 / 10%);
}

.brand-lg {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.1rem;
	letter-spacing: 0.02em;
	color: var(--muted);
}

.brand-mark {
	width: 26px;
	height: 26px;
}

.card h1 {
	margin: 1rem 0 0.25rem;
	font-size: 1.9rem;
	letter-spacing: -0.02em;
}

.lede {
	margin: 0 0 1.25rem;
	color: var(--muted);
}

/* the three ways in, one tile each: Google, GitHub, Email */
.methods {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
	margin: 0 0 1rem;
}

.method {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: center;
	justify-content: center;
	padding: 1rem 0.5rem;
	color: var(--ink);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.method img {
	width: 32px;
	height: 32px;
}

.method:hover,
.method[aria-expanded="true"] {
	border-color: var(--accent);
	box-shadow: 0 6px 16px rgb(37 99 235 / 14%);
}

.method:active {
	transform: translateY(1px);
}

.method:focus-visible,
.method:focus-within {
	outline: 3px solid rgb(37 99 235 / 35%);
	outline-offset: 2px;
}

.method.off {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
	border-color: var(--line);
}

/* where Google signs in through its own button (drawn by its script), the button lies unseen over the Google tile and takes its clicks */
.gsi-button {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	opacity: 0.01;
}

/* Google's button is 200 by 40: three times that covers the tile */
.gsi-button > div {
	transform: scale(3);
	transform-origin: 0 0;
}

.method.off .gsi-button {
	display: none;
}

.email-form[hidden] {
	display: none;
}

.email-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ink);
}

.field input {
	width: 100%;
	padding: 0.65rem 0.8rem;
	font-weight: 400;
	border-radius: 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgb(37 99 235 / 18%);
}

.password-field {
	position: relative;
	display: block;
}

.password-field input {
	padding-right: 4rem;
}

.password-field .link {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	transform: translateY(-50%);
	font-size: 0.8rem;
}

button.link {
	padding: 0.2rem 0.4rem;
	background: none;
	border: none;
	color: var(--accent);
	font-weight: 600;
}

button.link:hover {
	text-decoration: underline;
}

button.primary {
	margin-top: 0.25rem;
	padding: 0.7rem 1rem;
	font-weight: 600;
	border-radius: 10px;
	background: linear-gradient(135deg, #4f46e5, #2563eb);
	border-color: transparent;
	box-shadow: 0 6px 16px rgb(37 99 235 / 25%);
	transition: transform 0.1s, box-shadow 0.15s;
}

button.primary:hover {
	box-shadow: 0 8px 22px rgb(37 99 235 / 35%);
}

button.primary:active {
	transform: translateY(1px);
}

button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.hint {
	margin: 0;
	font-size: 0.85rem;
	color: var(--muted);
}

.notice {
	margin: 0;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #eff6ff;
	color: #1e40af;
	font-size: 0.9rem;
}

.hint[hidden],
.notice[hidden],
.field[hidden] {
	display: none;
}

.switch {
	margin: 0;
	font-size: 0.85rem;
	text-align: center;
	color: var(--muted);
}

.dev-login {
	margin-top: 1.5rem;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--line);
	border-radius: 10px;
	font-size: 0.85rem;
	color: var(--muted);
}

.dev-row {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.dev-row input {
	flex: 1;
	min-width: 0;
}

.dev-row button {
	white-space: nowrap;
}

.warning {
	color: var(--danger);
}

.card .warning {
	margin: 0 0 1rem;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	font-size: 0.9rem;
}

.landing .footer {
	padding: 1.5rem 0 0;
}

@media (max-width: 900px) {
	.landing-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.scene {
		position: static;
		height: auto;
		padding: 1.5rem;
	}

	.scene-art {
		flex: none;
		height: 300px;
	}

	.scene-copy h2 {
		font-size: 1.25rem;
	}

	.card {
		padding: 1.5rem 1.25rem;
	}
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: flex-end;
	margin-top: 0.75rem;
}

/* the hidden attribute must win over the flex/grid display rules above and below */
.row[hidden],
.movie-results[hidden] {
	display: none;
}

.row label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.row label.wide {
	flex: 1;
}

.row label.wide input {
	width: 100%;
}

input,
select,
button {
	font: inherit;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
}

button {
	cursor: pointer;
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

button.danger {
	background: #fff;
	color: var(--danger);
	border-color: var(--danger);
}

.entries {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.entries th,
.entries td {
	padding: 0.5rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: middle;
}

.entries th {
	font-size: 0.8rem;
	color: var(--muted);
	text-transform: uppercase;
}

.entries td.title {
	font-weight: 600;
}

.entries input[type="number"] {
	width: 4.5rem;
}

.entries input[type="date"] {
	width: 9.5rem;
}

.inline {
	display: inline;
}

.empty {
	color: var(--muted);
}

.footer {
	text-align: center;
	color: var(--muted);
	font-size: 0.8rem;
	padding: 2rem 1rem;
}

.footer p {
	margin: 0.2rem 0;
}

.footer a {
	color: inherit;
}

.footer .inscription {
	font-size: 0.75rem;
}

/* ─── film search (library page) ───────────────────────────────────────── */

.movie-search {
	padding-bottom: 0.75rem;
	margin-bottom: 0.25rem;
	border-bottom: 1px dashed var(--line);
}

.movie-results {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 0.5rem;
}

.movie-results li {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	padding: 0.5rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--bg);
	cursor: pointer;
}

.movie-results li:hover,
.movie-results li:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgb(37 99 235 / 15%);
}

.movie-results img,
.movie-results .no-poster {
	flex: none;
	width: 46px;
	height: 69px;
	border-radius: 4px;
	object-fit: cover;
	background: var(--line);
}

.movie-results .movie-title {
	font-weight: 600;
}

.movie-results .movie-meta {
	font-size: 0.8rem;
	color: var(--muted);
}

.movie-results .movie-overview {
	margin: 0.2rem 0 0;
	font-size: 0.8rem;
	color: var(--ink);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.movie-results button.pick {
	margin-left: auto;
	flex: none;
	padding: 0.3rem 0.6rem;
	font-size: 0.85rem;
}

.picked {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	color: var(--muted);
}

/* a library card's catalog links, under its title */
.world-body > .ids {
	margin: 0.25rem 0 0;
}

.ids {
	display: inline-flex;
	gap: 0.35rem;
	margin-left: 0.4rem;
	vertical-align: middle;
}

.ids a {
	font-size: 0.7rem;
	font-weight: 600;
	padding: 0.05rem 0.35rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--muted);
	text-decoration: none;
}

.ids a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.id-field {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.id-field input {
	width: 11rem;
}

/* values shown, not typed (what a catalog lookup gave, any box until its pencil is pressed):
   greyed; their text can be selected and copied */
.dialog-form .locked select,
.dialog-form .locked .ts-control,
.settings .locked select,
.settings input[readonly] {
	background: #eef0f3;
	border-color: transparent;
	color: var(--muted);
}

.dialog-form label.check.locked {
	color: var(--muted);
}

/* a box and the pencil that frees it, side by side */
.lockable {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.lockable > :not(.lock-edit) {
	flex: 1 1 auto;
	min-width: 0;
}

.date-pick .lock-edit {
	align-self: center;
}

.dialog-form input[readonly] {
	background: #eef0f3;
	border-color: transparent;
	color: var(--muted);
	cursor: text;
	-moz-appearance: textfield;
	appearance: textfield;
}

/* no box of a dialog is highlighted when it is clicked into or reached: the caret says where typing goes */
.settings input:focus,
.settings select:focus,
.dialog-form input:focus,
.dialog-form select:focus,
.dialog-form textarea:focus {
	outline: none;
	box-shadow: none;
}

.dialog-form .ts-wrapper.focus .ts-control {
	border-color: var(--line);
	box-shadow: none;
}

.id-link {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--accent);
	text-decoration: none;
}

.id-link:hover {
	text-decoration: underline;
}

/* ─── concerts, museums, people ─────────────────────────────────────────── */

.world-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	margin-bottom: 1rem;
}

#world-search {
	flex: 1;
	max-width: 28rem;
}

.type-filter {
	position: relative;
}

.filter-button {
	min-width: 8rem;
	padding: 0.35rem 1.6rem 0.35rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%236b7280'/%3E%3C/svg%3E") right 0.3rem center / 18px no-repeat;
	color: var(--ink);
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
}

.type-filter-menu {
	position: absolute;
	z-index: 20;
	top: calc(100% + 4px);
	left: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 12rem;
	padding: 0.5rem 0.75rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgb(0 0 0 / 14%);
}

.type-filter-menu[hidden] {
	display: none;
}

.type-filter-option input {
	flex: none;
	margin: 0;
	padding: 0;
}

.type-filter-option {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	white-space: nowrap;
	cursor: pointer;
}

/* a group's name in the filter menu: Status, Cover */
.type-filter-heading {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
	margin-top: 0.4rem;
}

.type-filter-heading:first-child {
	margin-top: 0;
}

.type-filter-menu .text {
	align-self: flex-start;
	margin-top: 0.25rem;
}

.sort {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
}

/* a control that does not apply here stays in its place, greyed out */
.world-tools select:disabled,
.filter-button:disabled,
.icon-button:disabled,
.layouts button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.icon-button:disabled:hover {
	background: transparent;
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 1rem;
}

.cards[hidden] {
	display: none;
}

/* the pager in the toolbar: first, previous, which page, next, last, how many per page */
.pager {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	white-space: nowrap;
}

.pager .page-label {
	padding: 0 0.35rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.pager select {
	margin-left: 0.35rem;
	font-size: 0.9rem;
	padding: 0.25rem 0.4rem;
}

.world-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
}

/* ─── layouts: one markup, a class on #cards picks how it looks ─────────── */

.layouts {
	display: inline-flex;
	margin-left: auto;
	border: 1px solid var(--line);
	border-radius: 999px;
	overflow: hidden;
}

.layouts[hidden] {
	display: none;
}

.layouts button {
	border: 0;
	border-radius: 0;
	background: #fff;
	color: var(--muted);
	padding: 0.3rem 0.8rem;
	font-size: 0.85rem;
}

.layouts button + button {
	border-left: 1px solid var(--line);
}

.layouts button[aria-pressed="true"] {
	background: var(--accent);
	color: #fff;
}

.world-image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--line);
}

.world-card.is-logo .world-image {
	object-fit: contain;
	padding: 1rem 2rem;
	box-sizing: border-box;
	background: #fff;
}

/* a book, film or album cover: portrait, shown whole on a card */
.world-card.is-cover .world-image {
	aspect-ratio: 2 / 3;
	max-height: 18rem;
	object-fit: contain;
	background: #f3f4f6;
}

/* the blank cover of an entry without one: a book-shaped card saying "No cover" */
.cover-slot {
	display: flex;
	align-items: center;
	justify-content: center;
}

.cover-blank {
	height: 100%;
	aspect-ratio: 2 / 3;
	max-width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	background: linear-gradient(135deg, #64748b, #334155);
	color: rgb(255 255 255 / 85%);
	font-size: 0.85rem;
	white-space: nowrap;
}

.cover-blank svg {
	width: 2.5rem;
	height: 2.5rem;
	fill: currentcolor;
	opacity: 0.7;
}

.layout-list .cover-blank {
	font-size: 0.65rem;
	gap: 0.2rem;
}

.layout-list .cover-blank svg {
	width: 1.5rem;
	height: 1.5rem;
}

/* the blank of anything else without its picture ("No photo"): it fills the slot, whatever its shape */
.cover-blank.picture-blank {
	width: 100%;
	aspect-ratio: auto;
}

/* tiles: the text lies over the picture, so the blank says it in the lower right corner, bright, under no shade */
.layout-tiles .world-card.has-image.no-picture .world-body {
	background: none;
	color: #fff;
}

.layout-tiles .world-card.has-image.no-picture .cover-blank {
	flex-direction: row;
	align-items: flex-end;
	justify-content: flex-end;
	padding: 0 0.6rem 0.5rem;
	font-size: 0.75rem;
	color: #fff;
}

.layout-tiles .world-card.has-image.no-picture .cover-blank svg {
	width: 1.1rem;
	height: 1.1rem;
	opacity: 1;
}

/* a blank is no logo: no white margin around it */
.world-card.is-logo.no-picture .world-image {
	padding: 0;
}

/* tiles and gallery: the blank fills the card, as a cover does */
.layout-tiles .cover-blank,
.layout-gallery .cover-blank {
	width: 100%;
	aspect-ratio: auto;
	justify-content: flex-start;
	padding-top: 25%;
}

/* cards: the image on top, the text under it */
.layout-cards .world-card.is-logo .world-image {
	border-bottom: 1px solid var(--line);
}

/* only the list layout shows the empty image slot of an item without one */
.world-image.no-image {
	display: none;
}

/*
 * list: one row per item, every row the same size: the image slot at the
 * start (empty when there is no image), the name and subtitle on one line
 * each, the details running on at most two lines, cut with an ellipsis.
 * Everything is on the item's card in the other layouts.
 */
.cards.layout-list {
	grid-template-columns: 1fr;
	gap: 0.5rem;
}

.layout-list .world-card {
	flex-direction: row;
	align-items: stretch;
	height: 6.5rem;
}

.layout-list .world-image,
.layout-list .world-image.no-image {
	display: block;
	width: 8.5rem;
	height: 100%;
	flex: none;
	aspect-ratio: auto;
}

.layout-list .world-image.no-image {
	border-right: 1px solid var(--line);
	background: #f3f4f6;
}

.layout-list .world-title,
.layout-list .world-subtitle {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.layout-list .world-details {
	margin-top: 0.25rem;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.layout-list .world-card.is-logo .world-image {
	padding: 0.5rem;
	border-right: 1px solid var(--line);
}

.layout-list .world-body {
	padding: 0.5rem 0.75rem;
	min-width: 0;
	overflow: hidden;
}

.layout-list .world-details li {
	display: inline;
	margin-right: 1rem;
}

.layout-list .world-card.is-cover .world-image {
	width: 4.5rem;
	max-height: none;
	object-fit: cover;
}

.layout-list .credit {
	display: none;
}

/* tiles: the image fills the card behind the text */
.layout-tiles .world-card.has-image {
	position: relative;
	min-height: 10rem;
}

.layout-tiles .world-card.has-image .world-image {
	position: absolute;
	inset: 0;
	height: 100%;
	aspect-ratio: auto;
}

.layout-tiles .world-card.has-image .world-body {
	position: relative;
	flex: 1;
}

.layout-tiles .world-card.is-cover .world-image {
	max-height: none;
	object-fit: cover;
}

.layout-tiles .world-card.is-photo,
.layout-tiles .world-card.is-cover {
	color: #fff;
	border-color: transparent;
}

.layout-tiles .world-card.is-photo .world-body,
.layout-tiles .world-card.is-cover .world-body {
	background: linear-gradient(rgb(0 0 0 / 55%), rgb(0 0 0 / 75%));
}

.layout-tiles .world-card.is-photo .world-subtitle,
.layout-tiles .world-card.is-cover .world-subtitle,
.layout-tiles .world-card.is-photo .world-details .label,
.layout-tiles .world-card.is-cover .world-details .label,
.layout-tiles .world-card.is-photo .credit,
.layout-tiles .world-card.is-cover .credit {
	color: rgb(255 255 255 / 75%);
}

.layout-tiles .world-card.is-photo .person-link,
.layout-tiles .world-card.is-cover .person-link,
.layout-tiles .world-card.is-photo .world-details a,
.layout-tiles .world-card.is-cover .world-details a,
.layout-tiles .world-card.is-cover .ids a {
	color: #bfdbfe;
}

.layout-tiles .world-card.is-logo .world-body {
	background: rgb(255 255 255 / 82%);
}

/* gallery: the image alone, the name over its bottom edge; click for the rest */
.cards.layout-gallery {
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 0.5rem;
}

.layout-gallery .world-card {
	position: relative;
	aspect-ratio: 4 / 3;
	justify-content: flex-end;
	background: var(--line);
}

.layout-gallery .world-card.is-cover {
	aspect-ratio: 2 / 3;
}

.layout-gallery .world-card.is-cover .world-image {
	max-height: none;
	object-fit: cover;
}

.layout-gallery .world-card.is-cover .world-body {
	color: #fff;
	background: linear-gradient(transparent, rgb(0 0 0 / 70%));
}

.layout-gallery .world-image {
	position: absolute;
	inset: 0;
	height: 100%;
	aspect-ratio: auto;
}

.layout-gallery .world-body {
	position: relative;
	padding: 1.5rem 0.75rem 0.5rem;
}

.layout-gallery .world-card.is-photo .world-body {
	color: #fff;
	background: linear-gradient(transparent, rgb(0 0 0 / 70%));
}

.layout-gallery .world-card.is-logo .world-body {
	background: linear-gradient(transparent, rgb(255 255 255 / 90%) 40%);
}

.layout-gallery .world-title {
	font-size: 0.95rem;
}

.layout-gallery .world-subtitle,
.layout-gallery .world-details,
.layout-gallery .ids,
.layout-gallery .credit {
	display: none;
}

.world-body {
	padding: 0.75rem 1rem 1rem;
}

.world-title {
	font-size: 1.05rem;
	margin: 0;
}

.world-subtitle {
	margin: 0.15rem 0 0;
	color: var(--muted);
}

.world-details {
	list-style: none;
	margin: 0.6rem 0 0;
	padding: 0;
	font-size: 0.9rem;
}

.world-details li {
	padding: 0.15rem 0;
}

.world-details .label {
	color: var(--muted);
	margin-right: 0.4rem;
}

.credit {
	margin: 0.6rem 0 0;
	font-size: 0.75rem;
	color: var(--muted);
}

.credit a {
	color: inherit;
}

.person-link {
	color: var(--accent);
	text-decoration: none;
	/* a value is never split over two lines ("Co-" / "Worker"); a list of them wraps between values */
	white-space: nowrap;
}

/* "+12 more" after the first links of a long list, and "Show fewer" once open */
.more-links {
	padding: 0 0.25rem;
	font-size: 0.85rem;
	white-space: nowrap;
}

.more-links-rest[hidden] {
	display: none;
}

/* a relation with its person ("Mother of Dana") is one value: never split */
.nowrap {
	white-space: nowrap;
}

/* a person's links in the person form (to people, to organizations): chips, or a quiet "None yet" */
.chips .empty {
	color: var(--muted);
}

/* names and types in the people and type tables stay on one line too */
#world-view .entries td.title {
	white-space: nowrap;
}

.person-link:hover {
	text-decoration: underline;
}

.world-card.highlight {
	outline: 2px solid var(--accent);
}

/* ─── clicking an item edits it ─────────────────────────────────────────── */

.clickable {
	cursor: pointer;
}

.world-card.clickable:hover,
.world-card.clickable:focus-visible {
	box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
	outline: none;
}

tr.clickable:hover td,
tr.clickable:focus-visible td {
	background: #f3f6fb;
	outline: none;
}

/* ─── stats ─────────────────────────────────────────────────────────────── */

.stats-link {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
}

.stats-link svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.stats-link:hover {
	color: var(--ink);
}

.stats-link.active {
	background: var(--accent);
	color: #fff;
}

.stats-link[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
}

.stats-link[aria-disabled="true"]:hover {
	color: var(--muted);
}

.stat-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.stat-tile {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.8rem 1rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	color: var(--ink);
	text-decoration: none;
}

a.stat-tile:hover {
	box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}

.stat-value {
	font-size: 1.8rem;
	font-weight: 600;
	line-height: 1.1;
}

.stat-label {
	white-space: nowrap;
}

.stat-sub {
	font-size: 0.8rem;
	color: var(--muted);
}

.stat-charts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
	gap: 1rem;
}

.chart-card {
	padding: 1rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.chart-card h2 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

.bar-list {
	display: grid;
	gap: 0.35rem;
}

.bar-row {
	display: grid;
	grid-template-columns: minmax(6rem, 10rem) 1fr 2.5rem;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.bar-name {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bar-track {
	height: 10px;
}

.bar-fill {
	display: block;
	height: 100%;
	min-width: 2px;
	background: var(--accent);
	border-radius: 0 4px 4px 0;
}

.bar-value {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.columns,
.column-years {
	display: flex;
	gap: 2px;
}

.columns {
	align-items: flex-end;
	height: 140px;
	border-bottom: 1px solid var(--line);
}

.column {
	flex: 1;
	height: 100%;
	display: flex;
	align-items: flex-end;
}

.column:hover .column-fill {
	opacity: 0.75;
}

.column-fill {
	display: block;
	width: 100%;
	background: var(--accent);
	border-radius: 4px 4px 0 0;
}

.column-years span {
	flex: 1;
	font-size: 0.7rem;
	color: var(--muted);
	white-space: nowrap;
	overflow: visible;
}

.chart-note {
	margin: 0.5rem 0 0;
	font-size: 0.8rem;
	color: var(--muted);
}

.fab:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

/* ─── how a person is connected to the user ─────────────────────────────── */

.icon-button {
	display: inline-flex;
	padding: 0.3rem;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--accent);
	cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
	background: #eff6ff;
}

.icon-button svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.connections h3 {
	margin: 1rem 0 0.4rem;
	font-size: 0.95rem;
}

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

.connections li {
	padding: 0.2rem 0;
}

.connections .when {
	display: inline-block;
	min-width: 7rem;
	color: var(--muted);
	white-space: nowrap;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ─── the + button and its dialog (Material style) ──────────────────────── */

.fab {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	width: 56px;
	height: 56px;
	padding: 0;
	border: none;
	border-radius: 16px;
	display: grid;
	place-items: center;
	/* it adds something: red, as everything that changes things */
	background: var(--danger);
	box-shadow: 0 3px 5px -1px rgb(0 0 0 / 20%), 0 6px 10px rgb(0 0 0 / 14%), 0 1px 18px rgb(0 0 0 / 12%);
	transition: box-shadow 0.2s, transform 0.2s;
	z-index: 10;
}

.fab:hover {
	box-shadow: 0 5px 5px -3px rgb(0 0 0 / 20%), 0 8px 10px 1px rgb(0 0 0 / 14%), 0 3px 14px 2px rgb(0 0 0 / 12%);
	transform: translateY(-1px);
}

.fab svg {
	width: 24px;
	height: 24px;
	fill: #fff;
}

.dialog {
	width: min(44rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	padding: 1.5rem;
	border: none;
	border-radius: 28px;
	background: #fff;
	color: var(--ink);
	box-shadow: 0 11px 15px -7px rgb(0 0 0 / 20%), 0 24px 38px 3px rgb(0 0 0 / 14%);
}

.dialog::backdrop {
	background: rgb(0 0 0 / 40%);
}

.dialog h2 {
	margin: 0 0 0.5rem;
	font-size: 1.4rem;
	font-weight: 500;
}

.dialog-form[hidden] {
	display: none;
}

.dialog-form .row label {
	flex: 1 1 8rem;
}

.dialog-form .row label.wide {
	flex: 3 1 14rem;
}

.dialog-form .row label input,
.dialog-form .row label select {
	width: 100%;
}

/* a date: the picker and how much of it is known, side by side */
.dialog-form .row label:has(.date-pick) {
	flex: 2 1 16rem;
}

.date-pick {
	display: flex;
	gap: 0.4rem;
}

.dialog-form .row label .date-pick .date-day {
	flex: 1 1 9rem;
	min-width: 0;
}

.dialog-form .row label .date-pick .date-precision {
	flex: 0 0 auto;
	width: auto;
}

.dialog-form .row label.check {
	flex: 0 0 auto;
	flex-direction: row;
	align-items: center;
	gap: 0.4rem;
	padding-bottom: 0.45rem;
}

.dialog-form .row label.check input {
	width: auto;
}

.dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1.5rem;
}

.dialog-actions .delete {
	margin-right: auto;
}

.dialog-actions button {
	border-radius: 999px;
	padding: 0.5rem 1.25rem;
}

button.text {
	background: transparent;
	border-color: transparent;
	color: var(--accent);
}

button.text:hover {
	background: #eef3fd;
}

button.text.danger {
	color: var(--danger);
}

button.text.danger:hover {
	background: #fdeeee;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
	padding: 0.25rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
}

/* ─── pickers (Tom Select): the app's look ──────────────────────────────── */

.dialog-form .row label .ts-wrapper {
	width: 100%;
}

.ts-wrapper .ts-control {
	font: inherit;
	min-height: 2.35rem;
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
	box-shadow: none;
}

.ts-wrapper.focus .ts-control {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px #2563eb33;
}

.ts-wrapper .ts-control input {
	font: inherit;
	color: var(--ink);
}

/* a chosen row in a multiple picker: a chip, as elsewhere */
.ts-wrapper.multi .ts-control > .item {
	border: none;
	border-radius: 999px;
	background: #e8eefc;
	color: var(--ink);
	font-size: 0.85rem;
	padding: 0.1rem 0.15rem 0.1rem 0.6rem;
	/* a value is never split over two lines */
	white-space: nowrap;
}

/* the chip names a row and is a link to it (dialogLink in app.js): it looks like one */
.ts-wrapper.multi .ts-control > .item a.person-link {
	color: var(--accent);
}

.ts-wrapper.plugin-remove_button .item .remove {
	border-left: none;
	color: var(--danger);
	font-weight: 700;
}

/* the × that empties a single picker changes things too */
.ts-wrapper .clear-button {
	color: var(--danger);
}

/* a list of chips shows what is chosen; the box to type another in comes in with
   the + (or a click in the list) and goes when the picker is left */
.ts-wrapper.multi:not(.focus) .ts-control > input {
	flex: 0 0 0 !important;
	width: 0 !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0;
}

.ts-wrapper.multi:not(.focus, .has-items) .ts-control::before {
	content: "None yet";
	color: var(--muted);
	font-size: 0.85rem;
}

.ts-wrapper.multi .ts-control {
	align-items: center;
	gap: 0.25rem;
}

.ts-wrapper.multi .ts-control > .picker-add {
	order: 99;
	margin-left: 0.15rem;
}

.ts-wrapper.disabled .picker-add {
	pointer-events: none;
}

/* while the box to type in is there, its + has nothing to bring in */
.ts-wrapper.multi.focus .picker-add {
	display: none;
}

.ts-wrapper.disabled .ts-control {
	opacity: 0.5;
}

.ts-dropdown {
	font: inherit;
	border: 1px solid var(--line);
	border-radius: 6px;
	box-shadow: 0 6px 18px #0000001f;
	color: var(--ink);
}

.ts-dropdown .option {
	padding: 0.4rem 0.6rem;
}

.ts-dropdown .active {
	background: #e8eefc;
	color: var(--ink);
}

/* a suggestion: the name, and under it what tells two of the same name apart */
.picker-option small {
	display: block;
	color: var(--muted);
	font-size: 0.8rem;
}

.ts-dropdown .no-results {
	padding: 0.4rem 0.6rem;
	color: var(--muted);
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	padding: 0.15rem 0.25rem 0.15rem 0.65rem;
	border-radius: 999px;
	background: #e8eefc;
	font-size: 0.85rem;
}

/* a chip with no − of its own: a person's English name, which is their name parts */
.chip.kept {
	padding-right: 0.65rem;
}

/* what changes things is red: the + that adds to a list and the − that takes away from it */
button.modify {
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	border: 1px solid var(--danger);
	border-radius: 999px;
	background: #fff;
	color: var(--danger);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
}

button.modify:hover {
	background: #fdeeee;
}

button.modify.chip-remove {
	width: 1.25rem;
	height: 1.25rem;
	margin-left: 0.2rem;
	border: none;
	background: transparent;
}

button.modify:disabled {
	opacity: 0.4;
	cursor: default;
}

/* the × of a row that adds something: at its end, level with its boxes */
.adder-close {
	align-self: flex-end;
	margin-bottom: 0.45rem;
}

/* a row to add something with, and the rows of a picture to add: in only after the + */
.adder[hidden] {
	display: none;
}

/* a picture the dialog's row has: small, with its − */
.chip.picture {
	padding: 0.2rem 0.25rem 0.2rem 0.2rem;
	border-radius: 8px;
}

.chip.picture img {
	display: block;
	height: 4.5rem;
	max-width: 9rem;
	border-radius: 6px;
	object-fit: contain;
}

/* ─── checks ────────────────────────────────────────────────────────────── */

.checks-intro {
	color: var(--muted);
}

.checks-intro button {
	margin-left: 0.5rem;
}

/* a page's own checks, between the toolbar and its rows */
.view-checks {
	margin-bottom: 1rem;
}

.check-group .schema-heading button {
	margin-left: 0.5rem;
	font-size: 0.85rem;
}

/* one row per check: name | result | Run, every row the same height */
.checks {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
}

.check {
	display: grid;
	grid-template-columns: auto minmax(0, 2fr) minmax(0, 3fr) auto;
	align-items: center;
	column-gap: 1rem;
	padding: 0.1rem 0.75rem;
	border-top: 1px solid var(--line);
}

/* a check turned off: greyed, Run disabled, its box unticked */
.check.check-off .check-title,
.check.check-off .check-result {
	color: var(--muted);
	opacity: 0.6;
}

.check-enabled {
	margin: 0;
}

.check > button.text {
	padding: 0.25rem 0.6rem;
}

.check:first-child {
	border-top: none;
}

.check-title,
.check-result {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.check-title {
	font-weight: 600;
	cursor: help;
}

.check-result {
	color: var(--muted);
}

/* a failing check's count opens its problems, under the whole row */
button.text.check-toggle {
	max-width: 100%;
	padding: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: inherit;
	font: inherit;
}

.check-toggle::after {
	content: " \25b8";
}

.check-toggle[aria-expanded="true"]::after {
	content: " \25be";
}

.check-details {
	grid-column: 1 / -1;
	margin: 0.2rem 0 0.4rem;
}

.check-details[hidden] {
	display: none;
}

.check-result.pass {
	color: #1a7f37;
}

.check-result.fail {
	color: #b42318;
}

.check-problems {
	margin: 0.3rem 0 0;
	padding-left: 1.2rem;
	color: var(--ink);
}

.check-subject {
	font-weight: 600;
}

.check-more {
	list-style: none;
	color: var(--muted);
}

/* ─── the map layout ─────────────────────────────────────────────────────── */

.world-map {
	height: calc(100dvh - 16rem);
	min-height: 20rem;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.world-map[hidden] {
	display: none;
}

.map-popup {
	display: grid;
	gap: 0.25rem;
	justify-items: start;
}

.map-popup p {
	margin: 0;
}

/* ─── history arrows ─────────────────────────────────────────────────────── */

.history {
	display: inline-flex;
	gap: 0.125rem;
}

/* ─── one place on a map ─────────────────────────────────────────────────── */

/* the pin on a card, in its top right corner in every layout */
.place-button {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	background: rgb(255 255 255 / 85%);
}

.place-dialog {
	width: min(56rem, calc(100vw - 2rem));
}

.place-address {
	margin: 0 0 0.75rem;
	color: var(--muted);
}

.place-map {
	height: min(60vh, 32rem);
	border: 1px solid var(--line);
	border-radius: 8px;
}

.place-dialog .dialog-actions {
	align-items: center;
	justify-content: space-between;
}

/* the title keeps clear of the pin */
.world-card .world-title {
	padding-right: 2.25rem;
}

/* ─── the structure of the database ──────────────────────────────────────── */

.schema-heading {
	font-size: 1.05rem;
	margin: 1.2rem 0 0.5rem;
}

.schema-drift {
	margin: 0.5rem 0;
	padding: 0.6rem 0.6rem 0.6rem 1.8rem;
	border: 1px solid #b42318;
	border-radius: 6px;
	color: #b42318;
}

.schema-drift[hidden] {
	display: none;
}

/* the diagram is as wide as it needs: it scrolls inside its box, never the page */
.schema-diagram {
	overflow: auto;
	max-height: 80dvh;
	padding: 0.5rem;
	border: 1px solid var(--line);
	border-radius: 6px;
}

.schema-tables {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 34rem), 1fr));
	gap: 1rem;
}

.schema-table {
	min-width: 0;
	overflow-x: auto;
}

.schema-name {
	margin: 0 0 0.3rem;
	font-size: 1rem;
	font-family: ui-monospace, monospace;
}

.schema-rows {
	font-family: inherit;
	font-weight: normal;
	color: var(--muted);
	white-space: nowrap;
}

.schema-columns td {
	white-space: nowrap;
	font-family: ui-monospace, monospace;
	font-size: 0.85rem;
}

.schema-columns tr.drift td {
	color: #b42318;
}

.schema-facts {
	margin: 0.4rem 0 0;
	padding-left: 1.2rem;
	font-size: 0.85rem;
	color: var(--muted);
}

/* ─── the sidebar ────────────────────────────────────────────────────────── */

.layout {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
	position: sticky;
	top: var(--topbar);
	height: calc(100dvh - var(--topbar));
	/* scrolls on its own, apart from the page */
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0.75rem 0.5rem 2rem;
	background: #fff;
	border-right: 1px solid var(--line);
}

body.sidebar-folded .layout {
	grid-template-columns: minmax(0, 1fr);
}

body.sidebar-folded .sidebar {
	display: none;
}

.side-group + .side-group,
.kinds + .side-group {
	margin-top: 0.9rem;
}

.side-heading {
	margin: 0 0 0.2rem;
	padding: 0 0.6rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}

.side-link {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.32rem 0.6rem;
	border-radius: 6px;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
}

.side-link:hover {
	background: var(--bg);
	color: var(--ink);
}

.side-link.active,
.side-link.active:hover {
	background: var(--accent);
	color: #fff;
}

.side-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
}

.side-count {
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

.side-link.active .side-count {
	color: rgb(255 255 255 / 0.85);
}

.nav-toggle {
	flex: none;
}

.sidebar-scrim[hidden] {
	display: none;
}

/* a phone: the sidebar slides out over the page, and a tap beside it closes it */
@media (max-width: 900px) {
	.layout,
	body.sidebar-folded .layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar,
	body.sidebar-folded .sidebar {
		display: block;
		position: fixed;
		left: 0;
		z-index: 30;
		width: min(var(--sidebar), 80vw);
		transform: translateX(-100%);
		transition: transform 0.2s ease;
		box-shadow: 0 0 24px rgb(0 0 0 / 0.15);
	}

	body.sidebar-open .sidebar {
		transform: none;
	}

	.sidebar-scrim {
		position: fixed;
		inset: var(--topbar) 0 0;
		z-index: 25;
		background: rgb(0 0 0 / 0.3);
	}

	.topbar {
		padding: 0 0.75rem;
	}

	.content {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sidebar {
		transition: none;
	}
}

/* the top bar never breaks a name or a button over two lines: the user's name gives way first */
.topbar .brand,
.topbar button {
	white-space: nowrap;
}

#who {
	display: inline-block;
	max-width: 12rem;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: middle;
}

@media (max-width: 480px) {
	/* the sign-in icon and the photo say who it is; the name is in the account panel's Settings */
	#who {
		display: none;
	}

	.topbar,
	.whoami {
		gap: 0.4rem;
	}
}
