/* La palette reprend celle de FICHES.html : meme univers, memes reperes.
   Tout est pense pour une main sur un telephone : cibles de 44 px au moins,
   la barre d'action en bas, rien d'essentiel en haut de l'ecran. */

:root {
	--paper: #dcdcd0;
	--raised: #c9c7b8;
	--well: #cecabb;
	--ink: #1b1f1c;
	--soft: #52564e;
	--faint: #86836f;
	--correction: #b23a1f;
	--relic: #26514a;
	--line: #b0ac98;
	--dot: #1b1f1c0e;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #0e0f11;
		--raised: #17181b;
		--well: #131417;
		--ink: #d6d8dc;
		--soft: #9aa0a6;
		--faint: #606468;
		--correction: #e0563f;
		--relic: #5fa096;
		--line: #26282c;
		--dot: #d6d8dc0a;
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	color: var(--ink);
	background: var(--paper) radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0) 0 0 / 22px 22px;
	font: 16px/1.45 -apple-system, "Helvetica Neue", system-ui, sans-serif;
	-webkit-text-size-adjust: 100%;
}

#app {
	max-width: 720px;
	margin: 0 auto;
	padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
}

h1,
h2 {
	margin: 0;
	font-family: ui-serif, Georgia, serif;
	letter-spacing: -0.025em;
}

h1 {
	font-size: 26px;
}

h2 {
	font-size: 17px;
	margin: 22px 0 8px;
}

p {
	margin: 8px 0 0;
	color: var(--soft);
}

code,
pre {
	font: 0.85em ui-monospace, "SF Mono", Menlo, monospace;
}

pre {
	margin: 8px 0;
	padding: 10px 12px;
	overflow-x: auto;
	background: var(--well);
	border: 1px solid var(--line);
	color: var(--ink);
}

/* --- Chapeau et reglages ------------------------------------------------ */

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

.reglages {
	display: flex;
	gap: 8px;
	align-items: center;
}

.segments {
	display: flex;
	border: 1px solid var(--line);
}

.segments button {
	min-height: 36px;
	padding: 0 12px;
	font: 0.72rem ui-monospace, Menlo, monospace;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--soft);
	background: var(--raised);
	border: 0;
	cursor: pointer;
}

.segments button.actif {
	color: var(--paper);
	background: var(--relic);
}

select {
	min-height: 36px;
	padding: 0 8px;
	font: inherit;
	font-size: 0.85rem;
	color: var(--ink);
	background: var(--raised);
	border: 1px solid var(--line);
	border-radius: 0;
}

/* --- Recherche ---------------------------------------------------------- */

.recherche {
	width: 100%;
	margin: 16px 0 4px;
	padding: 13px 14px;
	font: inherit;
	color: var(--ink);
	background: var(--well);
	border: 1px solid var(--line);
	border-radius: 0;
}

.recherche:focus {
	outline: 2px solid var(--correction);
	outline-offset: 0;
}

/* --- Lots et fiches ---------------------------------------------------- */

.lot {
	margin-top: 8px;
	background: var(--raised);
	border: 1px solid var(--line);
}

.lot.ouvert {
	border-left: 3px solid var(--relic);
}

.tete {
	display: flex;
	align-items: stretch;
}

.deplier {
	display: flex;
	flex: 1;
	gap: 12px;
	align-items: center;
	min-height: 52px;
	padding: 8px 10px;
	font: inherit;
	text-align: left;
	color: var(--ink);
	background: none;
	border: 0;
	cursor: pointer;
}

.numero {
	flex: 0 0 34px;
	font: 0.95rem ui-monospace, Menlo, monospace;
	color: var(--relic);
	text-align: center;
}

.deplier .titre,
.fiche .titre {
	display: block;
}

.meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 3px;
	font: 0.68rem ui-monospace, Menlo, monospace;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--faint);
}

.etiquette {
	padding: 1px 5px;
	border: 1px solid var(--line);
	white-space: nowrap;
}

.etiquette.refus {
	color: var(--correction);
	border-color: var(--correction);
}

.tout {
	flex: 0 0 auto;
	margin: 8px 8px 8px 0;
}

.fiche {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 11px 12px;
	border-top: 1px solid var(--line);
	cursor: pointer;
}

.resultats .fiche {
	margin-top: 6px;
	background: var(--raised);
	border: 1px solid var(--line);
}

.fiche.empechee {
	opacity: 0.55;
	cursor: not-allowed;
}

.fiche input[type="checkbox"] {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--relic);
}

.fiche .corps {
	flex: 1;
}

.vide {
	padding: 20px 0;
	text-align: center;
}

/* --- Barre d'action ---------------------------------------------------- */

.barre {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	max-width: 720px;
	margin: 0 auto;
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: var(--raised);
	border-top: 1px solid var(--line);
}

.compte {
	font-size: 0.9rem;
	color: var(--soft);
}

.compte strong {
	font-size: 1.15rem;
	color: var(--ink);
}

.separe {
	color: var(--faint);
}

.refus {
	color: var(--correction);
}

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

.bouton {
	min-height: 44px;
	padding: 0 16px;
	font: inherit;
	font-size: 0.9rem;
	color: var(--ink);
	background: var(--well);
	border: 1px solid var(--line);
	border-radius: 0;
	cursor: pointer;
}

.bouton.primaire {
	font-weight: 600;
	color: var(--paper);
	background: var(--relic);
	border-color: var(--relic);
}

.bouton.primaire:disabled {
	color: var(--faint);
	background: var(--well);
	border-color: var(--line);
	cursor: not-allowed;
}

.bouton.discret {
	min-height: 36px;
	font-size: 0.78rem;
	color: var(--soft);
	background: none;
	border-color: transparent;
	text-decoration: underline;
}

.depot {
	display: inline-flex;
	align-items: center;
	margin-top: 16px;
}

/* --- Envoi ------------------------------------------------------------- */

.accueil,
.envoi {
	margin-top: 24px;
}

.envoi header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.apercu {
	width: 100%;
	height: min(52vh, 460px);
	margin-top: 12px;
	background: var(--well);
	border: 1px solid var(--line);
}

.canaux {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.canaux .bouton {
	flex: 1 1 auto;
}

.aparte {
	margin-top: 14px;
	font-size: 0.82rem;
	color: var(--faint);
}

/* --- Messages et pied -------------------------------------------------- */

.message {
	margin: 14px 0 0;
	padding: 10px 12px;
	background: var(--raised);
	border-left: 3px solid var(--relic);
	color: var(--ink);
}

.message.alerte {
	border-left-color: var(--correction);
}

.pied {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: space-between;
	margin-top: 28px;
	padding-top: 12px;
	font: 0.72rem ui-monospace, Menlo, monospace;
	color: var(--faint);
	border-top: 1px solid var(--line);
}

details summary {
	margin-top: 18px;
	font-size: 0.88rem;
	color: var(--soft);
	cursor: pointer;
}
