:root,
:root[data-theme="puratos"],
:root[data-theme="perso"] {
  --background: #F3F2F1;
  --surface: #FFFFFF;
  --surface-2: #F7F6F5;
  --surface-3: #EDEBE9;
  --foreground: #1F1F1F;
  --muted-foreground: #5F5E5C;
  --border: #E1DFDD;
  --primary: #D6001C;
  --primary-fonce: #A80016;
  --primary-texte: #C00019;
  --primary-foreground: #FFFFFF;
  --ring: #D6001C;
  --halo-1: rgba(214, 0, 28, .09);
  --halo-2: rgba(255, 196, 176, .28);
  --halo-3: rgba(206, 204, 230, .30);
  --ombre-carte: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 10px rgba(0, 0, 0, .05);
  --ombre-haute: 0 10px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .08);
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --background: #0E0E10;
  --surface: #19191C;
  --surface-2: #212125;
  --surface-3: #2A2A2F;
  --foreground: #F4F4F5;
  --muted-foreground: #A8A8AE;
  --border: #303036;
  --primary: #D6001C;
  --primary-fonce: #B00017;
  --primary-texte: #FF6B7D;
  --primary-foreground: #FFFFFF;
  --ring: #FF6B7D;
  --halo-1: rgba(214, 0, 28, .16);
  --halo-2: rgba(120, 20, 30, .18);
  --halo-3: rgba(60, 60, 90, .22);
  --ombre-carte: 0 1px 2px rgba(0, 0, 0, .5);
  --ombre-haute: 0 14px 44px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="clair"] {
  --background: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F7F7;
  --surface-3: #EFEFEF;
  --foreground: #242424;
  --muted-foreground: #646464;
  --border: #E6E6E6;
  --primary: #B8323F;
  --primary-fonce: #962733;
  --primary-texte: #A82C38;
  --primary-foreground: #FFFFFF;
  --ring: #B8323F;
  --halo-1: rgba(184, 50, 63, .05);
  --halo-2: rgba(0, 0, 0, .02);
  --halo-3: rgba(0, 0, 0, .02);
  --ombre-carte: 0 0 0 1px #ECECEC;
  --ombre-haute: 0 10px 40px rgba(0, 0, 0, .12);
  color-scheme: light;
}
:root {
  --font-body: "Segoe UI Variable Text", "Segoe UI", "Familjen Grotesk", system-ui, sans-serif;
  --font-heading: "Segoe UI Variable Display", "Segoe UI", "Outfit", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --weight-heading: 600;
  --tracking-heading: -0.015em;
  --text-body: 0.9375rem;
  --text-small: 0.8125rem;
  --leading-body: 1.5;
  --text-h1: clamp(1.6rem, 3.2vw, 2.1rem);
  --text-h2: 1.2rem;
  --text-h3: 1rem;
  --rayon: 6px;
  --rayon-carte: 8px;
  --hauteur-barre: 60px;
  --muted: var(--surface-2);
  --input: var(--border);
}

body {
  background:
    radial-gradient(60rem 40rem at 105% -10%, var(--halo-1), transparent 60%),
    radial-gradient(50rem 36rem at -10% 20%, var(--halo-2), transparent 60%),
    radial-gradient(40rem 30rem at 60% 110%, var(--halo-3), transparent 60%),
    var(--background);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
a { color: var(--primary-texte); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.barre {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  height: var(--hauteur-barre); padding: 0 clamp(.75rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.barre-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--foreground); font-size: 1rem; white-space: nowrap; }
.barre-logo img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }
.barre-logo b { color: var(--primary-texte); font-weight: 700; }
.recherche { position: relative; flex: 1; max-width: 560px; margin-inline: auto; }
.recherche input {
  width: 100%; height: 40px; padding: 0 4.5rem 0 2.5rem;
  background: var(--surface-2); border: 1px solid transparent; border-bottom: 1px solid var(--muted-foreground);
  border-radius: var(--rayon) var(--rayon) 0 0; color: var(--foreground);
  transition: background .2s, border-color .2s;
}
.recherche input::placeholder { color: var(--muted-foreground); }
.recherche input:focus { outline: none; background: var(--surface); border-color: var(--border); border-bottom: 2px solid var(--primary); }
.recherche-ico { position: absolute; left: .75rem; top: 50%; translate: 0 -50%; color: var(--muted-foreground); display: flex; }
.recherche-kbd { position: absolute; right: .6rem; top: 50%; translate: 0 -50%; font: 600 .7rem var(--font-body); color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 4px; padding: .1rem .35rem; background: var(--surface); }
.resultats {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  max-height: min(70vh, 560px); overflow: auto; padding: .4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rayon-carte); box-shadow: var(--ombre-haute);
}
.resultat { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .6rem; border: 0; border-radius: var(--rayon); background: none; text-align: left; color: var(--foreground); }
.resultat[aria-selected="true"], .resultat:hover { background: var(--surface-2); }
.resultat-pastille { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; flex: none; background: var(--c); color: var(--ct); overflow: hidden; }
.resultat-pastille img { width: 100%; height: 100%; object-fit: contain; }
.resultat-texte { min-width: 0; flex: 1; display: grid; gap: .1rem; }
.resultat-nom { font-weight: 600; }
.resultat-nom mark, .resultat-chemin mark { background: color-mix(in srgb, var(--primary) 22%, transparent); color: inherit; border-radius: 2px; }
.resultat-chemin { font-size: var(--text-small); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultat-cible { font: .75rem var(--font-mono); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultat-genre { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); flex: none; }
.resultats-vide { padding: 1rem; color: var(--muted-foreground); text-align: center; }

.barre-nav { display: flex; gap: .15rem; }
.barre-nav a { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; border-radius: var(--rayon); color: var(--foreground); text-decoration: none; font-size: .875rem; white-space: nowrap; }
.barre-nav a:hover { background: var(--surface-2); }
.barre-nav a[aria-current="page"] { color: var(--primary-texte); background: color-mix(in srgb, var(--primary) 9%, transparent); font-weight: 600; }
.barre-nav [data-icone] { display: flex; }
.sauvegarde { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--muted-foreground); white-space: nowrap; }
.sauvegarde-point { width: 8px; height: 8px; border-radius: 50%; background: #2E7D32; }
.sauvegarde[data-etat="encours"] .sauvegarde-point { background: #E8710A; animation: pouls 1s infinite; }
.sauvegarde[data-etat="erreur"] { color: var(--primary-texte); }
.sauvegarde[data-etat="erreur"] .sauvegarde-point { background: var(--primary); }
@keyframes pouls { 50% { opacity: .3; } }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-weight: 700; font-size: .8rem; text-decoration: none; flex: none; }

.barre-rapide {
  position: sticky; top: var(--hauteur-barre); z-index: 40;
  display: flex; align-items: center; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  padding: .45rem clamp(.75rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.barre-rapide::-webkit-scrollbar { display: none; }
.barre-rapide-titre { font-size: .75rem; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .05em; margin-right: .25rem; display: flex; align-items: center; gap: .3rem; flex: none; }
.puce {
  display: inline-flex; align-items: center; gap: .45rem; flex: none;
  min-height: 34px; padding: .25rem .8rem .25rem .35rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  font-size: .85rem; text-decoration: none; transition: border-color .15s, transform .15s;
}
.puce:hover { border-color: var(--primary); }
.puce:active { transform: scale(.97); }
.puce-pastille { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: var(--ct); }
.puce-pastille .ico, .puce-pastille img { width: 14px; height: 14px; object-fit: contain; }

.app { width: min(1440px, 100%); margin: 0 auto; padding: clamp(1rem, 2.5vw, 2rem) clamp(.75rem, 2.5vw, 2rem) 3rem; }
.chargement { display: grid; place-items: center; gap: 1rem; min-height: 50vh; color: var(--muted-foreground); }
.chargement img { border-radius: 12px; animation: pouls 1.4s infinite; }

.bouton, .bouton-secondaire, .bouton-texte, .bouton-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1.1rem; border-radius: var(--rayon);
  font-weight: 600; font-size: .9rem; text-decoration: none; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .1s;
}
.bouton { background: var(--primary); color: var(--primary-foreground); }
.bouton:hover { background: var(--primary-fonce); }
.bouton-secondaire { background: var(--surface); color: var(--foreground); border-color: var(--border); }
.bouton-secondaire:hover { border-color: var(--muted-foreground); }
.bouton-secondaire[aria-pressed="true"] { border-color: var(--primary); color: var(--primary-texte); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.bouton-texte { background: none; color: var(--primary-texte); padding-inline: .6rem; }
.bouton-texte:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.bouton-danger { background: none; color: var(--primary-texte); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.bouton-danger:hover { background: var(--primary); color: var(--primary-foreground); }
.bouton:active, .bouton-secondaire:active, .bouton-texte:active, .bouton-danger:active { transform: scale(.98); }
.bouton-icone { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--rayon); border: 0; background: none; color: var(--muted-foreground); }
.bouton-icone:hover { background: var(--surface-2); color: var(--foreground); }
button:disabled { opacity: .5; cursor: not-allowed; }

.accueil-tete { display: grid; place-items: center; padding: clamp(.5rem, 3vw, 2rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.carte-bienvenue {
  width: min(560px, 100%); padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.75rem);
  background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 12px 40px rgba(0, 0, 0, .08); border-radius: 4px;
}
.carte-bienvenue img { width: 44px; height: 44px; border-radius: 6px; margin-bottom: 1.25rem; }
.carte-bienvenue .sur-titre { font-size: .85rem; color: var(--muted-foreground); margin-bottom: .25rem; }
.carte-bienvenue h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: .25rem; }
.carte-bienvenue > p { color: var(--muted-foreground); }
.champ-souligne {
  display: flex; align-items: center; gap: .6rem; width: 100%; margin: 1.5rem 0 1.25rem;
  padding: .55rem 0; border: 0; border-bottom: 1px solid var(--muted-foreground); background: none;
  color: var(--muted-foreground); text-align: left; font-size: .95rem;
}
.champ-souligne:hover { border-bottom-color: var(--primary); color: var(--foreground); }
.carte-bienvenue-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.carte-bienvenue-pied { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .8rem; color: var(--muted-foreground); }

.section { margin-top: clamp(1.75rem, 3vw, 2.5rem); }
.section-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.section-tete h2 { font-size: var(--text-h2); display: flex; align-items: center; gap: .5rem; }
.section-tete h2 small { font: 400 .85rem var(--font-body); color: var(--muted-foreground); }
.outils { display: flex; flex-wrap: wrap; gap: .5rem; }
.aide-organiser { display: none; margin: -.25rem 0 1rem; padding: .6rem .9rem; border-left: 3px solid var(--primary); background: var(--surface); font-size: .85rem; color: var(--muted-foreground); }
.mode-organiser .aide-organiser { display: block; }

.grille {
  --col: 150px;
  --ligne: 132px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--col), 1fr)); grid-auto-rows: var(--ligne);
  grid-auto-flow: dense; gap: 14px;
}
.grille-categories { --col: 210px; --ligne: 150px; gap: 16px; }
.grille-compacte { --col: 132px; --ligne: 112px; gap: 12px; }

.tuile {
  --c: #D6001C; --ct: #FFFFFF; --r: 14px; --op: 100%; --bc: transparent; --be: 0px;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: .4rem;
  min-width: 0; padding: .9rem 1rem; text-align: left;
  color: var(--ct); background-color: color-mix(in srgb, var(--c) var(--op), transparent);
  border: var(--be) solid var(--bc); border-radius: var(--r);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s, filter .2s;
}
.tuile:hover { transform: translateY(-2px); }
.tuile:active { transform: scale(.98); }
.tuile.taille-m { grid-column: span 2; }
.tuile.taille-g { grid-column: span 2; grid-row: span 2; }
.tuile.taille-l { grid-column: span 3; }
.tuile.ombre-douce { box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .08); }
.tuile.ombre-forte { box-shadow: 0 6px 14px rgba(0, 0, 0, .16), 0 18px 40px rgba(0, 0, 0, .18); }
.tuile.forme-rectangle { flex-direction: row; align-items: center; justify-content: flex-start; gap: .9rem; }
.tuile.forme-rectangle .t-haut { flex: none; }
.tuile.forme-rectangle .t-meta { position: absolute; right: .8rem; bottom: .55rem; }
.tuile.forme-carre, .tuile.forme-cercle, .tuile.forme-hexagone { aspect-ratio: 1; height: 100%; width: auto; max-width: 100%; justify-self: center; align-items: center; justify-content: center; text-align: center; padding: .6rem; }
.tuile.forme-cercle { border-radius: 50%; }
.tuile.forme-hexagone { aspect-ratio: 1.12; border-radius: 0; border: 0; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); box-shadow: none; padding: .6rem 1.4rem; }
.tuile.forme-libre { border-radius: var(--rl, 30% 70% 70% 30% / 30% 30% 70% 70%); }
.forme-carre .t-desc, .forme-cercle .t-desc, .forme-hexagone .t-desc, .forme-cercle .t-meta, .forme-hexagone .t-meta { display: none; }
.forme-carre .t-haut, .forme-cercle .t-haut, .forme-hexagone .t-haut { justify-content: center; }
.tuile.effet-degrade { background-image: linear-gradient(140deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .18)); }
.tuile.effet-verre { background-color: color-mix(in srgb, var(--c) min(var(--op), 55%), transparent); backdrop-filter: blur(12px) saturate(1.5); border-color: rgba(255, 255, 255, .45); border-width: max(var(--be), 1px); }
.tuile.effet-lueur { box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 8px 28px color-mix(in srgb, var(--c) 50%, transparent); }
.tuile.effet-relief { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .2), 0 3px 8px rgba(0, 0, 0, .15); }
.tuile.a-fond::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--img) center / cover no-repeat; }
.tuile.a-fond::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 35%, transparent), color-mix(in srgb, var(--c) 92%, transparent) 85%); }
.t-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; min-height: 0; }
.t-ico { width: 30px; height: 30px; stroke-width: 1.6; }
.taille-g .t-ico { width: 44px; height: 44px; }
.t-logo { max-width: 72px; max-height: 40px; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.taille-g .t-logo { max-width: 120px; max-height: 64px; }
.t-fav { color: #FFC83D; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.t-fav .ico { width: 18px; height: 18px; }
.forme-carre .t-fav, .forme-cercle .t-fav, .forme-hexagone .t-fav { position: absolute; top: 10%; right: 14%; }
.t-corps { display: grid; gap: .15rem; min-width: 0; }
.t-nom { font-weight: 600; font-size: .95rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.taille-g .t-nom { font-size: 1.35rem; }
.grille-categories .t-nom { font-size: 1.15rem; }
.grille-categories .taille-g .t-nom { font-size: 1.6rem; }
.t-desc { font-size: .8rem; opacity: .85; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.taille-p:not(.forme-rectangle) .t-desc { display: none; }
.t-meta { font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.tuile-ajout {
  --c: transparent; --ct: var(--muted-foreground);
  border: 2px dashed var(--border); background: transparent; align-items: center; justify-content: center; text-align: center; box-shadow: none;
}
.tuile-ajout:hover { border-color: var(--primary); color: var(--primary-texte); }
.tuile-ajout .ico { width: 28px; height: 28px; }

.mode-organiser [data-grille] .tuile[data-id] { touch-action: none; cursor: grab; animation: frisson .35s ease-in-out infinite alternate; }
.mode-organiser [data-grille] .tuile[data-id]:nth-child(2n) { animation-delay: -.17s; }
@keyframes frisson { from { rotate: -.6deg; } to { rotate: .6deg; } }
.glisse-en-cours, .glisse-en-cours * { cursor: grabbing !important; user-select: none !important; }
.tuile.source { opacity: .3; }
.fantome { position: fixed !important; z-index: 1000; pointer-events: none; margin: 0; opacity: .95; box-shadow: var(--ombre-haute) !important; rotate: 2deg; scale: 1.04; transition: none !important; animation: none !important; }
.tuile.cible-avant { box-shadow: -6px 0 0 -1px var(--primary) !important; }
.tuile.cible-apres { box-shadow: 6px 0 0 -1px var(--primary) !important; }
.tuile.cible-dans { outline: 3px dashed var(--primary); outline-offset: 3px; transform: scale(1.04); }
.tuile.cible-grouper { outline: 3px solid var(--primary); outline-offset: 3px; transform: scale(.94); }
[data-depot].cible-dans { background: var(--primary); color: var(--primary-foreground) !important; border-radius: var(--rayon); }

.tableau { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panneau { grid-column: span 4; min-width: 0; padding: 1.1rem 1.2rem; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); }
.panneau.large { grid-column: span 8; }
.panneau.moitie { grid-column: span 6; }
.panneau.plein { grid-column: 1 / -1; }
.panneau h2, .panneau h3 { font-size: .95rem; margin-bottom: .85rem; display: flex; align-items: center; gap: .45rem; }
.panneau h2 .ico { color: var(--primary-texte); }
.liste { list-style: none; padding: 0; display: grid; gap: .15rem; }
.ligne-elem { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .45rem .5rem; border: 0; border-radius: var(--rayon); background: none; text-align: left; color: var(--foreground); min-height: 44px; }
.ligne-elem:hover { background: var(--surface-2); }
.ligne-elem .resultat-pastille { width: 32px; height: 32px; }
.ligne-elem-texte { display: grid; min-width: 0; flex: 1; }
.ligne-elem-texte b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-elem-texte small { color: var(--muted-foreground); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-elem-fin { font-size: .75rem; color: var(--muted-foreground); white-space: nowrap; }
.vide { padding: 1rem .5rem; color: var(--muted-foreground); font-size: .875rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 1rem; border-radius: var(--rayon); background: var(--surface-2); }
.stat b { display: block; font: 600 2rem/1 var(--font-heading); color: var(--foreground); }
.stat span { font-size: .8rem; color: var(--muted-foreground); }
.stat:first-child b { color: var(--primary-texte); }
.en-bref { display: grid; gap: .6rem; }
.en-bref dt { font-size: .75rem; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.en-bref dd { margin: 0 0 .4rem; }
.activite { display: grid; grid-template-columns: auto 1fr; gap: .1rem .7rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.activite:last-child { border-bottom: 0; }
.activite time { grid-row: span 2; font: 600 .75rem var(--font-mono); color: var(--muted-foreground); padding-top: .15rem; }
.activite small { color: var(--muted-foreground); }
.activite b { font-weight: 600; }

.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.widget { min-width: 0; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); display: flex; flex-direction: column; }
.widget.taille-m { grid-column: span 2; }
.widget.taille-g { grid-column: span 3; }
.widget > header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .6rem .2rem 1.1rem; }
.widget h3 { font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.widget h3 .ico { color: var(--primary-texte); }
.widget-corps { padding: .4rem 1.1rem 1.1rem; min-height: 120px; }
.horloge-heure { font: 300 3rem/1.05 var(--font-heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.horloge-heure small { font-size: 1.3rem; color: var(--muted-foreground); }
.horloge-date { color: var(--muted-foreground); text-transform: capitalize; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; text-transform: capitalize; font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .8rem; }
.cal span { padding: .3rem 0; border-radius: 4px; }
.cal .jour-nom { color: var(--muted-foreground); font-size: .7rem; font-weight: 600; }
.cal .hors { color: var(--muted-foreground); opacity: .45; }
.cal .aujourdhui { background: var(--primary); color: var(--primary-foreground); font-weight: 700; }
.meteo-actuel { display: flex; align-items: center; gap: 1rem; }
.meteo-actuel .ico { width: 48px; height: 48px; color: var(--primary-texte); }
.meteo-temp { font: 300 2.6rem/1 var(--font-heading); }
.meteo-jours { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .9rem; font-size: .8rem; text-align: center; }
.meteo-jours div { padding: .4rem; border-radius: var(--rayon); background: var(--surface-2); }
.meteo-jours b { display: block; text-transform: capitalize; }
.zone-note { width: 100%; min-height: 150px; resize: vertical; padding: .7rem; border: 1px solid var(--border); border-radius: var(--rayon); background: #FFFBEA; color: #3A3A3A; line-height: 1.5; }
[data-theme="sombre"] .zone-note { background: #2A2618; color: #F3EBD0; }
.taches { list-style: none; padding: 0; display: grid; gap: .1rem; margin-bottom: .6rem; }
.taches li { display: flex; align-items: center; gap: .55rem; min-height: 38px; }
.taches label { flex: 1; display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.taches input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.taches .fait span { text-decoration: line-through; color: var(--muted-foreground); }
.taches .heure { font: 600 .8rem var(--font-mono); color: var(--primary-texte); min-width: 3.2rem; }
.ajout-ligne { display: flex; gap: .4rem; }
.ajout-ligne input { flex: 1; min-width: 0; }
.barres { display: grid; gap: .55rem; }
.barre-stat { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; font-size: .82rem; }
.barre-stat i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.barre-stat i::before { content: ""; display: block; height: 100%; width: var(--p); background: var(--primary); border-radius: 3px; }
.cadre-integre { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--rayon); background: var(--surface-2); }

.fil { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; font-size: .85rem; margin-bottom: .9rem; }
.fil a { color: var(--muted-foreground); text-decoration: none; padding: .2rem .45rem; border-radius: var(--rayon); }
.fil a:hover { color: var(--primary-texte); background: var(--surface); }
.fil span[aria-current] { font-weight: 600; padding: .2rem .45rem; }
.fil .sep { color: var(--muted-foreground); opacity: .6; }
.vue-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); }
.vue-titre { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.vue-titre .resultat-pastille { width: 52px; height: 52px; border-radius: 12px; }
.vue-titre .resultat-pastille .ico { width: 28px; height: 28px; }
.vue-titre h1 { font-size: var(--text-h1); }
.vue-titre p { color: var(--muted-foreground); font-size: .875rem; }
.etat-vide { display: grid; justify-items: center; gap: .75rem; padding: 3rem 1rem; text-align: center; background: var(--surface); border: 2px dashed var(--border); border-radius: var(--rayon-carte); color: var(--muted-foreground); }
.etat-vide .ico { width: 40px; height: 40px; color: var(--primary-texte); }
.etat-vide h2 { color: var(--foreground); font-size: 1.1rem; }

.menu {
  position: fixed; z-index: 300; min-width: 230px; max-height: calc(100vh - 16px); overflow: auto; padding: .35rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--rayon-carte); box-shadow: var(--ombre-haute);
  animation: apparait .14s ease-out;
}
.menu-titre { padding: .45rem .7rem .35rem; font-size: .75rem; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.menu button { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 40px; padding: .4rem .7rem; border: 0; border-radius: var(--rayon); background: none; color: var(--foreground); text-align: left; font-size: .9rem; }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button .ico { color: var(--muted-foreground); }
.menu button.danger, .menu button.danger .ico { color: var(--primary-texte); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.voile-menu { position: fixed; inset: 0; z-index: 299; }
@keyframes apparait { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

dialog.dialogue {
  width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0;
  border-radius: 6px; background: var(--surface); color: var(--foreground); box-shadow: var(--ombre-haute);
}
dialog.dialogue.large { width: min(1000px, calc(100vw - 1.5rem)); }
dialog.dialogue::backdrop { background: rgba(20, 20, 20, .45); backdrop-filter: blur(3px); }
dialog.dialogue[open] { animation: apparait .18s ease-out; display: flex; flex-direction: column; }
.dialogue-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .6rem 1.5rem; }
.dialogue-tete h2 { font-size: 1.25rem; }
.dialogue-corps { padding: .25rem 1.5rem 1rem; overflow: auto; flex: 1; }
.dialogue-pied { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; padding: .9rem 1.5rem 1.25rem; border-top: 1px solid var(--border); }
.dialogue-pied .etat-auto { margin-right: auto; align-self: center; font-size: .8rem; color: var(--muted-foreground); }
.dialogue-pied .etat-auto.erreur { color: var(--primary-texte); font-weight: 600; }

.champ { display: grid; gap: .3rem; margin-bottom: .9rem; }
.champ > label, .champ > span, fieldset > legend { font-size: .82rem; font-weight: 600; color: var(--foreground); }
.champ small, .aide { font-size: .78rem; color: var(--muted-foreground); }
input[type="text"], input[type="search"], input[type="url"], input[type="number"], input[type="time"], select, textarea {
  width: 100%; min-height: 40px; padding: .45rem .7rem; border: 1px solid var(--border); border-bottom-color: var(--muted-foreground);
  border-radius: 4px; background: var(--surface); color: var(--foreground);
}
.dialogue input:focus, .dialogue select:focus, .dialogue textarea:focus, .vue input:focus, .vue select:focus, .vue textarea:focus { outline: none; border-color: var(--border); border-bottom: 2px solid var(--primary); }
textarea { min-height: 70px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); flex: none; }
.code { font-family: var(--font-mono); font-size: .85rem; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 .9rem; min-width: 0; }
fieldset > legend { margin-bottom: .35rem; padding: 0; }
.choix { display: flex; flex-wrap: wrap; gap: .4rem; }
.choix label { position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix label > span { display: flex; align-items: center; gap: .4rem; min-height: 38px; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: var(--rayon); background: var(--surface); font-size: .85rem; }
.choix input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary-texte); font-weight: 600; }
.choix input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.forme-ex { width: 18px; height: 14px; background: currentColor; opacity: .7; }
.forme-ex.carre { width: 14px; border-radius: 2px; }
.forme-ex.cercle { width: 14px; border-radius: 50%; }
.forme-ex.carte { border-radius: 4px; }
.forme-ex.hexagone { width: 16px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.forme-ex.libre { border-radius: 40% 10% 40% 10%; }
.couleurs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pastille-couleur { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); background: var(--sw); }
.pastille-couleur[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary); }
.saisie-couleur { display: flex; gap: .4rem; align-items: center; }
.saisie-couleur input[type="text"] { width: 7.5rem; font-family: var(--font-mono); text-transform: uppercase; }
.choix-icones { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .3rem; max-height: 220px; overflow: auto; padding: .2rem; }
.choix-icones label > span { justify-content: center; padding: .4rem; min-height: 44px; }
.choix-icones .ico { width: 22px; height: 22px; }
.choix-images label > span { padding: .25rem; }
.choix-images img { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; }
.choix-images .logo-apercu { object-fit: contain; background: var(--surface-2); }

.onglets { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.onglets button { padding: .6rem .85rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted-foreground); font-weight: 600; font-size: .875rem; white-space: nowrap; margin-bottom: -1px; }
.onglets button[aria-selected="true"] { color: var(--primary-texte); border-bottom-color: var(--primary); }
.editeur { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; }
.editeur-apercu { position: sticky; top: 0; align-self: start; display: grid; gap: .75rem; }
.apercu-cadre { padding: 1rem; border-radius: var(--rayon-carte); background: var(--background); min-height: 200px; display: grid; place-items: center; }
.apercu-cadre .grille { --col: 105px; --ligne: 105px; width: 100%; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.apercu-cadre .tuile.taille-l { grid-column: span 2; }
.apercu-cadre .tuile { pointer-events: none; }

.pieces { list-style: none; padding: 0; display: grid; gap: .4rem; margin-bottom: 1rem; }
.piece { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: var(--rayon); }
.piece img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.piece-texte { flex: 1; min-width: 0; display: grid; }
.piece-texte a { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piece-texte small { color: var(--muted-foreground); }
.qr-grand { max-width: 220px; border-radius: 6px; }

.details { display: grid; gap: .9rem; }
.details dl { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; font-size: .9rem; }
.details dt { color: var(--muted-foreground); }
.details dd { margin: 0; overflow-wrap: anywhere; }

.arbre { list-style: none; padding: 0; display: grid; gap: .1rem; max-height: 50vh; overflow: auto; }
.arbre button { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 40px; padding: .35rem .6rem; padding-left: calc(.6rem + var(--n, 0) * 1.1rem); border: 0; border-radius: var(--rayon); background: none; color: var(--foreground); text-align: left; }
.arbre button:hover:not(:disabled) { background: var(--surface-2); }
.arbre button .ico { color: var(--primary-texte); }

.liste-vue { background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); padding: .5rem 1.25rem; }
.jour { margin: 1rem 0 .3rem; font-size: .8rem; font-weight: 700; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .05em; }
.ligne-corbeille { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.ligne-corbeille:last-child { border-bottom: 0; }
.ligne-corbeille .ligne-elem-texte { flex: 1 1 220px; }

.reglages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.theme-choix { position: relative; }
.theme-choix input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.theme-choix span { display: grid; gap: .5rem; padding: .6rem; border: 2px solid var(--border); border-radius: var(--rayon-carte); font-size: .85rem; font-weight: 600; }
.theme-choix input:checked + span { border-color: var(--primary); }
.theme-choix input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.theme-apercu { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 46px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.theme-apercu i:nth-child(1) { background: var(--a); }
.theme-apercu i:nth-child(2) { background: var(--b); }
.theme-apercu i:nth-child(3) { background: var(--c); }
.boutons-export { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: 1rem; }
.encart { padding: .8rem 1rem; border-radius: var(--rayon); background: var(--surface-2); font-size: .85rem; color: var(--muted-foreground); }
.encart b { color: var(--foreground); }

.notifications { position: fixed; z-index: 400; left: 50%; bottom: 1.25rem; translate: -50% 0; display: grid; gap: .5rem; width: min(480px, calc(100vw - 1.5rem)); pointer-events: none; }
.notification { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: var(--rayon); background: #1F1F1F; color: #FFFFFF; box-shadow: var(--ombre-haute); font-size: .9rem; pointer-events: auto; animation: apparait .2s ease-out; }
.notification.erreur { background: #A80016; }
.notification span { flex: 1; overflow-wrap: anywhere; }
.notification button { border: 0; background: none; color: #FF9AA6; font-weight: 700; padding: .3rem .5rem; border-radius: 4px; }
.notification button:hover { background: rgba(255, 255, 255, .1); }

.site-pied { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: 1rem clamp(.75rem, 2.5vw, 2rem) 1.25rem; font-size: .75rem; color: var(--muted-foreground); }
.site-pied nav { display: flex; gap: 1rem; }
.site-pied a { color: var(--muted-foreground); text-decoration: none; }
.site-pied a:hover { text-decoration: underline; color: var(--foreground); }

.texte-legal { max-width: 820px; margin: 2rem auto; padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--surface); border-radius: 4px; box-shadow: var(--ombre-carte); }
.texte-legal h1 { margin-bottom: 1rem; }
.texte-legal h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.texte-legal p, .texte-legal li { margin-bottom: .5rem; }
.message { width: min(1440px, 100% - 2rem); margin: 1rem auto 0; padding: .75rem 1rem; border-radius: var(--rayon); background: var(--surface); border-left: 3px solid #2E7D32; }
.message-erreur { border-left-color: var(--primary); }

@media (max-width: 1180px) {
  .barre-nav a { padding: .5rem; font-size: 0; gap: 0; }
  .barre-nav a .ico { font-size: 1rem; width: 20px; height: 20px; }
  .panneau { grid-column: span 6; }
  .panneau.large { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .editeur { grid-template-columns: 1fr; }
  .editeur-apercu { position: static; }
  .apercu-cadre { min-height: 140px; }
  .reglages { grid-template-columns: 1fr; }
  .widget.taille-m, .widget.taille-g { grid-column: auto; }
  .sauvegarde span[data-sauvegarde-texte] { display: none; }
}
@media (max-width: 760px) {
  :root { --hauteur-barre: 56px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .barre { gap: .6rem; }
  .barre-logo span { display: none; }
  .recherche-kbd { display: none; }
  .recherche input { padding-right: .75rem; }
  .avatar { display: none; }
  .barre-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; justify-content: space-around;
    padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
  }
  .barre-nav a { flex-direction: column; gap: .15rem; font-size: .68rem; padding: .35rem .5rem; min-width: 56px; }
  .barre-nav a .ico { width: 22px; height: 22px; }
  .panneau, .panneau.large, .panneau.moitie { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grille { --col: 130px; --ligne: 118px; gap: 10px; }
  .grille-categories { --col: 150px; --ligne: 130px; }
  .tuile.taille-l { grid-column: span 2; }
  .deux, .trois { grid-template-columns: 1fr; }
  .boutons-export { grid-template-columns: 1fr; }
  .carte-bienvenue { box-shadow: none; background: transparent; padding-inline: .25rem; }
  .details dl { grid-template-columns: 1fr; gap: .1rem; }
  .details dd { margin-bottom: .5rem; }
  .menu.feuille { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 75vh; border-radius: 14px 14px 0 0; padding-bottom: calc(.5rem + env(safe-area-inset-bottom)); }
  .menu.feuille button { min-height: 48px; }
  .notifications { bottom: calc(76px + env(safe-area-inset-bottom)); }
  dialog.dialogue, dialog.dialogue.large { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
}
@media (max-width: 380px) {
  .grille, .grille-categories { --col: 120px; }
  .tuile.taille-m, .tuile.taille-g, .tuile.taille-l { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  .mode-organiser [data-grille] .tuile[data-id] { animation: none; }
  .tuile:hover { transform: none; }
}
