/* ==========================================================================
   Postrend — charte et composants de la refonte (novembre 2026)
   Chargée après app.css : elle a le dernier mot sur les jetons et la navigation.

   Charte v0.3 (/mnt/project-files/postrend, couleurs-postrend.css) : uniquement beige et marron, tons pastel,
   aucun vert ni violet. Dégradé 45° lin #EADBC6 → sable #D9BC98 → caramel #B98D66 (une fois par écran, texte
   espresso), moka #8A6246 (boutons, liens, état actif ; texte blanc 5,4:1), latte #F3E9DC + #6B4A33 (puces,
   « publiée »), espresso #3A2A1F (texte, P du logo), crème #FBF7F0, taupe #7A6A5C, cacao #4A3628,
   terracotta #B5533C (erreurs). Jamais de texte blanc sur le caramel. Sora (titres), Inter (texte),
   JetBrains Mono (chiffres).

   Sommaire
   1. Jetons (clair, sombre, mouvement)      5. Palette de commandes (⌘K)
   2. Marque, typographie                    6. Menu radial d'actions
   3. Connexion                              7. Accueil bento, statuts en direct
   4. Dock flottant                          8. Statistiques
   ========================================================================== */

/* 1. Jetons ---------------------------------------------------------------- */

:root {
    /* Couleurs fixes de la charte (mêmes valeurs dans les deux thèmes). */
    --pt-lin: #eadbc6;
    --pt-sable: #d9bc98;
    --pt-caramel: #b98d66;
    --pt-moka: #8a6246;
    --pt-latte: #f3e9dc;
    --pt-latte-texte: #6b4a33;
    --pt-espresso: #3a2a1f;
    --pt-creme: #fbf7f0;
    --pt-taupe: #7a6a5c;
    --pt-cacao: #4a3628;
    --pt-terracotta: #b5533c;
    --pt-gradient: linear-gradient(45deg, var(--pt-lin) 0%, var(--pt-sable) 50%, var(--pt-caramel) 100%);
    /* Confettis de « Publiée » (assets/lib/live.js) : quatre teintes de la charte, en alternance. */
    --confetti-1: var(--pt-moka);
    --confetti-2: var(--pt-caramel);
    --confetti-3: var(--pt-sable);
    --confetti-4: var(--pt-espresso);

    --font-display: 'Sora Variable', Sora, var(--font-sans);
    --font-mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

    /* Mouvement : ressorts et sorties, réutilisables partout (coupés par prefers-reduced-motion, voir plus bas). */
    --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    /* Ressort amorti (léger rebond puis stabilisation), calculé pour linear() ; repli sur --ease-spring. */
    --ease-spring-soft: cubic-bezier(.34, 1.56, .64, 1);
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --t-spring: .55s;

    /* Verre dépoli du dock et des fenêtres flottantes. Le dock, le tiroir « Créer » et le menu en arc passent sur
       le contenu : verre presque plein (--glass-solid, 97 %) pour rester lisibles quoi qu'il y ait dessous. */
    --glass-blur: 24px;
    --glass-solid: color-mix(in srgb, var(--surface) 97%, transparent);
    --dock-h: 64px;
    --dock-gap: 16px;
}

@supports (transition-timing-function: linear(0, 1)) {
    :root {
        --ease-spring-soft: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
        --ease-bounce: linear(0, .004, .016, .035, .063, .098, .141 13.6%, .25, .391, .563, .765, 1, .891 40.9%, .848, .813, .785, .766, .754, .75, .754, .766, .785, .813, .848, .891 68.2%, 1 72.7%, .973, .953, .941, .938, .941, .953, .973, 1, .988, .984, .988, 1);
    }
}

:root,
[data-bs-theme='light'] {
    --bg: #fbf7f0;
    --glow-1: rgba(217, 188, 152, .24);
    --glow-2: rgba(185, 141, 102, .14);
    --surface: #fffefb;
    --surface-2: #f7f1e7;
    --surface-3: #eee6d8;
    --line: #eadfcf;
    --line-strong: #d3c4ae;
    --glass: rgba(255, 254, 251, .72);
    --glass-edge: rgba(255, 255, 255, .85);
    --glass-line: rgba(46, 34, 25, .08);

    --ink: #3a2a1f;          /* espresso : 14:1 sur --surface */
    --ink-2: #5a4a3c;        /* 8,3:1 */
    --ink-3: #75655a;        /* taupe un peu plus foncé : 5,4:1 */
    --ink-2-rgb: 90, 74, 60;

    --brand: #8a6246;        /* moka : 5,4:1 avec du blanc */
    --brand-rgb: 138, 98, 70;
    --brand-strong: #6f4d36;
    --brand-ink: #6b4a33;    /* texte de marque : 7,9:1 sur la crème, 6,6:1 sur le latte */
    --brand-soft: #f3e9dc;   /* latte */
    --ring: rgba(138, 98, 70, .38);
    --accent: #b98d66;

    --cta-bg: #8a6246;
    --cta-ink: #ffffff;
    --cta-hover: #74513a;
    --cta-line: #74513a;
    --solid: #8a6246;
    --on-solid: #ffffff;

    /* États (toujours avec icône et mot) : « programmée » en taupe neutre, « publiée » en moka sur latte,
       envoi en ambre, erreurs en terracotta. */
    --sched: #75655a;
    --info: #7f5c3c;
    --info-soft: #f4eadb;
    --ok: #6b4a33;
    --ok-soft: #f3e9dc;
    --warn: #855000;
    --warn-soft: #fbefd6;
    --bad: #a8472f;          /* terracotta assombri : 5,6:1 sur sa teinte douce */
    --bad-soft: #f8e6df;

    --grad: linear-gradient(0deg, var(--solid), var(--solid));
    --grad-vivid: var(--pt-gradient);
    --hero:
        radial-gradient(60% 55% at 12% 18%, rgba(234, 219, 198, .95), transparent 70%),
        radial-gradient(55% 60% at 88% 12%, rgba(185, 141, 102, .55), transparent 70%),
        radial-gradient(70% 60% at 55% 96%, rgba(243, 233, 220, .95), transparent 70%),
        #d9bc98;
    --hero-ink: #3a2a1f;

    --shadow-1: 0 1px 2px rgba(46, 34, 25, .06);
    --shadow-2: 0 1px 2px rgba(46, 34, 25, .05), 0 8px 24px -10px rgba(46, 34, 25, .16);
    --shadow-3: 0 2px 6px rgba(46, 34, 25, .06), 0 24px 48px -16px rgba(46, 34, 25, .28);
    --shadow-brand: 0 10px 24px -10px rgba(138, 98, 70, .65);
}

[data-bs-theme='dark'] {
    --bg: #1c1612;
    --glow-1: rgba(217, 188, 152, .08);
    --glow-2: rgba(185, 141, 102, .08);
    --surface: #241c16;
    --surface-2: #2a211a;
    --surface-3: #352a21;
    --line: #3a2f26;
    --line-strong: #5a4a3c;
    --glass: rgba(36, 28, 22, .72);
    --glass-edge: rgba(255, 255, 255, .1);
    --glass-line: rgba(255, 255, 255, .07);

    --ink: #f5eee3;
    --ink-2: #d4c6b5;
    --ink-3: #b5a595;
    --ink-2-rgb: 212, 198, 181;

    --brand: #d9bc98;        /* sable : liens et état actif lisibles sur l'espresso (9:1) */
    --brand-rgb: 217, 188, 152;
    --brand-strong: #e6cfae;
    --brand-ink: #e8d3b6;
    --brand-soft: #3d2e22;   /* puce sombre de la charte */
    --ring: rgba(217, 188, 152, .5);
    --accent: #b98d66;

    /* Bouton principal : moka et texte blanc, comme en clair (5,4:1). */
    --cta-bg: #8a6246;
    --cta-ink: #ffffff;
    --cta-hover: #9a7051;
    --cta-line: #d9bc98;
    --solid: #8a6246;
    --on-solid: #ffffff;

    --sched: #b5a595;
    --info: #e2c29e;
    --info-soft: rgba(212, 176, 140, .14);
    --ok: #e8d3b6;
    --ok-soft: #3d2e22;
    --warn: #f2c167;
    --warn-soft: rgba(242, 193, 103, .13);
    --bad: #f0a08a;
    --bad-soft: rgba(240, 160, 138, .14);

    --grad: linear-gradient(0deg, var(--solid), var(--solid));
    --grad-vivid: var(--pt-gradient);
    --hero:
        radial-gradient(60% 55% at 12% 18%, rgba(138, 98, 70, .5), transparent 70%),
        radial-gradient(55% 60% at 88% 12%, rgba(185, 141, 102, .26), transparent 70%),
        radial-gradient(70% 60% at 55% 96%, rgba(217, 188, 152, .14), transparent 70%),
        #241c16;
    --hero-ink: #f5eee3;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 24px -10px rgba(0, 0, 0, .6);
    --shadow-3: 0 2px 6px rgba(0, 0, 0, .4), 0 28px 56px -18px rgba(0, 0, 0, .75);
    --shadow-brand: 0 10px 24px -10px rgba(0, 0, 0, .7);
}

/* 2. Marque, typographie ----------------------------------------------------- */

/* Logo « Écho » : trois P en cascade dessinés dans un SVG (templates/_logo.html.twig).
   Le carré est peint par le SVG ; ses couleurs changent selon le fond pour toujours se détacher :
   version sable sur la crème, version espresso (cernée de sable) sur le chocolat et sur le dégradé de la connexion. */
.brand-mark,
.topbar .brand-mark,
.auth-hero .brand-mark {
    --logo-bg: var(--pt-sable);
    --logo-p1: var(--pt-latte);
    --logo-p2: var(--pt-creme);
    --logo-p3: var(--pt-espresso);
    --logo-play: var(--pt-sable);
    --logo-ring: transparent;

    display: block;
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    filter: drop-shadow(0 4px 8px rgba(58, 42, 31, .16));
}

.logo-icon {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.logo-bg {
    fill: var(--logo-bg);
    stroke: var(--logo-ring);
    stroke-width: 2;
}

.logo-p1 { fill: var(--logo-p1); }
.logo-p2 { fill: var(--logo-p2); }
.logo-p3 { fill: var(--logo-p3); }

.logo-play {
    fill: var(--logo-play);
    stroke: var(--logo-play);
}

/* Logotype vectorisé : encre espresso et « t » caramel ; crème et « t » sable sur fond sombre. */
.brand {
    --logo-ink: var(--pt-espresso);
    --logo-t: var(--pt-caramel);
}

.logo-word {
    display: block;
    width: auto;
    height: 25px;
    fill: var(--logo-ink);
}

.logo-word .logo-t {
    fill: var(--logo-t);
}

[data-bs-theme='dark'] .brand {
    --logo-ink: var(--pt-creme);
    --logo-t: var(--pt-sable);
}

[data-bs-theme='dark'] .brand-mark,
[data-bs-theme='dark'] .topbar .brand-mark {
    --logo-bg: var(--pt-espresso);
    --logo-p1: var(--pt-caramel);
    --logo-p2: var(--pt-sable);
    --logo-p3: var(--pt-latte);
    --logo-play: var(--pt-espresso);
    --logo-ring: rgba(217, 188, 152, .42);

    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}

/* Connexion : le panneau est déjà sable et caramel, le carré passe en espresso pour ressortir. */
.auth-hero .brand-mark {
    --logo-bg: var(--pt-espresso);
    --logo-p1: var(--pt-caramel);
    --logo-p2: var(--pt-sable);
    --logo-p3: var(--pt-latte);
    --logo-play: var(--pt-espresso);
    --logo-ring: transparent;

    width: 44px;
    height: 44px;
}

.auth-hero .brand {
    --logo-ink: var(--pt-espresso);
    --logo-t: var(--pt-moka);
}

.auth-hero .logo-word {
    height: 30px;
}

[data-bs-theme='dark'] .auth-hero .brand-mark {
    --logo-ring: rgba(217, 188, 152, .42);
}

[data-bs-theme='dark'] .auth-hero .brand {
    --logo-ink: var(--pt-creme);
    --logo-t: var(--pt-sable);
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: lowercase;
}

/* Titres en Sora ; chiffres et heures en JetBrains Mono (chasse fixe : les compteurs ne bougent pas). */
h1, h2, h3, .h1, .h2, .h3,
.page-title,
.panel-title,
.dialog-title,
.auth-card h1 {
    font-family: var(--font-display);
    letter-spacing: -.02em;
}

.num,
time.num,
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

/* Le bouton principal ne prend plus de reflet blanc : aplat moka, net sur la crème comme sur l'espresso. */
.btn-primary {
    background-image: none;
    box-shadow: var(--shadow-brand);
}

::selection {
    background: color-mix(in srgb, var(--brand) 32%, transparent);
    color: var(--ink);
}

/* 3. Connexion ------------------------------------------------------------- */

.auth-hero {
    background: var(--hero);
    background-size: 160% 160%, 150% 150%, 170% 170%, auto;
    color: var(--hero-ink);
}

.auth-hero .brand,
.auth-hero .brand:hover {
    color: var(--hero-ink);
}

.auth-pitch .auth-headline {
    max-width: none;
    font-family: var(--font-display);
    letter-spacing: -.035em;
}

/* L'accroche sur deux lignes : « Une connexion. » puis « Tous tes réseaux. ». */
.auth-pitch .auth-headline span {
    display: block;
}

/* Liens légaux : tout en bas de la page, détachés du formulaire. */
.auth-panel {
    display: flex;
    flex-direction: column;
}

.auth-panel > .auth-card {
    margin-block: auto;
}

.auth-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem 1.25rem;
    margin: 2.5rem 0 0;
    padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    list-style: none;
    font-size: var(--fs-xs);
}

.auth-legal a {
    color: var(--ink-3);
    text-decoration: none;
}

.auth-legal a:hover,
.auth-legal a:focus-visible {
    color: var(--ink);
    text-decoration: underline;
}

/* Mot de passe : jamais affiché en clair, ni par l'appli ni par l'œil intégré d'Edge (il se change dans Profil). */
input[type='password']::-ms-reveal,
input[type='password']::-ms-clear {
    display: none;
}

/* 4. Barre du haut et dock flottant ------------------------------------------ */

/* Plus de barre latérale : la page prend toute la largeur, le dock flotte en bas. */
.has-dock .shell-main {
    min-height: calc(100dvh - var(--topbar-h, 64px));
}

.has-dock .page {
    padding-bottom: calc(var(--dock-h) + var(--dock-gap) * 2 + 24px + env(safe-area-inset-bottom));
}

.has-dock.has-actionbar .page {
    padding-bottom: revert-layer;
}

.topbar {
    --topbar-h: 64px;

    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid transparent;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
    transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
    view-transition-name: topbar;
}

/* Une fois la page défilée, un liseré sépare la barre du contenu (animation liée au défilement, sans JavaScript). */
@supports (animation-timeline: scroll()) {
    .topbar {
        animation: topbar-edge linear both;
        animation-timeline: scroll(root);
        animation-range: 0 64px;
    }
}

@keyframes topbar-edge {
    to {
        border-bottom-color: var(--line);
        box-shadow: 0 6px 18px -14px rgba(46, 34, 25, .45);
    }
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    max-width: 1320px;
    height: var(--topbar-h);
    margin-inline: auto;
    padding-inline: clamp(16px, 3vw, 32px);
}

.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink);
    font-size: 1.15rem;
    text-decoration: none;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-left: auto;
}

.topbar .menu-panel {
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 32px));
}

/* Recherche : la seule entrée de la palette ⌘K, au centre de la barre et bien visible (bordure marquée,
   loupe sur pastille latte, texte lisible, raccourci à droite). La barre devient une grille logo | recherche | compte. */
.topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(0, 1fr);
}

.topbar-end {
    justify-self: end;
}

.palette-trigger {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    min-height: 46px;
    padding: 0 .55rem 0 1rem;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--r-full);
    background: var(--surface);
    box-shadow: 0 1px 0 var(--glass-edge) inset, 0 6px 18px -12px rgba(46, 34, 25, .35);
    color: var(--ink-2);
    font-size: .92rem;
    font-weight: 500;
    transition: border-color var(--t-fast), box-shadow var(--t) var(--ease), transform var(--t) var(--ease-spring);
}

.palette-trigger:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent), 0 10px 24px -14px rgba(46, 34, 25, .45);
    color: var(--ink);
    transform: translateY(-1px);
}

.palette-trigger:active {
    transform: scale(.99);
}

.palette-trigger-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: .95rem;
}

.palette-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.palette-trigger-short {
    display: none;
}

.kbd {
    display: inline-grid;
    place-items: center;
    min-width: 1.6rem;
    height: 1.5rem;
    padding: 0 .4rem;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--ink-2);
    font: 600 .7rem/1 var(--font-mono);
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .palette-trigger-long {
        display: none;
    }

    .palette-trigger-short {
        display: inline;
    }
}

/* Téléphone : la recherche prend toute la place entre le logo et le compte. */
@media (max-width: 767.98px) {
    .topbar-inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--s-3);
    }

    .palette-trigger {
        min-height: var(--tap);
        padding-left: .4rem;
    }

    .palette-trigger .kbd {
        display: none;
    }
}

/* Le dock : pilule de verre centrée en bas, liseré spéculaire d'un pixel. */
.dock {
    position: fixed;
    bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 1030;
    translate: -50% 0;
    transition: translate var(--t-spring) var(--ease-spring-soft), opacity var(--t) var(--ease);
    view-transition-name: dock;
}

.dock.is-tucked {
    translate: -50% calc(100% + var(--dock-gap) + 12px);
    opacity: 0;
}

.dock-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    height: var(--dock-h);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--glass-solid);
    box-shadow:
        inset 0 1px 0 var(--glass-edge),
        inset 0 -1px 0 rgba(46, 34, 25, .04),
        0 1px 2px rgba(46, 34, 25, .06),
        0 18px 40px -18px rgba(46, 34, 25, .45);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
}

[data-bs-theme='dark'] .dock-inner {
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 18px 44px -16px rgba(0, 0, 0, .8);
}

/* Pilule active : un seul calque qui glisse (transform) d'un onglet à l'autre, en ressort. */
.dock-pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: var(--w, 0);
    border-radius: 16px;
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .18), 0 4px 12px -6px rgba(var(--brand-rgb), .55);
    opacity: 0;
    translate: var(--x, 0) 0;
    transition:
        translate var(--t-spring) var(--ease-spring-soft),
        width var(--t-spring) var(--ease-spring-soft),
        opacity var(--t) var(--ease);
    pointer-events: none;
}

.dock-pill.is-on {
    opacity: 1;
}

.dock-pill.is-instant {
    transition: none;
}

.dock-item {
    --pull: 0;

    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 64px;
    height: 100%;
    padding: 0 10px;
    border: 0;
    border-radius: 16px;
    background: none;
    color: var(--ink-2);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}

.dock-icon {
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    line-height: 1;
    /* Agrandissement magnétique : --pull vaut 0 à 1 selon la distance du pointeur (dock.js). */
    transform: translateY(calc(var(--pull) * -5px)) scale(calc(1 + var(--pull) * .28));
    transition: transform .18s var(--ease-out-expo);
}

.dock-item:hover,
.dock-item:focus-visible {
    color: var(--ink);
}

.dock-item.is-active,
.dock-item.is-going {
    color: var(--brand-ink);
}

.dock-item:active .dock-icon {
    transform: scale(.9);
}

.dock-label-short {
    display: none;
}

.dock-count {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid var(--surface);
    border-radius: var(--r-full);
    background: var(--bad);
    color: #fff;
    font: 700 .62rem/1 var(--font-mono);
    animation: badge-pop .5s var(--ease-spring) both;
}

[data-bs-theme='dark'] .dock-count {
    color: var(--pt-espresso);
}

/* Bouton central « Créer » : proéminent, avec un halo qui respire doucement. */
.dock-create-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 100%;
}

.dock-create {
    position: relative;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-top: -14px;
    border: 0;
    border-radius: 18px;
    background: var(--cta-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 22px -8px color-mix(in srgb, var(--solid) 85%, transparent);
    color: var(--cta-ink);
    font-size: 1.5rem;
    anchor-name: --dock-create;
    transition: transform .35s var(--ease-spring), background var(--t-fast);
}

.dock-create:hover {
    background: var(--cta-hover);
    transform: translateY(-2px) scale(1.04);
}

.dock-create:active {
    transform: scale(.94);
}

.dock-create .bi {
    position: relative;
    transition: transform .4s var(--ease-spring);
}

.dock-create[aria-expanded='true'] .bi {
    transform: rotate(135deg);
}

.dock-create-halo {
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: 24px;
    background: conic-gradient(from 0deg, var(--pt-lin), var(--pt-sable), var(--pt-caramel), var(--pt-moka), var(--pt-lin));
    filter: blur(12px);
    opacity: .55;
    animation: halo-turn 9s linear infinite, halo-breathe 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes halo-turn {
    to { rotate: 1turn; }
}

@keyframes halo-breathe {
    50% { opacity: .85; scale: 1.06; }
}

@keyframes badge-pop {
    from { scale: .3; opacity: 0; }
}

/* Tiroir « Créer » : Popover API, apparition en ressort (@starting-style), options en cascade. */
.create-drawer {
    position: fixed;
    inset: auto auto calc(var(--dock-h) + var(--dock-gap) + 22px + env(safe-area-inset-bottom)) 50%;
    width: min(380px, calc(100vw - 32px));
    margin: 0;
    padding: 10px;
    border: 1px solid var(--glass-line);
    border-radius: 22px;
    background: var(--glass-solid);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-3);
    color: var(--ink);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    backdrop-filter: blur(22px) saturate(1.6);
    opacity: 0;
    transform: translate(-50%, 16px) scale(.92);
    transform-origin: 50% 100%;
    transition:
        opacity .2s var(--ease),
        transform .45s var(--ease-spring),
        overlay .45s allow-discrete,
        display .45s allow-discrete;
}

.create-drawer:popover-open {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

@starting-style {
    .create-drawer:popover-open {
        opacity: 0;
        transform: translate(-50%, 16px) scale(.92);
    }
}

/* Ancré au bouton là où le navigateur sait le faire (CSS Anchor Positioning). */
@supports (position-anchor: --dock-create) {
    .create-drawer {
        position-anchor: --dock-create;
        bottom: calc(anchor(top) + 16px);
        left: anchor(center);
        position-try-fallbacks: flip-block;
    }
}

.create-drawer::backdrop {
    background: rgba(46, 34, 25, .12);
    opacity: 0;
    transition: opacity .25s var(--ease), overlay .25s allow-discrete, display .25s allow-discrete;
}

.create-drawer:popover-open::backdrop {
    opacity: 1;
}

@starting-style {
    .create-drawer:popover-open::backdrop {
        opacity: 0;
    }
}

.create-drawer-title {
    margin: 4px 8px 8px;
    color: var(--ink-3);
    font: 700 .7rem/1 var(--font-sans);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.create-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    color: var(--ink);
    text-decoration: none;
    transition: background var(--t-fast);
}

.create-drawer:popover-open .create-option {
    animation: option-in .5s var(--ease-spring) both;
    animation-delay: calc(60ms + var(--i, 0) * 45ms);
}

@keyframes option-in {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
}

.create-option:hover,
.create-option:focus-visible {
    background: var(--surface-2);
    color: var(--ink);
}

.create-option > span:nth-child(2) {
    display: grid;
    flex: 1;
    min-width: 0;
}

.create-option strong {
    font-size: var(--fs-sm);
}

.create-option small {
    color: var(--ink-3);
    font-size: var(--fs-xs);
}

.create-option-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--brand-ink);
    font-size: 1.1rem;
}

.create-option-icon.is-main {
    background: var(--pt-gradient);
    color: var(--pt-espresso);
}

/* Écran moyen : les libellés courts ; téléphone : dock pleine largeur, trois pages de chaque côté du « + ». */
@media (max-width: 1099.98px) {
    .dock-item {
        min-width: 56px;
        padding: 0 6px;
    }

    .dock-label-long {
        display: none;
    }

    .dock-label-short {
        display: inline;
    }
}

@media (max-width: 767.98px) {
    :root {
        --dock-h: 62px;
        --dock-gap: 10px;
    }

    .dock {
        right: 10px;
        left: 10px;
        translate: none;
    }

    .dock.is-tucked {
        translate: 0 calc(100% + var(--dock-gap) + 12px);
    }

    .dock-inner {
        justify-content: space-between;
        padding: 5px;
        border-radius: 20px;
    }

    .dock-item {
        flex: 1;
        min-width: 0;
        padding: 0 2px;
        font-size: .62rem;
    }

    .dock-create-wrap {
        width: 60px;
        flex: none;
    }

    .dock-label {
        font-size: .62rem;
        letter-spacing: 0;
    }

    /* Téléphone : le bouton n'est pas au centre du dock, le tiroir se centre sur l'écran. */
    .create-drawer {
        bottom: calc(var(--dock-h) + var(--dock-gap) + 18px + env(safe-area-inset-bottom));
        left: 50%;
        transform-origin: 62% 100%;
    }
}

/* Téléphone courant (380 à 420 px) : on gagne quelques pixels sur les bords pour que les six libellés respirent. */
@media (max-width: 419.98px) {
    .dock {
        right: 6px;
        left: 6px;
    }

    .dock-inner {
        padding: 4px;
    }

    .dock-create-wrap {
        width: 56px;
    }

    .dock-label {
        letter-spacing: -.01em;
    }
}

/* Petit téléphone (moins de 380 px) : six libellés ne tiennent pas sans être coupés. Le dock passe en icônes seules,
   un peu plus grandes ; le libellé reste lu par les lecteurs d'écran, la pilule marque la page en cours. */
@media (max-width: 379.98px) {
    :root {
        --dock-h: 58px;
    }

    .dock-inner {
        gap: 0;
    }

    .dock-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .dock-icon {
        font-size: 1.4rem;
    }

    .dock-create-wrap {
        width: 54px;
    }

    .dock-create {
        width: 48px;
        height: 48px;
    }
}

/* Les notifications passent au-dessus du dock. */
.has-dock:not(.has-actionbar) .toasts {
    bottom: calc(var(--dock-h) + var(--dock-gap) + 20px + env(safe-area-inset-bottom));
}

.toast-item {
    border-color: var(--glass-line);
    background: var(--glass-solid);
    box-shadow: inset 0 1px 0 var(--glass-edge), var(--shadow-3);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    animation: toast-spring .55s var(--ease-spring-soft) both;
}

@keyframes toast-spring {
    from { opacity: 0; transform: translateY(24px) scale(.9); filter: blur(4px); }
}

/* Transitions entre pages : le dock et la barre du haut restent en place, seul le contenu glisse et se fond. */
::view-transition-group(dock),
::view-transition-group(topbar) {
    animation-duration: 0s;
}

::view-transition-old(dock),
::view-transition-old(topbar) {
    display: none;
}

::view-transition-new(dock),
::view-transition-new(topbar) {
    animation: none;
}

::view-transition-old(root) {
    animation: .18s var(--ease) both vt-fade-out;
}

::view-transition-new(root) {
    animation: .38s var(--ease-out-expo) both vt-rise-in;
}

@keyframes vt-fade-out {
    to { opacity: 0; transform: scale(.985); filter: blur(2px); }
}

@keyframes vt-rise-in {
    from { opacity: 0; transform: translateY(10px) scale(.995); }
}

/* 5. Palette de commandes (Ctrl+K) -------------------------------------------- */

.palette {
    width: min(640px, calc(100vw - 24px));
    max-height: min(560px, calc(100dvh - 120px));
    margin: 12vh auto auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--ink);
    opacity: 0;
    transform: scale(.94) translateY(-8px);
    transition:
        opacity .18s var(--ease),
        transform .4s var(--ease-spring),
        overlay .4s allow-discrete,
        display .4s allow-discrete;
}

.palette[open] {
    opacity: 1;
    transform: none;
}

@starting-style {
    .palette[open] {
        opacity: 0;
        transform: scale(.94) translateY(-8px);
    }
}

.palette::backdrop {
    background: rgba(46, 34, 25, .28);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    opacity: 0;
    transition: opacity .25s var(--ease), backdrop-filter .35s var(--ease), overlay .35s allow-discrete, display .35s allow-discrete;
}

.palette[open]::backdrop {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 1;
}

@starting-style {
    .palette[open]::backdrop {
        -webkit-backdrop-filter: blur(0);
        backdrop-filter: blur(0);
        opacity: 0;
    }
}

[data-bs-theme='dark'] .palette::backdrop {
    background: rgba(0, 0, 0, .55);
}

.palette-box {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    overflow: hidden;
    border: 1px solid var(--glass-line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 30px 80px -24px rgba(46, 34, 25, .55);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    backdrop-filter: blur(24px) saturate(1.5);
}

.palette-field {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 1.1rem;
}

.palette-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 1.05rem;
    outline: none;
}

.palette-input::placeholder {
    color: var(--ink-3);
}

.palette-close {
    padding: 0;
    border: 0;
    background: none;
}

.palette-busy {
    width: 16px;
    height: 16px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.palette-results {
    position: relative;
    flex: 1;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding: 8px;
}

/* Surbrillance glissante : un seul calque qui suit l'option active (translate + hauteur). */
.palette-highlight {
    position: absolute;
    top: 0;
    right: 6px;
    left: 6px;
    height: var(--h, 48px);
    border-radius: 12px;
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), .2);
    opacity: 0;
    translate: 0 var(--y, 0);
    transition: translate .32s var(--ease-spring-soft), height .2s var(--ease), opacity .15s;
    pointer-events: none;
}

.palette-highlight.is-on {
    opacity: 1;
}

.palette-group + .palette-group {
    margin-top: 6px;
}

.palette-group-label {
    padding: 10px 12px 4px;
    color: var(--ink-3);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.palette-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 12px;
    color: var(--ink);
    cursor: pointer;
    animation: option-in .35s var(--ease-out-expo) both;
    animation-delay: calc(var(--i, 0) * 18ms);
}

.palette-option[aria-selected='true'] .palette-icon {
    background: var(--surface);
    color: var(--brand-ink);
}

.palette-option.is-chosen {
    animation: chosen .3s var(--ease) both;
}

@keyframes chosen {
    50% { transform: scale(.98); }
}

.palette-icon,
.palette-thumb {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink-2);
    transition: background var(--t-fast), color var(--t-fast);
}

.palette-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.palette-text {
    display: grid;
    flex: 1;
    min-width: 0;
}

.palette-label {
    overflow: hidden;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.palette-hint {
    overflow: hidden;
    color: var(--ink-3);
    font-size: var(--fs-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.palette-option .status {
    flex: none;
}

.palette-empty {
    margin: 0;
    padding: 28px 16px;
    color: var(--ink-3);
    text-align: center;
}

.palette-foot {
    display: flex;
    gap: 16px;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: var(--fs-xs);
}

.palette-foot .kbd {
    margin-right: 2px;
}

@media (max-width: 767.98px) {
    .palette {
        margin-top: 10px;
    }

    .palette-foot {
        display: none;
    }
}

/* 6. Menu radial d'actions ----------------------------------------------------
   Un seul menu pour toute la page (templates/_radial.html.twig, assets/lib/radial.js). Le conteneur est un point
   (popover sans taille) posé au centre du bouton « … » ; chaque action part de ce point et rejoint sa place sur
   l'arc (--x, --y calculés selon la place libre à l'écran), en ressort et en cascade (--k). */

.radial-trigger {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    font-size: 1.1rem;
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t) var(--ease-spring);
}

.radial-trigger:hover,
.radial-trigger[aria-expanded='true'] {
    border-color: var(--line);
    background: var(--surface-2);
    color: var(--ink);
}

.radial-trigger[aria-expanded='true'] {
    transform: rotate(90deg);
}

.radial {
    position: fixed;
    inset: auto;
    top: var(--cy, 50%);
    left: var(--cx, 50%);
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: none;
    transition: display .3s allow-discrete, overlay .3s allow-discrete;
}

.radial::backdrop {
    background: rgba(28, 22, 18, 0);
    transition: background .3s var(--ease), display .3s allow-discrete, overlay .3s allow-discrete;
}

.radial:popover-open::backdrop {
    background: rgba(28, 22, 18, .3);
}

/* En sombre, le voile doit foncer davantage pour détacher l'arc du contenu. */
[data-bs-theme='dark'] .radial:popover-open::backdrop {
    background: rgba(0, 0, 0, .5);
}

@starting-style {
    .radial:popover-open::backdrop {
        background: rgba(28, 22, 18, 0);
    }
}

/* Disque de verre derrière l'arc, centré sur le bouton. */
.radial-disc {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--r, 96px) * 2 + 54px);
    height: calc(var(--r, 96px) * 2 + 54px);
    border: 1px solid var(--glass-line);
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--glass-solid) 70%, color-mix(in srgb, var(--surface) 80%, transparent));
    box-shadow: var(--shadow-3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.2);
    transition: transform .45s var(--ease-out-expo), opacity .2s var(--ease);
}

.radial:popover-open .radial-disc {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Le centre : une croix à la place du bouton « … », pour refermer à la souris. */
.radial-center {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-2);
    color: var(--ink-2);
    cursor: pointer;
    transform: translate(-50%, -50%) rotate(-90deg) scale(.6);
    opacity: 0;
    transition: transform .4s var(--ease-spring), opacity .15s;
}

.radial:popover-open .radial-center {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0) scale(1);
}

.radial-item {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink);
    text-decoration: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.3);
    transition:
        transform .5s var(--ease-spring-soft) calc(var(--k, 0) * 32ms),
        opacity .18s var(--ease) calc(var(--k, 0) * 32ms);
}

.radial:popover-open .radial-item {
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--x, 0), var(--y, 0)) scale(1);
}

@starting-style {
    .radial:popover-open .radial-item {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.3);
    }

    .radial:popover-open .radial-disc {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.2);
    }

    .radial:popover-open .radial-center {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-90deg) scale(.6);
    }
}

.radial-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--glass-edge);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-2);
    font-size: 1.1rem;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t) var(--ease-spring);
}

/* Libellé toujours visible, du côté extérieur de l'arc. */
.radial-label {
    position: absolute;
    top: 50%;
    padding: .3rem .65rem;
    border: 1px solid var(--glass-line);
    border-radius: var(--r-full);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--ink);
    font-size: .8rem;
    font-weight: 650;
    white-space: nowrap;
    transform: translateY(-50%);
    pointer-events: none;
}

.radial-item[data-side='left'] .radial-label {
    right: calc(100% + 8px);
}

.radial-item[data-side='right'] .radial-label {
    left: calc(100% + 8px);
}

.radial-item:hover .radial-icon,
.radial-item:focus-visible .radial-icon {
    background: var(--brand);
    color: var(--on-solid);
    transform: scale(1.1);
}

.radial-item:focus-visible {
    outline: none;
}

.radial-item:focus-visible .radial-icon {
    box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand);
}

.radial-item.is-danger .radial-icon {
    color: var(--bad);
}

.radial-item.is-danger:hover .radial-icon,
.radial-item.is-danger:focus-visible .radial-icon {
    background: var(--bad);
    color: #fff;
}

.radial:popover-open .radial-item[aria-disabled='true'] {
    opacity: .4;
    pointer-events: none;
}

/* Frise réordonnée sur place (Reprogrammer, Publier maintenant) : seules les lignes glissent, le reste ne bouge pas. */
html.vt-local::view-transition-old(root),
html.vt-local::view-transition-new(root) {
    animation: none;
}

::view-transition-group(*.tl) {
    animation-duration: .5s;
    animation-timing-function: var(--ease-spring-soft);
}

/* Confirmation sans perte (Publier maintenant) : pastille de la marque plutôt que l'alerte rouge. */
.dialog.is-calm .dialog-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

/* Petite fenêtre « Reprogrammer ». */
.mini-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--glass-line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    color: var(--ink);
    opacity: 0;
    transform: translateY(12px) scale(.96);
    transition: opacity .2s var(--ease), transform .4s var(--ease-spring), display .3s allow-discrete, overlay .3s allow-discrete;
}

.mini-dialog[open] {
    opacity: 1;
    transform: none;
}

@starting-style {
    .mini-dialog[open] {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }
}

.mini-dialog::backdrop {
    background: rgba(28, 22, 18, .35);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mini-dialog-box {
    display: grid;
    gap: .35rem;
    padding: 1.25rem;
}

.mini-dialog-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
}

.mini-dialog-sub {
    margin: 0 0 .5rem;
    color: var(--ink-2);
    font-size: .88rem;
}

.mini-dialog-error {
    margin: .25rem 0 0;
    color: var(--bad);
    font-size: .85rem;
    font-weight: 600;
}

.mini-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: .75rem;
}

/* 7. Accueil bento, frise et statuts en direct -------------------------------- */

.home-bento {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.tile-next,
.tile-live {
    grid-column: 1 / -1;
}

/* Prochaine publication : la tuile en dégradé de la charte (.tile.tile-next : l'emporte sur .tile, section 8). */
.tile.tile-next {
    gap: .9rem;
    border-color: transparent;
    background: var(--hero);
    color: var(--hero-ink);
}

.tile-next .tile-kicker {
    color: inherit;
    opacity: .8;
}

/* .post-card.next-post : l'emporte sur la carte de base (.post-card, section 7) pour garder le verre et la grille. */
.post-card.next-post {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    padding: .7rem;
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-lg);
    background: var(--glass);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    color: var(--ink);
}

.next-thumb {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--r);
    background: var(--surface-3);
    color: var(--ink-3);
}

.next-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.next-body {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.next-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.next-title:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.next-when {
    margin: 0;
    color: var(--ink-2);
    font-size: .85rem;
}

.next-empty {
    position: relative;
    display: grid;
    justify-items: start;
    gap: .75rem;
}

.next-empty p {
    margin: 0;
}

/* Compte à rebours : chiffres de la police de titre, le chiffre qui change glisse d'un cran. Sur grand écran, la tuile
   prend la hauteur du robot voisin : le compte à rebours s'installe en bas, en grand. */
@media (min-width: 992px) {
    .tile-next .countdown {
        flex-direction: column;
        align-items: flex-start;
    }

    .tile-next .cd-unit b {
        font-size: clamp(2.4rem, 1.2rem + 2vw, 3.6rem);
    }
}

/* « Ensuite » : les publications qui suivent, en bas de la tuile (grand écran seulement, où la tuile est haute). */
.next-after {
    position: relative;
    display: grid;
    gap: .3rem;
    margin-top: auto;
}

.next-after-title {
    margin: 0;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .07em;
    opacity: .75;
    text-transform: uppercase;
}

.next-after-list {
    display: grid;
    gap: .2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.next-after-list a {
    display: flex;
    align-items: baseline;
    gap: .9rem;
    padding: .45rem .65rem;
    border-radius: var(--r);
    color: var(--hero-ink);
    text-decoration: none;
    transition: background var(--t-fast);
}

.next-after-list a:hover,
.next-after-list a:focus-visible {
    background: var(--glass);
}

.next-after-list time {
    flex: none;
    min-width: 9.5em;
    font-family: var(--font-mono);
    font-size: .8rem;
    opacity: .8;
}

.next-after-list span {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .next-after {
        display: none;
    }
}

.countdown {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .75rem;
}

.countdown-label {
    color: inherit;
    font-size: .9rem;
    font-weight: 600;
    opacity: .85;
}

.countdown-value {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .55rem;
    font-size: .9rem;
}

.cd-unit {
    display: inline-flex;
    align-items: baseline;
    gap: .2rem;
    opacity: .85;
}

.cd-unit b {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1;
    opacity: 1;
}

.cd-unit b.is-tick {
    animation: cd-tick .35s var(--ease-out-expo);
}

@keyframes cd-tick {
    from { opacity: .2; transform: translateY(-35%); }
}

.countdown.is-due .cd-now {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
}

/* Robot de publication en direct. */
.tile-live {
    gap: .75rem;
}

.live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.live-dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ok);
}

.live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--ok);
    animation: ping 1.8s var(--ease) infinite;
}

.tile-live.is-late .live-dot,
.tile-live.is-late .live-dot::after {
    background: var(--warn);
}

@keyframes ping {
    to { opacity: 0; transform: scale(2.8); }
}

.live-state {
    padding: .2rem .65rem;
    border-radius: var(--r-full);
    background: var(--ok-soft);
    color: var(--ok);
    font-size: .75rem;
    font-weight: 700;
}

.tile-live.is-busy .live-state {
    background: var(--warn-soft);
    color: var(--warn);
}

.tile-live.is-late .live-state {
    background: var(--bad-soft);
    color: var(--bad);
}

.live-list {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.live-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .5rem;
    border-radius: var(--r);
    background: var(--surface-2);
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.live-item.is-new {
    animation: rise var(--t-slow) var(--ease) both;
}

.live-item.is-leaving {
    opacity: 0;
    transform: translateX(12px);
}

.live-item.is-shake {
    animation: live-shake .45s var(--ease);
}

@keyframes live-shake {
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.live-link {
    display: flex;
    flex: 1 1 12rem;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.live-thumb {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-sm);
    background: var(--surface-3);
}

.live-thumb img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.live-thumb .net-icon {
    position: absolute;
    right: -5px;
    bottom: -5px;
    box-shadow: 0 0 0 2px var(--surface-2);
}

.live-text {
    display: grid;
    min-width: 0;
}

.live-text strong {
    overflow: hidden;
    font-size: .88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-text small {
    color: var(--ink-3);
    font-size: .75rem;
}

.live-empty,
.live-late {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 0;
    color: var(--ink-2);
    font-size: .88rem;
}

.live-late {
    padding: .6rem .75rem;
    border-radius: var(--r);
    background: var(--bad-soft);
    color: var(--bad);
    font-weight: 600;
}

/* Badges vivants : pulsation pendant l'envoi, essais 1/3… en points, éclat de confettis à la parution. */
.status {
    position: relative;
}

.status-publishing::before,
.status.is-pulse::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent);
    animation: status-pulse 1.6s var(--ease) infinite;
    pointer-events: none;
}

@keyframes status-pulse {
    to { box-shadow: 0 0 0 8px transparent; }
}

.status-publishing .status-icon {
    animation: spin 1.2s linear infinite;
}

.status.is-retry {
    --c: var(--warn);
}

.retry-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: .15rem;
}

.retry-dots i {
    width: 6px;
    height: 6px;
    border: 1.5px solid currentcolor;
    border-radius: 50%;
}

.retry-dots i.is-on {
    background: currentcolor;
}

.retry-tag {
    display: inline-block;
    padding: 0 .4rem;
    border-radius: var(--r-full);
    background: color-mix(in srgb, var(--bad) 14%, transparent);
    font-weight: 700;
}

.status.is-pop {
    animation: status-pop .6s var(--ease-spring);
}

@keyframes status-pop {
    40% { transform: scale(1.18); }
}

.burst {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
}

.burst i {
    position: absolute;
    width: 6px;
    height: 9px;
    margin: -4px 0 0 -3px;
    border-radius: 2px;
    background: var(--confetti-1);
    animation: confetti .9s var(--ease-out-expo) forwards;
}

.burst i:nth-child(4n + 2) {
    background: var(--confetti-2);
}

.burst i:nth-child(4n + 3) {
    background: var(--confetti-3);
}

.burst i:nth-child(4n) {
    background: var(--confetti-4);
}

.burst i:nth-child(3n) {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

@keyframes confetti {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(0) rotate(0) scale(.4); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1 - 14px)) rotate(var(--r)) scale(1); }
}

/* Petites tuiles chiffrées. */
.tile-stat {
    justify-content: space-between;
    min-height: 116px;
    color: var(--ink);
    text-decoration: none;
    transition: transform var(--t-spring) var(--ease-spring-soft), box-shadow var(--t) var(--ease), border-color var(--t-fast);
}

.tile-stat:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

.tile-stat .tile-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15rem .5rem;
}

.tile-stat.is-bad {
    border-color: color-mix(in srgb, var(--bad) 35%, var(--line));
}

.tile-stat.is-bad .tile-kicker,
.tile-stat.is-bad .tile-value {
    color: var(--bad);
}

/* Courbe des 7 jours : sept barres d'une seule teinte, la dernière (aujourd'hui) plus foncée. */
.spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 28px;
}

.spark i {
    flex: 1;
    height: max(3px, var(--h));
    border-radius: 3px 3px 0 0;
    background: var(--chart-bar);
    transform-origin: bottom;
    animation: bar-grow .6s var(--ease-out-expo) both;
}

.spark i:last-child {
    background: var(--chart-peak);
}

.spark i:nth-child(2) { animation-delay: 40ms; }
.spark i:nth-child(3) { animation-delay: 80ms; }
.spark i:nth-child(4) { animation-delay: 120ms; }
.spark i:nth-child(5) { animation-delay: 160ms; }
.spark i:nth-child(6) { animation-delay: 200ms; }
.spark i:nth-child(7) { animation-delay: 240ms; }

/* Frise des prochaines publications : l'heure, un point sur la ligne, la carte. */
.timeline {
    position: relative;
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 2.2rem;
    bottom: 1.6rem;
    left: calc(3.1rem + 5px);
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--pt-sable), var(--pt-caramel));
    opacity: .5;
}

.timeline-day h3 {
    margin: .5rem 0 0;
    padding-left: calc(3.1rem + 22px);
    color: var(--ink-2);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.timeline-day:first-child h3 {
    margin-top: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 3.1rem 12px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.timeline-item.is-leaving,
.draft-list li.is-leaving {
    opacity: 0;
    transform: translateX(-16px) scale(.98);
    transition: opacity .25s var(--ease), transform .3s var(--ease);
}

.timeline-time {
    color: var(--ink-2);
    font-size: .82rem;
    font-weight: 600;
    text-align: right;
}

.timeline-dot {
    position: relative;
    width: 12px;
    height: 12px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--pt-moka);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pt-sable) 60%, transparent);
}

.post-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    padding: .45rem .45rem .45rem .5rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

.post-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
}

.post-card.is-flash {
    animation: card-flash 1.2s var(--ease);
}

@keyframes card-flash {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
    100% { box-shadow: 0 0 0 10px transparent; }
}

.post-card.is-ghost {
    border-style: dashed;
    opacity: .75;
}

.post-card.is-ghost .post-card-thumb {
    animation: ghost-breathe 1.1s linear infinite;
}

@keyframes ghost-breathe {
    50% { opacity: .45; }
}

.post-card-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.post-card-thumb {
    flex: none;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--surface-3);
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-text {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

/* Le titre passe sur deux lignes plutôt que d'être coupé. */
.post-card-text strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: .9rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-card-text small {
    color: var(--ink-3);
    font-size: .75rem;
}

.post-card-status {
    flex: none;
}

.draft-list {
    display: grid;
    gap: .5rem;
    margin: .75rem 0 0;
    padding: 0;
    list-style: none;
}

.draft-list li {
    transition: opacity .25s var(--ease), transform .3s var(--ease);
}

@media (min-width: 768px) {
    .home-bento {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tile-next,
    .tile-live {
        grid-column: span 2;
    }
}

/* Téléphone : badge sous le titre, rien n'est coupé. */
@media (max-width: 575.98px) {
    .post-card {
        flex-wrap: wrap;
        position: relative;
        padding-right: 44px;
    }

    .post-card-link {
        flex-basis: 100%;
    }

    .post-card-status {
        min-width: 0;
        max-width: calc(100% - 44px - .7rem);
        margin-left: calc(44px + .7rem);
    }

    .post-card-status .status {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .post-card .radial-trigger {
        position: absolute;
        top: 50%;
        right: 2px;
        transform: translateY(-50%);
    }

    .post-card .radial-trigger[aria-expanded='true'] {
        transform: translateY(-50%) rotate(90deg);
    }

    /* Boutons « Voir » et « Réessayer » : ils passent l'un sous l'autre s'ils ne tiennent pas côte à côte. */
    .todo-actions {
        flex-wrap: wrap;
    }

    /* Écran étroit ou texte agrandi : l'état passe sous la vignette, il garde toute la largeur de la carte. */
    @media (max-width: 399.98px) {
        .post-card-status {
            max-width: 100%;
            margin-left: 0;
        }
    }

    /* Frise sur téléphone : l'heure passe au-dessus de la carte, à côté du point ; la carte prend toute la largeur. */
    .timeline-item {
        grid-template-areas:
            'dot time'
            '. card';
        grid-template-columns: 12px minmax(0, 1fr);
        gap: .2rem 10px;
    }

    .timeline-time {
        grid-area: time;
        font-size: .78rem;
        text-align: left;
    }

    .timeline-dot {
        grid-area: dot;
    }

    .timeline-item > .post-card {
        grid-area: card;
    }

    .timeline::before {
        left: 5px;
    }

    .timeline-day h3 {
        padding-left: 22px;
    }

    .post-card.next-post {
        grid-template-columns: auto minmax(0, 1fr);
        padding-right: 48px;
    }

    .next-post .radial-trigger {
        position: absolute;
        top: .5rem;
        right: .4rem;
    }

    .next-thumb {
        width: 60px;
        height: 60px;
    }

    .live-item .status {
        margin-left: calc(40px + .65rem);
    }

    .tile-stat {
        min-height: 0;
    }
}

/* Téléphone, texte agrandi (réglage d'accessibilité du téléphone) ou titres très longs : rien ne doit élargir la page
   au-delà de l'écran, sinon le navigateur dézoome et le dock déborde. Les colonnes de l'accueil se resserrent
   (minmax(0, 1fr) au lieu de la largeur du contenu), les mots trop longs passent à la ligne, et le contenu principal
   coupe en dernier recours ce qui dépasserait encore (overflow-x: clip garde la barre du haut collante). */
.dash-main,
.dash-side {
    grid-template-columns: minmax(0, 1fr);
}

.dash-main > *,
.dash-side > *,
.home-bento > * {
    min-width: 0;
}

.post-card-text strong,
.next-title,
.live-text strong,
.todo-text strong {
    overflow-wrap: anywhere;
}

main.page {
    overflow-x: clip;
}

/* 8. Statistiques ------------------------------------------------------------ */

/* Couleurs du graphique : une seule teinte (moka), le pic plus foncé (clair) ou plus clair (sombre) et nommé.
   Clair : barres 3,8:1 et pic 11:1 sur la surface. Sombre : barres 3,1:1 et pic 11,5:1. Le pic est aussi
   signalé par son libellé, jamais par la couleur seule ; infobulle et tableau en plus. */
:root,
[data-bs-theme='light'] {
    --chart-bar: #a47a55;
    --chart-peak: #4f3626;
    --chart-grid: #eee6d8;
    --chart-axis: #d3c4ae;
}

[data-bs-theme='dark'] {
    --chart-bar: #8a6246;
    --chart-peak: #e8d3b6;
    --chart-grid: #33291f;
    --chart-axis: #5a4a3c;
}

/* Filtres : période en segments, réseau en puces. Ce sont des liens (chaque vue a son adresse). */
.stats-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    margin-bottom: 1.25rem;
}

.seg-links {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border-radius: var(--r);
    background: var(--surface-3);
}

.seg-link {
    padding: .4rem .85rem;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.seg-link:hover {
    color: var(--ink);
}

.seg-link.is-active {
    background: var(--surface);
    box-shadow: var(--shadow-1), 0 4px 10px -6px rgba(0, 0, 0, .3);
    color: var(--brand-ink);
}

.net-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.net-filter .chip {
    text-decoration: none;
}

.net-filter .chip .bi {
    color: var(--net, var(--ink-3));
}

.net-filter .chip.net-tiktok .bi {
    color: var(--ink);
}

.net-filter .chip.is-on {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-ink);
}

/* Bento du pic : la grande tuile en dégradé de la charte, trois petites à côté. */
.stats-bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
    padding: 1.15rem 1.25rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.tile-hero {
    grid-column: 1 / -1;
    gap: .85rem;
    padding: 1.35rem 1.5rem;
    border-color: transparent;
    background: var(--hero);
    color: var(--hero-ink);
}

/* Halo lent qui respire derrière le contenu (transform et opacité seulement). */
.tile-hero-glow {
    position: absolute;
    inset: -40% -10% auto auto;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .55), transparent);
    opacity: .7;
    pointer-events: none;
    animation: glow-drift 9s ease-in-out infinite alternate;
}

[data-bs-theme='dark'] .tile-hero-glow {
    background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent);
}

@keyframes glow-drift {
    to { opacity: .35; transform: translate(-18%, 22%) scale(1.15); }
}

.tile-kicker {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    color: var(--ink-2);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.tile-hero .tile-kicker {
    color: inherit;
    opacity: .8;
}

.tile-kicker .bi {
    font-size: .95rem;
}

.peak-post {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.1rem;
    padding: .75rem;
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-lg);
    background: var(--glass);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    color: var(--ink);
    text-decoration: none;
    transition: transform var(--t-spring) var(--ease-spring-soft), box-shadow var(--t) var(--ease);
}

.peak-post:hover {
    box-shadow: var(--shadow-3);
    transform: translateY(-2px);
}

.peak-thumb {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border-radius: var(--r);
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: 1.4rem;
}

.peak-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.peak-body {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.peak-label {
    color: var(--ink-2);
    font-size: .8rem;
}

.peak-title {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peak-nets {
    display: flex;
    gap: .3rem;
    margin-top: .15rem;
}

.peak-figures {
    display: grid;
    justify-items: end;
    text-align: right;
}

.peak-big {
    font-family: var(--font-display);
    white-space: nowrap;
    font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}

.peak-unit {
    color: var(--ink-2);
    font-size: .85rem;
    font-weight: 600;
}

.peak-sub {
    margin-top: .3rem;
    color: var(--ink-3);
    font-size: .75rem;
    white-space: nowrap;
}

.peak-none {
    position: relative;
    max-width: 52ch;
    margin: 0;
}

.momentum {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    align-self: flex-start;
    margin: 0;
    padding: .3rem .75rem;
    border-radius: var(--r-full);
    background: var(--glass);
    font-size: .82rem;
}

.momentum.is-up .bi { color: var(--ok); }
.momentum.is-down .bi { color: var(--bad); }

.tile-value {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.tile-value small,
.stat-value small {
    margin-left: .15rem;
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: 0;
}

.tile-value-text {
    font-size: 1.3rem;
}

.tile-net {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.tile-note {
    margin: 0;
    color: var(--ink-2);
    font-size: .82rem;
}

/* Chiffres clés : sept petites tuiles, le compteur monte à l'apparition (assets/lib/chart.js). */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.stat-tile {
    display: grid;
    align-content: start;
    gap: .3rem;
    padding: .95rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.stat-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--ink-2);
    font-size: .8rem;
    font-weight: 600;
}

.stat-label .bi {
    color: var(--brand-ink);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.stat-none {
    color: var(--ink-3);
}

.stat-hint {
    color: var(--ink-3);
    font-size: .75rem;
}

.stat-hint a {
    color: var(--bad);
    font-weight: 600;
}

.delta {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    align-self: start;
    justify-self: start;
    padding: .1rem .45rem;
    border-radius: var(--r-full);
    font-size: .74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.delta.is-up { background: var(--ok-soft); color: var(--ok); }
.delta.is-down { background: var(--bad-soft); color: var(--bad); }
.delta.is-flat { background: var(--surface-2); color: var(--ink-2); }

/* Graphique, puis « par réseau » et « meilleures publications » côte à côte. */
.stats-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid .panel + .panel,
.stats-notes {
    margin-top: 0;
}

.stats-notes {
    margin-top: 1rem;
}

.chart-panel {
    min-width: 0;
}

.chart {
    position: relative;
    margin: 0;
    padding: 1.6rem 0 0 2.75rem;
}

/* Zone de tracé : la grille derrière, une colonne par période devant (toute la hauteur sert de zone de survol). */
.chart-plot {
    position: relative;
    height: clamp(180px, 22vw, 260px);
    margin-bottom: 1.6rem;
}

.chart-grid {
    position: absolute;
    inset: 0;
}

.chart-gridline {
    position: absolute;
    right: 0;
    bottom: var(--p);
    left: 0;
    border-top: 1px solid var(--chart-grid);
}

.chart-gridline.is-base {
    border-top-color: var(--chart-axis);
}

.chart-gridline > span {
    position: absolute;
    right: calc(100% + .5rem);
    color: var(--ink-3);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-50%);
}

.chart-cols {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.chart-col {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: var(--r-xs) var(--r-xs) 0 0;
    outline: none;
    transition: background var(--t-fast);
}

.chart-col.is-hover {
    background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.chart-col:focus-visible {
    background: color-mix(in srgb, var(--brand) 9%, transparent);
    box-shadow: inset 0 0 0 2px var(--brand);
}

/* Barre : 4 px arrondis en haut, posée sur l'axe ; elle pousse depuis l'axe, l'une après l'autre (transform seulement). */
.chart-bar {
    width: min(36px, 62%);
    height: var(--h);
    min-height: 3px;
    border-radius: 4px 4px 0 0;
    background: var(--chart-bar);
    transform-origin: 50% 100%;
    transition: background var(--t-fast);
    animation: bar-grow .7s var(--ease-out-expo) both;
    animation-delay: calc(120ms + var(--i, 0) * 16ms);
}

.chart-col.is-zero .chart-bar {
    min-height: 0;
}

.chart-col.is-hover .chart-bar {
    background: color-mix(in srgb, var(--chart-bar) 65%, var(--chart-peak));
}

.chart-col.is-peak .chart-bar {
    background: var(--chart-peak);
}

@keyframes bar-grow {
    from { transform: scaleY(0); }
}

.chart-peak-label {
    position: absolute;
    bottom: calc(var(--h) + .4rem);
    left: 50%;
    color: var(--ink);
    font-size: .76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transform: translateX(-50%);
    animation: fade-in var(--t-slow) var(--ease) .65s both;
}

@keyframes fade-in {
    from { opacity: 0; }
}

.chart-x {
    position: absolute;
    top: calc(100% + .45rem);
    left: 50%;
    color: var(--ink-3);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transform: translateX(-50%);
}

.chart-tip {
    position: absolute;
    top: var(--y, 0);
    left: var(--x, 0);
    z-index: 2;
    display: grid;
    gap: .1rem;
    min-width: 9rem;
    padding: .5rem .7rem;
    border: 1px solid var(--glass-edge);
    border-radius: var(--r-sm);
    background: var(--glass);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
    box-shadow: var(--shadow-3);
    color: var(--ink);
    font-size: .78rem;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 10px));
    white-space: nowrap;
}

.chart-tip strong {
    font-size: .8rem;
}

.chart-tip span {
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.chart-table {
    margin-top: .75rem;
    font-size: .85rem;
}

.chart-table summary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--brand-ink);
    font-weight: 600;
    cursor: pointer;
}

.chart-table table {
    margin: .6rem 0 0;
}

.chart-table tr.is-peak th,
.chart-table tr.is-peak td {
    font-weight: 700;
}

/* Par réseau : barres horizontales d'une seule teinte, le nom et le chiffre en texte. */
.net-bars {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.net-bar {
    display: grid;
    gap: .4rem;
}

.net-bar-head {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink);
    text-decoration: none;
}

.net-bar-head:hover .net-bar-name {
    color: var(--brand-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.net-bar-name {
    font-weight: 650;
}

.net-bar-value {
    margin-left: auto;
    font-weight: 700;
}

.net-bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: var(--r-full);
    background: var(--surface-3);
}

.net-bar-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--chart-bar);
    transform: scaleX(calc(var(--w, 0) / 100));
    transform-origin: left center;
    animation: bar-fill .9s var(--ease-out-expo) .25s both;
}

.net-bar.is-lead .net-bar-fill {
    background: var(--chart-peak);
}

@keyframes bar-fill {
    from { transform: scaleX(0); }
}

.net-bar-meta {
    color: var(--ink-3);
    font-size: .78rem;
}

.net-bar-empty {
    color: var(--ink-2);
}

/* Meilleures publications. */
.top-list {
    display: grid;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.top-item {
    display: grid;
    grid-template-columns: 1.4rem 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .5rem;
    border-radius: var(--r);
    color: var(--ink);
    text-decoration: none;
    transition: background var(--t-fast), transform var(--t) var(--ease-spring);
}

.top-item:hover {
    background: var(--surface-2);
    transform: translateX(2px);
}

.top-rank {
    color: var(--ink-3);
    font-family: var(--font-display);
    font-weight: 700;
    text-align: center;
}

li:first-child > .top-item .top-rank {
    color: var(--brand-ink);
}

.top-thumb {
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--surface-3);
}

.top-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-body {
    display: grid;
    min-width: 0;
}

.top-body strong {
    overflow: hidden;
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-body small {
    color: var(--ink-3);
    font-size: .75rem;
}

.top-figures {
    display: grid;
    justify-items: end;
    gap: .1rem;
    color: var(--ink-2);
    font-size: .8rem;
}

.top-figures span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.notes-list {
    display: grid;
    gap: .7rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .88rem;
}

.notes-list li {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.notes-list > li > .bi {
    color: var(--ink-3);
    font-size: 1rem;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-panel {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .stats-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Grand écran : le pic occupe un carré de 2 × 2, les quatre petites tuiles l'entourent. */
@media (min-width: 1200px) {
    .stats-bento {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tile-hero {
        grid-row: span 2;
        grid-column: span 2;
        justify-content: space-between;
    }
}

@media (max-width: 767.98px) {
    .peak-post {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .peak-figures {
        grid-column: 1 / -1;
        grid-template-columns: auto auto 1fr;
        align-items: baseline;
        justify-items: start;
        gap: .4rem;
        text-align: left;
    }

    .peak-sub {
        justify-self: end;
    }

    .peak-thumb {
        width: 60px;
        height: 60px;
    }

    .stats-filters {
        flex-flow: column nowrap;
        align-items: stretch;
    }

    .net-filter {
        min-width: 0;
    }

    .seg-links {
        display: flex;
    }

    .seg-link {
        flex: 1;
        padding-inline: .4rem;
        text-align: center;
    }

    .net-filter {
        flex-wrap: nowrap;
        margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5);
        padding: 2px calc(var(--bs-gutter-x, 1.5rem) * .5);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .stat-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 9. Mouvement réduit ---------------------------------------------------------
   app.css ramène déjà toutes les durées à 0,01 ms ; ici on retire ce qui bougerait encore (boucles, décalages). */
@media (prefers-reduced-motion: reduce) {
    .tile-hero-glow,
    .dock-create-halo {
        animation: none !important;
    }

    .chart-bar,
    .net-bar-fill,
    .chart-peak-label,
    .spark i,
    .live-dot::after,
    .status-publishing::before,
    .status.is-pulse::before,
    .status-publishing .status-icon,
    .cd-unit b.is-tick,
    .post-card.is-ghost .post-card-thumb {
        animation: none !important;
    }

    .burst {
        display: none;
    }

    .peak-post:hover,
    .top-item:hover {
        transform: none;
    }
}

/* Écran tactile sans clavier : les raccourcis affichés n'ont pas de sens. */
@media (hover: none) and (pointer: coarse) {
    .create-option .kbd,
    .palette-option .kbd,
    .palette-foot {
        display: none;
    }
}

/* Planning : le calendrier s'arrête au-dessus du dock (la page ne défile pas, le dock reste visible). */
.has-dock .cal {
    height: max(520px, calc(100dvh - var(--appbar-h) - 10.25rem - var(--dock-h) - var(--dock-gap) - 12px));
}

@media (max-width: 767.98px) {
    .has-dock .cal {
        height: max(440px, calc(100dvh - var(--appbar-h) - 15rem - var(--dock-h) - var(--dock-gap)));
    }
}
