/* eScan : feuille de style de l'application */

:root {
	--bg: #f5f6fa;
	--surface: #ffffff;
	--surface-2: #f0f2f7;
	--border: #e3e6ee;
	--text: #121726;
	--text-2: #545d73;
	--text-3: #8a92a6;
	--brand: #0b1020;
	--accent: #14b8a6;
	--accent-2: #6366f1;
	--accent-soft: #e6f7f5;
	--grad: linear-gradient(135deg, #14b8a6 0%, #3b82f6 55%, #6366f1 100%);
	--success: #16a34a;
	--success-soft: #e8f6ee;
	--danger: #e11d48;
	--danger-soft: #fdecef;
	--warn: #d97706;
	--warn-soft: #fdf3e3;
	--info: #2563eb;
	--info-soft: #e9f0fd;
	--ignored: #c3c8d4;
	--radius: 14px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
	--shadow-lg: 0 20px 60px rgba(11, 16, 32, 0.25);
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--nav-h: 72px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0e1a;
		--surface: #121829;
		--surface-2: #1a2136;
		--border: #262f48;
		--text: #eef1f8;
		--text-2: #a9b1c6;
		--text-3: #737c93;
		--accent-soft: rgba(20, 184, 166, 0.14);
		--success-soft: rgba(22, 163, 74, 0.16);
		--danger-soft: rgba(225, 29, 72, 0.16);
		--warn-soft: rgba(217, 119, 6, 0.16);
		--info-soft: rgba(37, 99, 235, 0.16);
		--ignored: #3b4560;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
		color-scheme: dark;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body.escan-body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

h1 {
	font-size: 1.65rem;
	font-weight: 750;
}

h2 {
	font-size: 1.1rem;
	font-weight: 700;
}

h3 {
	font-size: 1rem;
	font-weight: 650;
}

p {
	margin: 0;
}

a {
	color: inherit;
}

img {
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

[hidden] {
	display: none !important;
}

.icon {
	display: inline-flex;
	width: 1.15em;
	height: 1.15em;
	flex: none;
}

.icon svg {
	width: 100%;
	height: 100%;
}

.muted {
	color: var(--text-2);
}

.small {
	font-size: 0.85rem;
}

.mono {
	font-family: var(--mono);
	font-size: 0.85em;
}

.pre {
	white-space: pre-line;
}

.error {
	color: var(--danger);
	padding: 16px;
}

.clickable {
	cursor: pointer;
}

.stack {
	display: grid;
	gap: 16px;
}

.stack-sm {
	display: grid;
	gap: 8px;
}

.escan-noscript {
	padding: 24px;
	text-align: center;
}

/* Démarrage */

.escan-boot {
	min-height: 100vh;
	display: grid;
	place-items: center;
	background: var(--brand);
}

.boot-logo img {
	animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
	50% {
		transform: scale(0.92);
		opacity: 0.7;
	}
}

/* Boutons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 16px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
	position: relative;
}

.btn:active {
	transform: translateY(1px);
}

.btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--brand);
	color: #fff;
	box-shadow: 0 2px 8px rgba(11, 16, 32, 0.18);
}

@media (prefers-color-scheme: dark) {
	.btn-primary {
		background: var(--grad);
	}
}

.btn-primary:hover:not(:disabled) {
	box-shadow: 0 4px 16px rgba(11, 16, 32, 0.25);
}

.btn-secondary {
	background: var(--accent-soft);
	color: #0f766e;
	border-color: rgba(20, 184, 166, 0.25);
}

@media (prefers-color-scheme: dark) {
	.btn-secondary {
		color: #5eead4;
	}
}

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

.btn-ghost:hover:not(:disabled) {
	background: var(--surface-2);
}

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

.btn-danger-ghost {
	background: transparent;
	color: var(--danger);
	border-color: var(--border);
}

.btn-sm {
	min-height: 34px;
	padding: 0 12px;
	font-size: 0.85rem;
	border-radius: 9px;
}

.btn-lg {
	min-height: 52px;
	font-size: 1rem;
	border-radius: 12px;
}

.btn-block {
	width: 100%;
}

.btn.is-busy > * {
	opacity: 0;
}

.btn.is-busy::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 9px;
	border: 0;
	background: transparent;
	color: var(--text-2);
	cursor: pointer;
	text-decoration: none;
}

.icon-btn:hover {
	background: var(--surface-2);
	color: var(--text);
}

.link {
	color: var(--accent-2);
	font-weight: 600;
	text-decoration: none;
}

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

/* Formulaires */

.field {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.field-label {
	font-size: 0.82rem;
	font-weight: 650;
	color: var(--text-2);
}

.field-hint {
	font-size: 0.8rem;
	color: var(--text-3);
}

.field-row {
	display: grid;
	grid-template-columns: 1fr 90px;
	gap: 10px;
}

.input,
.select {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input {
	resize: vertical;
	min-height: 70px;
}

.input:focus,
.select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.15);
}

.input:disabled,
.select:disabled {
	background: var(--surface-2);
	color: var(--text-2);
}

.select {
	appearance: none;
	padding-right: 34px;
	background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
	background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
	background-size: 5px 5px;
	background-repeat: no-repeat;
}

.select-sm {
	min-height: 36px;
	padding-top: 6px;
	padding-bottom: 6px;
	background-position: calc(100% - 18px) 15px, calc(100% - 13px) 15px;
	width: auto;
}

.input-group {
	position: relative;
}

.input-group .input {
	padding-right: 46px;
}

.input-addon {
	position: absolute;
	right: 4px;
	top: 4px;
	width: 38px;
	height: 36px;
	border: 0;
	background: transparent;
	color: var(--text-3);
	border-radius: 8px;
	cursor: pointer;
	display: grid;
	place-items: center;
}

.check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 0.92rem;
}

.check input {
	width: 18px;
	height: 18px;
	accent-color: var(--accent);
}

.form-grid {
	display: grid;
	gap: 14px;
}

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

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

.form-grid .form-actions,
.form-grid.two > .form-actions,
.form-grid.three > .form-actions {
	grid-column: 1 / -1;
}

.form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.form-message {
	font-size: 0.9rem;
	min-height: 0;
}

.form-message.is-error {
	color: var(--danger);
	background: var(--danger-soft);
	padding: 10px 12px;
	border-radius: var(--radius-sm);
}

.form-message.is-success {
	color: var(--success);
	background: var(--success-soft);
	padding: 10px 12px;
	border-radius: var(--radius-sm);
}

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

.segmented button {
	flex: 1 1 140px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--surface);
	cursor: pointer;
	font-weight: 600;
	font-size: 0.88rem;
	text-align: left;
}

.segmented button.active {
	border-color: var(--accent);
	background: var(--accent-soft);
	box-shadow: inset 0 0 0 1px var(--accent);
}

/* Badges */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 650;
	white-space: nowrap;
	background: var(--surface-2);
	color: var(--text-2);
}

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

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

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

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

.badge-accent {
	background: var(--accent-soft);
	color: #0f766e;
}

.chip {
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: var(--surface-2);
	color: var(--text-2);
}

.chip-ok {
	background: var(--success-soft);
	color: var(--success);
}

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

/* Bandeaux */

.banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	font-size: 0.9rem;
	background: var(--info-soft);
	color: var(--text);
	margin: 0;
}

.banner > .icon {
	font-size: 1.15rem;
	flex: none;
}

.banner > span:not(.icon) {
	flex: 1;
	min-width: 0;
}

.banner-info > .icon {
	color: var(--info);
}

.banner-warn {
	background: var(--warn-soft);
}

.banner-warn > .icon {
	color: var(--warn);
}

.banner-error {
	background: var(--danger-soft);
}

.banner-error > .icon {
	color: var(--danger);
}

.banner-success {
	background: var(--success-soft);
}

.banner-success > .icon {
	color: var(--success);
}

.banner-accent {
	background: var(--accent-soft);
}

.banner-accent > .icon {
	color: var(--accent);
}

/* Cartes */

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow);
	display: grid;
	gap: 14px;
	min-width: 0;
}

.card.narrow {
	max-width: 440px;
}

.card-title {
	font-size: 1.05rem;
}

.center-screen {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px;
}

.subhead {
	margin-top: 8px;
	font-size: 0.95rem;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

/* Chargement et vide */

.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 32px;
	color: var(--text-2);
}

.spinner {
	width: 20px;
	height: 20px;
	border: 2.5px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

.empty {
	text-align: center;
	padding: 36px 20px;
	display: grid;
	justify-items: center;
	gap: 8px;
}

.empty-icon {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	display: grid;
	place-items: center;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 1.5rem;
	margin-bottom: 6px;
}

.empty p {
	color: var(--text-2);
	max-width: 420px;
}

.empty .btn {
	margin-top: 8px;
}

/* Page de connexion */

.login {
	min-height: 100vh;
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	background: var(--bg);
}

.login-hero {
	position: relative;
	overflow: hidden;
	background: radial-gradient(1200px 600px at 10% -10%, #1d2b55 0%, transparent 60%), radial-gradient(900px 600px at 110% 110%, #0f3b47 0%, transparent 55%), #0b1020;
	color: #fff;
	padding: 48px clamp(28px, 5vw, 72px);
	display: flex;
	flex-direction: column;
	gap: 36px;
}

.hero-glow {
	position: absolute;
	inset: auto -20% -40% auto;
	width: 620px;
	height: 620px;
	border-radius: 50%;
	background: var(--grad);
	filter: blur(120px);
	opacity: 0.35;
	pointer-events: none;
}

.hero-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	position: relative;
}

.hero-copy {
	position: relative;
	max-width: 560px;
	display: grid;
	gap: 14px;
}

.hero-copy h1 {
	font-size: clamp(2rem, 3.4vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.08;
	background: linear-gradient(180deg, #fff 30%, #b9c4e4 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero-copy p {
	color: #b6bfd6;
	font-size: 1.05rem;
	max-width: 480px;
}

.hero-demo {
	position: relative;
	height: 300px;
	max-width: 560px;
}

.demo-receipt {
	position: absolute;
	left: 0;
	top: 10px;
	width: 210px;
	padding: 18px 18px 22px;
	background: #fdfdfb;
	color: #222;
	border-radius: 6px;
	box-shadow: var(--shadow-lg);
	display: grid;
	gap: 9px;
	transform: rotate(-4deg);
	overflow: hidden;
	animation: receipt 7s ease-in-out infinite;
}

.demo-receipt::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px;
	height: 12px;
	background: radial-gradient(circle at 6px 0, transparent 6px, #fdfdfb 6px) 0 0 / 12px 12px repeat-x;
	transform: rotate(180deg);
}

.demo-receipt-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}

.demo-dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #f97316;
}

.demo-line {
	display: block;
	height: 7px;
	border-radius: 4px;
	background: #e2e2dc;
}

.w40 {
	width: 40%;
}

.w60 {
	width: 60%;
}

.w70 {
	width: 70%;
}

.w80 {
	width: 80%;
}

.demo-total {
	display: flex;
	justify-content: space-between;
	border-top: 1px dashed #ccc;
	padding-top: 8px;
	font-size: 0.85rem;
	font-family: var(--mono);
}

.demo-qr {
	width: 56px;
	height: 56px;
	background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 14px 14px;
	border: 4px solid #222;
	border-radius: 2px;
}

.scan-beam {
	position: absolute;
	left: -10%;
	right: -10%;
	height: 34px;
	top: -40px;
	background: linear-gradient(180deg, transparent, rgba(20, 184, 166, 0.55), transparent);
	box-shadow: 0 0 24px rgba(20, 184, 166, 0.6);
	animation: beam 3.5s ease-in-out infinite;
}

@keyframes beam {
	0%,
	10% {
		top: -40px;
	}

	55%,
	100% {
		top: 110%;
	}
}

@keyframes receipt {
	0%,
	100% {
		transform: rotate(-4deg) translateY(0);
	}

	50% {
		transform: rotate(-2deg) translateY(-6px);
	}
}

.demo-result {
	position: absolute;
	left: 180px;
	top: 120px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
	animation: pop 7s ease-in-out infinite;
}

.demo-result strong {
	display: block;
	font-size: 0.98rem;
	white-space: nowrap;
}

.demo-result small {
	white-space: nowrap;
}

.demo-result small {
	color: #9fb0d6;
}

.demo-check {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--grad);
	color: #fff;
}

.demo-folder {
	position: absolute;
	left: 240px;
	top: 210px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 12px;
	background: rgba(20, 184, 166, 0.14);
	border: 1px solid rgba(20, 184, 166, 0.35);
	font-family: var(--mono);
	font-size: 0.78rem;
	color: #99f6e4;
	animation: pop 7s ease-in-out infinite;
	animation-delay: 0.35s;
}

@keyframes pop {
	0%,
	30% {
		opacity: 0;
		transform: translateY(10px) scale(0.97);
	}

	40%,
	90% {
		opacity: 1;
		transform: none;
	}

	100% {
		opacity: 0;
	}
}

.hero-points {
	position: relative;
	list-style: none;
	margin: auto 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	color: #c8d0e6;
	font-size: 0.92rem;
}

.hero-points li {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hero-points .icon {
	color: #5eead4;
}

.login-panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 32px 24px;
	gap: 24px;
}

.login-card {
	width: 100%;
	max-width: 400px;
	display: grid;
	gap: 22px;
}

.login-mobile-brand {
	display: none;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 1.35rem;
	letter-spacing: -0.03em;
}

.login-form {
	display: grid;
	gap: 16px;
}

.login-form-head {
	display: grid;
	gap: 4px;
	margin-bottom: 4px;
}

.login-form-head h2 {
	font-size: 1.6rem;
	font-weight: 750;
}

.login-form-head p {
	color: var(--text-2);
}

.login-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 0.9rem;
}

.login-tip {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 0.85rem;
	color: var(--text-2);
	background: var(--surface-2);
	padding: 12px;
	border-radius: var(--radius-sm);
}

.login-foot {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	justify-content: center;
	font-size: 0.8rem;
	color: var(--text-3);
}

.login-foot span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

@media (max-width: 900px) {
	.login {
		grid-template-columns: 1fr;
	}

	.login-hero {
		padding: 28px 22px 32px;
		gap: 20px;
	}

	.hero-copy h1 {
		font-size: 1.85rem;
	}

	.hero-copy p {
		font-size: 0.95rem;
	}

	.hero-demo {
		height: 210px;
		transform: scale(0.78);
		transform-origin: left top;
		margin-bottom: -40px;
	}

	.hero-points {
		display: none;
	}

	.login-panel {
		padding: 28px 20px 40px;
		justify-content: flex-start;
	}
}

@media (max-width: 600px) {
	.hero-demo {
		display: none;
	}

	.login-hero {
		padding-bottom: 26px;
	}
}

/* Coquille de l'application */

.app {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 20px;
	padding-top: calc(10px + env(safe-area-inset-top, 0px));
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid var(--border);
}

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	font-weight: 800;
	font-size: 1.2rem;
	letter-spacing: -0.03em;
}

/* Sélecteur d'entreprise */

.switcher {
	position: relative;
	min-width: 0;
	padding-left: 14px;
	border-left: 1px solid var(--border);
}

.switcher-btn,
.switcher-static {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	max-width: 300px;
	padding: 5px 10px 5px 5px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
}

.switcher-btn {
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.switcher-btn:hover,
.switcher-btn[aria-expanded="true"] {
	background: var(--surface-2);
	border-color: var(--border);
}

.switcher-avatar {
	flex: none;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: var(--accent-soft, var(--surface-2));
	color: var(--accent, var(--text));
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.switcher-avatar.is-global {
	background: var(--text);
	color: var(--surface);
}

.switcher-avatar .icon {
	font-size: 1rem;
}

.switcher-label {
	display: grid;
	min-width: 0;
	line-height: 1.2;
}

.switcher-label small {
	color: var(--text-2);
	font-size: 0.72rem;
	font-weight: 600;
}

.switcher-label strong,
.switcher-name strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.92rem;
}

.switcher-caret {
	flex: none;
	color: var(--text-2);
}

.switcher-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 14px;
	z-index: 60;
	width: 300px;
	max-width: calc(100vw - 32px);
	max-height: min(calc(100dvh - var(--topbar-h, 65px) - 16px), 520px);
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow-lg, 0 16px 40px rgba(8, 12, 24, 0.18));
}

.switcher-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.switcher-item:hover {
	background: var(--surface-2);
}

.switcher-item.active {
	background: var(--surface-2);
}

.switcher-name {
	display: grid;
	flex: 1;
	min-width: 0;
	line-height: 1.25;
}

.switcher-name small {
	color: var(--text-2);
	font-size: 0.75rem;
}

.switcher-check {
	color: var(--success);
}

.switcher-sep {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 6px 8px;
	color: var(--text-2);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.switcher-sep::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.switcher-search {
	margin: 0 0 6px;
}

.switcher-empty {
	padding: 8px;
}

/* Vue globale */

.gc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 14px;
}

.gc-card {
	display: grid;
	gap: 14px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius, 14px);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.gc-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gc-avatar {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: var(--surface-2);
	font-size: 0.8rem;
	font-weight: 800;
}

.gc-title {
	display: grid;
	flex: 1;
	min-width: 0;
	line-height: 1.25;
}

.gc-title strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gc-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
	gap: 8px;
}

.gc-metric {
	display: grid;
	gap: 2px;
	padding: 8px 10px;
	border: 0;
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text-2);
	font: inherit;
	font-size: 0.75rem;
	text-align: left;
}

button.gc-metric {
	cursor: pointer;
}

button.gc-metric:hover {
	outline: 1px solid var(--border);
}

.gc-metric strong {
	color: var(--text);
	font-size: 1.25rem;
	font-variant-numeric: tabular-nums;
}

.gc-metric.tone-danger strong {
	color: var(--danger);
}

.gc-metric.tone-warn strong {
	color: var(--warn);
}

.gc-metric.tone-success strong {
	color: var(--success);
}

.gc-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.spark {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 42px;
}

.spark-col {
	display: flex;
	flex: 1;
	flex-direction: column;
	overflow: hidden;
	border-radius: 3px;
	background: var(--surface-2);
}

.spark-col i {
	display: block;
	min-height: 2px;
}

.spark-missing {
	background: var(--danger);
}

.spark-ok {
	background: var(--success);
	opacity: 0.75;
}

.topbar-spacer {
	flex: 1;
}

.offline-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--warn-soft);
	color: var(--warn);
	font-size: 0.8rem;
	font-weight: 650;
}

.user {
	position: relative;
}

.avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 0;
	background: var(--grad);
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	display: grid;
	place-items: center;
	flex: none;
}

.avatar.small {
	width: 34px;
	height: 34px;
	font-size: 0.75rem;
}

.user-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	width: 250px;
	max-height: calc(100vh - var(--topbar-h, 65px) - 16px);
	max-height: calc(100dvh - var(--topbar-h, 65px) - 16px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	padding: 8px;
	display: grid;
	gap: 2px;
	z-index: 40;
}

.user-menu-head {
	display: grid;
	padding: 8px 10px 10px;
	border-bottom: 1px solid var(--border);
	margin-bottom: 4px;
}

.user-menu-head small {
	color: var(--text-2);
	overflow: hidden;
	text-overflow: ellipsis;
}

.menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 9px;
	text-decoration: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	text-align: left;
	font-size: 0.92rem;
}

.menu-item:hover {
	background: var(--surface-2);
}

.app-body {
	flex: 1;
	display: grid;
	grid-template-columns: 236px minmax(0, 1fr);
}

.sidenav {
	position: sticky;
	/* Hauteur réelle de l'en-tête, mesurée par l'application (--topbar-h). */
	top: var(--topbar-h, 65px);
	height: calc(100vh - var(--topbar-h, 65px));
	height: calc(100dvh - var(--topbar-h, 65px));
	padding: 18px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	border-right: 1px solid var(--border);
	/* Fenêtre peu haute (zoom, petit portable) : le menu défile au lieu d'être coupé. */
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
}

.sidenav > .nav-link {
	flex: none;
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	border-radius: 11px;
	text-decoration: none;
	color: var(--text-2);
	font-weight: 600;
	transition: background 0.15s, color 0.15s;
}

.nav-link .icon {
	font-size: 1.1rem;
}

.nav-link:hover {
	background: var(--surface-2);
	color: var(--text);
}

.nav-link.active {
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow);
}

.nav-link.active .icon {
	color: var(--accent);
}

.nav-admin {
	margin-top: auto;
}

.show-mobile {
	display: none;
}

.access-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 4px 3px 10px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text);
	font-size: 0.8rem;
	font-weight: 600;
}

.access-tag-x {
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--text-2);
	cursor: pointer;
}

.access-tag-x:hover {
	background: var(--danger-soft);
	color: var(--danger);
}

.access-tag-x .icon {
	font-size: 0.75rem;
}

.inline-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.inline-form .input {
	flex: 1 1 260px;
}

.drive-preview {
	display: grid;
	gap: 6px;
}

.drive-preview code {
	display: block;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	font-size: 0.82rem;
	overflow-wrap: anywhere;
}

.inline-field {
	display: flex;
	align-items: center;
	gap: 6px;
}

.inline-field .input {
	width: 90px;
}

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

.check-chips:empty {
	display: none;
}

.check-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text-2);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.check-chip strong {
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.check-chip.tone-danger strong {
	color: var(--danger);
}

.check-chip.tone-warn strong {
	color: var(--warn);
}

.check-chip.tone-success strong {
	color: var(--success);
}

.check-chip.active {
	border-color: var(--text);
	color: var(--text);
}

.tx-badges {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.nav-capture {
	display: none;
}

.nav-short {
	display: none;
}

.main {
	padding: 28px clamp(16px, 3vw, 40px) 60px;
	display: grid;
	gap: 18px;
	align-content: start;
	max-width: 1320px;
	width: 100%;
	margin-inline: auto;
	outline: none;
}

.view {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: inherit;
	align-content: start;
	min-width: 0;
}

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

.fade-in {
	animation: fade 0.25s ease;
}

@keyframes fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}

.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.eyebrow {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent);
	margin-bottom: 4px;
}

.page-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* Statistiques */

.stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.stat {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
	text-align: left;
	min-width: 0;
}

button.stat {
	cursor: pointer;
	transition: transform 0.12s, box-shadow 0.15s;
}

button.stat:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
}

.stat-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 1.15rem;
	flex: none;
}

.stat-text {
	display: grid;
	min-width: 0;
}

.stat-label {
	font-size: 0.8rem;
	color: var(--text-2);
	font-weight: 600;
}

.stat-value {
	font-size: 1.55rem;
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.2;
	white-space: nowrap;
}

.stat-sub {
	font-size: 0.8rem;
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tone-success .stat-icon {
	background: var(--success-soft);
	color: var(--success);
}

.tone-danger .stat-icon {
	background: var(--danger-soft);
	color: var(--danger);
}

.tone-danger .stat-value {
	color: var(--danger);
}

.tone-warn .stat-icon {
	background: var(--warn-soft);
	color: var(--warn);
}

.onboarding {
	grid-template-columns: auto 1fr auto;
	align-items: center;
	background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
}

.onboarding-icon {
	width: 52px;
	height: 52px;
	border-radius: 16px;
	background: var(--grad);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 1.4rem;
}

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

/* Graphique */

.legend {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 0.8rem;
	color: var(--text-2);
}

.lg {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.lg::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 3px;
	background: var(--ignored);
}

.lg-justified::before {
	background: var(--success);
}

.lg-missing::before {
	background: var(--danger);
}

.chart-wrap {
	width: 100%;
	overflow-x: auto;
}

.month-chart {
	width: 100%;
	height: auto;
	display: block;
}

.month-chart.compact .label {
	font-size: 11px;
}

.month-chart .grid {
	stroke: var(--border);
	stroke-dasharray: 3 4;
}

.month-chart .bar {
	cursor: pointer;
	outline: none;
}

.month-chart .hit {
	fill: transparent;
	rx: 10;
}

.month-chart .bar:hover .hit,
.month-chart .bar:focus-visible .hit {
	fill: var(--surface-2);
}

.month-chart .bar.is-selected .hit {
	fill: var(--accent-soft);
}

.month-chart .seg-justified {
	fill: var(--success);
}

.month-chart .seg-missing {
	fill: var(--danger);
}

.month-chart .seg-ignored {
	fill: var(--ignored);
}

.month-chart .seg-empty {
	fill: var(--border);
}

.month-chart .count {
	fill: var(--danger);
	font-size: 13px;
	font-weight: 750;
	text-anchor: middle;
}

.month-chart .label {
	fill: var(--text-2);
	font-size: 12px;
	font-weight: 600;
	text-anchor: middle;
	text-transform: capitalize;
}

.month-chart .bar.is-selected .label {
	fill: var(--text);
	font-weight: 750;
}

/* Listes */

.tx-list,
.doc-list,
.statement-list,
.account-list,
.member-list,
.token-list,
.audit-list,
.candidate-list,
.health {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tx-row,
.doc-row,
.statement-row {
	display: grid;
	align-items: center;
	gap: 14px;
	padding: 12px 10px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	border-radius: 10px;
	transition: background 0.12s;
}

.tx-row:hover,
.doc-row:hover {
	background: var(--surface-2);
}

.tx-row:last-child,
.doc-row:last-child,
.statement-row:last-child {
	border-bottom: 0;
}

.tx-row {
	grid-template-columns: 92px minmax(0, 1fr) auto auto;
}

.tx-date {
	font-size: 0.85rem;
	color: var(--text-2);
	font-variant-numeric: tabular-nums;
}

.tx-main {
	display: grid;
	min-width: 0;
	gap: 2px;
	justify-items: start;
}

.tx-main strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.tx-desc {
	font-size: 0.82rem;
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.tx-amount,
.doc-amount {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	text-align: right;
}

.doc-amount-chf {
	display: block;
	font-weight: 500;
	font-size: 0.78rem;
	color: var(--text-2);
}

.fx-note {
	display: flex;
	gap: 6px;
	align-items: flex-start;
	margin: -6px 0 0;
}

.account-field {
	display: grid;
	gap: 4px;
}

.rule-options {
	padding-left: 28px;
}

.nowrap {
	white-space: nowrap;
}

.tx-amount.credit {
	color: var(--success);
}

.row-actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

.doc-row {
	grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
}

.doc-list.compact .doc-row {
	grid-template-columns: minmax(0, 1fr) auto auto;
}

.doc-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 1.1rem;
}

.doc-icon.tone-success {
	background: var(--success-soft);
	color: var(--success);
}

.doc-icon.tone-warn {
	background: var(--warn-soft);
	color: var(--warn);
}

.doc-icon.tone-info {
	background: var(--info-soft);
	color: var(--info);
}

.doc-main {
	display: grid;
	min-width: 0;
}

.doc-main strong,
.doc-main span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.doc-main span {
	font-size: 0.84rem;
}

.doc-badges {
	display: flex;
	gap: 6px;
	align-items: center;
}

.statement-row {
	grid-template-columns: 40px minmax(0, 1fr) auto auto;
	cursor: default;
}

.statement-error {
	color: var(--warn);
	font-size: 0.82rem;
	white-space: normal !important;
}

.account-list li {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.account-list li:last-child {
	border-bottom: 0;
}

.account-list li > div {
	display: grid;
	min-width: 0;
}

.account-list li strong {
	overflow-wrap: anywhere;
}

.candidate-list li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	gap: 10px;
	align-items: center;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-bottom: 8px;
}

.candidate-list li > div {
	display: grid;
	min-width: 0;
}

.candidate-list span {
	font-size: 0.84rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding-top: 14px;
	font-size: 0.9rem;
	color: var(--text-2);
}

.list-wrap {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 6px 10px;
	box-shadow: var(--shadow);
}

/* Barre d'outils et onglets */

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

.toolbar.wrap {
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.toolbar .select {
	width: auto;
}

.search {
	flex: 1;
	position: relative;
	min-width: 200px;
}

.search .icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-3);
}

.search .input {
	padding-left: 38px;
}

.tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--surface-2);
	border-radius: 12px;
	overflow-x: auto;
	scrollbar-width: none;
	width: fit-content;
	max-width: 100%;
}

.tab {
	border: 0;
	background: transparent;
	padding: 8px 14px;
	border-radius: 9px;
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--text-2);
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
}

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

.tab-count {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	margin-left: 6px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--warn);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	vertical-align: 1px;
}

/* Superpositions */

.overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(8, 12, 24, 0.5);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	display: grid;
	place-items: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.overlay.open {
	opacity: 1;
}

.modal {
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border-radius: 18px;
	box-shadow: var(--shadow-lg);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.2s ease;
	overflow: hidden;
}

.overlay.open .modal {
	transform: none;
}

.modal-head,
.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--border);
}

.modal-body {
	padding: 18px;
	overflow-y: auto;
	display: grid;
	gap: 14px;
}

.modal-foot {
	padding: 14px 18px calc(14px + var(--safe-bottom));
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.modal-foot-row {
	display: flex;
	gap: 10px;
	width: 100%;
	justify-content: space-between;
}

.overlay-drawer {
	place-items: stretch end;
	grid-template-rows: minmax(0, 1fr);
	padding: 0;
}

.drawer {
	width: min(980px, 100vw);
	height: 100%;
	min-height: 0;
	max-height: 100dvh;
	background: var(--bg);
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-lg);
	transform: translateX(30px);
	transition: transform 0.25s ease;
}

.overlay.open .drawer {
	transform: none;
}

.drawer-head {
	background: var(--surface);
	padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.drawer-head h2 {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	padding-bottom: calc(24px + var(--safe-bottom));
}

.toasts {
	position: fixed;
	z-index: 200;
	left: 50%;
	bottom: calc(24px + var(--safe-bottom));
	transform: translateX(-50%);
	display: grid;
	gap: 8px;
	width: min(440px, calc(100vw - 32px));
}

.toast {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 12px;
	background: #111827;
	color: #fff;
	box-shadow: var(--shadow-lg);
	font-size: 0.92rem;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
	opacity: 1;
	transform: none;
}

.toast-success .icon {
	color: #4ade80;
}

.toast-error .icon {
	color: #fb7185;
}

.toast-info .icon {
	color: #60a5fa;
}

/* Capture */

.capture {
	display: grid;
	gap: 16px;
}

.capture-company {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.88rem;
	color: var(--text-2);
}

.capture-start {
	display: grid;
	gap: 12px;
}

.capture-big {
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 34px 20px;
	border-radius: 18px;
	border: 2px dashed rgba(20, 184, 166, 0.45);
	background: var(--accent-soft);
	cursor: pointer;
	transition: transform 0.12s, border-color 0.15s;
}

.capture-big:hover {
	border-color: var(--accent);
}

.capture-big:active {
	transform: scale(0.99);
}

.capture-big strong {
	font-size: 1.1rem;
}

.capture-big small {
	color: var(--text-2);
}

.capture-big-icon {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--grad);
	color: #fff;
	font-size: 1.8rem;
	box-shadow: 0 10px 30px rgba(20, 184, 166, 0.35);
	margin-bottom: 6px;
}

.capture-alt {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: var(--surface);
	cursor: pointer;
	font-weight: 600;
}

.capture-pages {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 10px;
}

.pdf-list {
	grid-column: 1 / -1;
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
	max-height: 46vh;
	overflow-y: auto;
}

.pdf-list li {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 10px;
	padding: 4px 4px 4px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
}

.pdf-list .icon {
	color: var(--danger);
}

.pdf-list .icon-btn .icon {
	color: var(--text-2);
}

.pdf-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.9rem;
	font-weight: 600;
}

.capture-pages:empty {
	display: none;
}

.capture-thumb {
	position: relative;
	margin: 0;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--surface-2);
}

.capture-thumb img,
.thumb-pdf {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	display: block;
}

.thumb-pdf {
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 6px;
	font-weight: 700;
	color: var(--danger);
	font-size: 1.6rem;
}

.thumb-pdf span {
	font-size: 0.8rem;
}

.capture-thumb figcaption {
	display: grid;
	padding: 6px 8px;
	font-size: 0.78rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.capture-thumb figcaption small {
	color: var(--text-3);
	font-weight: 500;
}

.thumb-remove {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border-radius: 50%;
}

.capture-add {
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 6px;
	aspect-ratio: 3 / 4;
	border-radius: 12px;
	border: 2px dashed var(--border);
	background: transparent;
	cursor: pointer;
	color: var(--text-2);
	font-weight: 600;
	font-size: 0.82rem;
}

.capture-form {
	display: grid;
	gap: 14px;
}

.progress {
	height: 6px;
	border-radius: 3px;
	background: var(--surface-2);
	overflow: hidden;
}

.progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: var(--grad);
	transition: width 0.2s;
}

.capture-result {
	display: grid;
	justify-items: center;
	text-align: center;
	gap: 8px;
	padding: 12px 0 4px;
}

.scan-anim {
	position: relative;
	width: 84px;
	height: 84px;
	border-radius: 22px;
	background: var(--accent-soft);
	color: var(--accent);
	display: grid;
	place-items: center;
	font-size: 2.2rem;
	overflow: hidden;
	margin-bottom: 8px;
}

.result-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 2rem;
	background: var(--surface-2);
	color: var(--text-2);
	margin-bottom: 6px;
}

.result-icon.ok {
	background: var(--success-soft);
	color: var(--success);
	animation: pop-in 0.35s ease;
}

.result-icon.warn {
	background: var(--warn-soft);
	color: var(--warn);
}

@keyframes pop-in {
	from {
		transform: scale(0.6);
		opacity: 0;
	}
}

.result-amount {
	font-size: 1.8rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.result-path {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--text-2);
	background: var(--surface-2);
	padding: 6px 10px;
	border-radius: 8px;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.capture-result .banner {
	text-align: left;
}

/* Détail d'une pièce */

.doc-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.doc-preview {
	position: sticky;
	top: 0;
	display: grid;
	gap: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px;
}

.doc-preview iframe {
	width: 100%;
	height: 70vh;
	border: 0;
	border-radius: 8px;
	background: var(--surface-2);
}

.doc-preview img {
	width: 100%;
	border-radius: 8px;
	display: block;
	background: #fff;
}

.doc-preview-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.doc-form {
	display: grid;
	gap: 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
}

.doc-status {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.link-box {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	font-size: 0.9rem;
}

.link-box > div {
	display: grid;
	flex: 1;
	min-width: 0;
}

.link-box.ok {
	background: var(--success-soft);
}

.link-box.ok > .icon {
	color: var(--success);
}

.doc-meta {
	display: grid;
	gap: 6px;
	font-size: 0.82rem;
	color: var(--text-2);
	border-top: 1px solid var(--border);
	padding-top: 12px;
}

.doc-meta span {
	display: flex;
	align-items: center;
	gap: 8px;
	word-break: break-all;
}

.danger-zone {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: space-between;
}

/* Détail d'une transaction */

.tx-detail {
	display: grid;
	gap: 16px;
	max-width: 640px;
}

.tx-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 20px;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
}

.tx-hero-amount {
	font-size: 1.9rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.tx-hero-amount.credit {
	color: var(--success);
}

.kv {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 10px 14px;
	margin: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
}

.card .kv {
	border: 0;
	padding: 0;
}

.kv dt {
	color: var(--text-2);
	font-size: 0.88rem;
}

.kv dd {
	margin: 0;
	word-break: break-word;
}

.action-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

/* Relevés */

.dropzone {
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 34px 20px;
	border-radius: 16px;
	border: 2px dashed var(--border);
	background: var(--surface-2);
	cursor: pointer;
	font-size: 1rem;
	transition: border-color 0.15s, background 0.15s;
}

.dropzone .icon {
	font-size: 1.8rem;
	color: var(--accent);
}

.dropzone small {
	color: var(--text-2);
}

.dropzone.drag,
.dropzone:hover {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.help {
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	font-size: 0.88rem;
}

.help summary {
	cursor: pointer;
	font-weight: 650;
}

.help ul {
	margin: 10px 0 4px;
	padding-left: 18px;
	display: grid;
	gap: 6px;
	color: var(--text-2);
}

/* Réglages */

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

.settings-nav {
	display: grid;
	gap: 2px;
	position: sticky;
	top: 80px;
}

.settings-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 10px;
	text-decoration: none;
	color: var(--text-2);
	font-weight: 600;
	font-size: 0.92rem;
}

.settings-nav a:hover {
	background: var(--surface-2);
}

.settings-nav a.active {
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow);
}

.settings-nav a.active .icon {
	color: var(--accent);
}

.settings-content {
	display: grid;
	gap: 16px;
	min-width: 0;
}

.drive-status {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	padding: 14px;
	border-radius: var(--radius-sm);
	background: var(--surface-2);
}

.drive-status > div:nth-child(2) {
	display: grid;
	gap: 4px;
	justify-items: start;
	min-width: 0;
}

.drive-logo {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	background: var(--surface);
	color: var(--accent-2);
	font-size: 1.4rem;
}

.rule-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--surface-2);
}

.rule-row code {
	font-family: var(--mono);
	font-size: 0.85rem;
	background: var(--surface);
	padding: 2px 8px;
	border-radius: 6px;
}

.rule-add {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.table th {
	text-align: left;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--text-3);
	font-weight: 700;
	padding: 8px;
	border-bottom: 1px solid var(--border);
}

.table td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
}

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

.member-list li {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	gap: 12px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.member-list li:last-child {
	border-bottom: 0;
}

.member-main {
	display: grid;
	min-width: 0;
	justify-items: start;
	gap: 2px;
}

.member-main small {
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.token-list li {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.token-list li > div {
	display: grid;
	min-width: 0;
}

.token-list li.revoked {
	opacity: 0.55;
}

.secret {
	display: block;
	font-family: var(--mono);
	font-size: 0.82rem;
	background: var(--surface-2);
	padding: 8px 10px;
	border-radius: 8px;
	word-break: break-all;
	user-select: all;
}

.secret.big {
	font-size: 0.95rem;
	padding: 14px;
}

.secret-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
}

.code {
	font-family: var(--mono);
	font-size: 0.78rem;
	background: #0b1020;
	color: #cbd5e1;
	padding: 14px;
	border-radius: 10px;
	overflow-x: auto;
	white-space: pre;
	margin: 10px 0 0;
}

.audit-list li {
	display: flex;
	gap: 10px;
	align-items: baseline;
	flex-wrap: wrap;
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
	font-size: 0.88rem;
}

.audit-list code {
	font-family: var(--mono);
	font-size: 0.8rem;
	background: var(--surface-2);
	padding: 1px 6px;
	border-radius: 5px;
}

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

.health li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 8px 0;
}

.health li > div {
	display: grid;
}

.health li.ok > .icon {
	color: var(--success);
}

.health li.ko > .icon {
	color: var(--warn);
}

.bar-list {
	display: grid;
	gap: 8px;
}

.bar-row {
	display: grid;
	grid-template-columns: 70px minmax(0, 1fr) 130px;
	align-items: center;
	gap: 12px;
	font-size: 0.85rem;
}

.bar-label {
	color: var(--text-2);
	text-transform: capitalize;
}

.bar-track {
	height: 10px;
	border-radius: 5px;
	background: var(--surface-2);
	overflow: hidden;
}

.bar-fill {
	display: block;
	height: 100%;
	border-radius: 5px;
	background: var(--grad);
}

.bar-value {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

/* Responsive */

@media (max-width: 1100px) {
	.stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.doc-detail {
		grid-template-columns: 1fr;
	}

	.doc-preview {
		position: static;
	}

	.doc-preview iframe {
		height: 55vh;
	}
}

@media (max-width: 900px) {
	body.escan-body {
		font-size: 15px;
	}

	.topbar {
		padding: 8px 14px;
		padding-top: calc(8px + env(safe-area-inset-top, 0px));
		gap: 10px;
	}

	.brand span {
		display: none;
	}

	.hide-mobile {
		display: none !important;
	}

	.app-body {
		grid-template-columns: 1fr;
	}

	.sidenav {
		position: fixed;
		z-index: 50;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		height: calc(var(--nav-h) + var(--safe-bottom));
		padding: 6px 8px var(--safe-bottom);
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		gap: 0;
		border-right: 0;
		border-top: 1px solid var(--border);
		background: color-mix(in srgb, var(--surface) 92%, transparent);
		backdrop-filter: saturate(1.4) blur(16px);
		-webkit-backdrop-filter: saturate(1.4) blur(16px);
	}

	.nav-link {
		flex: 1;
		flex-direction: column;
		gap: 3px;
		padding: 6px 2px;
		font-size: 0.68rem;
		border-radius: 10px;
		text-align: center;
	}

	.nav-link .icon {
		font-size: 1.35rem;
	}

	.nav-link.active {
		background: transparent;
		box-shadow: none;
	}

	.nav-admin,
	.nav-aba {
		display: none;
	}

	.show-mobile {
		display: inline-flex;
	}

	.nav-long {
		display: none;
	}

	.nav-short {
		display: inline;
	}

	.nav-capture {
		display: grid;
		place-items: center;
		flex: 1;
		border: 0;
		background: transparent;
		padding: 0;
		cursor: pointer;
	}

	.nav-capture-btn {
		width: 58px;
		height: 58px;
		margin-top: -26px;
		border-radius: 50%;
		display: grid;
		place-items: center;
		background: var(--grad);
		color: #fff;
		font-size: 1.6rem;
		box-shadow: 0 10px 28px rgba(20, 184, 166, 0.45), 0 0 0 5px var(--bg);
		transition: transform 0.12s;
	}

	.nav-capture:active .nav-capture-btn {
		transform: scale(0.94);
	}

	.main {
		padding: 18px 14px calc(var(--nav-h) + var(--safe-bottom) + 28px);
		gap: 14px;
	}

	h1 {
		font-size: 1.4rem;
	}

	.page-head {
		align-items: flex-start;
	}

	.card {
		padding: 16px;
	}

	.stats {
		gap: 10px;
	}

	.stat {
		padding: 12px;
		gap: 10px;
	}

	.stat-icon {
		width: 34px;
		height: 34px;
		font-size: 1rem;
	}

	.stat-value {
		font-size: 1.3rem;
	}

	.onboarding {
		grid-template-columns: 1fr;
	}

	.settings {
		grid-template-columns: 1fr;
	}

	.settings-nav {
		position: static;
		display: flex;
		overflow-x: auto;
		gap: 6px;
		scrollbar-width: none;
	}

	.settings-nav a {
		white-space: nowrap;
		background: var(--surface-2);
	}

	.grid-2,
	.form-grid.two,
	.form-grid.three {
		grid-template-columns: 1fr;
	}

	.rule-add {
		grid-template-columns: 1fr;
	}

	.overlay {
		padding: 0;
		place-items: end stretch;
	}

	.modal {
		max-width: none;
		max-height: 92vh;
		border-radius: 20px 20px 0 0;
		transform: translateY(40px);
	}

	.modal.modal-sheet {
		max-height: 96vh;
	}

	.overlay-drawer {
		place-items: stretch;
	}

	.drawer {
		width: 100vw;
		transform: translateY(30px);
	}

	.drawer-body {
		padding: 14px;
	}

	.toasts {
		bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
	}

	.tx-row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "main amount" "date actions";
		gap: 4px 10px;
		padding: 12px 6px;
	}

	.tx-row .tx-main {
		grid-area: main;
	}

	.tx-row .tx-amount {
		grid-area: amount;
	}

	.tx-row .tx-date {
		grid-area: date;
		font-size: 0.78rem;
	}

	.tx-row .row-actions,
	.tx-row > .badge {
		grid-area: actions;
		justify-self: end;
	}

	.doc-row {
		grid-template-columns: 36px minmax(0, 1fr) auto;
		gap: 10px;
	}

	.doc-row .doc-badges {
		display: none;
	}

	.doc-icon {
		width: 36px;
		height: 36px;
	}

	.statement-row {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.statement-row .doc-icon {
		display: none;
	}

	.statement-row .row-actions {
		grid-column: 1 / -1;
	}

	.kv {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	.kv dd {
		margin-bottom: 8px;
	}

	.member-list li {
		grid-template-columns: auto minmax(0, 1fr);
	}

	.member-list li > select,
	.member-list li > .row-actions {
		grid-column: 2;
	}

	.toolbar {
		flex-wrap: wrap;
	}

	.search {
		min-width: 100%;
	}

	.bar-row {
		grid-template-columns: 54px minmax(0, 1fr) 110px;
	}
}

@media (max-width: 480px) {
	.hide-xs {
		display: none !important;
	}

	.switcher {
		padding-left: 8px;
	}

	.switcher-btn,
	.switcher-static {
		max-width: 56vw;
	}

	.switcher-label small {
		display: none;
	}

	.action-grid {
		grid-template-columns: 1fr;
	}

	.field-row {
		grid-template-columns: 1fr 80px;
	}
}

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

/* Envoi de plusieurs pièces */

.capture.drag {
	outline: 2px dashed var(--accent);
	outline-offset: 6px;
	border-radius: 14px;
}

.capture-summary {
	margin-top: -6px;
}

.batch-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
	max-height: 50vh;
	overflow-y: auto;
}

.batch-row {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
}

.batch-row.clickable:hover {
	background: var(--surface-2);
}

.batch-row.is-active {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.batch-row .doc-main strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.queue-head {
	display: grid;
	gap: 8px;
	position: sticky;
	top: -18px;
	z-index: 2;
	padding: 4px 0 8px;
	background: var(--surface);
}

.queue-count {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 1rem;
}

.queue-count .icon {
	color: var(--accent);
}

.queue-status {
	margin: 0;
}

.queue-pct {
	font-size: 0.85rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--accent);
}

.upload-pill {
	position: fixed;
	z-index: 120;
	left: 50%;
	bottom: calc(24px + var(--safe-bottom));
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--text);
	color: var(--surface);
	font-size: 0.88rem;
	font-weight: 600;
	box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
	.upload-pill {
		bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
	}

	.batch-list {
		max-height: none;
	}
}

.batch-row .doc-icon {
	width: 36px;
	height: 36px;
}

.reason-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 6px;
}

.reason-list li {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 0.88rem;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	background: var(--warn-soft);
}

.reason-list .icon {
	color: var(--warn);
	margin-top: 2px;
}

/* Onglet « À imputer » */

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

a.stat {
	text-decoration: none;
	color: inherit;
}

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

.book-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
}

.book-row {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 16px;
	display: grid;
	gap: 12px;
	box-shadow: var(--shadow);
	transition: opacity 0.2s, border-color 0.2s;
}

.book-row.is-done {
	border-color: var(--success);
	opacity: 0.7;
}

.book-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
}

.book-head input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--accent);
}

.book-main {
	display: grid;
	min-width: 0;
}

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

.book-doc {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 0.9rem;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	background: var(--surface-2);
}

.book-doc > span:not(.icon) {
	flex: 1;
	min-width: 0;
}

.book-fields {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
	gap: 12px;
	align-items: start;
}

.book-fields .book-text {
	grid-column: 1 / -1;
}

.book-foot {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
}

.book-status {
	flex: 1;
}

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

@media (max-width: 900px) {
	.book-fields,
	.compact-stats {
		grid-template-columns: 1fr;
	}
}

.signal-list li {
	background: var(--info-soft);
}

.signal-list .icon {
	color: var(--info);
}

.inbox-actions {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
}

@media (max-width: 900px) {
	.inbox-actions {
		grid-template-columns: 1fr;
	}

	.inbox-actions .form-actions {
		justify-content: stretch;
	}

	.inbox-actions .form-actions .btn {
		flex: 1;
	}
}

.mailbox-form .full {
	grid-column: 1 / -1;
}

.mailbox-form .rule-row {
	grid-template-columns: minmax(140px, auto) minmax(0, 1fr) auto;
}

.dup-banner {
	flex-wrap: wrap;
	align-items: flex-start;
}

.dup-banner > span:not(.icon) {
	flex: 1 1 260px;
}

.dup-banner .row-actions {
	margin-left: auto;
}

/* ==========================================================================
   Mobile : passe d'optimisation (téléphones, une main, zones tactiles larges)
   ========================================================================== */

.filters-toggle {
	display: none;
}

.filters-box {
	display: contents;
}

button,
a,
.tx-row,
.doc-row,
.switcher-item,
.check-chip {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
	/* iOS zoome sur tout champ en dessous de 16 px : on l'évite. */
	.input,
	.select,
	textarea.input,
	.switcher-search {
		font-size: 16px;
	}

	.icon-btn {
		width: 42px;
		height: 42px;
	}

	.btn-sm {
		min-height: 38px;
	}

	/* L'entreprise est déjà dans le sélecteur du haut. */
	.page-head .eyebrow {
		display: none;
	}

	.page-head {
		align-items: center;
		gap: 10px;
	}

	.page-head > div:first-child {
		min-width: 0;
		flex: 1 1 auto;
	}

	.page-actions {
		gap: 8px;
	}

	/* Textes d'explication : deux lignes, un appui pour tout lire. */
	.page-intro {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		cursor: pointer;
		position: relative;
		padding-right: 22px;
	}

	.page-intro::after {
		content: "+";
		position: absolute;
		right: 0;
		top: 0;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: var(--surface-2);
		color: var(--text-2);
		font-size: 0.8rem;
		font-weight: 700;
		line-height: 18px;
		text-align: center;
	}

	.page-intro.open {
		display: block;
	}

	.page-intro.open::after {
		content: "−";
	}

	/* Barres d'onglets : défilement horizontal propre, sans barre visible. */
	.tabs,
	.settings-nav {
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		max-width: 100%;
	}

	.tabs::-webkit-scrollbar,
	.settings-nav::-webkit-scrollbar,
	.check-chips::-webkit-scrollbar {
		display: none;
	}

	.tab,
	.settings-nav a {
		scroll-snap-align: center;
		flex: none;
	}

	.tab {
		padding: 10px 14px;
	}

	/* Compteurs de contrôle : une seule ligne qui défile. */
	.check-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin: 0 -14px;
		padding: 2px 14px;
	}

	.check-chip {
		flex: none;
		padding: 9px 12px;
	}

	/* Statistiques compactes en trois colonnes. */
	.compact-stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 8px;
	}

	.compact-stats .stat {
		padding: 10px;
	}

	.compact-stats .stat-label {
		font-size: 0.72rem;
	}

	/* Transactions : titre lisible sur deux lignes, montant à droite, date et pastilles dessous. */
	.tx-row {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: "main main amount" "date badges badges";
		gap: 6px 10px;
		padding: 12px 4px;
	}

	.tx-row .tx-main strong {
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		line-height: 1.3;
	}

	.tx-row .tx-badges,
	.tx-row .row-actions,
	.tx-row > .badge {
		grid-area: badges;
		justify-self: end;
		justify-content: flex-end;
		min-width: 0;
	}

	.tx-row > .icon {
		display: none;
	}

	.tx-row .tx-amount {
		align-self: start;
		white-space: nowrap;
	}

	.tx-row .tx-date {
		align-self: center;
		white-space: nowrap;
	}

	.tx-badges .badge {
		font-size: 0.7rem;
	}

	/* Pièces : le statut reste visible sous le fournisseur. */
	.doc-row {
		grid-template-columns: 36px minmax(0, 1fr) auto;
		grid-template-areas: "icon main amount" "icon badges badges";
		gap: 4px 10px;
		align-items: start;
	}

	.doc-row .doc-icon {
		grid-area: icon;
	}

	.doc-row .doc-main {
		grid-area: main;
	}

	.doc-row .doc-amount {
		grid-area: amount;
	}

	.doc-row .doc-badges {
		display: flex;
		grid-area: badges;
		gap: 6px;
		justify-content: flex-start;
	}

	.doc-row .doc-badges .badge {
		font-size: 0.7rem;
	}

	.doc-row .doc-badges .chip {
		width: 22px;
		height: 22px;
	}

	.doc-row > .icon {
		display: none;
	}

	.doc-main strong {
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	/* Détail d'une pièce : aperçu compact, boutons d'action toujours à portée de pouce. */
	.doc-preview {
		padding: 8px;
	}

	.doc-preview iframe {
		display: none;
	}

	.doc-preview img {
		max-height: 42vh;
		object-fit: contain;
	}

	.doc-preview-actions .btn {
		flex: 1;
	}

	.doc-form {
		padding: 14px;
	}

	.doc-form > .form-actions {
		position: sticky;
		bottom: calc(-14px - var(--safe-bottom));
		z-index: 3;
		margin: 0 -14px;
		padding: 10px 14px calc(10px + var(--safe-bottom));
		background: var(--surface);
		border-top: 1px solid var(--border);
		box-shadow: 0 -8px 20px rgba(11, 16, 32, 0.06);
	}

	.doc-form > .form-actions .btn,
	.drawer .form-actions .btn,
	.modal-foot .btn {
		flex: 1;
	}

	.field-row {
		grid-template-columns: minmax(0, 1fr) 96px;
	}

	/* Détail d'une transaction. */
	.tx-hero {
		flex-wrap: wrap;
		padding: 16px;
	}

	.tx-hero-amount {
		font-size: 1.6rem;
		white-space: nowrap;
	}

	/* Écran « À imputer » et champs côte à côte : toujours dans la largeur. */
	.book-fields .select,
	.book-fields .select-sm,
	.book-fields .input {
		width: 100%;
		min-width: 0;
	}

	.book-head {
		align-items: flex-start;
	}

	.book-foot {
		flex-wrap: wrap;
	}

	.book-foot .btn {
		flex: 1;
	}

	/* Recherche et filtres. */
	.toolbar.has-filters {
		flex-wrap: wrap;
	}

	.toolbar.has-filters .search,
	.toolbar-docs .search {
		min-width: 0;
		flex: 1;
	}

	.toolbar-docs {
		flex-wrap: nowrap;
	}

	.toolbar-docs .select {
		width: 120px;
		flex: none;
	}

	.filters-toggle {
		display: inline-flex;
	}

	.filters-toggle[aria-expanded="true"] {
		background: var(--surface-2);
		border-color: var(--text-2);
	}

	.filters-box {
		display: none;
		width: 100%;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.filters-box.open {
		display: grid;
	}

	.filters-box .select {
		width: 100%;
	}

	/* Fenêtres en feuille du bas : poignée et boutons pleine largeur. */
	.modal::before {
		content: "";
		display: block;
		width: 40px;
		height: 4px;
		margin: 8px auto 0;
		border-radius: 2px;
		background: var(--border);
	}

	.modal-foot {
		flex-wrap: wrap;
	}

	/* Cartes de la vue globale. */
	.gc-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	/* Tableaux en fiches : l'intitulé de chaque colonne passe devant sa valeur. */
	.table-wrap {
		overflow: visible;
	}

	table.table[data-labelled] {
		display: block;
		border: 0;
	}

	table.table[data-labelled] thead {
		display: none;
	}

	table.table[data-labelled] tbody {
		display: grid;
		gap: 10px;
	}

	table.table[data-labelled] tr {
		display: grid;
		gap: 4px;
		padding: 12px;
		border: 1px solid var(--border);
		border-radius: 12px;
		background: var(--surface);
	}

	table.table[data-labelled] td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		min-width: 0;
		padding: 2px 0;
		border: 0;
		text-align: right;
		overflow-wrap: anywhere;
	}

	table.table[data-labelled] td::before {
		content: attr(data-label);
		flex: none;
		max-width: 45%;
		color: var(--text-2);
		font-size: 0.78rem;
		font-weight: 600;
		text-align: left;
	}

	table.table[data-labelled] td:first-child {
		display: grid;
		gap: 2px;
		justify-content: stretch;
		text-align: left;
		font-weight: 600;
	}

	table.table[data-labelled] td:first-child small,
	table.table[data-labelled] td:first-child .muted {
		font-weight: 400;
	}

	table.table[data-labelled] td::before {
		font-family: var(--font, inherit);
		letter-spacing: 0;
	}

	table.table[data-labelled] td:first-child::before,
	table.table[data-labelled] td[data-label=""]::before {
		display: none;
	}

	table.table[data-labelled] td[data-label=""] {
		justify-content: flex-end;
	}

	table.table[data-labelled] td .input,
	table.table[data-labelled] td .select {
		max-width: 60%;
	}

	table.table[data-labelled] td:first-child .input {
		max-width: none;
	}

	.settings {
		grid-template-columns: 1fr;
	}
}

.pdf-list ~ .capture-add {
	grid-column: 1 / -1;
	aspect-ratio: auto;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

/* ==========================================================================
   Mobile : seconde passe de finition
   ========================================================================== */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Chargement : silhouettes animées. */
.loading.skeleton {
	display: grid;
	gap: 14px;
	justify-content: stretch;
	padding: 8px 0;
}

.skeleton-row {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
}

.skeleton-avatar,
.skeleton-lines i {
	display: block;
	border-radius: 8px;
	background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 100%);
	background-size: 200% 100%;
	animation: skeleton 1.3s ease-in-out infinite;
}

.skeleton-avatar {
	width: 36px;
	height: 36px;
	border-radius: 10px;
}

.skeleton-lines {
	display: grid;
	gap: 7px;
}

.skeleton-lines i {
	height: 11px;
	width: 70%;
}

.skeleton-lines i + i {
	width: 42%;
	height: 9px;
}

@keyframes skeleton {
	from {
		background-position: 200% 0;
	}

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

/* Pastilles de la navigation. */
.nav-link {
	position: relative;
}

.nav-badge {
	margin-left: auto;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	display: inline-grid;
	place-items: center;
	font-size: 0.7rem;
	font-weight: 800;
	color: #fff;
	background: var(--text-2);
	font-variant-numeric: tabular-nums;
}

.nav-badge.tone-danger {
	background: var(--danger);
}

.nav-badge.tone-warn {
	background: var(--warn);
}

/* Fenêtre ouverte : la page ne défile plus derrière. */
html.has-overlay,
html.has-overlay body {
	overflow: hidden;
}

.overlay,
.drawer-body,
.modal-body,
.switcher-menu {
	overscroll-behavior: contain;
}

/* Focus visible au clavier seulement (pas de cadre après un appui au doigt). */
:focus:not(:focus-visible) {
	outline: none;
}

.nav-capture {
	position: relative;
	z-index: 2;
	outline: none;
}

.nav-capture:focus-visible .nav-capture-btn {
	box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent);
}

/* Tirer pour actualiser. */
.ptr {
	position: fixed;
	z-index: 40;
	top: calc(env(safe-area-inset-top, 0px) + 58px);
	left: 50%;
	width: 36px;
	height: 36px;
	margin-top: -44px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--surface);
	color: var(--text-2);
	box-shadow: var(--shadow);
	transform: translate(-50%, 0);
	transition: color 0.15s, opacity 0.15s;
	pointer-events: none;
	opacity: 0;
}

.ptr.ready {
	color: var(--accent);
}

.ptr.spinning .icon {
	animation: spin 0.7s linear infinite;
}

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

/* Menu des réglages (téléphone). */
.settings-menu {
	display: grid;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius, 14px);
	background: var(--surface);
}

.settings-menu-item {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 10px 14px;
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}

.settings-menu-item:last-child {
	border-bottom: 0;
}

.settings-menu-icon {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 1.05rem;
}

.settings-menu-text {
	display: grid;
	min-width: 0;
	line-height: 1.3;
}

.settings-menu-text small {
	color: var(--text-2);
	font-size: 0.8rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.settings-back-head {
	display: grid;
	gap: 2px;
}

.settings-back {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: -6px;
	padding: 6px;
	width: fit-content;
	color: var(--accent);
	font-weight: 600;
	text-decoration: none;
}

/* Appareils tactiles : pas de survol « collé » après un appui, mais un retour visuel. */
@media (hover: none) {
	.tx-row:hover,
	.doc-row:hover,
	.batch-row.clickable:hover,
	.switcher-item:hover,
	.btn-ghost:hover,
	.nav-link:hover {
		background: transparent;
	}

	.tx-row:active,
	.doc-row:active,
	.batch-row.clickable:active,
	.settings-menu-item:active,
	.switcher-item:active,
	.check-chip:active,
	button.gc-metric:active,
	button.stat:active {
		background: var(--surface-2);
	}

	.btn:active,
	.icon-btn:active,
	.nav-link:active {
		transform: scale(0.97);
	}

	.btn,
	.icon-btn,
	.nav-link {
		transition: transform 0.08s ease, background 0.15s;
	}
}

@media (max-width: 900px) {
	/* Indicateur de l'onglet actif : pastille derrière l'icône. */
	.nav-link .icon {
		width: 52px;
		height: 30px;
		padding: 4px 0;
		border-radius: 15px;
		transition: background 0.2s;
		box-sizing: border-box;
	}

	.nav-link.active .icon {
		background: var(--accent-soft);
	}

	.nav-badge {
		position: absolute;
		top: 2px;
		left: calc(50% + 6px);
		margin: 0;
		min-width: 18px;
		height: 18px;
		padding: 0 5px;
		font-size: 0.65rem;
		box-shadow: 0 0 0 2px var(--surface);
	}

	/* Cartes repliables (administration). */
	[data-collapsible-cards] .card > .card-title {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		cursor: pointer;
		margin: 0;
	}

	[data-collapsible-cards] .card > .card-title::after {
		content: "";
		flex: none;
		width: 9px;
		height: 9px;
		border-right: 2px solid var(--text-2);
		border-bottom: 2px solid var(--text-2);
		transform: rotate(45deg) translateY(-3px);
		transition: transform 0.2s;
	}

	[data-collapsible-cards] .card.collapsed > .card-title::after {
		transform: rotate(-45deg);
	}

	[data-collapsible-cards] .card.collapsed > :not(.card-title) {
		display: none;
	}

	[data-collapsible-cards] .card.collapsed {
		padding-top: 14px;
		padding-bottom: 14px;
	}

	.main {
		padding-top: 14px;
	}

	h1 {
		letter-spacing: -0.02em;
	}
}

/* Téléphone à l'horizontale : on rend la hauteur au contenu. */
@media (max-width: 900px) and (max-height: 500px) {
	:root {
		--nav-h: 52px;
	}

	.topbar {
		padding-top: calc(4px + env(safe-area-inset-top, 0px));
		padding-bottom: 4px;
	}

	.switcher-avatar {
		width: 28px;
		height: 28px;
	}

	.nav-link {
		flex-direction: row;
		justify-content: center;
		gap: 6px;
		min-width: 0;
		overflow: hidden;
		font-size: 0.75rem;
	}

	.nav-link .icon,
	.nav-link.active .icon {
		width: 20px;
		height: 20px;
		padding: 0;
		background: transparent;
	}

	.nav-link.active {
		color: var(--accent);
	}

	.nav-capture-btn {
		width: 44px;
		height: 44px;
		margin-top: 0;
		font-size: 1.2rem;
		box-shadow: 0 6px 16px rgba(20, 184, 166, 0.35);
	}

	.nav-badge {
		position: static;
		box-shadow: none;
	}

	.drawer-head,
	.modal-head {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.modal {
		max-height: 100vh;
	}

	.doc-preview img {
		max-height: 60vh;
	}
}

/* ==========================================================================
   Ordinateur : passe de finition
   ========================================================================== */

/* Anneau de focus homogène pour la navigation au clavier. */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.input:focus-visible,
.select:focus-visible,
.main:focus,
.main:focus-visible {
	outline: none;
}

/* Tiroir étroit (détail d'une transaction : une seule colonne). */
.drawer.drawer-narrow {
	width: min(620px, 100vw);
}

/* Glisser-déposer sur toute la fenêtre. */
.drop-zone {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: grid;
	place-items: center;
	padding: 24px;
	background: color-mix(in srgb, var(--bg) 70%, transparent);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	pointer-events: none;
}

.drop-zone[hidden] {
	display: none;
}

.drop-zone-inner {
	display: grid;
	justify-items: center;
	gap: 8px;
	width: min(560px, 100%);
	padding: 56px 24px;
	border: 2px dashed var(--accent);
	border-radius: 24px;
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	text-align: center;
	color: var(--text-2);
}

.drop-zone-inner .icon {
	font-size: 2.2rem;
	color: var(--accent);
}

.drop-zone-inner strong {
	font-size: 1.2rem;
	color: var(--text);
}

.capture-drop-hint {
	margin: 0;
	text-align: center;
}

/* Raccourcis clavier. */
kbd {
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border: 1px solid var(--border);
	border-bottom-width: 2px;
	border-radius: 6px;
	background: var(--surface-2);
	color: var(--text);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
}

.shortcuts {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 10px 18px;
	align-items: center;
	margin: 0;
}

.shortcuts dt {
	display: flex;
	align-items: center;
	gap: 2px;
	white-space: nowrap;
}

.shortcuts dd {
	margin: 0;
	color: var(--text-2);
}

.menu-kbd {
	margin-left: auto;
}

/* Barres de défilement discrètes. */
@media (hover: hover) {
	.drawer-body,
	.modal-body,
	.switcher-menu,
	.batch-list,
	.pdf-list {
		scrollbar-width: thin;
		scrollbar-color: var(--border) transparent;
	}

	/* Lignes cliquables : la flèche se révèle au survol. */
	.doc-row > .icon,
	.global-tx > .icon {
		opacity: 0.35;
		transition: opacity 0.15s, transform 0.15s;
	}

	.doc-row:hover > .icon,
	.global-tx:hover > .icon {
		opacity: 1;
		transform: translateX(2px);
	}
}

@media (max-width: 900px) {
	.capture-drop-hint {
		display: none;
	}
}

/* Une carte ou un bloc ne s'élargit jamais pour son contenu : un tableau trop large défile. */
.card,
.view > *,
.stack > *,
.settings > *,
.settings-content > *,
.grid-2 > * {
	min-width: 0;
}

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

.card > * {
	min-width: 0;
}

/* ==========================================================================
   Tableau de bord mobile
   ========================================================================== */

.dash-hero {
	display: grid;
	gap: 16px;
	position: relative;
	overflow: hidden;
}

.dash-hero::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--danger);
}

.dash-hero.is-done::before {
	background: var(--success);
}

.dash-hero-top {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 16px;
	align-items: center;
}

/* Anneau de progression : part des débits justifiés. */
.dash-ring {
	--p: 0;
	--ring: var(--danger);
	position: relative;
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: conic-gradient(var(--success) calc(var(--p) * 1%), color-mix(in srgb, var(--ring) 22%, var(--surface-2)) 0);
}

.dash-ring::before {
	content: "";
	position: absolute;
	inset: 9px;
	border-radius: 50%;
	background: var(--surface);
}

.dash-ring strong {
	position: relative;
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.dash-hero-text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.dash-hero-label {
	color: var(--text-2);
	font-size: 0.8rem;
	font-weight: 600;
}

.dash-hero-big {
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--danger);
}

.dash-hero.is-done .dash-hero-big {
	color: var(--success);
}

.dash-hero-sub {
	color: var(--text-2);
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
}

.dash-hero .btn-block {
	min-height: 48px;
}

/* Raccourcis : à vérifier, relevé, coût IA. */
.dash-quick {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.dash-tile {
	display: grid;
	justify-items: start;
	gap: 2px;
	min-width: 0;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius, 14px);
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--text);
	font: inherit;
	text-align: left;
}

button.dash-tile {
	cursor: pointer;
}

.dash-tile .icon {
	margin-bottom: 4px;
	color: var(--text-2);
	font-size: 1.1rem;
}

.dash-tile strong {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 1.05rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.dash-tile span {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-2);
	font-size: 0.75rem;
}

.dash-tile.tone-warn .icon,
.dash-tile.tone-warn strong {
	color: var(--warn);
}

.legend-compact {
	justify-content: center;
	flex-wrap: nowrap;
	gap: 14px;
	font-size: 0.78rem;
}

@media (max-width: 600px) {
	/* Titre de carte et compteur sur une seule ligne. */
	.section-head {
		flex-wrap: nowrap;
	}

	.section-head h2 {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: 1rem;
	}

	.section-head > .badge {
		flex: none;
	}

	/* Pièces sans paiement (liste compacte, sans icône). */
	.doc-list.compact .doc-row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "main amount";
		align-items: center;
	}

	.doc-list.compact .doc-row > .icon {
		display: none;
	}

	/* Derniers relevés : IBAN sur une ligne. */
	.account-list li {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: 10px;
	}

	.account-list li strong {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-size: 0.88rem;
	}

	.account-list li .badge {
		white-space: nowrap;
	}

	/* Unités du graphique (viewBox de 380) : légèrement plus grand pour rester lisible. */
	.month-chart.compact .label {
		font-size: 15px;
		font-weight: 700;
	}

	.month-chart.compact .is-selected .label {
		fill: var(--text);
	}

	.month-chart.compact .count {
		font-size: 15px;
	}
}

@media (max-width: 380px) {
	.dash-ring {
		width: 70px;
		height: 70px;
	}

	.dash-ring::before {
		inset: 8px;
	}

	.dash-ring strong {
		font-size: 1rem;
	}

	.dash-hero-top {
		gap: 12px;
	}

	.dash-hero-big {
		font-size: 1.15rem;
	}

	.dash-hero-sub {
		font-size: 0.8rem;
	}

	.dash-tile {
		padding: 10px;
	}
}

@media (max-width: 900px) {
	/* Barre du bas : le bouton photo dépasse vers le haut, rien ne doit le couper. */
	.sidenav {
		top: auto;
		overflow: visible;
	}
}

@media (min-width: 901px) {
	/* Détail d'une pièce : « Enregistrer / Valider » reste visible en bas du panneau. */
	.doc-form > .form-actions {
		position: sticky;
		bottom: -20px;
		z-index: 3;
		margin: 0 -18px;
		padding: 12px 18px;
		background: var(--surface);
		border-top: 1px solid var(--border);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: 0 -8px 20px rgba(11, 16, 32, 0.05);
	}
}

/* Page Pièces : compteurs d'onglets, noms de fichiers, relance, « Afficher plus ». */
.tab-count.tone-muted {
	background: var(--surface-2);
	color: var(--text-2);
}

.tab.active .tab-count.tone-muted {
	background: var(--bg);
}

.tab-count.tone-danger {
	background: var(--danger);
}

.doc-unnamed {
	overflow-wrap: anywhere;
	font-weight: 600;
	color: var(--text-2);
}

.unread-banner {
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.unread-banner > span {
	flex: 1 1 200px;
}

.list-more {
	margin-top: 12px;
}

.list-more:empty {
	display: none;
}

@media (max-width: 600px) {
	.unread-banner .btn {
		width: 100%;
	}

	.doc-unnamed {
		font-size: 0.9rem;
	}
}

@media (max-width: 900px) {
	/* Détail d'une pièce : « Enregistrer » compact, « Valider » prend le reste de la ligne. */
	.doc-form > .form-actions {
		flex-wrap: nowrap;
	}

	.doc-form > .form-actions .btn-secondary {
		flex: 0 0 auto;
		padding: 0 14px;
	}

	.doc-form > .form-actions .btn-secondary .icon {
		display: none;
	}

	.doc-form > .form-actions .btn-primary {
		flex: 1 1 auto;
		min-width: 0;
	}

	/* Notifications en haut de l'écran : elles ne cachent plus les boutons du bas. */
	.toasts {
		top: calc(env(safe-area-inset-top, 0px) + 12px);
		bottom: auto;
		width: calc(100vw - 32px);
		justify-items: center;
	}

	.toast {
		transform: translateY(-10px);
	}
}

/* ===== Page Banque : liste par mois, ajout rapide, relevés et comptes ===== */
.tx-list.grouped .tx-row {
	grid-template-columns: 92px minmax(0, 1fr) auto auto 36px;
}

.tx-month {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 10px 6px;
	font-size: 0.85rem;
	border-bottom: 1px solid var(--border);
}

.tx-month:first-child {
	padding-top: 4px;
}

.tx-month strong {
	text-transform: capitalize;
	font-size: 0.92rem;
}

.tx-month strong {
	flex: none;
}

.tx-month .muted {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tx-month-count + .tx-month-total::before {
	content: " · ";
}

.tx-month .badge {
	flex: none;
	margin-left: auto;
}

@media (max-width: 400px) {
	/* Petit écran : le total du mois passe avant le nombre de lignes. */
	.tx-month-count {
		display: none;
	}

	.tx-month-count + .tx-month-total::before {
		content: none;
	}
}

.tx-quick {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 10px;
	background: var(--danger-soft);
	color: var(--danger);
	cursor: pointer;
	transition: transform 0.12s, background 0.12s;
}

.tx-quick:hover {
	background: var(--danger);
	color: #fff;
}

.tx-quick:active {
	transform: scale(0.92);
}

.tx-quick .icon {
	width: 18px;
	height: 18px;
}

.check-chip-amount {
	color: var(--text-3);
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
}

.filters-toggle {
	position: relative;
}

.filters-count {
	display: inline-grid;
	place-items: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
}

.filters-count[hidden] {
	display: none;
}

.filter-note {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 12px;
	margin-bottom: 10px;
	border-radius: var(--radius-sm);
	background: var(--info-soft);
	color: var(--info);
	font-size: 0.88rem;
}

.filter-note > .icon {
	flex: none;
	width: 18px;
	height: 18px;
}

.filter-note > span {
	flex: 1 1 auto;
	min-width: 0;
}

.filter-note .btn {
	flex: none;
}

.filter-note:empty,
div:empty > .filter-note {
	display: none;
}

.statement-row .doc-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.statement-row .doc-main > span {
	font-size: 0.85rem;
	overflow-wrap: anywhere;
}

.statement-period {
	color: var(--text);
}

.statement-balance {
	color: var(--text-2);
	font-variant-numeric: tabular-nums;
}

.statement-balance b {
	font-weight: 600;
	color: var(--text);
}

.statement-row .row-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.bank-accounts li {
	grid-template-columns: 44px minmax(0, 1fr) auto;
	gap: 14px;
	padding: 14px 0;
}

.account-icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent);
}

.account-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.account-main .mono {
	font-size: 0.85rem;
	overflow-wrap: anywhere;
}

.bank-accounts .row-actions {
	display: flex;
	gap: 6px;
}

.pick-list {
	max-height: min(60vh, 480px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.pick-list li > .badge {
	white-space: nowrap;
}

@media (max-width: 900px) {
	/* En-tête de mois collé sous la barre du haut pendant le défilement. */
	.tx-month {
		position: sticky;
		top: var(--topbar-h, 60px);
		z-index: 1;
		background: var(--bg);
		margin: 0 -4px;
		padding: 12px 8px 6px;
	}

	.tx-month:first-child {
		padding-top: 6px;
	}

	.tx-month .muted {
		font-size: 0.8rem;
	}

	.tx-list.grouped .tx-row {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: "main main amount" "date badges badges";
	}

	/* Ligne sans pièce : le bouton photo remplace la pastille « Pièce manquante ». */
	.tx-list.grouped .tx-row.has-quick {
		grid-template-columns: auto minmax(0, 1fr) auto 40px;
		grid-template-areas: "main main amount quick" "date badges badges quick";
	}

	.tx-row.has-quick .tx-badges > .badge-danger:first-child {
		display: none;
	}

	.tx-row .tx-quick {
		grid-area: quick;
		align-self: center;
		justify-self: end;
		width: 40px;
		height: 40px;
	}

	.check-chip {
		flex-wrap: nowrap;
		white-space: nowrap;
	}

	.statement-row {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: start;
		gap: 8px 10px;
		padding: 14px 4px;
	}

	.statement-row .row-actions {
		grid-column: 1 / -1;
		justify-content: flex-end;
		margin-top: 2px;
	}

	.statement-row .row-actions .btn-sm:first-child {
		margin-right: auto;
	}

	.bank-accounts li {
		grid-template-columns: 40px minmax(0, 1fr);
		gap: 6px 12px;
		align-items: start;
	}

	.bank-accounts .account-icon {
		width: 40px;
		height: 40px;
	}

	.bank-accounts .row-actions {
		grid-column: 2;
		justify-content: flex-start;
		margin-left: -10px;
	}

	.filter-note {
		font-size: 0.84rem;
	}
}

/* Facture payée en plusieurs fois (acompte, solde). */
.pay-line {
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--text);
}

.pick-partial {
	font-size: 0.8rem;
	color: var(--warn);
	white-space: normal !important;
}

.add-payment {
	justify-self: start;
	align-self: flex-start;
	white-space: normal;
	text-align: left;
	height: auto;
	min-height: 36px;
}

.pay-list li {
	margin-bottom: 6px;
}

@media (max-width: 600px) {
	/* Encadré de la pièce liée : texte sur toute la largeur, boutons en dessous. */
	.link-box:has(> .row-actions) {
		flex-wrap: wrap;
	}

	.link-box:has(> .row-actions) > div:not(.row-actions) {
		flex: 1 1 calc(100% - 40px);
	}

	.link-box > .row-actions {
		flex: 1 1 100%;
		display: flex;
		justify-content: flex-end;
		gap: 8px;
	}
}

/* Pièces : onglet « À lier » et motif « à vérifier » dans la liste. */
.tab-count.tone-accent {
	background: var(--accent);
	color: #fff;
}

.doc-reason {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 0.8rem;
	color: var(--warn);
	line-height: 1.35;
}

.doc-reason .icon {
	margin-top: 1px;
}

.doc-reason > span {
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ai-reason {
	display: flex;
	gap: 6px;
	align-items: flex-start;
	font-size: 0.8rem;
	color: var(--accent-2);
	white-space: normal !important;
}

.ai-reason > span {
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
}

/* ===== Activité : indicateur de la barre du haut et panneau des tâches ===== */
.activity-btn {
	position: relative;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	flex: none;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
	color: var(--text-2);
	cursor: pointer;
	margin-right: 8px;
}

.activity-btn:hover {
	color: var(--text);
	background: var(--surface-2);
}

.activity-btn .icon {
	width: 18px;
	height: 18px;
}

.activity-btn.is-active {
	color: var(--accent);
	border-color: var(--accent);
}

.activity-btn.is-active .icon {
	animation: escan-pulse 1.4s ease-in-out infinite;
}

.activity-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	border: 2px solid var(--surface);
	box-sizing: content-box;
}

.activity-count[hidden] {
	display: none;
}

.activity-btn.has-failed .activity-count {
	background: var(--danger);
}

@keyframes escan-pulse {
	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.activity-btn.is-active .icon {
		animation: none;
	}
}

.act-section-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.act-section-head .subhead {
	margin: 0;
}

.act-section-head .btn {
	margin-left: auto;
}

.act-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.act-group,
.act-failed {
	display: grid;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
}

.act-group.is-running {
	border-color: var(--accent);
}

.act-failed {
	border-color: var(--danger-soft);
}

.act-head {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.act-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text-2);
}

.act-icon.tone-danger {
	background: var(--danger-soft);
	color: var(--danger);
}

.act-icon .spinner {
	width: 16px;
	height: 16px;
}

.act-title {
	display: grid;
	gap: 1px;
	min-width: 0;
}

.act-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--surface-2);
	overflow: hidden;
}

.act-progress > span {
	display: block;
	height: 100%;
	background: var(--accent);
	border-radius: inherit;
	transition: width 0.4s;
}

.act-note {
	display: flex;
	gap: 6px;
	margin: 0;
	font-size: 0.8rem;
	color: var(--warn);
}

.act-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 4px;
	font-size: 0.84rem;
}

.act-items li {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.act-dot {
	width: 8px;
	height: 8px;
	flex: none;
	border-radius: 50%;
	background: var(--ignored);
}

.act-dot.status-running {
	background: var(--accent);
}

.act-dot.status-waiting {
	background: var(--warn);
}

.act-object {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	border: 0;
	padding: 0;
	background: none;
	color: var(--text);
	font: inherit;
	font-size: 0.84rem;
	text-align: left;
}

button.act-object {
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: var(--border);
	text-underline-offset: 3px;
}

.act-error {
	margin: 0;
	font-size: 0.82rem;
	color: var(--text-2);
	overflow-wrap: anywhere;
}

.act-actions {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
}

.act-done {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 6px 2px;
	font-size: 0.86rem;
	border-bottom: 1px solid var(--border);
}

.act-done:last-child {
	border-bottom: 0;
}

.act-done-list {
	gap: 0;
}

.act-done .tone-success {
	color: var(--success);
}

.act-foot {
	text-align: center;
}

@media (max-width: 600px) {
	.activity-btn {
		width: 36px;
		height: 36px;
		margin-right: 6px;
	}
}

/* Frais bancaires : réglage et proposition de l'IA. */
.fees-box {
	display: grid;
	gap: 10px;
	padding: 14px;
	margin-bottom: 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
}

.fees-head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.fees-head > div {
	display: grid;
	gap: 2px;
}

.fees-head .icon {
	color: var(--accent);
	margin-top: 2px;
}

.link-box.fee-hint {
	background: var(--info-soft);
}

.link-box.fee-hint > .icon {
	color: var(--accent-2);
}

/* ===== AbaNinja « À imputer » : liste compacte ===== */
.bk-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-size: 0.9rem;
	color: var(--text-2);
}

.bk-summary strong {
	color: var(--text);
	font-variant-numeric: tabular-nums;
}

.bk-summary a {
	color: inherit;
	text-decoration: none;
}

.bk-toolbar {
	align-items: center;
	gap: 10px;
}

.bk-toolbar .toolbar-spacer {
	flex: 1;
}

.bk-filter .tab-count {
	margin-left: 6px;
}

.bk-ai-note {
	margin: 0;
	align-items: center;
}

.bk-ai-note .spinner {
	width: 14px;
	height: 14px;
}

.bk-head,
.bk-line {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) 120px 230px auto;
	align-items: center;
	gap: 12px;
}

.bk-head {
	padding: 0 12px 6px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--text-3);
	border-bottom: 1px solid var(--border);
}

.bk-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.bk-row {
	border-bottom: 1px solid var(--border);
	transition: background 0.15s;
}

.bk-row:last-child {
	border-bottom: 0;
}

.bk-row:hover {
	background: var(--surface-2);
}

.bk-row.is-open {
	background: var(--surface-2);
}

.bk-row.is-done {
	opacity: 0.55;
}

.bk-row.is-updated .bk-account {
	border-color: var(--accent);
}

.bk-line {
	padding: 10px 12px;
	cursor: pointer;
}

.bk-check {
	display: grid;
	place-items: center;
}

.bk-check input {
	width: 18px;
	height: 18px;
}

.bk-main {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.bk-main strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bk-sub {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	font-size: 0.8rem;
	color: var(--text-3);
	white-space: nowrap;
	overflow: hidden;
}

.bk-sub > span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
}

.bk-sub .icon {
	width: 14px;
	height: 14px;
	flex: none;
}

.bk-amount {
	justify-content: flex-end;
	white-space: nowrap;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.bk-acc {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.bk-acc-input {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bk-account {
	width: 92px;
	flex: none;
}

.bk-acc-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.75rem;
}

.acc-src {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 0.7rem;
	font-weight: 600;
	white-space: nowrap;
}

.acc-src .icon {
	width: 11px;
	height: 11px;
}

.acc-src.is-rule {
	background: var(--success-soft);
	color: var(--success);
}

.acc-src.is-ai {
	background: var(--info-soft);
	color: var(--accent-2);
}

.acc-src.is-manual {
	background: var(--warn-soft);
	color: var(--warn);
}

.bk-ai-chip {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	padding: 2px 8px;
	border: 1px dashed var(--accent-2);
	border-radius: 999px;
	background: none;
	color: var(--accent-2);
	font: inherit;
	font-size: 0.72rem;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bk-ai-chip .icon {
	width: 11px;
	height: 11px;
	flex: none;
}

.bk-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bk-state {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
}

.bk-state .icon {
	width: 15px;
	height: 15px;
}

.bk-state.is-ready {
	background: var(--success-soft);
	color: var(--success);
}

.bk-state.is-todo {
	background: var(--warn-soft);
	color: var(--warn);
}

.bk-state .spinner {
	width: 14px;
	height: 14px;
}

.bk-more .icon {
	transition: transform 0.15s;
}

.bk-row.is-open .bk-more .icon {
	transform: rotate(180deg);
}

.bk-extra {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 0 12px 0 52px;
}

.bk-extra:has(> :not([hidden])) {
	padding-bottom: 8px;
}

.bk-extra .bk-status:empty {
	display: none;
}

.bk-pin {
	font-size: 0.78rem;
	min-height: 30px;
}

.bk-details {
	padding: 4px 12px 14px 52px;
	display: grid;
	gap: 10px;
}

.bk-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px 14px;
}

.bk-detail-grid .bk-text {
	grid-column: 1 / -1;
}

.bk-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

@media (max-width: 900px) {
	.bk-head {
		grid-template-columns: 28px minmax(0, 1fr);
	}

	.bk-head > span:nth-child(n + 3) {
		display: none;
	}

	.bk-line {
		grid-template-columns: 28px minmax(0, 1fr) auto;
		grid-template-areas: "check main amount" "check acc actions";
		gap: 6px 10px;
		padding: 12px 10px;
	}

	.bk-line > .bk-check {
		grid-area: check;
		align-self: start;
		padding-top: 2px;
	}

	.bk-main {
		grid-area: main;
	}

	.bk-amount {
		grid-area: amount;
		align-self: start;
	}

	.bk-acc {
		grid-area: acc;
	}

	.bk-actions {
		grid-area: actions;
		justify-self: end;
	}

	.bk-extra,
	.bk-details {
		padding-left: 48px;
		padding-right: 10px;
	}

	.bk-toolbar {
		flex-wrap: wrap;
	}

	.bk-toolbar .btn-primary {
		width: 100%;
	}

	.bk-toolbar .toolbar-spacer {
		display: none;
	}
}

.bk-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bk-filter button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 4px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-2);
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.bk-filter button.active {
	border-color: var(--text);
	color: var(--text);
	font-weight: 600;
}

.bk-filter .tab-count {
	margin-left: 0;
}

.bk-reason {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 0.8rem;
	color: var(--warn);
	min-width: 0;
}

.bk-reason .icon {
	width: 14px;
	height: 14px;
	flex: none;
	margin-top: 1px;
}

.bk-extra:not(:has(> .bk-reason, > .bk-pin:not([hidden]), > .bk-status:not(:empty))) {
	display: none;
}
