:root {
	/* été → automne : lumière chaude, verts doux → cuivre / bordeaux */
	--ink: #2a2418;
	--forest: #3d5a3a;
	--walnut: #6a3a22;
	--walnut-2: #4a2e1c;
	--walnut-3: #8a5230;
	--brass: #c9a04a;
	--brass-2: #f0d48a;
	--brass-dark: #8a6428;
	--paper: #f7f0e0;
	--paper-2: #efe4cc;
	--cream: #fff8ec;
	--blotter: #5a7a4e;
	--wine: #9a3a3a;
	--wine-2: #b04a48;
	--leather: #7a3e28;
	--leather-2: #5a2e1c;
	--muted: #6e5c48;
	--muted-inv: #efe2c4;
	--text: #2a2418;
	--text-inv: #fff6e8;
	--line: rgba(106, 58, 34, 0.16);
	--gold: #c9a04a;
	--gold-2: #f0d48a;
	--ok: #4a7a44;
	--off: #b04a48;
	--warn: #c98a3a;
	--olive: #5a7a4e;
	--terracotta: #c4683a;
	--amber: #e0a84a;
	--sun: #f2c86a;
	--leaf: #7a9a5a;
	--copper: #b86a3a;
	--side: 272px;
	--serif: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
	--sans: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
	margin: 0;
	min-height: 100%;
	background:
		radial-gradient(ellipse 90% 60% at 70% -10%, rgba(242, 200, 106, 0.35), transparent 55%),
		radial-gradient(ellipse 70% 50% at 10% 100%, rgba(122, 154, 90, 0.18), transparent 50%),
		linear-gradient(165deg, #f3e6c8 0%, #e8d4a8 42%, #d8b888 100%);
	color: var(--text);
}
body {
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.5;
}

.grain {
	pointer-events: none;
	position: fixed;
	inset: 0;
	z-index: 120;
	opacity: 0.11;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.season {
	pointer-events: none;
	position: fixed;
	inset: 0;
	z-index: 0;
	opacity: 0.14;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cpath fill='%23c4683a' d='M40 36c22 6 34 22 30 40-16-4-30-16-30-40z'/%3E%3Cpath fill='%23e0a84a' d='M150 88c20 10 26 30 18 44-18-6-30-20-18-44z'/%3E%3Cpath fill='%237a9a5a' d='M96 150c16 12 14 30 0 40-12-10-20-26 0-40z'/%3E%3C/svg%3E");
	background-size: 320px 320px;
}

.hidden { display: none !important; }

h1, h2 {
	font-family: var(--serif);
	font-weight: 600;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--ink);
}
h1 { font-size: clamp(1.7rem, 3vw, 2.55rem); }
h2 { font-size: 1.35rem; }
h3 {
	font-family: var(--sans);
	font-size: 0.7rem;
	margin: 0.75rem 0 0.35rem;
	color: var(--wine);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.eyebrow {
	margin: 0 0 0.3rem;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-size: 0.66rem;
	color: var(--wine);
	font-weight: 700;
}
.lede {
	color: var(--muted);
	margin: 0.4rem 0 0;
	line-height: 1.6;
	font-size: 0.98rem;
}

:focus-visible {
	outline: 2px solid var(--brass-dark);
	outline-offset: 3px;
}

.crest.mini {
	width: 54px;
	height: 54px;
	object-fit: cover;
	object-position: center;
	flex: 0 0 auto;
	border: 2px solid var(--brass);
	border-radius: 4px;
	background: var(--leather);
	box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.18);
}

/* ——— Seuil : cabinet au crépuscule ——— */
.gate {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(340px, 480px);
	grid-template-rows: 1fr auto;
	background: #140c0a;
	color: var(--text-inv);
	overflow: hidden;
}
.office {
	grid-column: 1;
	grid-row: 1 / -1;
	position: relative;
	overflow: hidden;
	background: #1a100c;
}
.office-sky {
	position: absolute;
	inset: 0 18% 28% 6%;
	background:
		radial-gradient(ellipse 80% 50% at 70% 18%, rgba(232, 150, 70, 0.55), transparent 55%),
		radial-gradient(ellipse 60% 40% at 30% 8%, rgba(110, 70, 90, 0.4), transparent 50%),
		linear-gradient(180deg, #7eb8d8 0%, #f0c878 36%, #e88848 58%, #c4683a 78%, #8a4a28 100%);
	transform: scale(1.06);
}
.gate-enter .office-sky { animation: dusk-shift 7s ease-out forwards; }
.office-trees {
	position: absolute;
	inset: 8% 20% 32% 8%;
	background:
		radial-gradient(ellipse 18px 70px at 12% 78%, #0e120e 70%, transparent 72%),
		radial-gradient(ellipse 90px 70px at 12% 42%, #152016 68%, transparent 70%),
		radial-gradient(ellipse 22px 90px at 38% 82%, #0c100c 70%, transparent 72%),
		radial-gradient(ellipse 120px 80px at 40% 40%, #1a2618 66%, transparent 68%),
		radial-gradient(ellipse 16px 60px at 68% 80%, #101410 70%, transparent 72%),
		radial-gradient(ellipse 80px 60px at 72% 48%, #182018 68%, transparent 70%),
		radial-gradient(ellipse 140px 50px at 88% 36%, #121a12 64%, transparent 66%);
	opacity: 0.72;
	filter: blur(0.4px);
}
.gate-bg {
	position: absolute;
	inset: 10% 22% 34% 10%;
	background: url("/banner.png?v=2") center / cover no-repeat;
	opacity: 0.28;
	mix-blend-mode: soft-light;
	filter: saturate(0.7) brightness(0.7);
	transform: scale(1.08);
}
.gate-enter .gate-bg { animation: gate-zoom 8s ease-out forwards; }
.office-window {
	position: absolute;
	left: 7%;
	top: 8%;
	width: min(72%, 640px);
	height: 58%;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	grid-template-rows: 1fr 1fr 1fr 1fr;
	gap: 7px;
	padding: 10px;
	background: #2a1a12;
	border: 12px solid #2e1c14;
	box-shadow:
		inset 0 0 0 3px var(--brass),
		0 28px 70px rgba(0, 0, 0, 0.5),
		0 0 80px rgba(196, 104, 58, 0.12);
}
.office-window span {
	background: linear-gradient(180deg, rgba(255, 210, 140, 0.08), rgba(20, 10, 8, 0.12));
	box-shadow: inset 0 0 18px rgba(20, 8, 4, 0.18);
}
.office-mullion {
	position: absolute;
	left: 7%;
	top: 8%;
	width: min(72%, 640px);
	height: 58%;
	pointer-events: none;
	background:
		linear-gradient(var(--brass-dark), var(--brass-dark)) 33.3% 0 / 7px 100% no-repeat,
		linear-gradient(var(--brass-dark), var(--brass-dark)) 66.6% 0 / 7px 100% no-repeat;
	opacity: 0.35;
}
.office-sill {
	position: absolute;
	left: 5%;
	top: calc(8% + 58% - 8px);
	width: min(76%, 680px);
	height: 22px;
	background: linear-gradient(180deg, #5a3a28, #2a1810);
	box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}
.office-curtain {
	position: absolute;
	top: 4%;
	width: 9%;
	height: 64%;
	background:
		repeating-linear-gradient(90deg, #4a1820 0 10px, #3a1218 10px 14px);
	box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
	opacity: 0.88;
}
.office-curtain.c-left { left: 4%; }
.office-curtain.c-right { left: calc(7% + min(72%, 640px) - 2%); }
.office-wall {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(20, 10, 8, 0.55) 0%, transparent 18%, transparent 70%, rgba(20, 10, 8, 0.7) 100%),
		linear-gradient(180deg, transparent 62%, #1a100c 78%);
	pointer-events: none;
}
.office-desk {
	position: absolute;
	left: 0;
	right: 32%;
	bottom: 0;
	height: 26%;
	background:
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 11px),
		linear-gradient(180deg, #5a3824 0%, #3a2418 18%, #24140e 100%);
	box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.4);
}
.office-lamp {
	position: absolute;
	left: 18%;
	bottom: 24%;
	width: 14px;
	height: 70px;
	background: linear-gradient(90deg, #7a5c28, var(--brass), #7a5c28);
	border-radius: 2px;
}
.office-lamp i {
	position: absolute;
	top: -18px;
	left: -22px;
	width: 58px;
	height: 28px;
	background: radial-gradient(ellipse at 50% 100%, #e2c47a, #8e3540 70%);
	clip-path: polygon(12% 100%, 88% 100%, 100% 0, 0 0);
	box-shadow: 0 0 40px rgba(226, 196, 122, 0.45);
}
.gate-glow {
	position: absolute;
	left: 8%;
	bottom: 8%;
	width: 42%;
	height: 38%;
	pointer-events: none;
	background: radial-gradient(ellipse at 30% 20%, rgba(226, 196, 122, 0.28), transparent 62%);
	opacity: 0;
}
.gate-enter .gate-glow { animation: gate-glow 1.6s ease forwards; }
.office-plate {
	position: absolute;
	left: 28%;
	bottom: 8%;
	padding: 0.55rem 1.1rem 0.45rem;
	background: linear-gradient(180deg, #c4a35a, #8a6a32);
	color: #1a120c;
	box-shadow: 0 8px 0 #2a1810, 0 14px 24px rgba(0, 0, 0, 0.35);
	min-width: 9.5rem;
	text-align: center;
}
.office-plate strong {
	display: block;
	font-family: var(--serif);
	font-size: 1.15rem;
	letter-spacing: 0.04em;
}
.office-plate em {
	font-style: normal;
	font-size: 0.62rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.8;
}

.fall {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
}
.fall i {
	position: absolute;
	top: -12%;
	width: 14px;
	height: 16px;
	background: #8e3540;
	clip-path: polygon(50% 0, 90% 28%, 72% 100%, 50% 78%, 28% 100%, 10% 28%);
	opacity: 0.7;
	animation: leaf-fall 14s linear infinite;
}
.fall i:nth-child(1) { left: 8%; background: #8e3540; animation-duration: 13s; animation-delay: -1s; }
.fall i:nth-child(2) { left: 18%; background: #b8924a; animation-duration: 16s; animation-delay: -4s; width: 11px; }
.fall i:nth-child(3) { left: 28%; background: #6a3a18; animation-duration: 12s; animation-delay: -7s; }
.fall i:nth-child(4) { left: 40%; background: #722832; animation-duration: 18s; animation-delay: -2s; width: 16px; }
.fall i:nth-child(5) { left: 52%; background: #b8924a; animation-duration: 11s; animation-delay: -9s; }
.fall i:nth-child(6) { left: 62%; background: #3d6a3c; animation-duration: 15s; animation-delay: -5s; width: 10px; }
.fall i:nth-child(7) { left: 70%; background: #8e3540; animation-duration: 17s; animation-delay: -11s; }
.fall i:nth-child(8) { left: 78%; background: #c4783a; animation-duration: 13.5s; animation-delay: -3s; }
.fall i:nth-child(9) { left: 12%; background: #5a4020; animation-duration: 19s; animation-delay: -8s; }
.fall i:nth-child(10) { left: 34%; background: #b8924a; animation-duration: 14s; animation-delay: -6s; }
.fall i:nth-child(11) { left: 48%; background: #722832; animation-duration: 12.5s; animation-delay: -10s; }
.fall i:nth-child(12) { left: 66%; background: #2c4636; animation-duration: 16.5s; animation-delay: -1.5s; }

.gate-intro {
	grid-column: 1;
	grid-row: 1;
	align-self: end;
	z-index: 3;
	padding: 0 8% 12% 8%;
	max-width: 34rem;
	opacity: 0;
	transform: translateY(16px);
}
.gate-enter .gate-intro { animation: hail-in 0.9s 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.gate-intro h1 {
	color: var(--cream);
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
	font-size: clamp(2rem, 4.2vw, 3.4rem);
	line-height: 0.95;
	margin-top: 0.15rem;
}
.gate-intro .lede {
	color: #f0e4cc;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
	font-size: 1.08rem;
	max-width: 26rem;
}
.gate-intro .kicker {
	margin: 0.7rem 0 0;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	font-size: 0.68rem;
	color: var(--brass-2);
	font-weight: 700;
}
.mono {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: radial-gradient(circle at 35% 30%, #e2c47a, #8e3540 62%, #4a1818 100%);
	box-shadow: 0 0 0 4px rgba(184, 146, 74, 0.35), 0 10px 24px rgba(0, 0, 0, 0.4);
	margin-bottom: 0.7rem;
}
.mono b {
	font-family: var(--serif);
	font-size: 1.35rem;
	color: #f8f1e2;
	letter-spacing: 0.06em;
}
.gate-logo-frame {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--brass-2);
	box-shadow: 0 0 0 4px rgba(184, 146, 74, 0.22), 0 10px 22px rgba(0, 0, 0, 0.35);
	margin: 0 0 0.75rem;
	background: #2a1810;
}
.gate-logo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

.gate-wrap {
	grid-column: 2;
	grid-row: 1;
	position: relative;
	z-index: 4;
	display: grid;
	align-content: center;
	padding: 2rem 1.6rem 1.4rem;
	background:
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 9px),
		linear-gradient(180deg, #3a1c18 0%, #2a1210 40%, #1e0e0c 100%);
	border-left: 1px solid rgba(226, 196, 122, 0.28);
	box-shadow: -24px 0 50px rgba(0, 0, 0, 0.35);
}
.gate-card {
	background:
		linear-gradient(180deg, rgba(184, 146, 74, 0.12), transparent 18%),
		var(--paper);
	color: var(--ink);
	padding: 1.7rem 1.55rem 1.35rem;
	border-radius: 2px;
	display: grid;
	gap: 0.85rem;
	box-shadow:
		0 0 0 10px var(--leather),
		0 0 0 12px var(--brass),
		0 0 0 18px var(--leather-2),
		18px 22px 40px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(18px);
}
.gate-enter .gate-card { animation: hail-in 0.85s 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.gate-card .eyebrow { color: var(--wine); }
.gate-card h2 {
	color: var(--ink);
	font-size: 1.7rem;
	line-height: 1.1;
}
.gate-card .lede { color: #5c4c3c; margin: 0 0 0.2rem; font-style: italic; font-family: var(--serif); font-size: 1.05rem; }
.gate-card label span {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wine);
	margin-bottom: 0.25rem;
}
.gate-card input {
	width: 100%;
	background: transparent;
	color: var(--ink);
	border: 0;
	border-bottom: 1px solid rgba(58, 36, 24, 0.35);
	border-radius: 0;
	padding: 0.45rem 0 0.4rem;
	font-family: var(--serif);
	font-size: 1.22rem;
	box-shadow: none;
}
.gate-card input:focus {
	border-color: var(--wine);
	box-shadow: none;
	outline: none;
}
.gate-card input::placeholder { color: #a09078; font-style: italic; }
.seal {
	margin-top: 0.55rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	background: linear-gradient(180deg, #c4a35a, #8a5c28);
	color: #1a120c;
	border: 0;
	border-radius: 2px;
	padding: 0.7rem 1rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.78rem;
	box-shadow: 0 4px 0 #4a2c10, 0 10px 18px rgba(0, 0, 0, 0.22);
}
.seal:hover { filter: brightness(1.06); }
.seal-mark {
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: radial-gradient(circle at 35% 30%, #e8c97a, var(--wine) 70%);
	color: #f8f1e2;
	font-family: var(--serif);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	box-shadow: inset 0 0 0 2px rgba(248, 241, 226, 0.35);
	flex: 0 0 auto;
}
.gate-card .error { color: var(--wine); text-shadow: none; min-height: 1.1em; margin: 0; }
.gate-hint { margin: 0; color: #7a6a58; font-size: 0.78rem; }
.gate-foot {
	grid-column: 1 / -1;
	grid-row: 2;
	position: relative;
	z-index: 4;
	text-align: center;
	color: rgba(244, 234, 212, 0.78);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	margin: 0;
	padding: 0.55rem 1rem;
	background: rgba(14, 8, 6, 0.72);
	border-top: 1px solid rgba(184, 146, 74, 0.22);
}
.gate.denied .gate-card {
	animation: gate-shake 0.35s ease;
	box-shadow:
		0 0 0 10px var(--leather),
		0 0 0 12px var(--wine),
		0 0 0 18px var(--leather-2),
		18px 22px 40px rgba(0, 0, 0, 0.45);
}
@keyframes gate-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-6px); }
	75% { transform: translateX(6px); }
}

input, button, select, textarea {
	font: inherit;
	border-radius: 2px;
	border: 1px solid var(--line);
}
input, select, textarea {
	background: var(--cream);
	color: var(--ink);
	padding: 0.72rem 0.9rem;
	outline: none;
}
input:focus, select:focus, textarea:focus {
	border-color: var(--brass-dark);
	box-shadow: 0 0 0 3px rgba(184, 146, 74, 0.22);
}
button {
	background: linear-gradient(180deg, var(--brass-2), var(--brass));
	color: #1a120c;
	padding: 0.68rem 1rem;
	font-weight: 700;
	cursor: pointer;
	border: 0;
	letter-spacing: 0.02em;
}
button:hover { filter: brightness(1.05); }
button.ghost {
	background: transparent;
	color: var(--walnut);
	border: 1px solid rgba(58, 36, 24, 0.28);
}
button.tiny, .btn-ok, .btn-no {
	padding: 0.32rem 0.6rem;
	font-size: 0.72rem;
	border-radius: 2px;
}
.btn-ok { background: var(--ok); color: #f4ead4; }
.btn-no { background: var(--wine); color: #f4ead4; }
.error { color: var(--off); min-height: 1.2em; font-size: 0.9rem; }

/* ——— Cabinet : rail de dossiers ——— */
.shell {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: var(--side) 1fr;
	min-height: 100vh;
	background:
		radial-gradient(ellipse 80% 40% at 100% 0%, rgba(242, 200, 106, 0.22), transparent 50%),
		var(--paper);
}

.side {
	border-right: 0;
	background:
		repeating-linear-gradient(90deg, rgba(255, 240, 200, 0.04) 0 1px, transparent 1px 8px),
		linear-gradient(165deg, #6a8a4a 0%, #8a6a38 28%, #a86838 62%, #8a3e2a 100%);
	padding: 1.15rem 0.75rem 1.1rem 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: auto;
	color: var(--text-inv);
	box-shadow: inset -14px 0 24px rgba(60, 30, 10, 0.18);
}
.morning {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin: 0 0 0.9rem;
}
.morning button {
	background: linear-gradient(180deg, #f2d48a, #d4a04a);
	box-shadow: 0 2px 0 #8a6428;
}
.morning button.ghost {
	background: rgba(255, 248, 236, 0.55);
	box-shadow: none;
}
.nav button[hidden] { display: none !important; }
.rail-bar {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 8px;
	background: linear-gradient(180deg, var(--brass-2), var(--brass-dark));
	box-shadow: 2px 0 0 #1a0e0a;
}
.brand {
	display: flex;
	gap: 0.7rem;
	align-items: center;
	padding: 0.35rem 0.45rem 0.5rem 0.55rem;
}
.brand .eyebrow { color: var(--brass-2); }
.brand strong {
	font-family: var(--serif);
	font-size: 1.2rem;
	display: block;
	color: var(--cream);
}
.plate {
	margin: 0 0.4rem 0.2rem;
	padding: 0.45rem 0.65rem 0.4rem;
	background: linear-gradient(180deg, #c4a35a, #8a6a32);
	color: #1a120c;
	text-align: center;
	box-shadow: 0 3px 0 #1a0e0a;
}
.plate span {
	display: block;
	font-family: var(--serif);
	font-weight: 700;
	font-size: 1rem;
}
.plate em {
	font-style: normal;
	font-size: 0.6rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.nav { display: grid; gap: 0.18rem; }
.nav button {
	background: linear-gradient(90deg, rgba(20, 10, 8, 0.5), rgba(58, 36, 24, 0.35));
	color: var(--muted-inv);
	text-align: left;
	padding: 0.48rem 0.7rem 0.48rem 0.85rem;
	border: 1px solid transparent;
	border-left: 3px solid transparent;
	text-transform: none;
	letter-spacing: 0;
	font-size: 0.88rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	border-radius: 0 12px 12px 0;
	margin-right: 0.2rem;
}
.nav-ico {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.nav button.on {
	color: var(--ink);
	background: var(--paper);
	border-color: rgba(184, 146, 74, 0.45);
	border-left-color: var(--wine);
	box-shadow: 0 0 0 1px rgba(184, 146, 74, 0.35);
	font-weight: 700;
}
.nav button:hover:not(.on) {
	color: var(--cream);
	border-color: rgba(184, 146, 74, 0.22);
	background: rgba(114, 40, 50, 0.22);
}
.nav button.on::after {
	content: "";
	margin-left: auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wine);
	box-shadow: 0 0 0 2px var(--brass);
}

.side-bots { margin-top: auto; display: grid; gap: 0.35rem; }
.side-bot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.75rem;
	color: var(--muted-inv);
	padding: 0.35rem 0.5rem;
	gap: 0.5rem;
	border-top: 1px solid rgba(184, 146, 74, 0.12);
}
.dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--off);
}
.dot.on { background: #7d9a58; }

.switch {
	position: relative;
	width: 36px;
	height: 20px;
	flex: 0 0 auto;
	cursor: pointer;
}
.switch input { display: none; }
.switch i {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: #3a2a20;
	border: 1px solid rgba(184, 146, 74, 0.28);
	transition: 0.2s ease;
}
.switch i::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #cbb89a;
	transition: 0.2s ease;
}
.switch input:checked + i {
	background: var(--ok);
	border-color: rgba(125, 154, 88, 0.6);
}
.switch input:checked + i::after {
	transform: translateX(16px);
	background: #f6efe4;
}

.ver-badge {
	margin-top: 0.4rem;
	background: transparent;
	color: var(--brass-2);
	border: 1px solid rgba(184, 146, 74, 0.35);
	border-radius: 2px;
	padding: 0.4rem 0.7rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
}

.ver-notes {
	margin: 1rem 0 0;
	padding-left: 1.1rem;
	color: var(--text);
	line-height: 1.7;
}
.ver-log {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}
.ver-log li {
	display: grid;
	grid-template-columns: auto auto 1fr auto;
	grid-template-areas: "when bot action src" "detail detail detail detail";
	gap: 0.15rem 0.7rem;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: 2px;
	background: var(--cream);
	font-size: 0.88rem;
}
.ver-log li.ko { border-color: rgba(142, 53, 64, 0.5); }
.ver-when { grid-area: when; color: var(--muted); font-size: 0.78rem; }
.ver-log strong { grid-area: bot; }
.ver-log code { grid-area: action; color: var(--wine); }
.ver-src {
	grid-area: src;
	font-style: normal;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--brass-dark);
}
.ver-log .muted { grid-area: detail; color: var(--muted); font-size: 0.82rem; }
.ver-who { color: var(--wine); font-weight: 650; }

/* ——— Buvard ——— */
.main {
	padding: 1.4rem 1.8rem 3.2rem;
	min-width: 0;
	background:
		linear-gradient(90deg, var(--blotter) 0 14px, transparent 14px),
		linear-gradient(180deg, var(--cream) 0%, var(--paper) 40%, var(--paper-2) 100%);
	color: var(--ink);
	box-shadow: inset 18px 0 28px rgba(20, 12, 8, 0.06);
}
.top {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 1rem;
	margin-bottom: 1.15rem;
	padding-bottom: 0.85rem;
	border-bottom: 2px solid rgba(58, 36, 24, 0.12);
}
.top-right { display: flex; align-items: center; gap: 0.75rem; }
.whoami {
	color: var(--wine);
	font-family: var(--serif);
	font-size: 1rem;
	font-weight: 600;
	font-style: italic;
	max-width: 10rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.clock {
	font-variant-numeric: tabular-nums;
	color: var(--muted);
	letter-spacing: 0.08em;
	font-size: 0.88rem;
}
#logout.ghost { color: var(--walnut); }

.dossier-stamp {
	margin: 0 0 1rem;
	display: inline-block;
	padding: 0.22rem 0.7rem;
	border: 2px solid var(--wine);
	color: var(--wine);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: 0.64rem;
	font-weight: 800;
	transform: rotate(-2deg);
	opacity: 0.85;
}

.panel {
	padding: 1.05rem 1.15rem;
	border: 1px solid rgba(58, 36, 24, 0.14);
	border-radius: 2px;
	background: var(--cream);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 8px 18px rgba(40, 24, 12, 0.06);
}
.kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.7rem;
	margin-bottom: 0.9rem;
}
.kpi {
	padding: 1rem 1.05rem;
	border: 1px solid rgba(58, 36, 24, 0.14);
	border-radius: 2px;
	background: var(--cream);
	border-top: 3px solid var(--brass);
}
.kpi span { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; }
.kpi strong {
	display: block;
	font-family: var(--serif);
	font-size: 1.7rem;
	margin-top: 0.15rem;
	color: var(--ink);
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.toolbar { display: flex; gap: 0.55rem; margin-bottom: 0.8rem; }
.toolbar input, .toolbar select { flex: 1; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 0.55rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
	color: var(--wine);
	font-size: 0.66rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: rgba(114, 40, 50, 0.06);
}
td code { font-size: 0.78rem; color: var(--brass-dark); }
.zero { color: var(--muted); }
.st-ok { color: var(--ok); font-weight: 700; }
.st-wait { color: var(--brass-dark); font-weight: 700; }
.st-no { color: var(--off); font-weight: 700; }
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.chips, .id-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip, .id-list span {
	background: rgba(184, 146, 74, 0.12);
	border: 1px solid rgba(184, 146, 74, 0.35);
	border-radius: 999px;
	padding: 0.28rem 0.65rem;
	font-size: 0.78rem;
	color: var(--ink);
}
.room { padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.room strong { display: block; }
.room p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }

.mini-logs, #cmd-logs {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.35rem;
	max-height: 380px;
	overflow: auto;
}
.mini-logs li, #cmd-logs li {
	color: var(--muted);
	font-size: 0.84rem;
	display: grid;
	grid-template-columns: 4.5rem 1fr;
	gap: 0.55rem;
	padding: 0.35rem 0;
	border-bottom: 1px dashed var(--line);
}
#cmd-logs li { grid-template-columns: 4.5rem 5.2rem 1fr; }
time { color: var(--wine); font-variant-numeric: tabular-nums; font-weight: 650; }
.ok { color: var(--ok); }
.fail { color: var(--off); }
.bot { color: var(--ink); font-weight: 700; }

.section-head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 0.8rem;
}
.tabs, .actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tabs button, .actions button, .cmd-card button {
	background: var(--cream);
	color: var(--ink);
	padding: 0.5rem 0.85rem;
	font-size: 0.8rem;
	font-weight: 650;
	border: 1px solid var(--line);
}
.tabs button.on {
	background: var(--wine);
	color: var(--cream);
	border-color: var(--wine);
}

td .desc { color: var(--muted); font-size: 0.78rem; margin-top: 0.12rem; }

.stats-hero {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 0.8rem;
	margin-bottom: 0.9rem;
}
.gauge-wrap { display: flex; gap: 1.1rem; align-items: center; }
.gauge { width: 148px; height: 148px; flex: 0 0 auto; }
.gauge-score { font-family: var(--serif); font-size: 2rem; fill: var(--ink); }
.gauge-cap { fill: var(--muted); font-size: 11px; }
.advice-text {
	font-size: 1.12rem;
	line-height: 1.65;
	margin: 0.4rem 0 0;
	font-family: var(--serif);
	font-style: italic;
}
.bars { display: grid; gap: 0.45rem; margin-top: 0.7rem; }
.bar-row { display: grid; grid-template-columns: 3.2rem 1fr 2.4rem; gap: 0.5rem; align-items: center; font-size: 0.78rem; color: var(--muted); }
.bar { height: 8px; background: rgba(58, 36, 24, 0.1); border-radius: 99px; overflow: hidden; }
.bar > i {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--wine), var(--brass));
	border-radius: 99px;
}

[data-view="commands"] .cmd-head {
	margin-bottom: 1.35rem;
	padding-bottom: 1.2rem;
	border-bottom: 1px solid var(--line);
	align-items: center;
}
[data-view="commands"] .cmd-lede {
	margin: 0 0 1.6rem;
	max-width: 46rem;
	color: var(--muted);
}
#cmd-filter.cmd-filter,
#cmd-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
}
#cmd-filter button {
	min-width: 7.5rem;
	padding: 0.65rem 1.1rem;
	background: var(--cream);
	color: var(--ink);
	border: 1px solid var(--line);
	font-size: 0.88rem;
	font-weight: 700;
}
#cmd-filter button:hover {
	filter: none;
	border-color: var(--brass);
	background: #f8f1e2;
}
#cmd-filter button.on {
	background: var(--wine);
	color: var(--cream);
	border-color: var(--wine);
	box-shadow: none;
}
#cmd-groups {
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
	padding-bottom: 2rem;
}
.cmd-group {
	margin: 0;
	padding: 1.5rem 1.4rem 1.6rem;
	border-radius: 2px 2px 2px 2px;
	background: #efe2c0;
	border: 1px solid rgba(58, 36, 24, 0.14);
	box-shadow: 0 10px 24px rgba(40, 24, 12, 0.08);
	position: relative;
}
.cmd-group::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 1.4rem;
	width: 5.5rem;
	height: 14px;
	background: var(--wine);
	border-radius: 2px 2px 0 0;
	box-shadow: 0 0 0 1px rgba(184, 146, 74, 0.4);
}
.cmd-group-title {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin: 0 0 1.2rem;
	padding: 0.2rem 0 0.35rem;
	font-family: var(--serif);
	font-size: clamp(1.35rem, 2.2vw, 1.7rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	text-transform: none;
	color: var(--ink);
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.cmd-group-title::-webkit-details-marker { display: none; }
.cmd-group-title::marker { content: ""; }
.cmd-group-title span { flex: 1; min-width: 0; }
.cmd-group-title em {
	font-style: normal;
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--wine);
	background: rgba(114, 40, 50, 0.08);
	border: 1px solid rgba(114, 40, 50, 0.28);
	border-radius: 999px;
	padding: 0.28rem 0.7rem;
	flex: 0 0 auto;
}
.cmd-group-title::after {
	content: "▾";
	font-size: 0.85rem;
	color: var(--brass-dark);
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}
.cmd-group:not([open]) .cmd-group-title { margin-bottom: 0; }
.cmd-group:not([open]) .cmd-group-title::after { transform: rotate(-90deg); }
.cmd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
	gap: 1rem;
}
.cmd-card {
	padding: 1.2rem 1.15rem 1.05rem;
	min-height: 9.2rem;
	border: 1px solid rgba(58, 36, 24, 0.14);
	border-radius: 2px;
	background: var(--cream);
	display: grid;
	grid-template-rows: auto auto 1fr auto;
	gap: 0.45rem;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(40, 24, 12, 0.06);
}
.cmd-card:hover {
	border-color: var(--brass);
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(40, 24, 12, 0.12);
}
.cmd-bot {
	display: inline-block;
	width: fit-content;
	font-size: 0.64rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wine);
	background: rgba(114, 40, 50, 0.08);
	border: 1px solid rgba(114, 40, 50, 0.22);
	border-radius: 999px;
	padding: 0.16rem 0.5rem;
}
.cmd-card h3 {
	margin: 0;
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.2rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	text-transform: none;
	line-height: 1.25;
}
.cmd-card p {
	margin: 0;
	color: var(--muted);
	font-size: 0.88rem;
	line-height: 1.5;
}
.cmd-card .job {
	font-size: 0.75rem;
	font-weight: 650;
	color: var(--brass-dark);
}
.cmd-card .job.ok { color: var(--ok); }
.cmd-card .job.fail { color: var(--off); }

.drawer {
	position: fixed;
	inset: 0;
	z-index: 20;
	background: rgba(20, 12, 8, 0.62);
	display: grid;
	place-items: center;
	padding: 1.2rem;
}
.drawer-card {
	width: min(460px, 100%);
	padding: 1.4rem;
	border-radius: 2px;
	background: var(--paper);
	border: 1px solid var(--brass);
	box-shadow: 0 0 0 8px var(--leather), 0 24px 50px rgba(0, 0, 0, 0.4);
	color: var(--ink);
}
.drawer-form { display: grid; gap: 0.7rem; margin: 1rem 0; }
.drawer-form label span {
	display: block;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wine);
	margin-bottom: 0.3rem;
}
.check { display: flex; gap: 0.55rem; align-items: center; color: var(--text); }
.check input { width: auto; }

.toasts {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 30;
	display: grid;
	gap: 0.45rem;
	width: min(340px, calc(100% - 2rem));
}
.toast {
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--brass);
	border-radius: 2px;
	background: var(--paper);
	color: var(--ink);
	font-size: 0.82rem;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--wine); }
.toast.queued { border-color: var(--brass); }

.ask-thread {
	min-height: 280px;
	max-height: 52vh;
	overflow: auto;
	display: grid;
	gap: 0.75rem;
	align-content: start;
}
.ask-msg span {
	display: block;
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wine);
	margin-bottom: 0.2rem;
}
.ask-msg p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.ask-msg.you p { color: var(--muted); }
.ask-form { display: flex; gap: 0.55rem; margin-top: 0.85rem; }
.ask-form input { flex: 1; }
.ask-hints {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.75rem;
}
.ask-hints button {
	font: inherit;
	font-size: 0.78rem;
	padding: 0.28rem 0.7rem;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--wine);
	cursor: pointer;
}
.ask-msg.pending p {
	color: var(--brass-dark);
	opacity: 0.85;
}
.ask-msg.pending p::after {
	content: '';
	display: inline-block;
	width: 0.7em;
	animation: hail-dots 1.1s steps(4, end) infinite;
}
@keyframes hail-dots {
	0% { content: ''; }
	25% { content: '.'; }
	50% { content: '..'; }
	75% { content: '...'; }
}

.hail {
	position: fixed;
	inset: 0;
	z-index: 90;
	display: grid;
	place-items: center;
	overflow: hidden;
	color: #f4ead4;
}
.hail.hidden { display: none !important; }
.hail-bg {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(20, 10, 8, 0.72) 0%, rgba(28, 14, 12, 0.82) 45%, rgba(14, 8, 6, 0.92) 100%),
		url("/banner.png?v=2") center / cover no-repeat;
	transform: scale(1.06);
	filter: saturate(0.9) brightness(0.62);
	transition: transform 3.4s ease-out;
}
.hail.on .hail-bg { transform: scale(1); }
.hail-vignette {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, transparent 28%, rgba(14, 8, 6, 0.82) 100%);
	pointer-events: none;
}
.hail-flash {
	position: absolute;
	inset: -20%;
	background: linear-gradient(115deg, transparent 40%, rgba(226, 196, 122, 0.22) 50%, transparent 60%);
	transform: translateX(-80%);
	opacity: 0;
	pointer-events: none;
}
.hail.on .hail-flash {
	animation: hail-sweep 1.15s 0.45s ease-out forwards;
}
@keyframes hail-sweep {
	0% { transform: translateX(-80%); opacity: 0; }
	35% { opacity: 1; }
	100% { transform: translateX(80%); opacity: 0; }
}
.hail-inner {
	position: relative;
	z-index: 2;
	text-align: center;
	padding: 2rem 1.4rem;
}
.hail-crest {
	width: 92px;
	height: 92px;
	object-fit: cover;
	border-radius: 4px;
	border: 3px solid var(--brass-2);
	box-shadow: 0 0 0 6px rgba(184, 146, 74, 0.22), 0 18px 40px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(12px) scale(0.86);
}
.hail.on .hail-crest {
	animation: hail-in 0.7s 0.08s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hail-line {
	margin: 1.15rem 0 0.15rem;
	font-size: clamp(0.72rem, 1.6vw, 0.95rem);
	letter-spacing: 0.42em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--brass-2);
	opacity: 0;
	transform: translateY(10px);
}
.hail.on .hail-line {
	animation: hail-in 0.8s 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hail-name {
	font-family: var(--serif);
	font-size: clamp(3.2rem, 11vw, 7.4rem);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 0.92;
	margin: 0.15rem 0 0;
	color: #f7edd4;
	text-shadow:
		0 0 40px rgba(184, 146, 74, 0.5),
		0 12px 28px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: scale(1.18);
}
.hail.on .hail-name {
	animation: hail-name 1.05s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hail-sub {
	margin: 0.85rem 0 0;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	font-size: 0.72rem;
	color: var(--brass);
	opacity: 0;
}
.hail.on .hail-sub {
	animation: hail-in 0.7s 1.05s ease forwards;
}
@keyframes hail-in {
	to { opacity: 1; transform: none; }
}
@keyframes hail-name {
	0% { opacity: 0; transform: scale(1.18); filter: blur(6px); }
	100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
.hail-bits {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}
.hail-bits i {
	position: absolute;
	top: -8%;
	left: var(--x, 50%);
	width: var(--s, 7px);
	height: var(--s, 7px);
	background: var(--c, #e2c47a);
	clip-path: polygon(50% 0, 90% 28%, 72% 100%, 50% 78%, 28% 100%, 10% 28%);
	opacity: 0;
	transform: rotate(20deg);
	animation: hail-fall var(--d, 1.6s) var(--delay, 0s) ease-in forwards;
}
@keyframes hail-fall {
	0% { opacity: 0; transform: translateY(0) rotate(10deg); }
	12% { opacity: 1; }
	100% { opacity: 0; transform: translateY(110vh) rotate(220deg); }
}
.hail-skip {
	position: absolute;
	right: 1.1rem;
	bottom: 1.1rem;
	z-index: 3;
	background: transparent;
	border: 1px solid rgba(226, 196, 122, 0.35);
	color: var(--brass-2);
	font: inherit;
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 0.35rem 0.7rem;
	border-radius: 2px;
	cursor: pointer;
	opacity: 0.7;
}
.hail-skip:hover { opacity: 1; background: rgba(226, 196, 122, 0.1); }
.hail.out { animation: hail-fade 0.65s ease forwards; }
@keyframes hail-fade { to { opacity: 0; } }

.bot-board {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.7rem;
	margin-bottom: 0.9rem;
}
.bot-card {
	padding: 1rem 1.05rem;
	border: 1px solid var(--line);
	border-radius: 2px;
	background: var(--cream);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.8rem;
}
.bot-card strong { display: block; font-family: var(--serif); font-size: 1.15rem; }
.bot-card p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.78rem; }
.bot-ops { display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }

.term {
	margin: 0.8rem 0 0;
	min-height: 22rem;
	max-height: 62vh;
	overflow: auto;
	padding: 1.05rem 1.15rem;
	border-radius: 2px;
	background: #101610;
	color: #c5d4a8;
	font: 0.78rem/1.5 ui-monospace, Consolas, monospace;
	white-space: pre-wrap;
	word-break: break-word;
	border: 8px solid var(--walnut);
	box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--brass);
}

.hit {
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
}
.hit:hover { color: var(--wine); }
.hit.on { color: var(--wine); font-weight: 700; }
.hit p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.8rem; }
.member-block { margin-top: 1rem; }
.member-block:first-child { margin-top: 0; }
.role-chips { margin-top: 0.45rem; }
.role-chips .chip {
	background: rgba(114, 40, 50, 0.1);
	border-color: rgba(114, 40, 50, 0.3);
	color: var(--ink);
}
.account-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.8rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--line);
}
.account-row strong { display: block; }
.account-row span { color: var(--muted); font-size: 0.8rem; }

.note-card {
	display: grid;
	gap: 0.35rem;
	padding: 0.85rem 0.95rem;
	margin-top: 0.7rem;
	border: 1px solid var(--line);
	border-radius: 2px;
	background: #f8f1e2;
	border-left-width: 4px;
}
.note-card.sugg {
	border-style: dashed;
	border-left-style: solid;
	background: rgba(184, 146, 74, 0.1);
}
.note-card.done { opacity: 0.58; }
.note-card.done .note-text { text-decoration: line-through; }
.note-card.prio-haute { border-left-color: var(--wine); }
.note-card.prio-moyenne { border-left-color: var(--brass); }
.note-card.prio-basse { border-left-color: var(--ok); }
.note-text { margin: 0; font-weight: 650; line-height: 1.45; }
.note-meta { margin: 0; color: var(--muted); font-size: 0.78rem; }
.note-ops {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
	margin-top: 0.2rem;
}
.note-ops select {
	padding: 0.32rem 0.55rem;
	font-size: 0.78rem;
	border-radius: 2px;
	min-width: 8.5rem;
}
.prio-badge {
	justify-self: start;
	padding: 0.18rem 0.55rem;
	font-size: 0.66rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 2px;
	cursor: pointer;
	border: 1px solid transparent;
}
.prio-badge:disabled { cursor: default; opacity: 0.9; }
.prio-haute {
	background: rgba(114, 40, 50, 0.14);
	color: var(--wine);
	border-color: rgba(114, 40, 50, 0.4);
}
.prio-moyenne {
	background: rgba(184, 146, 74, 0.18);
	color: var(--brass-dark);
	border-color: rgba(184, 146, 74, 0.45);
}
.prio-basse {
	background: rgba(61, 106, 60, 0.14);
	color: var(--ok);
	border-color: rgba(61, 106, 60, 0.4);
}
#note-tabs { margin: 0.55rem 0 0.2rem; }
#home-notes .note-card { margin-top: 0.55rem; }
#home-notes.panel:hover { transform: none; }
#note-form.content-form {
	grid-template-columns: 1fr minmax(160px, 220px);
	align-items: end;
}
#note-form .actions,
#note-form .lede { grid-column: 1 / -1; }

.panel, .kpi, .cmd-card, .bot-card {
	transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
.panel:hover, .kpi:hover, .bot-card:hover {
	transform: translateY(-2px);
	border-color: rgba(184, 146, 74, 0.55);
	box-shadow: 0 12px 26px rgba(40, 24, 12, 0.1);
}
.ask-thread.panel:hover { transform: none; }
.view-in { animation: view-in 0.38s ease; }
@keyframes view-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}
@keyframes gate-zoom { to { transform: scale(1); } }
@keyframes gate-glow { to { opacity: 1; } }
@keyframes dusk-shift {
	to { transform: scale(1); filter: saturate(1.08); }
}
@keyframes leaf-fall {
	0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
	8% { opacity: 0.75; }
	100% { transform: translate3d(40px, 110vh, 0) rotate(220deg); opacity: 0; }
}

.quick {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.quick button {
	background: var(--cream);
	color: var(--ink);
	border: 1px solid rgba(58, 36, 24, 0.2);
	font-size: 0.82rem;
	padding: 0.72rem 0.55rem;
}
.quick button:hover {
	border-color: var(--brass);
	box-shadow: 0 0 0 1px rgba(184, 146, 74, 0.25);
}
.quick button.on {
	background: var(--wine);
	color: var(--cream);
	border-color: var(--wine);
}
.quick button:disabled { opacity: 0.4; cursor: not-allowed; }
.maint-banner {
	margin: 0 0 1rem;
	padding: 0.7rem 1rem;
	border-radius: 2px;
	background: rgba(184, 146, 74, 0.16);
	border: 1px solid rgba(184, 146, 74, 0.5);
	color: var(--brass-dark);
	font-weight: 700;
	letter-spacing: 0.04em;
}
.bell {
	position: relative;
	background: transparent;
	color: var(--wine);
	border: 1px solid rgba(114, 40, 50, 0.28);
	padding: 0.4rem 0.7rem;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.bell em {
	position: absolute;
	top: -6px;
	right: -6px;
	background: var(--wine);
	color: #fff;
	font-style: normal;
	font-size: 0.65rem;
	min-width: 1.1rem;
	height: 1.1rem;
	border-radius: 999px;
	display: grid;
	place-items: center;
	padding: 0 0.2rem;
}
.alert-panel {
	position: fixed;
	top: 4.2rem;
	right: 1.2rem;
	z-index: 40;
	width: min(360px, calc(100vw - 2rem));
	max-height: 60vh;
	overflow: auto;
	background: var(--paper);
	color: var(--ink);
	border: 1px solid var(--brass);
	border-radius: 2px;
	padding: 0.9rem 1rem;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.alert-panel ol { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.alert-panel li { display: grid; gap: 0.1rem; font-size: 0.86rem; }
.alert-panel li.fresh strong { color: var(--wine); }
.alert-panel time { color: var(--muted); font-size: 0.72rem; }
.content-form { display: grid; gap: 0.75rem; }
.content-form label span {
	display: block;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wine);
	margin-bottom: 0.3rem;
}
.content-form textarea {
	width: 100%;
	background: var(--cream);
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 2px;
	padding: 0.75rem 1rem;
	font: inherit;
	resize: vertical;
}

body[data-authed="1"] .fall { display: none; }

@media (max-width: 980px) {
	.gate {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(220px, 34vh) 1fr auto;
	}
	.office { grid-column: 1; grid-row: 1; min-height: 220px; }
	.gate-intro {
		grid-column: 1;
		grid-row: 1;
		padding: 1rem 1.2rem 1.1rem;
		max-width: none;
	}
	.gate-intro h1 { font-size: 1.7rem; }
	.gate-intro .lede { display: none; }
	.gate-wrap {
		grid-column: 1;
		grid-row: 2;
		border-left: 0;
		border-top: 1px solid rgba(226, 196, 122, 0.28);
		padding: 1.4rem 1.1rem 1.6rem;
	}
	.office-curtain, .office-lamp, .office-plate { display: none; }
	.shell { grid-template-columns: 1fr; }
	.side {
		height: auto;
		position: relative;
		border-right: 0;
		border-bottom: 3px solid var(--brass-dark);
	}
	.nav { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
	.nav button { border-radius: 2px; }
	.side-bots { display: none; }
	.plate { display: none; }
	.kpis, .split, .stats-hero, .bot-board { grid-template-columns: 1fr 1fr; }
	.main { background: var(--paper); }
}
@media (max-width: 640px) {
	.kpis, .split, .stats-hero, .bot-board { grid-template-columns: 1fr; }
	.gauge-wrap { flex-direction: column; align-items: flex-start; }
	.quick { grid-template-columns: 1fr 1fr; }
	#note-form.content-form { grid-template-columns: 1fr; }
	.top { flex-direction: column; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
	.fall i,
	.gate-enter .office-sky,
	.gate-enter .gate-bg,
	.gate-enter .gate-glow,
	.gate-enter .gate-card,
	.gate-enter .gate-intro,
	.view-in,
	.hail.on .hail-flash,
	.hail-bits i {
		animation: none !important;
	}
	.gate-card, .gate-intro, .gate-glow { opacity: 1; transform: none; }
	.panel, .kpi, .cmd-card, .bot-card { transition: none; }
}
