/* ==========================================================================
   Design tokens

   The single source of colour, spacing, type, and layout values every
   component and page in this crate draws from — the 2026-07-19 "design
   system before styling" ruling: components and pages reach for a
   token or an existing component class, never a literal colour,
   spacing, or font of their own. Restyling later is a change to this
   file alone.

   The palette is deliberately neutral: greys throughout, no brand
   accent. The four semantic colours (info/success/warning/danger)
   exist for STATE — a badge, a warning, a refusal — not decoration,
   and are the only colour this palette spends. Light is the default
   scheme; `prefers-color-scheme: dark` overrides every colour token,
   nothing else.
   ========================================================================== */

:root {
	color-scheme: light;

	--color-bg:            #ffffff;
	--color-bg-raised:     #f6f7f8;
	--color-bg-sunken:     #eceef1;
	--color-border:        #d8dbdf;
	--color-border-strong: #b6bac1;
	--color-text:          #1b1e22;
	--color-text-muted:    #5b6068;
	--color-text-faint:    #8a8f97;

	--color-info:          #3b6ea5;
	--color-success:       #2f7d4f;
	--color-warning:       #9a6a12;
	--color-danger:        #b3372c;

	--font-sans:   -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono:   ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	--text-xs:     0.75rem;
	--text-sm:     0.8125rem;
	--text-base:   0.9375rem;
	--text-lg:     1.125rem;
	--text-xl:     1.5rem;
	--line-height: 1.5;

	/* 4px grid */
	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;

	--radius-sm:    4px;
	--radius-md:    8px;
	--radius-full:  999px;
	--border-width: 1px;

	/* Monochrome only — no coloured shadows */
	--shadow-sm: 0 1px 2px rgb(0 0 0 / 8%);
	--shadow-md: 0 4px 16px rgb(0 0 0 / 16%);

	--z-modal: 100;
	--z-toast: 200;
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;

		--color-bg:            #17191c;
		--color-bg-raised:     #202226;
		--color-bg-sunken:     #101113;
		--color-border:        #34373c;
		--color-border-strong: #484c53;
		--color-text:          #e8e9eb;
		--color-text-muted:    #a3a8b0;
		--color-text-faint:    #74797f;

		--color-info:    #6ea3d8;
		--color-success: #5cb583;
		--color-warning: #d1a04c;
		--color-danger:  #e17d70;

		--shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
		--shadow-md: 0 4px 16px rgb(0 0 0 / 50%);
	}
}

/* ==========================================================================
   Base elements
   ========================================================================== */

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: var(--line-height);
}

h1, h2, h3 {
	margin: 0 0 var(--space-3);
	font-weight: 600;
	line-height: 1.25;
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }

p {
	margin: 0 0 var(--space-3);
}

code, pre, .mono {
	font-family: var(--font-mono);
}

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

a:hover {
	text-decoration: underline;
}

button, input, select, textarea {
	font: inherit;
	color: inherit;
}

button {
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-2) var(--space-3);
	cursor: pointer;
}

button:hover {
	border-color: var(--color-border-strong);
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

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

/* ==========================================================================
   Layout grammar
   ========================================================================== */

.app-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.top-nav {
	display: flex;
	align-items: center;
	gap: var(--space-4);
	padding: var(--space-3) var(--space-4);
	border-bottom: var(--border-width) solid var(--color-border);
	background: var(--color-bg-raised);
}

.top-nav .brand {
	font-weight: 600;
	letter-spacing: 0.02em;
}

.top-nav nav {
	display: flex;
	flex: 1;
	gap: var(--space-3);
}

.top-nav nav a {
	color: var(--color-text-muted);
}

.top-nav nav a:hover,
.top-nav nav a[aria-current="page"] {
	color: var(--color-text);
	text-decoration: none;
}

main.content {
	flex: 1;
	padding: var(--space-5);
}

.page > h1 {
	margin-bottom: var(--space-4);
}

/* ==========================================================================
   Login page
   ========================================================================== */

.login-page {
	max-width: 22rem;
	margin: var(--space-6) auto;
	padding: var(--space-5);
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	margin-top: var(--space-4);
}

.login-form label {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	font-size: var(--text-sm);
	color: var(--color-text-muted);
}

.login-form input {
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-2);
}

.login-error {
	color: var(--color-danger);
	font-size: var(--text-sm);
	margin: 0;
}

.login-toggle {
	background: none;
	border: none;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

.login-sent {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	margin-top: var(--space-4);
}

/* ==========================================================================
   Device sign-in approval page
   ========================================================================== */

.device-approve {
	max-width: 26rem;
}

.device-form input {
	font-family: var(--font-mono, monospace);
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.device-approved {
	color: var(--color-success, inherit);
}

/* ==========================================================================
   Form kit
   ========================================================================== */

.form-field {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin-bottom: var(--space-3);
}

.form-field label {
	font-size: var(--text-sm);
	color: var(--color-text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-2);
}

.form-field-error {
	color: var(--color-danger);
	font-size: var(--text-xs);
}

.form-errors {
	list-style: none;
	margin: 0 0 var(--space-4);
	padding: var(--space-3);
	border: var(--border-width) solid var(--color-danger);
	border-radius: var(--radius-sm);
	color: var(--color-danger);
	font-size: var(--text-sm);
}

.form-errors li + li {
	margin-top: var(--space-1);
}

/* ==========================================================================
   Data table
   ========================================================================== */

.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--text-sm);
}

.data-table th {
	text-align: left;
	color: var(--color-text-muted);
	font-weight: 500;
	padding: var(--space-2) var(--space-3);
	border-bottom: var(--border-width) solid var(--color-border);
}

.data-table td {
	padding: var(--space-2) var(--space-3);
	border-bottom: var(--border-width) solid var(--color-border);
	vertical-align: top;
}

.data-table tr.clickable {
	cursor: pointer;
}

.data-table tr.clickable:hover td {
	background: var(--color-bg-raised);
}

/* ==========================================================================
   Tabs
   ========================================================================== */

.tabs {
	display: flex;
	gap: var(--space-1);
	border-bottom: var(--border-width) solid var(--color-border);
	margin-bottom: var(--space-4);
}

.tab {
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	padding: var(--space-2) var(--space-3);
	color: var(--color-text-muted);
}

.tab:hover {
	color: var(--color-text);
	border-color: var(--color-border-strong);
}

.tab-active,
.tab-active:hover {
	color: var(--color-text);
	border-color: var(--color-text);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
	display: inline-block;
	padding: 2px var(--space-2);
	border-radius: var(--radius-full);
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: 1.6;
	border: var(--border-width) solid transparent;
}

.badge-neutral {
	background: color-mix(in srgb, var(--color-text-faint) 16%, transparent);
	color: var(--color-text-muted);
	border-color: var(--color-border);
}

.badge-info {
	background: color-mix(in srgb, var(--color-info) 16%, transparent);
	color: var(--color-info);
	border-color: color-mix(in srgb, var(--color-info) 40%, transparent);
}

.badge-success {
	background: color-mix(in srgb, var(--color-success) 16%, transparent);
	color: var(--color-success);
	border-color: color-mix(in srgb, var(--color-success) 40%, transparent);
}

.badge-warning {
	background: color-mix(in srgb, var(--color-warning) 16%, transparent);
	color: var(--color-warning);
	border-color: color-mix(in srgb, var(--color-warning) 40%, transparent);
}

.badge-danger {
	background: color-mix(in srgb, var(--color-danger) 16%, transparent);
	color: var(--color-danger);
	border-color: color-mix(in srgb, var(--color-danger) 40%, transparent);
}

/* ==========================================================================
   States (loading / empty / error)
   ========================================================================== */

.state {
	padding: var(--space-4);
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
}

.state-loading {
	color: var(--color-text-muted);
}

.state-empty {
	text-align: center;
	color: var(--color-text-muted);
	border: 1px dashed var(--color-border);
}

.state-error {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	border: var(--border-width) solid var(--color-danger);
	color: var(--color-danger);
	background: color-mix(in srgb, var(--color-danger) 8%, transparent);
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-host {
	position: fixed;
	right: var(--space-4);
	bottom: var(--space-4);
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	z-index: var(--z-toast);
	max-width: 22rem;
}

.toast {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3);
	border-radius: var(--radius-md);
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	box-shadow: var(--shadow-md);
	font-size: var(--text-sm);
}

.toast-neutral { border-left: 3px solid var(--color-text-faint); }
.toast-info    { border-left: 3px solid var(--color-info); }
.toast-success { border-left: 3px solid var(--color-success); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-danger  { border-left: 3px solid var(--color-danger); }

.toast-dismiss {
	margin-left: auto;
	background: transparent;
	border: none;
	padding: 0 var(--space-1);
	font-size: var(--text-lg);
	line-height: 1;
	color: var(--color-text-muted);
}

.toast-dismiss:hover {
	border: none;
	color: var(--color-text);
}

/* ==========================================================================
   Modal / drawer overlay
   ========================================================================== */

.overlay-backdrop {
	position: fixed;
	inset: 0;
	display: flex;
	background: color-mix(in srgb, black 45%, transparent);
	z-index: var(--z-modal);
}

.overlay-panel {
	background: var(--color-bg);
	box-shadow: var(--shadow-md);
	padding: var(--space-5);
	overflow-y: auto;
}

.overlay-panel-modal {
	margin: auto;
	width: min(32rem, calc(100vw - var(--space-6)));
	max-height: calc(100vh - var(--space-6));
	border-radius: var(--radius-md);
}

.overlay-panel-drawer {
	margin-left: auto;
	width: min(28rem, 100vw);
	height: 100vh;
}

/* ==========================================================================
   Dashboard panels
   ========================================================================== */

.dashboard-page .panel {
	margin-bottom: var(--space-5);
}

.panel-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: var(--space-2);
}

.panel-header h2 {
	margin: 0;
}

.panel-total {
	color: var(--color-text-muted);
	font-variant-numeric: tabular-nums;
}

.panel-rows {
	display: flex;
	flex-direction: column;
}

.entry-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-2) 0;
	border-bottom: var(--border-width) solid var(--color-border);
	font-size: var(--text-sm);
}

.entry-row:last-child {
	border-bottom: none;
}

.entry-time {
	flex: 0 0 auto;
	width: 11rem;
	color: var(--color-text-muted);
	font-variant-numeric: tabular-nums;
}

.entry-reference {
	flex: 1 1 auto;
	min-width: 0;
}

.entry-tags {
	flex: 0 0 auto;
	color: var(--color-text-muted);
	font-size: var(--text-xs);
}

.entry-duration {
	flex: 0 0 auto;
	min-width: 4.5rem;
	text-align: right;
}

.week-bar-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-1) 0;
}

.week-bar-label {
	flex: 0 0 10rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.week-bar-track {
	flex: 1 1 auto;
	height: 0.5rem;
	background: var(--color-bg-sunken);
	border-radius: var(--radius-full);
	overflow: hidden;
}

.week-bar-fill {
	display: block;
	height: 100%;
	background: var(--color-info);
	border-radius: var(--radius-full);
}

.week-bar-value {
	flex: 0 0 auto;
	min-width: 4.5rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Entries page
   ========================================================================== */

.entries-controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin-bottom: var(--space-4);
}

.entries-filter {
	flex: 1 1 20rem;
	min-width: 12rem;
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-2);
}

.entries-list-header {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	margin-bottom: var(--space-2);
}

.entries-count {
	font-weight: 600;
}

.entries-marked-count {
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.entries-mark-all {
	margin-left: auto;
}

.entries-mark-cell {
	width: 1.5rem;
}

.entries-day-header td {
	background: var(--color-bg-raised);
	font-weight: 600;
	color: var(--color-text-muted);
}

.entries-tags {
	color: var(--color-text-muted);
	font-size: var(--text-xs);
}

.entries-duration {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-family: var(--font-mono);
}

.data-table tr.entries-row-selected td {
	background: var(--color-bg-sunken);
}

.entries-detail {
	margin-top: var(--space-5);
	padding: var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
}

.entries-detail dl {
	display: grid;
	grid-template-columns: 8rem 1fr;
	gap: var(--space-2) var(--space-3);
	margin: 0;
}

.entries-detail dt {
	color: var(--color-text-muted);
}

.entries-detail dd {
	margin: 0;
}

.entries-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-bottom: var(--space-4);
}

.join-candidate-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: var(--space-2) 0;
	padding: 0;
	list-style: none;
}

.join-candidate {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	width: 100%;
	padding: var(--space-2) var(--space-3);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
	text-align: left;
	cursor: pointer;
}

.join-candidate:hover {
	background: var(--color-bg-raised);
}

/* ==========================================================================
   Day page
   ========================================================================== */

.day-controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-3);
	margin-bottom: var(--space-4);
}

.day-date-nav {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.day-date-label {
	min-width: 12rem;
	font-weight: 600;
	text-align: center;
}

.day-view-toggle {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.day-zoom {
	display: flex;
	gap: var(--space-1);
}

/* Lane grid */

.day-lane-grid {
	position: relative;
	display: flex;
	gap: var(--space-3);
}

.day-axis {
	position: relative;
	flex: 0 0 3.5rem;
	height: 72rem;
}

.day-axis-hour {
	position: absolute;
	left: 0;
	right: 0;
	transform: translateY(-0.5em);
	color: var(--color-text-muted);
	font-size: var(--text-xs);
	font-variant-numeric: tabular-nums;
}

.day-lanes {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	gap: var(--space-2);
	height: 72rem;
	border-left: var(--border-width) solid var(--color-border);
}

.day-lane {
	position: relative;
	flex: 1 1 0;
	min-width: 8rem;
}

.day-block {
	position: absolute;
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow: hidden;
	padding: var(--space-1) var(--space-2);
	background: color-mix(in srgb, var(--color-info) 14%, var(--color-bg-raised));
	border: var(--border-width) solid color-mix(in srgb, var(--color-info) 40%, transparent);
	border-radius: var(--radius-sm);
	font-size: var(--text-xs);
	cursor: pointer;
}

.day-block:hover {
	border-color: var(--color-info);
}

.day-block-selected {
	border-color: var(--color-text);
	box-shadow: var(--shadow-sm);
}

.day-block-reference {
	font-weight: 600;
}

.day-block-time,
.day-block-tags,
.day-block-duration {
	color: var(--color-text-muted);
	font-variant-numeric: tabular-nums;
}

/* Proportional strip */

.day-strip-layout {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

.day-strip {
	display: flex;
	flex-direction: column;
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.day-segment {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-1) var(--space-3);
	border-bottom: var(--border-width) solid var(--color-border);
	cursor: pointer;
}

.day-segment:last-child {
	border-bottom: none;
}

.day-segment:hover {
	background: var(--color-bg-raised);
}

.day-segment-active {
	background: var(--color-bg-sunken);
}

.day-segment-label {
	flex: 0 0 3.5rem;
	color: var(--color-text-muted);
	font-size: var(--text-xs);
	font-variant-numeric: tabular-nums;
}

.day-segment-bar {
	flex: 1 1 auto;
	height: 0.75rem;
	border-radius: var(--radius-sm);
	background: var(--color-bg-sunken);
}

.day-segment-partial .day-segment-bar {
	background: linear-gradient(
		to right,
		color-mix(in srgb, var(--color-info) 55%, transparent) 50%,
		var(--color-bg-sunken) 50%
	);
}

.day-segment-full .day-segment-bar {
	background: var(--color-info);
}

.day-segment-detail {
	padding: var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
}

.day-segment-expansion {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin-bottom: var(--space-4);
}

.day-segment-lane {
	position: relative;
	height: 1.5rem;
	background: var(--color-bg-sunken);
	border-radius: var(--radius-sm);
}

.day-expansion-block {
	position: absolute;
	top: 0;
	bottom: 0;
	background: var(--color-info);
	border-radius: var(--radius-sm);
	cursor: pointer;
}

.day-expansion-block-selected {
	outline: 2px solid var(--color-text);
	outline-offset: 1px;
}

.day-info-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.day-info-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-2) 0;
	border-bottom: var(--border-width) solid var(--color-border);
	font-size: var(--text-sm);
}

.day-info-row:last-child {
	border-bottom: none;
}

.day-info-row-selected {
	background: var(--color-bg-sunken);
}

.day-info-reference {
	flex: 1 1 auto;
	min-width: 0;
}

.day-info-time,
.day-info-duration {
	flex: 0 0 auto;
	color: var(--color-text-muted);
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Honest-clock displays
   ========================================================================== */

.duration {
	font-variant-numeric: tabular-nums;
	font-family: var(--font-mono);
}

time {
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Transport suite (B5): the Dashboard's start prompt, the Entries page's
   restart confirm, and the non-blocking future-time warning banner both
   share.
   ========================================================================== */

.dashboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--space-4);
}

.dashboard-header h1 {
	margin-bottom: 0;
}

.start-prompt {
	display: flex;
	flex-direction: column;
}

.start-prompt-actions,
.restart-confirm .start-prompt-actions {
	display: flex;
	gap: var(--space-2);
	margin-top: var(--space-2);
}

.form-warning {
	color: var(--color-warning);
	font-size: var(--text-sm);
	margin: calc(-1 * var(--space-2)) 0 var(--space-3);
}

.restart-confirm p {
	color: var(--color-text-muted);
}

/* ==========================================================================
   Report page (D1)
   ========================================================================== */

.report-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3);
	margin-bottom: var(--space-4);
}

.report-overlaps-toggle {
	display: flex;
	align-items: center;
	gap: var(--space-1);
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

.report-bars {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.report-bar-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-1) 0;
}

.report-bar-label {
	flex: 0 0 12rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.report-bar-track {
	flex: 1 1 auto;
	height: 0.5rem;
	background: var(--color-bg-sunken);
	border-radius: var(--radius-full);
	overflow: hidden;
}

.report-bar-fill {
	display: block;
	height: 100%;
	background: var(--color-info);
	border-radius: var(--radius-full);
}

.report-bar-value {
	flex: 0 0 auto;
	min-width: 4.5rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.report-total {
	margin-top: var(--space-3);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.report-span,
.report-duration {
	font-variant-numeric: tabular-nums;
	font-family: var(--font-mono);
}

.report-overlap-reference {
	display: block;
}

.report-overlap-time {
	display: block;
	color: var(--color-text-muted);
	font-size: var(--text-sm);
	font-variant-numeric: tabular-nums;
}

.report-overlap-duration {
	margin-left: var(--space-1);
}

.report-overlap-reason-none {
	color: var(--color-text-faint);
}

/* ==========================================================================
   Catalogue page (D2)
   ========================================================================== */

.catalogue-panes {
	display: grid;
	grid-template-columns: repeat(3, minmax(14rem, 1fr));
	gap: var(--space-4);
	align-items: start;
}

.catalogue-pane {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.catalogue-tags {
	margin-top: var(--space-5);
}

.catalogue-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.catalogue-list li {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
}

.catalogue-row {
	flex: 1 1 auto;
	text-align: left;
	background: none;
	border: none;
	padding: 0;
	color: inherit;
	cursor: pointer;
}

.catalogue-row:hover {
	text-decoration: underline;
}

.catalogue-row-active {
	font-weight: 600;
}

.catalogue-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-1);
	margin-left: auto;
}

.catalogue-create-form {
	display: flex;
	gap: var(--space-2);
	margin-top: var(--space-1);
}

.catalogue-create-form input {
	flex: 1 1 auto;
	background: var(--color-bg-raised);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: var(--space-2);
}

.catalogue-rename-form .form-hint {
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

/* ==========================================================================
   Freeze control (D3)
   ========================================================================== */

.freeze-control {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.freeze-indicator {
	color: var(--color-warning);
	font-size: var(--text-sm);
	white-space: nowrap;
}

.freeze-move-form {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Billing page (R5)
   ========================================================================== */

.billing-section {
	margin-bottom: var(--space-5);
	padding: var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
}

.billing-summary {
	display: grid;
	grid-template-columns: 8rem 1fr;
	gap: var(--space-2) var(--space-3);
	margin: 0 0 var(--space-3);
}

.billing-summary dt {
	color: var(--color-text-muted);
}

.billing-summary dd {
	margin: 0;
}

.billing-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-top: var(--space-3);
}

.billing-payment-methods {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0 0 var(--space-3);
	padding: 0;
	list-style: none;
}

.billing-payment-methods li {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
}

.cancel-modal {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}
