/* Thème : les couleurs viennent de js/theme.js (mêmes styles que l'app Android : clair / sombre / système + 8 palettes),
   qui pose ces variables sur <html> avant le premier affichage. Les valeurs ci-dessous (vert « forêt » clair) ne servent
   que de repli si le script ne s'exécute pas. */
:root {
    --primary: #2e6b41;
    --primary-contrast: #ffffff;
    --primary-soft: #b2f1be;
    --on-primary-soft: #00210e;
    --bg: #f6fbf3;
    --surface: #ffffff;
    --surface-high: #e3ece4;
    --text: #17211a;
    --muted: #4a5c4e;
    --track: #dfe8e0;
    --outline: #6e7f72;
    --border: #cbd8cd;
    --danger: #b3261e;
    --shadow: 0 1px 3px rgba(0, 0, 0, .12);
    --accent-1: #2f8f4d;
    --accent-2: #2d8f9a;
    --accent-3: #4fbf6d;
    --accent-gradient: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
    --accent-loop: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-1));
    --rayon-1: #2f8f4d; --rayon-2: #2d8f9a; --rayon-3: #4fbf6d; --rayon-4: #6bb04f; --rayon-5: #3d9fb0; --rayon-6: #5bc07f;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.2rem; margin: 0 0 .6rem; }
h3.section { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.4rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.error { color: var(--danger); }
.grow { flex: 1; min-width: 0; }

/* ---- Écran de démarrage / connexion ---- */
.boot { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.boot-logo { width: 6rem; height: 6rem; display: block; margin: 0 auto .5rem; }
.login h1 { margin-top: 0; }
.login .captcha { display: flex; justify-content: center; margin: .8rem 0; min-height: 65px; }

/* ---- Structure ---- */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; background: var(--surface); position: sticky; top: 0; z-index: 5; }
/* Ruban de couleur qui défile doucement sous la barre du haut (dégradé du style choisi ; arc-en-ciel pour « Fierté »). */
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent-loop) 0 0 / 800px 100% repeat-x; animation: accent-shift 10s linear infinite; }
[data-palette="pride"] .topbar::after, [data-palette="cyberpunk"] .topbar::after { animation-duration: 6s; }
/* Cyberpunk : le ruban du haut brille comme un tube néon. */
[data-palette="cyberpunk"][data-theme="dark"] .topbar::after { box-shadow: 0 0 10px rgba(255, 42, 109, .55), 0 0 18px rgba(5, 217, 232, .35); }
@keyframes accent-shift { to { background-position-x: 800px; } }
/* Styles « Terminal » vert et ambre (2026-10-20) : titres en police de terminal ; en sombre, ils brillent comme un
   écran à phosphore et de fines lignes de balayage passent sur toute la page. */
[data-palette^="terminal"] h1, [data-palette^="terminal"] h2, [data-palette^="terminal"] h3, [data-palette^="terminal"] .brand {
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace; letter-spacing: .02em; }
[data-palette^="terminal"][data-theme="dark"] h1, [data-palette^="terminal"][data-theme="dark"] h2 {
    text-shadow: 0 0 .35em color-mix(in srgb, var(--primary) 55%, transparent); }
[data-palette^="terminal"][data-theme="dark"] body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .16) 2px 3px); }
[data-palette^="terminal"][data-theme="dark"] .topbar::after { box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 55%, transparent); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; display: flex; align-items: center; gap: .4rem; }
.brand-logo { width: 2rem; height: 2rem; display: block; }
/* Thème de saison : un émoji posé sur le coin du logo, et le mot du jour qui apparaît puis s'efface. */
.brand-mark { position: relative; display: block; }
.brand-season { position: absolute; right: -.45rem; bottom: -.3rem; font-size: 1rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.season-greeting { position: fixed; top: 4.4rem; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--surface); color: var(--text); border: 2px solid var(--accent-1); border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); animation: season-greeting 5.2s ease forwards; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 2rem); overflow: hidden; text-overflow: ellipsis; }
@keyframes season-greeting { 0% { opacity: 0; transform: translate(-50%, -.6rem); } 10%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -.4rem); } }
@media (prefers-reduced-motion: reduce) { .season-greeting { animation: none; } }
.season-toggle { margin: .2rem 0 .4rem; font-weight: 600; }
.season-toggle:disabled { color: var(--muted); cursor: default; }
.season-arrow { display: inline-block; transition: transform .2s; }
.season-arrow.open { transform: rotate(90deg); }
.season-group { margin: .8rem 0 .1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.season-row { align-items: center; gap: .6rem; padding-top: .25rem; padding-bottom: .25rem; }
.season-emoji { font-size: 1.3rem; width: 1.6rem; text-align: center; flex: none; }
.topbar nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.topbar nav a { padding: .45rem .7rem; border-radius: 999px; text-decoration: none; color: var(--text); position: relative; }
.topbar nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.topbar .profile-link { padding: .15rem; }
/* Menu des apps PortoGames (Components/AppsMenu.razor). */
.apps-menu { position: relative; }
.apps-btn { background: none; border: 0; font: inherit; font-size: 1.15rem; line-height: 1; color: var(--text); padding: .45rem .6rem; border-radius: 999px; cursor: pointer; }
.apps-btn:hover, .apps-btn[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.apps-backdrop { position: fixed; inset: 0; background: transparent; border: 0; z-index: 20; cursor: default; }
.apps-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 21; width: min(18rem, calc(100vw - 1rem)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: .5rem; }
.apps-pop .apps-title { margin: .1rem .4rem .4rem; font-weight: 600; }
.apps-pop p.small { margin: .4rem .4rem .1rem; }
.apps-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .55rem; border-radius: 10px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.apps-item:hover:not(.current):not(:disabled) { background: var(--primary-soft); }
.apps-item.current { cursor: default; }
.apps-item img, .apps-item .apps-ico { width: 1.6rem; height: 1.6rem; font-size: 1.3rem; line-height: 1.6rem; text-align: center; border-radius: 6px; }
.apps-item small { margin-left: auto; color: var(--muted); }
.nav-ico { display: none; }
.badge { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px; background: #b3261e; color: #fff; font-size: .75rem; text-align: center; line-height: 1.25rem; }

.page { max-width: 760px; margin: 0 auto; padding: 1rem; }
.page.narrow { max-width: 420px; }
.page.feed-page { max-width: 640px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.page-head h1 { margin-bottom: 0; }
.back { font-size: .9rem; text-decoration: none; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- Boutons et champs ---- */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .55rem 1rem; border-radius: 999px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover:not(:disabled) { border-color: var(--primary); }
.btn.primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.small { padding: .25rem .7rem; font-size: .85rem; }
.btn.wide { width: 100%; margin-top: .5rem; }
.btn:disabled { opacity: .5; cursor: default; }
.danger-text { color: var(--danger); }
.link, .linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: left; }
.linklike { color: inherit; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: .3rem .5rem; border-radius: 50%; }
.icon-btn:hover { background: var(--primary-soft); }

.field { display: block; margin: .6rem 0; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .55rem .7rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
/* Navigation au clavier : un contour bien visible à la couleur du style (pas au clic de souris). */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.segmented:focus-within { outline: 3px solid var(--primary); outline-offset: 2px; }
.segmented button:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 3px; }
/* Lien « Aller au contenu » : invisible jusqu'à ce qu'on arrive dessus avec Tab. */
.skip-link { position: absolute; left: .5rem; top: -3rem; z-index: 100; background: var(--primary); color: var(--primary-contrast); padding: .5rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: .5rem; }
main:focus { outline: none; }
.row-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; color: inherit; text-align: left; }
.row-btn:focus-visible { outline-offset: -3px; border-radius: 8px; }
button, a, [role="button"], input, select, label { touch-action: manipulation; }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; accent-color: var(--primary); flex: none; }
.add-row { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.add-row .qty { width: 8rem; flex: none; }

/* ---- Cartes et rangées ---- */
.budget-month { display: flex; align-items: center; justify-content: center; gap: .75rem; margin: .25rem 0 .75rem; }
.budget-month strong { min-width: 10rem; text-align: center; }
.budget-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.budget-totals > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .6rem .75rem; min-width: 0; }
.budget-totals dt { font-size: .85rem; color: var(--muted); }
.budget-totals dd { margin: .1rem 0 0; font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }
.budget-income { color: var(--primary); }
.budget-expense { color: var(--danger); }
.budget-categories { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.budget-categories .progress { display: block; }
.week-start { display: flex; align-items: center; gap: .5rem; margin: .25rem 0 .5rem; }
.week-start select { width: auto; margin: 0; padding: .2rem .5rem; }
.budget-view { display: flex; justify-content: center; margin: .25rem 0 .5rem; }
.budget-year-months { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; }
.budget-year-month { display: flex; justify-content: space-between; align-items: center; gap: .75rem; width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: .5rem .75rem; font: inherit; text-align: left; cursor: pointer; }
.budget-year-month:hover { border-color: var(--primary); }
.budget-check { display: flex; align-items: center; gap: .5rem; margin: .6rem 0; }
.budget-check input { width: auto; margin: 0; }
.budget-category-head { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .2rem; }
@media (max-width: 480px) { .budget-totals dd { font-size: .95rem; } .budget-totals > div { padding: .5rem; } }
.cards, .rows { list-style: none; margin: 0; padding: 0; }
.cards { display: grid; gap: .75rem; }
.card { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .75rem .5rem .75rem 1.3rem; box-shadow: var(--shadow); position: relative; overflow: visible;
    animation: card-in .42s ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }
/* La transform de card-in fait de .card un contexte d'empilement isolé (même une fois l'animation
   finie) : sans ça, le menu (z-index plus bas dans le document que les cartes suivantes) se ferait
   couper par la carte suivante dès qu'il dépasse l'espace entre deux cartes. */
.card.menu-open { z-index: 5; }
/* Bande de couleur à gauche + pastille d'émoji : couleur et émoji stables pour une liste donnée (comme dans l'app). */
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--card-color, var(--primary)); border-radius: 16px 0 0 16px; }
.card-emoji { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; flex: none; background: color-mix(in srgb, var(--card-color, var(--primary)) 22%, transparent); }
.card-main { flex: 1; display: grid; gap: .15rem; text-decoration: none; color: inherit; min-width: 0; }
/* Invitation directe à une liste, en attente d'accepter/refuser. */
.invite-banner { background: var(--primary-soft); color: var(--on-primary-soft); border-radius: 16px; padding: .9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.invite-banner .actions { display: flex; gap: .4rem; flex: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
/* Barre de progression : dégradé du style, remplissage qui rebondit un peu. */
.progress { display: block; height: 6px; background: var(--track); border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.progress > span { display: block; height: 100%; background: var(--accent-gradient); border-radius: 999px; transition: width .7s cubic-bezier(.34, 1.3, .64, 1); }
.progress.big { height: 10px; margin-top: .4rem; }
.progress-head { padding: .4rem 0 .6rem; }
.progress-line { display: flex; align-items: center; gap: .5rem; }
.progress-line strong { flex: 1; font-size: .95rem; }
.progress-line .pct { color: var(--primary); font-weight: 600; font-size: .9rem; }
.rayon-head { display: flex; align-items: center; gap: .6rem; margin: 1.1rem 0 .2rem; }
.rayon-emoji { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; background: color-mix(in srgb, var(--rc, var(--outline)) 22%, transparent); flex: none; }
.rayon-head h3 { flex: 1; margin: 0; font-size: .95rem; font-weight: 600; }
.rayon-count { font-size: .8rem; padding: .05rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--rc, var(--outline)) 28%, transparent); }
.row { display: flex; align-items: center; gap: .7rem; padding: .55rem .25rem; border-bottom: 1px solid var(--border); }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--primary-soft); }
.row.item { border-left: 4px solid var(--accent, transparent); padding-left: .5rem; transition: opacity .25s; }
.row.item.done { opacity: .55; }
.row.item input[type=checkbox]:checked { animation: check-pop .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes check-pop { from { transform: scale(.55); } to { transform: scale(1); } }
.row.done .item-name { text-decoration: line-through; color: var(--muted); }
.row .note { display: block; }
.price { color: var(--muted); font-variant-numeric: tabular-nums; }
.total { text-align: right; margin-top: 1rem; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }

.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 100%; z-index: 4; min-width: 12rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); padding: .3rem; display: grid; }
.menu button { background: none; border: 0; text-align: left; padding: .55rem .7rem; font: inherit; color: inherit; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--primary-soft); }

.avatar { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; flex: none; }
.avatar-lg { width: 5rem; height: 5rem; font-size: 2rem; }
.avatar-photo { object-fit: cover; padding: 0; }
.avatar-xl { width: 7.5rem; height: 7.5rem; font-size: 3rem; }
.avatar-img { width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; }
/* Présence d'un ami : pastille verte sur l'avatar + « En ligne » / « Vu il y a… ». Vert fixe, quel que soit le style de couleur. */
.presence-avatar { position: relative; display: inline-flex; flex: none; }
.presence-avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: .7rem; height: .7rem; border-radius: 50%; background: #2fa84f; border: 2px solid var(--surface); }
.presence-text { margin-left: .25rem; }
/* Date de fête : jour + mois côte à côte ; fête dans les 30 jours mise en évidence. */
.birthday-input { display: flex; gap: .5rem; align-items: flex-end; }
.birthday-input .field { margin: .3rem 0; }
.birthday-input .field:first-child { width: 5.5rem; flex: none; }
.birthday-input .btn { margin-bottom: .35rem; }
.birthday-soon { color: var(--primary); font-weight: 600; }
/* Récurrence d'une corvée : « Tous les [nombre] [unité] » sur une ligne, puis les jours de la semaine en pastilles. */
.repeat-toggle { margin: .6rem 0 .2rem; }
.repeat-row { display: flex; gap: .5rem; align-items: center; }
.repeat-row input { width: 5rem; flex: none; }
.repeat-row select { flex: 1; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.weekday-picker button { font: inherit; font-size: .85rem; padding: .35rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.weekday-picker button.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); font-weight: 600; }
/* « Mes listes » : filtre par sorte, et choix de la sorte à la création. */
.kind-filter { margin-bottom: .75rem; max-width: 100%; overflow-x: auto; }
.kind-filter button { white-space: nowrap; }
.kind-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .6rem; }
.kind-picker button { display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: .6rem .4rem; cursor: pointer; }
.kind-picker button.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--on-primary-soft); }
.kind-picker button.selected .muted { color: inherit; }
.kind-picker .kind-emoji { font-size: 1.6rem; }
@media (max-width: 480px) { .kind-picker { grid-template-columns: 1fr; } .kind-picker button { flex-direction: row; text-align: left; gap: .6rem; padding: .5rem .7rem; } .kind-picker button .muted { margin-left: auto; text-align: right; } }
.presence-text.online { color: #2fa84f; font-weight: 600; }
.nick { font-size: 1.05rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-emoji { font-size: 4.5rem; display: inline-block; animation: bob 1.6s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(-10px) rotate(-6deg); } to { transform: translateY(10px) rotate(6deg); } }

/* ---- Dialogues et messages ---- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 20; padding: 1rem; }
.dialog { background: var(--surface); border-radius: 18px; padding: 1.25rem; width: min(100%, 26rem); max-height: 90vh; overflow: auto; overscroll-behavior: contain; }
.dialog:focus, .cooking:focus { outline: none; } /* la fenêtre elle-même reçoit le focus à l'ouverture : pas de cadre autour */
.dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.share-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2.2rem; letter-spacing: .15em; text-align: center; margin: .5rem 0; }
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 30; width: min(92vw, 28rem); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); cursor: pointer; }
.toast-error { background: var(--danger); color: #fff; }

/* ---- Cadeaux ---- */
.gift-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .85rem 1rem; margin-bottom: .75rem; box-shadow: var(--shadow); }
.gift-top { display: flex; gap: .8rem; align-items: flex-start; }
.gift-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.gift-links { margin: .35rem 0 0 0; padding: 0; list-style: none; font-size: .9rem; }
.gift-links a { word-break: break-all; }
.reservation { margin-top: .5rem; font-size: .9rem; }
.gift-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }

/* Pige de cadeaux : encadré au-dessus des profils du groupe. */
.draw-card { background: var(--primary-soft); color: var(--on-primary-soft); border-radius: 16px; padding: .9rem 1rem; margin-bottom: .9rem; }
.draw-card h2 { font-size: 1.05rem; margin-bottom: .4rem; }
.draw-card p { margin: .3rem 0; }
.draw-card .muted, .draw-card a { color: inherit; }
.draw-card .muted { opacity: .8; }
.draw-card .actions { margin-top: .6rem; }

/* ---- Visite guidée et aperçu public ---- */
/* Section de la barre du haut dont parle l'étape en cours. */
.topbar nav a.tour-focus { outline: 3px solid var(--primary); outline-offset: 2px; animation: tour-pulse 1.4s ease-in-out infinite; }
@keyframes tour-pulse { 50% { outline-color: transparent; } }
.tour-card { position: fixed; z-index: 25; top: 4.2rem; right: 1rem; width: min(24rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 1rem 1.1rem .8rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.tour-card h2 { margin: .2rem 0 .3rem; }
.tour-card p { margin: 0 0 .6rem; }
.tour-emoji { font-size: 2rem; }
.tour-dots { display: flex; gap: .35rem; justify-content: center; margin: .3rem 0 .6rem; }
.tour-dots span, .tour-dots button { width: .55rem; height: .55rem; border-radius: 50%; background: var(--track); border: 0; padding: 0; }
.tour-dots button { cursor: pointer; width: .7rem; height: .7rem; }
.tour-dots .on { background: var(--primary); }
.tour-actions { display: flex; align-items: center; gap: .4rem; }
@media (max-width: 520px) { .tour-card { top: auto; bottom: 1rem; right: 1rem; } }
.discover { max-width: 860px; }
.slide { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; margin-top: 1rem; animation: card-in .45s ease-out both; min-height: 26rem; }
.slide-text h2 { font-size: 1.4rem; }
.slide-nav { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-top: .8rem; }
.slide-nav .tour-dots { margin: 0; }
.mock-phone { background: var(--bg); border: 8px solid var(--surface-high); border-radius: 28px; padding: 1rem .8rem; box-shadow: var(--shadow); min-height: 24rem; font-size: .92rem; pointer-events: none; }
.mock-phone .rows .row { padding: .45rem .2rem; }
.mock-title { font-weight: 700; margin: 0 0 .5rem; }
.mock-toast { background: var(--text); color: var(--bg); border-radius: 10px; padding: .45rem .7rem; font-size: .8rem; margin-top: .8rem; }
.mock-phone .thread { padding-top: .8rem; }
@media (max-width: 700px) { .slide { grid-template-columns: 1fr; min-height: 0; } .slide-text { text-align: center; } }

/* ---- Idées cadeaux ---- */
.idea-filters { display: grid; gap: .4rem; margin: .5rem 0 1rem; }
.idea-filters .chips { margin: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; }
.idea-filters .chip { white-space: nowrap; }
.idea-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.idea { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .9rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .35rem; }
.idea-emoji { font-size: 1.8rem; }
.idea h3 { margin: 0; font-size: 1rem; }
.idea p { margin: 0; }
.idea .tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .3rem; }
.idea .actions { margin-top: .4rem; }

/* ---- Messagerie ---- */
/* Hauteur de repli ; app.js (fitChat) la cale ensuite sur la zone réellement visible, clavier du téléphone compris. */
.chat { display: flex; flex-direction: column; height: calc(100vh - 8.5rem); height: calc(100dvh - 8.5rem); min-height: 8.75rem; }
.thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; padding: .5rem 0; }
.bubble { max-width: 78%; padding: .5rem .8rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); align-self: flex-start; overflow-wrap: anywhere; }
.bubble .body { white-space: pre-wrap; }
.bubble.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.bubble time { display: flex; align-items: center; gap: .3rem; font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.bubble.deleted { background: transparent; border-style: dashed; }
.bubble .clickable { cursor: pointer; }
.bubble-actions { display: flex; gap: .1rem; margin-top: .1rem; }
.bubble-actions .icon-btn { font-size: .8rem; padding: .1rem .3rem; }
.edit-form { display: flex; flex-direction: column; gap: .4rem; width: min(26rem, 72vw); }
.edit-input { width: 100%; min-height: 4.5rem; resize: vertical; font: inherit; line-height: 1.4; padding: .45rem .6rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); box-sizing: border-box; }
.edit-actions { display: flex; gap: .4rem; align-items: center; }
.composer { display: flex; gap: .5rem; align-items: flex-end; padding-top: .5rem; }
.composer textarea { resize: none; }

/* ---- Profil ---- */
.picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.font-chip { border: 2px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: .4rem .8rem; cursor: pointer; font-size: 1.05rem; }
.font-chip.selected { border-color: var(--primary); }
.color-dot { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-dot.selected { border-color: var(--text); }
/* Profil : « nom montré aux autres », une carte par façon, avec l'aperçu du nom. */
.name-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin: .5rem 0 .4rem; }
.name-choice { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left; min-width: 0;
    border: 2px solid var(--border); background: var(--surface); color: var(--text); border-radius: 14px; padding: .7rem .9rem; cursor: pointer; font: inherit; }
.name-choice:hover:not(:disabled) { border-color: var(--primary); }
.name-choice.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--on-primary-soft); }
.name-choice.selected .name-choice-label, .name-choice.selected .name-choice-check { color: inherit; }
.name-choice:disabled { opacity: .45; cursor: not-allowed; }
.name-choice-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; gap: .4rem; width: 100%; }
.name-choice-check { margin-left: auto; color: var(--primary); }
.name-choice-preview { font-size: 1.15rem; overflow-wrap: anywhere; }

#blazor-error-ui { background: #fff3cd; color: #333; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Barre du haut à cinq sections : sous 720 px, chaque section ne garde que son émoji. */
@media (max-width: 720px) {
    .topbar nav .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .topbar nav .nav-ico { display: inline; }
}

@media (max-width: 520px) {
    .brand span { display: none; }
    .topbar { padding: .4rem .5rem; gap: .25rem; }
    .topbar nav a { padding: .4rem .5rem; }
    .add-row { flex-wrap: wrap; }
    .add-row .qty { width: 100%; }
}

.block { display: block; }
.file-input { display: none; }
label.btn { cursor: pointer; }

.narrow-chat { max-width: 640px; }
.friend-link { text-decoration: none; color: inherit; border-bottom: 0; padding: 0; }
.strong { font-weight: 700; color: var(--text); }
.profile-photo { display: flex; align-items: center; gap: 1rem; margin: .5rem 0 1rem; }
.preview { font-size: 1.6rem; margin: .8rem 0; }
.handle-row { display: flex; align-items: center; gap: .8rem; margin: .2rem 0; }
.handle { font-size: 1.3rem; overflow-wrap: anywhere; }

.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; }

/* ---- Réglages : thème et style de couleur ---- */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: none; color: var(--text); font: inherit; padding: .5rem 1.1rem; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.selected { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 600; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem; margin: .4rem 0 1rem; }
.swatch { display: grid; justify-items: center; gap: .4rem; background: none; border: 0; color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; padding: .4rem .2rem; border-radius: 14px; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.swatch:hover { background: var(--surface-high); }
.swatch.selected { transform: scale(1.1); }
.swatch-dot { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: #fff; font-size: 1.4rem; font-weight: 700; }
.swatch.selected .swatch-dot { border: 3px solid var(--text); }

@media (prefers-reduced-motion: reduce) {
    .topbar::after, .empty-emoji, .card, .row.item input[type=checkbox]:checked, .slide, .topbar nav a.tour-focus { animation: none; }
    .progress > span, .swatch { transition: none; }
}

/* ---- Administration (/admin) ---- */
.page.admin { max-width: 900px; }
.page.admin.wide { max-width: 1200px; }
.admin-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin: .25rem 0 1rem; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--text); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.admin-tabs a.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .5rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.warn-card { border-color: var(--danger); }
.warn { color: var(--danger); }
.tag { display: inline-block; font-size: .7rem; padding: 0 .5rem; border-radius: 999px; background: var(--primary-soft); color: var(--on-primary-soft); vertical-align: middle; }
.mono, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .06em; text-align: center; background: var(--surface-high); border-radius: 12px; padding: .8rem; user-select: all; overflow-wrap: anywhere; }
.admin-user { align-items: flex-start; flex-wrap: wrap; }
.admin-user .actions { justify-content: flex-end; }
.table-picker { margin-bottom: .75rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.grid { border-collapse: collapse; width: 100%; font-size: .85rem; }
table.grid th, table.grid td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.grid th { background: var(--surface-high); position: sticky; top: 0; }
table.grid th .kind { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); }
table.grid td.null { color: var(--muted); font-style: italic; }
table.grid td.protected { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .75rem 0; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .7rem .9rem; box-shadow: var(--shadow); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.chart svg { display: block; width: 100%; height: 72px; margin: .4rem 0 .2rem; }
.chart .bar { fill: var(--primary); }
.chart .bar.zero { fill: var(--track); }
.chart-axis { display: flex; justify-content: space-between; }
.bar-row { gap: .8rem; }
.bar-label { flex: 0 0 min(20rem, 42%); }
.bar-value { flex: 0 0 auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.rank-list li { display: flex; align-items: center; gap: .6rem; }
.rank-label { flex: 0 0 8.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.rank-list .progress { margin: 0; }

/* Très petits écrans : le lien « Admin » s'ajoute à la barre du haut, on resserre pour ne pas déborder. */
@media (max-width: 420px) {
    .topbar { padding: .4rem .35rem; }
    .topbar nav { gap: 0; }
    .topbar nav a { padding: .4rem .32rem; font-size: .92rem; }
}

/* Administration : sur petit écran, les boutons passent sous le texte au lieu de l'écraser. */
.admin .add-row input.grow { flex: 1 1 12rem; min-width: 10rem; }
.admin-user > .grow { flex: 1 1 16rem; min-width: 13rem; }
.admin-user .actions { flex: 0 1 auto; }
a.font-chip { text-decoration: none; display: inline-block; }

/* ---- Recettes et planificateur ---- */
.recipe-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.5rem; }
.recipe-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; display: block; margin: .5rem 0; }
.card.recipe { padding-left: 1rem; }
.card.recipe::before { display: none; }
/* Éditeur : une rangée par ingrédient (nom, quantité, rayon, retirer). */
.ingredient-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .4rem; align-items: center; margin-bottom: .4rem; }
@media (max-width: 520px) { .ingredient-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .ingredient-row .ing-name { grid-column: 1 / -1; } }
/* Lecture d'une recette : liste d'ingrédients et étapes. */
.ingredient-list { margin: .3rem 0 .8rem; padding-left: 1.2rem; }
.instructions { white-space: pre-wrap; }
/* Cases à cocher d'« Ajouter à une liste » et rangées de personnes des dialogues de partage. */
.check-list { list-style: none; margin: .3rem 0 0; padding: 0; max-height: 42vh; overflow: auto; }
.check-list label { display: flex; align-items: center; gap: .6rem; padding: .4rem .2rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.person-row { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.person-row .actions { flex: none; gap: .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .3rem 0; }
.chip { font: inherit; font-size: .9rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.selected { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); font-weight: 600; }
/* Planificateur : une carte par jour, aujourd'hui mis en évidence. */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .25rem 0 .75rem; }
.week-nav strong { font-size: 1.05rem; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .6rem .8rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.day.today { background: var(--primary-soft); color: var(--on-primary-soft); border-color: transparent; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.day-head strong { font-weight: 600; }
.meal { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; }
.meal-title-form .row-inline { display: flex; gap: .4rem; align-items: center; }
.meal-title-form .row-inline input { flex: 1; min-width: 0; }
.meal .linklike { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.day.today .icon-btn { color: inherit; }
.view-switch { margin: 0 0 .25rem; }
/* Annonces de l'administration : une bannière sous la barre du haut. */
.announcement { display: flex; align-items: flex-start; gap: .6rem; max-width: 60rem; margin: .6rem auto 0; padding: .6rem .8rem;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); width: calc(100% - 2rem); }
.announcement.new { border-color: var(--primary); }
.announcement.warning { border-color: var(--danger); }
.announcement-icon { font-size: 1.2rem; line-height: 1.3; }
.announcement-body { font-size: .92rem; white-space: pre-line; }
.date-range { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
/* Administration : photos signalées. */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .8rem; }
.report-card { display: flex; flex-direction: column; gap: .5rem; padding: .7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.report-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg, #0000); border-radius: 10px; }
.report-photo.small { width: 45%; margin-top: 4px; }
.tag.danger { background: var(--danger); color: #fff; }
.item-photo { margin-top: .6rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.item-photo-img { max-width: 100%; max-height: 14rem; border-radius: 10px; object-fit: contain; }
.date-range .field { flex: 1; min-width: 12rem; }
.chore-occurrence { display: flex; align-items: center; gap: .45rem; padding: .2rem 0; }
.chore-occurrence a { color: inherit; text-decoration: none; }
.chore-occurrence.done a { text-decoration: line-through; opacity: .65; }
.chore-occurrence .muted { text-align: right; }
.chore-mark { width: 1.1rem; text-align: center; opacity: .7; }
.late-badge { flex: none; font-size: .72rem; font-weight: 600; padding: 0 .45rem; border-radius: 999px; border: 1px solid currentColor; color: var(--danger); }
.month-item.late { color: var(--danger); font-weight: 600; }
/* Vue mois : 7 colonnes, lundi à dimanche ; chaque case est un bouton qui ouvre sa semaine. */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: .6rem; }
.month-weekday { text-align: center; font-size: .75rem; color: var(--muted); padding: .2rem 0; }
.month-cell { font: inherit; color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 5.2rem;
    min-width: 0; padding: .3rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; overflow: hidden; }
.month-cell.outside { opacity: .45; }
.month-cell.today { background: var(--primary-soft); color: var(--on-primary-soft); border-color: transparent; }
.month-day { font-weight: 600; font-size: .85rem; }
.month-item { font-size: .72rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-item.done { text-decoration: line-through; opacity: .6; }
.month-more { font-size: .7rem; color: var(--muted); }
/* Téléphone : les cases sont trop étroites pour les noms, seulement les icônes (le détail est dans la vue semaine). */
@media (max-width: 520px) {
    .month-cell { min-height: 3.4rem; padding: .2rem; flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 0 1px; }
    .month-day { width: 100%; }
    .month-label { display: none; }
    .month-item { font-size: .7rem; }
    .month-item.done { opacity: .4; text-decoration: none; }
    .month-more { font-size: .65rem; align-self: center; }
}
/* Administration : en ligne (pastille verte) ou non. */
.presence-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--border); margin-right: .35rem; vertical-align: middle; }
.presence-dot.online { background: #2fbf55; }
.birthday-row { padding: .2rem 0; }

/* Recette en page de livre : papier crème (teinté sur la surface, donc aussi en thème sombre), caractères d'imprimerie. */
.recipe-book {
    --paper: color-mix(in srgb, var(--surface) 86%, #f0dcb4);
    background: var(--paper); color: var(--text); border-radius: 18px; box-shadow: var(--shadow);
    max-width: 680px; margin: .5rem auto 2rem; padding: 1.5rem clamp(1rem, 5vw, 3rem) 2rem;
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}
.recipe-book h1 { text-align: center; font-size: clamp(1.8rem, 6vw, 2.6rem); margin: .8rem 0 .2rem; line-height: 1.15; overflow-wrap: anywhere; }
.recipe-book-subtitle { text-align: center; font-style: italic; color: var(--muted); margin: 0; font-size: 1.1rem; }
.recipe-book-ornament { display: flex; align-items: center; gap: .8rem; justify-content: center; color: var(--primary); margin: 1.2rem 0; font-size: 1.2rem; }
.recipe-book-ornament::before, .recipe-book-ornament::after { content: ""; width: 3.5rem; height: 1px; background: color-mix(in srgb, var(--primary) 50%, transparent); }
.recipe-book h2 { font-size: 1.4rem; margin: 1.6rem 0 .8rem; padding-bottom: .3rem; border-bottom: 2px solid var(--primary); display: inline-block; }
.recipe-book-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; display: block; }
.recipe-book-ingredients { list-style: none; padding: 0; margin: 0; font-size: 1.1rem; line-height: 1.5; }
.recipe-book-ingredients li { padding: .2rem 0 .2rem 1.3rem; position: relative; }
.recipe-book-ingredients li::before { content: "•"; color: var(--primary); position: absolute; left: .2rem; }
.recipe-book-ingredients strong { margin-right: .35rem; }
.recipe-book-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; font-size: 1.1rem; line-height: 1.6; }
.recipe-book-steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; margin-bottom: .9rem; }
.recipe-book-steps li::before { content: counter(step); color: var(--primary); font-weight: 700; font-size: 1.5rem; line-height: 1.2; }
.recipe-book-step-single { font-size: 1.1rem; line-height: 1.6; white-space: pre-wrap; }
.recipe-book-notmine { text-align: center; font-family: system-ui, sans-serif; font-size: .95rem; color: var(--muted); }

/* Profil vu par les autres, réglages de confidentialité */
a.icon-btn { text-decoration: none; }
.family-toggle { filter: grayscale(1); opacity: .5; }
.family-toggle.on { filter: none; opacity: 1; background: var(--primary-soft); }
.audience-row { align-items: center; gap: .6rem; }
.audience-select { flex: 0 0 auto; max-width: 9.5rem; }
.privacy-row { align-items: flex-start; }
.privacy-row input { margin-top: .2rem; }
.public-profile { text-align: center; max-width: 520px; margin: 1rem auto; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.public-profile h1 { margin: .6rem 0 0; overflow-wrap: anywhere; }
.public-profile p { margin: .2rem 0; }
.avatar-xl-wrap .avatar { width: 7.5rem; height: 7.5rem; font-size: 3rem; }
.profile-banner { align-self: stretch; height: 7.5rem; border-radius: 18px 18px 0 0; margin-bottom: -3.75rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--banner, var(--primary)) 85%, transparent),
                                        color-mix(in srgb, var(--banner, var(--primary)) 35%, transparent)); }
.avatar-xl-wrap { border-radius: 50%; padding: 4px; background: var(--bg); position: relative; }
.profile-bio { white-space: pre-wrap; max-width: 32rem; margin: .4rem 0 !important; }
.profile-mutual-title { align-self: stretch; text-align: left; margin-top: 1.5rem; }
/* Horaire de travail sur un profil (2026-11-17) : une carte par jour, défilement horizontal. */
.month-cal { align-self: stretch; display: flex; flex-direction: column; gap: .4rem; }
.month-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.month-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.month-cal-dow { text-align: center; font-size: .72rem; color: var(--muted); }
.month-cal-day { aspect-ratio: 1 / .9; min-width: 0; padding: 2px; border: 2px solid transparent; border-radius: 8px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; font: inherit; font-size: .85rem;
    background: var(--day, color-mix(in srgb, var(--muted) 14%, transparent)); color: var(--ink, inherit); overflow: hidden; }
.month-cal-day small { font-size: .68rem; white-space: nowrap; overflow: hidden; max-width: 100%; }
.month-cal-day.free { background: color-mix(in srgb, var(--day) 35%, transparent); color: inherit; }
.month-cal-day.today { border-color: var(--accent-1); font-weight: 700; }
.month-cal-day.selected { border-color: currentColor; }
.month-cal-legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.month-cal-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; background: var(--day); }
.month-cal-legend i.free { background: color-mix(in srgb, var(--day) 35%, transparent); }
.sched-profile-offer { margin-bottom: .8rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 12px;
    background: color-mix(in srgb, var(--accent-1) 10%, transparent); }
.sched-profile-offer p { margin: 0 0 .4rem; }
.sched-profile-offer .actions { flex-wrap: wrap; }
.profile-mutual { align-self: stretch; display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; }
.profile-mutual-friend { display: flex; flex-direction: column; align-items: center; gap: .25rem; width: 5rem; flex: none;
    color: var(--text); text-decoration: none; padding: .4rem .2rem; border-radius: 12px; }
.profile-mutual-friend:hover { background: var(--primary-soft); }
.profile-mutual-friend span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Alerte de l'administration (ex. courriels qui ne partent plus) */
.admin-alert { border: 2px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-radius: 12px; padding: .8rem 1rem; margin: .5rem 0 1rem; }
.chat-title { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }

/* Portions ajustables et mode cuisine (page « livre » d'une recette) */
.recipe-book-portions { display: flex; align-items: center; justify-content: center; gap: .4rem; font-style: italic; color: var(--muted); margin: .3rem 0 0; font-size: 1.1rem; }
.recipe-book-portions .changed { color: var(--primary); font-weight: 600; }
.cooking { position: fixed; inset: 0; z-index: 50; background: var(--bg); color: var(--text); display: flex; flex-direction: column; overscroll-behavior: contain;
    padding: max(1rem, env(safe-area-inset-top)) clamp(1rem, 5vw, 3rem) max(1rem, env(safe-area-inset-bottom)); overflow-y: auto; }
.cooking-head { display: flex; align-items: center; gap: .6rem; }
.cooking-head h2 { flex: 1; margin: 0; font-family: Georgia, "Iowan Old Style", serif; }
.cooking-step { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: Georgia, "Iowan Old Style", serif; font-size: clamp(1.6rem, 5vw, 2.6rem); line-height: 1.35; margin: 1rem 0; }
.cooking-timer { text-align: center; font-size: 1.6rem; font-weight: 700; margin: .5rem 0; }
.cooking-nav { display: flex; gap: .8rem; }
.cooking-nav .btn { flex: 1; padding: .9rem; font-size: 1.1rem; }
.cooking-ingredients { font-size: 1.25rem; line-height: 1.7; margin: .3rem 0 .8rem; padding-left: 0; list-style: none; }
.cooking-ingredients label { display: flex; gap: .6rem; align-items: baseline; cursor: pointer; }
.cooking-ingredients input { width: 1.2rem; height: 1.2rem; flex: none; }
.cooking-ingredients li.used { opacity: .5; text-decoration: line-through; }
/* Habituels d'une liste (2026-10-21) : favoris, à racheter bientôt, fréquents. */
.usuals { list-style: none; padding: 0; margin: .2rem 0 .6rem; }
.usuals li { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; }
.usuals li label { display: flex; align-items: center; gap: .5rem; flex: 1; cursor: pointer; }
.usuals li.in-list { opacity: .5; }
.usuals .star { font-size: 1.2rem; color: var(--muted); }
.usuals .star.on { color: var(--primary); }
.usuals-banner { display: flex; width: 100%; align-items: center; gap: .5rem; margin: .5rem 0; padding: .6rem .9rem; border: none;
    border-radius: 12px; background: var(--primary-soft); color: var(--on-primary-soft); font: inherit; cursor: pointer; text-align: left; }
.usuals-banner span { margin-left: auto; font-weight: 700; }
/* Bulle des ingrédients du mode cuisine, et le panneau qu'elle ouvre (par-dessus l'étape). */
.cooking-bubble { position: fixed; right: 1.2rem; bottom: 6.5rem; z-index: 52; width: 3.6rem; height: 3.6rem; border-radius: 50%;
    border: none; background: var(--primary); color: var(--primary-contrast); font-size: 1.7rem; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.cooking-sheet-backdrop { position: fixed; inset: 0; z-index: 52; background: rgba(0, 0, 0, .35); }
.cooking-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 53; max-height: 72vh; overflow: auto; overscroll-behavior: contain;
    background: var(--surface); color: var(--text); border-radius: 18px 18px 0 0; padding: .8rem 1.2rem 1.4rem;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .3); max-width: 46rem; margin: 0 auto; }
.cooking-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.cooking-sheet-head h3 { margin: 0; }
.cooking-sheet-section { margin: .8rem 0 .1rem; color: var(--primary); font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.recipe-book-section { margin: 1rem 0 .2rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.ingredient-section-row { grid-template-columns: minmax(0, 1fr) auto; margin-top: .8rem; }
.ingredient-section-row .ing-name { font-weight: 700; grid-column: auto; }
.row-tools { display: inline-flex; align-items: center; white-space: nowrap; }
.row-tools .icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.aisle-order { padding-left: 1.6rem; margin: .4rem 0; max-height: 55vh; overflow-y: auto; }
.aisle-order li { display: flex; align-items: center; gap: .3rem; padding: .15rem 0; }

/* ---- Fil d'actualité et événements ---- */
.post-list { display: grid; gap: .8rem; margin-top: .6rem; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .9rem 1rem; box-shadow: var(--shadow); display: grid; gap: .6rem; min-width: 0; }
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.post-author { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; min-width: 0; }
.post-menu { display: flex; gap: .1rem; flex: none; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; display: block; }
.post-recipe { display: flex; gap: .8rem; align-items: center; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: 12px; padding: .6rem; }
.post-rating { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.post-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.post-actions .btn.liked { border-color: var(--danger); }
.event-answers { display: flex; flex-wrap: wrap; gap: .3rem; margin-left: auto; }
.post-event-box { display: flex; gap: .9rem; align-items: center; text-decoration: none; color: inherit; background: var(--primary-soft); color: var(--on-primary-soft); border-radius: 12px; padding: .7rem .9rem; }
.post-event-box .muted { color: inherit; opacity: .8; }
.post-event-date { display: grid; place-items: center; min-width: 3.2rem; padding: .3rem; border-radius: 10px; background: var(--surface); color: var(--text); line-height: 1.1; }
.post-event-date strong { font-size: 1.4rem; }
.post-event-date span { font-size: .75rem; text-transform: uppercase; }
.stars { display: inline-flex; gap: .05rem; vertical-align: middle; }
.stars .star { color: var(--border); font-size: 1.1rem; line-height: 1; background: none; border: 0; padding: 0 .05rem; }
.stars .star.on { color: #f5b301; }
.stars-input .star { cursor: pointer; font-size: 1.4rem; }
.attendees { display: flex; flex-wrap: wrap; gap: .8rem; }
.attendee { display: grid; justify-items: center; gap: .1rem; text-decoration: none; color: inherit; max-width: 5rem; text-align: center; overflow-wrap: anywhere; }
.bring-list { list-style: none; padding: 0; margin: .3rem 0; }
.comment { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.comment-body { margin: .15rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.invite-list { max-height: 14rem; overflow-y: auto; }
.warning { background: color-mix(in srgb, #f5b301 18%, transparent); border-radius: 10px; padding: .5rem .7rem; }
.event-row { display: block; text-decoration: none; color: inherit; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: .4rem; }
.audience-choices { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.audience-choices .name-choice-label { text-transform: none; letter-spacing: 0; font-size: .95rem; }

/* ---- Sécurité du compte (clés d'accès, authentificateur) ---- */
h4.subsection { font-size: 1rem; margin: 1rem 0 .3rem; }
.qr { display: flex; justify-content: center; margin: .5rem 0; }
.qr svg { width: min(220px, 70vw); height: auto; background: #fff; padding: 8px; border-radius: 12px; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; font-size: 1.05rem; }
.recovery-codes li { background: var(--surface-high); border-radius: 8px; padding: .4rem .6rem; text-align: center; font-variant-numeric: tabular-nums; }
.or-line { margin: .8rem 0 .4rem; }
.steps { padding-left: 1.2rem; margin: 0 0 .4rem; }

/* Événement passé : grisé, étiquette « Passé » (réponses figées). */
.post-event-box.past { opacity: .65; }
.past-tag { background: var(--surface-high); color: var(--muted); margin-left: .35rem; }

/* ---- Discussions de groupe ---- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.section-head h3.section { margin-bottom: .4rem; }
.group-avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); font-size: 1.2rem; flex: none; }
.bubble .sender { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .1rem; }
.pick-list { list-style: none; padding: 0; margin: .4rem 0; max-height: 45vh; overflow: auto; overscroll-behavior: contain; }
.pick-list label { display: flex; align-items: center; gap: .6rem; padding: .35rem .2rem; cursor: pointer; }

/* Discussions flottantes (ChatDock), en bas à droite, sur grand écran seulement. */
.chat-dock { position: fixed; right: 1rem; bottom: 0; z-index: 15; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: .75rem; pointer-events: none; }
.chat-dock > * { pointer-events: auto; }
.dock-launcher-wrap { position: relative; margin-bottom: 1rem; }
.dock-launcher { position: relative; width: 3.25rem; height: 3.25rem; border-radius: 50%; border: none; background: var(--primary); color: var(--primary-contrast); font-size: 1.4rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.dock-launcher:hover { filter: brightness(1.08); }
.dock-launcher .badge { position: absolute; top: -.2rem; right: -.2rem; margin: 0; }
.dock-list { position: absolute; right: 0; bottom: 4rem; width: 20rem; max-height: min(28rem, 70vh); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); padding: .6rem; }
.dock-list-head { display: flex; justify-content: space-between; align-items: baseline; padding: .2rem .4rem .5rem; }
.dock-list .rows { margin: 0; }
.dock-entry { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .4rem; border: none; background: none; color: inherit; text-align: left; border-radius: 10px; cursor: pointer; font: inherit; }
.dock-entry:hover, .dock-entry:focus-visible { background: var(--primary-soft); }
.dock-entry-text { display: grid; min-width: 0; }
.dock-entry-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-group-avatar { display: inline-grid; place-items: center; background: var(--primary-soft); }
.dock-window { width: 20rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .28); display: flex; flex-direction: column; }
.dock-window:not(.minimized) { height: min(28rem, calc(100vh - 6rem)); }
.dock-head { display: flex; align-items: center; gap: .2rem; padding: .35rem .4rem; border-bottom: 1px solid var(--border); }
.dock-window.minimized .dock-head { border-bottom: none; }
.dock-window.has-unread .dock-head { background: var(--primary-soft); border-radius: 12px 12px 0 0; }
.dock-title { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; border: none; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; padding: .15rem; text-align: left; }
.dock-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-head .icon-btn { text-decoration: none; }
.dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 .6rem .6rem; }
.dock-body .bubble { max-width: 85%; font-size: .92rem; }
.dock-body .composer input { min-width: 0; }
@media (max-width: 899px), (hover: none) { .chat-dock { display: none; } }

/* Garde-manger */
.pantry-add .grow { flex: 1 1 auto; min-width: 10rem; }
.pantry-add input[type=date] { flex: none; width: auto; }
.pantry-expiry { display: block; }
.pantry-expiry.soon { color: #b26a00; font-weight: 600; }
.pantry-expiry.expired { color: #b3261e; font-weight: 600; }
.pantry-expiring { color: #b26a00; }
@media (max-width: 600px) { .pantry-add { flex-wrap: wrap; } .pantry-add .grow { flex-basis: 100%; } }

/* Mise en forme des textes (Services/RichText.cs). Couleurs de la palette : une teinte par thème, toujours lisible. */
.rt-g { font-weight: 700; }
.rt-i { font-style: italic; }
.rt-s { text-decoration: underline; text-underline-offset: 2px; }
.rt-c-rouge { color: #c62828; } .rt-c-orange { color: #d35400; } .rt-c-jaune { color: #a67c00; } .rt-c-vert { color: #2e7d32; }
.rt-c-bleu { color: #1565c0; } .rt-c-violet { color: #7b1fa2; } .rt-c-rose { color: #c2185b; } .rt-c-gris { color: #616161; }
:root[data-theme="dark"] .rt-c-rouge { color: #ff6b6b; } :root[data-theme="dark"] .rt-c-orange { color: #ffa94d; }
:root[data-theme="dark"] .rt-c-jaune { color: #ffd43b; } :root[data-theme="dark"] .rt-c-vert { color: #69db7c; }
:root[data-theme="dark"] .rt-c-bleu { color: #74c0fc; } :root[data-theme="dark"] .rt-c-violet { color: #d0a2ff; }
:root[data-theme="dark"] .rt-c-rose { color: #f783ac; } :root[data-theme="dark"] .rt-c-gris { color: #adb5bd; }
.rt-bg-rouge { background: #e53935; } .rt-bg-orange { background: #fb8c00; } .rt-bg-jaune { background: #fdd835; } .rt-bg-vert { background: #43a047; }
.rt-bg-bleu { background: #1e88e5; } .rt-bg-violet { background: #8e24aa; } .rt-bg-rose { background: #ec407a; } .rt-bg-gris { background: #9e9e9e; }
.rt-ac { background: linear-gradient(90deg, #e53935, #fb8c00, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); background-size: 200% auto;
         -webkit-background-clip: text; background-clip: text; color: transparent; animation: rt-arc 3s linear infinite; font-weight: 600; }
@keyframes rt-arc { to { background-position: 200% center; } }
/* Ajoutés le 2026-10-15 : barré, tailles, dégradé, surligné, et les animés vague / tremble / néon / rebond. */
.rt-b { text-decoration: line-through; }
.rt-s.rt-b { text-decoration: underline line-through; }
.rt-sizep1 { font-size: 1.3em; } .rt-sizep2 { font-size: 1.65em; }
/* Le texte plus gros ou animé ne doit pas étirer la ligne : interligne serré sur ces morceaux. */
.rt-sizep1, .rt-sizep2, .rt-sizem1, .rt-sizem2, .rt-l, .rt-r, .rt-sl { line-height: 1.15; }
.rt-sizem1 { font-size: .82em; } .rt-sizem2 { font-size: .68em; }
.rt-dg { background: linear-gradient(90deg, #ff512f, #f09819, #dd2476); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.rt-sl { background: #ffe066; color: #1b1b1b; border-radius: .25em; padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.rt-l { display: inline-block; white-space: pre; }
.rt-word { white-space: nowrap; }
.rt-v { animation: rt-wave 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.09s); }
@keyframes rt-wave { 0%, 100% { transform: translateY(.06em); } 50% { transform: translateY(-.16em); } }
.rt-t { animation: rt-shake .35s linear infinite; animation-delay: calc(var(--i) * -.07s); }
@keyframes rt-shake { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(.05em, -.04em) rotate(3deg); }
    50% { transform: translate(-.04em, .05em) rotate(-2deg); } 75% { transform: translate(.04em, .04em) rotate(2deg); } 100% { transform: translate(0, 0) rotate(0); } }
.rt-n { text-shadow: 0 0 .15em currentColor, 0 0 .45em currentColor; animation: rt-neon 1.6s ease-in-out infinite alternate; }
@keyframes rt-neon { from { text-shadow: 0 0 .1em currentColor, 0 0 .25em currentColor; } to { text-shadow: 0 0 .2em currentColor, 0 0 .7em currentColor, 0 0 1.1em currentColor; } }
.rt-r { display: inline-block; animation: rt-pulse 1s ease-in-out infinite; }
@keyframes rt-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* Arc-en-ciel ou dégradé sur des lettres qui bougent : les deux animations ensemble, et la couleur décalée selon la
   lettre pour que le dégradé continue d'une lettre à l'autre. */
.rt-l.rt-ac.rt-v { animation: rt-arc 3s linear infinite, rt-wave 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.2s), calc(var(--i) * -.09s); }
.rt-l.rt-ac.rt-t { animation: rt-arc 3s linear infinite, rt-shake .35s linear infinite; animation-delay: calc(var(--i) * -.2s), calc(var(--i) * -.07s); }
.rt-l.rt-dg { background-size: 900% 100%; background-position: calc(var(--i) * 9%) 0; }
.rt-sla { background-size: 200% auto; animation: rt-arc 3s linear infinite; }
.rt-dga { -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; background-size: 200% auto; animation: rt-arc 3s linear infinite; }
.rt-l.rt-dga.rt-v { animation: rt-arc 3s linear infinite, rt-wave 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.2s), calc(var(--i) * -.09s); }
.rt-l.rt-dga.rt-t { animation: rt-arc 3s linear infinite, rt-shake .35s linear infinite; animation-delay: calc(var(--i) * -.2s), calc(var(--i) * -.07s); }
/* Matrix [mx] : la lettre reste cachée pendant qu'une pluie de caractères verts tombe jusqu'à sa place (::before, et une
   traînée plus pâle au-dessus : ::after), puis elle apparaît en vert lumineux et reprend sa couleur. Décalée par lettre. */
/* La pluie reste dans la bulle (ou la carte) qui contient le texte. */
/* « clip » et non « hidden » : hidden ferait de la bulle un conteneur défilant, et la liste des messages (flex) pouvait
   alors l'écraser jusqu'à un mince bandeau. */
.bubble:has(.rt-mxw), .card:has(.rt-mxw), .post-body:has(.rt-mxw) { overflow: clip; overflow-clip-margin: 0; }
.rt-mx { position: relative; animation: rt-mx-land 1.6s linear both; animation-delay: calc(var(--i) * .08s); }
@keyframes rt-mx-land { 0%, 70% { color: transparent; text-shadow: none; } 78% { color: #5cff8f; text-shadow: 0 0 .4em #5cff8f; } 100% { } }
.rt-mx::before, .rt-mx::after { content: "ｱ"; position: absolute; left: 0; top: 0; color: #5cff8f; text-shadow: 0 0 .35em #2bd96b;
    font-family: "MS Gothic", "Noto Sans Mono CJK JP", monospace; font-weight: 400; pointer-events: none; opacity: 0; }
.rt-mx::before { animation: rt-mx-rain 1.6s linear both, rt-mx-glyph .45s steps(1) 4; animation-delay: calc(var(--i) * .08s); }
.rt-mx::after { animation: rt-mx-trail 1.6s linear both, rt-mx-glyph2 .5s steps(1) 3; animation-delay: calc(var(--i) * .08s); }
@keyframes rt-mx-rain { 0% { transform: translateY(-3em); opacity: 0; } 8% { opacity: 1; } 70% { transform: translateY(0); opacity: 1; } 78%, 100% { transform: translateY(0); opacity: 0; } }
@keyframes rt-mx-trail { 0% { transform: translateY(-4.1em); opacity: 0; } 12% { opacity: .45; } 66% { transform: translateY(-1.1em); opacity: .35; } 74%, 100% { transform: translateY(-1.1em); opacity: 0; } }
@keyframes rt-mx-glyph { 0% { content: "ｱ"; } 12% { content: "ﾂ"; } 25% { content: "7"; } 37% { content: "ﾐ"; } 50% { content: "ｶ"; } 62% { content: "3"; } 75% { content: "ﾈ"; } 87% { content: "ｻ"; } }
@keyframes rt-mx-glyph2 { 0% { content: "ﾘ"; } 20% { content: "0"; } 40% { content: "ﾜ"; } 60% { content: "ｹ"; } 80% { content: "9"; } }
/* Bug de temps en temps après la cascade (app.js) : la lettre est cachée et ce caractère vert clignote à sa place. */
.rt-mxg { position: absolute; left: 0; top: 0; visibility: visible; color: #5cff8f; text-shadow: 0 0 .35em #2bd96b;
    font-family: "MS Gothic", "Noto Sans Mono CJK JP", monospace; font-weight: 400; pointer-events: none;
    -webkit-text-fill-color: #5cff8f; background: none; }
@media (prefers-reduced-motion: reduce) { .rt-mx, .rt-mx::before, .rt-mx::after { animation: none; } }
/* Terminal [tm] vert / [tma] ambre (2026-10-20) : écran à phosphore — police de terminal, lueur, fines lignes de
   balayage et léger scintillement ; des lettres buggent en symboles (app.js, « rt-tmg »). */
.rt-tm { --tm: #41ff6e; position: relative; display: inline-block; color: var(--tm); font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    text-shadow: 0 0 .25em color-mix(in srgb, var(--tm) 70%, transparent), 0 0 .7em color-mix(in srgb, var(--tm) 35%, transparent);
    animation: rt-tm-flicker 4s steps(1) infinite; }
.rt-tma { --tm: #ffb000; }
[data-theme="light"] .rt-tm { --tm: #0b8a33; text-shadow: 0 0 .2em color-mix(in srgb, var(--tm) 35%, transparent); }
[data-theme="light"] .rt-tma { --tm: #a86400; }
[data-theme="light"] .rt-tm::after { background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .1) 2px 3px); }
.rt-tm::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .3) 2px 3px); }
@keyframes rt-tm-flicker { 0% { opacity: 1; } 46% { opacity: .78; } 47% { opacity: 1; } 80% { opacity: .9; } 81% { opacity: 1; } }
.rt-tmw .rt-l { position: relative; }
.rt-tmg { position: absolute; left: 0; top: 0; visibility: visible; color: var(--tm, currentColor); -webkit-text-fill-color: var(--tm, currentColor);
    background: none; pointer-events: none; }
/* Frappe [tf] : les lettres arrivent une à une, un curseur ▌ juste après ; il clignote 3 fois à la fin. */
.rt-tf { position: relative; opacity: 0; animation: rt-tf-in 1ms linear forwards; animation-delay: calc(.2s + var(--i) * .07s); }
@keyframes rt-tf-in { to { opacity: 1; } }
.rt-tf::after { content: "▌"; position: absolute; left: 100%; top: 0; opacity: 0; pointer-events: none;
    animation: rt-tf-cur .07s steps(1); animation-delay: calc(.2s + var(--i) * .07s); }
.rt-tf.rt-tf-last::after { animation: rt-tf-cur .07s steps(1), rt-tf-blink 1s steps(1) 3;
    animation-delay: calc(.2s + var(--i) * .07s), calc(.27s + var(--i) * .07s); }
@keyframes rt-tf-cur { 0%, 100% { opacity: 1; } }
@keyframes rt-tf-blink { 0% { opacity: 1; } 50% { opacity: 0; } }
/* Piratage [hk] : chaque lettre est d'abord un symbole qui change sans arrêt, puis se « décode », l'une après l'autre. */
.rt-hk { position: relative; animation: rt-hk-hide calc(.35s + var(--i) * .06s) steps(1); }
/* Cachée pendant toute l'animation, puis l'animation se termine : la lettre redevient normale. */
@keyframes rt-hk-hide { 0%, 100% { -webkit-text-fill-color: transparent; text-shadow: none; } }
.rt-hk::before { content: "#"; position: absolute; left: 0; top: 0; -webkit-text-fill-color: currentColor; pointer-events: none; opacity: 0;
    font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
    animation: rt-hk-sym calc(.35s + var(--i) * .06s) steps(1), rt-hk-glyph .3s steps(1) 14;
    animation-delay: 0s, calc(var(--i) * -.07s); }
@keyframes rt-hk-sym { 0%, 100% { opacity: 1; } }
@keyframes rt-hk-glyph { 0% { content: "#"; } 14% { content: "%"; } 28% { content: "/"; } 42% { content: "$"; } 57% { content: "<"; }
    71% { content: "!"; } 85% { content: "{"; } }
@media (prefers-reduced-motion: reduce) { .rt-tm, .rt-tf, .rt-tf::after, .rt-hk, .rt-hk::before { animation: none; } .rt-tf { opacity: 1; } }
/* Cyberpunk [cp] : aberration chromatique permanente (copies magenta et cyan décalées), et de courtes rafales de glitch
   où le texte tressaute et des tranches de ses copies glissent de côté. Le reste du temps, le texte est calme. */
.rt-cp { position: relative; display: inline-block; font-weight: 700; letter-spacing: .02em;
    text-shadow: -.06em 0 rgba(255, 42, 109, .85), .06em 0 rgba(0, 240, 255, .85); animation: rt-cp-jit 3.2s steps(1) infinite; }
/* Les copies prennent exactement la place du texte (même largeur, mêmes retours à la ligne). */
.rt-cp::before, .rt-cp::after { content: attr(data-text); position: absolute; inset: 0; white-space: inherit;
    pointer-events: none; text-shadow: none; clip-path: inset(100% 0 0 0); }
.rt-cp::before { color: #ff2a6d; animation: rt-cp-slice1 3.2s steps(1) infinite; }
.rt-cp::after { color: #00f0ff; animation: rt-cp-slice2 3.2s steps(1) infinite; }
@keyframes rt-cp-jit { 0% { transform: none; } 40% { transform: translate(-.03em, 0); } 42% { transform: none; }
    86% { transform: translate(.05em, -.02em) skewX(-8deg); } 88% { transform: translate(-.06em, .02em); }
    90% { transform: translate(.03em, 0) skewX(5deg); } 92% { transform: none; } }
@keyframes rt-cp-slice1 { 0% { clip-path: inset(100% 0 0 0); transform: none; } 40% { clip-path: inset(38% 0 42% 0); transform: translateX(.1em); }
    42% { clip-path: inset(100% 0 0 0); transform: none; } 85% { clip-path: inset(8% 0 62% 0); transform: translateX(-.14em); }
    87% { clip-path: inset(55% 0 18% 0); transform: translateX(.12em); } 89% { clip-path: inset(28% 0 48% 0); transform: translateX(-.09em); }
    91% { clip-path: inset(72% 0 4% 0); transform: translateX(.16em); } 93% { clip-path: inset(100% 0 0 0); transform: none; } }
@keyframes rt-cp-slice2 { 0% { clip-path: inset(100% 0 0 0); transform: none; } 41% { clip-path: inset(60% 0 20% 0); transform: translateX(-.1em); }
    43% { clip-path: inset(100% 0 0 0); transform: none; } 86% { clip-path: inset(45% 0 30% 0); transform: translateX(.15em); }
    88% { clip-path: inset(12% 0 70% 0); transform: translateX(-.12em); } 90% { clip-path: inset(66% 0 10% 0); transform: translateX(.08em); }
    92% { clip-path: inset(100% 0 0 0); transform: none; } }
@media (prefers-reduced-motion: reduce) { .rt-cp, .rt-cp::before, .rt-cp::after { animation: none; } }
@media (prefers-reduced-motion: reduce) { .rt-ac, .rt-dga, .rt-sla, .rt-v, .rt-t, .rt-n, .rt-r { animation: none; } }
.format-wrap { position: relative; display: inline-flex; align-self: flex-end; }
.format-btn { font-weight: 700; font-family: Georgia, serif; }
.format-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 12; width: 18.5rem; background: var(--surface); color: var(--text);
               border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); padding: .5rem; }
.format-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.format-opt { min-width: 2.2rem; height: 2.2rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); cursor: pointer; font: inherit; }
.format-swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.format-custom { position: relative; overflow: hidden; background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); }
.format-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.format-help { margin: 0; }
.format-under { display: flex; margin: -.4rem 0 .6rem; }
.format-under .format-menu { bottom: auto; top: calc(100% + 6px); }
.seen { align-self: flex-end; margin: -.15rem .2rem .2rem; font-size: .72rem; color: var(--muted); }

/* Corvées : classement (2026-10-24). */
.leaderboard { margin-top: .6rem; }
.leaderboard .medal { min-width: 1.8rem; text-align: center; font-size: 1.3rem; }

/* Sondages du fil (2026-10-24). */
.poll { margin: .4rem 0 .6rem; }
.poll-option { position: relative; display: flex; align-items: center; gap: .5rem; width: 100%; margin-top: .4rem; padding: .55rem .8rem;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left;
    cursor: pointer; overflow: hidden; }
.poll-option:disabled { cursor: default; }
.poll-option.mine { border-color: var(--primary); font-weight: 600; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--primary-soft); transition: width .3s; }
.poll-text, .poll-count { position: relative; }
.poll-text { flex: 1; }
.poll-voters { margin: .15rem .3rem 0; }
.poll-edit { margin: 0 0 .6rem 1.8rem; }
.cooking-ingredients .swap { margin: .1rem 0 0 1.7rem; }

/* Substitutions et photo de la fiche (2026-10-24). */
.recipe-book-swap { display: block; font-size: .85rem; color: var(--muted); }
.icon-btn.small { font-size: .9rem; padding: .1rem .3rem; }
.recipe-card-photo { width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; display: block; background: var(--surface); }
/* Horaires de travail et de garde (planificateur, 2026-11-15). */
.sched-row { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0; }
.sched-pill { font: inherit; font-size: .8rem; padding: .15rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.sched-free { margin: .1rem 0 .3rem; }
.sched-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .2rem; border-radius: 6px;
    font-size: .75rem; font-weight: 700; background: var(--border); color: var(--text); }
.sched-dot.mini { min-width: .95rem; height: .95rem; font-size: .6rem; border-radius: 4px; padding: 0 .1rem; }
.month-scheds { display: flex; flex-wrap: wrap; gap: 1px; }
.sched-legend { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-left: .3rem; vertical-align: middle; }
.sched-tags { display: grid; gap: .35rem; margin: .2rem 0 .4rem; }
.sched-tag { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.sched-tag input.sched-letter { width: 2.4rem; text-align: center; font-weight: 700; }
.sched-tag input[type=color] { width: 2.4rem; height: 2.1rem; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.sched-tag input[type=time] { width: 6.4rem; }
.sched-tag input.grow { flex: 1 1 55%; }   /* le titre prend la 1re ligne ; les heures passent dessous */
.sched-tag { padding-bottom: .35rem; border-bottom: 1px dashed var(--border); }
.sched-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.sched-preview { display: flex; flex-wrap: wrap; gap: 2px; margin: .1rem 0 .4rem; }
.sched-override-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.sched-override-form .field { margin: 0; }
.sched-override-form .row-inline { display: flex; gap: .3rem; }
@media (max-width: 520px) { .month-scheds { width: 100%; } }
/* Partager seulement des horaires (2026-11-15) : choix dans « Se lier », et la ligne « De Marie · voir seulement ». */
.accent-text { color: var(--primary); }
.share-choice { border: 1px solid var(--border, #ccc); border-radius: 10px; padding: .6rem .7rem; margin: .2rem 0 .7rem; }
.share-choice .radio-row, .share-choice .check-row { display: flex; gap: .5rem; align-items: flex-start; margin: .35rem 0; cursor: pointer; }
.share-choice-schedules { margin-left: 1.6rem; }
.person-row .check-row { display: inline-flex; gap: .3rem; align-items: center; margin-right: .4rem; cursor: pointer; }

/* Mode « planificateur seul » (?embed=1, Services/EmbedMode.cs) : affichage dans un cadre (Home Assistant…).
   Cadre étroit (~450 px) : les jours restent l'un sous l'autre. Large : les jours se placent en colonnes. */
.app.embed .page.planner-page { max-width: none; padding: .5rem .75rem; }
/* La barre de semaine reste en haut du cadre quand on défile ; journées plus compactes (on consulte, on ne gère pas). */
.app.embed .week-nav { position: sticky; top: 0; z-index: 2; background: var(--bg); margin: 0 0 .4rem; padding: .3rem 0; }
.app.embed .day { padding: .35rem .6rem; margin-bottom: .4rem; }
.app.embed .day-head .icon-btn { padding: .1rem .45rem; font-size: 1.05rem; }
.app.embed .sched-row { margin: .15rem 0; }
.app.embed .sched-free { margin: 0 0 .1rem; }
.app.embed .meal, .app.embed .chore-occurrence, .app.embed .birthday-row { padding: .1rem 0; }
@media (min-width: 700px) {
    .app.embed .week-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; align-items: start; }
    .app.embed .week-days .day { margin-bottom: 0; }
    /* Colonne étroite : le nom de la liste d'une corvée passe sur sa propre ligne. */
    .app.embed .week-days .chore-occurrence { flex-wrap: wrap; }
    .app.embed .week-days .chore-occurrence > .muted { flex-basis: 100%; padding-left: 1.6rem; text-align: left; }
}
@media (min-width: 1400px) {
    .app.embed .week-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
