/* ============================================================
   Éditeur — feuilles A4 paysage à l'échelle exacte (mm) +
   barre d'outils. Reprend les tokens de styles.css.
   ============================================================ */

.page-editeur { background: var(--bureau); }
/* une seule barre collante sur l'éditeur : les outils, pas la topbar */
.page-editeur .topbar { position: static; }

/* ---------------- barre d'outils ---------------- */

.outils {
	display: flex;
	align-items: flex-end;
	gap: 1.1rem;
	flex-wrap: wrap;
	max-width: 1140px;
	margin: 0 auto;
	padding: .8rem 2.2rem .9rem;
	background: var(--papier);
	border: 1.5px solid var(--encre);
	border-top: 0;
	position: sticky;
	top: 0;
	z-index: 15;
}
.outils label {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	font-family: var(--f-mono);
	font-size: .68rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--graphite);
}
.outils input, .outils select {
	font-family: var(--f-mono);
	font-size: .9rem;
	color: var(--encre);
	background: #fff;
	border: 1.5px solid var(--encre);
	border-radius: 0;
	padding: .35rem .5rem;
	width: 7.2rem;
}
.outils select { width: auto; }
.outils .btn { align-self: flex-end; }
.outil-case {
	flex-direction: row !important;
	align-items: center;
	gap: .45rem !important;
	align-self: flex-end;
	padding-bottom: .55rem;
}
.outil-case input { width: auto; accent-color: var(--rouge); }

.btn-achat {
	align-self: flex-end;
	background: var(--encre);
	color: #fff;
	border-color: var(--encre);
}
.btn-achat:hover { background: #000; border-color: #000; color: #fff; }
.outil-paye {
	align-self: flex-end;
	padding-bottom: .6rem;
	font-family: var(--f-mono);
	font-size: .8rem;
	color: var(--encre);
}

/* dossier acheté : le filigrane APERÇU disparaît */
.paye .sheet::after { display: none; }

.outil-adresse {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	font-family: var(--f-mono);
	font-size: .88rem;
	max-width: 300px;
}
.outil-adresse .outil-etiquette {
	font-size: .68rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--graphite);
}
.outil-adresse a { font-size: .75rem; }
.outil-aide {
	flex-basis: 100%;
	font-family: var(--f-mono);
	font-size: .75rem;
	color: var(--graphite);
}

/* ---------------- entrée / statut ---------------- */

.editeur-entree {
	max-width: 640px;
	margin: 4rem auto;
	background: var(--papier);
	border: 1.5px solid var(--encre);
	padding: 2.4rem;
}
.editeur-entree h1 {
	font-family: var(--f-disp);
	font-variation-settings: "wdth" 112;
	font-weight: 680;
	font-size: 1.6rem;
	margin-bottom: 1.2rem;
}
.editeur-entree form { display: flex; gap: .6rem; }
.editeur-entree input {
	flex: 1;
	min-width: 0;
	height: 52px;
	padding: 0 1rem;
	font-family: var(--f-mono);
	font-size: .98rem;
	border: 1.5px solid var(--encre);
	border-radius: 0;
	background: #fff;
}

.editeur-statut {
	max-width: 640px;
	margin: 2rem auto;
	padding: .7rem 1rem;
	font-family: var(--f-mono);
	font-size: .88rem;
	background: var(--encre);
	color: var(--papier);
}
.editeur-statut.erreur { background: var(--rouge); color: #fff; }

/* ---------------- feuilles A4 paysage ---------------- */

.sheet {
	width: 297mm;
	height: 210mm;
	margin: 18px auto;
	background: #fff;
	padding: 8mm;
	box-shadow: 0 2px 14px rgba(35, 39, 43, .16);
	display: grid;
	grid-template-columns: 1fr 66mm;
	grid-template-rows: auto 1fr;
	gap: 4mm;
	position: relative;
	overflow: hidden;
}

/* filigrane tant que le dossier n'est pas acheté */
.sheet::after {
	content: "SPÉCIMEN — mon-plan-de-masse.fr";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: rotate(-24deg);
	font-family: var(--f-mono);
	font-size: 34px;
	letter-spacing: .3em;
	color: rgba(35, 39, 43, .08);
	pointer-events: none;
	white-space: nowrap;
}

.sheet-tete {
	grid-column: 1 / -1;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 6mm;
	border-bottom: 1.2px solid var(--encre);
	padding-bottom: 2mm;
}
.sheet-tete h1 {
	margin: 0;
	font-family: var(--f-disp);
	font-variation-settings: "wdth" 118;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .06em;
}
.sheet-ref {
	font-family: var(--f-mono);
	font-size: 8.5px;
	color: #555;
	text-align: right;
}

.sheet-plan {
	border: .6px solid #BBB;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.sheet-plan svg { display: block; }

/* cartouche latéral */
.sheet-cartouche {
	display: flex;
	flex-direction: column;
	gap: 2.6mm;
	font-size: 9.5px;
	line-height: 1.4;
	font-family: var(--f-corps);
}
.c-box { border: .6px solid #CCC; padding: 2mm; }
.c-box h2 {
	margin: 0 0 1mm;
	font-family: var(--f-disp);
	font-variation-settings: "wdth" 115;
	font-weight: 650;
	font-size: 8px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #555;
}
.c-box table { width: 100%; border-collapse: collapse; }
.c-box td { padding: .4mm 0; vertical-align: top; }
.c-box td:last-child {
	text-align: right;
	font-family: var(--f-mono);
	font-size: 8.5px;
	white-space: nowrap;
}
.c-box .alerte { color: var(--rouge); font-weight: 600; }

.c-legende i {
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 4px;
	vertical-align: -1px;
}
.c-legende span { color: #777; }
.l-parcelle { background: #EFEDE4; border: 1px solid #444; }
.l-bati     { background: #D9D5C9; border: 1px solid #333; }
.l-projet   { background: rgba(194, 51, 28, .18); border: 1.4px solid var(--rouge); }
.l-cote     { background: #fff; border-top: 2px dashed #555; height: 0 !important; vertical-align: 2px; }
.l-coupe    { background: #fff; border-top: 2px dashed var(--bleu); height: 0 !important; vertical-align: 2px; }

.c-mentions {
	margin-top: auto;
	font-size: 7.6px;
	line-height: 1.4;
	color: #666;
}

/* ---------------- feuille plan de situation ---------------- */

.situation-cadre {
	position: relative;
	width: 196mm;
	height: 170mm;
	overflow: hidden;
}
.situation-cadre img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
}
.situation-cadre svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* ---------------- feuille récapitulatif Cerfa ---------------- */

.recap {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-auto-rows: min-content;
	gap: 4mm;
	align-content: start;
}
.recap .c-box { font-size: 10.5px; }
.recap .c-box h2 { font-size: 8.5px; }
.recap .c-box td { padding: .7mm 0; }
.recap .c-box td:first-child { white-space: nowrap; padding-right: 3mm; }
.recap .c-box td:last-child { font-size: 9.5px; white-space: normal; }
.recap-note {
	margin: 1.5mm 0 0;
	font-size: 8px;
	color: #666;
	line-height: 1.4;
}
.recap-note.alerte { color: var(--rouge); font-weight: 600; }
.recap-texte { margin: 0; font-size: 9px; line-height: 1.45; color: #333; }

/* ---------------- impression ---------------- */

@page { size: A4 landscape; margin: 0; }
@media print {
	body, .page-editeur { background: #fff; }
	.ecran-seul { display: none !important; }
	.sheet {
		margin: 0;
		box-shadow: none;
		width: 297mm;
		height: 210mm;
		page-break-after: always;
	}
}

/* ---------------- petit écran ---------------- */

@media (max-width: 700px) {
	.outils { padding: .7rem 1rem .8rem; gap: .7rem; }
	.outils input { width: 5.4rem; }
	.editeur-entree { margin: 2rem 1rem; padding: 1.4rem; }
	.editeur-entree form { flex-direction: column; }
	/* les feuilles A4 restent en taille réelle : défilement horizontal maîtrisé */
	#feuilles { overflow-x: auto; }
}
