/*
 * LAFU Tables admin. One set of tokens, one radius, one type scale.
 * Everything is scoped under .rv-root so wp-admin styles do not leak in or out.
 */

.rv-root,
.lafu-tables-screen {
	--rv-bg: #f5f6f8;
	--rv-surface: #fff;
	--rv-surface-2: #f9fafb;
	--rv-hover: #f2f4f7;
	--rv-border: #e4e7ec;
	--rv-border-strong: #d0d5dd;
	--rv-text: #101828;
	--rv-text-2: #344054;
	--rv-muted: #5d6679;
	--rv-accent: #4f46e5;
	--rv-accent-strong: #4338ca;
	--rv-accent-soft: #eef2ff;
	--rv-accent-ring: rgba(79, 70, 229, 0.28);
	--rv-danger: #c4320a;
	--rv-danger-soft: #fef3f2;
	--rv-success: #067647;
	--rv-success-soft: #ecfdf3;
	--rv-warn: #93370d;
	--rv-warn-soft: #fffaeb;
	--rv-radius: 8px;
	--rv-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
	--rv-shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
	--rv-shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22), 0 4px 12px rgba(16, 24, 40, 0.06);
	--rv-font: -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif;
	--rv-mono: ui-monospace, sfmono-regular, menlo, consolas, monospace;
	--rv-fs-xs: 12px;
	--rv-fs-sm: 13px;
	--rv-fs: 14px;
	--rv-fs-md: 16px;
	--rv-fs-lg: 20px;
	--rv-fs-xl: 24px;
	--rv-ease: cubic-bezier(0.2, 0, 0, 1);
	--rv-admin-bar: 32px;
	--rv-top-h: 56px;
}

/* Full width: drop wp-admin's padding around our screen. */
.lafu-tables-screen #wpcontent {
	padding-left: 0;
}

.lafu-tables-screen #wpbody-content {
	padding-bottom: 0;
}

.lafu-tables-screen #wpfooter {
	display: none;
}

.lafu-tables-screen #wpwrap,
.lafu-tables-screen #wpbody-content {
	background: var(--rv-bg);
}

.lafu-tables-screen .lafu-tables-wrap {
	margin: 0;
	padding: 0;
}

.lafu-tables-screen .lafu-tables-wrap > .notice,
.lafu-tables-screen #wpbody-content > .notice {
	margin: 16px 32px 0;
}

.rv-root {
	font-family: var(--rv-font);
	font-size: var(--rv-fs);
	line-height: 1.5;
	color: var(--rv-text);
	-webkit-font-smoothing: antialiased;
}

.rv-root *,
.rv-root *::before,
.rv-root *::after {
	box-sizing: border-box;
}

.rv-root h1,
.rv-root h2,
.rv-root h3,
.rv-root h4,
.rv-root p {
	margin: 0;
	color: inherit;
}

.rv-root :focus {
	outline: none;
}

.rv-root :focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 2px;
	box-shadow: none;
}

.rv-icon {
	flex: none;
	display: block;
}

.rv-spin {
	animation: rv-spin 0.9s linear infinite;
}

@keyframes rv-spin {
	to {
		transform: rotate(360deg);
	}
}

.rv-grow {
	flex: 1 1 auto;
}

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

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

.rv-mt {
	margin-top: 16px;
}

/* Boot placeholder (server markup). */
.rv-boot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 60vh;
	color: var(--rv-muted);
	font-size: var(--rv-fs);
}

.rv-boot__mark {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--rv-border-strong);
	border-top-color: var(--rv-accent);
	animation: rv-spin 0.9s linear infinite;
}

/* ---------- Top bar and tabs ---------- */

.rv-top {
	position: sticky;
	top: var(--rv-admin-bar);
	z-index: 20;
	display: flex;
	align-items: stretch;
	gap: 40px;
	height: var(--rv-top-h);
	padding: 0 32px;
	background: var(--rv-surface);
	border-bottom: 1px solid var(--rv-border);
}

.rv-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
}

.rv-brand__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--rv-radius);
	background: linear-gradient(135deg, #7479ff, #4338ca);
	box-shadow: 0 2px 6px rgba(30, 26, 110, 0.25);
	color: #fff;
}

.rv-brand__name {
	font-size: var(--rv-fs-md);
	font-weight: 650;
	letter-spacing: -0.01em;
}

.rv-brand__ver {
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--rv-hover);
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 500;
}

.rv-tabs {
	display: flex;
	align-items: stretch;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
}

.rv-tab {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 12px;
	color: var(--rv-muted);
	font-size: var(--rv-fs);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s var(--rv-ease);
}

.rv-tab:hover,
.rv-tab:focus {
	color: var(--rv-text);
}

.rv-tab:focus-visible {
	outline-offset: -6px;
	border-radius: var(--rv-radius);
}

.rv-tab::after {
	content: "";
	position: absolute;
	right: 12px;
	bottom: -1px;
	left: 12px;
	height: 2px;
	border-radius: 2px 2px 0 0;
	background: transparent;
	transition: background 0.15s var(--rv-ease);
}

.rv-tab.is-active {
	color: var(--rv-accent-strong);
}

.rv-tab.is-active::after {
	background: var(--rv-accent);
}

/* Feedback link at the end of the top bar (.rv-top beats the margin: 0 of .rv-btn). */
.rv-top .rv-feedback {
	flex: none;
	align-self: center;
	margin-inline-start: auto;
}

.rv-main {
	min-height: calc(100vh - var(--rv-admin-bar) - var(--rv-top-h));
}

.rv-main:focus {
	outline: none;
}

/* ---------- Page layout ---------- */

.rv-page {
	padding: 32px;
}

.rv-page__head,
.rv-section-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

.rv-h1 {
	font-size: var(--rv-fs-xl);
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.rv-h2 {
	font-size: var(--rv-fs-lg);
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.rv-h3 {
	font-size: var(--rv-fs-md);
	font-weight: 600;
	line-height: 1.4;
}

.rv-sub {
	margin-top: 4px;
	color: var(--rv-muted);
	font-size: var(--rv-fs);
}

.rv-help {
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
	line-height: 1.5;
}

.rv-panel {
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow-sm);
}

.rv-card {
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow-sm);
}

.rv-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 0;
}

.rv-loading--page {
	min-height: 50vh;
}

.rv-spinner {
	display: inline-flex;
	color: var(--rv-accent);
}

.rv-stack {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.rv-grid2,
.rv-grid3 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 20px;
	align-items: start;
}

.rv-grid3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- Buttons ---------- */

.rv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	margin: 0;
	border: 1px solid transparent;
	border-radius: var(--rv-radius);
	font: inherit;
	font-size: var(--rv-fs);
	font-weight: 550;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s var(--rv-ease), border-color 0.15s var(--rv-ease), color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

.rv-btn:disabled,
.rv-btn[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.5;
}

.rv-btn--sm {
	height: 32px;
	padding: 0 12px;
	font-size: var(--rv-fs-sm);
	gap: 6px;
}

.rv-btn--primary {
	background: var(--rv-accent);
	border-color: var(--rv-accent);
	color: #fff;
	box-shadow: var(--rv-shadow-sm);
}

.rv-btn--primary:hover:not(:disabled) {
	background: var(--rv-accent-strong);
	border-color: var(--rv-accent-strong);
	color: #fff;
}

.rv-btn--secondary {
	background: var(--rv-surface);
	border-color: var(--rv-border-strong);
	color: var(--rv-text-2);
	box-shadow: var(--rv-shadow-sm);
}

.rv-btn--secondary:hover:not(:disabled) {
	background: var(--rv-surface-2);
	color: var(--rv-text);
}

.rv-btn--tertiary {
	background: transparent;
	color: var(--rv-text-2);
}

.rv-btn--tertiary:hover:not(:disabled) {
	background: var(--rv-hover);
	color: var(--rv-text);
}

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

.rv-btn--danger:hover:not(:disabled) {
	background: #a82a08;
	border-color: #a82a08;
	color: #fff;
}

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

.rv-btn--danger-text:hover:not(:disabled) {
	background: var(--rv-danger-soft);
	color: var(--rv-danger);
}

.rv-btn.is-busy {
	pointer-events: none;
}

.rv-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: var(--rv-radius);
	background: transparent;
	color: var(--rv-muted);
	cursor: pointer;
	transition: background 0.15s var(--rv-ease), color 0.15s var(--rv-ease);
}

.rv-iconbtn:hover:not(:disabled) {
	background: var(--rv-hover);
	color: var(--rv-text);
}

.rv-iconbtn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.rv-iconbtn.is-pressed {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-iconbtn--danger:hover:not(:disabled) {
	background: var(--rv-danger-soft);
	color: var(--rv-danger);
}

.rv-spin-icon .rv-icon {
	animation: rv-spin 0.9s linear infinite;
}

.rv-link {
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	color: var(--rv-accent-strong);
	font: inherit;
	font-weight: 550;
	text-align: left;
	cursor: pointer;
}

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

.rv-btnrow {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Buttons of one kind in an even grid of pairs. */
/* ---------- Form controls ---------- */

.rv-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.rv-label {
	color: var(--rv-text-2);
	font-size: var(--rv-fs-sm);
	font-weight: 550;
}

.rv-root .rv-input {
	width: 100%;
	min-height: 40px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--rv-border-strong);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	box-shadow: var(--rv-shadow-sm);
	color: var(--rv-text);
	font: inherit;
	font-size: var(--rv-fs);
	line-height: 1.4;
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

.rv-root .rv-input::placeholder {
	color: #8a93a6;
}

.rv-root .rv-input:focus {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
	outline: none;
}

.rv-root .rv-input.is-invalid {
	border-color: var(--rv-danger);
}

.rv-root .rv-textarea {
	min-height: 88px;
	resize: vertical;
}

.rv-root .rv-mono {
	font-family: var(--rv-mono);
	font-size: var(--rv-fs-sm);
}

.rv-select {
	position: relative;
	display: block;
}

.rv-root .rv-select select.rv-input {
	max-width: none;
	padding-right: 36px;
	appearance: none;
	background-image: none;
	cursor: pointer;
}

.rv-select .rv-icon,
.rv-combo > .rv-icon {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	color: var(--rv-muted);
	pointer-events: none;
}

.rv-fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.rv-fieldset > legend {
	margin-bottom: 8px;
	padding: 0;
}

.rv-root .rv-check {
	width: 18px;
	height: 18px;
	margin: 0;
	border: 1px solid var(--rv-border-strong);
	border-radius: 5px;
	box-shadow: none;
	accent-color: var(--rv-accent);
}

.rv-root .rv-check:checked {
	background: var(--rv-accent);
	border-color: var(--rv-accent);
}

.rv-root .rv-check:checked::before {
	content: "";
	display: block;
	width: 10px;
	height: 6px;
	margin: 4px 0 0 3px;
	border: solid #fff;
	border-width: 0 0 2px 2px;
	transform: rotate(-45deg);
}

/* Switch */
.rv-switch {
	position: relative;
	flex: none;
	width: 40px;
	height: 24px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: #c3c8d2;
	cursor: pointer;
	transition: background 0.2s var(--rv-ease);
}

.rv-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
	transition: transform 0.2s var(--rv-ease);
}

.rv-switch.is-on {
	background: var(--rv-accent);
}

.rv-switch.is-on .rv-switch__thumb {
	transform: translateX(16px);
}

.rv-switch:disabled {
	opacity: 0.5;
	cursor: wait;
}

.rv-switchrow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
}

.rv-switchrow__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rv-switchrow__label {
	color: var(--rv-text);
	font-weight: 550;
}

/* A switch straight under a card title starts where the other cards' first field does. */
.rv-h3 + .rv-switchrow {
	padding-top: 0;
}

.rv-switchlist > .rv-switchrow + .rv-switchrow {
	border-top: 1px solid var(--rv-border);
}

/* Segmented control */
.rv-seg {
	display: inline-flex;
	flex-wrap: wrap;
	align-self: flex-start;
	gap: 2px;
	padding: 3px;
	border-radius: var(--rv-radius);
	background: var(--rv-hover);
	border: 1px solid var(--rv-border);
	max-width: 100%;
}

.rv-seg__opt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 32px;
	padding: 0 12px;
	margin: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--rv-muted);
	font: inherit;
	font-size: var(--rv-fs-sm);
	font-weight: 550;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s var(--rv-ease), color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

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

.rv-seg__opt.is-active {
	background: var(--rv-surface);
	color: var(--rv-text);
	box-shadow: var(--rv-shadow);
}

/* Colour */
/* Colour: swatch and code in one field-shaped control. Empty, the theme decides. */
.rv-color {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 320px;
	height: 40px;
	padding: 0 4px 0 5px;
	border: 1px solid var(--rv-border-strong);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

.rv-color:focus-within {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
}

.rv-color__swatch {
	position: relative;
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12);
	overflow: hidden;
}

/* The theme's own colours: a light and a dark half. */
.rv-color.is-empty .rv-color__swatch {
	background: linear-gradient(135deg, #fff 0 50%, #1d2127 50% 100%);
}

.rv-color__swatch input {
	position: absolute;
	inset: -8px;
	width: calc(100% + 16px);
	height: calc(100% + 16px);
	opacity: 0;
	cursor: pointer;
}

.rv-root .rv-color__hex {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--rv-text);
	font: inherit;
	font-size: var(--rv-fs-sm);
	text-transform: uppercase;
}

.rv-root .rv-color__hex::placeholder {
	color: var(--rv-text);
	text-transform: none;
	opacity: 1;
}

.rv-root .rv-color__hex:focus {
	outline: 0;
	box-shadow: none;
}

.rv-root .rv-color__hex:focus::placeholder {
	color: var(--rv-muted);
}

.rv-color .rv-iconbtn {
	flex: none;
}

/* Combobox */
.rv-combo {
	position: relative;
}

.rv-combo .rv-input {
	padding-right: 36px;
	text-overflow: ellipsis;
}

.rv-combo__list {
	position: absolute;
	z-index: 30;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	max-height: 240px;
	margin: 0;
	padding: 4px;
	overflow: auto;
	list-style: none;
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow-lg);
}

.rv-combo__opt,
.rv-combo__none {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 6px;
	cursor: pointer;
}

.rv-combo__none {
	color: var(--rv-muted);
	cursor: default;
}

.rv-combo__opt span {
	flex: 1 1 auto;
}

.rv-combo__opt code {
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	background: none;
	padding: 0;
}

.rv-combo__opt.is-active {
	background: var(--rv-hover);
}

.rv-combo__opt[aria-selected="true"] {
	color: var(--rv-accent-strong);
	font-weight: 550;
}

/* Search field with an icon */
.rv-search {
	position: relative;
	display: block;
	flex: 0 1 320px;
	min-width: 0;
	margin: 0;
}

.rv-search > .rv-icon {
	position: absolute;
	top: 50%;
	left: 12px;
	transform: translateY(-50%);
	color: var(--rv-muted);
	pointer-events: none;
}

.rv-root .rv-search .rv-input {
	padding-left: 36px;
}

.rv-search--sm {
	flex-basis: 220px;
}

.rv-root .rv-search--sm .rv-input {
	min-height: 32px;
	padding-top: 4px;
	padding-bottom: 4px;
	padding-left: 32px;
	font-size: var(--rv-fs-sm);
}

.rv-search--sm > .rv-icon {
	left: 11px;
}

/* ---------- Badges, chips, notices ---------- */

.rv-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	background: var(--rv-hover);
	color: var(--rv-text-2);
	font-size: var(--rv-fs-xs);
	font-weight: 550;
	line-height: 1;
	white-space: nowrap;
}

.rv-badge--accent {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-badge--success {
	background: var(--rv-success-soft);
	color: var(--rv-success);
}

.rv-badge--warn {
	background: var(--rv-warn-soft);
	color: var(--rv-warn);
}

.rv-code-chip {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	height: 32px;
	padding: 0 2px 0 10px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-surface-2);
	white-space: nowrap;
}

.rv-code-chip code {
	padding: 0;
	background: none;
	color: var(--rv-text-2);
	font-size: var(--rv-fs-xs);
}

.rv-code-chip .rv-iconbtn {
	width: 28px;
	height: 28px;
}

.rv-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rv-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 12px;
	margin: 0;
	border: 1px solid var(--rv-border-strong);
	border-radius: 999px;
	background: var(--rv-surface);
	color: var(--rv-text-2);
	font: inherit;
	font-size: var(--rv-fs-sm);
	font-weight: 550;
	cursor: pointer;
}

.rv-chip.is-on {
	border-color: var(--rv-accent);
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 20px;
	padding: 12px 8px 12px 14px;
	border: 1px solid #c7d7fe;
	border-radius: var(--rv-radius);
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-notice > .rv-icon {
	margin-top: 2px;
}

.rv-notice__body {
	flex: 1 1 auto;
	padding-top: 0;
	color: var(--rv-text);
}

.rv-notice .rv-iconbtn {
	width: 24px;
	height: 24px;
	margin-top: -2px;
}

.rv-notice--error {
	border-color: #fecdca;
	background: var(--rv-danger-soft);
	color: var(--rv-danger);
}

.rv-notice--success {
	border-color: #abefc6;
	background: var(--rv-success-soft);
	color: var(--rv-success);
}

.rv-notice--warning {
	border-color: #fedf89;
	background: var(--rv-warn-soft);
	color: var(--rv-warn);
}

/* ---------- Table health (Settings) ---------- */

.rv-health__list {
	margin: 6px 0 0;
	padding-left: 18px;
}

.rv-health__list code {
	font-family: var(--rv-mono);
	font-size: var(--rv-fs-xs);
}

.rv-health__actions {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 12px;
}

/* ---------- Empty state ---------- */

.rv-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 560px;
	margin: 0 auto;
	padding: 64px 24px;
	text-align: center;
}

.rv-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
	box-shadow: 0 0 0 8px #f5f7ff;
}

.rv-empty__title {
	font-size: var(--rv-fs-lg);
	font-weight: 650;
	letter-spacing: -0.01em;
}

.rv-empty__text {
	margin-top: 8px;
	color: var(--rv-muted);
}

.rv-empty__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
}

/* ---------- Tables list ---------- */

.rv-toolbar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--rv-border);
}

.rv-toolbar__pick {
	flex: 0 0 200px;
}

.rv-toolbar__pick .rv-field {
	gap: 0;
}

.rv-bulkbar {
	flex-wrap: wrap;
	gap: 8px;
	min-height: 73px;
	box-sizing: border-box;
	background: var(--rv-accent-soft);
}

.rv-bulkbar__count {
	margin-inline-end: 8px;
	color: var(--rv-accent-strong);
	font-weight: 600;
}

.rv-list th.rv-list__pick,
.rv-list td.rv-list__pick {
	width: 20px;
	padding-inline-end: 0;
}

.rv-list tbody tr.is-picked {
	background: var(--rv-accent-soft);
}

.rv-sorthead {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.rv-sorthead .rv-icon {
	opacity: 0.5;
}

.rv-sorthead.is-active,
.rv-sorthead:hover {
	color: var(--rv-text);
}

.rv-sorthead.is-active .rv-icon {
	opacity: 1;
	color: var(--rv-accent);
}

.rv-count {
	margin-left: auto;
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

.rv-tablewrap {
	overflow-x: auto;
}

.rv-list {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
}

.rv-list th {
	padding: 10px 20px;
	border-bottom: 1px solid var(--rv-border);
	background: var(--rv-surface-2);
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-align: left;
	white-space: nowrap;
}

.rv-list td {
	height: 72px; /* One row height, with or without a badge line under the title. */
	padding: 14px 20px;
	border-bottom: 1px solid var(--rv-border);
	vertical-align: middle;
}

.rv-list tbody tr:last-child td {
	border-bottom: 0;
}

.rv-list tbody tr {
	transition: background 0.1s var(--rv-ease);
}

.rv-list tbody tr:hover {
	background: var(--rv-surface-2);
}

.rv-list .rv-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rv-list__title {
	min-width: 280px;
}

.rv-list__cell {
	display: flex;
	align-items: center;
	gap: 14px;
}

.rv-list__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: var(--rv-radius);
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

.rv-list__icon.is-layout {
	background: #fdf2fa;
	color: #c11574;
}

.rv-list__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rv-list__name a {
	color: var(--rv-text);
	font-size: var(--rv-fs);
	font-weight: 600;
	text-decoration: none;
}

.rv-list__name a:hover {
	color: var(--rv-accent-strong);
	text-decoration: underline;
}

.rv-list__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

.rv-list__desc {
	overflow: hidden;
	max-width: 380px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rv-badge + .rv-list__desc::before {
	content: "·";
	margin-right: 8px;
}

.rv-list__actions {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

.rv-list__actions .rv-iconbtn + .rv-iconbtn {
	margin-left: 2px;
}

.rv-pager {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 12px 20px;
	border-top: 1px solid var(--rv-border);
	font-size: var(--rv-fs-sm);
}

/* ---------- Equal cards (import, features) ---------- */

.rv-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rv-cards > li {
	display: flex;
	margin: 0;
}

.rv-cards > li > .rv-card {
	flex: 1 1 auto;
}

.rv-feature,
.rv-imp {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
}

.rv-feature__head,
.rv-imp__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.rv-feature__head .rv-h3,
.rv-imp__head .rv-h3 {
	flex: 1 1 auto;
	min-width: 0;
}

.rv-feature__icon,
.rv-imp__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: var(--rv-radius);
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

.rv-feature__text,
.rv-imp__text {
	flex: 1 1 auto;
	color: var(--rv-muted);
}

.rv-feature__foot,
.rv-imp__foot {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding-top: 4px;
}

.rv-feature__text .rv-badge {
	margin-inline-end: 4px;
	vertical-align: 1px;
}

.rv-feature__note {
	margin-top: -4px;
	overflow: hidden;
	font-size: var(--rv-fs-xs);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rv-imp--loading {
	align-items: center;
	justify-content: center;
	min-height: 180px;
}

/* ---------- Settings ---------- */

.rv-settings {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	align-items: stretch;
}

/* A known column count, so a short last row can fill the width instead of leaving a gap. */
@media (min-width: 961px) {

	.rv-settings {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rv-settings > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1400px) {

	.rv-settings {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.rv-settings > :last-child:nth-child(odd) {
		grid-column: auto;
	}

	.rv-settings > :last-child:nth-child(3n + 1) {
		grid-column: 1 / -1;
	}

	.rv-settings > :last-child:nth-child(3n + 2) {
		grid-column: span 2;
	}
}

.rv-settings__card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
}

.rv-pro {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 20px;
	background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 60%, #fff 100%);
	border-color: #ddd6fe;
}

.rv-pro__body {
	display: flex;
	flex: 1 1 auto;
	gap: 14px;
}

.rv-pro__body p {
	margin-top: 4px;
	color: var(--rv-text-2);
}

.rv-pro__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: var(--rv-radius);
	background: var(--rv-accent);
	color: #fff;
}

/* ---------- Modal ---------- */

body.rv-modal-open {
	overflow: hidden;
}

.rv-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(16, 24, 40, 0.5);
	backdrop-filter: blur(2px);
	animation: rv-fade 0.15s var(--rv-ease);
}

@keyframes rv-fade {
	from {
		opacity: 0;
	}
}

@keyframes rv-rise {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.99);
	}
}

.rv-modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 48px);
	border-radius: 12px;
	background: var(--rv-surface);
	box-shadow: var(--rv-shadow-lg);
	animation: rv-rise 0.2s var(--rv-ease);
}

.rv-modal:focus {
	outline: none;
}

.rv-modal--sm {
	max-width: 440px;
}

.rv-modal--lg {
	max-width: 840px;
}

.rv-modal--xl {
	max-width: 1180px;
	height: calc(100vh - 48px);
}

.rv-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 20px 0 24px;
}

.rv-modal__title {
	padding-top: 4px;
	font-size: var(--rv-fs-lg);
	font-weight: 650;
	letter-spacing: -0.01em;
}

.rv-modal__desc {
	margin-top: 4px;
	color: var(--rv-muted);
}

.rv-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 20px 24px 24px;
	overflow: auto;
}

.rv-modal__foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px;
	border-top: 1px solid var(--rv-border);
	background: var(--rv-surface-2);
	border-radius: 0 0 12px 12px;
}

.rv-confirm p {
	color: var(--rv-text-2);
}

/* Choice cards in New table */
/* Welcome: three steps in a row over the step's content. */
.rv-welcome {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.rv-welcome__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

.rv-welcome__steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.rv-welcome__steps .is-current {
	color: var(--rv-text);
	font-weight: 600;
}

.rv-welcome__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 1px solid var(--rv-border-strong);
	border-radius: 999px;
	background: var(--rv-surface);
	font-size: var(--rv-fs-xs);
}

.rv-welcome__steps .is-current .rv-welcome__num {
	border-color: var(--rv-accent);
	background: var(--rv-accent);
	color: #fff;
}

.rv-welcome__steps .is-done .rv-welcome__num {
	border-color: var(--rv-success);
	color: var(--rv-success);
}

.rv-welcome__ways {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	align-items: stretch;
}

.rv-welcome__ways > div {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 16px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
}

@media (max-width: 782px) {

	.rv-welcome__ways {
		grid-template-columns: minmax(0, 1fr);
	}
}

.rv-choices {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.rv-choices.has-4 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rv-choice {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	height: 100%;
	padding: 20px;
	margin: 0;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	color: var(--rv-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease), transform 0.15s var(--rv-ease);
}

.rv-choice:hover {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
}

.rv-choice__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 8px;
	border-radius: var(--rv-radius);
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

.rv-choice__title {
	font-size: var(--rv-fs-md);
	font-weight: 600;
}

.rv-choice__text {
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

.rv-choice__go {
	position: absolute;
	top: 20px;
	right: 16px;
	color: var(--rv-muted);
	transition: transform 0.15s var(--rv-ease), color 0.15s var(--rv-ease);
}

.rv-choice:hover .rv-choice__go {
	color: var(--rv-accent);
	transform: translateX(2px);
}

/* Template gallery */
.rv-gallery {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.rv-gallery__cats {
	position: sticky;
	top: 0;
}

.rv-gallery__cats ul,
.rv-sidenav ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rv-gallery__cats li,
.rv-sidenav li {
	margin: 0;
}

.rv-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rv-gallery__grid > li {
	display: flex;
	margin: 0;
}

.rv-tpl {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	color: var(--rv-text);
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

.rv-tpl:hover:not(.is-disabled),
.rv-tpl:focus-within {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
}

.rv-tpl__pick {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

/* The button covers the whole card, picture included. */
.rv-tpl__pick::after {
	content: "";
	position: absolute;
	inset: 0;
}

.rv-tpl__pick:focus-visible {
	outline: none;
}

.rv-tpl__pick:disabled {
	cursor: progress;
}

.rv-tpl__preview {
	position: relative;
	display: block;
	height: 200px;
	padding: 12px;
	overflow: hidden;
	background: var(--rv-surface-2);
	border-bottom: 1px solid var(--rv-border);
}

/* A real rendering at desktop width, scaled down by the gallery to fit. */
.rv-pic {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	pointer-events: none;
}

.rv-pic__inner {
	position: absolute;
	top: 0;
	left: 0;
	width: 880px;
	visibility: hidden;
	transform-origin: 0 0;
	color: #1d2127;
	font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rv-pic__inner .ltable,
.rv-pic__inner .lafu-tables-layout-wrap {
	margin: 0;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
}

.rv-pic__inner .ltable.is-dark {
	background: #15171c;
}

.rv-tpl__busy {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.75);
}

.rv-tpl__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px 4px;
}

.rv-tpl__title {
	font-weight: 600;
}

.rv-tpl__summary {
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

.rv-tpl__mode {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 14px 12px;
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 550;
}

/* File drop */
.rv-drop {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
	border: 2px dashed var(--rv-border-strong);
	border-radius: var(--rv-radius);
	background: var(--rv-surface-2);
	transition: border-color 0.15s var(--rv-ease), background 0.15s var(--rv-ease);
}

.rv-drop.is-over {
	border-color: var(--rv-accent);
	background: var(--rv-accent-soft);
}

.rv-drop.has-file {
	border-style: solid;
	border-color: var(--rv-accent);
	background: var(--rv-surface);
}

.rv-drop__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

.rv-drop__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	word-break: break-word;
}

.rv-drop:focus-within label.rv-btn {
	outline: 2px solid var(--rv-accent);
	outline-offset: 2px;
}

.rv-checklist {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
}

.rv-checklist__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	cursor: pointer;
}

.rv-checklist__item + .rv-checklist__item {
	border-top: 1px solid var(--rv-border);
}

.rv-checklist__title {
	flex: 1 1 auto;
	font-weight: 550;
}

/* Toasts */
.rv-toasts {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	pointer-events: none;
}

.rv-toast {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 420px;
	padding: 10px 6px 10px 14px;
	border-radius: var(--rv-radius);
	background: #101828;
	box-shadow: var(--rv-shadow-lg);
	color: #fff;
	font-size: var(--rv-fs-sm);
	font-weight: 500;
	pointer-events: auto;
	animation: rv-rise 0.2s var(--rv-ease);
}

.rv-toast > .rv-icon {
	color: #75e0a7;
}

.rv-toast--error > .rv-icon {
	color: #fda29b;
}

.rv-toast .rv-iconbtn {
	width: 26px;
	height: 26px;
	color: #c3c8d2;
}

.rv-toast .rv-iconbtn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

/* ---------- Editor ---------- */

.rv-editor {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--rv-admin-bar) - var(--rv-top-h));
	min-height: 520px;
}

.rv-editor__head {
	display: flex;
	flex: none;
	align-items: center;
	gap: 16px;
	min-height: 72px;
	padding: 12px 24px;
	background: var(--rv-surface);
	border-bottom: 1px solid var(--rv-border);
}

.rv-editor__title {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rv-root .rv-titlefield {
	width: min(480px, 40vw);
	min-height: 0;
	margin: 0 0 0 -8px;
	padding: 2px 8px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: var(--rv-text);
	font: inherit;
	font-size: 18px;
	font-weight: 650;
	letter-spacing: -0.01em;
	text-overflow: ellipsis;
}

.rv-root .rv-titlefield:hover {
	border-color: var(--rv-border);
}

.rv-root .rv-titlefield:focus {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
	background: var(--rv-surface);
}

.rv-editor__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
}

.rv-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #17b26a;
}

.rv-dot.is-draft {
	background: #f79009;
}

.rv-dot.is-private {
	background: #98a2b3;
}

.rv-savestate {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
	white-space: nowrap;
}

.rv-savestate.is-saved .rv-icon {
	color: var(--rv-success);
}

.rv-savestate.is-error {
	color: var(--rv-danger);
}

.rv-savestate.is-dirty .rv-icon {
	animation: none;
	opacity: 0.6;
}

.rv-editor__body {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: 216px minmax(0, 1fr);
	min-height: 0;
}

.rv-sidenav {
	padding: 16px 12px;
	background: var(--rv-surface);
	border-right: 1px solid var(--rv-border);
	overflow: auto;
}

.rv-sidenav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 40px;
	padding: 0 12px;
	margin: 0;
	border: 0;
	border-radius: var(--rv-radius);
	background: transparent;
	color: var(--rv-text-2);
	font: inherit;
	font-size: var(--rv-fs);
	font-weight: 550;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s var(--rv-ease), color 0.15s var(--rv-ease);
}

.rv-sidenav__item > span:first-of-type,
.rv-sidenav__item > .rv-icon + span {
	flex: 1 1 auto;
}

.rv-sidenav__item .rv-icon {
	color: var(--rv-muted);
}

.rv-sidenav__item:hover {
	background: var(--rv-hover);
	color: var(--rv-text);
}

.rv-sidenav__item.is-active {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-sidenav__item.is-active .rv-icon {
	color: var(--rv-accent);
}

.rv-sidenav__count {
	padding: 0 7px;
	border-radius: 999px;
	background: var(--rv-hover);
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 600;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
}

.rv-sidenav__item.is-active .rv-sidenav__count {
	background: #fff;
	color: var(--rv-accent-strong);
}

.rv-editor__panel {
	display: flex;
	min-width: 0;
	min-height: 0;
}

.rv-editor__main {
	flex: 1 1 auto;
	min-width: 0;
	overflow: auto;
}

.rv-editor__panel.is-data .rv-editor__main,
.rv-editor__panel.is-builder .rv-editor__main {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.rv-editor__panel.has-preview .rv-editor__main {
	flex: 0 1 600px;
	min-width: 420px;
	border-right: 1px solid var(--rv-border);
}

.rv-editor__preview {
	flex: 1 1 auto;
	min-width: 0;
	overflow: auto;
	padding: 24px;
	background: #eceef2;
}

.rv-panelpad {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 28px 32px 40px;
}

.rv-panelpad > .rv-section-head {
	margin-bottom: 4px;
}

.rv-cardhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Sections inside a side menu item (Style: Look, Colours, Rows and lines). */
.rv-sidenav__chev {
	flex: none;
	transform: rotate(-90deg);
	transition: transform 0.15s var(--rv-ease);
}

.rv-sidenav li.is-open .rv-sidenav__chev {
	transform: none;
}

.rv-sidenav__item.is-parent {
	color: var(--rv-text);
}

.rv-sidenav__item.is-parent .rv-icon {
	color: var(--rv-accent);
}

.rv-sidenav ul.rv-sidenav__sub {
	position: relative;
	gap: 0;
	margin-block: 2px 6px;
	margin-inline: 21px 0;
	padding-inline-start: 12px;
	border-inline-start: 1px solid var(--rv-border);
}

.rv-sidenav__subitem {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 34px;
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-radius: var(--rv-radius);
	background: transparent;
	color: var(--rv-text-2);
	font: inherit;
	font-size: var(--rv-fs-sm);
	font-weight: 500;
	text-align: start;
	cursor: pointer;
	transition: background 0.15s var(--rv-ease), color 0.15s var(--rv-ease);
}

.rv-sidenav__subitem:hover {
	background: var(--rv-hover);
	color: var(--rv-text);
}

.rv-sidenav__subitem.is-active {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
	font-weight: 600;
}

.rv-sidenav__subitem.is-active::before {
	content: "";
	position: absolute;
	inset-inline-start: -1px;
	width: 2px;
	height: 20px;
	border-radius: 2px;
	background: var(--rv-accent);
}

/* A section that fills the panel: its list scrolls in its own box, the panel itself never does. */
.rv-panelpad--fill {
	box-sizing: border-box;
	height: 100%;
	min-height: 0;
}

.rv-panelpad--fill > .rv-fillcard,
.rv-panelpad--fill > .rv-scrollbox {
	flex: 0 1 auto;
	min-height: 0;
}

.rv-fillcard {
	display: flex;
	flex-direction: column;
}

.rv-scrollbox {
	min-height: 0;
	overflow: auto;
}

.rv-fillcard > .rv-scrollbox {
	flex: 0 1 auto;
}

.rv-scrollbox .rv-matrix thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--rv-surface);
}

.rv-scrollbox:focus-visible {
	outline: 2px solid var(--rv-accent);
	outline-offset: 2px;
}

/* A screen with its own side menu (Settings, Features). */
.rv-split {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	min-height: calc(100vh - var(--rv-admin-bar) - var(--rv-top-h));
}

.rv-split > .rv-sidenav {
	padding-top: 24px;
}

.rv-split__main {
	min-width: 0;
}

/* Spreadsheet */
.rv-sheet {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	background: var(--rv-surface);
}

.rv-sheet > .rv-notice {
	margin: 12px 16px 0;
}

.rv-sheet__bar,
.rv-builder__bar {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	min-height: 56px;
	padding: 8px 16px;
	border-bottom: 1px solid var(--rv-border);
	background: var(--rv-surface);
}

.rv-sheet__group {
	display: flex;
	align-items: center;
	gap: 4px;
}

.rv-sheet__rowtools {
	gap: 8px;
	font-size: var(--rv-fs-sm);
}

.rv-sheet__sep {
	width: 1px;
	height: 20px;
	margin: 0 4px;
	background: var(--rv-border);
}

.rv-sheet__scroll {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	background: var(--rv-surface);
	overscroll-behavior: contain;
}

/* The grid places cells by left offset, so it keeps one direction; text inside still follows its own script. */
.rv-sheet__scroll {
	direction: ltr;
}

.rv-sheet__grid {
	position: relative;
	min-width: 100%;
	font-size: var(--rv-fs-sm);
	font-variant-numeric: tabular-nums;
}

.rv-sheet__grid:focus-visible {
	outline: none;
}

.rv-sheet__grid:focus-visible .rv-sheet__td.is-active {
	box-shadow: inset 0 0 0 2px var(--rv-accent);
}

.rv-sheet__head {
	position: sticky;
	top: 0;
	z-index: 3;
	height: 40px;
	background: var(--rv-surface-2);
	border-bottom: 1px solid var(--rv-border-strong);
}

.rv-sheet__headrow {
	position: relative;
	height: 40px;
}

.rv-sheet__corner {
	position: sticky;
	left: 0;
	z-index: 2;
	height: 40px;
	background: var(--rv-surface-2);
	border-right: 1px solid var(--rv-border);
}

.rv-sheet__th {
	position: absolute;
	top: 0;
	display: flex;
	align-items: center;
	height: 40px;
	border-right: 1px solid var(--rv-border);
	color: var(--rv-text-2);
	font-weight: 600;
	user-select: none;
}

.rv-sheet__th.is-sel {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
}

.rv-sheet__th.is-dragging {
	opacity: 0.4;
}

.rv-sheet__th.drop-before {
	box-shadow: inset 3px 0 0 var(--rv-accent);
}

.rv-sheet__th.drop-after {
	box-shadow: inset -3px 0 0 var(--rv-accent);
}

.rv-sheet__thbtn {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	min-width: 0;
	height: 100%;
	padding: 0 4px 0 12px;
	margin: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: grab;
}

.rv-sheet__thbtn .rv-icon {
	color: var(--rv-muted);
}

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

.rv-sheet__thmenu {
	width: 28px;
	height: 28px;
	margin-right: 6px;
	opacity: 0;
}

.rv-sheet__th:hover .rv-sheet__thmenu,
.rv-sheet__thmenu:focus-visible {
	opacity: 1;
}

.rv-sheet__resize {
	position: absolute;
	top: 0;
	right: -4px;
	z-index: 1;
	width: 8px;
	height: 100%;
	cursor: col-resize;
}

.rv-sheet__resize:hover {
	background: linear-gradient(to right, transparent 3px, var(--rv-accent) 3px, var(--rv-accent) 5px, transparent 5px);
}

.rv-sheet__stick {
	position: sticky;
	top: 0;
	z-index: 4;
	height: 0;
}

.rv-sheet__thadd {
	position: absolute;
	top: 4px;
	padding-left: 6px;
}

.rv-sheet__tr {
	position: absolute;
	top: 0;
	left: 0;
	height: 36px;
	will-change: transform;
}

.rv-sheet__tr:hover .rv-sheet__td {
	background-color: #fafbfc;
}

.rv-sheet__tr.drop-before {
	box-shadow: inset 0 2px 0 var(--rv-accent);
}

.rv-sheet__tr.drop-after {
	box-shadow: inset 0 -2px 0 var(--rv-accent);
}

.rv-sheet__num {
	position: sticky;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	height: 36px;
	padding: 0 10px 0 6px;
	background: var(--rv-surface-2);
	border-right: 1px solid var(--rv-border);
	border-bottom: 1px solid var(--rv-border);
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	cursor: pointer;
	user-select: none;
}

.rv-sheet__grip {
	margin-right: auto;
	opacity: 0;
	cursor: grab;
}

.rv-sheet__tr:hover .rv-sheet__grip {
	opacity: 0.7;
}

.rv-sheet__tr.is-sel .rv-sheet__num {
	background: var(--rv-accent-soft);
	color: var(--rv-accent-strong);
	font-weight: 600;
}

.rv-sheet__td {
	position: absolute;
	top: 0;
	display: flex;
	align-items: center;
	height: 36px;
	padding: 0 12px;
	overflow: hidden;
	border-right: 1px solid var(--rv-border);
	border-bottom: 1px solid var(--rv-border);
	background: var(--rv-surface);
	color: var(--rv-text);
	white-space: nowrap;
	cursor: cell;
	user-select: none;
}

.rv-sheet__td.is-right {
	justify-content: flex-end;
}

.rv-sheet__td.is-center {
	justify-content: center;
}

.rv-sheet__td.is-code {
	font-family: var(--rv-mono);
	font-size: var(--rv-fs-xs);
	color: var(--rv-text-2);
}

.rv-sheet__td.is-sel,
.rv-sheet__tr:hover .rv-sheet__td.is-sel {
	background: #eef1ff;
}

.rv-sheet__td.is-active {
	box-shadow: inset 0 0 0 2px var(--rv-accent);
	background: var(--rv-surface);
	z-index: 1;
}

.rv-cell-text {
	overflow: hidden;
	text-overflow: ellipsis;
}

.rv-cell-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	color: var(--rv-accent-strong);
}

.rv-cell-link span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.rv-cell-pill {
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--rv-hover);
	color: var(--rv-text-2);
	font-size: var(--rv-fs-xs);
	font-weight: 550;
}

.rv-skel {
	display: block;
	width: 60%;
	height: 10px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0f1f4 0%, #f7f8fa 50%, #f0f1f4 100%);
	background-size: 200% 100%;
	animation: rv-shimmer 1.2s linear infinite;
}

@keyframes rv-shimmer {
	to {
		background-position: -200% 0;
	}
}

.rv-cell-editor {
	position: absolute;
	z-index: 5;
	display: flex;
	flex-direction: column;
	background: var(--rv-surface);
	border-radius: 2px;
	box-shadow: 0 0 0 2px var(--rv-accent), var(--rv-shadow-lg);
}

.rv-root .rv-cell-editor__input {
	width: 100%;
	height: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--rv-text);
	font: inherit;
	font-size: var(--rv-fs-sm);
}

.rv-root textarea.rv-cell-editor__input {
	height: auto;
	padding: 9px 12px;
	resize: vertical;
}

.rv-root .rv-cell-editor__input:focus {
	box-shadow: none;
	outline: none;
}

.rv-cell-editor__hint {
	padding: 4px 12px 6px;
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	border-top: 1px solid var(--rv-border);
}

.rv-sheet__empty {
	position: absolute;
	top: 40px;
	right: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 64px 24px;
	color: var(--rv-muted);
}

.rv-sheet__status {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 36px;
	padding: 0 16px;
	border-top: 1px solid var(--rv-border);
	background: var(--rv-surface-2);
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	white-space: nowrap;
}

.rv-sheet__keys {
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Columns list */
.rv-collist {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--rv-surface);
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow-sm);
}

.rv-colrow {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	margin: 0;
	padding: 10px 12px 10px 8px;
	background: var(--rv-surface);
	transition: background 0.1s var(--rv-ease);
}

.rv-colrow:first-child {
	border-radius: var(--rv-radius) var(--rv-radius) 0 0;
}

.rv-colrow:last-child {
	border-radius: 0 0 var(--rv-radius) var(--rv-radius);
}

.rv-colrow + .rv-colrow {
	border-top: 1px solid var(--rv-border);
}

.rv-colrow:hover {
	background: var(--rv-surface-2);
}

.rv-colrow.is-dragging {
	opacity: 0.45;
}

.rv-colrow.drop-before {
	box-shadow: inset 0 2px 0 var(--rv-accent);
}

.rv-colrow.drop-after {
	box-shadow: inset 0 -2px 0 var(--rv-accent);
}

.rv-colrow__grip {
	display: flex;
	color: #98a2b3;
	cursor: grab;
}

.rv-colrow__type {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: var(--rv-radius);
	background: var(--rv-hover);
	color: var(--rv-text-2);
}

.rv-colrow__name {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.rv-colrow__label {
	color: var(--rv-text);
	font-weight: 600;
}

.rv-colrow__name code {
	padding: 0;
	background: none;
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
}

.rv-colrow__flags {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.rv-colrow__actions {
	display: flex;
	gap: 2px;
}

/* Column type picker */
.rv-typegrid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.rv-typeopt {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 12px;
	margin: 0;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	color: var(--rv-text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease), background 0.15s var(--rv-ease);
}

.rv-typeopt .rv-icon {
	margin-bottom: 4px;
	color: var(--rv-muted);
}

.rv-typeopt:hover {
	border-color: var(--rv-border-strong);
	background: var(--rv-surface-2);
}

.rv-typeopt.is-active,
.rv-typeopt:focus-within {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
}

.rv-typeopt.is-active .rv-icon {
	color: var(--rv-accent);
}

.rv-typeopt__label {
	font-size: var(--rv-fs-sm);
	font-weight: 600;
}

.rv-typeopt__help {
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	line-height: 1.4;
}

/* Presets and responsive modes */
.rv-presets,
.rv-modes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

/*
 * Looks: always one even row of five. Narrow, the cards drop their line and
 * the chosen look's line shows under the row; on phones they become a list.
 */
.rv-looks {
	container: rv-looks / inline-size;
}

.rv-looks .rv-presets {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rv-presets__note {
	display: none;
	margin: 12px 0 0;
	color: var(--rv-muted);
	font-size: var(--rv-fs-sm);
}

@container rv-looks (max-width: 759px) {

	.rv-looks .rv-preset__text {
		display: none;
	}

	.rv-looks .rv-preset {
		padding: 8px;
	}

	.rv-looks .rv-psample {
		height: 64px;
	}

	.rv-looks .rv-preset__label {
		overflow-wrap: anywhere;
	}

	.rv-presets__note {
		display: block;
	}
}

@container rv-looks (max-width: 459px) {

	.rv-looks .rv-presets {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.rv-looks .rv-preset {
		display: grid;
		grid-template-columns: 88px minmax(0, 1fr);
		grid-template-rows: auto auto;
		align-items: center;
		column-gap: 12px;
		row-gap: 2px;
	}

	.rv-looks .rv-psample {
		grid-row: 1 / 3;
		height: 56px;
	}

	.rv-looks .rv-preset__label {
		align-self: end;
		margin-top: 0;
	}

	.rv-looks .rv-preset__text {
		display: block;
		align-self: start;
	}

	.rv-presets__note {
		display: none;
	}
}

.rv-modes {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rv-preset,
.rv-mode {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 12px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	cursor: pointer;
	transition: border-color 0.15s var(--rv-ease), box-shadow 0.15s var(--rv-ease);
}

.rv-preset:hover,
.rv-mode:hover {
	border-color: var(--rv-border-strong);
}

.rv-preset.is-active,
.rv-mode.is-active,
.rv-preset:focus-within,
.rv-mode:focus-within {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
}

.rv-preset__label,
.rv-mode__label {
	margin-top: 8px;
	font-size: var(--rv-fs-sm);
	font-weight: 600;
}

.rv-preset__text,
.rv-mode__text {
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
}

.rv-psample {
	display: flex;
	flex-direction: column;
	height: 92px;
	overflow: hidden;
	border-radius: 6px;
	border: 1px solid #eef0f3;
	background: #fff;
}

.rv-psample__row {
	display: grid;
	grid-template-columns: 1.4fr 1fr 0.8fr;
	gap: 6px;
	padding: 6px 8px;
}

.rv-psample__row i {
	display: block;
	height: 5px;
	border-radius: 3px;
	background: #d0d5dd;
}

.rv-psample__row.is-head i {
	background: var(--rv-t-accent);
}

.rv-psample__row + .rv-psample__row {
	border-top: 1px solid #f0f1f4;
}

.rv-psample--minimal .rv-psample__row + .rv-psample__row {
	border-top-color: transparent;
}

.rv-psample--minimal .rv-psample__row.is-head {
	box-shadow: inset 0 -2px 0 var(--rv-t-accent);
}

.rv-psample--clean .rv-psample__row.is-odd {
	background: #f7f8fa;
}

.rv-psample--grid .rv-psample__row {
	gap: 0;
	padding: 0;
}

.rv-psample--grid .rv-psample__row i {
	margin: 6px 8px;
}

.rv-psample--grid .rv-psample__row > i + i {
	box-shadow: -8px 0 0 -7px #e4e7ec;
}

.rv-psample--grid .rv-psample__row.is-head {
	background: #f4f5f8;
}

.rv-psample--bold .rv-psample__row.is-head {
	padding: 8px;
	background: var(--rv-t-accent);
}

.rv-psample--bold .rv-psample__row.is-head i {
	background: rgba(255, 255, 255, 0.85);
}

.rv-psample--soft {
	gap: 4px;
	padding: 4px;
	border-color: transparent;
	background: #f2f4f7;
}

.rv-psample--soft .rv-psample__row {
	border-radius: 4px;
	background: #fff;
}

.rv-psample--soft .rv-psample__row + .rv-psample__row {
	border-top: 0;
}

.rv-mode__art {
	display: flex;
	gap: 4px;
	height: 56px;
	padding: 8px;
	border-radius: 6px;
	background: var(--rv-surface-2);
	border: 1px solid #eef0f3;
}

.rv-mode__art i {
	display: block;
	flex: 1 1 0;
	border-radius: 3px;
	background: #d0d5dd;
}

.rv-mode__art.is-scroll i:last-child {
	flex-basis: 40%;
	opacity: 0.4;
}

.rv-mode__art.is-stack {
	flex-direction: column;
}

.rv-mode__art.is-collapse i:nth-child(2) {
	opacity: 0.35;
}

.rv-mode__art.is-collapse i:nth-child(3) {
	opacity: 0.2;
}

/* Matrix tables (breakpoints, per-column flags) */
.rv-matrix {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--rv-fs-sm);
}

.rv-matrix th,
.rv-matrix td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--rv-border);
	text-align: center;
}

.rv-matrix thead th {
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 600;
	vertical-align: bottom;
}

.rv-matrix th[scope="row"],
.rv-matrix thead th:first-child {
	padding-left: 0;
	color: var(--rv-text);
	font-weight: 550;
	text-align: left;
}

.rv-matrix thead th:first-child {
	color: var(--rv-muted);
}

.rv-matrix tbody tr:last-child th,
.rv-matrix tbody tr:last-child td {
	border-bottom: 0;
}

.rv-matrix__bp,
.rv-matrix__px {
	display: block;
	white-space: nowrap;
}

.rv-matrix__px {
	color: var(--rv-muted);
	font-weight: 500;
}

/* Embed */
.rv-codebox {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 8px 8px 16px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: #0f172a;
}

.rv-codebox code {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	overflow-x: auto;
	background: none;
	color: #e2e8f0;
	font-size: var(--rv-fs-sm);
	white-space: nowrap;
}

.rv-inline-icon {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.rv-inline-icon .rv-icon {
	margin-top: 2px;
}

/* Rows of a read-only source */
.rv-source-rows {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rv-source-rows__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-accent-soft);
	color: var(--rv-text-2);
}

.rv-source-rows__head > .rv-icon {
	flex: none;
	color: var(--rv-accent-strong);
}

.rv-source-rows__note {
	flex: 1;
	margin: 0;
	font-size: var(--rv-fs);
}

/* Preview */
.rv-preview {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.rv-preview__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rv-preview__bar .rv-field {
	flex: none;
}

.rv-preview__title {
	color: var(--rv-muted);
	font-size: var(--rv-fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.rv-preview__stage {
	display: flex;
	justify-content: center;
	min-height: 200px;
	padding: 0;
	align-items: flex-start;
}

.rv-preview__fit {
	flex: none;
	/* The frame is scaled from its top left corner; keep it left-anchored in right-to-left admin too. */
	direction: ltr;
	overflow: hidden;
	border-radius: var(--rv-radius);
	box-shadow: var(--rv-shadow);
}

.rv-preview__frame {
	display: block;
	max-width: none;
	transform-origin: 0 0;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: #fff;
}

.rv-preview.is-large .rv-preview__stage {
	padding: 24px;
	border-radius: var(--rv-radius);
	background: #eceef2;
}

/* Layout builder */
.rv-builder {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

.rv-builder__body {
	display: grid;
	flex: 1 1 auto;
	grid-template-columns: minmax(0, 1fr) 320px;
	min-height: 0;
}

.rv-builder__canvas {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	background: #eceef2;
}

.rv-builder__palette {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--rv-border);
	background: var(--rv-surface-2);
}

.rv-palette__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--rv-border-strong);
	border-radius: var(--rv-radius);
	background: var(--rv-surface);
	box-shadow: var(--rv-shadow-sm);
	color: var(--rv-text-2);
	font-size: var(--rv-fs-sm);
	font-weight: 550;
	cursor: grab;
	user-select: none;
}

.rv-palette__item:hover {
	border-color: var(--rv-accent);
	color: var(--rv-accent-strong);
}

.rv-builder__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 32px;
}

.rv-root .rv-builder__table {
	margin: 0 auto;
	background: #fff;
	box-shadow: var(--rv-shadow);
}

.rv-builder__table .rv-l-cell {
	position: relative;
	cursor: pointer;
	transition: box-shadow 0.1s var(--rv-ease);
}

.rv-builder__table .rv-l-cell:hover {
	box-shadow: inset 0 0 0 1px var(--rv-border-strong);
}

.rv-builder__table .rv-l-cell.is-selected {
	box-shadow: inset 0 0 0 2px var(--rv-accent);
}

.rv-builder__table .rv-l-cell.is-drop {
	box-shadow: inset 0 0 0 2px var(--rv-accent);
	background-image: linear-gradient(var(--rv-accent-ring), var(--rv-accent-ring));
}

.rv-b-el {
	display: block;
	width: 100%;
	padding: 2px;
	margin: 0;
	border: 1px dashed transparent;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: inherit;
	cursor: grab;
}

.rv-b-el:hover {
	border-color: var(--rv-accent);
}

.rv-b-chipel {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--rv-hover);
	color: var(--rv-text-2);
	font-size: var(--rv-fs-xs);
	font-weight: 550;
}

.rv-b-chipel code {
	padding: 0;
	background: none;
	font-size: var(--rv-fs-xs);
}

.rv-b-add {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--rv-accent);
	box-shadow: var(--rv-shadow);
	color: #fff;
	cursor: pointer;
}

.rv-builder__side {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
	overflow: auto;
	background: var(--rv-surface-2);
	border-left: 1px solid var(--rv-border);
}

.rv-builder__side .rv-settings__card {
	gap: 14px;
	padding: 16px;
}

.rv-builder__side .rv-switchrow {
	padding: 4px 0;
}

.rv-builder__tip {
	padding: 0 4px;
}

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

.rv-ellist__item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 0;
}

.rv-ellist__item + .rv-ellist__item {
	border-top: 1px solid var(--rv-border);
}

.rv-ellist__item > .rv-icon {
	color: var(--rv-muted);
}

.rv-ellist__name {
	flex: 1 1 auto;
	overflow: hidden;
	color: var(--rv-text);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rv-ellist__item .rv-iconbtn {
	width: 28px;
	height: 28px;
}

.rv-iconpick {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 6px;
}

.rv-iconpick__opt {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	color: var(--rv-text-2);
	cursor: pointer;
}

.rv-iconpick__opt:hover {
	background: var(--rv-surface-2);
}

.rv-iconpick__opt.is-active,
.rv-iconpick__opt:focus-within {
	border-color: var(--rv-accent);
	box-shadow: 0 0 0 3px var(--rv-accent-ring);
	color: var(--rv-accent);
}

.rv-typegrid--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1280px) {
	.rv-editor__panel.has-preview {
		flex-direction: column;
		overflow: auto;
	}

	.rv-editor__panel.has-preview .rv-editor__main {
		flex: none;
		min-width: 0;
		overflow: visible;
		border-right: 0;
		border-bottom: 1px solid var(--rv-border);
	}

	.rv-editor__preview {
		flex: none;
		overflow: visible;
	}

	.rv-builder__body {
		grid-template-columns: minmax(0, 1fr) 280px;
	}
}

@media (max-width: 960px) {
	.rv-typegrid,
	.rv-typegrid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rv-builder__body {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: minmax(320px, 1fr) auto;
		overflow: auto;
	}

	.rv-builder__side {
		border-left: 0;
		border-top: 1px solid var(--rv-border);
		overflow: visible;
	}
}

@media (max-width: 782px) {
	.rv-root,
	.lafu-tables-screen {
		--rv-admin-bar: 46px;
		/* The two-row top bar below: 52px brand row, 48px tabs, 1px border. */
		--rv-top-h: 101px;
	}

	/* Two rows: the brand and Feedback, then the tabs across the full width, so longer translated tab names fit. */
	.rv-top {
		position: static;
		flex-wrap: wrap;
		gap: 0 16px;
		height: auto;
		padding: 0 16px;
	}

	.rv-brand {
		height: 52px;
	}

	.rv-tabs {
		order: 3;
		flex: 1 0 100%;
		height: 48px;
	}

	.rv-brand__ver {
		display: none;
	}

	.rv-tab {
		padding: 0 8px;
	}

	.rv-tab > .rv-icon {
		display: none;
	}

	/* Icon only on small screens; the name stays for screen readers. */
	.rv-feedback__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		border: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.rv-page {
		padding: 20px 16px;
	}

	.rv-page__head,
	.rv-section-head {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.rv-page__head > .rv-btn {
		align-self: flex-start;
	}

	.rv-grid2,
	.rv-grid3,
	.rv-choices,
	.rv-choices.has-4,
	.rv-modes {
		grid-template-columns: minmax(0, 1fr);
	}

	.rv-settings {
		grid-template-columns: minmax(0, 1fr);
	}

	.rv-cards {
		grid-template-columns: minmax(0, 1fr);
	}

	.rv-toolbar {
		flex-wrap: wrap;
		padding: 12px 16px;
	}

	.rv-search {
		flex: 1 1 100%;
	}

	.rv-count {
		margin-left: 0;
	}

	.rv-toolbar__pick {
		flex: 1 1 calc(50% - 8px);
		min-width: 0;
	}

	/* The list becomes stacked cards. */
	.rv-list thead {
		display: none;
	}

	.rv-list,
	.rv-list tbody,
	.rv-list tr,
	.rv-list td {
		display: block;
	}

	.rv-list tr {
		position: relative;
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: 10px 12px;
		padding: 16px;
		border-bottom: 1px solid var(--rv-border);
	}

	.rv-list tbody tr:last-child {
		border-bottom: 0;
	}

	.rv-list td {
		height: auto;
		padding: 0;
		border: 0;
	}

	.rv-list .rv-list__title {
		grid-column: 1 / -1;
		min-width: 0;
		padding-inline-end: 148px;
	}

	.rv-list td.rv-list__title {
		display: block;
	}

	.rv-list td.rv-list__pick {
		position: absolute;
		top: 26px;
		inset-inline-start: 16px;
		width: auto;
	}

	.rv-list td.rv-list__pick + .rv-list__title {
		padding-inline-start: 32px;
	}

	.rv-list td.rv-num {
		display: none;
	}

	.rv-list td.rv-list__source {
		display: none;
	}

	.rv-list td.rv-list__code {
		grid-column: 1;
	}

	.rv-list td.rv-list__date {
		grid-column: 2;
		align-self: center;
		justify-self: end;
		font-size: var(--rv-fs-sm);
	}

	.rv-list .rv-list__actions {
		position: absolute;
		top: 20px;
		inset-inline-end: 12px;
		width: auto;
	}

	.rv-list__desc {
		display: none;
	}

	.rv-gallery {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.rv-gallery__cats {
		position: static;
	}

	.rv-gallery__cats ul {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
	}

	.rv-gallery__cats .rv-sidenav__item {
		width: auto;
		min-height: 32px;
		border: 1px solid var(--rv-border);
		font-size: var(--rv-fs-sm);
	}

	.rv-gallery__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.rv-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.rv-modal,
	.rv-modal--xl {
		max-width: none;
		height: auto;
		max-height: 92vh;
		border-radius: 12px 12px 0 0;
	}

	.rv-modal__foot {
		flex-wrap: wrap;
		border-radius: 0;
	}

	.rv-modal__head {
		padding: 16px 12px 0 16px;
	}

	.rv-modal__body {
		padding: 16px;
	}

	.rv-modal__foot {
		padding: 12px 16px;
	}

	.rv-editor {
		height: auto;
		min-height: 0;
	}

	.rv-editor__head {
		flex-wrap: wrap;
		gap: 8px 12px;
		padding: 12px 16px;
	}

	.rv-editor__title {
		flex: 1 1 calc(100% - 48px);
	}

	.rv-editor__head .rv-savestate {
		flex: 1 1 auto;
	}

	.rv-root .rv-titlefield {
		width: 100%;
		font-size: var(--rv-fs-md);
	}

	.rv-editor__head .rv-grow {
		display: none;
	}

	.rv-editor__head .rv-code-chip {
		display: none;
	}

	.rv-editor__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.rv-sidenav {
		padding: 8px 12px;
		border-right: 0;
		border-bottom: 1px solid var(--rv-border);
	}

	/* At most three per row (a track is never under a third of the row); with fewer items each gets more room, so long translated names fit. */
	.rv-sidenav ul {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(max(104px, calc((100% - 8px) / 3)), 1fr));
		gap: 4px;
	}

	.rv-sidenav__item {
		justify-content: center;
		gap: 6px;
		min-height: 36px;
		padding: 0 6px;
		font-size: var(--rv-fs-sm);
	}

	.rv-sidenav__item > .rv-icon + span {
		flex: 0 1 auto;
		min-width: 0;
		overflow-wrap: anywhere;
		hyphens: auto;
	}

	.rv-sidenav__count {
		display: none;
	}

	.rv-sidenav li.is-open {
		grid-column: 1 / -1;
	}

	.rv-sidenav ul.rv-sidenav__sub {
		grid-template-columns: repeat(auto-fit, minmax(max(104px, calc((100% - 8px) / 3)), 1fr));
		margin: 4px 0 0;
		padding: 0;
		border-inline-start: 0;
	}

	.rv-sidenav__subitem {
		justify-content: center;
	}

	.rv-sidenav__subitem.is-active::before {
		display: none;
	}

	.rv-split {
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}

	.rv-split > .rv-sidenav {
		padding-top: 8px;
	}

	.rv-editor__panel.is-data .rv-editor__main {
		height: 70vh;
	}

	.rv-editor__panel.is-builder .rv-editor__main {
		overflow: visible;
	}

	.rv-panelpad {
		padding: 20px 16px 32px;
	}

	.rv-editor__preview {
		padding: 16px;
	}

	.rv-sheet__keys {
		display: none;
	}

	.rv-sheet__bar .rv-search {
		flex: 1 1 100%;
	}

	.rv-sheet__bar .rv-grow {
		display: none;
	}

	.rv-colrow {
		flex-wrap: wrap;
	}

	.rv-colrow__flags {
		display: none;
	}

	.rv-builder__scroll {
		padding: 16px;
	}

	.rv-iconpick {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.rv-toasts {
		right: 16px;
		bottom: 16px;
		left: 16px;
		align-items: stretch;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rv-root *,
	.rv-root *::before,
	.rv-root *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
