/* ===========================================================================
   RoyalT - dark admin theme.
   Layered on top of Bootstrap 5 (loaded with data-bs-theme="dark").
   =========================================================================== */

:root {
	/* surfaces, darkest to lightest */
	--rt-bg: #070a12;
	--rt-sidebar: #0b101c;
	--rt-surface: #111726;
	--rt-surface-2: #161d2f;
	--rt-border: #1f2839;
	--rt-border-soft: #182032;

	/* text */
	--rt-text: #e7ecf6;
	--rt-text-dim: #93a0b8;
	--rt-text-faint: #64718a;

	/* accents */
	--rt-accent: #3b82f6;
	--rt-accent-strong: #2563eb;
	--rt-green: #22c55e;
	--rt-red: #ef4444;
	--rt-amber: #f59e0b;
	--rt-purple: #8b5cf6;
	--rt-cyan: #06b6d4;

	--rt-radius: 16px;
	--rt-radius-sm: 10px;
	--rt-sidebar-width: 256px;

	/* Bootstrap overrides */
	--bs-body-bg: var(--rt-bg);
	--bs-body-color: var(--rt-text);
	--bs-border-color: var(--rt-border);
	--bs-primary: var(--rt-accent);
	--bs-link-color: var(--rt-accent);
	--bs-link-hover-color: #60a5fa;
	--bs-secondary-color: var(--rt-text-dim);
}

body {
	background:
		radial-gradient(1200px 600px at 78% -10%, rgba(59, 130, 246, .10), transparent 60%),
		radial-gradient(900px 500px at 8% 0%, rgba(139, 92, 246, .07), transparent 55%),
		var(--rt-bg);
	background-attachment: fixed;
	color: var(--rt-text);
	font-size: .9375rem;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: rgba(59, 130, 246, .35);
}

/* --- application shell ---------------------------------------------------- */

.app {
	min-height: 100vh;
}

.app__sidebar {
	width: var(--rt-sidebar-width);
	flex: 0 0 var(--rt-sidebar-width);
	background: var(--rt-sidebar);
	border-right: 1px solid var(--rt-border-soft);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
	padding: 1.25rem 0;
}

.app__brand {
	display: flex;
	align-items: center;
	gap: .625rem;
	padding: 0 1.25rem 1.25rem;
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--rt-text);
	text-decoration: none;
}

.app__brand-mark {
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: linear-gradient(140deg, var(--rt-accent), var(--rt-purple));
	color: #fff;
	font-size: 1rem;
}

.app__nav {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 .75rem;
}

.app__nav-group {
	margin-bottom: 1.25rem;
}

.app__nav-title {
	padding: 0 .625rem .5rem;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
}

.app__nav-link {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .5rem .625rem;
	margin-bottom: .125rem;
	border-radius: var(--rt-radius-sm);
	color: var(--rt-text-dim);
	text-decoration: none;
	font-size: .875rem;
	transition: background .15s, color .15s;
}

.app__nav-link i {
	font-size: 1rem;
	width: 1.125rem;
	text-align: center;
}

.app__nav-link:hover {
	background: rgba(255, 255, 255, .04);
	color: var(--rt-text);
}

.app__nav-link--active {
	background: linear-gradient(90deg, rgba(59, 130, 246, .18), rgba(59, 130, 246, .04));
	color: #fff;
	box-shadow: inset 2px 0 0 var(--rt-accent);
}

.app__user {
	margin: 0 .75rem;
	padding: .5rem .625rem;
	border: 1px solid var(--rt-border-soft);
	border-radius: var(--rt-radius-sm);
	background: var(--rt-surface);
	display: flex;
	align-items: center;
	gap: .5rem;
	transition: border-color .15s;
}

.app__user:hover {
	border-color: #2b3852;
}

.app__user--active {
	border-color: rgba(59, 130, 246, .45);
	background: linear-gradient(90deg, rgba(59, 130, 246, .14), var(--rt-surface));
}

.app__user-link {
	display: flex;
	align-items: center;
	gap: .625rem;
	flex: 1 1 auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.app__user-text {
	min-width: 0;
}

.app__user-name,
.app__user-role {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app__user-name {
	font-size: .8125rem;
	color: var(--rt-text);
}

.app__user-role {
	font-size: .6875rem;
	color: var(--rt-text-faint);
}

.app__avatar {
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: linear-gradient(140deg, var(--rt-accent), var(--rt-cyan));
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
}

.app__main {
	min-width: 0;
}

.app__topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .875rem 1.75rem;
	background: rgba(7, 10, 18, .82);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--rt-border-soft);
}

.app__crumbs {
	display: flex;
	align-items: center;
	gap: .5rem;
	min-width: 0;
	font-size: .8125rem;
	color: var(--rt-text);
}

.app__crumbs a {
	color: var(--rt-text-faint);
	text-decoration: none;
}

.app__crumbs a:hover {
	color: var(--rt-text-dim);
}

.app__crumbs i {
	font-size: .6875rem;
	color: var(--rt-text-faint);
}

.app__crumbs span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app__content {
	padding: 1.75rem;
}

/* --- notifications -------------------------------------------------------- */

.notif__bell {
	position: relative;
	overflow: visible;
}

/* The snippet wrapper around the count. The bell is an inline-flex button with
   a gap, and a wrapper box would take a slot in it and push the icon off
   centre; "contents" leaves only the count, which is positioned absolutely. */
.notif__count-slot {
	display: contents;
}

.notif__count {
	position: absolute;
	top: -5px;
	right: -5px;
	min-width: 17px;
	height: 17px;
	padding: 0 .25rem;
	border-radius: 999px;
	background: var(--rt-red);
	border: 2px solid var(--rt-bg);
	color: #fff;
	font-size: .625rem;
	font-weight: 600;
	line-height: 13px;
	text-align: center;
}

.notif.dropdown-menu {
	width: 22rem;
	max-width: calc(100vw - 2rem);
	padding: 0;
	margin-top: .5rem;
	background: var(--rt-surface);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
	overflow: hidden;
}

.notif__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
	padding: .875rem 1rem;
	border-bottom: 1px solid var(--rt-border-soft);
	font-size: .875rem;
}

/* Scrolls up and down only. A long file name has no spaces to break at and
   would otherwise push the list sideways, with a scrollbar under it. */
.notif__list {
	max-height: 21rem;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--rt-border) transparent;
}

.notif__list::-webkit-scrollbar {
	width: 6px;
}

.notif__list::-webkit-scrollbar-thumb {
	background: var(--rt-border);
	border-radius: 999px;
}

.notif__item {
	display: flex;
	gap: .75rem;
	padding: .75rem 1rem;
	border-bottom: 1px solid var(--rt-border-soft);
}

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

.notif__item--read {
	opacity: .55;
}

/* The Notifications page: a read one faded like in the bell. */
.table-rt tbody tr.notification-row--read td {
	opacity: .6;
}

.notif__icon {
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	display: grid;
	place-items: center;
	border-radius: 9px;
	font-size: .875rem;
	color: var(--tint, var(--rt-accent));
	background: color-mix(in srgb, var(--tint, var(--rt-accent)) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--tint, var(--rt-accent)) 30%, transparent);
}

.notif__body {
	flex: 1 1 auto;
	min-width: 0;
	display: block;
	overflow-wrap: anywhere;
}

.notif__title {
	display: block;
	font-size: .8125rem;
	color: var(--rt-text);
	line-height: 1.35;
}

.notif__text {
	display: block;
	font-size: .75rem;
	color: var(--rt-text-dim);
	line-height: 1.4;
}

.notif__when {
	display: block;
	margin-top: .1875rem;
	font-size: .6875rem;
	color: var(--rt-text-faint);
}

.notif__empty {
	margin: 0;
	padding: 1.5rem 1rem;
	text-align: center;
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.notif__foot {
	padding: .625rem 1rem;
	border-top: 1px solid var(--rt-border-soft);
	font-size: .75rem;
}

/* --- generic surfaces ----------------------------------------------------- */

.card-rt {
	background: linear-gradient(180deg, var(--rt-surface-2), var(--rt-surface));
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
}

/* Only cards sitting in a grid column stretch, so that neighbours in the same
   row line up. A card on its own must keep its content height - height:100%
   there resolves against the whole content area and leaves a huge gap. */
.row > [class*="col-"] > .card-rt {
	height: 100%;
}

.card-rt__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.125rem 1.25rem;
	border-bottom: 1px solid var(--rt-border-soft);
}

.card-rt__title {
	margin: 0;
	font-size: .9375rem;
	font-weight: 600;
	letter-spacing: -.01em;
}

/* An icon before a card's title - what the section is about, at a glance. */
.card-rt__icon {
	margin-right: .5rem;
	color: var(--rt-accent);
}

.card-rt__sub {
	margin: .125rem 0 0;
	font-size: .75rem;
	color: var(--rt-text-faint);
}

.card-rt__body {
	padding: 1.25rem;
}

.page-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

/* The heading and its text on the left, the page's main action on the
   right - its bottom level with the bottom of the text. */
.page-head--end {
	align-items: flex-end;
	flex-wrap: nowrap;
}

.page-head--end > .btn-rt {
	flex: 0 0 auto;
}

/* A detail's head (back button, a big avatar, the name) is taller than its
   text: the action sits in its middle, beside the name. */
.page-head--end:has(> .product-head) {
	align-items: center;
}

@media (max-width: 575.98px) {
	.page-head--end {
		flex-wrap: wrap;
	}
}

.page-head h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -.02em;
}

.page-head p {
	margin: .25rem 0 0;
	color: var(--rt-text-dim);
	font-size: .875rem;
}

/* --- KPI tiles ------------------------------------------------------------ */

.kpi {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, var(--rt-surface-2), var(--rt-surface));
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
	padding: 1.125rem 1.25rem;
	height: 100%;
}

.kpi::after {
	content: "";
	position: absolute;
	inset: -40% 55% 40% -10%;
	background: radial-gradient(closest-side, rgba(59, 130, 246, .16), transparent);
	pointer-events: none;
}

.kpi__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.kpi__icon {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 11px;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	color: var(--rt-text-dim);
	font-size: 1.0625rem;
}

.kpi__label {
	margin: 0 0 .25rem;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.kpi__value {
	margin: 0;
	font-size: 1.625rem;
	font-weight: 600;
	letter-spacing: -.02em;
	line-height: 1.2;
}

.kpi__foot {
	margin: .375rem 0 0;
	font-size: .75rem;
	color: var(--rt-text-faint);
}

/* Something the figure leaves out or takes off, e.g. withholding tax. */
.kpi__foot--warn {
	margin-top: .125rem;
	color: var(--rt-amber);
}

/* The Developer payout tile: one line per developer under the total. */
.kpi__link {
	position: relative;
	z-index: 1;
	color: var(--rt-text-faint);
	font-size: .875rem;
}

.kpi__link:hover {
	color: var(--rt-accent);
}

.kpi__list {
	position: relative;
	z-index: 1;
	display: grid;
	gap: .25rem;
	margin: .5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: .75rem;
}

.kpi__list li {
	display: flex;
	justify-content: space-between;
	gap: .75rem;
}

.kpi__list-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--rt-text-dim);
}

.kpi__list-value {
	color: var(--rt-text);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* --- delta / status pills ------------------------------------------------- */

.pill {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	padding: .1875rem .5rem;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

.pill--up {
	color: #6ee7a8;
	background: rgba(34, 197, 94, .12);
	border: 1px solid rgba(34, 197, 94, .25);
}

.pill--down {
	color: #fca5a5;
	background: rgba(239, 68, 68, .12);
	border: 1px solid rgba(239, 68, 68, .25);
}

.pill--neutral {
	color: var(--rt-text-dim);
	background: rgba(255, 255, 255, .05);
	border: 1px solid var(--rt-border);
}

.pill--info {
	color: #93c5fd;
	background: rgba(59, 130, 246, .12);
	border: 1px solid rgba(59, 130, 246, .28);
}

.pill--warn {
	color: #fcd34d;
	background: rgba(245, 158, 11, .12);
	border: 1px solid rgba(245, 158, 11, .28);
}

/* --- buttons -------------------------------------------------------------- */

.btn-rt {
	display: inline-flex;
	align-items: center;
	gap: .4375rem;
	padding: .4375rem .875rem;
	border-radius: var(--rt-radius-sm);
	border: 1px solid transparent;
	font-size: .8125rem;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}

.btn-rt:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .35);
}

.btn-rt > .bi {
	font-size: 1.05em;
	line-height: 1;
}

/* The coloured buttons: flat, one solid colour, a shade darker on hover and
   pressed in a little on click. */
.btn-rt--primary,
.btn-rt--danger {
	--btn-bg: var(--rt-accent);
	--btn-bg-hover: var(--rt-accent-strong);
	--btn-ring: rgba(59, 130, 246, .35);

	background: var(--btn-bg);
	color: #fff;
	font-weight: 600;
	letter-spacing: .01em;
}

.btn-rt--danger {
	--btn-bg: var(--rt-red);
	--btn-bg-hover: #dc2626;
	--btn-ring: rgba(239, 68, 68, .35);
}

.btn-rt--primary:hover,
.btn-rt--danger:hover {
	background: var(--btn-bg-hover);
	color: #fff;
}

.btn-rt--primary:active,
.btn-rt--danger:active {
	transform: scale(.97);
}

.btn-rt--primary:focus-visible,
.btn-rt--danger:focus-visible {
	box-shadow: 0 0 0 3px var(--btn-ring);
}

.btn-rt--lg {
	padding: .5625rem 1.25rem;
	gap: .4375rem;
	font-size: .85rem;
}

/* Full width, as in the forms of the sign-in page and the dialogs. */
.btn-rt--block {
	width: 100%;
	justify-content: center;
	padding-top: .5625rem;
	padding-bottom: .5625rem;
	font-size: .875rem;
}

.btn-rt--ghost {
	background: var(--rt-surface);
	border-color: var(--rt-border);
	color: var(--rt-text-dim);
}

.btn-rt--ghost:hover {
	border-color: #2b3852;
	color: var(--rt-text);
}

.btn-rt--icon {
	padding: .4375rem;
	width: 34px;
	height: 34px;
	justify-content: center;
	background: var(--rt-surface);
	border-color: var(--rt-border);
	color: var(--rt-text-dim);
}

.btn-rt--icon:hover {
	color: var(--rt-text);
	border-color: #2b3852;
}

.btn-rt:disabled,
.btn-rt[aria-disabled="true"] {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
}

/* --- palette tints --------------------------------------------------------
   Colours travel from PHP as a class name, never as an inline style: Latte
   escapes interpolated values in a style attribute (var(--x) becomes
   var\(--x\)) and the browser then drops the declaration.
   --------------------------------------------------------------------------- */

.tint-blue { --tint: var(--rt-accent); }
.tint-purple { --tint: var(--rt-purple); }
.tint-green { --tint: var(--rt-green); }
.tint-cyan { --tint: var(--rt-cyan); }
.tint-amber { --tint: var(--rt-amber); }
.tint-red { --tint: var(--rt-red); }

/* --- charts --------------------------------------------------------------- */

.chart {
	width: 100%;
	height: auto;
	display: block;
	overflow: visible;
}

.chart-scroll {
	overflow-x: auto;
}

/* Below this the whole drawing would shrink with it, and the axis labels
   along with it. Better to keep it readable and let it scroll. */
@media (max-width: 767.98px) {
	.chart-scroll .chart {
		min-width: 34rem;
	}
}

.chart__grid {
	stroke: var(--rt-border-soft);
	stroke-dasharray: 4 6;
	stroke-width: 1;
}

/* 11 pixels on screen whatever the chart's scale (--chart-scale, app.js). */
.chart__axis {
	fill: var(--rt-text-faint);
	font-size: calc(11px / var(--chart-scale, 1));
}

/* The lines as thick on screen in every chart. */
.chart path,
.chart line,
.chart circle {
	vector-effect: non-scaling-stroke;
}

.chart__dot {
	fill: var(--rt-bg);
	stroke-width: 2.5;
}

/* --- the revenue chart's switches: one per line, on or off (app.js) -------- */

.series-toggles {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .375rem;
	margin-bottom: 1rem;
}

.series-toggles__sep {
	width: 1px;
	height: 1.25rem;
	margin: 0 .25rem;
	background: var(--rt-border);
}

.series-toggle {
	display: inline-flex;
	align-items: center;
	gap: .4375rem;
	padding: .3125rem .625rem;
	background: color-mix(in srgb, var(--series) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--series) 35%, transparent);
	border-radius: 999px;
	color: var(--rt-text);
	font-size: .75rem;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, opacity .15s;
}

.series-toggle:hover {
	border-color: var(--series);
}

.series-toggle:focus-visible {
	outline: 2px solid rgba(59, 130, 246, .5);
	outline-offset: 2px;
}

.series-toggle > .bi {
	font-size: .6875rem;
	color: var(--rt-text-dim);
}

.series-toggle__swatch {
	width: .875rem;
	height: 3px;
	border-radius: 2px;
	background: var(--series);
}

.series-toggle__swatch--dashed {
	background: repeating-linear-gradient(90deg, var(--series) 0 4px, transparent 4px 7px);
}

/* Switched off: greyed, the swatch hollow. */
.series-toggle[aria-pressed="false"] {
	background: transparent;
	border-color: var(--rt-border);
	color: var(--rt-text-faint);
}

.series-toggle[aria-pressed="false"] .series-toggle__swatch {
	opacity: .35;
}

.chart__empty {
	fill: var(--rt-text-faint);
	font-size: 13px;
}

/* --- the bubble over the revenue chart (app.js) ---------------------------- */

.chart-hover {
	position: relative;
	cursor: crosshair;
}

.chart__guide {
	stroke: var(--rt-border);
	stroke-width: 1;
	stroke-dasharray: 3 4;
}

.chart__hover {
	pointer-events: none;
}

/* In the window, not in the chart (app.js places it): a scrolling box
   around the chart would clip it, or grow a scrollbar for it. */
.chart-tip {
	position: fixed;
	z-index: 40;
	min-width: 11rem;
	padding: .625rem .75rem;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
	font-size: .75rem;
	pointer-events: none;
	white-space: nowrap;
}

.chart-tip__month {
	margin-bottom: .375rem;
	font-weight: 600;
	color: var(--rt-text);
}

.chart-tip__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .125rem 0;
}

.chart-tip__key {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	color: var(--rt-text-dim);
}

.chart-tip__value {
	color: var(--rt-text);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.chart-tip__empty {
	margin-top: .25rem;
	color: var(--rt-text-faint);
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: .375rem 1rem;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.legend__item {
	display: flex;
	align-items: center;
	gap: .4375rem;
}

/* ---- Sales by country (dashboard, app.js) ----------------------------------
   One blue in five steps, lighter for more - on the dark card the lightest
   stands out most. Countries without sales are plain land. */
.country-map {
	position: relative;
	aspect-ratio: 960 / 470;
}

.country-map__svg {
	display: block;
	width: 100%;
	height: 100%;
}

.country-map__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	margin: 0;
	font-size: .875rem;
	color: var(--rt-text-faint);
}

.country-map__land {
	fill: #1f2839;
	stroke: var(--rt-surface);
	stroke-width: .5;
	transition: fill .15s;
}

.country-map__land--1 { fill: #184f95; }
.country-map__land--2 { fill: #256abf; }
.country-map__land--3 { fill: #3987e5; }
.country-map__land--4 { fill: #6da7ec; }
.country-map__land--5 { fill: #9ec5f4; }

.country-map__land[class*="--"] {
	cursor: pointer;
}

.country-map__land.is-hover {
	stroke: var(--rt-text);
	stroke-width: 1.25;
}

.country-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: .375rem 1rem;
	margin-top: .75rem;
	font-size: .75rem;
	color: var(--rt-text-dim);
	font-variant-numeric: tabular-nums;
}

.country-map__step {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
}

.country-map__swatch {
	width: .75rem;
	height: .75rem;
	border-radius: 3px;
	background: #1f2839;
}

.country-map__swatch.country-map__land--1 { background: #184f95; }
.country-map__swatch.country-map__land--2 { background: #256abf; }
.country-map__swatch.country-map__land--3 { background: #3987e5; }
.country-map__swatch.country-map__land--4 { background: #6da7ec; }
.country-map__swatch.country-map__land--5 { background: #9ec5f4; }

.country-list__title {
	margin: 0 0 .75rem;
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
}

.country-list {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.country-list__item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: .25rem .75rem;
	padding: .4375rem .5rem;
	border-radius: 8px;
	font-size: .8125rem;
	cursor: default;
}

.country-list__item.is-hover {
	background: var(--rt-surface-2);
}

.country-list__name {
	display: flex;
	align-items: center;
	gap: .5rem;
	min-width: 0;
	color: var(--rt-text);
	font-weight: 500;
}

.country-list__name > span {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.country-list__name small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: .6875rem;
	font-weight: 400;
	color: var(--rt-text-faint);
}

.country-list__value {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	align-self: center;
	color: var(--rt-text);
	font-variant-numeric: tabular-nums;
}

/* The country's share, under its payout. */
.country-list__value small {
	font-size: .6875rem;
	color: var(--rt-text-faint);
}

.country-list__bar {
	grid-column: 1 / -1;
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, .05);
	overflow: hidden;
}

.country-list__bar > span {
	display: block;
	height: 100%;
	border-radius: 2px;
	background: #3987e5;
}

.country-list__empty {
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.country-tip__head {
	display: flex;
	align-items: center;
	gap: .4375rem;
}

.country-tip__products {
	margin-top: .375rem;
	padding-top: .375rem;
	border-top: 1px solid var(--rt-border);
}

.legend__dot {
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	flex: 0 0 auto;
	background: var(--tint, var(--rt-text-faint));
}

.donut-seg {
	stroke: var(--tint, var(--rt-accent));
}

.legend__value {
	color: var(--rt-text);
	font-weight: 500;
}

.donut-wrap {
	position: relative;
	display: grid;
	place-items: center;
}

.donut-wrap__centre {
	position: absolute;
	text-align: center;
	line-height: 1.25;
}

.donut-wrap__centre strong {
	display: block;
	font-size: 1.375rem;
	font-weight: 600;
	letter-spacing: -.02em;
}

.donut-wrap__centre span {
	font-size: .75rem;
	color: var(--rt-text-faint);
}

/* --- tables --------------------------------------------------------------- */

.table-rt {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: .8125rem;
}

.table-rt th {
	padding: .625rem 1.25rem;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
	background: rgba(255, 255, 255, .015);
	border-bottom: 1px solid var(--rt-border-soft);
	text-align: left;
	white-space: nowrap;
}

.table-rt td {
	padding: .75rem 1.25rem;
	border-bottom: 1px solid var(--rt-border-soft);
	vertical-align: middle;
	color: var(--rt-text-dim);
}

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

.table-rt tbody tr:hover td {
	background: rgba(255, 255, 255, .02);
}

.table-rt .is-primary {
	color: var(--rt-text);
	font-weight: 500;
}

.table-rt .is-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.table-scroll {
	overflow-x: auto;
}

/* A table filling a card: clip it to the card's rounded corners, or a row
   with a background of its own (hover, an opened import detail) pokes out
   square at the bottom. The overflow above already clips; this rounds it.
   One pixel less, for the card's border. Only the edges that meet the
   card's: a pager under the table keeps the bottom square. */
.card-rt > .table-scroll:first-child {
	border-top-left-radius: calc(var(--rt-radius) - 1px);
	border-top-right-radius: calc(var(--rt-radius) - 1px);
}

.card-rt > .table-scroll:last-child {
	border-bottom-left-radius: calc(var(--rt-radius) - 1px);
	border-bottom-right-radius: calc(var(--rt-radius) - 1px);
}

.thing {
	display: flex;
	align-items: center;
	gap: .625rem;
	/* the table scrolls sideways rather than squashing names onto three lines */
	white-space: nowrap;
}

.thing__mark {
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	font-size: .75rem;
	font-weight: 600;
	color: #fff;
	background: var(--tint, var(--rt-accent));
}

.thing__sub {
	display: block;
	font-size: .6875rem;
	color: var(--rt-text-faint);
}

/* --- filter bar ----------------------------------------------------------- */

.filter {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: 1rem;
	padding: .625rem .75rem;
	background: linear-gradient(180deg, var(--rt-surface-2), var(--rt-surface));
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
	/* One line: the fields shrink rather than pushing the buttons onto a row
	   of their own. It wraps only once there is genuinely no room. */
	flex-wrap: nowrap;
}

@media (max-width: 767.98px) {
	.filter {
		flex-wrap: wrap;
	}
}

/* A floor on every field, so shrinking on one line never squeezes a control
   down to nothing. */
.filter__field {
	flex: 1 1 7rem;
	min-width: 5.5rem;
}

.filter__field--search {
	flex: 2 1 7rem;
}

/* A bar with few fields: only as wide as they are, not the whole row. */
.filter--compact {
	width: fit-content;
	max-width: 100%;
}

/* A filter bar with the page's main action level with it, on the right. */
.list-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1rem;
	margin-bottom: 1rem;
}

.list-bar__filter {
	min-width: 0;
	max-width: 100%;
}

/* The buttons on the right, the main one last. */
.list-bar__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-left: auto;
}

.list-bar .filter {
	margin-bottom: 0;
}

/* A snippet around a button - no box of its own, the button sits as if alone. */
.snippet-slot {
	display: contents;
}

/* The action stays on the right, with a filter beside it or without. */
.list-bar > .btn-rt {
	margin-left: auto;
}

/* A select whose options are short names: a fixed width, not a share of
   the row - and not one that follows what is chosen, or the bar would
   jump with every pick. The panel may still grow wider than the field. */
.filter__field--narrow {
	flex: 0 0 12rem;
	width: 12rem;
}

@media (max-width: 767.98px) {
	.filter__field--narrow {
		flex: 1 1 12rem;
	}
}

.filter__dates {
	display: flex;
	align-items: center;
	gap: .375rem;
	flex: 0 1 auto;
}

/* Date inputs have a wide intrinsic size; hold them to what they need, but
   never below what "yyyy-mm-dd" takes to read. */
.filter__dates .ctl {
	flex: 0 1 8.5rem;
	min-width: 7.5rem;
}

.filter__sep {
	font-size: .75rem;
	color: var(--rt-text-faint);
}

/* No auto margin: pushing the buttons right makes them wrap onto a line of
   their own as soon as the row is tight. They just follow the last field. */
.filter__actions {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex: 0 0 auto;
}

/* --- input shell ----------------------------------------------------------
   One wrapper for every kind of control, so a select, a date and a text field
   all sit in the same shape and light up together on focus.
   --------------------------------------------------------------------------- */

.ctl {
	position: relative;
	display: flex;
	align-items: center;
	min-width: 0;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 10px;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

.ctl:hover {
	border-color: #2b3852;
}

.ctl:focus-within {
	border-color: rgba(59, 130, 246, .6);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
	background: #090d17;
}

.ctl__icon,
.ctl__arrow {
	position: absolute;
	color: var(--rt-text-faint);
	pointer-events: none;
	transition: color .15s;
}

.ctl__icon {
	left: .625rem;
	font-size: .8125rem;
}

.ctl__arrow {
	right: .5625rem;
	font-size: .625rem;
}

.ctl:focus-within .ctl__icon {
	color: var(--rt-accent);
}

.ctl__input {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	min-width: 0;
	padding: .5rem .625rem .5rem 2rem;
	background: transparent;
	border: 0;
	border-radius: inherit;
	color: var(--rt-text);
	font: inherit;
	font-size: .8125rem;
	line-height: 1.4;
}

.ctl__input:focus {
	outline: none;
}

.ctl__input::placeholder {
	color: var(--rt-text-faint);
}

/* no leading icon on this one - the pair shares the calendar icon */
.ctl__input--flush {
	padding-left: .625rem;
}

.ctl--select .ctl__input {
	padding-right: 1.75rem;
	cursor: pointer;
}

/* the dropdown itself is drawn by the OS, so give it readable colours */
.ctl--select .ctl__input option {
	background: var(--rt-surface);
	color: var(--rt-text);
}

/* --- select boxes (select.js) -----------------------------------------------
   The native select stays in the form, hidden; a button in the same classes
   shows the choice and a panel in the application's look lists the options.
   --------------------------------------------------------------------------- */

.rs {
	position: relative;
}

/* Before select.js takes over: a multiselect keeps the height of one line
   instead of opening up into a list box. */
select[multiple].ctl__input {
	height: calc(1.4em + 1rem);
	overflow: hidden;
}

.rs__native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	border: 0 !important;
	opacity: 0;
	pointer-events: none;
}

.rs__button {
	display: flex;
	align-items: center;
	gap: .375rem;
	text-align: left;
	cursor: pointer;
}

/* Room for the arrow - the filter bar's shell draws it, select.js adds one
   next to a form-select. */
.ctl .rs__button,
.rs .rs__button {
	padding-right: 2rem;
}

.rs__arrow {
	top: 50%;
	right: .75rem;
	margin-top: -.3125rem;
	line-height: 1;
}

.rs.rs-host--open .rs__button {
	border-color: rgba(59, 130, 246, .55);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.rs-host--open .rs__arrow,
.rs:focus-within .rs__arrow {
	color: var(--rt-accent);
}

.rs__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rs__button--placeholder .rs__text {
	color: var(--rt-text-dim);
}

.rs__badge {
	flex-shrink: 0;
	padding: .0625rem .375rem;
	border-radius: 999px;
	background: rgba(59, 130, 246, .18);
	color: #93c5fd;
	font-size: .6875rem;
	font-weight: 600;
	line-height: 1.4;
}

.rs-host--open .ctl__arrow {
	transform: rotate(180deg);
}

.ctl__arrow {
	transition: color .15s, transform .15s;
}

.rs-host--open.ctl {
	border-color: rgba(59, 130, 246, .6);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.rs__panel {
	position: absolute;
	top: calc(100% + .375rem);
	left: 0;
	z-index: 60;
	min-width: 100%;
	width: max-content;
	max-width: min(22rem, calc(100vw - 2rem));
	padding: .375rem;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
	cursor: default;
}

.rs__panel--up {
	top: auto;
	bottom: calc(100% + .375rem);
}

.rs__search {
	width: 100%;
	margin-bottom: .375rem;
	padding: .4375rem .625rem;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 8px;
	color: var(--rt-text);
	font: inherit;
	font-size: .8125rem;
}

.rs__search:focus {
	outline: none;
	border-color: rgba(59, 130, 246, .6);
}

.rs__list {
	max-height: 16rem;
	overflow-y: auto;
	outline: none;
	scrollbar-width: thin;
	scrollbar-color: var(--rt-border) transparent;
}

.rs__list::-webkit-scrollbar {
	width: 6px;
}

.rs__list::-webkit-scrollbar-thumb {
	background: var(--rt-border);
	border-radius: 999px;
}

.rs__option {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .4375rem .625rem;
	border-radius: 8px;
	font-size: .8125rem;
	color: var(--rt-text-dim);
	cursor: pointer;
	user-select: none;
}

.rs__option--active {
	background: rgba(255, 255, 255, .05);
	color: var(--rt-text);
}

.rs__option--selected {
	color: var(--rt-text);
}

.rs__option[aria-disabled="true"] {
	opacity: .45;
	cursor: not-allowed;
}

.rs__label {
	white-space: nowrap;
}

/* An option's picture (select.js avatarOf()): a distributor's logo, or its mark. */
.rs__avatar {
	width: 20px;
	height: 20px;
	flex: 0 0 20px;
	border-radius: 6px;
	object-fit: cover;
}

img.rs__avatar {
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border-soft);
}

.rs__avatar--icon {
	display: inline-grid;
	place-items: center;
	font-size: .625rem;
	color: #fff;
	background: var(--tint, var(--rt-accent));
}

/* Single select: a tick next to the chosen option, room kept for it on the others. */
.rs__mark {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	font-size: .875rem;
	color: var(--rt-accent);
	visibility: hidden;
}

.rs__option--selected .rs__mark {
	visibility: visible;
}

/* Bootstrap Icons sit their glyph on the text baseline (vertical-align:
   -.125em), which pushes the tick off the middle of the box. */
.rs__mark .bi,
.rs__mark .bi::before {
	display: block;
	line-height: 1;
	vertical-align: 0;
}

/* Multiselect: a checkbox in front of every option. */
.rs__panel--multi .rs__mark {
	visibility: visible;
	border: 1.5px solid var(--rt-border);
	border-radius: 4px;
	background: var(--rt-bg);
	font-size: .6875rem;
	color: transparent;
	transition: background .12s, border-color .12s;
}

.rs__panel--multi .rs__option--selected .rs__mark {
	background: var(--rt-accent);
	border-color: var(--rt-accent);
	color: #fff;
}

.rs__empty {
	padding: .5rem .625rem;
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.rs__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin-top: .375rem;
	padding: .375rem .25rem 0 .625rem;
	border-top: 1px solid var(--rt-border-soft);
	font-size: .75rem;
	color: var(--rt-text-faint);
}

.rs__clear {
	padding: .25rem .5rem;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: var(--rt-accent);
	font: inherit;
	cursor: pointer;
}

.rs__clear:hover:not(:disabled) {
	background: rgba(59, 130, 246, .12);
}

.rs__clear:disabled {
	color: var(--rt-text-faint);
	cursor: default;
}

/* Only shown before datepicker.js takes the field over; after that it is a
   text input with the calendar below. */
.ctl__input[type="date"]::-webkit-calendar-picker-indicator {
	filter: invert(70%);
	opacity: .65;
	cursor: pointer;
}

/* --- date picker ----------------------------------------------------------
   Replaces the operating system's calendar, which cannot be styled.
   --------------------------------------------------------------------------- */

.dp {
	position: absolute;
	top: calc(100% + .375rem);
	left: 0;
	z-index: 60;
	width: 16.5rem;
	padding: .625rem;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	border-radius: 12px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
	cursor: default;
}

.dp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .25rem;
	margin-bottom: .5rem;
}

/* A button: a click shows the months, another one the years. */
.dp__title {
	padding: .1875rem .5rem;
	border: 0;
	border-radius: 7px;
	background: transparent;
	font: inherit;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--rt-text);
	cursor: pointer;
	transition: background .15s;
}

.dp__title:hover {
	background: rgba(255, 255, 255, .06);
}

/* The months, or a dozen years: three a row, no weekday names. */
.dp--months .dp__week,
.dp--years .dp__week {
	display: none;
}

.dp--months .dp__grid,
.dp--years .dp__grid {
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
}

.dp__cell {
	padding: .625rem 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--rt-text);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background .12s, color .12s, border-color .12s;
}

.dp__cell:hover {
	background: rgba(255, 255, 255, .07);
}

.dp__cell--current {
	border-color: rgba(59, 130, 246, .45);
}

.dp__cell--selected,
.dp__cell--selected:hover {
	background: var(--rt-accent);
	border-color: var(--rt-accent);
	color: #fff;
	font-weight: 600;
}

.dp__nav {
	width: 26px;
	height: 26px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 7px;
	background: transparent;
	color: var(--rt-text-dim);
	font-size: .6875rem;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.dp__nav:hover {
	background: rgba(255, 255, 255, .06);
	color: var(--rt-text);
}

.dp__week,
.dp__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.dp__week {
	margin-bottom: 2px;
}

.dp__week span {
	text-align: center;
	font-size: .625rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
	padding-bottom: .25rem;
}

.dp__day {
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 7px;
	background: transparent;
	color: var(--rt-text);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background .12s, color .12s, border-color .12s;
}

.dp__day:hover {
	background: rgba(255, 255, 255, .07);
}

.dp__day--outside {
	color: var(--rt-text-faint);
}

.dp__day--today {
	border-color: rgba(59, 130, 246, .45);
}

.dp__day--selected,
.dp__day--selected:hover {
	background: var(--rt-accent);
	border-color: var(--rt-accent);
	color: #fff;
	font-weight: 600;
}

.dp__foot {
	display: flex;
	justify-content: space-between;
	gap: .5rem;
	margin-top: .5rem;
	padding-top: .5rem;
	border-top: 1px solid var(--rt-border-soft);
}

.dp__link {
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--rt-text-dim);
	font-size: .75rem;
	cursor: pointer;
}

.dp__link:hover {
	color: var(--rt-accent);
}

.dp__link--strong {
	color: var(--rt-accent);
	font-weight: 600;
}

/* --- the period picker (one field, a day or from - to) -------------------- */

/* Wide enough for the four presets on one line. */
.dp--range {
	width: 19.5rem;
}

/* The days between the ends: one band, the ends rounded on the outside only. */
.dp--range .dp__grid {
	gap: 2px 0;
}

.dp__day--in-range,
.dp__day--in-range:hover {
	background: rgba(59, 130, 246, .16);
	border-radius: 0;
	color: var(--rt-text);
}

.dp__day--range-start {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.dp__day--range-end {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.dp__hint {
	margin: .5rem 0 0;
	font-size: .6875rem;
	color: var(--rt-text-faint);
	text-align: center;
}

.dp__presets {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
	margin-top: .5rem;
	padding-top: .5rem;
	border-top: 1px solid var(--rt-border-soft);
}

.dp__chip {
	padding: .25rem .5rem;
	border: 1px solid var(--rt-border);
	border-radius: 999px;
	background: transparent;
	color: var(--rt-text-dim);
	font-size: .6875rem;
	cursor: pointer;
	transition: background .12s, color .12s, border-color .12s;
}

.dp__chip:hover {
	border-color: rgba(59, 130, 246, .5);
	color: var(--rt-text);
	background: rgba(59, 130, 246, .1);
}

/* Room for "01.10.2026 â€“ 31.10.2026" without the field changing size. */
.filter__period {
	flex: 0 0 14.5rem;
	width: 14.5rem;
}

@media (max-width: 767.98px) {
	.filter__period {
		flex: 1 1 14.5rem;
	}
}

/* --- pager ---------------------------------------------------------------- */

.pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .875rem 1.25rem;
	border-top: 1px solid var(--rt-border-soft);
}

.pager__state {
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.btn-rt.disabled {
	opacity: .4;
	pointer-events: none;
}

/* Count on the left, page buttons in the middle, page size on the right;
   stacked on a narrow screen. */
.pager--split {
	flex-wrap: wrap;
}

.pager__nav {
	display: flex;
	align-items: center;
	gap: .75rem;
}

/* A column header that sorts the list. The arrow is faint until the column
   is the one sorted by. */
.sort-link {
	display: inline-flex;
	align-items: center;
	gap: .3125rem;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.sort-link .bi {
	font-size: .75em;
	opacity: .35;
	transition: opacity .15s;
}

.sort-link:hover {
	color: var(--rt-text);
}

.sort-link:hover .bi {
	opacity: .8;
}

.sort-link--active {
	color: var(--rt-text);
}

.sort-link--active .bi {
	opacity: 1;
	color: var(--rt-accent);
}

/* Right-aligned even when it is alone (a single page has no nav). */
.per-page {
	display: flex;
	align-items: center;
	gap: .25rem;
	margin-left: auto;
}

.list-info {
	padding-top: .875rem;
	padding-bottom: .875rem;
	border-bottom: 1px solid var(--rt-border-soft);
}

.list-info strong {
	color: var(--rt-text);
	font-weight: 500;
}

.per-page__label {
	margin-right: .375rem;
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.per-page__option {
	min-width: 2.25rem;
	padding: .3125rem .5rem;
	border-radius: 8px;
	font-size: .8125rem;
	text-align: center;
	color: var(--rt-text-dim);
	text-decoration: none;
}

.per-page__option:hover {
	background: rgba(255, 255, 255, .05);
	color: var(--rt-text);
}

.per-page__option--active {
	background: rgba(59, 130, 246, .15);
	color: var(--rt-text);
	font-weight: 500;
}

@media (max-width: 575.98px) {
	.pager--split {
		justify-content: center;
	}
}

/* --- key/value chips in a table cell -------------------------------------- */

.facts {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
	max-width: 28rem;
}

.fact {
	display: inline-flex;
	align-items: baseline;
	gap: .3125rem;
	padding: .0625rem .375rem;
	border: 1px solid var(--rt-border);
	border-radius: .3125rem;
	background: rgba(255, 255, 255, .02);
	font-size: .75rem;
	line-height: 1.5;
	/* A chip stays in one piece; the row wraps between chips and the table
	   scrolls sideways if even that is not enough. */
	white-space: nowrap;
}

.fact__key {
	color: var(--rt-text-faint);
}

.fact__value {
	color: var(--rt-text);
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
}

/* --- dialogs -------------------------------------------------------------- */

.modal-content {
	background: linear-gradient(180deg, var(--rt-surface-2), var(--rt-surface));
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.modal-header {
	align-items: center;
	gap: .75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--rt-border-soft);
}

/* Bootstrap's header has no justify-content; it pushes its own .btn-close
   over with an auto margin. Ours is a plain link, so it needs the same. */
.modal-header .btn-rt--icon {
	margin-left: auto;
}

.modal-title {
	display: flex;
	align-items: center;
	gap: .625rem;
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -.01em;
}

.modal-body {
	padding: 1rem 1.25rem 1.25rem;
}

/* The dialog is only as wide as its contents need: one column when creating,
   two when editing. The edit view is recognised by its second column. */
#userDialog .modal-dialog {
	max-width: 27rem;
}

#userDialog .modal-dialog:has(.col-lg-5) {
	max-width: 44rem;
}

/* Tighter fields than the full-page forms: a dialog should not feel roomy. */
#userDialog .form-pair {
	margin-bottom: .75rem;
}

#userDialog .form-label {
	margin-bottom: .25rem;
	font-size: .75rem;
}

#userDialog .form-control,
#userDialog .form-select {
	padding: .5rem .75rem;
	font-size: .8125rem;
}

#userDialog .alert {
	padding: .5rem .75rem;
	font-size: .75rem;
	margin-bottom: .75rem;
}

.modal-backdrop.show {
	opacity: .65;
}

/* --- dashboard ------------------------------------------------------------ */

.range-menu {
	min-width: 11rem;
	padding: .375rem;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-sm);
	box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

.range-menu .dropdown-item {
	padding: .4375rem .625rem;
	border-radius: 8px;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.range-menu .dropdown-item:hover,
.range-menu .dropdown-item:focus {
	background: rgba(255, 255, 255, .05);
	color: var(--rt-text);
}

.range-menu .dropdown-item.active {
	background: rgba(59, 130, 246, .15);
	color: var(--rt-text);
}

.dash-link {
	color: inherit;
	text-decoration: none;
}

.dash-link:hover,
.row-link:hover .dash-link {
	color: var(--rt-accent);
}

/* A table row that leads somewhere as a whole (app.js follows data-href). */
.row-link {
	cursor: pointer;
}

.table-rt tbody tr.row-link:hover td {
	background: var(--rt-surface-2);
}

/* --- products ----------------------------------------------------------------
   The badge a product carries in every list (Accessory/@product.latte): its
   icon, or two letters on its colour.
   --------------------------------------------------------------------------- */

.product-avatar {
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1;
	object-fit: cover;
	user-select: none;
}

img.product-avatar {
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border-soft);
}

/* A distributor without an icon: the shop mark on its tint (@distributor.latte). */
.distributor-avatar {
	color: #fff;
	background: var(--tint, var(--rt-accent));
	font-size: .9375rem;
}

.product-avatar--lg.distributor-avatar {
	font-size: 1.75rem;
}

/* Small, before a name in running text or a table cell. */
.product-avatar--sm {
	width: 25px;
	height: 25px;
	border-radius: 7px;
	font-size: .625rem;
}

.product-avatar--sm.distributor-avatar {
	font-size: .75rem;
}

/* The dashboard's distributor picker: the Statements filter's select
   (select.js), on its own beside the period - no filter bar around it. */
.dash-distributors {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0;
}

/* Like the period button beside it (btn-rt--ghost): its background, its height. */
.dash-distributors .ctl {
	background: var(--rt-surface);
}

/* Being redrawn over AJAX (app.js, ajaxBusy): dimmed, after a moment, so a
   quick answer does not flicker. */
[data-ajax-busy] {
	transition: opacity .15s;
}
[data-ajax-busy][aria-busy="true"] {
	opacity: .55;
	pointer-events: none;
	transition-delay: .15s;
}

.dash-distributors .ctl__input {
	padding-top: .4375rem;
	padding-bottom: .4375rem;
}

.distributor-name {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	vertical-align: middle;
}

.product-avatar--lg {
	width: 64px;
	height: 64px;
	border-radius: 16px;
	font-size: 1.375rem;
}

.product-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-width: 0;
}

.product-head h1 {
	overflow-wrap: anywhere;
}

.product-facts {
	grid-template-columns: max-content 1fr;
}

.appearance__section + .appearance__section {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rt-border-soft);
}

.appearance__label {
	display: block;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--rt-text);
}

.appearance__hint {
	margin: .25rem 0 .75rem;
	font-size: .75rem;
	color: var(--rt-text-faint);
}

.appearance__icon-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.appearance__upload {
	cursor: pointer;
	max-width: 100%;
}

.appearance__upload span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* The hidden file input still takes the focus; show it on the label. */
.appearance__upload:focus-within {
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .3);
}

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

.swatch {
	aspect-ratio: 1;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
	transition: transform .12s, border-color .12s;
}

.swatch:hover {
	transform: scale(1.08);
}

.swatch--active {
	border-color: var(--rt-text);
}

.swatch--auto {
	display: grid;
	place-items: center;
	background: var(--rt-bg);
	border-color: var(--rt-border);
	color: var(--rt-text-dim);
	font-size: .75rem;
}

.swatch--auto.swatch--active {
	border-color: var(--rt-text);
	color: var(--rt-text);
}

.appearance__custom {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-top: .75rem;
}

/* The native colour input, drawn as one more swatch. */
.appearance__picker {
	position: relative;
	flex: 0 0 auto;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--rt-border);
	cursor: pointer;
	background: conic-gradient(#ef4444, #f59e0b, #84cc16, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
}

.appearance__picker input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.appearance__hex {
	flex: 1 1 auto;
	max-width: 9rem;
}

.appearance__hex .ctl__input {
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	text-transform: lowercase;
}

.appearance__errors {
	margin-bottom: 1rem;
	padding-left: 1.75rem;
	font-size: .8125rem;
}

/* --- distributor IDs (product detail) ------------------------------------- */

/* A distributor a row: its name, then its IDs as chips (like the aliases). */
.skus__row {
	display: grid;
	grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
	align-items: start;
	gap: .375rem 1rem;
}

.skus__row + .skus__row {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--rt-border-soft);
}

.skus__name {
	padding-top: .25rem;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--rt-text);
}

/* IDs are codes: monospaced, so similar ones are told apart. */
.skus .alias__name {
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-size: .75rem;
}

/* An ID is short: a narrow field, the Add button right beside it. */
.skus .aliases__add {
	margin-top: .5rem;
	max-width: 22rem;
}

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

/* --- the Revenue page: what each developer has earned ---------------------- */

.revenue-table td {
	white-space: nowrap;
}

.revenue-table__earned {
	font-weight: 600;
	color: var(--rt-text);
}

/* The developer's PDF report, at the end of their row. */
.revenue-table__report {
	width: 1%;
	white-space: nowrap;
	vertical-align: middle;
}

/* The detail's Overview: no rule over its first row - the card's head has one already. */
.revenue-facts > dt:first-of-type,
.revenue-facts > dd:first-of-type {
	border-top: 0;
	padding-top: 0;
}

/* What the developer earned, first in the detail's Overview - the figure people come for. */
.kv .revenue-overall {
	color: var(--rt-text);
	font-weight: 600;
}

.revenue-overall__amount {
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.3;
	color: #6ee7a8;
}

/* Transactions and the PDF report side by side. */
.revenue-table__report .btn-rt + .btn-rt {
	margin-left: .375rem;
}

/* A developer's transactions: product and distributor names wrap, so the
   table fits without scrolling sideways; the figures stay on one line. */
.revenue-table.transaction-table td.transaction-table__name {
	white-space: normal;
	min-width: 9rem;
}

.transaction-table th {
	white-space: normal;
}

/* An import's header over its rows, by period. */
.table-rt tbody tr.transaction-group > td {
	padding-top: .625rem;
	padding-bottom: .625rem;
	background: var(--rt-surface-2);
	white-space: normal;
}

.transaction-group__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .375rem 1rem;
}

.transaction-group__import {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	font-weight: 600;
	color: var(--rt-text);
}

.transaction-group__import .bi {
	color: var(--rt-text-faint);
}

/* When the import was uploaded, by its number. */
.transaction-group__date {
	display: block;
	font-size: .6875rem;
	font-weight: 400;
	color: var(--rt-text-dim);
}
.transaction-group__sum {
	display: inline-flex;
	align-items: baseline;
	gap: .625rem;
	margin-left: auto;
	color: var(--rt-text);
}

.transaction-group__sum .thing__sub {
	display: inline;
}

/* The rows under it, drawn in a little. */
.table-rt tbody tr.transaction-group__row > td:first-child {
	padding-left: 2rem;
}

/* What was credited in the report's own currency, and the rate - small,
   under the euros; the whole of it in the tooltip. */
.transaction-table__fx {
	display: block;
	font-size: .5625rem;
	color: var(--rt-text-faint);
	white-space: nowrap;
}

/* A product's row kept low: many of them under each import. */
.transaction-table tbody tr:not(.transaction-group) > td {
	padding-top: .375rem;
	padding-bottom: .375rem;
	line-height: 1.25;
}

/* The chart in its card, on the developer detail. */
.revenue-chart {
	min-width: 0;
}

/* "right axis" by the units' switch. */
.series-toggle__axis {
	font-size: .6875rem;
	font-weight: 400;
	color: var(--rt-text-faint);
}

/* Each product's rate in the tooltip. */
.revenue-table__rate {
	color: #6ee7a8;
	font-weight: 600;
	border-bottom: 1px dotted currentColor;
	cursor: help;
}

.revenue-table__none {
	color: var(--rt-text-faint);
}

.revenue-table tfoot td {
	border-top: 1px solid var(--rt-border);
	font-weight: 600;
	color: var(--rt-text);
}

/* --- the product detail's Overview: the facts, then its parts under them -- */

.overview-part {
	margin-top: 1.25rem;
	padding-top: 1.125rem;
	border-top: 1px solid var(--rt-border-soft);
}

.overview-part__title {
	margin: 0 0 .625rem;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
}

/* Under a title, what the part is about. */
.overview-part__title:has(+ .overview-part__sub) {
	margin-bottom: .125rem;
}

/* An icon before a part's title, in the title's own colour. */
.overview-part__icon {
	margin-right: .375rem;
	font-size: .8125rem;
}

.overview-part__sub {
	margin: 0 0 .75rem;
	font-size: .75rem;
	color: var(--rt-text-faint);
}

.aliases {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.aliases:empty {
	display: none;
}

.alias {
	display: inline-flex;
	align-items: center;
	gap: .25rem;
	max-width: 100%;
	padding: .3125rem .375rem .3125rem .75rem;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 999px;
	font-size: .8125rem;
	color: var(--rt-text);
}

/* Without a remove button (Read only) the right side gets its padding back. */
.alias:not(:has(.alias__remove)) {
	padding-right: .75rem;
}

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

.alias__remove {
	display: grid;
	place-items: center;
	width: 1.375rem;
	height: 1.375rem;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	color: var(--rt-text-faint);
	font-size: .75rem;
	cursor: pointer;
}

.alias__remove:hover {
	background: rgba(239, 68, 68, .15);
	color: #fca5a5;
}

.alias__remove:focus-visible {
	outline: 2px solid rgba(59, 130, 246, .5);
}

.aliases__empty {
	margin: 0;
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.aliases__add {
	display: flex;
	gap: .5rem;
	margin-top: .75rem;
	max-width: 32rem;
}

.aliases__input {
	flex: 1 1 auto;
}

.aliases__note {
	margin: .5rem 0 0;
	font-size: .75rem;
	color: #fcd34d;
}

/* --- what the developers have earned (product detail, Overview) ------------ */

.earned__empty {
	margin: 0;
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

.earned__table {
	font-size: .8125rem;
}

.earned__table td.is-num,
.earned__table th.is-num {
	white-space: nowrap;
}

.earned__table tfoot td {
	border-top: 1px solid var(--rt-border);
	font-weight: 600;
	color: var(--rt-text);
}

.earned__none {
	color: var(--rt-text-faint);
}

/* --- developer payout setup (product detail) ------------------------------- */

.payout__dev + .payout__dev {
	border-top: 1px solid var(--rt-border-soft);
}

.payout__head {
	display: flex;
	align-items: center;
	gap: .75rem 1rem;
	flex-wrap: wrap;
	padding: .875rem 1.25rem;
}

.payout__head > .thing {
	min-width: 12rem;
	flex: 1 1 12rem;
}

.payout__summary {
	display: flex;
	flex-wrap: wrap;
	gap: .375rem;
}

.payout__head-actions {
	display: flex;
	gap: .5rem;
	margin-left: auto;
}

.payout__head-actions [data-payout-toggle] .bi {
	transition: transform .15s;
}

.payout__head-actions [aria-expanded="true"] .bi {
	transform: rotate(180deg);
}

.payout__body {
	display: grid;
	gap: 1.25rem;
	padding: .25rem 1.25rem 1.25rem;
}

.payout__body[hidden] {
	display: none;
}

/* Two choices side by side - the radios are the options. */
.seg {
	display: inline-flex;
	padding: 3px;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 10px;
}

.seg__opt {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: .3125rem .75rem;
	border-radius: 7px;
	font-size: .75rem;
	font-weight: 600;
	color: var(--rt-text-faint);
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s, color .15s;
	user-select: none;
}

.seg__opt:hover {
	color: var(--rt-text);
}

.seg__input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}

.seg__opt:has(.seg__input:focus-visible) {
	box-shadow: 0 0 0 2px rgba(59, 130, 246, .5);
}

.seg__opt:has(.seg__input:checked) {
	background: color-mix(in srgb, var(--rt-accent) 20%, transparent);
	color: #93c5fd;
}

.seg__opt:has(.seg__input:disabled) {
	cursor: default;
}

.payout__scope {
	justify-self: start;
	max-width: 100%;
	overflow-x: auto;
}

.payout__each {
	display: grid;
	gap: 1rem;
}

.payout__each[hidden],
[data-payout-common][hidden],
[data-payout-panel][hidden] {
	display: none;
}

/* One tab per distributor, with what its rules come to. */
.dist-tabs {
	display: flex;
	gap: .375rem;
	overflow-x: auto;
	padding-bottom: .125rem;
	border-bottom: 1px solid var(--rt-border-soft);
}

.dist-tab {
	display: grid;
	gap: .0625rem;
	flex: 0 0 auto;
	padding: .5rem .875rem;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	color: var(--rt-text-dim);
	text-align: left;
	cursor: pointer;
	transition: color .15s, border-color .15s;
}

.dist-tab:hover {
	color: var(--rt-text);
}

.dist-tab:focus-visible {
	outline: 2px solid rgba(59, 130, 246, .5);
	outline-offset: -2px;
	border-radius: 6px;
}

.dist-tab.is-active {
	color: var(--rt-text);
	border-bottom-color: var(--rt-accent);
}

.dist-tab__name {
	font-size: .8125rem;
	font-weight: 600;
}

.dist-tab__state {
	font-size: .6875rem;
	color: var(--rt-text-faint);
	font-variant-numeric: tabular-nums;
}

.payout-editor,
.payout-editor__rules {
	display: grid;
	gap: 1.25rem;
}

.payout-editor__rules[hidden],
.payout-editor__empty[hidden] {
	display: none;
}

.payout-editor__empty {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .75rem;
	padding: 1rem;
	border: 1px dashed var(--rt-border);
	border-radius: var(--rt-radius-sm);
	font-size: .8125rem;
	color: var(--rt-text-faint);
}

/* The tiers: one row each, the range worked out from the next one's start. */
.tiers {
	max-width: 40rem;
}

.tiers__head,
.tier {
	display: grid;
	grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 10rem) minmax(6rem, 8rem) 2.25rem;
	align-items: center;
	gap: .625rem;
}

.tiers__head {
	padding: 0 0 .375rem;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rt-text-faint);
}

.tier + .tier {
	margin-top: .5rem;
}

.tier__range {
	display: flex;
	align-items: center;
	gap: .5rem;
	font-size: .8125rem;
	color: var(--rt-text);
	font-variant-numeric: tabular-nums;
}

.tier__dot {
	width: 8px;
	height: 8px;
	flex: 0 0 8px;
	border-radius: 50%;
	background: var(--tint);
}

.tier__suffix {
	position: absolute;
	right: .625rem;
	font-size: .75rem;
	color: var(--rt-text-faint);
	pointer-events: none;
}

.tier .ctl__input {
	padding-right: 2.25rem;
	font-variant-numeric: tabular-nums;
}

.tier .ctl.is-invalid {
	border-color: rgba(239, 68, 68, .6);
}

.tier__error {
	grid-column: 1 / -1;
	font-size: .75rem;
	color: #fca5a5;
}

.tiers__foot {
	display: flex;
	gap: .5rem;
	margin-top: .75rem;
}

/* The steps: one column per tier, as high as its rate. */
.payout__preview {
	display: grid;
	gap: .875rem;
	padding: 1rem;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border-soft);
	border-radius: var(--rt-radius-sm);
}

.steps {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 7rem;
}

.step {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: .375rem .5rem;
	border-radius: 6px 6px 2px 2px;
	background: color-mix(in srgb, var(--tint) 22%, transparent);
	border-top: 2px solid var(--tint);
	transition: height .2s, background .15s;
}

.step.is-hit {
	background: color-mix(in srgb, var(--tint) 42%, transparent);
}

.step__rate {
	font-size: .8125rem;
	font-weight: 600;
	color: var(--rt-text);
	font-variant-numeric: tabular-nums;
}

.step__range {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: .6875rem;
	color: var(--rt-text-dim);
	font-variant-numeric: tabular-nums;
}

.payout__try {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .5rem .625rem;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.payout__try-input {
	width: 8.5rem;
}

.payout__try-arrow {
	color: var(--rt-text-faint);
}

.payout__try-result {
	color: var(--rt-text);
	font-variant-numeric: tabular-nums;
}

.payout__try-result strong {
	font-weight: 600;
	color: #6ee7a8;
}

@media (max-width: 575.98px) {
	.tiers__head {
		display: none;
	}

	.tier {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2.25rem;
	}

	.tier__range {
		grid-column: 1 / -1;
	}
}

/* --- on/off switch (a link that flips a setting) --------------------------- */

/* Or a label round a checkbox (.switch__input) - on while it is ticked. */
.switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	color: var(--rt-text-dim);
	font-size: .8125rem;
	text-decoration: none;
	cursor: pointer;
}

.switch__track {
	position: relative;
	flex-shrink: 0;
	width: 2.25rem;
	height: 1.25rem;
	border-radius: 999px;
	background: var(--rt-border);
	transition: background .15s;
}

.switch__knob {
	position: absolute;
	top: .125rem;
	left: .125rem;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	transition: transform .15s;
}

.switch__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.switch:has(.switch__input:checked) .switch__track,
.switch--on .switch__track {
	background: var(--rt-green);
}

.switch:has(.switch__input:checked) .switch__knob,
.switch--on .switch__knob {
	transform: translateX(1rem);
}

.switch:has(.switch__input:checked) .switch__label,
.switch--on .switch__label {
	color: var(--rt-text);
}

.switch:hover .switch__track {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .06);
}

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

.switch:has(.switch__input:focus-visible) .switch__track,
.switch:focus-visible .switch__track {
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .35);
}

/* A distributor switched off: its row recedes. */
.distributor--off td:not(:nth-child(2)) {
	opacity: .55;
}

/* --- import statement dialog ------------------------------------------------ */

#statementImportDialog .modal-dialog {
	max-width: 30rem;
}

/* The file input is stretched invisibly over the whole zone: a click opens
   the picker and a drop lands in it, both without any script. */
.dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .375rem;
	padding: 1.75rem 1rem;
	border: 1.5px dashed var(--rt-border);
	border-radius: var(--rt-radius-sm);
	background: rgba(255, 255, 255, .02);
	text-align: center;
	transition: border-color .15s, background-color .15s;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone--over {
	border-color: var(--rt-accent);
	background: rgba(59, 130, 246, .07);
}

.dropzone__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.dropzone__icon {
	font-size: 1.75rem;
	line-height: 1;
	color: var(--rt-accent);
}

.dropzone__title {
	font-size: .875rem;
	font-weight: 500;
	color: var(--rt-text);
}

.dropzone__browse {
	color: var(--rt-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.dropzone__hint {
	font-size: .75rem;
	color: var(--rt-text-faint);
}

/* Errors from netteForms.js land under the input, inside the zone. */
.dropzone .form-text {
	position: relative;
	font-size: .75rem;
}

.dropzone__files {
	margin: .75rem 0 0;
	padding: 0;
	list-style: none;
	max-height: 10rem;
	overflow-y: auto;
}

.dropzone__files li {
	display: flex;
	gap: .75rem;
	justify-content: space-between;
	padding: .375rem .625rem;
	border-radius: 8px;
	font-size: .8125rem;
}

.dropzone__files li:nth-child(odd) {
	background: rgba(255, 255, 255, .03);
}

.dropzone__file-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--rt-text);
}

.dropzone__file-size {
	flex-shrink: 0;
	color: var(--rt-text-faint);
	font-variant-numeric: tabular-nums;
}

.upload-progress {
	margin-top: .875rem;
}

.upload-progress__head {
	display: flex;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: .5rem;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.upload-progress__value {
	color: var(--rt-text);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.upload-progress .bar {
	height: 8px;
}

.upload-progress__fill {
	background: linear-gradient(90deg, var(--rt-accent), var(--rt-purple));
	transition: width .2s ease-out;
}

.dropzone__note {
	margin: .875rem 0 0;
	font-size: .75rem;
	color: var(--rt-text-dim);
}

.dialog__subtitle {
	margin: 0 0 .75rem;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .02em;
	color: var(--rt-text-dim);
}

/* --- account page --------------------------------------------------------- */

.account__identity {
	display: flex;
	align-items: center;
	gap: .875rem;
}

.account__avatar {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	font-size: 1.0625rem;
}

.account__name {
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -.01em;
}

.account__mail {
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.kv {
	display: grid;
	grid-template-columns: minmax(8rem, auto) 1fr;
	gap: 0;
	margin: 0;
	font-size: .8125rem;
}

.kv dt,
.kv dd {
	padding: .625rem 0;
	margin: 0;
	border-top: 1px solid var(--rt-border-soft);
}

.kv dt {
	color: var(--rt-text-faint);
	font-weight: 400;
}

.kv dd {
	color: var(--rt-text);
	text-align: right;
}

/* An icon before a row's name - what the row holds, at a glance. */
.kv__icon {
	margin-right: .5rem;
	color: var(--rt-text-dim);
}

/* --- progress ------------------------------------------------------------- */

.bar {
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .06);
	overflow: hidden;
}

.bar__fill {
	height: 100%;
	border-radius: 999px;
}

/* --- sign in -------------------------------------------------------------- */

.auth {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 1.5rem;
}

.auth__box {
	width: 100%;
	max-width: 25rem;
}

.auth__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .625rem;
	margin-bottom: 1.5rem;
	font-size: 1.25rem;
	font-weight: 600;
}

.auth__card {
	background: linear-gradient(180deg, var(--rt-surface-2), var(--rt-surface));
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
	padding: 1.75rem;
}

/* The sign-in code, a box per digit (app.js); the real field hidden under them. */
.otp {
	display: flex;
	justify-content: space-between;
	gap: .5rem;
}

.otp__box {
	width: 100%;
	min-width: 0;
	max-width: 3.25rem;
	aspect-ratio: 4 / 5;
	padding: 0;
	text-align: center;
	font-size: 1.5rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--rt-text);
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 12px;
	caret-color: var(--rt-accent);
	transition: border-color .15s, box-shadow .15s;
}

.otp__box:focus {
	outline: none;
	border-color: rgba(59, 130, 246, .55);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

/* Every digit in - on its way. */
.otp--full .otp__box {
	border-color: rgba(59, 130, 246, .4);
}

.otp--sending .otp__box {
	opacity: .6;
}

.has-danger .otp__box {
	border-color: rgba(239, 68, 68, .55);
}

/* The field the form sends - out of sight, still in the form. */
.otp__source {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	border: 0 !important;
	opacity: 0;
	pointer-events: none;
}

/* --- forms ---------------------------------------------------------------- */

.form-label {
	font-size: .8125rem;
	font-weight: 500;
	color: var(--rt-text-dim);
	margin-bottom: .375rem;
}

.form-control,
.form-select {
	background: var(--rt-bg);
	border-color: var(--rt-border);
	color: var(--rt-text);
	padding: .5rem .75rem;
	font-size: .875rem;
}

.form-control:focus,
.form-select:focus {
	background: var(--rt-bg);
	border-color: rgba(59, 130, 246, .55);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
	color: var(--rt-text);
}

.form-control::placeholder {
	color: var(--rt-text-faint);
}

/* Chrome paints autofilled fields pale blue, which fights the dark theme.
   The inset shadow is the only way to override that background. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--rt-text);
	-webkit-box-shadow: 0 0 0 100px var(--rt-bg) inset;
	caret-color: var(--rt-text);
	/* keeps the override from being animated away */
	transition: background-color 9999s ease-in-out 0s;
}

/* --- alerts and validation ------------------------------------------------
   Flash messages and form errors share one look. Styling is CSS-only so that
   Nette's form renderer output matches without touching its markup.
   --------------------------------------------------------------------------- */

.alert {
	--alert-tint: var(--rt-accent);

	position: relative;
	padding: .6875rem .875rem .6875rem 1.0625rem;
	margin-bottom: 1rem;
	border: 1px solid color-mix(in srgb, var(--alert-tint) 32%, transparent);
	border-radius: var(--rt-radius-sm);
	background: color-mix(in srgb, var(--alert-tint) 11%, var(--rt-surface));
	color: var(--rt-text);
	font-size: .8125rem;
	line-height: 1.45;
	overflow: hidden;
	animation: alert-in .2s ease-out;
}

/* the accent bar down the leading edge */
.alert::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--alert-tint);
}

.alert p:last-child,
.alert ul:last-child {
	margin-bottom: 0;
}

.alert-success { --alert-tint: var(--rt-green); }
.alert-info { --alert-tint: var(--rt-accent); }
.alert-warning { --alert-tint: var(--rt-amber); }
.alert-danger { --alert-tint: var(--rt-red); }

@keyframes alert-in {
	from {
		opacity: 0;
		transform: translateY(-.25rem);
	}
}

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

/* per-field messages */
.form-text {
	display: block;
	margin-top: .3125rem;
	font-size: .75rem;
	color: var(--rt-text-faint);
}

.form-text.text-danger {
	color: #fca5a5 !important;
}

.has-danger .form-control,
.has-danger .form-select {
	border-color: rgba(239, 68, 68, .55);
}

.has-danger .form-control:focus,
.has-danger .form-select:focus {
	border-color: rgba(239, 68, 68, .75);
	box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.has-danger .form-label {
	color: #fca5a5;
}

/* --- responsive ----------------------------------------------------------- */

/* --- narrow screens --------------------------------------------------------
   The sidebar becomes a drawer over the page instead of a strip above it: a
   navigation column does not fold into a usable horizontal bar.
   --------------------------------------------------------------------------- */

.app__toggle {
	display: none;
	flex: 0 0 auto;
}

.app__backdrop {
	display: none;
}

@media (max-width: 991.98px) {
	.app__toggle {
		display: inline-flex;
	}

	.app__sidebar {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 1045;
		width: 17rem;
		max-width: 85vw;
		flex-basis: auto;
		height: 100%;
		border-right: 1px solid var(--rt-border);
		box-shadow: 0 0 40px rgba(0, 0, 0, .6);
		transform: translateX(-100%);
		transition: transform .22s ease;
	}

	body.nav-open .app__sidebar {
		transform: none;
	}

	.app__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1040;
		background: rgba(0, 0, 0, .6);
		opacity: 0;
		transition: opacity .2s ease;
	}

	body.nav-open {
		overflow: hidden;
	}

	body.nav-open .app__backdrop {
		opacity: 1;
	}

	.app__main {
		width: 100%;
	}

	.app__content,
	.app__topbar {
		padding-inline: 1rem;
	}

	.app__content {
		padding-block: 1.25rem;
	}
}

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


/* --- import list: rows that open a detail row under them ------------------ */

/* The tick for the bulk delete, before the toggle. */
.import-table__select {
	width: 2.75rem;
	padding-right: 0 !important;
	vertical-align: middle;
}

/* Big enough to hit without aiming. */
.import-table__select .form-check-input {
	width: 1.375rem;
	height: 1.375rem;
	margin: 0;
	border-width: 2px;
	border-radius: .375rem;
	cursor: pointer;
}

/* What is ticked in a list, and what can be done with it. */
.bulk-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .5rem 1rem;
	margin-bottom: .75rem;
	padding: .625rem .875rem;
	background: var(--rt-surface-2);
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius);
}

.bulk-bar[hidden] {
	display: none;
}

.bulk-bar__count {
	margin-right: auto;
	font-size: .875rem;
	color: var(--rt-text-dim);
}

.bulk-bar__count strong {
	color: var(--rt-text);
}

.import-table__toggle {
	width: 2rem;
	padding-right: 0 !important;
	color: var(--rt-text-faint);
}

.import-table__toggle .bi {
	display: inline-block;
	transition: transform .15s;
}

.import-row {
	cursor: pointer;
}

.import-row[aria-expanded="true"] .import-table__toggle .bi {
	transform: rotate(90deg);
}

/* With the pointer over it too - the list's hover must not wash it out. */
.table-rt tbody tr.import-row[aria-expanded="true"] > td {
	background: color-mix(in srgb, var(--rt-accent) 9%, var(--rt-surface-2));
}

/* The open import and its detail are one block: a blue bar down their left
   edge, the file name and the toggle in blue. */
.import-row[aria-expanded="true"] > td:first-child,
.table-rt tbody tr.import-detail > td {
	box-shadow: inset 3px 0 0 var(--rt-accent);
}

.import-row[aria-expanded="true"] .import-table__toggle,
.import-row[aria-expanded="true"] .is-primary {
	color: #93c5fd;
}

/* A line under the detail closes the block off from the next import. */
.import-table > tbody > tr.import-detail:not(:last-child) > td,
.import-table > tbody > tr.import-detail:not(:last-child):hover > td {
	border-bottom: 1px solid color-mix(in srgb, var(--rt-accent) 35%, var(--rt-border-soft));
}

/* Every import is two rows, and the last <tr> is the (usually hidden) detail
   row - so the table's usual "no line under the last row" misses. The last
   import row drops it while its detail is closed. */
.import-table > tbody > tr.import-row:nth-last-child(2) td {
	border-bottom: 0;
}

/* The detail belongs to the row above it, so the line between them goes. */
.import-row[aria-expanded="true"] td,
.table-rt tbody tr.import-detail:hover td {
	border-bottom-color: transparent;
}

.table-rt tbody tr.import-detail > td {
	padding: 0 1rem 1rem 3rem;
	background: var(--rt-surface-2);
}

/* While the detail is fetched (app.js), or when it could not be. */
.import-detail__loading {
	margin: 0;
	padding: .25rem 0;
	color: var(--rt-text-faint);
	font-size: .875rem;
}

/* Show raw rows over the products (app.js) - a small .switch as a tab on
   the table: the head row's shade and lettering, square at the bottom and
   right on top of the head row. Blue while on. */
.import-detail__switch {
	align-self: flex-start;
	/* The body's gap taken back - the tab sits on the table. */
	margin-bottom: -1rem;
	gap: .5rem;
	padding: .4375rem .75rem .4375rem 1.25rem;
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	background: rgba(255, 255, 255, .015);
	border-radius: 8px 8px 0 0;
	user-select: none;
	transition: background .15s;
}

.import-detail__switch:hover {
	background: rgba(255, 255, 255, .04);
}

.import-detail__switch-icon {
	font-size: .8125rem;
	color: var(--rt-text-faint);
	transition: color .15s;
}

.import-detail__switch .switch__label {
	color: var(--rt-text-faint);
	transition: color .15s;
}

.import-detail__switch:hover .switch__label {
	color: var(--rt-text-dim);
}

.import-detail__switch .switch__track {
	width: 1.75rem;
	height: 1rem;
}

.import-detail__switch .switch__knob {
	width: .75rem;
	height: .75rem;
}

.import-detail__switch:has(.switch__input:checked) .import-detail__switch-icon {
	color: var(--rt-accent);
}

.import-detail__switch:has(.switch__input:checked) .switch__label {
	color: var(--rt-text);
}

.import-detail__switch:has(.switch__input:checked) .switch__knob {
	transform: translateX(.75rem);
}

.import-detail__switch:has(.switch__input:checked) .switch__track {
	background: var(--rt-accent);
}

/* A country code with its flag (assets/img/flags). */
.country {
	display: inline-flex;
	align-items: center;
	gap: .4375rem;
	white-space: nowrap;
}

.country__flag {
	width: 1rem;
	height: .75rem;
	border-radius: 2px;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}

.import-detail__body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* The two lists of facts: side by side from xl up, one under the other
   below (where they read as one list). */
.import-detail__facts {
	display: grid;
	max-width: 46rem;
}

@media (min-width: 1200px) {
	.import-detail__facts {
		grid-template-columns: 1fr 1fr;
		align-items: start;
		column-gap: 2.5rem;
		max-width: none;
	}
}

/* The uploaded file and its ZIP, downloadable. */
.import-file {
	color: var(--rt-accent);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.import-file:hover {
	text-decoration: underline;
}

.import-file i {
	margin-right: .25rem;
}

.import-detail__summary {
	font-size: .8125rem;
}

/* Denser than a list: a product a short line, the head row too. */
.import-detail__summary td {
	padding-top: .4375rem;
	padding-bottom: .4375rem;
}

.import-detail__summary th {
	padding-top: .5rem;
	padding-bottom: .5rem;
}

/* Every other product a shade lighter, to follow a row across the figures. */
.import-detail__summary tbody tr:nth-child(even) td {
	background: rgba(255, 255, 255, .035);
}

/* The list's hover (tr:hover td) reaches every cell under the row - here
   the whole products table, whenever the pointer is anywhere in the
   detail. So these cells take only their own: the stripe, and a light
   one on the product under the pointer. */
.table-rt tbody tr.import-detail .import-detail__summary td {
	background: transparent;
}

.table-rt tbody tr.import-detail .import-detail__summary tbody tr:nth-child(even) > td {
	background: rgba(255, 255, 255, .035);
}

.table-rt tbody tr.import-detail .import-detail__summary tbody tr:hover > td {
	background: rgba(255, 255, 255, .06);
}

/* A product name stays on one line - the table scrolls sideways instead. */
.import-detail__summary td:first-child {
	white-space: nowrap;
}

/* The totals under the products. */
.import-detail__summary tfoot td {
	border-top: 1px solid var(--rt-border);
	font-weight: 600;
	color: var(--rt-text);
}

/* Withholding tax under the totals, and what is payable after it. */
.import-detail__summary tfoot .import-detail__withholding td {
	font-weight: 500;
	color: var(--rt-amber);
}

.import-detail__summary tfoot .import-detail__payable td {
	border-top: 0;
}

/* The "New product" dialog (Products/default.latte). */
.new-product__label {
	display: block;
	margin-bottom: .375rem;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--rt-text);
}

/* The exchange rates (Rates/default.latte). */
.rate__code {
	font-size: .6875rem;
	letter-spacing: .02em;
}

.rate__value {
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-variant-numeric: tabular-nums;
}

/* --- roles and their permissions (Roles/default.latte, permissions.latte) - */

.perm__mark,
.page-mark {
	width: 3rem;
	height: 3rem;
	/* .thing__mark's flex basis of 30px would keep it that narrow */
	flex-basis: 3rem;
	font-size: 1.25rem;
}

.perm-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
	margin-bottom: 1rem;
}

.perm-legend {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

.perm-legend strong {
	color: var(--rt-text);
	font-weight: 600;
}

.perm-dot {
	display: inline-block;
	width: .5rem;
	height: .5rem;
	margin-right: .25rem;
	border-radius: 50%;
	vertical-align: middle;
}

.perm-dot--none { background: var(--rt-text-faint); }
.perm-dot--read { background: var(--rt-cyan); }
.perm-dot--write { background: var(--rt-green); }

.perm-toolbar__actions {
	display: flex;
	align-items: center;
	gap: .625rem;
}

.perm-toolbar__label {
	font-size: .8125rem;
	color: var(--rt-text-dim);
}

/* Small buttons that set a whole page, or every page, at once. */
.perm-all {
	display: inline-flex;
	border: 1px solid var(--rt-border);
	border-radius: 8px;
	overflow: hidden;
}

.perm-all__btn {
	padding: .3125rem .75rem;
	background: var(--rt-surface);
	border: 0;
	color: var(--rt-text-dim);
	font-size: .75rem;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.perm-all__btn + .perm-all__btn {
	border-left: 1px solid var(--rt-border);
}

.perm-all__btn:hover {
	color: var(--rt-text);
	background: var(--rt-surface-2);
}

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

.perm-page__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}

.perm-page__title {
	display: flex;
	align-items: center;
	gap: .75rem;
}

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

.perm-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5rem 1rem;
	padding: .75rem 1.25rem;
}

.perm-row + .perm-row {
	border-top: 1px solid var(--rt-border-soft);
}

.perm-row__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 14rem;
}

.perm-row__label {
	font-size: .875rem;
	font-weight: 500;
	color: var(--rt-text);
}

.perm-row__desc {
	font-size: .75rem;
	color: var(--rt-text-faint);
}

/* None / Read / Write: one segmented control per function. */
.perm-seg {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 3px;
	background: var(--rt-bg);
	border: 1px solid var(--rt-border);
	border-radius: 10px;
}

.perm-seg__opt {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4.25rem;
	padding: .3125rem .625rem;
	border-radius: 7px;
	font-size: .75rem;
	font-weight: 600;
	color: var(--rt-text-faint);
	cursor: pointer;
	transition: background .15s, color .15s;
	user-select: none;
}

.perm-seg__opt:hover {
	color: var(--rt-text);
}

.perm-seg__input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	margin: 0;
}

.perm-seg__opt:has(.perm-seg__input:focus-visible) {
	box-shadow: 0 0 0 2px rgba(59, 130, 246, .5);
}

.perm-seg__opt--none:has(.perm-seg__input:checked) {
	background: var(--rt-surface-2);
	color: var(--rt-text);
}

.perm-seg__opt--read:has(.perm-seg__input:checked) {
	background: color-mix(in srgb, var(--rt-cyan) 20%, transparent);
	color: var(--rt-cyan);
}

.perm-seg__opt--write:has(.perm-seg__input:checked) {
	background: color-mix(in srgb, var(--rt-green) 20%, transparent);
	color: var(--rt-green);
}

/* --- an account's own permissions (Users/permissions.latte) ---------------- */

.perm-dot--role { background: var(--rt-purple); }

/* "Role": no override - shown in the role's colour, not in a level's. */
.perm-seg__opt--inherit:has(.perm-seg__input:checked) {
	background: color-mix(in srgb, var(--rt-purple) 18%, transparent);
	color: var(--rt-purple);
}

.perm-all__btn--inherit {
	color: var(--rt-purple);
}

/* Role keeps the width of one choice in an action's control too, so the two
   wide ones beside it add up to the four of the others. */
.perm-seg--action .perm-seg__opt.perm-seg__opt--inherit {
	min-width: 4.25rem;
}

/* What the role has, marked on its level in every control: a dot in the
   corner. While Role is chosen that level is what applies, so it is tinted
   too - the account gets exactly that. */
.perm-seg__opt--role-level::after,
.perm-role-mark {
	content: '';
	width: .375rem;
	height: .375rem;
	border-radius: 50%;
	background: var(--rt-purple);
}

.perm-seg__opt--role-level::after {
	position: absolute;
	top: 4px;
	right: 5px;
}

.perm-role-mark {
	display: inline-block;
	vertical-align: middle;
}

.perm-seg:has(.perm-seg__opt--inherit .perm-seg__input:checked) .perm-seg__opt--role-level {
	background: color-mix(in srgb, var(--rt-purple) 10%, transparent);
	color: var(--rt-text);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rt-purple) 45%, transparent);
}

/* A function the account has differently from its role. */
.perm-row--override {
	background: color-mix(in srgb, var(--rt-amber) 7%, transparent);
	box-shadow: inset 3px 0 0 var(--rt-amber);
}

.perm-badge {
	display: inline-block;
	margin-left: .375rem;
	padding: .0625rem .4375rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--rt-amber) 18%, transparent);
	color: var(--rt-amber);
	font-size: .6875rem;
	font-weight: 600;
	vertical-align: middle;
}

.perm-total--override {
	color: var(--rt-amber);
	font-weight: 600;
}

/* None / Allowed: two options as wide as the three of None / Read / Write, so the
   controls line up down the page. */
.perm-seg--action .perm-seg__opt {
	min-width: calc((4.25rem * 3) / 2);
}

.perm-seg__opt--na {
	opacity: .3;
	cursor: not-allowed;
}

.perm-seg__opt--na:hover {
	color: var(--rt-text-faint);
}

.perm-seg__opt:has(.perm-seg__input:disabled) {
	cursor: not-allowed;
}

/* Several buttons side by side in the page head (.page-head--end) - Cancel
   or Delete next to Save. */
.head-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: .5rem;
}

/* A quiet button that turns red when hovered: it destroys something. */
.btn-rt--danger-hover:hover {
	color: var(--rt-red);
	border-color: rgba(239, 68, 68, .4);
}

/* Edit and remove at the end of a user row (Users/default.latte). */
.user-actions {
	display: inline-flex;
	align-items: center;
	gap: .375rem;
}

.user-actions .btn-rt--icon:hover {
	color: var(--rt-red);
	border-color: rgba(239, 68, 68, .4);
}

/* What an import logged, one line each (Imports/default.latte). */
.import-messages {
	max-width: 52rem;
	border: 1px solid var(--rt-border);
	border-radius: var(--rt-radius-sm);
	background: var(--rt-bg);
	overflow: hidden;
}

.import-messages__head {
	padding: .5rem .875rem;
	border-bottom: 1px solid var(--rt-border-soft);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rt-text-dim);
}

.import-messages__list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 18rem;
	overflow-y: auto;
}

.import-messages__item {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	padding: .4375rem .875rem;
	font-size: .8125rem;
	color: var(--rt-text);
	overflow-wrap: anywhere;
}

.import-messages__item + .import-messages__item {
	border-top: 1px solid var(--rt-border-soft);
}

.import-messages__item > .bi {
	flex: 0 0 auto;
	color: var(--rt-accent);
}

.import-messages__item--error > .bi {
	color: var(--rt-red);
}

.import-messages__item--warning > .bi {
	color: var(--rt-amber);
}

/* Opened from a notification: a short flash so the eye finds the row. */
.import-row--target td {
	animation: import-target 1.6s ease-out;
}

@keyframes import-target {
	from { background: rgba(77, 140, 255, .28); }
}

/* On a phone: a fact's name over its value, so neither is squeezed. */
@media (max-width: 575.98px) {
	.import-detail__facts .kv {
		grid-template-columns: 1fr;
	}

	.import-detail__facts .kv dt {
		padding-bottom: 0;
	}

	.import-detail__facts .kv dd {
		padding-top: .25rem;
		border-top: 0;
		text-align: left;
	}

	.import-detail__facts .kv + .kv {
		margin-top: 0;
	}
}


/* A notification that leads somewhere (an import). */
a.notif__item--link {
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

a.notif__item--link:hover {
	background: var(--rt-surface-2);
}


/* --- the application dialog (Accessory/@dialog.latte, RoyalT.confirm) ----- */

.rt-dialog .modal-dialog {
	max-width: 26rem;
}

.rt-dialog__body {
	display: flex;
	gap: 1rem;
	padding: 1.5rem 1.5rem 1.25rem;
}

/* A tinted disc behind the icon, coloured by the tint-* class app.js sets. */
.rt-dialog__icon {
	flex: 0 0 2.75rem;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 1.25rem;
	color: var(--tint, var(--rt-accent));
	background: color-mix(in srgb, var(--tint, var(--rt-accent)) 16%, transparent);
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--tint, var(--rt-accent)) 7%, transparent);
}

.rt-dialog__text {
	min-width: 0;
	padding-top: .125rem;
}

.rt-dialog__title {
	margin: 0 0 .375rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--rt-text);
}

.rt-dialog__message {
	margin: 0;
	font-size: .875rem;
	line-height: 1.5;
	color: var(--rt-text-dim);
	/* messages may carry a file name, which must not stretch the dialog */
	overflow-wrap: anywhere;
	white-space: pre-line;
}

.rt-dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: .5rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--rt-border-soft);
}

/* The developer payout setup in short (Products/default.latte). */
.payout-summary {
	font-size: .8125rem;
	min-width: 11rem;
}

.payout-summary__item + .payout-summary__item {
	margin-top: .375rem;
}

.payout-summary__who {
	display: block;
	color: var(--rt-text);
	white-space: nowrap;
}

.payout-summary__who .bi {
	color: var(--rt-text-faint);
}
