/* Design tokens */
:root {
	--color-bg: #f5f6f8;
	--color-surface: #ffffff;
	--color-surface-muted: #f0f2f6;
	--color-border: #dfe3ea;
	--color-border-strong: #c3c9d4;
	--color-text: #10182b;
	--color-text-muted: #566074;
	--color-primary: #2447d5;
	--color-primary-hover: #1a37ad;
	--color-primary-soft: #ebf0ff;
	--color-on-primary: #ffffff;
	--color-ink: #0c1633;
	--color-success: #0b7a53;
	--color-success-soft: #e5f6ee;
	--color-danger: #b42318;
	--color-danger-soft: #fdecea;
	--color-warning: #8a5a00;
	--color-warning-soft: #fff4d9;

	--font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--radius-sm: 6px;
	--radius: 10px;
	--radius-lg: 16px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 43, 0.06);
	--shadow: 0 1px 2px rgba(16, 24, 43, 0.05), 0 8px 24px rgba(16, 24, 43, 0.07);
	--shadow-lg: 0 2px 4px rgba(16, 24, 43, 0.05), 0 24px 56px rgba(16, 24, 43, 0.14);
	--width-page: 1120px;
	--width-narrow: 720px;
}

/* Base */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: 1rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: var(--color-ink);
}

p {
	margin: 0;
}

a {
	color: var(--color-primary);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--color-primary-hover);
}

:focus-visible {
	outline: 3px solid rgba(36, 71, 213, 0.45);
	outline-offset: 2px;
	border-radius: var(--radius-sm);
}

svg {
	display: block;
}

/* Components set their own display; hidden must still win. */
[hidden] {
	display: none !important;
}

.container {
	width: 100%;
	max-width: var(--width-page);
	margin: 0 auto;
	padding: 0 24px;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -48px;
	z-index: 10;
	padding: 8px 14px;
	background: var(--color-ink);
	color: #fff;
	border-radius: var(--radius-sm);
}

.skip-link:focus {
	top: 12px;
	color: #fff;
}

.muted {
	color: var(--color-text-muted);
}

/* Brand */
.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--color-ink);
	font-weight: 700;
	font-size: 1.0625rem;
	letter-spacing: -0.01em;
	text-decoration: none;
	white-space: nowrap;
}

.brand:hover {
	color: var(--color-ink);
}

.brand svg {
	width: 30px;
	height: 30px;
}

/* Buttons */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--color-primary);
	color: var(--color-on-primary);
	font: inherit;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
	background: var(--color-primary-hover);
	color: var(--color-on-primary);
}

.button-secondary {
	background: var(--color-surface);
	border-color: var(--color-border-strong);
	color: var(--color-ink);
}

.button-secondary:hover {
	background: var(--color-surface-muted);
	color: var(--color-ink);
}

.button-ghost {
	background: transparent;
	color: var(--color-ink);
}

.button-ghost:hover {
	background: var(--color-surface-muted);
	color: var(--color-ink);
}

.button-large {
	min-height: 50px;
	padding: 0 24px;
	font-size: 1rem;
}

.button-block {
	width: 100%;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 5;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--color-border);
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 64px;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 6px;
}

.nav-link {
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	color: var(--color-text-muted);
	font-weight: 500;
	font-size: 0.9375rem;
	text-decoration: none;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
	color: var(--color-ink);
	background: var(--color-surface-muted);
}

.header-start {
	display: flex;
	align-items: center;
	gap: 28px;
}

/* User menu */
.user-menu {
	position: relative;
}

.user-menu summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 10px 5px 5px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
	cursor: pointer;
	list-style: none;
	font-weight: 500;
	font-size: 0.9375rem;
}

.user-menu summary::-webkit-details-marker {
	display: none;
}

.user-menu summary:hover {
	border-color: var(--color-border-strong);
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--color-primary-soft);
	color: var(--color-primary);
	font-weight: 700;
	font-size: 0.8125rem;
	text-transform: uppercase;
}

.user-menu-name {
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.user-menu-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 260px;
	padding: 8px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.user-menu-identity {
	padding: 8px 10px 12px;
	margin-bottom: 6px;
	border-bottom: 1px solid var(--color-border);
	font-size: 0.875rem;
	overflow-wrap: anywhere;
}

.user-menu-identity strong {
	display: block;
	color: var(--color-ink);
	font-size: 0.9375rem;
}

.menu-item {
	display: block;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: var(--radius-sm);
	background: none;
	color: var(--color-text);
	font: inherit;
	font-size: 0.9375rem;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.menu-item:hover {
	background: var(--color-surface-muted);
	color: var(--color-ink);
}

/* Main areas */
main {
	flex: 1;
}

.shell-app main {
	padding: 40px 0 64px;
}

.page-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.page-header h1 {
	font-size: 1.75rem;
}

.page-header p {
	margin-top: 6px;
	color: var(--color-text-muted);
}

/* Cards */
.card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

.card-body {
	padding: 28px;
}

.card-header {
	padding: 22px 28px;
	border-bottom: 1px solid var(--color-border);
}

.card-header h2 {
	font-size: 1.125rem;
}

.card-header p {
	margin-top: 4px;
	color: var(--color-text-muted);
	font-size: 0.9375rem;
}

.card-footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 18px 28px;
	border-top: 1px solid var(--color-border);
	background: #fafbfc;
	border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stack {
	display: grid;
	gap: 24px;
}

.narrow {
	max-width: var(--width-narrow);
}

/* Definition list */
.details {
	display: grid;
	gap: 0;
	margin: 0;
}

.details > div {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--color-border);
}

.details > div:first-child {
	padding-top: 0;
}

.details > div:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.details dt {
	color: var(--color-text-muted);
	font-size: 0.9375rem;
}

.details dd {
	margin: 0;
	color: var(--color-ink);
	font-weight: 500;
	overflow-wrap: anywhere;
}

/* Forms */
.form {
	display: grid;
	gap: 18px;
}

/* A titled group of fields inside a form, separated by a rule. */
.fieldset {
	display: grid;
	gap: 18px;
	margin: 0;
	padding: 0 0 18px;
	border: 0;
	border-bottom: 1px solid var(--color-border);
}

.fieldset legend {
	margin-bottom: 12px;
	padding: 0;
	color: var(--color-ink);
	font-weight: 600;
}

.field {
	display: grid;
	gap: 6px;
}

.field label,
.label {
	color: var(--color-ink);
	font-weight: 600;
	font-size: 0.875rem;
}

.label-optional {
	color: var(--color-text-muted);
	font-weight: 400;
}

.input,
.select {
	width: 100%;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius);
	background: var(--color-surface);
	color: var(--color-text);
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover,
.select:hover {
	border-color: #9aa3b2;
}

.input:focus,
.select:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 4px rgba(36, 71, 213, 0.16);
}

.input:disabled {
	background: var(--color-surface-muted);
	border-color: var(--color-border);
	color: var(--color-text-muted);
}

.field-invalid .input,
.field-invalid .select {
	border-color: var(--color-danger);
}

.field-invalid .input:focus {
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.field-hint {
	color: var(--color-text-muted);
	font-size: 0.8125rem;
}

.field-error {
	color: var(--color-danger);
	font-size: 0.8125rem;
	font-weight: 500;
}

.field label.checkbox {
	font-weight: 400;
}

.checkbox {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
	font-size: 0.9375rem;
	color: var(--color-text);
}

.checkbox input {
	width: 18px;
	height: 18px;
	margin: 3px 0 0;
	accent-color: var(--color-primary);
}

.form-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

/* Alerts */
.alert {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-size: 0.9375rem;
}

.alert svg {
	width: 20px;
	height: 20px;
	margin-top: 1px;
}

.alert-success {
	background: var(--color-success-soft);
	border-color: #bfe6d3;
	color: #07543a;
}

.alert-danger {
	background: var(--color-danger-soft);
	border-color: #f6c9c4;
	color: #8a1c13;
}

.alert-warning {
	background: var(--color-warning-soft);
	border-color: #f3dc9c;
	color: #6b4600;
}

.alert-info {
	background: var(--color-primary-soft);
	border-color: #c9d5fb;
	color: #1a2f80;
}

.alert a {
	color: inherit;
	font-weight: 600;
}

/* Auth shell */
.shell-auth {
	background:
		radial-gradient(900px 480px at 50% -120px, rgba(36, 71, 213, 0.10), transparent 70%),
		var(--color-bg);
}

.auth-header {
	display: flex;
	justify-content: center;
	padding: 40px 24px 0;
}

.shell-auth main {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 28px 16px 48px;
}

.auth-card {
	width: 100%;
	max-width: 440px;
	padding: 36px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
}

.auth-card h1 {
	font-size: 1.5rem;
}

.auth-lead {
	margin: 8px 0 24px;
	color: var(--color-text-muted);
}

.auth-card .alert {
	margin-bottom: 20px;
}

.auth-alt {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: 0.9375rem;
	text-align: center;
}

.auth-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 18px;
	border-radius: 14px;
	background: var(--color-primary-soft);
	color: var(--color-primary);
}

.auth-icon svg {
	width: 26px;
	height: 26px;
}

.auth-icon-danger {
	background: var(--color-danger-soft);
	color: var(--color-danger);
}

.link-small {
	font-size: 0.875rem;
	font-weight: 500;
}

/* Footer */
.site-footer {
	border-top: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text-muted);
	font-size: 0.875rem;
}

.shell-auth .site-footer {
	background: transparent;
	border-top: 0;
}

.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding-top: 20px;
	padding-bottom: 20px;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 20px;
}

.footer-links a {
	color: var(--color-text-muted);
	text-decoration: none;
}

.footer-links a:hover {
	color: var(--color-ink);
	text-decoration: underline;
}

.language-switch {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
}

.language-switch a {
	padding: 3px 10px;
	border-radius: 999px;
	color: var(--color-text-muted);
	font-weight: 600;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

.language-switch a:hover {
	text-decoration: none;
}

.language-switch a[aria-current="true"] {
	background: var(--color-ink);
	color: #fff;
}

/* Landing */
.hero {
	background:
		radial-gradient(760px 420px at 85% 0, rgba(36, 71, 213, 0.13), transparent 70%),
		linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
	border-bottom: 1px solid var(--color-border);
}

.hero .container {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	align-items: center;
	gap: 56px;
	padding-top: 72px;
	padding-bottom: 80px;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--color-primary-soft);
	color: var(--color-primary);
	font-weight: 600;
	font-size: 0.8125rem;
}

.hero h1 {
	font-size: clamp(2.125rem, 4.6vw, 3.375rem);
	letter-spacing: -0.03em;
	line-height: 1.08;
}

.hero-lead {
	margin-top: 20px;
	max-width: 34rem;
	color: var(--color-text-muted);
	font-size: 1.1875rem;
	line-height: 1.6;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}

.hero-note {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
	color: var(--color-text-muted);
	font-size: 0.9375rem;
}

.hero-note svg {
	width: 18px;
	height: 18px;
	color: var(--color-success);
	flex: none;
}

.hero-visual {
	position: relative;
	padding: 0 12px;
}

.hero-visual svg {
	width: 100%;
	height: auto;
	filter: drop-shadow(0 24px 40px rgba(16, 24, 43, 0.16));
}

.section {
	padding: 80px 0;
}

.section-alt {
	background: var(--color-surface);
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}

.section-heading {
	max-width: 42rem;
	margin-bottom: 44px;
}

.section-heading h2 {
	font-size: clamp(1.625rem, 3vw, 2.125rem);
	letter-spacing: -0.02em;
}

.section-heading p {
	margin-top: 12px;
	color: var(--color-text-muted);
	font-size: 1.0625rem;
}

.grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}

.step {
	padding: 28px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-bottom: 18px;
	border-radius: 10px;
	background: var(--color-ink);
	color: #fff;
	font-weight: 700;
	font-size: 0.9375rem;
}

.step h3,
.feature h3 {
	margin-bottom: 8px;
	font-size: 1.125rem;
}

.step p,
.feature p {
	color: var(--color-text-muted);
}

.feature {
	padding: 32px;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.feature-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-bottom: 18px;
	border-radius: 12px;
	background: var(--color-primary-soft);
	color: var(--color-primary);
}

.feature-icon svg {
	width: 22px;
	height: 22px;
}

.feature-note {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px dashed var(--color-border-strong);
	font-size: 0.875rem;
}

.check-list {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.check-list li {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 12px;
	color: var(--color-text);
}

.check-list svg {
	width: 22px;
	height: 22px;
	color: var(--color-success);
}

.split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 56px;
}

.split .section-heading {
	margin-bottom: 0;
}

.cta {
	padding: 72px 0;
	background: var(--color-ink);
	color: #c9d1e6;
	text-align: center;
}

.cta h2 {
	color: #fff;
	font-size: clamp(1.625rem, 3vw, 2.125rem);
}

.cta p {
	max-width: 34rem;
	margin: 12px auto 28px;
	font-size: 1.0625rem;
}

.cta .button {
	background: #fff;
	color: var(--color-ink);
}

.cta .button:hover {
	background: #e8ecf7;
	color: var(--color-ink);
}

/* Error page */
.error-page {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 96px 24px;
	text-align: center;
}

.error-code {
	color: var(--color-primary);
	font-weight: 700;
	font-size: 0.9375rem;
	letter-spacing: 0.08em;
}

.error-page h1 {
	margin-top: 10px;
	font-size: 2rem;
}

.error-page p {
	max-width: 30rem;
	margin: 12px 0 28px;
	color: var(--color-text-muted);
}

/* Utilities */
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.button svg {
	width: 18px;
	height: 18px;
	flex: none;
}

.button-small {
	min-height: 34px;
	padding: 0 12px;
	font-size: 0.875rem;
}

.button-icon {
	min-width: 42px;
	padding: 0 10px;
}

.button-small.button-icon {
	min-width: 34px;
	padding: 0 8px;
}

.button-danger {
	background: var(--color-danger);
}

.button-danger:hover {
	background: #8f1c13;
}

.button-danger-ghost {
	justify-self: start;
	padding: 0 10px;
	background: transparent;
	border-color: transparent;
	color: var(--color-danger);
}

.button-danger-ghost:hover {
	background: var(--color-danger-soft);
	color: #8f1c13;
}

.button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.input-small {
	min-height: 36px;
	font-size: 0.9375rem;
}

.card-title {
	margin-bottom: 8px;
	font-size: 1.375rem;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	color: var(--color-text-muted);
	font-weight: 500;
	font-size: 0.875rem;
	text-decoration: none;
}

.back-link svg {
	width: 16px;
	height: 16px;
}

.back-link:hover {
	color: var(--color-ink);
}

.page-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.usage-pill {
	padding: 6px 12px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
	color: var(--color-text-muted);
	font-weight: 500;
	font-size: 0.8125rem;
}

.chip {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--color-surface-muted);
	color: var(--color-text-muted);
	font-weight: 600;
	font-size: 0.75rem;
	white-space: nowrap;
}

.chip-ready {
	background: var(--color-success-soft);
	color: var(--color-success);
}

.chip-processing {
	background: var(--color-primary-soft);
	color: var(--color-primary);
}

.chip-rejected {
	background: var(--color-danger-soft);
	color: var(--color-danger);
}

.spinner {
	display: inline-block;
	width: 22px;
	height: 22px;
	border: 3px solid var(--color-primary-soft);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Dashboard */
.dashboard-grid {
	display: grid;
	gap: 24px;
	align-items: start;
}

.dashboard-grid .card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.dashboard-grid .card-footer {
	margin-top: auto;
}

.metric {
	color: var(--color-ink);
	font-weight: 700;
	font-size: 2.25rem;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.dashboard-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-wide {
	grid-column: 1 / -1;
}

.dashboard-grid .card-footer {
	justify-content: flex-start;
}

/* Lists, tables and toolbars */
.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-bottom: 20px;
}

.tabs {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
}

.tab {
	padding: 6px 12px;
	border-radius: var(--radius-sm);
	color: var(--color-text-muted);
	font-weight: 500;
	font-size: 0.875rem;
	text-decoration: none;
}

.tab:hover {
	background: var(--color-surface-muted);
	color: var(--color-ink);
}

.tab[aria-current="page"] {
	background: var(--color-ink);
	color: #fff;
}

.search .input {
	width: 280px;
	min-height: 40px;
}

.table-card {
	overflow-x: auto;
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.table th {
	padding: 12px 16px;
	border-bottom: 1px solid var(--color-border);
	background: #fafbfc;
	color: var(--color-text-muted);
	font-weight: 600;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}

.table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--color-border);
	vertical-align: middle;
}

.table tbody tr:last-child td {
	border-bottom: 0;
}

.table tbody tr:hover {
	background: #fafbfc;
}

.table .numeric {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.cell-main a {
	color: var(--color-ink);
	font-weight: 600;
	text-decoration: none;
}

.cell-main a:hover {
	text-decoration: underline;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 20px;
}

.plain-list {
	margin: 4px 0 8px;
	padding-left: 18px;
}

.title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.button-row {
	display: flex;
	gap: 8px;
}

.pre-line {
	white-space: pre-line;
}

.stack-sm {
	display: grid;
	gap: 16px;
}

.textarea {
	min-height: 96px;
	padding-top: 10px;
	padding-bottom: 10px;
	resize: vertical;
	line-height: 1.5;
}

.input-date {
	max-width: 220px;
}

.card-footer-split {
	align-items: center;
	justify-content: space-between;
}

.stack-gap {
	margin-bottom: 20px;
}

.steps-list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps-list li {
	position: relative;
	display: grid;
	gap: 4px;
	justify-items: start;
	padding: 18px 28px 18px 72px;
	border-bottom: 1px solid var(--color-border);
	counter-increment: step;
}

.steps-list li:last-child {
	border-bottom: 0;
}

.steps-list li::before {
	content: counter(step);
	position: absolute;
	top: 18px;
	left: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--color-ink);
	color: #fff;
	font-weight: 700;
	font-size: 0.875rem;
}

.steps-list strong {
	color: var(--color-ink);
}

.steps-list .button {
	margin-top: 6px;
}

.table-compact th,
.table-compact td {
	padding: 10px 12px;
	font-size: 0.875rem;
}

.row-invalid td {
	background: #fff8f7;
}

.table-compact td {
	white-space: nowrap;
}

.table-compact td:last-child {
	min-width: 280px;
	white-space: normal;
}

/* Keep the outcome of each row in view while scrolling through wide spreadsheets. */
.table-compact th:last-child,
.table-compact td:last-child {
	position: sticky;
	right: 0;
	background: var(--color-surface);
	box-shadow: -1px 0 0 var(--color-border);
}

.table-compact th:last-child {
	background: #fafbfc;
}

.table-compact .row-invalid td:last-child {
	background: #fff8f7;
}

.row-errors {
	margin: 0;
	padding-left: 16px;
	color: var(--color-danger);
	font-size: 0.8125rem;
}

/* Status chips of requests and signers */
.chip-in_progress,
.chip-signer-pending {
	background: var(--color-primary-soft);
	color: var(--color-primary);
}

.chip-completed,
.chip-signer-signed {
	background: var(--color-success-soft);
	color: var(--color-success);
}

.chip-declined,
.chip-signer-declined {
	background: var(--color-danger-soft);
	color: var(--color-danger);
}

.chip-cancelled,
.chip-expired,
.chip-signer-waiting {
	background: var(--color-surface-muted);
	color: var(--color-text-muted);
}

/* Choosing a template */
.choice-list {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.choice {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 16px 20px;
	color: var(--color-text);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.choice:hover {
	border-color: var(--color-primary);
	box-shadow: var(--shadow);
	color: var(--color-text);
}

.choice.is-disabled {
	opacity: 0.6;
}

.choice-text {
	display: grid;
	gap: 2px;
}

.choice-text strong {
	color: var(--color-ink);
}

.choice-arrow {
	color: var(--color-primary);
	font-size: 1.25rem;
}

/* Signers */
.signer-row {
	margin: 0;
	padding: 0 0 16px;
	border: 0;
	border-bottom: 1px solid var(--color-border);
}

.signer-row:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.signer-row legend {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	padding: 0;
	color: var(--color-ink);
	font-weight: 600;
}

.signer-fields {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(120px, 0.7fr);
	gap: 12px;
}

.signer-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: var(--role-soft);
	color: var(--role);
	font-weight: 700;
	font-size: 0.8125rem;
}

.signer-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.signer-item {
	display: grid;
	grid-template-columns: 26px 1fr auto;
	gap: 14px;
	align-items: center;
	padding: 16px 28px;
	border-bottom: 1px solid var(--color-border);
}

.signer-item:last-child {
	border-bottom: 0;
}

.signer-text {
	display: grid;
	gap: 2px;
	min-width: 0;
	overflow-wrap: anywhere;
}

.signer-text strong {
	color: var(--color-ink);
}

.signer-text .muted {
	font-size: 0.875rem;
}

/* Request detail */
.detail-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.details-compact > div {
	grid-template-columns: 110px 1fr;
}

.history-integrity {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--color-success) !important;
	font-size: 0.8125rem !important;
}

.history-integrity svg {
	width: 16px;
	height: 16px;
}

.history-integrity.is-broken {
	color: var(--color-danger) !important;
}

.timeline {
	margin: 0;
	padding: 8px 28px 20px;
	list-style: none;
}

.timeline li {
	position: relative;
	display: grid;
	gap: 2px;
	padding: 12px 0 12px 22px;
	border-left: 2px solid var(--color-border);
	font-size: 0.9375rem;
}

.timeline li::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 17px;
	width: 10px;
	height: 10px;
	border: 2px solid var(--color-surface);
	border-radius: 50%;
	background: var(--color-primary);
}

.timeline .muted {
	font-size: 0.8125rem;
	overflow-wrap: anywhere;
}

@media (max-width: 900px) {
	.detail-grid,
	.dashboard-grid {
		grid-template-columns: 1fr;
	}

	.signer-fields {
		grid-template-columns: 1fr;
	}

	.search,
	.search .input {
		width: 100%;
	}
}

/* Empty state */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 56px 24px;
	text-align: center;
}

.empty-state-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 18px;
	border-radius: 16px;
	background: var(--color-primary-soft);
	color: var(--color-primary);
}

.empty-state-icon svg {
	width: 28px;
	height: 28px;
}

.empty-state h2 {
	font-size: 1.25rem;
}

.empty-state p {
	max-width: 30rem;
	margin: 8px 0 24px;
	color: var(--color-text-muted);
}

/* Template list */
.template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.template-card {
	display: flex;
	flex-direction: column;
}

.template-card-body {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	gap: 14px;
	align-items: start;
	padding: 22px 22px 16px;
}

.template-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--color-surface-muted);
	color: var(--color-ink);
}

.template-card-icon svg {
	width: 20px;
	height: 20px;
}

.template-card-text {
	min-width: 0;
}

.template-card-text h2 {
	font-size: 1.0625rem;
	overflow-wrap: anywhere;
}

.template-card-text h2 a {
	color: var(--color-ink);
	text-decoration: none;
}

.template-card-text h2 a:hover {
	text-decoration: underline;
}

.template-card-text p {
	margin-top: 2px;
	overflow: hidden;
	font-size: 0.875rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.template-card-facts {
	display: flex;
	gap: 24px;
	margin: 0;
	padding: 0 22px 18px 76px;
}

.template-card-facts dt {
	color: var(--color-text-muted);
	font-size: 0.75rem;
}

.template-card-facts dd {
	margin: 0;
	color: var(--color-ink);
	font-weight: 600;
}

.template-card-actions {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
	padding: 14px 22px;
	border-top: 1px solid var(--color-border);
}

/* Upload */
.file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 28px 16px;
	border: 1.5px dashed var(--color-border-strong);
	border-radius: var(--radius);
	background: var(--color-surface-muted);
	color: var(--color-text-muted);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field label.dropzone {
	font-weight: 400;
}

.dropzone svg {
	width: 26px;
	height: 26px;
	color: var(--color-primary);
}

.dropzone:hover,
.dropzone.is-dragover,
.dropzone:has(+ .file-input:focus-visible) {
	border-color: var(--color-primary);
	background: var(--color-primary-soft);
}

.dropzone-title {
	color: var(--color-ink);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.dropzone-hint {
	font-size: 0.8125rem;
}

.field-invalid .dropzone {
	border-color: var(--color-danger);
}

/* Status pages */
.status-panel {
	margin: 40px auto 0;
}

.status-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 48px 32px;
	text-align: center;
}

.status-card .spinner {
	width: 34px;
	height: 34px;
	margin-bottom: 18px;
}

/* Template editor */
.full-screen {
	height: 100vh;
	overflow: hidden;
}

.full-screen main {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 0;
}

.editor {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.editor-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
}

.editor-name {
	flex: 1;
	max-width: 520px;
	min-height: 40px;
	border-color: transparent;
	background: transparent;
	color: var(--color-ink);
	font-weight: 600;
	font-size: 1.0625rem;
}

.editor-name:hover {
	border-color: var(--color-border);
}

.editor-status {
	margin-left: auto;
	color: var(--color-text-muted);
	font-size: 0.875rem;
	white-space: nowrap;
}

.editor-status.is-unsaved {
	color: var(--color-warning);
}

.editor-status.is-saved {
	color: var(--color-success);
}

.editor-errors {
	margin: 12px 20px 0;
}

.editor-errors ul {
	margin: 0;
	padding-left: 18px;
}

.editor-body {
	display: grid;
	flex: 1;
	grid-template-columns: 264px minmax(0, 1fr) 288px;
	min-height: 0;
}

.editor-sidebar,
.editor-inspector {
	overflow-y: auto;
	background: var(--color-surface);
}

.editor-sidebar {
	border-right: 1px solid var(--color-border);
}

.editor-inspector {
	border-left: 1px solid var(--color-border);
}

.editor-section {
	padding: 20px;
	border-bottom: 1px solid var(--color-border);
}

.editor-inspector .editor-section {
	border-bottom: 0;
}

.editor-section h2 {
	margin-bottom: 4px;
	color: var(--color-text-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.editor-inspector .form {
	gap: 16px;
}

.editor-hint {
	margin: 4px 0 12px;
	color: var(--color-text-muted);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.role-list {
	display: grid;
	gap: 8px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.role-item {
	display: grid;
	grid-template-columns: 12px 1fr auto;
	align-items: center;
	gap: 8px;
}

.role-swatch {
	width: 12px;
	height: 12px;
	border-radius: 4px;
	background: var(--role);
}

.palette {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.palette-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 6px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface);
	color: var(--color-ink);
	font: inherit;
	font-weight: 500;
	font-size: 0.8125rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.palette-item svg {
	width: 20px;
	height: 20px;
	color: var(--color-primary);
}

.palette-item:hover {
	border-color: var(--color-primary);
	background: var(--color-primary-soft);
}

.check-items {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.check-item {
	position: relative;
	padding-left: 18px;
	color: var(--color-warning);
	font-size: 0.8125rem;
	line-height: 1.45;
}

.check-item::before {
	content: "";
	position: absolute;
	top: 6px;
	left: 2px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.check-item.is-ok {
	color: var(--color-success);
}

.editor-canvas {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	padding: 32px 40px 64px;
	overflow-y: auto;
	background: #e9ecf1;
}

.editor-loading {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 40px;
	color: var(--color-text-muted);
}

.pdf-page {
	position: relative;
	flex: none;
	width: 100%;
	max-width: 860px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 43, 0.12), 0 8px 24px rgba(16, 24, 43, 0.08);
}

.pdf-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.pdf-overlay {
	position: absolute;
	inset: 0;
}

.pdf-page-number {
	position: absolute;
	right: 0;
	bottom: -22px;
	color: var(--color-text-muted);
	font-size: 0.75rem;
}

/* Colours of the signers, used by fields and swatches */
.role-colour-0 {
	--role: #2447d5;
	--role-soft: rgba(36, 71, 213, 0.12);
}

.role-colour-1 {
	--role: #7c3aed;
	--role-soft: rgba(124, 58, 237, 0.12);
}

.role-colour-2 {
	--role: #0f8b8d;
	--role-soft: rgba(15, 139, 141, 0.13);
}

.role-colour-3 {
	--role: #c2570c;
	--role-soft: rgba(194, 87, 12, 0.12);
}

.role-colour-4 {
	--role: #be185d;
	--role-soft: rgba(190, 24, 93, 0.11);
}

.role-colour-5 {
	--role: #4d7c0f;
	--role-soft: rgba(77, 124, 15, 0.13);
}

.role-sender {
	--role: #566074;
	--role-soft: rgba(86, 96, 116, 0.12);
}

.tf-field {
	position: absolute;
	display: flex;
	align-items: center;
	min-width: 6px;
	min-height: 6px;
	padding: 0 6px;
	border: 1.5px solid var(--role);
	border-radius: 4px;
	background: var(--role-soft);
	color: var(--role);
	font-weight: 600;
	font-size: 0.75rem;
	line-height: 1.1;
	cursor: move;
	touch-action: none;
	user-select: none;
}

.tf-field.role-sender {
	border-style: dashed;
}

.tf-field:focus-visible {
	outline: none;
}

.tf-field.is-selected {
	z-index: 2;
	box-shadow: 0 0 0 3px var(--role-soft), 0 2px 8px rgba(16, 24, 43, 0.18);
}

.tf-field.is-dragging {
	opacity: 0.85;
}

.tf-field.is-small {
	justify-content: center;
	padding: 0;
}

.tf-field.is-small .tf-field-label {
	display: none;
}

.tf-field-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
}

.tf-handle {
	position: absolute;
	right: -6px;
	bottom: -6px;
	width: 12px;
	height: 12px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--role);
	cursor: nwse-resize;
	opacity: 0;
}

.tf-field.is-selected .tf-handle,
.tf-field:hover .tf-handle {
	opacity: 1;
}

@media (max-width: 1100px) {
	.editor-body {
		grid-template-columns: 220px minmax(0, 1fr) 240px;
	}

	.editor-canvas {
		padding: 24px 20px 56px;
	}
}

@media (max-width: 820px) {
	.full-screen {
		height: auto;
		overflow: visible;
	}

	.editor-body {
		grid-template-columns: 1fr;
	}

	.editor-sidebar,
	.editor-inspector {
		border: 0;
		border-bottom: 1px solid var(--color-border);
	}

	.editor-canvas {
		max-height: 75vh;
	}

	.editor-bar {
		flex-wrap: wrap;
	}
}

/* Signing */
.shell-signer {
	background: var(--color-bg);
}

.signer-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--color-success);
	font-weight: 600;
	font-size: 0.8125rem;
}

.signer-badge svg {
	width: 18px;
	height: 18px;
}

.signing {
	padding: 28px 0 64px;
}

.sign-intro {
	margin-bottom: 24px;
}

.sign-from {
	margin-bottom: 6px;
	color: var(--color-primary);
	font-weight: 600;
	font-size: 0.875rem;
}

.sign-intro h1 {
	font-size: clamp(1.5rem, 3vw, 1.875rem);
}

.sign-intro > .muted {
	margin-top: 6px;
}

.sender-note {
	max-width: 44rem;
	margin: 16px 0 0;
	padding: 12px 16px;
	border-left: 3px solid var(--color-border-strong);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--color-surface);
	white-space: pre-line;
}

.sign-progress {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
}

.sign-progress li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.sign-progress li.is-current {
	font-weight: 600;
}

.sign-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 28px;
	align-items: start;
}

.sign-document {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	padding: 24px;
	border-radius: var(--radius-lg);
	background: #e9ecf1;
}

.sign-panel {
	position: sticky;
	top: 88px;
	max-height: calc(100vh - 110px);
	overflow-y: auto;
}

.sign-actions {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	text-align: center;
}

.sign-auto {
	color: var(--color-text-muted);
	font-size: 0.875rem;
}

.sign-narrow {
	margin: 24px auto 0;
	max-width: 480px;
}

.sign-legal {
	text-align: center;
}

.input-code {
	min-height: 56px;
	font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
	font-size: 1.75rem;
	letter-spacing: 0.4em;
	text-align: center;
}

.accept-box {
	padding: 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-surface-muted);
}

.auth-icon-success {
	background: var(--color-success-soft);
	color: var(--color-success);
}

/* Fields on the signer's document */
.sf-field {
	position: absolute;
	display: flex;
	align-items: center;
	overflow: hidden;
	padding: 0 4px;
	border-radius: 3px;
	container-type: size;
	font: inherit;
	text-align: left;
}

.sf-field.is-mine {
	border: 1.5px dashed var(--color-primary);
	background: rgba(36, 71, 213, 0.08);
	color: var(--color-primary);
	cursor: pointer;
}

.sf-field.is-mine:hover,
.sf-field.is-mine.is-active {
	background: rgba(36, 71, 213, 0.16);
}

.sf-field.is-mine.is-filled {
	border-style: solid;
	border-color: rgba(36, 71, 213, 0.35);
	background: rgba(36, 71, 213, 0.04);
	color: var(--color-ink);
}

.sf-field.is-other {
	border: 1px solid var(--color-border-strong);
	background: rgba(240, 242, 246, 0.85);
	color: var(--color-text-muted);
}

.sf-content {
	overflow: hidden;
	width: 100%;
	font-size: clamp(7px, 62cqh, 16px);
	line-height: 1.1;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sf-signature .sf-content,
.sf-checkbox .sf-content {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	text-align: center;
}

.sf-signature .sf-content img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.signature-typed {
	font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", "Snell Roundhand", cursive;
	color: var(--color-ink);
}

.sf-signature .signature-typed {
	font-size: clamp(8px, 70cqh, 28px);
}

/* Signature preview and dialog */
.signature-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 84px;
	padding: 10px;
	border: 1px dashed var(--color-border-strong);
	border-radius: var(--radius);
	background: var(--color-surface);
}

.signature-preview img {
	max-width: 100%;
	max-height: 72px;
}

.signature-preview .signature-typed {
	font-size: 1.75rem;
}

.signature-preview.has-signature .signature-empty,
.signature-preview:not(.has-signature) .signature-typed {
	display: none;
}

.signature-saved {
	color: var(--color-success);
	font-weight: 600;
	font-size: 0.875rem;
}

.signature-dialog {
	width: min(640px, calc(100vw - 24px));
	padding: 0;
	border: 0;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}

.signature-dialog::backdrop {
	background: rgba(12, 22, 51, 0.45);
}

.signature-dialog-body {
	display: grid;
	gap: 16px;
	padding: 24px;
}

.signature-dialog-body h2 {
	font-size: 1.25rem;
}

.signature-dialog .tab[aria-selected="true"] {
	background: var(--color-ink);
	color: #fff;
}

.signature-dialog .tab {
	border: 0;
	background: none;
	font: inherit;
	font-weight: 500;
	font-size: 0.875rem;
	cursor: pointer;
}

.signature-pad {
	display: block;
	width: 100%;
	height: 200px;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius);
	background:
		linear-gradient(transparent calc(100% - 48px), var(--color-border) calc(100% - 48px), var(--color-border) calc(100% - 47px), transparent calc(100% - 47px)),
		#fff;
	cursor: crosshair;
	touch-action: none;
}

.signature-pad.is-empty {
	border-color: var(--color-danger);
}

.signature-pad-actions,
.signature-dialog-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 8px;
}

.signature-dialog-actions {
	justify-content: flex-end;
}

.signature-typed-large {
	min-height: 64px;
	margin-top: 12px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--color-border-strong);
	font-size: 2.25rem;
	line-height: 1.3;
}

@media (max-width: 960px) {
	.sign-layout {
		grid-template-columns: 1fr;
	}

	.sign-panel {
		position: static;
		max-height: none;
	}

	.sign-document {
		padding: 12px;
	}
}

/* Responsive */
@media (max-width: 900px) {
	.hero .container,
	.split {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.hero .container {
		padding-top: 48px;
		padding-bottom: 56px;
	}

	.grid-3,
	.grid-2 {
		grid-template-columns: 1fr;
	}

	.section {
		padding: 56px 0;
	}
}

@media (max-width: 600px) {
	.container {
		padding: 0 16px;
	}

	.auth-card {
		padding: 28px 22px;
	}

	.card-body,
	.card-header,
	.card-footer {
		padding-left: 20px;
		padding-right: 20px;
	}

	.details > div {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.user-menu-name,
	.nav-optional {
		display: none;
	}

	.header-start {
		gap: 12px;
	}

	.hero-actions .button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	* {
		transition: none !important;
	}
}

/* Verification page */
.verify-page {
	padding-block: 40px 64px;
}

.verify-page h1 {
	margin-bottom: 8px;
}

.verify-heading {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

.verify-heading .auth-icon {
	flex: none;
	margin-bottom: 0;
}

.verify-heading h2 {
	margin: 0 0 4px;
	font-size: 1.125rem;
}

.verify-heading p {
	margin: 0;
}

.verify-result.is-valid {
	border-color: #bfe6d3;
}

.verify-result.is-unknown {
	border-color: #f3dc9c;
}

.verify-result.is-unknown .auth-icon {
	background: var(--color-warning-soft);
	color: var(--color-warning);
}

.verify-signer {
	display: block;
}

.verify-reasons {
	margin: 0;
	padding-left: 20px;
}

.mono {
	font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
	overflow-wrap: anywhere;
}

.verify-hash {
	margin: -8px 0 0;
	font-size: 0.75rem;
}

/* Exports in settings */
.export-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.export-list li {
	display: flex;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	padding: 14px 28px;
	border-top: 1px solid var(--color-border);
}

.export-list li > span {
	display: grid;
	gap: 2px;
}

/* Account closure */
.closure-banner {
	padding: 10px 0;
	background: var(--color-danger-soft);
	color: #8a1c13;
	font-size: 0.9375rem;
}

.closure-banner .container {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	align-items: center;
	justify-content: space-between;
}

.closure-banner a {
	color: inherit;
	font-weight: 600;
}

.closure-list {
	display: grid;
	gap: 6px;
	margin: 0;
	padding-left: 20px;
	color: var(--color-text-muted, inherit);
}

/* Back office */
.admin-badge {
	padding: 3px 10px;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.admin-identity {
	display: flex;
	gap: 12px;
	align-items: center;
	font-size: 0.875rem;
}

.shell-admin .nav-link,
.admin-badge {
	white-space: nowrap;
}

.admin-email {
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 1100px) {
	.admin-email {
		display: none;
	}
}

.shell-admin .auth-card {
	margin: 48px auto;
}

.auth-card-wide {
	max-width: 560px;
}

.setup-authenticator {
	display: grid;
	grid-template-columns: 168px 1fr;
	gap: 20px;
	align-items: center;
}

.qr-code {
	display: block;
	width: 168px;
	height: 168px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.setup-secret {
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
}

.stack-small {
	display: grid;
	gap: 6px;
}

.stack-small p {
	margin: 0;
}

.link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-primary);
	font: inherit;
	cursor: pointer;
}

.link-button:hover {
	text-decoration: underline;
}

.admin-details {
	display: block;
	font-size: 0.75rem;
	color: var(--color-text-muted);
}

.chip-admin-active {
	background: var(--color-success-soft);
	color: var(--color-success);
}

.chip-admin-suspended,
.chip-admin-closing {
	background: var(--color-warning-soft);
	color: var(--color-warning);
}

.chip-admin-closed {
	background: var(--color-surface-muted);
	color: var(--color-text-muted);
}

@media (max-width: 560px) {
	.setup-authenticator {
		grid-template-columns: 1fr;
	}
}

/* Plans in the back office */
.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}

.card-header-split {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	justify-content: space-between;
}

.inline-form {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
}

.inline-form .input {
	min-width: 140px;
}

.plans-table td,
.plans-table th {
	white-space: nowrap;
}

.plans-table .version-cell {
	display: flex;
	gap: 8px;
	align-items: center;
}

.plans-table .small {
	font-size: 0.8125rem;
}

.retry-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

.retry-form .input {
	min-width: 140px;
}

.failed-job-error {
	font-size: 0.8125rem;
	color: var(--color-danger);
	word-break: break-word;
	max-width: 480px;
}

.failed-job-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
}

.chip-resolved {
	background: var(--color-success-soft);
	color: var(--color-success);
}

@media (max-width: 1100px) {
	.shell-admin .header-start {
		gap: 16px;
	}
	.shell-admin .site-nav {
		gap: 2px;
	}
	.shell-admin .nav-link {
		padding: 6px 8px;
		font-size: 0.875rem;
	}
}
