/* Dashboard — la porte (toujours noire) et le tableau (clair ou sombre).
 *
 * Le thème du tableau suit le système par défaut ; data-theme="clair" ou
 * "sombre" sur <html> le force (assets/js/theme.js). Les couleurs sont des
 * variables, redéfinies une fois pour chaque thème sombre.
 */

:root {
	--fond: #f3f3f1;
	--surface: #ffffff;
	--surface-2: #f6f6f4;
	--texte: #1d1d1f;
	--discret: #6e6e73;
	--trait: #e2e2df;
	--trait-fort: #c9c9c5;
	--accent: #2f6fd6;
	--erreur: #c0392b;
	--attention: #b26a00;
	--ok: #2e7d32;
	--ombre: 0 1px 2px rgb(0 0 0 / 0.05), 0 1px 1px rgb(0 0 0 / 0.03);
	--serie-0: #2f6fd6;
	--serie-1: #d9822b;
	--serie-2: #8e5bd1;
	--serie-3: #2e9b6b;
	--p1: #d64545;
	--p2: #e08a1e;
	--p3: #3b82f6;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="clair"]) {
		--fond: #000000;
		--surface: #0d0d0e;
		--surface-2: #151517;
		--texte: #d9d9db;
		--discret: #85858b;
		--trait: #222225;
		--trait-fort: #34343a;
		--accent: #6ea2ff;
		--erreur: #ef7b72;
		--attention: #e6a740;
		--ok: #67c26f;
		--ombre: none;
		--serie-0: #6ea2ff;
		--serie-1: #f0a35c;
		--serie-2: #b48cf0;
		--serie-3: #5cc99a;
		--p1: #ef6b6b;
		--p2: #f0a35c;
		--p3: #6ea2ff;
		color-scheme: dark;
	}
}

:root[data-theme="sombre"] {
	--fond: #000000;
	--surface: #0d0d0e;
	--surface-2: #151517;
	--texte: #d9d9db;
	--discret: #85858b;
	--trait: #222225;
	--trait-fort: #34343a;
	--accent: #6ea2ff;
	--erreur: #ef7b72;
	--attention: #e6a740;
	--ok: #67c26f;
	--ombre: none;
	--serie-0: #6ea2ff;
	--serie-1: #f0a35c;
	--serie-2: #b48cf0;
	--serie-3: #5cc99a;
	--p1: #ef6b6b;
	--p2: #f0a35c;
	--p3: #6ea2ff;
	color-scheme: dark;
}

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

html,
body {
	margin: 0;
}

body {
	min-height: 100vh;
	background: var(--fond);
	color: var(--texte);
	font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.discret {
	color: var(--discret);
}

.lien {
	padding: 0;
	border: 0;
	background: none;
	color: var(--discret);
	font: inherit;
	cursor: pointer;
	text-decoration: none;
}

.lien:hover,
.lien:focus-visible {
	color: var(--texte);
	text-decoration: underline;
	outline: none;
}

/* --- La porte : noire, quel que soit le thème --------------------------------- */

body.porte {
	background: #000;
	color: #d4d4d4;
	font-size: 15px;
}

.porte .discret {
	color: #737373;
}

.porte main {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	padding: 1rem;
}

.bouton {
	display: inline-block;
	padding: 0.6rem 1.6rem;
	border: 1px solid #3a3a3a;
	border-radius: 2px;
	color: #d4d4d4;
	text-decoration: none;
	letter-spacing: 0.04em;
	transition: border-color 0.2s, color 0.2s;
}

.bouton:hover,
.bouton:focus-visible {
	border-color: #8a8a8a;
	color: #fff;
	outline: none;
}

.porte .erreur {
	max-width: 32rem;
	margin: 0;
	color: #e57373;
	font-size: 0.875rem;
	text-align: center;
}

/* --- Le tableau : la barre et la grille --------------------------------------- */

.page-tableau {
	display: flex;
	flex-direction: column;
	height: 100vh;
}

.barre {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 0.45rem 1rem;
	font-size: 0.8125rem;
}

.barre .date {
	margin: 0;
	color: var(--discret);
}

.barre .date::first-letter {
	text-transform: uppercase;
}

.barre-droite {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.barre form {
	margin: 0;
}

.theme svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.theme svg .plein {
	fill: currentColor;
	stroke: none;
}

/* La grille remplit l'écran sous la barre. La recherche tient le haut du
   centre, les colonnes de widgets l'entourent et descendent jusqu'en bas. */
.grille {
	flex: 1;
	min-height: 0;
	display: grid;
	gap: 0.75rem;
	padding: 0 0.75rem 0.75rem;
	grid-template-rows: auto minmax(0, 1fr);
}

.grille[data-colonnes="1"] {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "r" "c0";
	grid-template-rows: auto auto;
}

.grille[data-colonnes="2"] {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-template-areas: "r r" "c0 c1";
}

.grille[data-colonnes="3"] {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
	grid-template-areas: "c0 r c2" "c0 c1 c2";
}

.grille[data-colonnes="4"] {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-template-areas: "c0 r r c3" "c0 c1 c2 c3";
}

.recherche {
	grid-area: r;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.75rem 0 1.25rem;
}

.recherche form {
	width: min(100%, 44rem);
}

.recherche input {
	width: 100%;
	padding: 0.85rem 1.2rem;
	border: 1px solid var(--trait-fort);
	border-radius: 999px;
	background: var(--surface);
	color: var(--texte);
	font: inherit;
	font-size: 1.125rem;
	box-shadow: var(--ombre);
	outline: none;
	transition: border-color 0.15s;
}

.recherche input:focus {
	border-color: var(--accent);
}

.colonne {
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Une colonne vidée reste une cible : on voit où redéposer un widget. */
.colonne:empty {
	border: 1px dashed var(--trait-fort);
	border-radius: 8px;
}

.colonne:empty::before {
	content: "Déposer un widget ici";
	margin: auto;
	color: var(--discret);
	font-size: 0.75rem;
}

/* Sur une seule colonne, c'est la page qui défile, pas la colonne. */
.grille[data-colonnes="1"] .colonne {
	overflow: visible;
}

.page-tableau:has(.grille[data-colonnes="1"]) {
	height: auto;
}

/* --- Les widgets ---------------------------------------------------------------- */

.widget {
	flex: 1 1 0;
	min-height: 11rem;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--trait);
	border-radius: 8px;
	background: var(--surface);
	box-shadow: var(--ombre);
	overflow: hidden;
}

.grille[data-colonnes="1"] .widget {
	flex: none;
	max-height: 70vh;
}

.widget.replie {
	flex: 0 0 auto;
	min-height: 0;
}

.widget.replie .widget-corps,
.widget.replie .widget-pied,
.widget.replie .notes-recherche {
	display: none;
}

.widget.glisse {
	opacity: 0.4;
}

.widget-tete {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.35rem 0.4rem 0.35rem 0.25rem;
	border-bottom: 1px solid var(--trait);
	cursor: grab;
	user-select: none;
}

.widget.replie .widget-tete {
	border-bottom: 0;
}

.widget-tete h2 {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.widget-outils {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.icone {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6rem;
	height: 1.6rem;
	padding: 0 0.25rem;
	border: 0;
	border-radius: 4px;
	background: none;
	color: var(--discret);
	font: inherit;
	font-size: 0.875rem;
	text-decoration: none;
	cursor: pointer;
}

.icone:hover,
.icone:focus-visible {
	background: var(--surface-2);
	color: var(--texte);
	outline: none;
}

.poignee {
	cursor: grab;
	letter-spacing: -0.1em;
}

.widget-tete .icone[aria-expanded="false"] {
	transform: rotate(-90deg);
}

.en-charge .widget-tete .icone[title="Actualiser"] {
	animation: tourne 0.9s linear infinite;
}

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

.choix,
.champ {
	max-width: 11rem;
	padding: 0.15rem 0.3rem;
	border: 1px solid var(--trait);
	border-radius: 4px;
	background: var(--surface);
	color: var(--texte);
	font: inherit;
	font-size: 0.75rem;
}

.widget-corps {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 0.5rem 0.75rem;
	scrollbar-width: thin;
}

.widget-pied {
	padding: 0.2rem 0.75rem 0.3rem;
	color: var(--discret);
	font-size: 0.6875rem;
}

.widget-pied:empty {
	display: none;
}

.perime,
.avis {
	color: var(--attention);
}

.avis {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
}

.etat {
	margin: 0.5rem 0;
	color: var(--discret);
}

.etat-non_configure,
.etat-jeton,
.etat-injoignable,
.etat-source,
.etat-interne {
	color: var(--attention);
}

.sous-titre {
	margin: 0 0 0.4rem;
	color: var(--discret);
	font-size: 0.75rem;
}

/* --- Tâches ----------------------------------------------------------------------- */

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

.tache {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 0.5rem;
	align-items: start;
	padding: 0.35rem 0 0.35rem 0.45rem;
	border-left: 3px solid transparent;
	border-bottom: 1px solid var(--trait);
}

.tache:last-child {
	border-bottom: 0;
}

.tache.p1 { border-left-color: var(--p1); }
.tache.p2 { border-left-color: var(--p2); }
.tache.p3 { border-left-color: var(--p3); }

.tache input {
	margin: 0.2rem 0 0;
	accent-color: var(--accent);
	cursor: pointer;
}

.tache-titre {
	cursor: pointer;
}

.tache.faite .tache-titre {
	color: var(--discret);
	text-decoration: line-through;
}

.tache.refusee {
	background: color-mix(in srgb, var(--erreur) 12%, transparent);
}

.tache-meta {
	grid-column: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	color: var(--discret);
	font-size: 0.75rem;
}

.tache-meta:empty {
	display: none;
}

.tache-meta .retard {
	color: var(--erreur);
}

/* --- Agenda ----------------------------------------------------------------------- */

.agenda-jour + .agenda-jour {
	margin-top: 0.6rem;
}

.agenda-jour h3 {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0 0 0.2rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.agenda-jour h3 .discret {
	font-weight: 400;
	text-transform: none;
}

.agenda-jour.aujourdhui h3 > span:first-child {
	color: var(--accent);
}

.type-jour {
	padding: 0 0.4rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--discret);
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.evenement {
	display: grid;
	grid-template-columns: 0.5rem 5.9rem 1fr;
	align-items: start;
	column-gap: 0.45rem;
	width: 100%;
	margin: 0;
	padding: 0.15rem 0.25rem;
	border: 0;
	border-radius: 4px;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 20px;
	text-align: left;
	cursor: pointer;
}

.evenement:hover,
.evenement:focus-visible {
	background: var(--surface-2);
	outline: none;
}

.evenement.passe {
	opacity: 0.45;
}

.agenda .aucun {
	margin: 0;
	padding: 0.15rem 0.25rem;
	font-size: 0.75rem;
}

/* La pastille s'aligne sur la première ligne, pas sur le milieu d'un titre qui
   en occupe deux. */
.pastille {
	width: 0.5rem;
	height: 0.5rem;
	margin-top: 6px;
	border-radius: 50%;
	background: var(--couleur, var(--discret));
}

.evenement-heure {
	color: var(--discret);
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.evenement-texte {
	display: flex;
	flex-wrap: wrap;
	column-gap: 0.5rem;
	min-width: 0;
}

.evenement-texte .discret {
	font-size: 0.75rem;
}

/* Vue calendrier : deux semaines, du lundi au dimanche. */
.widget-corps:has(> .calendrier) {
	container-type: inline-size;
}

/* Étroit, le calendrier ne garde que les titres : l'heure est dans l'infobulle. */
@container (max-width: 560px) {
	.puce-heure {
		display: none;
	}

	.calendrier-tete .type-jour {
		display: none;
	}

	.calendrier-case {
		padding: 0.15rem 0.1rem;
	}
}

.calendrier {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--trait);
	border-radius: 6px;
	background: var(--trait);
	overflow: hidden;
}

.calendrier-jour-nom {
	padding: 0.15rem 0.3rem;
	background: var(--surface-2);
	color: var(--discret);
	font-size: 0.6875rem;
	text-align: center;
}

.calendrier-case {
	min-height: 5.5rem;
	min-width: 0;
	padding: 0.2rem;
	background: var(--surface);
}

.calendrier-case.week-end {
	background: var(--surface-2);
}

.calendrier-case.passee {
	opacity: 0.55;
}

.calendrier-tete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.2rem;
	margin-bottom: 0.15rem;
}

.calendrier-numero {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--discret);
}

.calendrier-case.aujourdhui .calendrier-numero {
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--accent);
	color: var(--surface);
}

.calendrier-tete .type-jour {
	padding: 0 0.25rem;
	font-size: 0.625rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.puce {
	display: flex;
	gap: 0.25rem;
	width: 100%;
	margin-top: 2px;
	padding: 0 0.25rem;
	border: 0;
	border-left: 3px solid var(--couleur);
	border-radius: 3px;
	background: color-mix(in srgb, var(--couleur) 12%, transparent);
	color: inherit;
	font: inherit;
	font-size: 0.6875rem;
	line-height: 1.5;
	text-align: left;
	cursor: pointer;
}

.puce.journee {
	background: color-mix(in srgb, var(--couleur) 28%, transparent);
}

.puce.passe {
	opacity: 0.6;
}

.puce:hover,
.puce:focus-visible {
	background: color-mix(in srgb, var(--couleur) 35%, transparent);
	outline: none;
}

.puce-heure {
	flex-shrink: 0;
	color: var(--discret);
	font-variant-numeric: tabular-nums;
}

.puce-titre {
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* L'infobulle d'un événement, qui suit la souris. */
.bulle-evenement {
	position: fixed;
	left: var(--x, 0);
	top: var(--y, 0);
	z-index: 50;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	max-width: 20rem;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--trait-fort);
	border-radius: 6px;
	background: var(--surface);
	box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
	font-size: 0.75rem;
	pointer-events: none;
}

.bulle-evenement[hidden] {
	display: none;
}

.bulle-evenement strong {
	font-size: 0.8125rem;
}

.bulle-evenement span {
	color: var(--discret);
}

.bulle-description {
	margin-top: 0.2rem;
	white-space: pre-line;
}

/* La fiche d'un événement, dans la fenêtre modale. */
.evenement-detail {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1rem;
	margin: 0;
}

.evenement-detail dt {
	color: var(--discret);
}

.evenement-detail dd {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	margin: 0;
}

.evenement-detail .pastille {
	margin-top: 0;
	align-self: center;
}

.evenement-detail .description {
	display: block;
	white-space: pre-line;
}

/* --- Notes -------------------------------------------------------------------------- */

.notes-recherche {
	padding: 0.5rem 0.75rem 0;
}

.notes-recherche .champ {
	width: 100%;
	max-width: none;
	padding: 0.4rem 0.6rem;
	font-size: 0.875rem;
}

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

.resultat {
	padding: 0.35rem 0.4rem;
	border-radius: 4px;
	cursor: pointer;
}

.resultat:hover,
.resultat[aria-selected="true"] {
	background: var(--surface-2);
}

.resultat-tete {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
}

.resultat-tete strong {
	font-weight: 600;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.resultat-tete .discret {
	flex-shrink: 0;
	font-size: 0.75rem;
}

.extrait {
	margin: 0.1rem 0 0;
	color: var(--discret);
	font-size: 0.75rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- Signets -------------------------------------------------------------------------- */

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

.signet a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0.3rem;
	border-radius: 4px;
	color: inherit;
	text-decoration: none;
}

.signet a:hover {
	background: var(--surface-2);
}

.favicon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	border-radius: 3px;
}

.favicon.initiale {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-2);
	color: var(--discret);
	font-size: 0.625rem;
	font-weight: 600;
}

.signet-titre {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.signet-hote {
	flex-shrink: 0;
	max-width: 40%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.75rem;
}

.a-lire {
	flex-shrink: 0;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--accent) 15%, transparent);
	color: var(--accent);
	font-size: 0.6875rem;
}

/* --- Comptes ---------------------------------------------------------------------- */

.serie-0 { --serie: var(--serie-0); }
.serie-1 { --serie: var(--serie-1); }
.serie-2 { --serie: var(--serie-2); }
.serie-3 { --serie: var(--serie-3); }

.comptes-soldes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.compte {
	display: flex;
	flex-direction: column;
	padding-left: 0.5rem;
	border-left: 3px solid var(--serie);
}

.compte-nom {
	color: var(--discret);
	font-size: 0.75rem;
}

.compte-solde {
	font-size: 1.125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.compte-plancher {
	font-size: 0.75rem;
	color: var(--discret);
	font-variant-numeric: tabular-nums;
}

.negatif {
	color: var(--erreur) !important;
}

.graphique {
	width: 100%;
}

.courbe {
	display: block;
}

.courbe .graduation {
	stroke: var(--trait);
	stroke-width: 1;
}

.courbe .zero {
	stroke: var(--trait-fort);
	stroke-width: 1;
}

.courbe .axe {
	fill: var(--discret);
	font-size: 10px;
}

.courbe .ligne {
	fill: none;
	stroke: var(--serie);
	stroke-width: 1.75;
	stroke-linejoin: round;
}

.courbe .survol {
	fill: transparent;
	cursor: crosshair;
}

.courbe .repere {
	stroke: var(--trait-fort);
	stroke-width: 1;
	pointer-events: none;
}

.courbe .bulle {
	pointer-events: none;
}

.courbe .bulle rect {
	fill: var(--surface);
	stroke: var(--trait-fort);
}

.courbe .bulle text {
	font-size: 11px;
	fill: var(--serie, var(--texte));
	font-variant-numeric: tabular-nums;
}

.courbe .bulle .bulle-date {
	fill: var(--discret);
}

.legende {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.9rem;
	margin-top: 0.25rem;
	font-size: 0.75rem;
}

.legende span {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.legende .trait {
	display: inline-block;
	width: 0.9rem;
	height: 2px;
	background: var(--serie);
}

.comptes-tableaux {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.25rem;
	margin-top: 1rem;
}

.comptes-tableaux h3 {
	margin: 0 0 0.4rem;
	padding-left: 0.5rem;
	border-left: 3px solid var(--serie);
	font-size: 0.875rem;
	color: var(--texte);
}

.comptes-tableaux h4 {
	margin: 0.75rem 0 0.25rem;
	font-size: 0.75rem;
	color: var(--discret);
	font-weight: 600;
}

table.mois {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

table.mois th {
	color: var(--discret);
	font-weight: 400;
	text-align: right;
}

table.mois th:first-child,
table.mois td:first-child {
	text-align: left;
}

table.mois td {
	padding: 0.1rem 0;
	border-top: 1px solid var(--trait);
}

.montant {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.prochains {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.75rem;
}

.prochains li {
	display: grid;
	grid-template-columns: 2.8rem 1fr auto;
	gap: 0.5rem;
	padding: 0.1rem 0;
}

/* --- Aperçu dépliable (digest) ----------------------------------------- */

/* Une quinzaine de lignes, fondues vers le bas ; la flèche déplie le reste. */
.apercu:not(.ouvert) {
	max-height: 21em;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5em), transparent);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5em), transparent);
}

.apercu-cadre {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.apercu-cadre .apercu {
	align-self: stretch;
}

.apercu-cadre.court .apercu {
	-webkit-mask-image: none;
	mask-image: none;
}

.apercu-cadre.court .deplier {
	display: none;
}

.deplier {
	margin-top: 0.1rem;
	font-size: 1rem;
}

/* --- Markdown et revue de presse -------------------------------------------- */

.md {
	font-size: 0.875rem;
	overflow-wrap: anywhere;
}

.md > :first-child {
	margin-top: 0;
}

.md h1 { font-size: 1.15rem; margin: 0.4rem 0 0.5rem; }
.md h2 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.md h3 { font-size: 0.9rem; margin: 0.8rem 0 0.3rem; }
.md h4, .md h5, .md h6 { font-size: 0.875rem; margin: 0.6rem 0 0.2rem; }

.md p,
.md ul,
.md ol,
.md blockquote,
.md pre {
	margin: 0.35rem 0;
}

.md ul,
.md ol {
	padding-left: 1.3rem;
}

.md a {
	color: var(--accent);
	text-decoration: none;
}

.md a:hover {
	text-decoration: underline;
}

/* Un lien dont l'adresse a été refusée (javascript:…) n'est plus qu'un texte. */
.md a:not([href]) {
	color: inherit;
}

.md blockquote {
	padding-left: 0.75rem;
	border-left: 3px solid var(--trait-fort);
	color: var(--discret);
}

.md code {
	padding: 0.05rem 0.25rem;
	border-radius: 3px;
	background: var(--surface-2);
	font-size: 0.8125rem;
}

.md pre {
	padding: 0.5rem;
	border-radius: 4px;
	background: var(--surface-2);
	overflow-x: auto;
}

.md pre code {
	padding: 0;
	background: none;
}

.md hr {
	border: 0;
	border-top: 1px solid var(--trait);
}

/* Le rendu de Notes enveloppe chaque tableau dans .tableau pour qu'il défile. */
.md .tableau {
	overflow-x: auto;
}

.md table {
	border-collapse: collapse;
	margin: 0.4rem 0;
	font-size: 0.8125rem;
}

.md th,
.md td {
	padding: 0.2rem 0.5rem;
	border: 1px solid var(--trait);
	text-align: left;
	vertical-align: top;
}

.md th {
	background: var(--surface-2);
	font-weight: 600;
}

.md .aligne-centre { text-align: center; }
.md .aligne-droite { text-align: right; }

/* Les cases d'une note se lisent ici, elles se cochent dans Notes. */
.md .tache {
	display: list-item;
	padding: 0;
	border: 0;
	list-style: none;
}

.md .tache input {
	pointer-events: none;
	margin-right: 0.35rem;
}

.md .tache--faite {
	color: var(--discret);
	text-decoration: line-through;
}

/* --- Fenêtre modale ------------------------------------------------------------ */

.modale {
	width: min(48rem, calc(100vw - 2rem));
	max-height: calc(100vh - 3rem);
	padding: 0;
	border: 1px solid var(--trait-fort);
	border-radius: 10px;
	background: var(--surface);
	color: var(--texte);
}

.modale.large {
	width: min(72rem, calc(100vw - 2rem));
}

.modale[open] {
	display: flex;
	flex-direction: column;
}

.modale::backdrop {
	background: rgb(0 0 0 / 0.55);
}

.modale > header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.7rem 0.75rem 0.7rem 1.25rem;
	border-bottom: 1px solid var(--trait);
}

.modale h2 {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 1rem;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.modale #modale-lien {
	color: var(--accent);
	white-space: nowrap;
	font-size: 0.8125rem;
}

.modale-corps {
	padding: 1rem 1.25rem 1.25rem;
	overflow-y: auto;
}

.modale-corps .md {
	font-size: 0.9375rem;
}

@media (max-width: 759px) {
	.barre .discret {
		display: none;
	}

	.recherche {
		padding: 1rem 0 0.25rem;
	}
}
