/* Panel du bot : vase attique à figures noires. Vernis noir, terre cuite, frise grecque. */

@font-face {
	font-family: 'Tenor Sans';
	src: url('/polices/tenor-sans.woff2') format('woff2');
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: 'Figtree';
	src: url('/polices/figtree.woff2') format('woff2-variations');
	font-weight: 300 900;
	font-display: swap;
}
@font-face {
	font-family: 'JetBrains Mono';
	src: url('/polices/jetbrains-mono.woff2') format('woff2-variations');
	font-weight: 100 800;
	font-display: swap;
}

:root {
	color-scheme: dark;

	--noir: #15110f;
	--noir-2: #1c1714;
	--noir-3: #251f1b;
	--noir-4: #2f2722;
	--filet: #3b302a;
	--filet-fort: #54443a;

	--argile: #c8693a;
	--argile-vive: #e3874f;
	--argile-sombre: #93461f;
	--argile-voile: rgb(200 105 58 / 0.16);
	--argile-encre: #2a170e;

	--engobe: #f2e6d3;
	--engobe-2: #cdb7a0;
	--engobe-3: #9c8573;

	--miltos: #b23a2c;
	--miltos-clair: #ef8f7c;
	--olive: #a9bd6e;
	--ocre: #e2b064;

	--police: 'Figtree', ui-sans-serif, system-ui, sans-serif;
	--police-titre: 'Tenor Sans', 'Figtree', ui-sans-serif, sans-serif;
	--police-code: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

	--sortie: cubic-bezier(0.16, 1, 0.3, 1);
	--h-journal: 34%;

	/* Méandre : un motif de 20 × 16, répété comme une frise de vase */
	--meandre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='16'%3E%3Cpath d='M0 15H20M16 15V1H4V11H12V5H8V8' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
}

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

* {
	scrollbar-width: thin;
	scrollbar-color: var(--filet-fort) transparent;
}

html,
body {
	margin: 0;
	height: 100%;
}

body {
	background: var(--noir);
	color: var(--engobe);
	font: 400 0.95rem/1.5 var(--police);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--argile);
	color: var(--noir);
}

:focus-visible {
	outline: 2px solid var(--argile-vive);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

h1,
h2,
p {
	margin: 0;
}

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

kbd {
	font: 600 0.78em/1 var(--police-code);
	padding: 3px 6px;
	border-radius: 5px;
	background: var(--noir-4);
	border: 1px solid var(--filet-fort);
	color: var(--engobe);
}

.visuellement-cache {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.icone {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icone--grande {
	width: 32px;
	height: 32px;
	stroke-width: 1.5;
}

/* ---------- Frise ---------- */

.frise {
	height: 16px;
	background: currentColor;
	-webkit-mask: var(--meandre) repeat-x 0 0 / 20px 16px;
	mask: var(--meandre) repeat-x 0 0 / 20px 16px;
}

@keyframes tour {
	to {
		-webkit-mask-position: 20px 0;
		mask-position: 20px 0;
	}
}

/* ---------- Boutons ---------- */

.bouton {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 38px;
	padding: 0 16px;
	overflow: hidden;
	border: 1px solid var(--filet-fort);
	border-radius: 999px;
	background: var(--noir-3);
	color: var(--engobe);
	font: 600 0.88rem/1 var(--police);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color 160ms var(--sortie),
		border-color 160ms var(--sortie),
		color 160ms var(--sortie),
		transform 140ms var(--sortie);
}

.bouton:hover {
	background: var(--noir-4);
	border-color: var(--argile-sombre);
}

.bouton:active {
	transform: scale(0.96);
}

.bouton:disabled {
	opacity: 0.42;
	cursor: not-allowed;
	transform: none;
}

.bouton--plein {
	background: var(--argile);
	border-color: var(--argile);
	color: var(--noir);
}

.bouton--plein:hover {
	background: var(--argile-vive);
	border-color: var(--argile-vive);
}

.bouton--plein:disabled,
.bouton--plein:disabled:hover {
	opacity: 1;
	background: var(--noir-3);
	border-color: var(--filet);
	color: var(--engobe-3);
}

.bouton--discret {
	background: transparent;
	border-color: transparent;
	color: var(--engobe-2);
}

.bouton--discret:hover {
	background: var(--noir-3);
	border-color: transparent;
	color: var(--engobe);
}

.bouton--icone {
	width: 38px;
	padding: 0;
}

.bouton--petit {
	height: 30px;
	padding: 0 12px;
	font-size: 0.8rem;
}

.bouton--petit .icone {
	width: 15px;
	height: 15px;
}

.bouton--petit.bouton--icone {
	width: 30px;
	padding: 0;
}

.bouton--large {
	width: 100%;
	height: 46px;
}

/* Action en deux temps : le premier clic arme, le second confirme. La barre décompte 4 s. */
[data-arme] {
	background: var(--miltos) !important;
	border-color: var(--miltos) !important;
	color: var(--engobe) !important;
}

[data-arme]::after {
	content: '';
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 5px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	opacity: 0.7;
	transform-origin: left;
	animation: decompte 4s linear forwards;
}

@keyframes decompte {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

.bouton.fait {
	background: var(--olive);
	border-color: var(--olive);
	color: var(--noir);
}

.bouton.occupe > .icone {
	animation: rotation 900ms linear infinite;
}

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

/* ---------- Connexion ---------- */

.connexion {
	min-height: 100dvh;
	display: grid;
	place-items: center;
	padding: 24px 16px;
}

.cartouche {
	position: relative;
	width: min(100%, 390px);
	display: grid;
	gap: 14px;
	padding: 52px 32px 56px;
	border-radius: 20px;
	background: var(--argile);
	color: var(--noir);
	box-shadow:
		0 30px 60px -20px rgb(0 0 0 / 0.65),
		0 2px 0 rgb(255 255 255 / 0.08) inset;
	animation: lever 700ms var(--sortie) both;
}

@keyframes lever {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
}

.cartouche__frise {
	position: absolute;
	top: 18px;
	left: 24px;
	right: 24px;
	animation: derouler 900ms var(--sortie) 200ms both;
}

.cartouche__frise--bas {
	top: auto;
	bottom: 18px;
	transform: scaleY(-1);
}

@keyframes derouler {
	from {
		clip-path: inset(0 50% 0 50%);
	}
	to {
		clip-path: inset(0 0 0 0);
	}
}

.cartouche__titre {
	margin: 6px 0 12px;
	font: 400 2.5rem/1.05 var(--police-titre);
	letter-spacing: 0.03em;
}

.champ {
	display: grid;
	gap: 6px;
}

.champ__libelle {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--argile-encre);
}

.champ__saisie {
	height: 46px;
	padding: 0 14px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: var(--noir);
	color: var(--engobe);
	caret-color: var(--argile-vive);
	transition: border-color 160ms var(--sortie);
}

.champ__saisie:focus-visible {
	outline: 2px solid var(--noir);
	outline-offset: 2px;
}

.cartouche .bouton--plein {
	margin-top: 4px;
	background: var(--noir);
	border-color: var(--noir);
	color: var(--engobe);
}

.cartouche .bouton--plein:hover {
	background: var(--noir-3);
	border-color: var(--noir-3);
}

.cartouche .bouton:focus-visible {
	outline-color: var(--noir);
}

.cartouche__erreur {
	min-height: 1.3em;
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--argile-encre);
}

.cartouche.refus {
	animation: refus 360ms var(--sortie);
}

@keyframes refus {
	20% {
		transform: translateX(-7px);
	}
	45% {
		transform: translateX(6px);
	}
	70% {
		transform: translateX(-3px);
	}
}

/* ---------- Panel ---------- */

.panel {
	height: 100dvh;
	display: grid;
	grid-template-rows: auto auto minmax(0, 1fr);
}

/* Fronton : la bande d'état. Terre cuite quand le bot vit, vernis noir quand il dort, rouge quand il plante. */
.fronton {
	--fond: var(--noir-2);
	--encre: var(--argile);
	--encre-2: var(--engobe-3);
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 20px 32px;
	padding: 24px clamp(16px, 3vw, 36px) 42px;
	background: var(--fond);
	color: var(--encre);
	border-bottom: 1px solid var(--filet);
	transition:
		background-color 700ms var(--sortie),
		color 500ms var(--sortie);
}

.fronton[data-phase='en_ligne'],
.fronton[data-phase='demarrage'],
.fronton[data-phase='arret'],
.fronton[data-phase='dependances'] {
	--fond: var(--argile);
	--encre: var(--noir);
	--encre-2: var(--argile-encre);
	border-bottom-color: var(--argile);
}

.fronton[data-phase='plante'] {
	--fond: var(--miltos);
	--encre: var(--engobe);
	--encre-2: #fbe1d8;
	border-bottom-color: var(--miltos);
}

.fronton :focus-visible {
	outline-color: var(--encre);
}

.fronton__bot {
	font-weight: 700;
	color: var(--encre);
	transition: color 500ms var(--sortie);
}

.fronton__etat {
	margin: 4px 0 12px;
	min-height: 1em;
	font: 400 3.5rem/1 var(--police-titre);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Le mot d'état se repeint lettre par lettre, comme une inscription au pinceau */
.lettre {
	display: inline-block;
	white-space: pre;
	animation: peindre 560ms var(--sortie) both;
	animation-delay: calc(var(--i) * 32ms);
}

@keyframes peindre {
	from {
		opacity: 0.1;
		clip-path: inset(-10% 100% -10% 0);
		transform: translateY(0.05em);
	}
	to {
		opacity: 1;
		clip-path: inset(-10% 0 -10% 0);
		transform: none;
	}
}

.fronton__details {
	min-height: 1.5em;
	font-size: 0.95rem;
	color: var(--encre-2);
	font-variant-numeric: tabular-nums;
	transition: color 500ms var(--sortie);
}

.fronton__commandes {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.fronton__frise {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	opacity: 0.85;
}

/* Pendant un démarrage, un arrêt ou une installation, la frise tourne comme le vase sur le tour */
.fronton[data-phase='demarrage'] .fronton__frise,
.fronton[data-phase='arret'] .fronton__frise,
.fronton[data-phase='dependances'] .fronton__frise {
	animation: tour 700ms linear infinite;
}

.bouton--fronton {
	background: var(--noir);
	border-color: var(--noir);
	color: var(--engobe);
}

.bouton--fronton:hover {
	background: var(--noir-3);
	border-color: var(--noir-3);
}

.fronton[data-phase='arrete'] .bouton--fronton {
	border-color: var(--filet-fort);
}

/* Interrupteur Marche / Arrêt : la pastille traverse quand le bot doit tourner */
.interrupteur {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	padding: 0 18px 0 6px;
	overflow: hidden;
	border: 1px solid var(--noir);
	border-radius: 999px;
	background: var(--noir);
	color: var(--engobe);
	font: 600 0.9rem/1 var(--police);
	cursor: pointer;
	transition:
		background-color 160ms var(--sortie),
		border-color 160ms var(--sortie),
		transform 140ms var(--sortie);
}

.fronton[data-phase='arrete'] .interrupteur {
	border-color: var(--filet-fort);
}

.interrupteur:active {
	transform: scale(0.97);
}

.interrupteur:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.interrupteur__rail {
	position: relative;
	width: 62px;
	height: 32px;
	border-radius: 999px;
	background: var(--noir-4);
	box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.55);
}

.interrupteur__pastille {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--engobe-3);
	box-shadow: 0 2px 6px rgb(0 0 0 / 0.5);
	transition:
		transform 460ms var(--sortie),
		background-color 300ms var(--sortie);
}

.interrupteur[aria-checked='true'] .interrupteur__pastille {
	transform: translateX(30px);
	background: var(--argile-vive);
}

.interrupteur__texte {
	min-width: 4.6em;
	text-align: left;
}

/* ---------- Onglets (téléphone) ---------- */

.onglets {
	display: none;
}

/* ---------- Atelier ---------- */

.atelier {
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) 9px var(--h-journal);
	grid-template-areas:
		'fichiers editeur'
		'fichiers separateur'
		'fichiers journal';
}

.vue {
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.volet__tete {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 0 10px 0 18px;
}

.volet__titre {
	display: flex;
	align-items: center;
	gap: 10px;
	font: 400 0.76rem/1 var(--police-titre);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--engobe-2);
}

.volet__actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* ---------- Fichiers ---------- */

.fichiers {
	grid-area: fichiers;
	background: var(--noir-2);
	border-right: 1px solid var(--filet);
}

.fil {
	flex: none;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px;
	padding: 0 12px 8px;
	font-size: 0.82rem;
	color: var(--engobe-3);
}

.fil__morceau {
	max-width: 100%;
	padding: 3px 6px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--engobe-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color 140ms var(--sortie),
		color 140ms var(--sortie);
}

.fil__morceau:hover {
	background: var(--noir-3);
	color: var(--engobe);
}

.fil__morceau[aria-current='page'] {
	color: var(--engobe);
	font-weight: 600;
	cursor: default;
	background: none;
}

.fil__sep {
	width: 14px;
	height: 14px;
	color: var(--filet-fort);
}

.fichiers__zone {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 2px 8px 24px;
}

.fichiers__liste {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Repère de la sélection : glisse d'un fichier à l'autre */
.fichiers__repere {
	position: absolute;
	top: 0;
	left: 8px;
	right: 8px;
	height: 38px;
	border-radius: 9px;
	background: var(--argile-voile);
	opacity: 0;
	pointer-events: none;
	transform: translateY(var(--y, 0));
	transition:
		transform 340ms var(--sortie),
		opacity 200ms var(--sortie);
}

.fichiers__repere.visible {
	opacity: 1;
}

.element {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	height: 38px;
	border-radius: 9px;
	color: var(--engobe-2);
	transition:
		background-color 140ms var(--sortie),
		color 140ms var(--sortie);
}

.element:hover {
	background: rgb(255 255 255 / 0.035);
	color: var(--engobe);
}

.element[aria-current='true'] {
	color: var(--engobe);
}

.element[aria-current='true'] .element__ouvrir .icone {
	color: var(--argile-vive);
}

.liste-entree .element {
	animation: entree 300ms var(--sortie) both;
	animation-delay: calc(min(var(--i), 14) * 14ms);
}

@keyframes entree {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
}

.element__ouvrir {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	height: 100%;
	padding: 0 8px 0 10px;
	border: 0;
	border-radius: 9px;
	background: none;
	text-align: left;
	cursor: pointer;
}

.element__ouvrir .icone {
	width: 17px;
	height: 17px;
	color: var(--engobe-3);
	transition: color 200ms var(--sortie);
}

.element--dossier .element__ouvrir .icone {
	color: var(--argile);
}

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

.element__fin {
	display: flex;
	align-items: center;
	padding-right: 4px;
}

.element__taille {
	padding: 0 6px;
	font: 400 0.72rem/1 var(--police-code);
	color: var(--engobe-3);
	font-variant-numeric: tabular-nums;
}

.element__actions {
	display: none;
	gap: 0;
}

.element:hover .element__taille,
.element:focus-within .element__taille {
	display: none;
}

.element:hover .element__actions,
.element:focus-within .element__actions {
	display: flex;
}

@media (hover: none) {
	.element__taille {
		display: none;
	}
	.element__actions {
		display: flex;
	}
}

.element__saisie {
	width: 100%;
	height: 30px;
	margin: 0 6px;
	padding: 0 8px;
	border: 1px solid var(--argile);
	border-radius: 7px;
	background: var(--noir);
	color: var(--engobe);
	caret-color: var(--argile-vive);
}

.element__saisie:focus-visible {
	outline: none;
	border-color: var(--argile-vive);
	box-shadow: 0 0 0 3px var(--argile-voile);
}

.element--edition {
	display: flex;
	padding-left: 10px;
	background: var(--noir-3);
}

.element--edition > .icone {
	width: 17px;
	height: 17px;
	color: var(--argile);
}

.fichiers__message {
	padding: 18px 12px;
	color: var(--engobe-3);
	font-size: 0.88rem;
}

/* Glisser-déposer */
.depot {
	position: absolute;
	inset: 8px;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 10px;
	padding: 20px;
	border: 1.5px dashed var(--argile);
	border-radius: 14px;
	background: rgb(21 17 15 / 0.9);
	color: var(--engobe);
	text-align: center;
	font-weight: 600;
	opacity: 0;
	transform: scale(0.98);
	pointer-events: none;
	transition:
		opacity 180ms var(--sortie),
		transform 260ms var(--sortie);
}

.depot .icone {
	color: var(--argile-vive);
}

.fichiers__zone.depot-actif .depot {
	opacity: 1;
	transform: none;
}

/* ---------- Éditeur ---------- */

.editeur {
	grid-area: editeur;
	background: var(--noir);
}

.editeur__tete {
	border-bottom: 1px solid var(--filet);
	padding-right: 12px;
}

.editeur__chemin {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	font: 500 0.86rem/1 var(--police-code);
	color: var(--engobe-3);
}

.editeur__chemin .editeur__nom {
	color: var(--engobe);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.editeur__chemin .editeur__aucun {
	font: 500 0.88rem/1 var(--police);
	color: var(--engobe-3);
}

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

.editeur__point {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--argile-vive);
	transform: scale(0);
	transition: transform 300ms var(--sortie);
}

.editeur.modifie .editeur__point {
	transform: scale(1);
}

.editeur__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: none;
}

.editeur__statut {
	font-size: 0.82rem;
	color: var(--engobe-3);
	font-variant-numeric: tabular-nums;
}

.rappel {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 4px 4px 14px;
	border-radius: 999px;
	background: var(--argile-voile);
	color: var(--ocre);
	font-size: 0.82rem;
	font-weight: 600;
	animation: glisser 420ms var(--sortie) both;
}

@keyframes glisser {
	from {
		opacity: 0;
		transform: translateX(10px);
	}
}

.editeur__corps {
	position: relative;
	flex: 1;
	min-height: 0;
}

.editeur__code {
	height: 100%;
}

.editeur__code.change {
	animation: fondu 260ms var(--sortie);
}

@keyframes fondu {
	from {
		opacity: 0;
		filter: blur(3px);
	}
}

.vide,
.non-texte {
	height: 100%;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	padding: 24px;
	text-align: center;
	color: var(--engobe-2);
}

.vide p,
.non-texte p {
	max-width: 46ch;
	line-height: 1.65;
}

.vide__frise {
	width: 120px;
	color: var(--argile);
	opacity: 0.8;
}

.vide__titre {
	font: 400 1.5rem/1.2 var(--police-titre);
	letter-spacing: 0.03em;
	color: var(--engobe);
}

/* CodeMirror */
.cm-editor {
	height: 100%;
}

.cm-editor .cm-scroller {
	font-family: var(--police-code);
	line-height: 1.6;
}

/* Pas de ligatures de code : « => » et « // » s'affichent tels qu'on les tape
   (Chrome casse aussi la ligature « // » pendant la frappe) */
.cm-editor .cm-scroller,
.journal__lignes,
.editeur__chemin,
.element__taille,
kbd {
	font-variant-ligatures: none;
	font-feature-settings: 'calt' 0, 'liga' 0;
}

.cm-editor .cm-panels {
	background: var(--noir-2);
	color: var(--engobe);
	border-color: var(--filet);
}

.cm-editor .cm-panels input,
.cm-editor .cm-panels button {
	font: 400 0.82rem/1.4 var(--police);
}

.cm-editor .cm-textfield {
	border: 1px solid var(--filet-fort);
	border-radius: 6px;
	background: var(--noir);
	color: var(--engobe);
}

.cm-editor .cm-button {
	border: 1px solid var(--filet-fort);
	border-radius: 6px;
	background: var(--noir-3);
	background-image: none;
	color: var(--engobe);
}

.cm-tooltip {
	border: 1px solid var(--filet-fort) !important;
	border-radius: 8px;
	background: var(--noir-2) !important;
	color: var(--engobe);
	overflow: hidden;
}

.cm-tooltip-autocomplete ul li[aria-selected] {
	background: var(--argile) !important;
	color: var(--noir) !important;
}

/* ---------- Séparateur ---------- */

.separateur {
	grid-area: separateur;
	position: relative;
	background: var(--noir);
	cursor: row-resize;
	touch-action: none;
}

.separateur::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 4px;
	height: 1px;
	background: var(--filet);
	transition: background-color 160ms var(--sortie);
}

.separateur::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 2px;
	width: 36px;
	height: 5px;
	margin-left: -18px;
	border-radius: 5px;
	background: var(--filet-fort);
	transition:
		background-color 160ms var(--sortie),
		transform 200ms var(--sortie);
}

.separateur:hover::after,
.separateur.actif::after,
.separateur:focus-visible::after {
	background: var(--argile);
	transform: scaleX(1.4);
}

.separateur:focus-visible {
	outline: none;
}

/* ---------- Journal ---------- */

.journal {
	grid-area: journal;
	position: relative;
	background: var(--noir-2);
}

.direct {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--engobe-3);
	transition: background-color 300ms var(--sortie);
}

.direct.actif {
	background: var(--olive);
	animation: pouls 2.4s var(--sortie) infinite;
}

@keyframes pouls {
	0% {
		box-shadow: 0 0 0 0 rgb(169 189 110 / 0.5);
	}
	70%,
	100% {
		box-shadow: 0 0 0 7px rgb(169 189 110 / 0);
	}
}

.journal__lignes {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0 0 14px;
	overflow: auto;
	list-style: none;
	font: 400 0.8rem/1.6 var(--police-code);
	font-variant-numeric: tabular-nums;
}

.journal__lignes:focus-visible {
	outline-offset: -2px;
}

.ligne {
	display: grid;
	grid-template-columns: 8ch minmax(0, 1fr);
	gap: 14px;
	padding: 0 18px;
	color: var(--engobe);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ligne time {
	color: var(--engobe-3);
}

.ligne--erreur {
	color: var(--miltos-clair);
}

.ligne--panel {
	color: var(--argile-vive);
}

.ligne--npm {
	color: var(--engobe-2);
}

.ligne--nouvelle {
	animation: arrivee 240ms var(--sortie) both;
}

@keyframes arrivee {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
}

.journal__vide {
	padding: 6px 18px;
	color: var(--engobe-3);
	font-family: var(--police);
}

.journal__suite {
	position: absolute;
	left: 50%;
	bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: var(--argile);
	color: var(--noir);
	font-weight: 700;
	font-size: 0.8rem;
	box-shadow: 0 8px 20px -6px rgb(0 0 0 / 0.6);
	cursor: pointer;
	transform: translateX(-50%);
	animation: monter 300ms var(--sortie) both;
}

.journal__suite .icone {
	width: 15px;
	height: 15px;
}

@keyframes monter {
	from {
		opacity: 0;
		transform: translate(-50%, 8px);
	}
}

/* ---------- Notifications ---------- */

.toasts {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 20;
	display: grid;
	gap: 8px;
	width: min(380px, calc(100vw - 32px));
	pointer-events: none;
}

.toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--filet-fort);
	border-radius: 12px;
	background: var(--noir-3);
	color: var(--engobe);
	font-size: 0.88rem;
	box-shadow: 0 16px 32px -12px rgb(0 0 0 / 0.7);
	pointer-events: auto;
	animation: toast 340ms var(--sortie) both;
}

.toast .icone {
	margin-top: 1px;
	color: var(--olive);
}

.toast--erreur {
	border-color: var(--miltos);
}

.toast--erreur .icone {
	color: var(--miltos-clair);
}

.toast.sortie {
	animation: toast-sortie 200ms ease-in both;
}

@keyframes toast {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

@keyframes toast-sortie {
	to {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* ---------- Dialogue ---------- */

.dialogue {
	width: min(440px, calc(100vw - 32px));
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: var(--noir-3);
	color: var(--engobe);
	box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.8);
}

.dialogue[open] {
	animation: ouverture 300ms var(--sortie);
}

.dialogue::backdrop {
	background: rgb(10 8 7 / 0.6);
	backdrop-filter: blur(3px);
}

@keyframes ouverture {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
}

.dialogue__forme {
	display: grid;
	gap: 12px;
	padding: 24px;
}

.dialogue__titre {
	font: 400 1.3rem/1.25 var(--police-titre);
	letter-spacing: 0.02em;
}

.dialogue__texte {
	color: var(--engobe-2);
	line-height: 1.6;
}

.dialogue__boutons {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.bouton--danger {
	background: var(--miltos);
	border-color: var(--miltos);
	color: var(--engobe);
}

.bouton--danger:hover {
	background: #c84a3a;
	border-color: #c84a3a;
}

/* ---------- Téléphone ---------- */

@media (max-width: 860px) {
	.fronton {
		grid-template-columns: 1fr;
		padding: 18px 16px 40px;
		gap: 14px;
	}

	.fronton__etat {
		font-size: 2.4rem;
		margin: 4px 0 8px;
		padding-right: 52px;
	}

	.fronton__details {
		font-size: 0.88rem;
	}

	.fronton__commandes {
		justify-content: flex-start;
		flex-wrap: nowrap;
	}

	#bouton-deconnexion {
		position: absolute;
		top: 12px;
		right: 12px;
	}

	.onglets {
		position: relative;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		background: var(--noir-2);
		border-bottom: 1px solid var(--filet);
	}

	.onglets__bouton {
		height: 46px;
		border: 0;
		background: none;
		color: var(--engobe-3);
		font-weight: 600;
		cursor: pointer;
		transition: color 200ms var(--sortie);
	}

	.onglets__bouton[aria-current='page'] {
		color: var(--engobe);
	}

	.onglets__repere {
		position: absolute;
		left: 0;
		bottom: -1px;
		width: calc(100% / 3);
		height: 2px;
		background: var(--argile);
		transform: translateX(calc(var(--onglet, 0) * 100%));
		transition: transform 360ms var(--sortie);
	}

	.atelier {
		display: block;
		position: relative;
		overflow: hidden;
	}

	.atelier > .vue {
		position: absolute;
		inset: 0;
		display: none;
		border: 0;
	}

	body[data-vue='fichiers'] #vue-fichiers,
	body[data-vue='editeur'] #vue-editeur,
	body[data-vue='journal'] #vue-journal {
		display: flex;
		animation: fondu 220ms var(--sortie);
	}

	.separateur {
		display: none;
	}

	.volet__tete {
		padding-left: 16px;
	}

	.editeur__tete {
		flex-wrap: wrap;
		row-gap: 8px;
		padding: 10px 12px 10px 16px;
	}

	.editeur__actions {
		width: 100%;
		justify-content: flex-end;
		gap: 8px;
	}

	.editeur__statut {
		display: none;
	}

	.rappel {
		margin-right: auto;
	}

	.rappel > span,
	#bouton-dependances span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	#bouton-dependances {
		width: 30px;
		padding: 0;
	}
}

/* ---------- Moins d'animations ---------- */

@media (prefers-reduced-motion: reduce) {
	.lettre {
		animation-name: apparaitre;
		animation-duration: 200ms;
		animation-delay: 0ms;
	}

	@keyframes apparaitre {
		from {
			opacity: 0.2;
		}
	}

	.fronton__frise,
	.cartouche__frise,
	.liste-entree .element,
	.ligne--nouvelle,
	.cartouche,
	.editeur__code.change {
		animation: none !important;
	}

	.fronton[data-phase='demarrage'] .fronton__frise,
	.fronton[data-phase='arret'] .fronton__frise,
	.fronton[data-phase='dependances'] .fronton__frise {
		animation: clignote 1.6s ease-in-out infinite !important;
	}

	@keyframes clignote {
		50% {
			opacity: 0.35;
		}
	}

	.interrupteur__pastille,
	.fichiers__repere,
	.onglets__repere {
		transition-duration: 120ms;
	}

	.direct.actif {
		animation: none;
	}
}
