/*
 * Tabs (ADR 0088): the topics on one side (or on top) and the open topic's picture beside them (or below).
 * view.js opens one tab at a time and, on phones, moves each picture under its tab; without it the first
 * tab is open. The tabs are cards or have a line at the side or below (ADR 0171); pictures fade into each
 * other in one place, so the section never jumps. Pictures are shown flat, never turned in depth.
 */
@counter-style sv-persian-2 {
	system: extends persian;
	pad: 2 "۰";
}

@counter-style sv-arabic-2 {
	system: extends arabic-indic;
	pad: 2 "٠";
}

/*
 * The focus ring is the area's text color, worked out here: it shows outside a dark or colored open tab too. The space
 * between the tabs and inside them (ADR 0171): Small 0.5rem between and Medium 1rem / 1.25rem inside unless chosen.
 */
.sv-tabs {
	--sv-tabs-accent: var(--sv-accent, var(--sv-color-primary));
	--sv-tabs-focus: var(--sv-color-text);
	--sv-tabs-gap: 0.5rem;
	--sv-tabs-pad-block: 1rem;
	--sv-tabs-pad-inline: 1.25rem;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: var(--sv-space-lg);
	align-items: center;
}

/*
 * Topics beside the picture (ADR 0107): the heading, its small words and description are a row of their own
 * above both, so the topics and the picture start at the same line (the side box gives its parts to the grid).
 */
.sv-tabs:not(.sv-tabs--layout-top) {
	row-gap: var(--sv-space-md);
	align-items: start;
}

.sv-tabs:not(.sv-tabs--layout-top) > .sv-tabs__side {
	display: contents;
}

.sv-tabs:not(.sv-tabs--layout-top) .sv-tabs__head {
	grid-column: 1 / -1;
}

/* The tabs' side counts only beside the picture: on top they stay above it, whatever side was chosen before. */
.sv-tabs--side-end:not(.sv-tabs--layout-top) .sv-tabs__list {
	order: 2;
}

/*
 * Heading With the tabs (ADR 0187): the side keeps its own column, the heading at its top, so the picture starts at the
 * heading's line. At the end side the whole column moves (zero specificity: tablets showing the tabs on top or as an
 * accordion put it back first, utilities.css).
 */
.sv-tabs--head-place-side:not(.sv-tabs--layout-top) > .sv-tabs__side {
	display: grid;
}

@media (min-width: 768px) {
	:where(.sv-tabs--side-end.sv-tabs--head-place-side:not(.sv-tabs--layout-top)) > .sv-tabs__side {
		order: 2;
	}
}

.sv-tabs__side {
	display: grid;
	gap: var(--sv-space-md);
	align-content: start;
	min-inline-size: 0;
}

.sv-tabs__head {
	justify-self: start;
	margin: 0;
	text-align: start;
}

.sv-tabs__eyebrow {
	margin: 0;
	color: var(--sv-accent, var(--sv-color-link));
	font-family: var(--sv-font-label, var(--sv-font-body));
	font-size: var(--sv-size-small);
	font-weight: 700;
	font-synthesis-weight: var(--sv-font-label-synthesis, auto);
	letter-spacing: calc(0.08em * var(--sv-tracking, 1));
	text-transform: var(--sv-uppercase, uppercase);
}

.sv-tabs__list {
	display: grid;
	gap: var(--sv-tabs-gap);
	counter-reset: sv-tab;
}

.sv-tabs--tab-gap-md { --sv-tabs-gap: 1rem; }
.sv-tabs--tab-gap-lg { --sv-tabs-gap: 1.5rem; }
.sv-tabs--tab-gap-custom { --sv-tabs-gap: var(--sv-custom-tab-gap, 0.5rem); }

.sv-tabs--tab-inset-sm {
	--sv-tabs-pad-block: 0.75rem;
	--sv-tabs-pad-inline: 1rem;
}

.sv-tabs--tab-inset-lg {
	--sv-tabs-pad-block: 1.5rem;
	--sv-tabs-pad-inline: 1.75rem;
}

.sv-tabs--tab-inset-custom {
	--sv-tabs-pad-block: var(--sv-custom-tab-inset, 1rem);
	--sv-tabs-pad-inline: var(--sv-custom-tab-inset, 1.25rem);
}

/* ---------- A tab ---------- */

.sv-tabs__item {
	position: relative;
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	padding: var(--sv-tabs-pad-block) var(--sv-tabs-pad-inline);
	border: 1px solid transparent;
	border-radius: var(--sv-radius-md);
	counter-increment: sv-tab;
	transition:
		background-color 0.25s ease,
		border-color 0.25s ease;
}

/* The tab's button: over the whole tab, under its own button. */
.sv-tabs__tab {
	position: absolute;
	inset: 0;
	z-index: 1;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: none;
	cursor: pointer;
}

.sv-tabs__tab:focus-visible {
	outline: 2px solid var(--sv-focus, var(--sv-tabs-focus));
	outline-offset: 2px;
}

.sv-tabs__icon {
	flex: none;
	color: var(--sv-tabs-accent);
}

/*
 * A number in the icon's place (ADR 0171): counted in the site's digits (two of them), in the number font, at the
 * icon's size and in its color and circle.
 */
.sv-tabs__count {
	display: inline-grid;
	place-items: center;
	inline-size: 2rem;
	block-size: 2rem;
	font-family: var(--sv-font-number, var(--sv-font-heading));
	font-size: 1.25rem;
	font-weight: 600;
	font-synthesis-weight: var(--sv-font-number-synthesis, auto);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.sv-tabs__count::before {
	content: counter(sv-tab, var(--sv-numerals-2, decimal-leading-zero));
}

.sv-icon--size-sm .sv-tabs__count {
	inline-size: 1.5rem;
	block-size: 1.5rem;
	font-size: 1rem;
}

.sv-icon--size-lg .sv-tabs__count {
	inline-size: 3rem;
	block-size: 3rem;
	font-size: 1.75rem;
}

/* Without a circle the number takes its own width: the title follows it at the usual gap. */
.sv-tabs__number > .sv-tabs__count {
	inline-size: auto;
}

/* Number at the end (ADR 0171): after the words, at the end of the tab, in the title's size, font and color, lighter. */
.sv-tabs--marker-end .sv-tabs__words {
	flex: 1;
}

.sv-tabs--marker-end .sv-tabs__number {
	order: 2;
	color: var(--sv-color-text);
}

.sv-tabs--marker-end .sv-tabs__number .sv-icon__circle {
	display: contents;
}

.sv-tabs.sv-tabs--marker-end .sv-tabs__count {
	inline-size: auto;
	block-size: auto;
	font-family: var(--sv-tabs-title-font);
	font-size: var(--sv-tabs-title-size);
	font-weight: 400;
	font-synthesis-weight: auto;
	line-height: calc(1.35 * var(--sv-leading, 1));
}

.sv-tabs__words {
	display: grid;
	gap: 0.25rem;
	min-inline-size: 0;
}

/*
 * With words only on the open tab the closed tabs show just their title, so its first line and the icon or number
 * before it share one middle (ADR 0171): a circle taller than the line moves the words down by half the difference (the
 * words under the title follow it as before), a small icon beside a large title moves down instead. --sv-tabs-mark is
 * the icon's or number's height, by its size and circle. With the words always shown the title stays at the icon's top,
 * as on tabs saved before (0.75.0).
 */
.sv-tabs {
	--sv-tabs-title-line: calc(var(--sv-tabs-title-size) * 1.35 * var(--sv-leading, 1));
}

.sv-tabs__item:has(> .sv-icon--size-sm) { --sv-tabs-mark: 1.5rem; }
.sv-tabs__item:has(> .sv-icon--size-md) { --sv-tabs-mark: 2rem; }
.sv-tabs__item:has(> .sv-icon--size-lg) { --sv-tabs-mark: 3rem; }
.sv-tabs__item:has(> .sv-icon--size-sm > .sv-icon__circle) { --sv-tabs-mark: 2.625rem; }
.sv-tabs__item:has(> .sv-icon--size-md > .sv-icon__circle) { --sv-tabs-mark: 3.5rem; }
.sv-tabs__item:has(> .sv-icon--size-lg > .sv-icon__circle) { --sv-tabs-mark: 5.25rem; }

.sv-tabs--text-on-open .sv-tabs__words {
	padding-block-start: max(0px, (var(--sv-tabs-mark, 0px) - var(--sv-tabs-title-line)) / 2);
}

.sv-tabs--text-on-open .sv-tabs__icon {
	margin-block-start: max(0px, (var(--sv-tabs-title-line) - var(--sv-tabs-mark, 0px)) / 2);
}

/* A number at the end is the title's own size: nothing to line up. */
.sv-tabs--marker-end .sv-tabs__words {
	padding-block-start: 0;
}

.sv-tabs.sv-tabs--marker-end .sv-tabs__icon {
	margin-block-start: 0;
}

/*
 * The titles' size (Small: the body text's, Large: a Heading 4's) and font (ADR 0171), as Testimonials' quote font:
 * variables, so a number at the end can match them.
 */
.sv-tabs {
	--sv-tabs-title-size: calc(var(--sv-size-body) * 1.06);
	--sv-tabs-title-font: var(--sv-font-body);
}

.sv-tabs--title-size-sm { --sv-tabs-title-size: var(--sv-size-body); }
.sv-tabs--title-size-lg { --sv-tabs-title-size: var(--sv-size-h4); }
.sv-tabs--title-size-custom { --sv-tabs-title-size: var(--sv-custom-title-size, calc(var(--sv-size-body) * 1.06)); }
.sv-tabs--title-font-heading { --sv-tabs-title-font: var(--sv-font-heading); }

.sv-tabs__title {
	margin: 0;
	font-family: var(--sv-tabs-title-font);
	font-size: var(--sv-tabs-title-size);
	font-weight: 600;
	line-height: calc(1.35 * var(--sv-leading, 1));
}

.sv-tabs--title-font-heading .sv-tabs__title {
	font-weight: min(var(--sv-font-heading-weight, 700), 600);
	font-synthesis-weight: none;
	letter-spacing: calc(var(--sv-font-heading-tracking, 0em) * var(--sv-tracking, 1));
}

.sv-tabs__text {
	margin: 0;
	color: var(--sv-color-muted);
	font-size: var(--sv-size-small);
	line-height: calc(1.55 * var(--sv-leading-body, 1));
}

/* Text size (ADR 0187): the words under each title; Small (the small text size) unless chosen. */
.sv-tabs--text-size-md .sv-tabs__text {
	font-size: var(--sv-size-body);
}

.sv-tabs--text-size-lg .sv-tabs__text {
	font-size: var(--sv-size-large);
}

.sv-tabs--text-size-custom .sv-tabs__text {
	font-size: var(--sv-custom-text-size);
}

/*
 * A tab's button shows while it is open, above the tab's own button. It unfolds smoothly (ADR 0107): its row grows
 * from nothing while it fades in, and folds away the same way — out of the keyboard's way once folded.
 */
.sv-tabs__action {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-rows: 0fr;
	margin-block-start: 0;
	opacity: 0;
	visibility: hidden;
	transition:
		grid-template-rows 0.35s ease,
		margin-block-start 0.35s ease,
		opacity 0.2s ease,
		visibility 0s linear 0.35s;
}

.sv-tabs__action > * {
	min-block-size: 0;
	overflow: hidden;
}

@media (hover: hover) {
	.sv-tabs__item:hover {
		background: color-mix(in srgb, var(--sv-tabs-accent) 4%, transparent);
	}
}

/*
 * Open (the first one until view.js runs): Box — a see-through tint of the accent over whatever is behind it, so on
 * a dark or accent-color section it is a lighter shade of that color under its light words (0.67.0; it was the
 * page's white there, hiding them).
 */
.sv-tabs__item[data-open],
.sv-tabs:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	border-color: color-mix(in srgb, var(--sv-tabs-accent) 35%, transparent);
	background: color-mix(in srgb, var(--sv-tabs-accent) 7%, transparent);
}

.sv-tabs__item[data-open] .sv-tabs__action,
.sv-tabs:not(.sv-tabs--ready) .sv-tabs__item:first-child .sv-tabs__action {
	grid-template-rows: 1fr;
	margin-block-start: 0.5rem;
	opacity: 1;
	visibility: visible;
	transition:
		grid-template-rows 0.35s ease,
		margin-block-start 0.35s ease,
		opacity 0.3s ease 0.1s,
		visibility 0s;
}

.sv-tabs__item[data-open] .sv-tabs__action > *,
.sv-tabs:not(.sv-tabs--ready) .sv-tabs__item:first-child .sv-tabs__action > * {
	overflow: visible;
}

/*
 * Words only on the open tab (ADR 0171): the words and the button sit in a fold under the title that unfolds with the
 * tab as the button does — its row grows from nothing while it fades in — and folds away the same way. On the canvas a
 * tab whose title is being typed in unfolds too, so its words can be edited there.
 */
.sv-tabs__fold {
	display: grid;
	grid-template-rows: 0fr;
	margin-block-start: -0.25rem;
	opacity: 0;
	visibility: hidden;
	transition:
		grid-template-rows 0.4s ease,
		margin-block-start 0.4s ease,
		opacity 0.2s ease,
		visibility 0s linear 0.4s;
}

.sv-tabs__more {
	display: grid;
	gap: 0.25rem;
	min-block-size: 0;
	overflow: hidden;
}

.sv-tabs__item[data-open] .sv-tabs__fold,
.sv-tabs:not(.sv-tabs--ready) .sv-tabs__item:first-child .sv-tabs__fold,
.sv-tabs__item:has([data-sv-edit]:focus) .sv-tabs__fold {
	grid-template-rows: 1fr;
	margin-block-start: 0;
	opacity: 1;
	visibility: visible;
	transition:
		grid-template-rows 0.4s ease,
		margin-block-start 0.4s ease,
		opacity 0.3s ease 0.1s,
		visibility 0s;
}

/* Line (retired, ADR 0171): a line beside the tabs (under them when on top), in the accent color where one is open;
   each tab's own piece of line, with a small gap to the next (ADR 0107). */
.sv-tabs--tab-style-line .sv-tabs__list {
	gap: 0.5rem;
}

.sv-tabs--tab-style-line .sv-tabs__item {
	border: 0;
	border-inline-start: 1px solid var(--sv-color-border);
	border-radius: 0;
}

.sv-tabs.sv-tabs--tab-style-line .sv-tabs__item:is([data-open], :hover) {
	background: none;
}

.sv-tabs.sv-tabs--tab-style-line .sv-tabs__item[data-open],
.sv-tabs.sv-tabs--tab-style-line:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	border-inline-start-color: var(--sv-tabs-accent);
	background: none;
}

/*
 * Side line and Bottom line (ADR 0171): each tab's own piece of line on its start side or under it, wherever the tabs
 * are; the open tab's is the accent, 2px (an inset shadow adds the second pixel, so nothing moves).
 */
.sv-tabs--tab-style-side .sv-tabs__item {
	border: 0;
	border-inline-start: 1px solid var(--sv-color-border);
	border-radius: 0;
}

.sv-tabs--tab-style-below .sv-tabs__item {
	border: 0;
	border-block-end: 1px solid var(--sv-color-border);
	border-radius: 0;
}

.sv-tabs.sv-tabs:is(.sv-tabs--tab-style-side, .sv-tabs--tab-style-below) .sv-tabs__item:is([data-open], :hover),
.sv-tabs.sv-tabs:is(.sv-tabs--tab-style-side, .sv-tabs--tab-style-below):not(.sv-tabs--ready) .sv-tabs__item:first-child {
	background: none;
}

.sv-tabs.sv-tabs--tab-style-side .sv-tabs__item[data-open],
.sv-tabs.sv-tabs--tab-style-side:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	border-inline-start-color: var(--sv-tabs-accent);
	box-shadow: inset 1px 0 0 var(--sv-tabs-accent);
}

[dir="rtl"] .sv-tabs.sv-tabs--tab-style-side .sv-tabs__item[data-open],
[dir="rtl"] .sv-tabs.sv-tabs--tab-style-side:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	box-shadow: inset -1px 0 0 var(--sv-tabs-accent);
}

.sv-tabs.sv-tabs--tab-style-below .sv-tabs__item[data-open],
.sv-tabs.sv-tabs--tab-style-below:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	border-block-end-color: var(--sv-tabs-accent);
	box-shadow: inset 0 -1px 0 var(--sv-tabs-accent);
}

/*
 * Bottom line, one tab under another (ADR 0187): the space between the tabs is split around each line, half above it and
 * half below, so every title sits halfway between the line over it and its own (the gap alone went above the next title).
 * On top they stand in a row, except on phones; As you scroll keeps its own room.
 */
.sv-tabs--tab-style-below:not(.sv-tabs--layout-top, .sv-tabs--layout-scroll) .sv-tabs__list {
	row-gap: 0;
}

.sv-tabs--tab-style-below:not(.sv-tabs--layout-top, .sv-tabs--layout-scroll) .sv-tabs__item {
	padding-block: calc(var(--sv-tabs-pad-block) + var(--sv-tabs-gap) / 2);
}

@media (max-width: 767px) {
	.sv-tabs--tab-style-below.sv-tabs--layout-top .sv-tabs__list {
		row-gap: 0;
	}

	.sv-tabs--tab-style-below.sv-tabs--layout-top .sv-tabs__item {
		padding-block: calc(var(--sv-tabs-pad-block) + var(--sv-tabs-gap) / 2);
	}
}

/*
 * ---------- Card (ADR 0171): the other tabs' background (None, Soft, Light, Outlined) and the open tab's color (Soft,
 * Light, Dark, Accent color or a custom one), with the cards' text colors (ADR 0026, 0070). Only for Card: a line
 * style leaves them out. A custom color rides on every tab; only the open one is painted (its glass's edge too).
 * ----------
 */
.sv-tabs__item[style*="--sv-custom-edge"] {
	box-shadow: none;
}

.sv-tabs--other-look-soft:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item,
.sv-tabs--other-look-light:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item {
	--sv-color-text: var(--sv-ink);
	--sv-color-muted: var(--sv-ink-muted);
	--sv-color-border: var(--sv-ink-border);
	--sv-accent: initial;
	--sv-accent-dark: initial;
	--sv-button-main-bg: initial;
	--sv-button-main-text: initial;
	--sv-tabs-accent: var(--sv-color-primary);
	color: var(--sv-color-text);
}

.sv-tabs--other-look-soft:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item {
	--sv-button-edge: var(--sv-button-edge-soft);
	background: var(--sv-color-surface);
}

.sv-tabs--other-look-light:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item {
	--sv-button-edge: var(--sv-button-edge-page);
	border-color: var(--sv-ink-border);
	background: var(--sv-color-background);
	box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
}

.sv-tabs--other-look-outlined:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item {
	border-color: var(--sv-color-border);
}

@media (hover: hover) {
	.sv-tabs[class*="sv-tabs--other-look-"]:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item:hover {
		border-color: color-mix(in srgb, var(--sv-tabs-accent) 35%, transparent);
	}
}

/* Soft (the open tab's own look) beside other tabs with a background: the area's words and the accent's tint again. */
.sv-tabs[class*="sv-tabs--other-look-"]:not([class*="sv-tabs--tab-style-"], [class*="sv-tabs--open-look-"]) .sv-tabs__item[data-open],
.sv-tabs[class*="sv-tabs--other-look-"]:not([class*="sv-tabs--tab-style-"], [class*="sv-tabs--open-look-"], .sv-tabs--ready) .sv-tabs__item:first-child {
	--sv-color-text: inherit;
	--sv-color-muted: inherit;
	--sv-color-border: inherit;
	--sv-accent: inherit;
	--sv-accent-dark: inherit;
	--sv-button-main-bg: inherit;
	--sv-button-main-text: inherit;
	--sv-button-edge: inherit;
	--sv-tabs-accent: inherit;
	border-color: color-mix(in srgb, var(--sv-tabs-accent) 35%, transparent);
	background: color-mix(in srgb, var(--sv-tabs-accent) 7%, transparent);
	box-shadow: none;
}

.sv-tabs--open-look-light:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item[data-open],
.sv-tabs--open-look-light:not([class*="sv-tabs--tab-style-"], .sv-tabs--ready) .sv-tabs__item:first-child {
	--sv-color-text: var(--sv-ink);
	--sv-color-muted: var(--sv-ink-muted);
	--sv-color-border: var(--sv-ink-border);
	--sv-accent: initial;
	--sv-accent-dark: initial;
	--sv-button-main-bg: initial;
	--sv-button-main-text: initial;
	--sv-button-edge: var(--sv-button-edge-page);
	--sv-tabs-accent: var(--sv-color-primary);
	border-color: var(--sv-ink-border);
	background: var(--sv-color-background);
	box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
	color: var(--sv-color-text);
}

.sv-tabs--open-look-dark:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item[data-open],
.sv-tabs--open-look-dark:not([class*="sv-tabs--tab-style-"], .sv-tabs--ready) .sv-tabs__item:first-child {
	--sv-color-text: var(--sv-color-on-inverse);
	--sv-color-muted: color-mix(in srgb, var(--sv-color-on-inverse) 78%, transparent);
	--sv-color-border: color-mix(in srgb, var(--sv-color-on-inverse) 12%, transparent);
	--sv-accent: var(--sv-color-on-inverse);
	--sv-accent-dark: var(--sv-color-primary);
	--sv-button-main-bg: var(--sv-button-on-dark);
	--sv-button-main-text: var(--sv-button-on-dark-text);
	--sv-button-edge: var(--sv-button-edge-dark);
	--sv-tabs-accent: var(--sv-color-on-inverse);
	border-color: transparent;
	background: var(--sv-color-inverse);
	box-shadow: none;
	color: var(--sv-color-text);
}

.sv-tabs--open-look-primary:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item[data-open],
.sv-tabs--open-look-primary:not([class*="sv-tabs--tab-style-"], .sv-tabs--ready) .sv-tabs__item:first-child {
	--sv-color-text: var(--sv-color-on-primary);
	--sv-color-muted: var(--sv-color-on-primary);
	--sv-color-border: color-mix(in srgb, var(--sv-color-on-primary) 25%, transparent);
	--sv-accent: var(--sv-color-on-primary);
	--sv-accent-dark: initial;
	--sv-button-main-bg: var(--sv-color-on-primary);
	--sv-button-main-text: var(--sv-button-fill, var(--sv-color-primary));
	--sv-button-edge: initial;
	--sv-tabs-accent: var(--sv-color-on-primary);
	border-color: transparent;
	background: var(--sv-color-primary);
	box-shadow: none;
	color: var(--sv-color-text);
}

/* A custom color: near-black words on light ones, white on dark ones (the Dark look's class), whatever the scheme. */
.sv-tabs:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item[data-open][style*="--sv-custom-card"],
.sv-tabs:not([class*="sv-tabs--tab-style-"], .sv-tabs--ready) .sv-tabs__item:first-child[style*="--sv-custom-card"] {
	--sv-color-text: #10131c;
	--sv-color-muted: color-mix(in srgb, #10131c 72%, transparent);
	--sv-color-border: color-mix(in srgb, #10131c 14%, transparent);
	--sv-accent: initial;
	--sv-accent-dark: initial;
	--sv-button-main-bg: initial;
	--sv-button-main-text: initial;
	--sv-button-edge: initial;
	--sv-tabs-accent: var(--sv-color-primary);
	border-color: transparent;
	background: var(--sv-custom-card);
	box-shadow: var(--sv-custom-edge, 0 0 #0000);
	color: var(--sv-color-text);
	-webkit-backdrop-filter: var(--sv-custom-glass);
	backdrop-filter: var(--sv-custom-glass);
}

.sv-tabs--open-look-dark:not([class*="sv-tabs--tab-style-"]) .sv-tabs__item[data-open][style*="--sv-custom-card"],
.sv-tabs--open-look-dark:not([class*="sv-tabs--tab-style-"], .sv-tabs--ready) .sv-tabs__item:first-child[style*="--sv-custom-card"] {
	--sv-color-text: #fff;
	--sv-color-muted: color-mix(in srgb, #fff 78%, transparent);
	--sv-color-border: color-mix(in srgb, #fff 12%, transparent);
	--sv-accent: #fff;
	--sv-accent-dark: var(--sv-color-primary);
	--sv-button-main-bg: #fff;
	--sv-button-main-text: var(--sv-custom-card);
	--sv-tabs-accent: #fff;
}

/* ---------- Moving by itself: a line fills in the open tab (view.js keeps the time), then the next one opens ---------- */

.sv-tabs__progress {
	display: none;
}

/*
 * Room for the line under the words of a Card (ADR 0171), whenever the tabs may move by themselves (also on the canvas,
 * so nothing jumps when they stop). With Side line and Bottom line the tab's own line is the timer instead. With words
 * only on the open tab the room unfolds with them, so the closed tabs keep their title in the middle.
 */
@media (prefers-reduced-motion: no-preference) {
	.sv-tabs[data-sv-autoplay]:not(.sv-tabs--layout-scroll, .sv-tabs--tab-style-side, .sv-tabs--tab-style-below, .sv-tabs--text-on-open) .sv-tabs__item {
		padding-block-end: calc(var(--sv-tabs-pad-block) + 0.75rem);
	}

	/* A spacer, not padding: padding would stay when the fold closes. With the row gap it is the same 0.75rem. */
	.sv-tabs--text-on-open[data-sv-autoplay]:not(.sv-tabs--layout-scroll, .sv-tabs--tab-style-side, .sv-tabs--tab-style-below) .sv-tabs__more::after {
		block-size: 0.5rem;
		content: "";
	}
}

.sv-tabs--auto .sv-tabs__item[data-open] .sv-tabs__progress {
	position: absolute;
	inset-block-end: calc(var(--sv-tabs-pad-block) * 0.75);
	inset-inline: var(--sv-tabs-pad-inline);
	display: block;
	block-size: 2px;
	border-radius: 2px;
	background-color: color-mix(in srgb, var(--sv-tabs-accent) 18%, transparent);
	background-image: linear-gradient(var(--sv-tabs-accent), var(--sv-tabs-accent));
	background-position: left center;
	background-repeat: no-repeat;
	background-size: calc(var(--sv-tabs-done, 0) * 100%) 100%;
}

[dir="rtl"] .sv-tabs--auto .sv-tabs__item[data-open] .sv-tabs__progress {
	background-position: right center;
}

/* Bottom line and Side line (ADR 0171): the open tab's line is the timer — it fills along the line, from where reading starts or from the top. */
.sv-tabs.sv-tabs--auto.sv-tabs--tab-style-below .sv-tabs__item[data-open] {
	border-block-end-color: var(--sv-color-border);
	box-shadow: none;
}

.sv-tabs--auto.sv-tabs--tab-style-below .sv-tabs__item[data-open] .sv-tabs__progress {
	inset-block-end: -1px;
	inset-inline: 0;
	border-radius: 0;
	background-color: transparent;
}

.sv-tabs.sv-tabs--auto.sv-tabs--tab-style-side .sv-tabs__item[data-open] {
	border-inline-start-color: var(--sv-color-border);
	box-shadow: none;
}

.sv-tabs--auto.sv-tabs--tab-style-side .sv-tabs__item[data-open] .sv-tabs__progress {
	inset-block: 0;
	inset-inline: -1px auto;
	inline-size: 2px;
	block-size: auto;
	border-radius: 0;
	background-color: transparent;
	background-position: center top;
	background-size: 100% calc(var(--sv-tabs-done, 0) * 100%);
}


/* ---------- The pictures ---------- */

.sv-tabs__panels {
	display: grid;
	min-inline-size: 0;
}

.sv-tabs__panel {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.45s ease,
		visibility 0s linear 0.45s;
}

.sv-tabs__panel[data-open],
.sv-tabs:not(.sv-tabs--ready) .sv-tabs__panel:first-child {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.45s ease;
}

.sv-tabs__img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	box-shadow: 0 12px 28px -14px rgb(15 23 42 / 22%);
}

.sv-tabs--corners-sm .sv-tabs__img {
	border-radius: var(--sv-radius-sm);
}

.sv-tabs--corners-md .sv-tabs__img {
	border-radius: var(--sv-radius-md);
}

.sv-tabs--corners-lg .sv-tabs__img {
	border-radius: var(--sv-radius-lg);
}

/* ---------- Tabs on top ---------- */

.sv-tabs--layout-top {
	grid-template-columns: minmax(0, 1fr);
}

.sv-tabs--layout-top .sv-tabs__head {
	justify-self: center;
	text-align: center;
}

.sv-tabs--layout-top .sv-tabs__list {
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.sv-tabs--layout-top.sv-tabs--tab-style-line .sv-tabs__item {
	border-inline-start: 0;
	border-block-end: 1px solid var(--sv-color-border);
}

.sv-tabs.sv-tabs--layout-top.sv-tabs--tab-style-line .sv-tabs__item[data-open],
.sv-tabs.sv-tabs--layout-top.sv-tabs--tab-style-line:not(.sv-tabs--ready) .sv-tabs__item:first-child {
	border-block-end-color: var(--sv-tabs-accent);
}

.sv-tabs--layout-top .sv-tabs__panels {
	justify-self: center;
	inline-size: 100%;
	max-inline-size: 64rem;
}

/*
 * ---------- As you scroll (ADR 0117): the pictures stay in view, just under the header, while the tabs go by; view.js
 * opens the tab at the middle of the screen. Room between the tabs gives each its turn; the others are a little faded.
 * ----------
 */
.sv-tabs--layout-scroll {
	--sv-stick-top: calc(max(var(--sv-header-space, 0px), var(--wp-admin--admin-bar--height, 0px)) + var(--sv-space-sm));
}

/* Room below the last tab lets it reach the middle while the picture still stays. */
.sv-tabs--layout-scroll .sv-tabs__list {
	gap: clamp(2rem, 16vh, 9rem);
	padding-block: clamp(1rem, 6vh, 3rem) clamp(2rem, 32vh, 18rem);
}

.sv-tabs--layout-scroll .sv-tabs__panels {
	position: sticky;
	inset-block-start: var(--sv-stick-top);
	align-self: start;
}

/* A tall picture still fits on the screen beside the tabs. */
.sv-tabs--layout-scroll .sv-tabs__panels .sv-tabs__img {
	max-block-size: calc(100vh - var(--sv-stick-top) - var(--sv-space-md));
	object-fit: cover;
}

.sv-tabs--layout-scroll.sv-tabs--ready .sv-tabs__item:not([data-open]) .sv-tabs__words {
	opacity: 0.55;
}

.sv-tabs--layout-scroll .sv-tabs__words {
	transition: opacity 0.3s ease;
}

/* Tabs above or an accordion (tablets that say so, phones): the tabs keep their usual spacing. */
@media (max-width: 1024px) {
	.sv-tabs--layout-scroll:is(.sv-t-tshow-top, .sv-t-tshow-accordion) .sv-tabs__list {
		gap: 0.5rem;
		padding-block: 0;
	}
}

@media (max-width: 767px) {
	.sv-tabs.sv-tabs--layout-scroll .sv-tabs__list {
		gap: 0.5rem;
		padding-block: 0;
	}
}

/* ---------- Phones: one column; view.js puts each picture under its tab ---------- */

@media (max-width: 767px) {
	.sv-tabs {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--sv-space-md);
	}

	.sv-tabs--side-end:not(.sv-tabs--layout-top) .sv-tabs__list {
		order: 0;
	}

	.sv-tabs--layout-top .sv-tabs__list {
		grid-template-columns: minmax(0, 1fr);
	}

	.sv-tabs__list > .sv-tabs__panel {
		grid-area: auto;
		margin-block: 0.25rem 0.75rem;
	}

	.sv-tabs__list > .sv-tabs__panel:not([data-open]) {
		display: none;
	}

	.sv-tabs__panels:empty {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sv-tabs__panel,
	.sv-tabs__panel[data-open],
	.sv-tabs__action,
	.sv-tabs__item[data-open] .sv-tabs__action,
	.sv-tabs__fold,
	.sv-tabs__item[data-open] .sv-tabs__fold {
		transition: none;
	}
}
