/*
 * Tunnel de commande (maquette commander.html) : colonne unique et barre de total collante sur
 * mobile ; dès 960 px, colonne d'étape et récapitulatif collant à droite. Styles limités à .tunnel.
 */

.tunnel {
	padding-bottom: 0;
	line-height: 1.55;
	background: var(--sable); /* la feuille Fusion de la page impose un fond blanc */
}

.tunnel .gut {
	padding-inline: max(16px, env(safe-area-inset-left, 0px));
}

.tunnel .hint {
	margin: 0;
	font-size: 14px;
	color: var(--encre-3);
}

/* ---------- Étapes ---------- */
.stp {
	max-width: 1180px;
	margin: 0 auto;
	padding-block: 16px 4px;
}

.stp-mob {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.stp-mob b {
	font-size: 15px;
}

.stp-bar {
	margin-top: 10px;
	height: 4px;
	border-radius: var(--radius-pill);
	background: var(--filet);
	overflow: hidden;
}

.stp-bar i {
	display: block;
	height: 100%;
	background: var(--rose);
	border-radius: var(--radius-pill);
	transition: width 0.4s ease;
}

.stp-list {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
}

.stp-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	font-size: 14px;
	font-weight: 600;
	color: var(--encre-3);
}

.stp-list li::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--trait);
	margin-right: 10px;
}

.stp-list li:last-child::after {
	display: none;
}

.stp-list .n {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--trait);
	background: var(--papier);
	font-size: 13px;
}

.stp-list li.on {
	color: var(--encre);
}

.stp-list li.on .n {
	background: var(--encre);
	color: var(--sur-encre);
	border-color: var(--encre);
}

.stp-list li.ok .n {
	background: var(--pistache);
	border-color: var(--pistache);
	color: var(--encre);
}

@media (max-width: 479px) {
	.stp-mob .hint {
		display: none;
	}
}

@media (min-width: 960px) {
	.stp-mob,
	.stp-bar {
		display: none;
	}

	.stp-list {
		display: flex;
	}

	.stp {
		padding-block: 22px 6px;
	}
}

/* ---------- Gabarit ---------- */
.lay {
	max-width: 1180px;
	margin: 0 auto;
	padding-block: 8px 56px;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
}

@media (min-width: 960px) {
	.lay {
		grid-template-columns: minmax(0, 1fr) 340px;
		gap: 28px;
		padding-bottom: 72px;
		align-items: start;
	}
}

.tunnel .main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.tunnel .back {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	border: none;
	background: none;
	padding: 0;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--encre-2);
	cursor: pointer;
}

.tunnel .back:hover {
	color: var(--rose);
}

.tunnel .h1 {
	margin: 0;
	font-weight: 500;
	font-size: clamp(32px, 8.4vw, 52px);
	line-height: 1.02;
	letter-spacing: -0.03em;
	text-wrap: balance;
}

.tunnel .h1 em {
	font-family: var(--font-accent);
	font-style: italic;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--rose);
	font-size: 1.08em;
}

.tunnel .h1:focus {
	outline: none;
}

.tunnel .lead {
	margin: 0;
	max-width: 56ch;
	font-size: 16.5px;
	color: var(--encre-2);
}

.tunnel .card {
	background: var(--papier);
	border: 1px solid var(--trait-fin);
	border-radius: 24px;
	padding: 20px 16px;
}

.tunnel .card-h {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
}

.tunnel .card-h h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.tunnel .card-h .kick {
	white-space: nowrap;
}

@media (min-width: 640px) {
	.tunnel .card {
		padding: 26px;
	}
}

/* ---------- Choix oui / non ---------- */
.yn {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.yn button {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 84px;
	padding: 16px;
	border-radius: 18px;
	border: 1px solid var(--trait);
	background: var(--papier);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.yn button:hover {
	border-color: var(--encre);
}

.yn .ico,
.tunnel .opt .ico,
.drop .ico {
	flex: none;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.yn .ico {
	width: 48px;
	height: 48px;
}

.yn b {
	display: block;
	font-size: 18px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.yn small {
	display: block;
	font-size: 14px;
	color: var(--encre-3);
	margin-top: 2px;
}

@media (min-width: 640px) {
	.yn {
		grid-template-columns: 1fr 1fr;
	}
}

.done {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 18px;
	background: var(--pistache-pale);
	font-weight: 600;
	font-size: 15px;
}

.done span {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.done button {
	border: none;
	background: none;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	min-height: 40px;
}

/* ---------- Check-list ---------- */
.chk {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.chk li {
	border-top: 1px solid var(--filet-papier);
}

.chk li:first-child {
	border-top: none;
}

.chk label {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 12px 0;
	cursor: pointer;
}

.chk input,
.tunnel .check-line input {
	appearance: none;
	-webkit-appearance: none;
	flex: none;
	width: 24px;
	height: 24px;
	margin: 1px 0 0;
	border-radius: 7px;
	border: 2px solid var(--encre-3);
	background: var(--papier);
	display: grid;
	place-content: center;
	cursor: pointer;
}

.chk input::after,
.tunnel .check-line input::after {
	content: "";
	width: 12px;
	height: 7px;
	border-left: 2.5px solid var(--encre);
	border-bottom: 2.5px solid var(--encre);
	transform: rotate(-45deg) translate(1px, -1px);
	opacity: 0;
}

.chk input:checked {
	background: var(--pistache);
	border-color: var(--pistache);
}

.chk input:checked::after,
.tunnel .check-line input:checked::after {
	opacity: 1;
}

.chk b {
	display: block;
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.35;
}

.chk small {
	display: block;
	font-size: 14px;
	color: var(--encre-3);
	line-height: 1.45;
	margin-top: 2px;
}

/* Compteur, jauge et points barrés : même fonctionnement que la check-list de Concevoir ma maquette. */
.tunnel .card-h .chk-n {
	white-space: nowrap;
	font-size: 14px;
	font-weight: 600;
	color: var(--encre-3);
	font-variant-numeric: tabular-nums;
}

.chk-jauge {
	height: 6px;
	margin: -4px 0 8px;
	border-radius: 999px;
	background: var(--papier-2);
	overflow: hidden;
}

.chk-jauge i {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--pistache-point);
	transition: width 0.35s;
}

.chk input:checked + span b {
	text-decoration: line-through;
	text-decoration-color: var(--encre-3);
	color: var(--encre-2);
}

.chk-fin {
	margin: 6px 0 0;
	padding: 12px 14px;
	border-radius: var(--radius-m);
	background: var(--pistache-pale);
	color: var(--pistache-encre);
	font-size: 14.5px;
	font-weight: 600;
}

.chk-fin[hidden],
.chk-foot[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.chk-jauge i {
		transition: none;
	}
}

.chk-foot {
	margin-top: 6px;
	padding: 12px 14px;
	border-radius: var(--radius-m);
	background: var(--papier-2);
	font-size: 14px;
	color: var(--encre-2);
}

/* ---------- Formats ---------- */
.fmts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.fmt {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-height: 150px;
	padding: 14px;
	border-radius: 18px;
	border: 1px solid var(--trait);
	background: var(--papier);
	color: var(--encre);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.fmt:hover {
	border-color: var(--encre);
}

.fmt[aria-checked="true"] {
	background: var(--encre);
	color: var(--sur-encre);
	border-color: var(--encre);
}

.fmt .shape {
	height: 52px;
	display: flex;
	align-items: flex-end;
}

.fmt .shape i {
	display: block;
	border-radius: 3px;
	background: var(--puce);
}

.fmt b {
	font-size: 16.5px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.fmt small {
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--encre-3);
}

.fmt[aria-checked="true"] small {
	color: var(--sur-encre-2);
}

.fmt .pr {
	margin-top: auto;
	font-size: 13px;
}

.fmt .pr .num {
	font-size: 19px;
}

.fmt.na {
	background: transparent;
	border-style: dashed;
}

.fmt.na b,
.fmt.na .shape {
	opacity: 0.5;
}

.fmt.na .pr {
	color: var(--orange-encre);
	font-weight: 600;
	font-size: 12.5px;
}

.fmt[aria-checked="true"].na {
	background: var(--papier-2);
	color: var(--encre);
}

.fmt[data-format="mag"] { --puce: var(--orange); }
.fmt[data-format="eco"] { --puce: var(--pistache); }
.fmt[data-format="tab"] { --puce: var(--rose); }
.fmt[data-format="brd"] { --puce: var(--citron); }

@media (min-width: 1100px) {
	.fmts {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ---------- Réglages ---------- */
.fld {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 0;
	border-top: 1px solid var(--filet-papier);
}

.fld:first-child {
	border-top: none;
	padding-top: 4px;
}

.fld-l {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 15.5px;
	font-weight: 600;
}

.fld-v {
	font-size: 14px;
	font-weight: 500;
	color: var(--encre-2);
	white-space: nowrap;
}

.fld-v .num {
	font-size: 28px;
	color: var(--encre);
	margin-right: 3px;
}

/* Nombre d'exemplaires : saisie libre, soulignée en pointillé pour se signaler. */
.fld-v .saisie-q {
	width: 4.4ch;
	padding: 0 2px;
	border: 0;
	border-bottom: 2px dashed var(--trait);
	border-radius: 0;
	background: transparent;
	line-height: 1.1;
	text-align: right;
	-moz-appearance: textfield;
	appearance: textfield;
}

.fld-v .saisie-q:hover {
	border-bottom-color: var(--encre-3);
}

.fld-v .saisie-q:focus {
	outline: none;
	border-bottom-color: var(--rose);
	border-bottom-style: solid;
}

.tunnel .ctl {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tunnel .pm {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--trait);
	background: var(--papier);
	color: var(--encre);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.tunnel .pm:hover:not(:disabled) {
	background: var(--encre);
	color: var(--sur-encre);
}

.tunnel .pm:disabled {
	opacity: 0.35;
	cursor: default;
}

.tunnel .rng {
	flex: 1;
	min-width: 0;
	-webkit-appearance: none;
	appearance: none;
	height: 6px;
	margin: 0;
	border-radius: var(--radius-pill);
	background: linear-gradient(90deg, var(--rose) 0 var(--p, 0%), var(--filet-papier) var(--p, 0%) 100%);
	cursor: pointer;
}

.tunnel .rng::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--papier);
	border: 7px solid var(--encre);
	box-shadow: 0 2px 6px rgba(30, 27, 23, 0.25);
}

.tunnel .rng::-moz-range-thumb {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--papier);
	border: 7px solid var(--encre);
	box-sizing: border-box;
}

.tunnel .badge {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px 11px;
	border-radius: var(--radius-pill);
	font-size: 13px;
	font-weight: 600;
	background: var(--pistache-pale);
	color: var(--pistache-encre);
	white-space: nowrap;
}

.hors {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px;
	border-radius: 18px;
	background: var(--citron-pale);
	font-size: 14.5px;
	color: var(--encre-2);
}

.hors b {
	color: var(--encre);
	font-size: 15.5px;
}

.hors a {
	font-weight: 600;
	align-self: flex-start;
}

/* ---------- Coordonnées ---------- */
.coord {
	margin: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
}

.coord div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--filet-papier);
	font-size: 15px;
}

.coord dt {
	color: var(--encre-3);
}

.coord dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
	word-break: break-word;
}

.coord-lien {
	display: inline-block;
	margin-top: 14px;
	font-weight: 600;
}

/* ---------- Dépôt et contrôle ---------- */
.drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 220px;
	padding: 24px 16px;
	border-radius: 18px;
	border: 2px dashed var(--filet);
	background: var(--papier-2);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.drop.over,
.drop:hover,
.drop:focus-within {
	border-color: var(--rose);
	background: var(--papier);
}

.drop b {
	font-size: 18px;
	letter-spacing: -0.02em;
}

.drop small {
	font-size: 13.5px;
	color: var(--encre-3);
}

.drop .ico {
	width: 56px;
	height: 56px;
	background: var(--rose);
	color: #fff;
}

.tunnel .file {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--radius-m);
	background: var(--papier-2);
}

.tunnel .file .pdf {
	flex: none;
	width: 40px;
	height: 48px;
	border-radius: 5px;
	background: var(--rose);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 6px;
	letter-spacing: 0.06em;
}

.tunnel .file b {
	display: block;
	font-size: 15px;
	word-break: break-all;
}

.tunnel .file small {
	color: var(--encre-3);
	font-size: 13px;
}

.tunnel .file button {
	margin-left: auto;
	border: none;
	background: none;
	font-weight: 600;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
	min-height: 40px;
	white-space: nowrap;
}

.tunnel .file button:disabled {
	opacity: 0.4;
	cursor: default;
}

.prog {
	height: 6px;
	border-radius: var(--radius-pill);
	background: var(--filet-papier);
	overflow: hidden;
	margin-top: 14px;
}

.prog i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--rose);
	transition: width 0.25s linear;
}

/* Barre indéterminée pendant le contrôle Callas */
.prog.indet i {
	width: 35%;
	animation: defile 1.4s ease-in-out infinite;
}

@keyframes defile {
	from { transform: translateX(-100%); }
	to { transform: translateX(300%); }
}

.ctrl {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
}

.ctrl li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px 0;
	border-top: 1px solid var(--filet-papier);
}

.ctrl li:first-child {
	border-top: none;
}

.st {
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.st.ok { background: var(--pistache); color: var(--encre); }
.st.warn { background: var(--citron); color: var(--encre); }
.st.err { background: var(--orange); color: var(--encre); }

.ctrl b {
	display: block;
	font-size: 15px;
	line-height: 1.35;
}

.ctrl small {
	display: block;
	font-size: 13.5px;
	color: var(--encre-3);
	line-height: 1.45;
	margin-top: 2px;
}

.tunnel .alert {
	padding: 14px 16px;
	border-radius: var(--radius-m);
	font-size: 14.5px;
}

.tunnel .alert.err { background: var(--orange-pale); }
.tunnel .alert.warn { background: var(--citron-pale); }
.tunnel .alert.ok { background: var(--pistache-pale); }

/* ---------- Boutons d'action ---------- */
.tunnel .mfaj-btn:disabled {
	background: var(--filet);
	color: var(--encre-3);
	cursor: not-allowed;
	border-color: transparent;
}

.tunnel .actions {
	display: none;
}

@media (min-width: 960px) {
	.tunnel .actions {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		margin-top: 6px;
	}

	.tunnel .actions .why {
		font-size: 14px;
		color: var(--encre-3);
	}
}

.tunnel .actions .why:empty {
	display: none;
}

/* ---------- Aperçu et bon à tirer ---------- */
.tunnel .view {
	border-radius: var(--radius-l);
	background: var(--sable-2);
	padding: 18px 10px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.tunnel .spread {
	display: flex;
	justify-content: center;
	min-height: 200px;
	align-items: center;
}

.tunnel .pg {
	position: relative;
	background: #fff;
	box-shadow: 0 8px 18px rgba(30, 27, 23, 0.18);
}

.tunnel .pg img,
.tunnel .pg canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.tunnel .pg .flag,
.tunnel .thumbs .flag {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--citron);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
	box-shadow: 0 0 0 4px rgba(240, 217, 74, 0.35);
}

.tunnel .vctl {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tunnel .vctl button {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--trait);
	background: var(--papier);
	color: var(--encre);
	cursor: pointer;
	display: grid;
	place-content: center;
}

.tunnel .vctl button:disabled {
	opacity: 0.35;
	cursor: default;
}

.tunnel .vctl span {
	font-size: 14px;
	font-weight: 600;
	min-width: 130px;
	text-align: center;
}

.tunnel .thumbs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	max-width: 100%;
	padding: 4px 2px 6px;
	scrollbar-width: thin;
}

.tunnel .thumbs button {
	position: relative;
	flex: none;
	display: flex;
	gap: 1px;
	padding: 4px;
	border-radius: 8px;
	border: 2px solid transparent;
	background: transparent;
	cursor: pointer;
}

.tunnel .thumbs button[aria-current="true"] {
	border-color: var(--rose);
}

.tunnel .thumbs i {
	display: block;
	width: 32px;
	height: 44px;
	background: #fff center / cover no-repeat;
	box-shadow: 0 1px 3px rgba(30, 27, 23, 0.2);
}

.tunnel .thumbs .flag {
	top: -4px;
	right: -4px;
	width: 18px;
	height: 18px;
	font-size: 11px;
	box-shadow: none;
}

.tunnel .view-msg {
	padding: 40px 16px;
	text-align: center;
	font-size: 14.5px;
	color: var(--encre-2);
}

.tunnel .bat {
	padding: 16px;
	border-radius: var(--radius-l);
	background: var(--papier-2);
}

.tunnel .check-line {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: 15px;
	line-height: 1.45;
	cursor: pointer;
}

.tunnel .check-line input:checked {
	background: var(--encre);
	border-color: var(--encre);
}

.tunnel .check-line input:checked::after {
	border-color: var(--sur-encre);
}

/* ---------- Livraison ---------- */
.tunnel .tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	padding: 5px;
	border-radius: var(--radius-pill);
	background: var(--papier-2);
	margin-bottom: 18px;
}

.tunnel .tabs button {
	min-height: 44px;
	border: none;
	border-radius: var(--radius-pill);
	background: transparent;
	color: var(--encre);
	font: 600 14.5px var(--font-sans);
	cursor: pointer;
	padding: 0 10px;
}

.tunnel .tabs button[aria-selected="true"],
.tunnel .tabs button[aria-checked="true"] {
	background: var(--encre);
	color: var(--sur-encre);
}

/* Étape « Vos coordonnées » : type de compte et structure à compléter. */
.tunnel .cf {
	margin-bottom: 14px;
}

.tunnel .cf .cf-intro {
	margin: 0 0 14px;
}

.tunnel .cf .form {
	margin-bottom: 14px;
}

.tunnel .cf .alert {
	margin-bottom: 14px;
}

.tunnel .cf .cf-note {
	margin: 0 0 14px;
}

.tunnel .addrs {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tunnel .addr {
	border: 1px solid var(--trait);
	border-radius: var(--radius-l);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--papier);
}

.tunnel .addr.ko {
	border-color: var(--orange);
	box-shadow: 0 0 0 1px var(--orange);
}

.tunnel .addr-h {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.tunnel .addr-h b {
	font-size: 15.5px;
}

.tunnel .lien-btn {
	border: none;
	background: none;
	padding: 6px 0;
	color: var(--encre);
	font: 600 14px var(--font-sans);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

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

@media (min-width: 640px) {
	.tunnel .form.two {
		grid-template-columns: 1fr 1fr;
	}

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

.tunnel .f {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tunnel .f label {
	font-size: 14.5px;
	font-weight: 600;
}

.tunnel .f label small {
	font-weight: 400;
	color: var(--encre-3);
}

.tunnel .f input,
.tunnel .f select {
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--trait);
	background: #fff;
	font: 400 16px var(--font-sans);
	color: var(--encre);
}

.tunnel .f input:focus,
.tunnel .f select:focus {
	outline: 3px solid var(--encre);
	outline-offset: 1px;
}

.tunnel .f input[aria-invalid="true"] {
	border-color: var(--orange-encre);
}

.tunnel .f .err {
	font-size: 13px;
	color: var(--orange-encre);
}

.tunnel .split {
	font-size: 14px;
	font-weight: 600;
	padding: 10px 14px;
	border-radius: var(--radius-m);
	background: var(--orange-pale);
}

.tunnel .split.ok {
	background: var(--pistache-pale);
	color: var(--pistache-encre);
}

.tunnel .ajout {
	align-self: flex-start;
}

.tunnel .modele {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 4px 0 16px;
	font-weight: 600;
	font-size: 14.5px;
	color: var(--encre);
}

.tunnel .mapping {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

.tunnel .mapping .f {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 6px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--filet-papier);
}

@media (min-width: 640px) {
	.tunnel .mapping .f {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
		align-items: center;
		gap: 4px 16px;
	}
}

.tunnel .mapping .ex {
	font-size: 13px;
	color: var(--encre-3);
	overflow-wrap: anywhere;
}

@media (min-width: 640px) {
	.tunnel .mapping .ex {
		grid-column: 2;
	}
}

.tunnel .lignes-ko {
	margin: 10px 0 0;
	padding-left: 18px;
	font-size: 14px;
	line-height: 1.5;
}

/* ---------- Récapitulatif ---------- */
.sum {
	display: none;
}

@media (min-width: 960px) {
	.sum {
		display: block;
		position: sticky;
		top: calc(var(--sh-colle-h, 0px) + 20px);
	}
}

.sum-c {
	background: var(--papier);
	border: 1px solid var(--trait-fin);
	border-radius: 24px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sum-prev {
	height: 150px;
	border-radius: var(--radius-m);
	background-color: var(--sable);
	background-image: linear-gradient(90deg, var(--trait-fin) 1px, transparent 1px), linear-gradient(0deg, var(--trait-fin) 1px, transparent 1px);
	background-size: 16px 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sum-prev i {
	display: block;
	border-radius: 4px;
	box-shadow: var(--ombre-objet);
	transition: width 0.4s, height 0.4s;
}

.sum-t {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.tunnel .sum dl,
.tunnel .sheet dl {
	margin: 0;
}

.tunnel .sum dl div,
.tunnel .sheet dl div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--trait);
	font-size: 14px;
}

.tunnel .sum dt,
.tunnel .sheet dt {
	color: var(--encre-2);
}

.tunnel .sum dd,
.tunnel .sheet dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
}

.tot {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.tot .num {
	font-size: 32px;
	color: var(--rose);
	line-height: 1;
}

.dates {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px;
	border-radius: var(--radius-m);
	background: var(--encre);
	color: var(--sur-encre);
	font-size: 13.5px;
}

.dates div {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.dates span:first-child {
	color: var(--sur-encre-2);
}

.sum-help {
	margin: 0;
	font-size: 13.5px;
	color: var(--encre-3);
	text-align: center;
}

/* ---------- Barre mobile ---------- */
.mbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	background: var(--papier);
	border-top: 1px solid var(--trait);
	box-shadow: 0 -10px 30px rgba(30, 27, 23, 0.12);
	padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
	display: flex;
	align-items: center;
	gap: 14px;
}

.mbar .tt {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	border: none;
	background: none;
	padding: 0;
	color: var(--encre);
	cursor: pointer;
	text-align: left;
}

.mbar .tt small {
	font-size: 12px;
	color: var(--encre-3);
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.mbar .tt .num {
	font-size: 22px;
	line-height: 1.15;
}

.mbar .mfaj-btn {
	min-height: 50px;
	padding: 0 20px;
	flex: none;
	max-width: 62%;
}

@media (min-width: 960px) {
	.mbar {
		display: none;
	}
}

@media (max-width: 959px) {
	body.has-mbar {
		padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Fenêtres ---------- */
.tunnel .ov {
	position: fixed;
	inset: 0;
	z-index: 120;
	background: rgba(30, 27, 23, 0.42);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.tunnel .ov[hidden] {
	display: none;
}

.tunnel .sheet {
	width: 100%;
	max-width: 560px;
	max-height: 88vh;
	overflow: auto;
	background: var(--papier);
	border-radius: 24px 24px 0 0;
	padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
	animation: monte-feuille 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tunnel .sheet .grab {
	width: 44px;
	height: 5px;
	border-radius: var(--radius-pill);
	background: var(--filet);
	margin: 4px auto 14px;
}

.tunnel .sheet h2 {
	margin: 8px 0 0;
	font-weight: 500;
	font-size: 30px;
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.tunnel .sheet h2 em {
	font-family: var(--font-accent);
	font-style: italic;
	font-weight: 700;
	color: var(--rose);
}

.tunnel .opts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

.tunnel .opt {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px;
	border-radius: 18px;
	text-decoration: none;
	color: var(--encre);
}

.tunnel .opt:hover {
	outline: 2px solid var(--encre);
	color: var(--encre);
}

.tunnel .opt .ico {
	width: 46px;
	height: 46px;
	background: var(--papier);
}

.tunnel .opt b {
	display: block;
	font-size: 16px;
}

.tunnel .opt small {
	display: block;
	font-size: 13.5px;
	color: var(--encre-2);
}

.tunnel .opt--1 { background: var(--orange-pale); }
.tunnel .opt--2 { background: var(--citron-pale); }
.tunnel .opt--3 { background: var(--pistache-pale); }

.tunnel .sheet-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}

@media (min-width: 640px) {
	.tunnel .ov {
		align-items: center;
	}

	.tunnel .sheet {
		border-radius: 24px;
		padding: 26px 28px;
	}

	.tunnel .sheet .grab {
		display: none;
	}
}

@keyframes monte-feuille {
	from {
		transform: translateY(30px);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.prog.indet i {
		animation: none;
		width: 100%;
		opacity: 0.5;
	}
}
