/* Signets — signets.dujardin.me
 *
 * La palette est celle de Notes et de Tâches (et donc de Sono93), teinte pour
 * teinte : des sites de la même main doivent se reconnaître.
 *
 * Une différence de forme, voulue : Tâches écrit ses teintes en light-dark(),
 * que Safari ne connaît que depuis la 17.5. La cible de Signets descend à
 * Safari iOS 15 ; les deux jeux de teintes sont donc déclarés à part — le clair
 * par défaut, le sombre par la préférence du système ou par le choix enregistré.
 */

:root {
	color-scheme: light;

	--fond: #fff;
	--laterale: #f4f4f7;
	--surface: #f1f1f5;
	--surface-haute: #e6e6ee;
	--bordure: #e1e1e9;
	--separateur: #e4e4ec;
	--survol: #eaeaf1;
	--texte: #16171a;
	--texte-doux: #3b3f47;
	--discret: #62687a;
	--efface: #6b7180;

	--accent: #7b2cbf;
	--accent-texte: #fff;
	--accent-voile: rgba(123, 44, 191, .12);
	--accent-halo: rgba(123, 44, 191, .35);

	--erreur: #c0272d;
	--succes: #0f7a52;
	--avertir: #a8850c;
	--surligne: rgba(231, 190, 35, .45);

	--ombre: rgba(0, 0, 0, .12);
	--voile-fond: rgba(0, 0, 0, .35);

	--rayon: 6px;
	--largeur-laterale: 348px; /* 232 px jusqu'au 30/11/2026, élargie de moitié */
}

/* Les teintes sombres, une fois pour les deux façons d'y arriver. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="clair"]) {
		color-scheme: dark;

		--fond: #0b0b0d;
		--laterale: #000;
		--surface: #17181c;
		--surface-haute: #212328;
		--bordure: #2a2c33;
		--separateur: #1d1f25;
		--survol: #131418;
		--texte: #f2f3f5;
		--texte-doux: #c8ccd3;
		--discret: #9096a0;
		--efface: #5f6672;

		--accent: #c589f2;
		--accent-texte: #17171b;
		--accent-voile: rgba(197, 137, 242, .16);
		--accent-halo: rgba(197, 137, 242, .45);

		--erreur: #ff6b6b;
		--succes: #5ddba0;
		--avertir: #e7be23;
		--surligne: rgba(231, 190, 35, .35);

		--ombre: rgba(0, 0, 0, .35);
		--voile-fond: rgba(0, 0, 0, .6);
	}
}

:root[data-theme="sombre"] {
	color-scheme: dark;

	--fond: #0b0b0d;
	--laterale: #000;
	--surface: #17181c;
	--surface-haute: #212328;
	--bordure: #2a2c33;
	--separateur: #1d1f25;
	--survol: #131418;
	--texte: #f2f3f5;
	--texte-doux: #c8ccd3;
	--discret: #9096a0;
	--efface: #5f6672;

	--accent: #c589f2;
	--accent-texte: #17171b;
	--accent-voile: rgba(197, 137, 242, .16);
	--accent-halo: rgba(197, 137, 242, .45);

	--erreur: #ff6b6b;
	--succes: #5ddba0;
	--avertir: #e7be23;
	--surligne: rgba(231, 190, 35, .35);

	--ombre: rgba(0, 0, 0, .35);
	--voile-fond: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
	margin: 0;
	background: var(--fond);
	color: var(--texte);
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.hors-ecran {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Les symboles des pictogrammes, posés une fois dans la page. */
.symboles { position: absolute; width: 0; height: 0; overflow: hidden; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

kbd {
	padding: 1px 5px;
	border: 1px solid var(--bordure);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--surface);
	font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Le cadre ------------------------------------------------------------ */

.cadre { display: flex; height: 100%; }

.colonne {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.vue--nue {
	display: grid;
	place-items: center;
	min-height: 100%;
	padding: 24px 16px;
}

.vue--page {
	flex: 1;
	overflow-y: auto;
	display: flex;
	justify-content: center;
	padding: 24px 16px 64px;
}

.page-reglages { display: flex; flex-direction: column; }

/* --- La barre latérale --------------------------------------------------- */

.laterale {
	width: var(--largeur-laterale);
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--laterale);
	border-right: 1px solid var(--separateur);
	padding: 14px 10px 10px;
	/* La latérale ne défile pas : seul le menu le fait. La Corbeille, le
	   compte (les réglages), l'aide et le thème restent en bas, à portée,
	   quelle que soit la longueur de la liste des étiquettes. */
	overflow: hidden;
}

.marque {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 8px 4px;
	font-weight: 600;
}

.logo { display: block; width: 26px; height: 26px; }
.logo svg { display: block; width: 100%; height: 100%; }
/* Le mauve de la marque est FIXE, comme le favicon et ceux de la fratrie : il
   ne suit pas l'accent, qui s'éclaircit en thème sombre. */
.logo-fond { fill: #7b2cbf; }
.logo-trace {
	fill: none;
	stroke: #fff;
	stroke-width: 2.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.menu {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: flex;
	flex-direction: column;
	gap: 1px;
	/* Pour que la barre de défilement ne colle pas aux pastilles. */
	margin-right: -6px;
	padding-right: 6px;
}
.menu > * { flex: none; }

.menu-titre {
	margin: 6px 0 4px;
	padding: 0 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--efface);
}

.menu-dossiers { display: flex; flex-direction: column; gap: 1px; }

.menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border: 0;
	border-radius: var(--rayon);
	background: none;
	color: var(--texte-doux);
	text-align: left;
	width: 100%;
	cursor: pointer;
}

.menu-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover { background: var(--survol); color: var(--texte); }

.menu-item[aria-current="page"] {
	background: var(--accent-voile);
	color: var(--accent);
	font-weight: 500;
}

.menu-item--discret { color: var(--discret); font-size: 14px; }

.menu-emoji {
	width: 20px;
	flex: none;
	text-align: center;
	font-size: 16px;
	line-height: 1;
}

.menu-nom { flex: 1; }

.menu-compte {
	margin-left: auto;
	flex: none;
	padding-left: 6px;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--efface);
}
.menu-item[aria-current="page"] .menu-compte { color: var(--accent); }

/* Une cible de dépôt se signale pendant qu'un signet ou un dossier la survole. */
.menu-item.depot { background: var(--accent-voile); box-shadow: inset 0 0 0 1px var(--accent); }

.dossier-neuf { padding: 0 2px; }

.dossier-neuf input,
.dossier-renomme input,
.etiquette-neuve input {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--fond);
	font-size: 14px;
}

.pied {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-top: 10px;
	border-top: 1px solid var(--separateur);
}

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

.compte {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: var(--rayon);
	color: var(--texte-doux);
}
.compte span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte:hover { background: var(--survol); color: var(--texte); }

/* --- Les outils ------------------------------------------------------------ */

.outil {
	position: relative;
	display: inline-grid;
	place-items: center;
	min-width: 34px; height: 34px;
	padding: 0;
	border: 0;
	border-radius: var(--rayon);
	background: none;
	color: var(--discret);
	cursor: pointer;
}
/* Une enveloppe en ligne poserait le pictogramme sur la ligne de base du
   texte, un peu plus haut que ses voisins : on la centre comme eux. */
.affichage-grille, .affichage-liste { display: grid; }
.outil:hover { background: var(--survol); color: var(--texte); }
.outil[aria-pressed="true"] { color: var(--accent); }

.outil--texte { padding: 0 10px; font-size: 14px; }
.outil--danger { color: var(--erreur); }

/* « Ranger dans » : un sélecteur natif posé, invisible, sur le pictogramme.
   Il reste le vrai contrôle — clavier, lecteur d'écran et liste native du
   téléphone compris — sans le poids visuel d'une liste déroulante. */
.outil--choix select {
	position: absolute;
	inset: 0;
	width: 100%;
	opacity: 0;
	cursor: pointer;
}
.outil--choix:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

.bascule-theme .theme-clair,
.bascule-theme .theme-sombre { display: none; }
:root[data-theme="clair"] .theme-sombre { display: grid; }
:root[data-theme="sombre"] .theme-clair { display: grid; }

@media (prefers-color-scheme: light) {
	:root:not([data-theme]) .theme-sombre { display: grid; }
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .theme-clair { display: grid; }
}

/* --- La barre du haut ---------------------------------------------------- */

.haut {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--separateur);
}

.haut-titre { margin: 0; font-size: 17px; font-weight: 600; }
.haut-outils { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.burger {
	display: none;
	place-items: center;
	width: 36px; height: 36px;
	flex: none;
	border: 0;
	border-radius: var(--rayon);
	background: none;
	color: var(--texte-doux);
	cursor: pointer;
}
.burger:hover { background: var(--survol); }

.voile {
	position: fixed;
	inset: 0;
	background: var(--voile-fond);
	z-index: 15;
}

/* --- La recherche ---------------------------------------------------------- */

.recherche {
	position: relative;
	flex: 1;
	max-width: 560px;
	display: flex;
	align-items: center;
}

.recherche > .icone {
	position: absolute;
	left: 10px;
	color: var(--efface);
	pointer-events: none;
}

.recherche input {
	width: 100%;
	padding: 8px 70px 8px 38px;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--surface);
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
}

.recherche input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.recherche-touche {
	position: absolute;
	right: 10px;
	color: var(--efface);
	pointer-events: none;
}
.recherche input:focus ~ .recherche-touche,
.recherche input:not(:placeholder-shown) ~ .recherche-touche { display: none; }

.resultats {
	position: absolute;
	top: calc(100% + 6px);
	left: 0; right: 0;
	z-index: 30;
	max-height: min(60vh, 460px);
	overflow-y: auto;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: var(--fond);
	border: 1px solid var(--bordure);
	border-radius: calc(var(--rayon) * 1.5);
	box-shadow: 0 12px 32px var(--ombre);
}

.resultat {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0 10px;
	padding: 8px 10px;
	border-radius: var(--rayon);
	cursor: pointer;
}
.resultat[aria-selected="true"] { background: var(--accent-voile); }
.resultat--vide { color: var(--discret); cursor: default; }

.resultat-titre { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resultat-dossier { font-size: 12px; color: var(--efface); white-space: nowrap; }
.resultat-extrait {
	grid-column: 1 / -1;
	font-size: 13px;
	color: var(--discret);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --- La liste des signets -------------------------------------------------------- */

.liste {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.liste-tete {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 980px;
	margin: 0 auto;
	padding: 16px 16px 8px 24px;
}

.liste-titre {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.liste-outils { display: flex; gap: 2px; }
.dossier-renomme { max-width: 980px; margin: 0 auto; padding: 0 16px 8px 24px; }
.liste-note { max-width: 980px; margin: 0 auto 8px; padding: 0 24px; font-size: 13px; color: var(--discret); }

.signets {
	max-width: 980px;
	margin: 0 auto;
	padding: 0 12px 24px;
	list-style: none;
}

.signet {
	position: relative;
	display: grid;
	grid-template-columns: 20px 1fr auto;
	gap: 0 12px;
	align-items: start;
	padding: 9px 8px 9px 12px;
	border-radius: var(--rayon);
}
.signet:hover { background: var(--survol); }
.signet[aria-current="true"] { background: var(--accent-voile); }
.signet--tire { opacity: .45; }

/* L'icône du site, ou son initiale sur une pastille quand il n'en a pas. */
.favicon {
	width: 20px; height: 20px;
	margin-top: 1px;
	border-radius: 4px;
	object-fit: contain;
}

.favicon--initiale {
	display: grid;
	place-items: center;
	background: var(--surface-haute);
	color: var(--discret);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.signet-corps { min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.signet-titre {
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.signet-titre:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.signet-commentaire,
.signet-extrait {
	font-size: 13px;
	color: var(--discret);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Le mot trouvé dans un extrait de recherche. */
mark {
	padding: 0 1px;
	border-radius: 2px;
	background: var(--surligne);
	color: inherit;
}

.signet-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 10px;
	font-size: 12px;
	color: var(--efface);
}

.signet-hote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.signet-etiquette { color: var(--discret); cursor: pointer; }
.signet-etiquette::before { content: "#"; opacity: .7; }
.signet-etiquette:hover { color: var(--accent); }
.signet-indice { display: inline-flex; align-items: center; gap: 3px; }
.signet-indice .icone { width: 14px; height: 14px; }

.signet-outils { display: flex; gap: 0; align-self: center; }
.signet-outils .outil { min-width: 30px; height: 30px; }
.signet-outils .icone { width: 18px; height: 18px; }

/* L'épingle : discrète au repos (au survol seulement), franche quand le
   signet est épinglé. Sans survol (tablette), toujours visible. */
.signet-epingle { opacity: 0; }
.signet:hover .signet-epingle,
.signet-epingle:focus-visible,
.signet-epingle[aria-pressed="true"] { opacity: 1; }
.signet-epingle[aria-pressed="true"] { color: var(--accent); }
.signet-epingle[aria-pressed="true"] { background: var(--accent-voile); }
.signet-epingle[aria-pressed="true"] .icone { stroke-width: 2.2; }
@media (hover: none) {
	.signet-epingle { opacity: 1; }
}

/* La poubelle : comme l'épingle, discrète au repos. Elle reste visible là où
   il n'y a pas de survol — sur une tablette, un outil qu'on ne voit pas
   n'existe pas, et le menu de l'appui long n'est pas évident. */
.signet-jeter { opacity: 0; }
.signet:hover .signet-jeter,
.signet-jeter:focus-visible { opacity: 1; }

@media (hover: none) {
	.signet-jeter { opacity: 1; }
}

.plus { display: block; margin: 8px auto 0; width: auto; }

.vide {
	margin: 40px 24px;
	text-align: center;
	color: var(--discret);
}

/* Un lien glissé depuis un autre onglet : toute la page devient une cible. */
body.depot-externe .colonne { outline: 3px dashed var(--accent); outline-offset: -8px; }

.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.etiquette {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 1px 4px 1px 8px;
	border-radius: 999px;
	background: var(--surface-haute);
	color: var(--texte-doux);
	font-size: 13px;
}
.etiquette::before { content: "#"; opacity: .6; }

.etiquette-retirer {
	display: grid;
	place-items: center;
	width: 18px; height: 18px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--efface);
	cursor: pointer;
}
.etiquette-retirer .icone { width: 12px; height: 12px; }
.etiquette-retirer:hover { background: var(--surface); color: var(--texte); }

/* Plus précis que « .champ input », qui l'étalerait sur toute la largeur. */
.champ .etiquette-neuve { width: 150px; padding: 4px 10px; border-radius: 999px; font-size: 13px; }

.lien {
	padding: 0;
	border: 0;
	background: none;
	color: var(--discret);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.lien:hover { color: var(--accent); }

/* Les étiquettes de la barre latérale : des pastilles, pas des lignes. Le
   nombre, entre parenthèses, n'apparaît qu'à partir de deux (app.js). */
.menu-etiquettes { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 6px 4px; }
.menu-etiquette {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--surface-haute);
	color: var(--texte-doux);
	font-size: 13px;
}
.menu-etiquette::before { content: "#"; opacity: .6; }
.menu-etiquette-nombre { color: var(--efface); }
.menu-etiquette:hover { color: var(--texte); }
.menu-etiquette[aria-current="page"] { background: var(--accent-voile); color: var(--accent); }
.menu-etiquette[aria-current="page"] .menu-etiquette-nombre { color: var(--accent); }

/* --- La fiche et le formulaire d'ajout --------------------------------------------- */

.fiche { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.fiche .champ { margin-bottom: 0; }

.champ textarea {
	width: 100%;
	min-height: 90px;
	padding: 9px 11px;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--fond);
	resize: vertical;
}
.champ textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.case { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texte-doux); cursor: pointer; }
.case input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.fiche-description { margin: 0; font-size: 13px; color: var(--discret); }
.fiche-infos { margin: 0; font-size: 12px; color: var(--efface); }
.fiche-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche-actions .bouton { width: auto; }
.fiche-doublon { margin: 0; font-size: 13px; color: var(--avertir); }

/* --- La lecture de l'article ------------------------------------------------------- */

.panneau--large { width: min(760px, 100%); }

.article-source { margin: 0; font-size: 13px; color: var(--discret); overflow-wrap: anywhere; }

.article-texte {
	font: 17px/1.65 Georgia, "Times New Roman", serif;
	color: var(--texte);
	overflow-wrap: anywhere;
}
.article-texte p { margin: 0 0 .9em; white-space: pre-line; }

/* --- Panneaux et annonces --------------------------------------------------------- */

.panneau {
	position: fixed;
	top: 0; right: 0; bottom: 0;
	z-index: 20;
	width: min(440px, 100%);
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--fond);
	border-left: 1px solid var(--bordure);
	box-shadow: 0 0 30px var(--ombre);
	overflow-y: auto;
}

.panneau-tete { display: flex; align-items: center; justify-content: space-between; }
.panneau-tete h2 { margin: 0; font-size: 17px; }
.panneau-note { margin: 0; font-size: 13px; color: var(--discret); }
/* Le texte d'une question : les retours à la ligne comptent, ils séparent ce
   qu'on vise de ce qu'il faut en savoir. */
.confirmer-texte { margin: 0; white-space: pre-line; }
.panneau--confirmer { width: min(420px, 100%); }

.raccourcis { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.raccourcis dt { white-space: nowrap; }
.raccourcis dd { margin: 0; color: var(--texte-doux); }

.annonce {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 40;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: calc(100% - 32px);
	padding: 10px 14px;
	border-radius: calc(var(--rayon) * 1.5);
	background: var(--texte);
	color: var(--fond);
	font-size: 14px;
	box-shadow: 0 8px 24px var(--ombre);
}

.annonce-action {
	flex: none;
	padding: 4px 8px;
	border: 0;
	border-radius: var(--rayon);
	background: none;
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

/* Le menu du clic droit. */
.menu-contextuel {
	position: fixed;
	z-index: 50;
	min-width: 220px;
	padding: 4px;
	border: 1px solid var(--bordure);
	border-radius: calc(var(--rayon) * 1.5);
	background: var(--fond);
	box-shadow: 0 12px 32px var(--ombre);
}

.menu-contextuel button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 7px 10px;
	border: 0;
	border-radius: var(--rayon);
	background: none;
	color: var(--texte-doux);
	text-align: left;
	cursor: pointer;
}
.menu-contextuel button:hover,
.menu-contextuel button:focus-visible { background: var(--survol); color: var(--texte); outline: none; }
.menu-contextuel .icone { width: 18px; height: 18px; color: var(--discret); }
.menu-contextuel kbd { margin-left: auto; color: var(--efface); }
.menu-contextuel [data-action="jeter"],
.menu-contextuel [data-action="effacer"] { color: var(--erreur); }
.menu-contextuel [data-action="jeter"] .icone,
.menu-contextuel [data-action="effacer"] .icone { color: inherit; }

/* --- Formulaires et cartes (connexion, réglages) ------------------------------------ */

.carte {
	width: min(380px, 100%);
	background: var(--surface);
	border: 1px solid var(--bordure);
	border-radius: calc(var(--rayon) * 2);
	padding: 28px;
	box-shadow: 0 8px 30px var(--ombre);
}

.carte--large { width: min(600px, 100%); box-shadow: none; align-self: flex-start; }

.carte .marque { justify-content: center; padding: 0 0 18px; font-size: 18px; }
.carte h2 { margin: 0 0 4px; font-size: 18px; }
.carte .accroche { margin: 0 0 16px; color: var(--discret); font-size: 14px; }

.carte h3 {
	margin: 28px 0 6px;
	padding-top: 24px;
	border-top: 1px solid var(--separateur);
	font-size: 15px;
}
.carte h3:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; margin-bottom: 5px; font-size: 13px; color: var(--texte-doux); }

.champ input,
.champ select {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--fond);
}

.champ input:focus-visible,
.champ select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.bouton {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	border-radius: var(--rayon);
	background: var(--accent);
	color: var(--accent-texte);
	font-weight: 600;
	text-align: center;
	cursor: pointer;
}
.bouton:hover { filter: brightness(1.08); }

.bouton--danger { background: var(--erreur); }
.bouton--sobre { background: var(--surface-haute); color: var(--texte-doux); }
.bouton--sobre:hover { background: var(--survol); filter: none; color: var(--texte); }
.bouton--petit { width: auto; padding: 6px 10px; font-size: 13px; font-weight: 500; }

.bouton--nouvelle { justify-content: flex-start; padding: 9px 10px; }

.secours { margin-top: 18px; }
.secours summary { cursor: pointer; color: var(--discret); font-size: 14px; text-align: center; }
.secours[open] summary { margin-bottom: 14px; }

.message {
	margin: 0 0 16px;
	padding: 9px 12px;
	border-radius: var(--rayon);
	font-size: 14px;
}
.message p { margin: 0 0 6px; }
.message p:last-child { margin-bottom: 0; }
.message--erreur { background: var(--accent-voile); color: var(--erreur); }
.message--succes { background: var(--accent-voile); color: var(--succes); }

.sous-carte { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--discret); }
.sous-carte a { color: var(--accent); }

.liste-sobre { margin: 0 0 14px; padding: 0; list-style: none; }
.liste-sobre li { padding: 8px 0; border-bottom: 1px solid var(--separateur); }
.liste-sobre li:last-child { border-bottom: 0; }
.liste-sobre small { display: block; color: var(--efface); font-size: 12px; }

.liste-jetons li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.pastille {
	display: inline-block;
	margin-left: 6px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--accent-voile);
	color: var(--accent);
	font-size: 11px;
	font-weight: 600;
}

.formulaire-ligne { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: end; }
.formulaire-ligne .bouton { grid-column: 1 / -1; }

.jeton-clair {
	width: 100%;
	margin: 6px 0;
	padding: 8px 10px;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--fond);
	color: var(--texte);
	font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.etapes { margin: 0 0 14px; padding-left: 20px; }
.etapes li { margin: 4px 0; }
.routes code { font-size: 12.5px; }
.lien-contrat { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.exemple {
	margin: 0 0 14px;
	padding: 10px 12px;
	overflow-x: auto;
	border: 1px solid var(--bordure);
	border-radius: var(--rayon);
	background: var(--fond);
	font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
	white-space: pre;
}

.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; }

.pied-carte { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--separateur); }

code {
	padding: 1px 4px;
	border-radius: 3px;
	background: var(--surface-haute);
	font-size: .92em;
}

/* --- La page d'épreuves ------------------------------------------------------------- */

.epreuves { margin: 0 0 8px; padding: 0; list-style: none; font-size: 13px; }
.epreuves li { padding: 2px 0; }
.epreuves .ok { color: var(--discret); }
.epreuves .rate { color: var(--erreur); }

/* --- Sous 900 px : la latérale devient un tiroir --------------------------------------- */

@media (max-width: 900px) {
	.laterale {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 20;
		/* Sur un téléphone, le tiroir laisse voir un bord de la liste. */
		max-width: 85vw;
		transform: translateX(calc(-100% - 40px));
		transition: transform .18s ease;
		box-shadow: 0 0 30px var(--ombre);
		border-right: 0;
	}

	body.tiroir-ouvert .laterale { transform: none; }
	.burger { display: grid; }
}

/* --- Sous 760 px : le téléphone ------------------------------------------------------ */

@media (max-width: 760px) {
	.recherche-touche { display: none; }
	.recherche input { padding-right: 12px; }
	.liste-tete { padding-left: 16px; }
	.signets { padding: 0 4px 24px; }
	.signet { padding-left: 8px; gap: 0 10px; }
	.panneau { width: 100%; }
}

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

/* --- La grille ------------------------------------------------------------------------ */
/*
 * Des cartes : l'aperçu en 16:9, puis le titre et ses indices. La même
 * structure que la ligne de liste (mêmes gestes, même menu), rangée autrement.
 */

.signets--grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
	padding-top: 4px;
}

.signet--carte {
	grid-template-columns: 1fr auto;
	grid-template-rows: auto 1fr;
	gap: 8px 4px;
	padding: 0 4px 10px 0;
	border: 1px solid var(--separateur);
	overflow: hidden;
	background: var(--fond);
}
.signet--carte:hover { background: var(--survol); }

.vignette {
	grid-column: 1 / -1;
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--surface);
}
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette--vide .favicon { width: 40px; height: 40px; border-radius: 8px; }
.vignette--vide .favicon--initiale { font-size: 20px; }

.signet--carte .signet-corps { padding-left: 12px; }
.signet--carte .signet-titre {
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.signet--carte .signet-commentaire { -webkit-line-clamp: 2; }
.signet--carte .signet-outils { align-self: start; flex-direction: column; }

.fiche-apercu {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--rayon);
	background: var(--surface);
}

@media (max-width: 760px) {
	.signets--grille { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
