:root {
	--bg-tint: #000;
	--bg-primary: #fff;
	--bg-secondary: color-mix(in xyz, var(--bg-primary) 95%, var(--bg-tint));
	--bg-tertiary: color-mix(in xyz, var(--bg-primary) 90%, var(--bg-tint));

	--text-tint: #fff;
	--text-primary: #000;
	--text-secondary: color-mix(in xyz, var(--text-primary) 95%, var(--text-tint));
	--text-tertiary: color-mix(in xyz, var(--text-primary) 90%, var(--text-tint));
	/* 82% is the lightest step that keeps 4.5:1 on white. */
	--text-muted: color-mix(in xyz, var(--text-primary) 82%, var(--text-tint));
	/* Placeholders and disabled text only: below AA. */
	--text-placeholder: color-mix(in xyz, var(--text-primary) 60%, var(--text-tint));
	--text-accent: #000;
	--text-sidebar: #000;
	--text-success: #008000;
	--text-danger: #b62325;
	/* Text-safe; the raw hue is --status-warning. */
	--text-warning: color-mix(in oklab, #e1b12c 60%, #000);

	/* Dots and fills. */
	--status-success: var(--text-success);
	--status-warning: #e1b12c;
	--status-danger: var(--text-danger);
	--status-running: var(--bg-neutral);
	--status-neutral: var(--text-muted);

	--bg-sidebar-tint: #000;
	--bg-sidebar-primary: #fff;
	--bg-sidebar-secondary: color-mix(in xyz, var(--bg-sidebar-primary) 90%, var(--bg-sidebar-tint));
	--bg-sidebar-tertiary: color-mix(in xyz, var(--bg-sidebar-primary) 80%, var(--bg-sidebar-tint));
	--text-sidebar-tint: #fff;
	--text-sidebar-primary: #3f3f3f;
	--text-sidebar-secondary: color-mix(in xyz,
			var(--text-sidebar-primary) 60%,
			var(--text-sidebar-tint));
	--text-sidebar-tertiary: color-mix(in xyz,
			var(--text-sidebar-primary) 50%,
			var(--text-sidebar-tint));
	--text-sidebar-muted: color-mix(in xyz,
			var(--text-sidebar-primary) 40%,
			var(--text-sidebar-tint));

	--ax-primary: #bed91a;
	--ax-secondary: color-mix(in xyz, var(--ax-primary) 80%, transparent);
	--ax-tertiary: color-mix(in xyz, var(--ax-primary) 30%, transparent);
	--ax-muted: color-mix(in xyz, var(--ax-primary) 15%, transparent);
	--ax-text: #000;

	--bg-neutral: #252525;
	--bg-neutral-secondary: color-mix(in xyz, var(--bg-neutral) 90%, var(--bg-primary));
	--bg-neutral-tertiary: color-mix(in xyz, var(--bg-neutral) 75%, var(--bg-primary));
	--bg-neutral-muted: color-mix(in xyz, var(--bg-neutral) 50%, var(--bg-primary));

	--ui-primary: color-mix(in xyz, var(--text-primary) 6%, transparent);
	--ui-secondary: color-mix(in xyz, var(--text-primary) 10%, transparent);
	/* Hover and focus borders. */
	--ui-strong: color-mix(in xyz, var(--text-primary) 18%, transparent);
	/* Same idea as --ui-primary/--ui-secondary, tinted off the sidebar's own
     contrast instead of the page's — for chrome that floats off the sidebar
     (menus, popovers) rather than sitting on page content. --ui-primary would
     tint off --text-primary, which is a different tenant-set color and can
     go the wrong direction (e.g. render white) against sidebar-toned chrome.
     Mixed against --bg-sidebar-primary rather than transparent (unlike
     --ui-primary/--ui-secondary): every current use sits directly on that
     surface, and mixing against an opaque color renders reliably regardless
     of alpha-compositing quirks, whereas mixing a color with transparent
     produced borders that were effectively invisible against a dark sidebar. */
	--ui-sidebar-primary: color-mix(in srgb,
			var(--text-sidebar-primary) 15%,
			var(--bg-sidebar-primary));
	--ui-sidebar-secondary: color-mix(in srgb,
			var(--text-sidebar-primary) 25%,
			var(--bg-sidebar-primary));

	--state-hover: color-mix(in srgb, var(--text-primary) 4%, transparent);
	--state-active: color-mix(in srgb, var(--text-primary) 8%, transparent);
	--state-selected: color-mix(in srgb, var(--text-primary) 4%, transparent);
	--state-selected-hover: color-mix(in srgb, var(--text-primary) 7%, transparent);
	/* Keyboard focus only; an outline because variants and hosts reset box-shadow. */
	--focus-ring: 2px solid color-mix(in srgb, var(--text-primary) 40%, transparent);
	/* Text and marks on a --bg-neutral fill. */
	--text-inverse: var(--bg-primary);
	/* Under popups, with a 2px backdrop blur. */
	--scrim: color-mix(in srgb, transparent 30%, var(--bg-secondary));

	--border-width: 1px;
	--form-control-height: 36px;
	--control-height-sm: 30px;
	--control-height-xs: 24px;

	--shadow:
		0px 0px 0px 1px rgba(0, 0, 0, 0.06), 0px 1px 2px -1px rgba(0, 0, 0, 0.06),
		0px 2px 4px 0px rgba(0, 0, 0, 0.04);
	--shadow-xs: 0 1px 2px rgb(0 0 0 / 6%);
	/* Floating canvas objects: graph nodes, zoom controls. */
	--shadow-md: 0 1px 2px rgb(0 0 0 / 5%), 0 2px 6px -2px rgb(0 0 0 / 6%);
	/* Menus, popovers, sheets, dialogs, toasts, the bulk bar. */
	--shadow-lg: 0 0 0 1px rgb(0 0 0 / 6%), 0 12px 32px -8px rgb(0 0 0 / 18%);

	/* Host apps layer in-page floating UI (action bars, sidebars, menus) as high
     as --z-floating. Popups are modal and must out-rank all of it. Below
     --z-floating, --z-dropdown through --z-popover cover the ordinary
     in-page floating tiers (menus, sticky headers, filter overlays) so
     apps share one stacking vocabulary instead of picking ad hoc numbers. */
	--z-dropdown: 50;
	--z-sticky: 60;
	--z-overlay: 80;
	--z-chrome: 90;
	--z-popover: 100;
	--z-floating: 1000;
	--z-modal-backdrop: 5000;
	--z-modal: 5001;

	/* Shared spacing/type/radius/transition scale — the single source for all
     three front-ends, so a theme change here permeates everywhere without
     hand-syncing per-app copies. Each family below derives from one *-unit
     token via calc(), so retuning that one value rescales the whole family
     instead of six independent knobs drifting out of proportion. */
	--font-size-2xs: 0.6875rem;
	/* Dense UI between 12 and 14: tables, menus, chips. */
	--font-size-ui: 0.8125rem;
	--font-size-xs: 0.75rem;
	--font-size-sm: 0.875rem;
	--font-size-base: 1rem;
	--font-size-lg: 1.125rem;
	--font-size-xl: 1.25rem;
	--font-size-2xl: 1.5rem;
	--font-size-3xl: 1.875rem;

	--line-height-unit: 0.25;
	--line-height-tight: calc(1 + var(--line-height-unit));
	--line-height-normal: calc(1 + var(--line-height-unit) * 2);
	--line-height-relaxed: calc(1 + var(--line-height-unit) * 3);

	--space-unit: 0.25rem;
	/* Half-step below --space-1: the "2px + var(--space-N)" idiom several
     small chip/badge paddings already share. */
	--space-half: calc(var(--space-unit) * 0.5);
	--space-1: var(--space-unit);
	--space-2: calc(var(--space-unit) * 2);
	--space-3: calc(var(--space-unit) * 3);
	--space-4: calc(var(--space-unit) * 4);
	--space-5: calc(var(--space-unit) * 5);
	--space-6: calc(var(--space-unit) * 6);
	--space-8: calc(var(--space-unit) * 8);
	--space-10: calc(var(--space-unit) * 10);
	--space-12: calc(var(--space-unit) * 12);
	--space-16: calc(var(--space-unit) * 16);

	--radius-unit: 2px;
	--radius-sm: calc(var(--radius-unit) * 2);
	--radius: calc(var(--radius-unit) * 3);
	--radius-md: calc(var(--radius-unit) * 4);
	--radius-lg: calc(var(--radius-unit) * 6);
	--radius-xl: calc(var(--radius-unit) * 8);
	--radius-2xl: calc(var(--radius-unit) * 12);
	/* Not derived from --radius-unit: this means "fully round" (a pill or
     circle once width/height cap it), not a magnitude on the scale. */
	--radius-full: 9999px;

	--transition-duration-fast: 150ms;
	--transition-duration-medium: 250ms;
	--transition-duration-normal: calc(var(--transition-duration-fast) * 2);
	--transition-fast: var(--transition-duration-fast) ease;
	--transition-medium: var(--transition-duration-medium) ease;
	--transition-normal: var(--transition-duration-normal) ease;
	--ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--icon-size: 18px;
	/* Small buttons, chips, menu search, breadcrumb chevrons. */
	--icon-size-sm: 16px;

	/* Metal swatches, the one set Make, Ring Builder and Matrix share. */
	--metal-white: #e4e6e8;
	--metal-yellow: #e3bf5a;
	--metal-rose: #dfa08f;
	--metal-platinum: #cfd2d6;
}

html,
body {
	position: relative;
	width: 100%;
	height: 100%;
	color: var(--text-secondary);
	background-color: var(--bg-secondary);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Stroke weight to match 14px text; needs the variable icon font. */
.material-symbols-outlined {
	font-variation-settings:
		'FILL' 0,
		'wght' 300,
		'GRAD' 0,
		'opsz' 20;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: var(--font-body, 'Rethink Sans', sans-serif);
	/* On body only: on html it would rescale every rem token. */
	font-size: var(--font-size-sm);
	line-height: 1.45;
}

.border-b {
	border-bottom: solid var(--border-width) var(--ui-secondary);
}

h1 {
	font-family: var(--font-heading, inherit);
	font-size: var(--font-size-2xl);
	font-weight: 600;
	letter-spacing: -0.02em;
	margin: 0;
	text-wrap: balance;
}

.btn {
	font-family: inherit;
	cursor: pointer;
	outline: none;
	border: none;
	text-decoration: none;
	color: inherit;
	/* Not `all`, which animates layout; opacity stays for hosts that fade icons. */
	transition-property: background-color, border-color, box-shadow, color, opacity;
	transition-duration: var(--transition-duration-fast);
	transition-timing-function: var(--ease-out);
	background-color: var(--bg-primary);
	padding: 0 var(--space-3);
	font-size: var(--font-size-sm);
	flex-wrap: wrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: var(--form-control-height);
	border-radius: var(--radius);
	border: solid var(--border-width) var(--ui-primary);
	box-shadow: var(--shadow-xs);
	gap: var(--space-1);
}

.btn .material-symbols-outlined {
	font-size: var(--icon-size);
}

/* The one call to action a page leads with: checkout, add to bag. */
.btn.btn-lg {
	height: calc(var(--form-control-height) + var(--space-3));
	padding: 0 var(--space-5);
	font-size: var(--font-size-base);
	font-weight: 500;
}

.btn.btn-sm,
.btn.btn-xs {
	padding: 0 10px;
}

.btn.btn-sm {
	height: var(--control-height-sm);
	font-size: var(--font-size-sm);
}

.btn.btn-xs {
	height: var(--control-height-xs);
	font-size: var(--font-size-xs);
}

.btn.btn-sm .material-symbols-outlined,
.btn.btn-xs .material-symbols-outlined {
	font-size: var(--icon-size-sm);
}

.btn.btn-icon {
	padding: 0;
	aspect-ratio: 1;
}

.btn.btn-xs.btn-icon {
	padding: var(--space-half);
}

.btn.btn-xxs {
	width: 15px;
	height: 15px;
	flex-grow: 0;
	min-width: 0;
	padding: 0;
}

.btn.btn-xxs .material-symbols-outlined {
	font-size: var(--font-size-xs);
}

kbd {
	border: solid var(--border-width) var(--ui-primary);
	border-radius: var(--radius);
	padding: var(--space-half) var(--space-2);
	background-color: var(--bg-secondary);
	font-family: inherit;
	font-size: var(--font-size-xs);
	margin-right: var(--space-1);
}

.btn.outline {
	border: solid var(--border-width) var(--ui-secondary);
	background-color: var(--bg-secondary);
}

/* A layer over the fill, so every variant keeps its own colour. */
.btn:hover {
	background-image: linear-gradient(var(--state-hover), var(--state-hover));
	box-shadow: 0 1px 1px var(--ui-primary);
}

/* After :hover, which would otherwise mask the press. */
.btn:active {
	background-image: linear-gradient(var(--state-active), var(--state-active));
	border-color: var(--ui-strong);
}

.btn:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
	border-color: var(--ui-strong);
}

.btn.primary {
	background-color: var(--bg-neutral);
	border-color: var(--bg-neutral);
	color: var(--text-inverse);
}

.btn.secondary {
	background-color: var(--ui-secondary);
	border-color: var(--ui-secondary);
}

.btn.danger {
	background-color: var(--text-danger);
	border-color: var(--text-danger);
	/* --text-danger is fixed, not tenant-tinted like --text-tint is — pairing
     it with --text-tint goes black-on-red for a tenant whose tint is dark. */
	color: white;
}

.btn.ghost {
	background: none;
	box-shadow: none;
	border: none;
}

.btn.ghost:hover {
	background-color: var(--state-hover);
}

.btn.ghost:active {
	background-color: var(--state-active);
}

/* One underline: text decoration, never a border, so a consumer that also
   underlines a link does not draw a second line under it. */
.btn.link {
	background: none;
	border: none;
	box-shadow: none;
	height: auto;
	border-radius: 0;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* After the variants, not before: at equal specificity the variant would win,
   and a disabled primary would keep its full-strength background. */
.btn:disabled {
	cursor: default;
	filter: contrast(0.8) opacity(0.8);
}

.button-bar {
	display: flex;
	padding: var(--space-3) 0;
	gap: var(--space-1);
	justify-content: flex-end;
}

.button-bar .material-symbols-outlined {
	display: flex;
}

.pill-bar {
	display: flex;
	gap: 0;
}

.pill-bar .btn {
	border-radius: 0;
	border-right: none;
}

.pill-bar .btn:first-child {
	border-top-left-radius: var(--radius);
	border-bottom-left-radius: var(--radius);
}

.pill-bar .btn:last-child {
	border-top-right-radius: var(--radius);
	border-bottom-right-radius: var(--radius);
	border-right: solid var(--border-width) var(--ui-primary);
}

.pill-box {
	display: flex;
	padding: var(--space-half);
	border-radius: var(--radius);
	background-color: var(--ui-primary);
	/* Keeps a hovered button's fill from merging into the active one. */
	gap: 2px;
}

/* The box, not its buttons, is a control's height. */
.pill-box .btn {
	height: calc(var(--form-control-height) - 2 * var(--space-half));
	gap: var(--space-1);
	background-color: transparent;
	border: none;
	border-radius: var(--radius-sm);
	box-shadow: none;
	color: var(--text-tertiary);
	font-size: var(--font-size-ui);
}

.pill-box .btn .material-symbols-outlined {
	font-size: var(--icon-size-sm);
}

.pill-box .btn.active {
	background-color: var(--bg-primary);
	box-shadow: var(--shadow-xs);
	color: var(--text-primary);
}

/* Search + filter chips on one line; scrolls sideways instead of wrapping. */
.filter-bar {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
	/* Room for focus rings, which the scroll box would otherwise clip. */
	margin: -4px;
	padding: 4px;
}

.filter-bar::-webkit-scrollbar {
	display: none;
}

/* Fades whichever edge has more to scroll to; no fade where unsupported or not overflowing. */
@property --filter-bar-start {
	syntax: '<length>';
	inherits: false;
	initial-value: 0px;
}

@property --filter-bar-end {
	syntax: '<length>';
	inherits: false;
	initial-value: 0px;
}

@supports (animation-timeline: scroll()) {
	.filter-bar {
		mask-image: linear-gradient(to right,
				transparent,
				#000 var(--filter-bar-start),
				#000 calc(100% - var(--filter-bar-end)),
				transparent);
		animation: filter-bar-fade linear both;
		animation-timeline: scroll(self inline);
	}

	@keyframes filter-bar-fade {
		0% {
			--filter-bar-start: 0px;
			--filter-bar-end: 32px;
		}

		8% {
			--filter-bar-start: 32px;
		}

		92% {
			--filter-bar-end: 32px;
		}

		100% {
			--filter-bar-start: 32px;
			--filter-bar-end: 0px;
		}
	}
}

.filter-bar>* {
	flex-shrink: 0;
}

.filter-bar>.input {
	flex: 0 1 260px;
	min-width: 160px;
}

@media screen and (max-width: 700px) {
	.pill-box .btn {
		padding: var(--space-1);
		min-width: 0;
		height: var(--control-height-xs);
	}

	.pill-box .label {
		display: none;
	}
}

.header {
	margin-bottom: var(--space-1);
}

.flex-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
}

.header .button-bar {
	padding: 0;
}

.container {
	padding: var(--space-5);
	height: 100%;
	display: flex;
	flex-direction: column;
}

.input input,
.textarea textarea {
	background: none !important;
	box-shadow: none !important;
	outline: none !important;
	min-height: 0 !important;
	border-radius: 0 !important;
	border: none !important;
	padding: 0 !important;
}

.input .material-symbols-outlined {
	font-size: var(--icon-size);
}

.input {
	gap: var(--space-1);
}

.textarea {
	display: block;
	resize: none;
	height: 150px;
}

.input,
input[type='text'],
input[type='tel'],
input[type='url'],
input[type='number'],
input[type='password'],
input[type='email'],
input[type='date'],
input[type='datetime-local'],
select,
.textarea {
	padding: 0 var(--space-3);
	display: inline-flex;
	align-items: center;
	flex: 1;
	border: none;
	outline: none;
	width: 100%;
	/* background: var(--ui-primary); */
	background-color: var(--bg-primary);
	color: var(--text-tertiary);
	transition-property: background-color, border-color, box-shadow;
	transition-duration: var(--transition-duration-fast);
	transition-timing-function: var(--ease-out);
	font-family: inherit;
	min-height: var(--form-control-height);
	font-size: var(--font-size-sm);
	border-radius: var(--radius);
	border: solid var(--border-width) var(--ui-primary);
	box-shadow: var(--shadow-xs);
}

.input.outline {
	border: solid var(--border-width) var(--ui-secondary);
	background-color: var(--bg-secondary);
}

input[type='date'],
input[type='datetime-local'] {
	display: inline-block;
}

input[type='date']::-webkit-date-and-time-value {
	line-height: var(--form-control-height);
}

input[type='file'] {
	padding-top: var(--space-2);
}

.textarea {
	padding: var(--space-2);
}

.input:hover,
input[type='text']:hover,
input[type='url']:hover,
input[type='number']:hover,
input[type='password']:hover,
input[type='email']:hover,
input[type='date']:hover,
select:hover,
textarea:hover {
	box-shadow: 0 1px 1px var(--ui-primary);
}

.input:focus-within,
.textarea:focus-within,
input[type='text']:focus,
input[type='tel']:focus,
input[type='url']:focus,
input[type='number']:focus,
input[type='password']:focus,
input[type='email']:focus,
input[type='date']:focus,
input[type='datetime-local']:focus,
select:focus,
textarea:focus {
	background: var(--bg-primary);
	border: solid var(--border-width) var(--ui-strong);
	outline: none;
}

::placeholder {
	color: var(--text-placeholder);
	opacity: 1;
}

/* Segmented fields share one class and two anatomies. `.input pair` — one
   shell around bare inputs, a segment optionally prefixed by an inline <b>
   ("Min", "$/ct"); the divider sits between segments. `.pair` — a row of
   fields, each a bare input or an .input shell under its own <b>; neighbours
   share a border and only the strip's ends keep a radius. */
.pair {
	display: flex;
}

.pair>div,
.pair>input,
.pair>.input {
	flex: 1;
	min-width: 0;
}

.pair>*:not(:first-child)>input,
.pair>.input:not(:first-child) {
	border-left: none;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.pair>*:not(:last-child)>input,
.pair>.input:not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.input.pair b {
	margin: 0;
	font-size: var(--font-size-xs);
	white-space: nowrap;
}

/* !important beats the `.input input` reset above. */
.input.pair input+input,
.input.pair input+b {
	padding-left: var(--space-2) !important;
	border-left: solid var(--border-width) var(--ui-primary) !important;
}

b {
	font-weight: 600;
}

/* One recipe for a form field label, whichever element carries it. A bare <b>
   is inline emphasis; only a form field's own <b> is a label. A <label> that
   is itself a control (FileInput, ColorPicker, a checkbox row) is not. */
.form-label,
.form-container label:not(.input, .check),
.form-control>b,
.form-group>b {
	display: block;
	font-size: var(--font-size-xs);
	font-weight: 500;
	/* Not --text-muted: that is 4.3:1 on --bg-secondary, and reads as disabled. */
	color: var(--text-secondary);
	margin-bottom: var(--space-1);
}

input[type='checkbox'] {
	appearance: none;
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin: 0;
	border: solid var(--border-width) var(--ui-strong);
	border-radius: var(--radius-sm);
	background-color: var(--bg-primary);
	box-shadow: var(--shadow-xs);
	cursor: pointer;
	transition-property: background-color, border-color;
	transition-duration: var(--transition-duration-fast);
	transition-timing-function: var(--ease-out);
}

input[type='checkbox']:hover {
	border-color: var(--text-muted);
}

input[type='checkbox']:checked,
input[type='checkbox']:indeterminate {
	background-color: var(--bg-neutral);
	border-color: var(--bg-neutral);
}

input[type='checkbox']:checked::before,
input[type='checkbox']:indeterminate::before {
	content: '';
	width: 10px;
	height: 10px;
	background-color: var(--text-inverse);
	-webkit-mask: var(--mark) center / contain no-repeat;
	mask: var(--mark) center / contain no-repeat;
	--mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2 3.9 7.5 8.5 2.7' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type='checkbox']:indeterminate::before {
	--mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5h6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

input[type='checkbox']:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

input[type='checkbox']:disabled {
	opacity: 0.5;
	cursor: default;
}

label.check {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	min-height: 28px;
	margin: 0;
	font-size: var(--font-size-ui);
	font-weight: 400;
	color: var(--text-secondary);
	cursor: pointer;
}

label.check:has(:checked) {
	color: var(--text-primary);
}

/* A removable value inside a multi-value field. */
.token {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	max-width: 100%;
	height: var(--control-height-xs);
	padding: 0 2px 0 var(--space-2);
	border-radius: var(--radius-sm);
	background-color: var(--ui-primary);
	color: var(--text-primary);
	font-size: var(--font-size-ui);
	white-space: nowrap;
}

.token> :first-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.token button {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	padding: 0;
	border: none;
	border-radius: var(--radius-sm);
	background: none;
	color: var(--text-muted);
	cursor: pointer;
}

.token button:hover {
	background-color: var(--state-hover);
	color: var(--text-primary);
}

.token button:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 0;
}

.token button .material-symbols-outlined {
	font-size: var(--font-size-sm);
}

/* A native file input, visually hidden inside its own label. */
.input.file {
	position: relative;
	gap: var(--space-2);
	cursor: pointer;
}

.input.file input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip-path: inset(50%);
}

.input.file:has(input:focus-visible) {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

.input.file.over {
	border-color: var(--ui-strong);
	background-color: var(--state-hover);
}

.input.file .material-symbols-outlined {
	color: var(--text-muted);
}

.input.file .name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-primary);
}

.input.file .name.empty {
	color: var(--text-muted);
}

.input.file .meta {
	flex-shrink: 0;
	font-size: var(--font-size-xs);
	font-variant-numeric: tabular-nums;
	color: var(--text-muted);
}

.input.file button {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: var(--control-height-xs);
	height: var(--control-height-xs);
	margin-right: calc(-1 * var(--space-2));
	padding: 0;
	border: none;
	border-radius: var(--radius-sm);
	background: none;
	color: var(--text-muted);
	cursor: pointer;
}

.input.file button:hover {
	background-color: var(--state-hover);
	color: var(--text-primary);
}

.input.file button:focus-visible {
	outline: var(--focus-ring);
}

.input.file button .material-symbols-outlined {
	font-size: var(--icon-size-sm);
	color: inherit;
}

.popup-btn.show::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--scrim);
	backdrop-filter: blur(2px);
	z-index: var(--z-modal-backdrop);
}

.popup-btn+.popup {
	background-color: var(--bg-primary);
	padding: var(--space-5);
	border-radius: var(--radius-md);
	border: solid var(--border-width) var(--ui-secondary);
	box-shadow: var(--shadow-lg);
	color: var(--text-secondary);
	font-size: var(--font-size-sm);
	display: flex;
	flex-direction: column;
	z-index: var(--z-modal);
	position: fixed;
	top: 50%;
	width: 560px;
	max-width: 95vw;
	left: 50%;
	transform: translate(-50%, -50%);
	max-height: 100%;
	overflow-y: auto;
}

/* The one menu recipe (ContextMenu, Dropdown, menubars): a panel of 32px rows. */
.menu-panel {
	box-sizing: border-box;
	padding: var(--space-1);
	background-color: var(--bg-primary);
	border: solid var(--border-width) var(--ui-secondary);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	font-size: var(--font-size-sm);
	color: var(--text-secondary);
	outline: none;
	animation: menu-enter var(--transition-duration-fast) var(--ease-out);
}

@keyframes menu-enter {
	from {
		opacity: 0;
		transform: translateY(-2px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.menu-panel {
		animation: none;
	}
}

.menu-row {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	width: 100%;
	min-height: 32px;
	padding: 0 var(--space-2);
	border: none;
	border-radius: var(--radius-sm);
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	justify-content: start;
}

.menu-row:hover:not(:disabled),
.menu-row:focus-visible {
	background-color: var(--state-hover);
	color: var(--text-primary);
	outline: none;
}

.menu-row:disabled {
	opacity: 0.4;
	cursor: default;
}

.menu-row .material-symbols-outlined {
	width: 1em;
	font-size: var(--icon-size);
	color: var(--text-muted);
}

/* A menu's filter box, above its rows. */
.menu-search {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	height: 32px;
	margin-bottom: var(--space-1);
	padding: 0 var(--space-2);
	border-bottom: solid var(--border-width) var(--ui-primary);
}

.menu-search .material-symbols-outlined {
	font-size: var(--icon-size-sm);
	color: var(--text-muted);
	pointer-events: none;
}

/* Beats the input[type="text"] recipe, which would draw a field in the row. */
.menu-search input {
	flex: 1;
	min-width: 0;
	min-height: 0;
	height: 100%;
	padding: 0;
	border: none;
	border-radius: 0;
	outline: none;
	box-shadow: none;
	background: none;
	font: inherit;
	color: var(--text-primary);
}

.menu-search input:hover,
.menu-search input:focus {
	border: none;
	box-shadow: none;
}

p.help {
	font-size: var(--font-size-sm);
	color: var(--text-tertiary);
	margin-top: var(--space-1);
	white-space: normal;
}

.popup-btn+.popup h2 {
	margin: 0 0 var(--space-2);
	color: var(--text-primary);
}

.spacer {
	flex: 1;
}

.login-form {
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}

.form-container form,
.form-container .form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-4);
}

.form-group,
.form-control {
	margin-bottom: var(--space-3);
}

/* Inside the grid, `gap` already separates the rows — the margin stacked on
   top of it, so rows sat 10px further apart than columns. */
.form-container form>.form-group,
.form-container form>.form-control,
.form-container .form>.form-group,
.form-container .form>.form-control {
	margin-bottom: 0;
}

.form-control.full {
	grid-column: span 2;
}

h2 {
	font-family: var(--font-heading, inherit);
	font-weight: 600;
	font-size: var(--font-size-base);
	letter-spacing: -0.01em;
	padding: 0;
	margin: 0;
}

.form-container h2 {
	grid-column: span 2;
}

.form-container .button-bar {
	grid-column: span 2;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

input[type='number'] {
	-moz-appearance: textfield;
}

.nothing {
	padding: var(--space-12) var(--space-3);
	text-align: center;
	border: solid var(--border-width) var(--ui-primary);
	box-shadow: 0 1px 2px var(--ui-primary);
	font-style: italic;
	background: var(--bg-primary);
	border-radius: var(--radius);
}

/* A loading placeholder; the element's own size gives it the shape it stands in for. */
.bone {
	background: linear-gradient(90deg,
			var(--ui-primary) 25%,
			var(--ui-secondary) 50%,
			var(--ui-primary) 75%);
	background-size: 200% 100%;
	border-radius: var(--radius-sm);
	animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: -100% 0;
	}
}

/* No bottom margin; pages that want a gap set one. Scrolls rather than
   wraps, with an inset hairline since a border would clip the underline. */
.tab-bar {
	display: flex;
	/* overflow drops the automatic min-height, so a tall flex sibling would crush it. */
	flex-shrink: 0;
	gap: var(--space-6);
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	box-shadow: inset 0 -1px var(--ui-primary);
}

.tab-bar::-webkit-scrollbar {
	display: none;
}

.tab-bar .btn {
	flex: none;
	height: auto;
	padding: 0 0 9px;
	/* Tabs mark the active one with the border below, not a link's underline. */
	text-decoration: none;
	white-space: nowrap;
	border-radius: 0;
	background: none;
	border-bottom: solid 2px transparent;
	box-shadow: none;
	color: var(--text-tertiary);
	font-weight: 400;
}

.tab-bar .btn:hover {
	background: none;
	color: var(--text-primary);
}

.tab-bar .btn.active {
	border-bottom-color: var(--ax-primary);
	color: var(--text-primary);
	font-weight: 500;
}

/* An item count after a tab's label. */
.tab-bar .count {
	margin-left: 6px;
	font-size: var(--font-size-xs);
	color: var(--text-muted);
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

/* The index-page template: head, tabs, toolbar, then a body that scrolls.
   Scoped under .page because the store has its own .page-head. */
.page {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	--page-gutter: 28px;
	padding: var(--space-6) var(--page-gutter) 0;
}

@media screen and (max-width: 700px) {
	.page {
		--page-gutter: var(--space-4);
	}
}

.page .page-head {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	height: var(--form-control-height);
}

.page .page-head h1 {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.page .page-tabs,
.page .page-toolbar {
	margin-top: var(--space-4);
}

.page .page-head+.page-toolbar {
	margin-top: var(--space-5);
}

.page .page-toolbar {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* The chips scroll; the controls after them stay put at the right. */
.page .page-toolbar>.filter-bar {
	flex: 1;
	gap: 6px;
}

/* A column, so a DataGrid can fill it and scroll itself (sticky header). */
.page .page-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow: auto;
	margin: var(--space-3) calc(-1 * var(--page-gutter)) 0;
	padding: 0 var(--page-gutter) var(--space-5);
}

.page .page-tabs+.page-body {
	margin-top: var(--space-4);
}

.sidebar {
	border-right: solid var(--border-width) var(--ui-primary);
	grid-area: sidebar;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: var(--space-4);
	transition: all var(--transition-duration-fast) ease-in-out;
	padding-top: var(--space-8);
}

.container>.paginator {
	margin-bottom: calc(-1 * var(--space-4));
}

.menu-item {
	padding: var(--space-half);
	background: none;
	border-radius: var(--radius);
	display: block;
	width: 35px;
	height: 35px;
	display: flex;
	justify-content: center;
	align-items: center;
	text-decoration: none;
	color: inherit;
	margin-bottom: var(--space-2);
	color: var(--text-sidebar-secondary);
	transition: all var(--transition-duration-fast) ease-in-out;
	border: none;
	font-size: inherit;
}

.menu-item:hover:not(.big-logo) {
	background-color: var(--ui-primary);
}

.menu-item.logo {
	margin-bottom: var(--space-5);
	background: none;
}

.menu-item.active {
	color: var(--text-sidebar-primary);
	background-color: var(--bg-sidebar-secondary);
}

.layout {
	display: grid;
	grid-template-areas: 'sidebar content';
	grid-template-columns: 55px 1fr;
	height: calc(100dvh - 1px);
}

.logo img {
	width: 35px;
	height: 35px;
}

.layout .content {
	grid-area: content;
	min-width: 0;
	overflow-y: auto;
	max-height: 100dvh;
}

.menu-item a {
	color: inherit;
}

span.tag,
.btn.tag {
	left: 0;
	top: calc(100% + 5px);
	display: inline-block;
	width: fit-content;
	padding: 0;
	border: 0;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: none;
	cursor: pointer;
	font-size: var(--font-size-xs);
	font-weight: 400;
	line-height: 1.33333;
	letter-spacing: 0.32px;
	background-color: var(--ui-secondary);
	color: var(--text-tertiary);
	min-width: 2rem;
	max-width: 100%;
	min-height: 1.5rem;
	align-items: center;
	justify-content: center;
	padding: var(--space-1) var(--space-2);
	margin: var(--space-1);
	border-radius: var(--radius);
	cursor: default;
	vertical-align: middle;
	word-break: break-word;
	margin-left: 0;
	margin-top: 0px;
	margin-bottom: var(--space-5);
}

h1:has(.tag) {
	position: relative;
	padding-bottom: var(--space-8);
}

h1 .tag {
	position: absolute;
}

h1 span.tag,
h1 .btn.tag {
	bottom: 0;
	top: auto;
}

a {
	color: var(--text-primary);
}

.chart-container {
	padding: var(--space-6);
	display: flex;
	flex-direction: column;
}

/* A notice on an 8% tint of its tone. Block, not flex, so inline markup in
   the text keeps its spacing; a leading icon sits inline in the tone. */
.message-error,
.message-warning,
.message-success {
	--tone: var(--text-danger);
	padding: var(--space-3);
	border-radius: var(--radius);
	background-color: color-mix(in srgb, var(--tone) 8%, transparent);
	border: solid var(--border-width) color-mix(in srgb, var(--tone) 20%, transparent);
	font-size: var(--font-size-ui);
	color: var(--text-secondary);
}

.message-warning {
	--tone: var(--status-warning);
}

.message-success {
	--tone: var(--text-success);
}

.message-error>.material-symbols-outlined:first-child,
.message-warning>.material-symbols-outlined:first-child,
.message-success>.material-symbols-outlined:first-child {
	margin-right: var(--space-2);
	font-size: var(--icon-size-sm);
	vertical-align: -3px;
	color: var(--tone);
}

.message-warning>.material-symbols-outlined:first-child {
	color: var(--text-warning);
}

.message.full {
	grid-column: span 2;
}

/* A dot and a label on a tint of --status; set it inline or with a tone. */
.status-chip {
	--status: var(--status-neutral);
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: var(--space-half) var(--space-2);
	border-radius: var(--radius-full);
	background-color: color-mix(in srgb, var(--status) 12%, transparent);
	color: var(--text-secondary);
	font-size: var(--font-size-xs);
	font-weight: 500;
	line-height: var(--line-height-tight);
	white-space: nowrap;
}

.status-chip::before {
	content: '';
	flex-shrink: 0;
	width: 6px;
	height: 6px;
	border-radius: var(--radius-full);
	background-color: var(--status);
}

.status-chip.success {
	--status: var(--status-success);
}

.status-chip.warning {
	--status: var(--status-warning);
}

.status-chip.danger {
	--status: var(--status-danger);
}

.status-chip.running {
	--status: var(--status-running);
}

/* A neutral icon and label for an item's metadata; a button when it filters. */
.meta-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: var(--space-half) var(--space-2) var(--space-half) var(--space-1);
	border: none;
	border-radius: var(--radius-full);
	background-color: var(--ui-primary);
	color: var(--text-secondary);
	font-family: inherit;
	font-size: var(--font-size-xs);
	font-weight: 400;
	line-height: var(--line-height-tight);
	white-space: nowrap;
}

.meta-chip .material-symbols-outlined {
	font-size: var(--font-size-xs);
	color: var(--text-muted);
}

button.meta-chip:not(:disabled) {
	cursor: pointer;
}

button.meta-chip:not(:disabled):hover {
	background-color: var(--ui-secondary);
}

.meta-chip.success,
.meta-chip.success .material-symbols-outlined {
	color: var(--text-success);
}

.meta-chip.danger,
.meta-chip.danger .material-symbols-outlined {
	color: var(--text-danger);
}

.meta-chip.danger {
	background-color: color-mix(in srgb, var(--text-danger) 8%, transparent);
}

/* A row's own buttons: ghost 24px icons, shown while the row is hovered or
   focused, and always where there is no hover. */
.row-actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-1);
	opacity: 0;
	transition: opacity var(--transition-fast);
}

tr:hover .row-actions,
.row-actions:focus-within {
	opacity: 1;
}

@media (hover: none) {
	.row-actions {
		opacity: 1;
	}
}

.row-actions>.btn {
	width: var(--control-height-xs);
	height: var(--control-height-xs);
	color: var(--text-tertiary);
}

.row-actions>.btn.destructive:hover {
	color: var(--text-danger);
}

.card-title {
	font-size: var(--font-size-sm);
	font-weight: 500;
	margin-bottom: var(--space-1);
}

@media screen and (max-width: 730px) {

	.form-control.full,
	.form-container .button-bar,
	.form-container h2 {
		grid-column: span 1;
	}

	.form-container form,
	.form-container .form {
		grid-template-columns: 1fr;
	}
}

.tbl {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	border: solid var(--border-width) var(--ui-primary);
	border-radius: var(--radius);
	overflow: hidden;
}

.tbl.unbordered {
	border: none;
}

.tbl td,
.tbl th {
	padding: var(--space-2);
	border-bottom: solid var(--border-width) var(--ui-primary);
	font-size: var(--font-size-xs);
}

.tbl.tbl-sm td,
.tbl.tbl-sm th {
	padding: var(--space-half) var(--space-2);
}

.tbl th {
	text-align: left;
	font-weight: 500;
}

/* Data-entry rows, spreadsheet style: the control is the cell and sets the
   row height. Not ColorPicker, a swatch rather than a text cell. */
.tbl tr:has(.input:not(.color-picker), select, > td > .dropdown, > td > .multi-drop-down)>td {
	padding-block: 0;
}

.tbl td:has(.input:not(.color-picker), select, > .dropdown, > .multi-drop-down) {
	padding: 0;
}

.tbl td:has(.input:not(.color-picker), select, > .dropdown, > .multi-drop-down):not(:last-child) {
	border-right: solid var(--border-width) var(--ui-primary);
}

/* An outline, so an opaque focused control can't cover it. */
.tbl td:has(.input:not(.color-picker), select, > .dropdown, > .multi-drop-down):focus-within {
	outline: 1.5px solid var(--text-primary);
	outline-offset: -1.5px;
}

.tbl td .input:not(.color-picker),
.tbl td select,
.tbl td>.dropdown>.btn,
.tbl td>.multi-drop-down>.btn {
	width: 100%;
	height: var(--form-control-height);
	min-height: 0;
	padding: 0 var(--space-2);
	border: none;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	background-color: transparent;
	color: inherit;
	font-size: inherit;
}

.info-box {
	margin-top: 0;
	font-size: var(--font-size-base);
	color: var(--text-muted);
	padding: var(--space-1) var(--space-3);
	display: flex;
	gap: var(--space-3);
	justify-content: left;
	align-items: center;
	flex-direction: row;
	margin-bottom: var(--space-1);
}

@media screen and (max-width: 750px) {
	.info-box span {
		font-size: var(--icon-size-sm);
	}

	.info-box {
		font-size: var(--font-size-xs);
	}
}

.diatech-card {
	background-color: var(--bg-primary);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-xs);
	border: solid var(--border-width) var(--ui-primary);
}

.diatech-card h5 {
	font-weight: 400;
	margin-bottom: var(--space-1);
	margin-top: 0;
}

.diatech-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	min-height: 48px;
	padding: 0 var(--space-3) 0 var(--space-4);
	border-bottom: solid var(--border-width) var(--ui-primary);
}

.diatech-card-head h2 {
	margin: 0;
	padding: 0;
	font-size: var(--font-size-base);
	font-weight: 600;
}

.diatech-card-body {
	padding: var(--space-3) var(--space-4);
}


.diatech-card-actions {
	display: flex;
	gap: var(--space-1);
}

.breadcrumb {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	min-width: 0;
	height: var(--control-height-sm);
	font-size: var(--font-size-sm);
}

.breadcrumb a {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	height: 100%;
	padding: 0 var(--space-2);
	border-radius: var(--radius);
	color: var(--text-tertiary);
	text-decoration: none;
}

.breadcrumb a:hover {
	background-color: var(--ui-primary);
	color: var(--text-primary);
}

.breadcrumb a:focus-visible {
	outline: var(--focus-ring);
}

.breadcrumb>.material-symbols-outlined {
	font-size: var(--icon-size-sm);
	line-height: 1;
	color: var(--text-muted);
}

.breadcrumb> :last-child {
	color: var(--text-primary);
	font-weight: 500;
}

/* Only plain text: clipping a picker's wrapper would clip its dropdown. */
.breadcrumb>span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.breadcrumb>.btn:last-child,
.breadcrumb> :last-child>.btn {
	height: var(--control-height-sm);
	padding: 0 var(--space-2);
	background-color: var(--ui-primary);
	border: none;
	box-shadow: none;
}

.breadcrumb>.btn:last-child:hover,
.breadcrumb> :last-child>.btn:hover {
	background-color: var(--ui-secondary);
}

.breadcrumb>.btn:last-child .material-symbols-outlined,
.breadcrumb> :last-child>.btn .material-symbols-outlined {
	font-size: var(--icon-size);
}

/* Workspace inspector: a 40px head, Accordion groups, then fields and slider
   rows. Scoped so the store's and admin's own range inputs keep their look. */
.inspector-head {
	display: flex;
	flex: none;
	align-items: center;
	gap: var(--space-2);
	height: 40px;
	padding: 0 var(--space-3);
	border-bottom: solid var(--border-width) var(--ui-primary);
}

.inspector-head> :first-child {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	color: var(--text-primary);
	font-size: var(--font-size-sm);
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.inspector .field {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding: var(--space-2) var(--space-3);
}

/* Label and value on one line: a slider's number, a colour's hex. */
.inspector .field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	min-height: 22px;
}

.inspector .field-label {
	min-width: 0;
	overflow: hidden;
	color: var(--text-secondary);
	font-size: var(--font-size-xs);
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.inspector .field-value {
	min-width: 0;
	overflow-wrap: anywhere;
	color: var(--text-primary);
	font-size: var(--font-size-ui);
}

/* A number that reads as text until it is clicked. */
.inspector .field-row input[type='number'] {
	flex: none;
	width: 64px;
	height: 22px;
	min-height: 0;
	box-shadow: none;
	padding: 0 var(--space-1);
	border: none;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-primary);
	font: inherit;
	font-size: var(--font-size-xs);
	font-variant-numeric: tabular-nums;
	text-align: right;
	-moz-appearance: textfield;
	appearance: textfield;
}

.inspector .field-row input[type='number']::-webkit-inner-spin-button,
.inspector .field-row input[type='number']::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.inspector .field-row input[type='number']:hover {
	background: var(--state-hover);
}

.inspector .field-row input[type='number']:focus {
	outline: var(--focus-ring);
	background: var(--bg-primary);
}

/* --fill is the value's position from 0 to 1, set by the caller; the fill
   ends under the thumb's centre, which travels 8px inside each end. */
.inspector input[type='range'] {
	--fill-to: calc(8px + (100% - 16px) * var(--fill, 0));
	width: 100%;
	height: 16px;
	margin: 0;
	background: linear-gradient(to right,
			var(--bg-neutral) var(--fill-to),
			var(--ui-secondary) var(--fill-to)) center / 100% 4px no-repeat;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* Two native ranges over one track (SliderMenu, DiscreteRangeMenu); --from
   and --to (0 to 1) place the fill between the thumbs' centres. */
.range {
	position: relative;
	height: 16px;
}

.range::before {
	content: '';
	position: absolute;
	inset: 6px 0;
	border-radius: var(--radius-full);
	background: linear-gradient(to right,
			var(--ui-secondary) calc(8px + (100% - 16px) * var(--from, 0)),
			var(--bg-neutral) 0 calc(8px + (100% - 16px) * var(--to, 1)),
			var(--ui-secondary) 0);
}

.range input[type='range'] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.range input[type='range']::-moz-range-track {
	background: none;
}

/* The thumb nearer the other end stays on top, so two thumbs at one end
   can still be pulled apart. */
.range input[type='range'].top {
	z-index: 1;
}

.inspector input[type='range']::-webkit-slider-thumb,
.range input[type='range']::-webkit-slider-thumb {
	width: 16px;
	height: 16px;
	border: none;
	border-radius: var(--radius-full);
	background: var(--bg-primary);
	box-shadow:
		0 0 0 1px var(--ui-strong),
		var(--shadow-xs);
	cursor: pointer;
	pointer-events: auto;
	-webkit-appearance: none;
}

.inspector input[type='range']::-moz-range-thumb,
.range input[type='range']::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border: none;
	border-radius: var(--radius-full);
	background: var(--bg-primary);
	box-shadow:
		0 0 0 1px var(--ui-strong),
		var(--shadow-xs);
	cursor: pointer;
	pointer-events: auto;
}

.inspector input[type='range']:focus-visible,
.range input[type='range']:focus-visible {
	outline: none;
}

.inspector input[type='range']:focus-visible::-webkit-slider-thumb,
.range input[type='range']:focus-visible::-webkit-slider-thumb {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

.inspector input[type='range']:focus-visible::-moz-range-thumb,
.range input[type='range']:focus-visible::-moz-range-thumb {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

/* Metal and colour swatches: 22px discs, selected with a neutral ring. */
.swatch {
	flex: none;
	width: 22px;
	height: 22px;
	padding: 0;
	border: none;
	border-radius: var(--radius-full);
	background: var(--swatch);
	background-position: center;
	background-size: cover;
	box-shadow: inset 0 0 0 1px var(--ui-primary);
	cursor: pointer;
}

.swatch.active {
	box-shadow:
		inset 0 0 0 1px var(--ui-primary),
		0 0 0 2px var(--bg-primary),
		0 0 0 3px var(--text-primary);
}

.swatch:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 4px;
}