@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #F6F8F5;
    --surface: #FFFFFF;
    /* Palette resserrée (10 couleurs) : encre, gris texte, trait, fond, blanc, gris vert,
       vert SUIVEL (seule couleur d'action), vert clair (sélection), maïs (« en retard ») et rouge (urgent).
       Les anciens jetons teintés (ambre, rouge pâle) pointent désormais vers des neutres. */
    --surface-subtle: #EAF0EC;
    --input-bg: #FFFFFF;
    --track-bg: #EAF0EC;
    --neutral-bg: #EAF0EC;
    --selected-bg: #D3F0E0;
    --text: #07110C;
    --text-muted: #52635A;
    --green: #0E7A48;
    --green-accent: #0E7A48;
    --green-hover: #0B6139;
    --green-pale: #D3F0E0;
    --maize: #F2A93B;
    --btn-primary-text: #FFFFFF;
    --border: #D2DDD6;
    --input-border: #8DA095;
    --amber-bg: #EAF0EC;
    --amber-border: #D2DDD6;
    --reperes-text: #07110C;
    --reperes-strong: #07110C;
    --danger: #B42318;
    --danger-bg: #FFFFFF;
    --danger-border: #D2DDD6;
    --warn: #8A5300;
    --warn-bg: #FFFFFF;
    --warn-border: #D2DDD6;
    --info: #0E7A48;
    --info-bg: #FFFFFF;
    --radius: 16px;
    --shadow-sm: none;
    --nav-glass: rgba(255, 255, 255, 0.96);
    --nav-glass-border: rgba(7, 17, 12, 0.08);
    --nav-shadow: 0 10px 30px rgba(7, 17, 12, 0.14);
    --nav-lamp: #EAF0EC;
    --nav-lamp-ink: #0E7A48;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07110C;
    --surface: #0E1B14;
    --surface-subtle: #14251C;
    --input-bg: #07110C;
    --track-bg: #14251C;
    --neutral-bg: #14251C;
    --selected-bg: #0F3F27;
    --text: #F6F8F5;
    --text-muted: #8FA398;
    --green: #19B36B;
    --green-accent: #19B36B;
    --green-hover: #22C97B;
    --green-pale: #0F3F27;
    --maize: #F2A93B;
    --btn-primary-text: #07110C;
    --border: #1E3529;
    --input-border: #2C4C3B;
    --amber-bg: #14251C;
    --amber-border: #1E3529;
    --reperes-text: #F6F8F5;
    --reperes-strong: #F6F8F5;
    --danger: #F87171;
    --danger-bg: #0E1B14;
    --danger-border: #1E3529;
    --warn: #F2A93B;
    --warn-bg: #0E1B14;
    --warn-border: #1E3529;
    --info: #19B36B;
    --info-bg: #0E1B14;
    --shadow-sm: none;
    --nav-glass: rgba(14, 27, 20, 0.95);
    --nav-glass-border: rgba(255, 255, 255, 0.10);
    --nav-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --nav-lamp: #1E3529;
    --nav-lamp-ink: #2FD487;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* iOS (et certains navigateurs Android) agrandissent le texte en mode paysage sans ça. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* La barre d'état de l'app installée est désormais opaque (« default ») : iOS 26.1+ floute le haut de
   l'écran avec l'ancien réglage « black-translucent ». La page commence alors sous la barre et cette
   bande a une hauteur nulle. Elle reste pour les apps installées avant ce changement (texte blanc
   sur fond transparent) tant qu'elles n'ont pas été réinstallées depuis l'écran d'accueil. */
:root:not([data-theme="dark"]) body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: #07110C;
    z-index: 100000;
    pointer-events: none;
}

/* Marque SUIVEL & sélecteur de thème */
.suivel-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    line-height: 1.1;
}

.suivel-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.suivel-logo-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #07110C;
    border: 1px solid rgba(25, 179, 107, 0.35);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.suivel-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.suivel-wordmark {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
}

.suivel-brand--sm .suivel-wordmark {
    font-size: 15.5px;
    letter-spacing: 0.16em;
}

.suivel-brand--lg .suivel-wordmark {
    font-size: 21px;
    letter-spacing: 0.2em;
}

.suivel-brand--dark .suivel-wordmark {
    color: #F6F8F5;
}

.suivel-brand--light .suivel-wordmark {
    color: #07110C;
}

.suivel-i {
    color: #F2A93B;
}

.suivel-tagline {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-muted);
}

.suivel-brand--dark .suivel-tagline {
    color: #8FA398;
}

/* Écran d'ouverture de l'application installée : le logo SUIVEL se dessine, la feuille pousse, puis le nom
   apparaît (environ 2,4 s). Fond clair par défaut, sombre si l'utilisateur a choisi le mode sombre. */
.pwa-splash {
    --splash-bg: #F6F8F5;
    --splash-ink: #07110C;
    --splash-muted: #52635A;
    --splash-g1: #14864D;
    --splash-g2: #0B6338;
    --splash-g3: #064224;
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--splash-bg);
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
}

html[data-theme="dark"] .pwa-splash {
    --splash-bg: #07110C;
    --splash-ink: #F6F8F5;
    --splash-muted: #8FA398;
    --splash-g1: #19B36B;
    --splash-g2: #0E7D47;
    --splash-g3: #074F2C;
}

html.pwa-launching .pwa-splash {
    display: flex;
}

.pwa-splash.is-fading {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.pwa-splash-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 24px;
}

.pwa-splash-mark {
    width: 112px;
    height: 112px;
    overflow: visible;
}

.pwa-splash-g1 { stop-color: var(--splash-g1); }
.pwa-splash-g2 { stop-color: var(--splash-g2); }
.pwa-splash-g3 { stop-color: var(--splash-g3); }

.pwa-splash-stroke {
    fill: none;
    stroke-width: 22;
    stroke-linecap: round;
    stroke-dasharray: 1 1.2;
    stroke-dashoffset: 0;
}

.pwa-splash-leaf {
    fill: #F2A93B;
    transform-box: view-box;
    transform-origin: 83.7px 36.2px;
}

.pwa-splash-wordmark {
    display: flex;
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.2em;
    padding-left: 0.2em;
    line-height: 1.05;
    color: var(--splash-ink);
}

.pwa-splash-wordmark .suivel-i {
    color: #F2A93B;
}

.pwa-splash-tagline {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--splash-muted);
}

@media (prefers-reduced-motion: no-preference) {
    html.pwa-launching .pwa-splash-stroke-a { animation: pwaDraw 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both; }
    html.pwa-launching .pwa-splash-stroke-b { animation: pwaDraw 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.5s both; }
    html.pwa-launching .pwa-splash-leaf { animation: pwaSprout 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 1.05s both; }
    html.pwa-launching .pwa-splash-wordmark span { animation: pwaLetterUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(1) { animation-delay: 1.3s; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(2) { animation-delay: 1.36s; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(3) { animation-delay: 1.42s; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(4) { animation-delay: 1.48s; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(5) { animation-delay: 1.54s; }
    html.pwa-launching .pwa-splash-wordmark span:nth-child(6) { animation-delay: 1.6s; }
    html.pwa-launching .pwa-splash-tagline { animation: pwaFadeIn 0.5s ease 1.85s both; }
}

/* Le trait part de 1,1 (et non 1) : aucun point rond n'apparaît avant le début du dessin. */
@keyframes pwaDraw {
    from { stroke-dashoffset: 1.1; }
    to { stroke-dashoffset: 0; }
}

@keyframes pwaSprout {
    from { transform: scale(0) rotate(-35deg); opacity: 0; }
    60% { opacity: 1; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes pwaLetterUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes pwaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 2px;
}

.num, td.num, th.num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Layout principal Desktop (1440px) & Mobile (360px) */
.app-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Filet de sécurité : un contenu trop large ne doit jamais élargir la page sur mobile
       (sinon iOS autorise le dézoom et ne revient plus au format exact de l'écran).
       « clip » et non « hidden » pour ne pas casser la barre du haut en position sticky. */
    overflow-x: clip;
}

.topbar {
    background: var(--bg);
    border-bottom: 1px solid transparent;
    padding: calc(8px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) 8px calc(20px + env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 30;
}

:root:not([data-theme="dark"]) .topbar {
    background: linear-gradient(
        to bottom,
        #07110C 0,
        #07110C env(safe-area-inset-top, 0px),
        var(--bg) env(safe-area-inset-top, 0px)
    );
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

/* En-tête (option 2) : logo, nom de la ferme avec la date dessous, état de synchro, initiales. */
.topbar-logo {
    display: none;
    flex-shrink: 0;
    text-decoration: none;
}

.topbar-farm {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-farm-select {
    min-height: 32px;
    padding: 0 26px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352635A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 16px;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    max-width: 260px;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* Aucun cadre quand on touche le nom de la ferme (iPhone et Android en affichaient un à chaque appui).
   Au clavier, sur ordinateur, un trait vert sous le nom montre où l'on est. */
.topbar-farm-select {
    -webkit-tap-highlight-color: transparent;
}

.topbar-farm-select:focus,
.topbar-farm-select:focus-visible {
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .topbar-farm-select:focus-visible {
        box-shadow: inset 0 -2px 0 var(--green);
    }
}

.topbar-date {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.3;
}

.topbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    position: relative;
}

/* Zone de toucher de 44 px autour des initiales. */
.topbar-avatar::after {
    content: "";
    position: absolute;
    inset: -2px;
}

.topbar-avatar:hover {
    background: var(--green-pale);
    text-decoration: none;
}

#sync-status-indicator {
    background: transparent;
    border: 0;
    padding: 0 4px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

#sync-status-indicator.badge-ok::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

#sync-status-indicator.badge-warn {
    color: var(--warn);
}

#sync-status-indicator.badge-danger {
    color: var(--danger);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar-logout-btn {
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.content {
    padding: 16px calc(20px + env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) 20px;
    max-width: 1440px;
    width: 100%;
    margin: 0;
    flex: 1;
}

.content > :last-child,
.card > :last-child,
.action-drawer-body > :last-child,
.check-row-body > :last-child {
    margin-bottom: 0;
}

/* Barre du bas (mobile) : gélule flottante en verre, au-dessus de la barre d'accueil de l'iPhone.
   L'onglet actif est posé sur une petite gélule qui glisse jusqu'à l'onglet touché (l'ancienne « lampe »),
   et un bouton rond séparé ouvre la recherche. */
.bottom-nav {
    display: none;
    position: fixed;
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 40;
    align-items: center;
    gap: 8px;
}

.bottom-nav-inner,
.bottom-nav-search {
    background: var(--nav-glass);
    border: 1px solid var(--nav-glass-border);
    box-shadow: var(--nav-shadow);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
}

.bottom-nav-inner {
    position: relative;
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(var(--nav-count, 5), minmax(0, 1fr));
    height: 64px;
    padding: 4px;
    border-radius: 999px;
    overflow: hidden;
}

/* Gélule de l'onglet actif : même largeur qu'un onglet, déplacée d'un onglet par unité de --nav-index. */
.bottom-nav-lamp {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / var(--nav-count, 5));
    transform: translateX(calc(var(--nav-index, 0) * 100%));
    border-radius: 999px;
    background: var(--nav-lamp);
    transition: transform 0.5s cubic-bezier(0.34, 1.3, 0.64, 1);
    pointer-events: none;
}

.bottom-nav-lamp[hidden] {
    display: none;
}

.bottom-nav-link {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 44px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bottom-nav-link svg {
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-link:focus-visible,
.bottom-nav-search:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -4px;
}

/* Même épaisseur de texte que les autres onglets : seule la couleur change, les noms ne se bousculent pas. */
.bottom-nav-link.active {
    color: var(--nav-lamp-ink);
}

.bottom-nav-link.active svg {
    transform: scale(1.06);
}

.bottom-nav-search {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.bottom-nav-search:active {
    transform: scale(0.94);
}

/* Petits téléphones : barre un peu plus basse et textes plus courts. */
@media (max-width: 374px) {
    .bottom-nav-inner {
        height: 60px;
    }

    .bottom-nav-search {
        width: 60px;
        height: 60px;
    }

    .bottom-nav-link {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-lamp,
    .bottom-nav-link,
    .bottom-nav-link svg,
    .bottom-nav-search {
        transition: none;
    }
}

/* Cards, Grids, Buttons, Forms */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.page-subtitle {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 15px;
}

/* Blocs : fond blanc sur fond légèrement teinté, sans bordure ni ombre. */
.card {
    background: var(--surface);
    border: 0;
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 12px;
    box-shadow: none;
}

.card-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.daily-top-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.45fr;
    gap: 12px;
    margin-bottom: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.daily-top-grid > .card,
.grid-2 > .card,
.grid-3 > .card,
.grid-4 > .card,
.grid-2 > .kpi-card,
.grid-3 > .kpi-card,
.grid-4 > .kpi-card,
.grid-2 > .action-drawer,
.grid-3 > .action-drawer {
    margin-bottom: 0;
}

.daily-top-grid > .card,
.grid-2 > .card,
.grid-3 > .card {
    display: flex;
    flex-direction: column;
}

.grid-2 > .action-drawer,
.grid-3 > .action-drawer {
    align-self: start;
}

.kpi-card {
    background: var(--surface);
    border: 0;
    border-radius: 16px;
    padding: 14px 16px;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.kpi-note {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--green);
    color: var(--btn-primary-text);
}

.btn-primary:hover {
    background: var(--green-hover);
    color: var(--btn-primary-text);
}

.btn-secondary {
    background: var(--surface-subtle);
    color: var(--green);
    border-color: transparent;
}

.btn-secondary:hover {
    background: var(--green-pale);
}

.btn-ghost {
    background: var(--surface-subtle);
    color: var(--text);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--green-pale);
}

.btn-danger {
    background: var(--danger);
    color: #FFFFFF;
}

/* Boutons posés sur le bloc vert clair de l'accueil. */
.btn-banner-primary {
    background: var(--green);
    color: var(--btn-primary-text);
    border-color: var(--green);
}

.btn-banner-primary:hover {
    background: var(--green-hover);
    color: var(--btn-primary-text);
}

.btn-banner-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: transparent;
}

.btn-banner-ghost:hover {
    background: var(--surface-subtle);
    color: var(--text);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 10px 12px;
    margin-bottom: 12px;
}

.form-grid > .field {
    margin-bottom: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.field label,
.field-group-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.field input,
.field select,
.field textarea {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 16px;
}

.field input[type="file"] {
    max-width: 100%;
    min-width: 0;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-control:focus,
.topbar-farm-select:focus {
    border-color: var(--green);
}

.field textarea {
    min-height: 84px;
}

.field-error {
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
}

/* Statuts : un mot, pas une pastille. Seuls « en retard » (maïs) et « urgent » (rouge)
   reçoivent une couleur, avec un point devant pour ne jamais dépendre de la couleur seule. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.badge-ok,
.badge-neutral {
    background: transparent;
    color: var(--text-muted);
}

.badge-warn {
    background: transparent;
    color: var(--warn);
}

.badge-danger {
    background: transparent;
    color: var(--danger);
}

.badge-warn::before,
.badge-danger::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.badge-warn::before {
    background: var(--maize);
}

/* Alertes : une ligne sur fond neutre ; seuls l'icône et le titre portent la couleur. */
.alert {
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.alert-danger {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.alert-warn {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.alert-success > svg:first-child,
.alert-success > span:first-child,
.alert-success strong {
    color: var(--green);
}

.alert-danger > svg:first-child,
.alert-danger > span:first-child,
.alert-danger strong {
    color: var(--danger);
}

.alert-warn > svg:first-child,
.alert-warn > span:first-child,
.alert-warn strong {
    color: var(--warn);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

td[colspan] {
    text-align: center;
    color: var(--text-muted);
    padding: 10px 12px;
}

th {
    background: var(--surface-subtle);
    font-weight: 600;
    color: var(--text);
}

tr:last-child td {
    border-bottom: none;
}

/* Version téléphone des tableaux : une liste dans un seul bloc, lignes séparées par un trait. */
.compact-list {
    display: none;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
}

.compact-item {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 14px 16px;
    background: var(--surface);
}

.compact-item:last-child {
    border-bottom: 0;
}

body.guest-page {
    background: #07110C;
    color: #F6F8F5;
    --bg: #07110C;
    --surface: #0E1B14;
    --surface-subtle: #14251C;
    --input-bg: #08130D;
    --neutral-bg: #172A20;
    --text: #F6F8F5;
    --text-muted: #8FA398;
    --green: #19B36B;
    --green-accent: #19B36B;
    --green-hover: #22C97B;
    --green-pale: #0F3F27;
    --btn-primary-text: #07110C;
    --border: #1E3529;
    --input-border: #2C4C3B;
    --danger: #F87171;
    --danger-bg: #0E1B14;
    --danger-border: #1E3529;
    --warn: #F2A93B;
    --warn-bg: #0E1B14;
    --warn-border: #1E3529;
}

.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
    background: #07110C;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #0E1B14;
    color: var(--text);
    border: 1px solid #1E3529;
    border-radius: 20px;
    padding: 28px;
    box-shadow: none;
}

/* Bloc d'en-tête des pages : vert clair uni, sans dégradé. */
.hero-banner {
    background: var(--green-pale);
    color: var(--text);
    border: 0;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-banner h1,
.hero-banner h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
}

.hero-sub {
    color: var(--text);
    font-size: 15px;
    margin-top: 2px;
}

.reperes-box {
    background: var(--surface-subtle);
    border: 0;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.reperes-box strong {
    display: block;
    margin-bottom: 2px;
    color: var(--reperes-strong);
}

/* Gestes du quotidien : des boutons ronds, comme dans une appli de mobile money. */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 8px;
}

.quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 4px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
    min-height: 88px;
    cursor: pointer;
}

.quick-tile:hover {
    text-decoration: none;
}

.quick-tile-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.quick-tile:hover .quick-tile-icon {
    background: var(--green-pale);
}

/* Accueil : bloc « Fiche du jour » vert clair avec son anneau d'avancement. */
.day-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 24px;
    background: var(--green-pale);
    color: var(--text);
}

.day-ring {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    color: var(--green);
}

.day-ring svg {
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}

.day-ring b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.day-hero-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.day-hero-text h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.day-hero-text p {
    margin: 0;
    font-size: 15px;
}

.day-hero-text .btn {
    margin-top: 4px;
}

/* Accueil : « À traiter », une ligne par alerte, délai d'attente ou tâche. */
.watch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.watch-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
}

.watch-list {
    display: flex;
    flex-direction: column;
}

.watch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
    border-top: 1px solid var(--border);
}

.watch-row:first-child {
    border-top: 0;
}

a.watch-row:hover {
    text-decoration: none;
}

.watch-row > form {
    margin: 0;
}

.watch-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.watch-icon.is-danger {
    color: var(--danger);
}

.watch-icon.is-warn {
    color: var(--warn);
}

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

.watch-text strong {
    font-size: 16px;
    font-weight: 600;
}

.watch-text > span:not(.watch-level) {
    font-size: 14px;
    color: var(--text-muted);
}

.watch-level {
    font-size: 13.5px;
    font-weight: 700;
}

.watch-level.is-danger {
    color: var(--danger);
}

.watch-level.is-warn,
.is-late {
    color: var(--warn);
    font-style: normal;
    font-weight: 700;
}

.watch-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
}

/* Case ronde pour cocher une tâche : 44 px de zone de toucher. */
.task-check {
    width: 44px;
    height: 44px;
    margin-left: -2px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.task-check span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--input-border);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.task-check:hover span {
    border-color: var(--green);
    background: var(--green-pale);
}

.drawer-chevron {
    display: inline-flex;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

details[open] > summary .drawer-chevron {
    transform: rotate(180deg);
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-row {
    background: var(--surface);
    border: 0;
    border-radius: 16px;
    overflow: hidden;
}

.check-row summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    min-height: 60px;
}

.check-row summary::-webkit-details-marker {
    display: none;
}

.check-row[open] summary {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
}

.check-row-body {
    padding: 16px;
}

.check-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.check-circle.done {
    background: var(--green);
    color: var(--btn-primary-text);
}

.check-circle.todo {
    background: var(--maize);
    color: #07110C;
}

.pill-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 0;
    background: var(--surface-subtle);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.pill-btn:hover {
    background: var(--green-pale);
    text-decoration: none;
}

.pill-btn.active {
    background: var(--green-pale);
    border-color: transparent;
    color: var(--text);
    font-weight: 700;
}

.action-drawer {
    background: var(--surface);
    border: 0;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: none;
    overflow: hidden;
    align-self: start;
}

.action-drawer > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.action-drawer > summary::-webkit-details-marker {
    display: none;
}

.action-drawer[open] > summary {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
}

.action-drawer-body {
    padding: 14px 15px;
}

.menu-group {
    background: var(--surface);
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: none;
}

.menu-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    min-height: 54px;
}

.menu-row:last-child {
    border-bottom: none;
}

.menu-row:hover {
    background: var(--surface-subtle);
    text-decoration: none;
}

/* Icônes seules, au trait vert : plus de petits carrés teintés. */
.menu-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: transparent;
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.menu-row-arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-weight: 700;
}

/* Lignes de menu qui sont des boutons (installer l'app, rappels du matin) */
button.menu-row {
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-row[hidden],
.install-banner[hidden] {
    display: none;
}

.menu-row.is-active .menu-row-icon {
    background: transparent;
    color: var(--green);
}

.menu-row-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.menu-row-hint {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.menu-row-value {
    color: var(--text-muted);
    font-size: 15px;
    white-space: nowrap;
}

.menu-row.is-danger .menu-row-icon,
.menu-row.is-danger .menu-row-label {
    color: var(--danger);
}

/* Résultats : mois avec flèches, résultat en grand, quatre chiffres. */
.month-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 420px;
    margin: 4px 0 8px;
}

.month-switch strong {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
}

.month-switch-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--surface-subtle);
    flex-shrink: 0;
}

.month-switch-btn:hover {
    background: var(--green-pale);
}

.result-hero {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 20px;
    margin-bottom: 12px;
    border-radius: 24px;
    background: var(--green-pale);
    color: var(--text);
}

.result-hero-label {
    font-size: 15px;
    font-weight: 600;
}

.result-hero-value {
    font-size: 40px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.result-hero-sub {
    font-size: 14px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 12px;
    background: var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.result-grid > div {
    background: var(--surface);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-grid strong {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.result-grid span {
    font-size: 14px;
    color: var(--text-muted);
}

.result-grid .is-due strong {
    color: var(--warn);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

/* Fiche d'un animal (option 2) : profil, trois chiffres, prochaine étape, courbe de poids. */
.animal-profile {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.animal-profile-photo {
    flex: 0 0 96px;
    text-align: center;
}

.animal-profile-photo img,
.animal-profile-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    display: block;
    background: var(--green-pale);
}

.animal-profile-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--green);
}

.animal-profile-placeholder span {
    font-size: 34px;
    line-height: 1;
    font-weight: 700;
}

.animal-profile-placeholder small {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text);
}

.animal-photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
    cursor: pointer;
    position: relative;
}

.animal-profile-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.animal-profile-name {
    font-weight: 600;
    color: var(--text-muted);
}

.animal-profile-text p {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

.animal-profile-status {
    align-self: flex-start;
}

.animal-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
}

.animal-stats > div {
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.animal-stats > div + div {
    border-left: 1px solid var(--border);
}

.animal-stats strong {
    font-size: 19px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.animal-stats span {
    font-size: 14px;
    color: var(--text-muted);
}

.animal-next {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: var(--green-pale);
    color: var(--text);
}

.animal-next svg {
    color: var(--green);
    flex-shrink: 0;
}

.animal-next div {
    display: flex;
    flex-direction: column;
}

.animal-next strong {
    font-size: 16px;
}

.animal-next span {
    font-size: 14px;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.panel-head > span {
    font-size: 14px;
    color: var(--text-muted);
}

.weight-chart {
    width: 100%;
    height: auto;
    display: block;
}

.wc-grid {
    stroke: var(--border);
    stroke-width: 1;
}

.wc-lbl {
    fill: var(--text-muted);
    font-size: 11.5px;
    font-family: inherit;
}

.wc-val {
    fill: var(--text);
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
}

.wc-line {
    fill: none;
    stroke: var(--green);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.wc-area {
    fill: var(--green);
    fill-opacity: 0.1;
}

.wc-dot {
    fill: var(--green);
    stroke: var(--surface);
    stroke-width: 2;
}

.kv-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 15px;
}

.kv-list > div:first-child {
    border-top: 0;
}

.kv-list span {
    color: var(--text-muted);
}

.kv-list strong {
    font-weight: 600;
    text-align: right;
}

/* Liste des animaux : un seul bloc, une ligne par animal. */
.animal-list {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.animal-list .menu-row {
    min-height: 68px;
}

.animal-list .menu-row:last-child {
    border-bottom: 0;
}

.animal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--green-pale);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.animal-status {
    display: inline;
    padding: 0;
    font-size: 14px;
    color: var(--text);
}

.animal-status.badge-warn {
    color: var(--warn);
}

.animal-list .menu-row-arrow {
    margin-left: 4px;
}

/* Menu Plus : liste à plat par thème (repris de l'option 1). */
.plus-section-title {
    margin: 22px 4px 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.plus-page .page-header {
    margin-bottom: 0;
}

.plus-page .menu-row {
    border-bottom: 0;
    position: relative;
}

.plus-page .menu-row + .menu-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 54px;
    right: 0;
    border-top: 1px solid var(--border);
}

.plus-page .menu-row[hidden] + .menu-row::before {
    display: none;
}

.plus-farm {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.plus-farm > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.plus-farm strong {
    font-size: 18px;
    font-weight: 800;
}

.plus-farm span {
    font-size: 14px;
    color: var(--text-muted);
}

.plus-farm-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

/* Interrupteur « Mode sombre » (bouton role="switch"). */
.switch-track {
    width: 48px;
    height: 28px;
    border-radius: 14px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
    transition: background-color 0.2s ease;
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(7, 17, 12, 0.3);
    transition: transform 0.2s ease;
}

[aria-checked="true"] > .switch-track {
    background: var(--green);
}

[aria-checked="true"] > .switch-track::after {
    transform: translateX(20px);
}

/* Proposition d'installation de l'app (masquée une fois installée ou reportée) */
.install-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 0;
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
}

.install-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1 1 180px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.install-banner-text span {
    color: var(--text-muted);
    font-size: 13px;
}

.install-banner-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.install-steps {
    list-style: none;
    padding: 0;
    margin: 16px 0 18px;
    display: grid;
    gap: 14px;
}

.install-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.45;
}

.install-step-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--green-pale);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cal-head {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 0;
}

.cal-day {
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 6px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cal-day.today {
    background: var(--green-pale);
    border-color: var(--green);
}

.cal-day.empty {
    background: var(--surface-subtle);
    border-color: transparent;
}

.cal-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.genealogy-tree {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.genealogy-row {
    display: grid;
    gap: 8px;
}

.genealogy-node {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-subtle);
    text-align: center;
    font-size: 13px;
}

.funnel-row {
    margin-bottom: 10px;
}

.funnel-bar-bg {
    height: 10px;
    background: var(--track-bg);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.funnel-bar {
    height: 100%;
    background: var(--green);
    border-radius: 999px;
}

.progress-track {
    height: 8px;
    background: var(--track-bg);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green);
    border-radius: 999px;
}

.flex-between-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-control {
    min-height: 44px;
    font-family: inherit;
    font-size: 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--input-bg);
    color: var(--text);
    max-width: 100%;
}

.sub-nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.genealogy-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.species-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.species-check-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.species-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 400;
    cursor: pointer;
}

.species-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.qr-box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #FFFFFF;
    max-width: 100%;
}

.qr-box svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.qr-badge-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 12px;
}

.cal-day-btn {
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.cal-day-btn.selected {
    border-color: var(--green);
    background: var(--selected-bg);
    box-shadow: inset 0 0 0 1px var(--green);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ============================================================
   Site vitrine (page d'accueil publique, surtout sur ordinateur)
   Grande photo en haut, montages de photos, bande photo pleine largeur,
   avantages avec icônes en carrés verts. Palette de 10 couleurs.
   ============================================================ */
html {
    scroll-behavior: smooth;
}

@keyframes panelFadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-page {
    --bg: #07110C;
    --lp-alt: #0E1B14;
    --lp-card: #14251C;
    --surface: #0E1B14;
    --surface-subtle: #14251C;
    --text: #F6F8F5;
    --text-muted: #8FA398;
    --green: #19B36B;
    --green-hover: #22C97B;
    --green-pale: #0F3F27;
    --btn-primary-text: #07110C;
    --border: #1E3529;
    --lp-danger: #F87171;
    background: var(--bg);
    color: var(--text);
}

html[data-theme="light"] .landing-page {
    --bg: #FFFFFF;
    --lp-alt: #F6F8F5;
    --lp-card: #FFFFFF;
    --surface: #FFFFFF;
    --surface-subtle: #EAF0EC;
    --text: #07110C;
    --text-muted: #52635A;
    --green: #0E7A48;
    --green-hover: #0B6338;
    --green-pale: #D3F0E0;
    --btn-primary-text: #FFFFFF;
    --border: #D2DDD6;
    --lp-danger: #B42318;
}

.landing-page section[id] {
    scroll-margin-top: 64px;
}

/* Rien ne doit élargir la page : un élément qui dépasse sur le côté est coupé ici
   (« clip » ne crée pas de zone de défilement ; « hidden » pour les anciens Safari). */
.landing-page main {
    overflow-x: hidden;
    overflow-x: clip;
}

.landing-container {
    width: 100%;
    max-width: 1248px;
    margin: 0 auto;
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
}

.scroll-progress {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--green);
    z-index: 60;
    transition: width .08s linear;
    pointer-events: none;
}

/* En-tête : transparent sur la photo, plein dès que l'on fait défiler. */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding-top: env(safe-area-inset-top, 0px);
    background: transparent;
    color: #FFFFFF;
    transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}

.landing-nav.scrolled,
.landing-nav.menu-open {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
}

.landing-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
}

.landing-brand {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.landing-nav .suivel-wordmark {
    color: currentColor;
}

.landing-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.landing-links a {
    position: relative;
    padding: 10px 0;
    color: inherit;
    opacity: .85;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s ease, color .2s ease;
}

.landing-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}

.landing-links a:hover,
.landing-links a.active {
    opacity: 1;
}

.landing-links a:hover::after,
.landing-links a.active::after {
    transform: scaleX(1);
}

.landing-nav.scrolled .landing-links a.active {
    color: var(--green);
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: inherit;
}

.landing-nav.scrolled .landing-menu-btn,
.landing-nav.menu-open .landing-menu-btn {
    border-color: var(--border);
}

.landing-nav .btn-secondary {
    background: transparent;
    color: inherit;
    border-color: rgba(255, 255, 255, 0.6);
}

.landing-nav .btn-secondary:hover {
    background: #FFFFFF;
    color: #07110C;
    border-color: #FFFFFF;
}

.landing-nav.scrolled .btn-secondary,
.landing-nav.menu-open .btn-secondary {
    border-color: var(--border);
}

.landing-nav.scrolled .btn-secondary:hover,
.landing-nav.menu-open .btn-secondary:hover {
    background: var(--surface-subtle);
    color: var(--text);
    border-color: var(--surface-subtle);
}

.landing-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.landing-mobile-menu {
    display: none;
    background: var(--bg);
    color: var(--text);
    border-top: 1px solid var(--border);
}

.landing-mobile-menu.open {
    display: block;
    animation: panelFadeSlide .2s ease;
}

.landing-mobile-links {
    display: flex;
    flex-direction: column;
    padding: 4px max(24px, env(safe-area-inset-left, 0px));
}

.landing-mobile-links a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.landing-mobile-links a:hover {
    color: var(--green);
}

.landing-mobile-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px max(24px, env(safe-area-inset-left, 0px)) 20px;
}

.landing-mobile-cta .btn-secondary {
    background: var(--surface-subtle);
    color: var(--text);
    border-color: transparent;
}

.btn-lg {
    min-height: 54px;
    padding: 0 28px;
    font-size: 16px;
}

/* Bouton posé sur une photo ou sur le bloc vert. */
.btn-on-photo {
    background: transparent;
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.75);
}

.btn-on-photo:hover {
    background: #FFFFFF;
    color: #07110C;
    border-color: #FFFFFF;
}

.btn-on-green {
    background: #FFFFFF;
    color: #07110C;
}

.btn-on-green:hover {
    background: #EAF0EC;
    color: #07110C;
}

/* Message (déconnexion…) : flotte sous l'en-tête. */
.landing-status-banner {
    position: fixed;
    top: calc(88px + env(safe-area-inset-top, 0px));
    left: 50%;
    z-index: 55;
    width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 8px 18px;
    border-radius: 16px;
    background: #07110C;
    color: #F6F8F5;
    font-size: 15px;
    font-weight: 600;
    animation: panelFadeSlide .3s ease;
}

.landing-status-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.landing-status-text svg {
    flex-shrink: 0;
    color: #19B36B;
}

.landing-status-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.landing-status-close:hover {
    background: #14251C;
}

/* 1. Grande photo d'accueil */
.landing-hero {
    position: relative;
    display: flex;
    align-items: center;
    /* Toute la hauteur de l'écran : la section suivante ne dépasse plus en bande sous la photo. */
    min-height: max(620px, 100vh);
    min-height: max(620px, 100svh);
    padding: calc(120px + env(safe-area-inset-top, 0px)) 0 110px;
    overflow: hidden;
    isolation: isolate;
    background: #07110C;
    color: #FFFFFF;
}

.landing-hero-photo,
.landing-band-photo {
    position: absolute;
    left: 0;
    width: 100%;
    object-fit: cover;
    z-index: -2;
    will-change: transform;
}

.landing-hero-photo {
    top: -8%;
    height: 116%;
    object-position: 50% 60%;
}

.landing-hero::after,
.landing-band::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(7, 17, 12, 0.58);
}

.landing-hero-kicker,
.landing-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 700;
}

.landing-hero-kicker::before,
.landing-kicker::before {
    content: "";
    width: 32px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.landing-hero-kicker {
    color: rgba(255, 255, 255, 0.9);
}

.landing-hero-title {
    margin: 0;
    max-width: 860px;
    font-size: clamp(40px, 5.6vw, 76px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    text-wrap: balance;
}

.landing-hero-text {
    margin: 24px 0 0;
    max-width: 580px;
    font-size: 19px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.landing-hero-note {
    margin: 20px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.landing-hero-scroll {
    position: absolute;
    left: 50%;
    bottom: 28px;
    width: 48px;
    height: 48px;
    margin-left: -24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease, color .2s ease;
}

.landing-hero-scroll:hover {
    background: #FFFFFF;
    color: #07110C;
}

/* Sections */
.landing-section {
    padding: 112px 0;
    background: var(--bg);
}

.landing-section-alt {
    background: var(--lp-alt);
}

.landing-section-head {
    max-width: 660px;
    margin-bottom: 48px;
}

.landing-kicker {
    color: var(--green);
}

.landing-h2 {
    margin: 0;
    font-size: clamp(30px, 3.5vw, 48px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-wrap: balance;
}

.landing-lead {
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-muted);
}

/* 2. SUIVEL en bref : texte et chiffres, montage photo, points forts */
.landing-about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: center;
}

.landing-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
    margin: 36px 0 38px;
}

.landing-stat strong {
    display: block;
    font-size: 40px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.landing-stat span {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-muted);
}

.landing-collage {
    position: relative;
    min-height: 560px;
}

.landing-collage img {
    display: block;
    object-fit: cover;
    border-radius: 20px;
    background: var(--surface-subtle);
}

.landing-collage .collage-small {
    border: 8px solid var(--bg);
    border-radius: 28px;
}

.landing-collage-about .collage-main {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    height: 84%;
}

.landing-collage-about .collage-small {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 54%;
    height: 44%;
}

.collage-card {
    position: absolute;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 240px;
    padding: 16px 18px;
    border-radius: 18px;
}

.collage-card svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.collage-card strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
}

.collage-card span {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.4;
    opacity: .9;
}

.collage-card-green {
    right: -12px;
    bottom: 22%;
    background: #0E7A48;
    color: #FFFFFF;
}

.collage-card-light {
    background: var(--lp-card);
    color: var(--text);
    box-shadow: 0 14px 34px rgba(7, 17, 12, 0.16);
}

.collage-card-light svg {
    color: var(--green);
}

.landing-about-side h3 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
}

.landing-about-side p {
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted);
}

.landing-checks {
    list-style: none;
    display: grid;
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
}

.landing-checks li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
}

.landing-checks svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--green);
}

/* 3. Espèces */
.species-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.species-pill {
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.species-pill:hover {
    border-color: var(--green);
    color: var(--green);
}

.species-pill.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--btn-primary-text);
}

.species-explorer-panel {
    padding: 36px 40px 40px;
    border-radius: 24px;
    background: var(--lp-card);
}

.species-explorer-panel.is-switching {
    animation: speciesSwitchIn .32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes speciesSwitchIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.species-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.species-panel-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.species-panel-sub {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--text-muted);
}

.species-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.species-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.species-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F2A93B;
}

#sp-block-tag::before {
    background: var(--lp-danger);
}

.species-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.species-metric-box {
    padding: 26px 24px 26px 0;
}

.species-metric-box + .species-metric-box {
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.species-metric-lbl {
    font-size: 14px;
    color: var(--text-muted);
}

.species-metric-val {
    margin-top: 6px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.species-timeline-title {
    margin: 0 0 20px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.species-timeline {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 16px;
}

.species-stage {
    position: relative;
    padding-top: 34px;
}

.species-stage::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 0;
    right: -16px;
    height: 2px;
    background: var(--border);
}

.species-stage:last-child::before {
    right: 0;
}

.species-stage::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--green);
    background: var(--lp-card);
    box-sizing: border-box;
}

.species-stage:first-child::after {
    background: var(--green);
}

.species-stage-day {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--green);
}

.species-stage-name {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.species-stage-note {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-muted);
}

/* 4. Bande photo pleine largeur */
.landing-band {
    position: relative;
    padding: 156px 0;
    overflow: hidden;
    isolation: isolate;
    background: #07110C;
    color: #FFFFFF;
    text-align: center;
}

.landing-band-photo {
    top: -14%;
    height: 128%;
}

.landing-band::after {
    background: rgba(7, 17, 12, 0.6);
}

.landing-band-inner {
    max-width: 880px;
}

.landing-band .landing-kicker {
    color: rgba(255, 255, 255, 0.9);
}

.landing-band-title {
    margin: 0;
    font-size: clamp(32px, 4.4vw, 58px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #FFFFFF;
    text-wrap: balance;
}

.landing-band-text {
    margin: 22px auto 0;
    max-width: 620px;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.landing-band .btn {
    margin-top: 34px;
}

/* 5. Fonctionnalités : montage photo et liste d'avantages */
.landing-why-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 72px;
    align-items: center;
}

.landing-collage-why {
    min-height: 640px;
}

.landing-collage-why .collage-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 76%;
    height: 100%;
}

.landing-collage-why .collage-small {
    position: absolute;
    right: 0;
    bottom: 10%;
    width: 46%;
    height: 40%;
}

.collage-card-top {
    top: 9%;
    right: 2%;
}

.collage-card-bottom {
    left: 6%;
    bottom: 5%;
}

.landing-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 30px;
    margin: 44px 0 0;
    padding: 0;
}

.landing-features li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.landing-feature-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--green);
    color: var(--btn-primary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease, transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-features li:hover .landing-feature-icon {
    background: var(--green-hover);
    transform: rotate(-8deg);
}

.landing-features h3 {
    margin: 3px 0 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}

.landing-features p {
    margin: 6px 0 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* 6. Démarrage en 3 étapes */
.landing-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin: 0;
    padding: 0;
}

.landing-steps li {
    position: relative;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.landing-steps li::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    width: 64px;
    height: 2px;
    background: var(--green);
}

.landing-step-num {
    display: block;
    font-size: 60px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--green);
}

.landing-steps h3 {
    margin: 20px 0 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.landing-steps p {
    margin: 8px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* 7. Tarifs */
.billing-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

.billing-bar .landing-section-head {
    margin-bottom: 0;
}

.billing-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface-subtle);
}

.billing-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.billing-opt.active {
    background: var(--green);
    color: var(--btn-primary-text);
}

.billing-save-pill {
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
}

.billing-opt.active .billing-save-pill {
    color: inherit;
}

.calc-box {
    margin-bottom: 28px;
    padding: 28px 32px;
    border-radius: 24px;
    background: var(--lp-alt);
}

.calc-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.calc-title {
    display: block;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
}

.calc-hint {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    color: var(--text-muted);
}

.calc-count {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.calc-count span {
    color: var(--green);
}

.calc-slider {
    display: block;
    width: 100%;
    height: 32px;
    margin: 18px 0;
    accent-color: var(--green);
    cursor: pointer;
}

.calc-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-muted);
}

.calc-summary strong {
    color: var(--text);
}

.landing-tiers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.tier-card {
    display: flex;
    flex-direction: column;
    padding: 32px;
    border-radius: 24px;
    background: var(--lp-alt);
    box-shadow: inset 0 0 0 2px transparent;
    transition: box-shadow .25s ease;
}

.tier-card.tier-recommended {
    box-shadow: inset 0 0 0 2px var(--green);
}

.tier-badge-rec {
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
}

.tier-card h3 {
    margin: 10px 0 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.tier-range {
    margin: 4px 0 0;
    font-size: 15px;
    color: var(--text-muted);
}

.tier-price {
    margin-top: 24px;
    font-size: 38px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.tier-period {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.tier-included {
    margin: 24px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.tier-list {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.tier-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
}

.tier-check {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--green);
}

.tier-cta {
    margin-top: auto;
    padding-top: 28px;
}

.tier-cta .btn {
    width: 100%;
}

.tier-note {
    max-width: 780px;
    margin: 32px auto 0;
    text-align: center;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
}

.tier-note strong {
    color: var(--text);
}

/* 8. Questions */
.landing-faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 72px;
    align-items: start;
}

.landing-faq-grid .landing-section-head {
    margin-bottom: 0;
}

.landing-faq-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.landing-faq-link:hover {
    text-decoration: underline;
}

.faq-list {
    border-top: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0;
    list-style: none;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: color .2s ease;
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary:hover {
    color: var(--green);
}

.faq-chevron {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 10px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text);
    transition: transform .25s ease, background-color .2s ease, color .2s ease;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    background: var(--green);
    color: var(--btn-primary-text);
}

.faq-body {
    margin: 0;
    padding: 0 56px 24px 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted);
}

.faq-item[open] .faq-body {
    animation: panelFadeSlide .25s ease;
}

/* 9. Dernier appel : bloc vert avec photo */
.landing-cta {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    overflow: hidden;
    border-radius: 28px;
    background: #0E7A48;
    color: #FFFFFF;
}

.landing-cta-text {
    padding: 64px;
}

.landing-cta-title {
    margin: 0;
    font-size: clamp(30px, 3.4vw, 46px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.landing-cta-sub {
    margin: 14px 0 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.88);
}

.landing-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.landing-cta-photo {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
}

/* Pied de page : encre dans les deux modes. */
.landing-footer {
    padding: 72px 0 calc(32px + env(safe-area-inset-bottom, 0px));
    background: #07110C;
    color: #F6F8F5;
    border-top: 1px solid #1E3529;
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.landing-footer .suivel-wordmark {
    color: #F6F8F5;
}

.landing-footer .suivel-tagline {
    color: #8FA398;
}

.landing-footer-about {
    margin: 18px 0 0;
    max-width: 330px;
    font-size: 15px;
    line-height: 1.6;
    color: #8FA398;
}

.landing-footer-col h2 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #F6F8F5;
}

.landing-footer-col a {
    display: block;
    padding: 7px 0;
    font-size: 15px;
    color: #8FA398;
    text-decoration: none;
    transition: color .2s ease;
}

.landing-footer-col a:hover {
    color: #FFFFFF;
}

.landing-footer-bottom {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid #1E3529;
    font-size: 14px;
    color: #8FA398;
}

.scroll-top-btn {
    position: fixed;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--green);
    color: var(--btn-primary-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, background-color .16s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: var(--green-hover);
}

/* Animations : entrée du titre, apparition au défilement, montages qui se dévoilent. */
@media (prefers-reduced-motion: no-preference) {
    .js-ready .hero-stagger {
        opacity: 0;
        transform: translate3d(0, 24px, 0);
        transition: opacity .7s cubic-bezier(0.22, 1, 0.36, 1), transform .8s cubic-bezier(0.22, 1, 0.36, 1);
    }

    html.hero-entered .hero-stagger {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    html.hero-entered .hero-stagger-1 { transition-delay: 80ms; }
    html.hero-entered .hero-stagger-2 { transition-delay: 180ms; }
    html.hero-entered .hero-stagger-3 { transition-delay: 300ms; }
    html.hero-entered .hero-stagger-4 { transition-delay: 420ms; }
    html.hero-entered .hero-stagger-5 { transition-delay: 540ms; }

    /* Rejoué à chaque retour en haut de page : le script retire puis remet hero-entered. */
    html.hero-entered .landing-hero-photo {
        animation: suivelHeroZoom 9s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .landing-hero-scroll {
        animation: suivelNudge 2.4s ease-in-out 1.6s infinite;
    }

    .js-ready .reveal {
        opacity: 0;
        transform: translate3d(0, 32px, 0);
        transition: opacity .7s cubic-bezier(0.22, 1, 0.36, 1), transform .8s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .js-ready .reveal.reveal-left {
        transform: translate3d(-40px, 0, 0);
    }

    .js-ready .reveal.reveal-right {
        transform: translate3d(40px, 0, 0);
    }

    /* Téléphone et tablette : apparition par le bas. Un bloc décalé sur le côté élargissait la page,
       qui bougeait alors de gauche à droite sous le doigt. */
    @media (max-width: 900px) {
        .js-ready .reveal.reveal-left:not(.is-visible),
        .js-ready .reveal.reveal-right:not(.is-visible) {
            transform: translate3d(0, 32px, 0);
        }
    }

    .js-ready .reveal.reveal-delay-1 { transition-delay: .1s; }
    .js-ready .reveal.reveal-delay-2 { transition-delay: .2s; }
    .js-ready .reveal.reveal-delay-3 { transition-delay: .3s; }

    .js-ready .reveal.is-visible {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    /* Le montage reste visible ; ses pièces arrivent l'une après l'autre. */
    .js-ready .reveal.landing-collage {
        opacity: 1;
        transform: none;
    }

    .js-ready .landing-collage .collage-main {
        clip-path: inset(0 0 100% 0 round 20px);
        transition: clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .js-ready .landing-collage .collage-small {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
        transition: opacity .7s ease .45s, transform .9s cubic-bezier(0.22, 1, 0.36, 1) .45s;
    }

    .js-ready .landing-collage .collage-card {
        opacity: 0;
        transform: translate3d(0, 18px, 0) scale(.94);
        transition: opacity .6s ease .8s, transform .7s cubic-bezier(0.34, 1.56, 0.64, 1) .8s;
    }

    .js-ready .landing-collage .collage-card-bottom {
        transition-delay: 1s;
    }

    .js-ready .landing-collage.is-visible .collage-main {
        clip-path: inset(0 0 0 0 round 20px);
    }

    .js-ready .landing-collage.is-visible .collage-small,
    .js-ready .landing-collage.is-visible .collage-card {
        opacity: 1;
        transform: none;
    }

    .landing-collage.is-visible .collage-card-green,
    .landing-collage.is-visible .collage-card-top {
        animation: suivelFloat 6s ease-in-out 2s infinite;
    }

    .landing-collage.is-visible .collage-card-bottom {
        animation: suivelFloat 7s ease-in-out 2.6s infinite reverse;
    }

    /* La ligne verte de chaque étape se remplit à l'apparition. */
    .js-ready .landing-steps li::before {
        transition: width 1s cubic-bezier(0.22, 1, 0.36, 1) .3s;
    }

    .js-ready .landing-steps li.is-visible::before {
        width: 100%;
    }
}

@keyframes suivelHeroZoom {
    from {
        scale: 1.14;
    }
    to {
        scale: 1;
    }
}

@keyframes suivelFloat {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 -10px;
    }
}

@keyframes suivelNudge {
    0%,
    100% {
        translate: 0 0;
    }
    50% {
        translate: 0 8px;
    }
}

/* Vitrine sur écran moyen */
@media (max-width: 1100px) {
    .landing-links {
        display: none;
    }

    .landing-menu-btn {
        display: inline-flex;
        flex-shrink: 0;
    }

    .landing-nav-actions .btn {
        white-space: nowrap;
    }

    .landing-about-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .landing-about-side {
        grid-column: 1 / -1;
        max-width: 720px;
    }

    .landing-why-grid {
        gap: 48px;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }
}

/* Vitrine sur tablette, ou téléphone couché */
@media (max-width: 900px), (max-height: 500px) and (pointer: coarse) {
    .landing-nav-inner {
        flex-wrap: nowrap;
        min-height: 64px;
        gap: 12px;
    }

    .landing-links,
    .landing-nav-actions .btn-secondary {
        display: none;
    }

    .landing-menu-btn {
        display: inline-flex;
        flex-shrink: 0;
    }

    .landing-nav-actions .btn-primary {
        min-height: 44px;
        padding: 0 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .landing-hero {
        min-height: max(560px, 100vh);
        min-height: max(560px, 100svh);
        padding: calc(104px + env(safe-area-inset-top, 0px)) 0 96px;
    }

    .landing-section {
        padding: 76px 0;
    }

    .landing-section-head {
        margin-bottom: 32px;
    }

    .landing-about-grid,
    .landing-why-grid,
    .landing-faq-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
    }

    .landing-collage {
        width: 100%;
        max-width: 560px;
        min-height: 480px;
        justify-self: center;
    }

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

    .species-timeline {
        grid-auto-flow: row;
        gap: 0;
    }

    .species-stage {
        padding: 0 0 20px 30px;
    }

    .species-stage::before {
        top: 16px;
        bottom: 0;
        left: 6px;
        right: auto;
        width: 2px;
        height: auto;
    }

    .species-stage:last-child::before {
        display: none;
    }

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

    .species-metric-box:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .species-metric-box:nth-child(n + 3) {
        border-top: 1px solid var(--border);
    }

    .landing-band {
        padding: 112px 0;
    }

    .landing-steps,
    .landing-tiers {
        grid-template-columns: minmax(0, 1fr);
    }

    .landing-tiers {
        max-width: 560px;
    }

    .landing-cta {
        grid-template-columns: minmax(0, 1fr);
    }

    .landing-cta-text {
        padding: 44px 36px;
    }

    .landing-cta-photo {
        min-height: 220px;
        max-height: 280px;
    }

    .landing-footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .landing-footer-brand {
        grid-column: 1 / -1;
    }
}

/* Vitrine sur téléphone (sous l'écran de bienvenue) */
@media (max-width: 600px) {
    .landing-container {
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }

    .landing-section {
        padding: 56px 0;
    }

    .landing-h2 {
        font-size: 30px;
    }

    .landing-stats {
        gap: 22px 16px;
        margin: 28px 0 30px;
    }

    .landing-stat strong {
        font-size: 32px;
    }

    .landing-collage {
        min-height: 400px;
    }

    .collage-card {
        max-width: 210px;
        padding: 12px 14px;
    }

    .collage-card-green {
        right: 0;
    }

    .landing-features {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }

    .species-explorer-panel {
        padding: 24px 18px 26px;
    }

    .species-metric-box,
    .species-metric-box + .species-metric-box {
        padding: 18px 12px 18px 0;
    }

    .species-metric-box:nth-child(even) {
        padding-left: 14px;
    }

    .species-metric-val {
        font-size: 21px;
    }

    .landing-band {
        padding: 88px 0;
    }

    .landing-band-text {
        font-size: 16px;
    }

    .billing-switch {
        width: 100%;
    }

    .billing-opt {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0 14px;
        white-space: nowrap;
    }

    .calc-box,
    .tier-card {
        padding: 24px 20px;
    }

    .faq-summary {
        padding: 20px 0;
        font-size: 16px;
    }

    .faq-body {
        padding-right: 0;
    }

    .landing-cta {
        border-radius: 24px;
    }

    .landing-cta-text {
        padding: 32px 22px;
    }

    .landing-cta-actions .btn {
        flex: 1 1 100%;
    }

    .landing-footer {
        padding: 48px 0 calc(74px + env(safe-area-inset-bottom, 0px));
    }

    .landing-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }

    .landing-footer-bottom {
        margin-top: 36px;
    }
}

/* Wave 3 : Mot de passe, Toasts, Modale hors ligne, Graphiques & Abonnement */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle-btn {
    position: absolute;
    right: 4px;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.password-toggle-btn:hover {
    color: var(--green);
    background: var(--green-pale);
}

.sync-badge-btn {
    border: 0;
    font-family: inherit;
    cursor: pointer;
    min-height: 36px;
    white-space: nowrap;
    transition: filter .15s ease;
}

.sync-badge-btn:hover {
    filter: brightness(0.95);
}

.toast-container {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100vw - 32px);
    pointer-events: none;
}

/* Messages en bas d'écran : toujours à l'encre ; le rouge seulement pour un échec. */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #07110C;
    color: #F6F8F5;
    border: 1px solid #1E3529;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 12px 28px rgba(7, 17, 12, 0.25);
    animation: panelFadeSlide .2s ease;
}

.toast-ok,
.toast-warn {
    background: #07110C;
}

.toast-danger {
    background: #B42318;
    border-color: #B42318;
}

.toast-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 17, 12, 0.65);
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}

.modal-backdrop.open {
    display: flex;
}

.modal-dialog {
    background: var(--surface);
    color: var(--text);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 22px 50px rgba(7, 17, 12, 0.35);
}

.chart-card-svg {
    width: 100%;
    max-height: 190px;
    height: auto;
    display: block;
}

.stacked-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--track-bg);
    margin: 10px 0 12px;
}

.stacked-seg {
    height: 100%;
    min-width: 3px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

.trial-meter-box {
    background: var(--surface-subtle);
    border: 0;
    border-radius: 16px;
    padding: 12px 15px;
    margin-bottom: 12px;
}

/* Mode clair commutable sur les écrans invités */
html[data-theme="light"] body.guest-page {
    background: #F6F8F5;
    color: #07110C;
    --bg: #F6F8F5;
    --surface: #FFFFFF;
    --surface-subtle: #EAF0EC;
    --input-bg: #FFFFFF;
    --neutral-bg: #EAF0EC;
    --text: #07110C;
    --text-muted: #52635A;
    --green: #0E7A48;
    --green-accent: #0E7A48;
    --green-hover: #0B6139;
    --green-pale: #D3F0E0;
    --btn-primary-text: #FFFFFF;
    --border: #D2DDD6;
    --input-border: #8DA095;
    --danger: #B42318;
    --danger-bg: #FFFFFF;
    --danger-border: #D2DDD6;
    --warn: #8A5300;
    --warn-bg: #FFFFFF;
    --warn-border: #D2DDD6;
}

html[data-theme="light"] .auth-wrapper {
    background: #F6F8F5;
}

html[data-theme="light"] .auth-card {
    background: #FFFFFF;
    border-color: #D2DDD6;
    box-shadow: 0 12px 32px rgba(7, 17, 12, 0.08);
}

/* Ordinateur et tablette : photo de ferme plein écran derrière le formulaire de connexion.
   Le téléphone garde sa photo en bandeau et sa feuille blanche (voir le bloc « max-width: 600px »). */
.auth-backdrop {
    display: none;
}

@media (min-width: 601px) {
    .auth-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 0;
        overflow: hidden;
        background: #07110C;
    }

    .auth-backdrop img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: var(--auth-focus, 50% 50%);
        display: block;
    }

    /* Voile uni : la carte ressort sur n'importe quelle photo. */
    .auth-backdrop::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(7, 17, 12, 0.42);
    }

    .guest-page .auth-wrapper,
    html[data-theme="light"] .guest-page .auth-wrapper {
        position: relative;
        z-index: 1;
        background: transparent;
    }

    /* Carte presque opaque : la photo transparaît à peine, floutée. */
    .guest-page .auth-card {
        background: rgba(14, 27, 20, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
        border-radius: 24px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
        -webkit-backdrop-filter: blur(18px) saturate(1.2);
        backdrop-filter: blur(18px) saturate(1.2);
    }

    html[data-theme="light"] .guest-page .auth-card {
        background: rgba(255, 255, 255, 0.93);
        border-color: rgba(255, 255, 255, 0.7);
        box-shadow: 0 24px 60px rgba(7, 17, 12, 0.35);
    }
}

/* Mise en page mobile : écrans étroits, ou téléphone tactile en paysage (peu de hauteur),
   même large — sinon un grand iPhone/Android couché recevait la mise en page ordinateur. */
@media (max-width: 900px), (max-height: 500px) and (pointer: coarse) {
    .toast-container {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
        left: calc(12px + env(safe-area-inset-left, 0px));
        width: auto;
        max-width: none;
    }
    .bottom-nav {
        display: flex;
    }

    .topbar {
        padding: calc(8px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
        flex-wrap: nowrap;
        gap: 8px;
    }

    .topbar-left, .topbar-right {
        gap: 8px;
        flex-wrap: nowrap;
    }

    /* Le sélecteur de ferme cède la place : c'est lui qui rétrécit, jamais la page. */
    .topbar-left {
        flex: 0 1 auto;
        min-width: 0;
    }

    .topbar-right {
        flex: 0 0 auto;
    }

    .topbar-hide-mobile {
        display: none !important;
    }

    .topbar-logo {
        display: inline-flex;
    }

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

    /* Menu Plus : bandes pleine largeur sur téléphone, comme les réglages du téléphone. */
    .plus-page .menu-group {
        border-radius: 0;
        margin-left: calc(-12px - env(safe-area-inset-left, 0px));
        margin-right: calc(-12px - env(safe-area-inset-right, 0px));
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .topbar-farm-select {
        max-width: min(100%, 220px);
        min-width: 0;
        /* 16 px minimum : en dessous, iOS zoome automatiquement au toucher du champ. */
        font-size: 17px;
    }

    .content {
        /* Côtés protégés : en paysage, l'encoche / la Dynamic Island / la caméra passent à gauche ou à droite. */
        padding: 14px calc(12px + env(safe-area-inset-right, 0px)) calc(92px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
    }

    .hero-banner {
        padding: 18px 16px;
    }

    .hero-banner h1 {
        font-size: 22px;
    }

    /* minmax(0, 1fr) et non 1fr : sinon un contenu large (champ fichier, tableau)
       élargit la colonne au-delà de l'écran. */
    .daily-top-grid,
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .kpi-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .genealogy-row-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .cal-day {
        min-height: 50px;
        padding: 4px;
    }

    .calendar-month-grid {
        gap: 4px;
    }

    .desktop-table-only {
        display: none;
    }

    .compact-list {
        display: flex;
    }
}

@media (max-width: 600px) {
    .inline-form input,
    .inline-form select {
        flex: 1 1 130px;
        min-width: 0;
    }

    .kpi-card {
        padding: 14px 12px;
    }

    .kpi-value {
        font-size: 20px;
    }

    /* Déconnexion en icône seule : le libellé reste annoncé via aria-label. */
    .topbar-logout-label {
        display: none;
    }

    .topbar-logout-btn {
        width: 44px;
        padding: 0;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .landing-nav-actions .btn {
        display: none;
    }

    .landing-mobile-cta {
        grid-template-columns: 1fr;
    }

    .species-check-grid,
    .species-check-grid-2 {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 22px;
    }
}

/* ============================================================
   Écrans « application » sur téléphone : accueil et connexion.
   Photo de ferme en haut, logo dans un rond blanc, feuille au bord arrondi.
   ============================================================ */
.app-welcome,
.auth-hero {
    display: none;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 15px;
}

.auth-forgot {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: 14px;
    font-weight: 600;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 15px;
    cursor: pointer;
}

.auth-remember input {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    font-size: 16px;
}

.auth-switch {
    margin: 20px 0 0;
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
}

.auth-switch a {
    font-weight: 700;
}

.landing-page {
    --welcome-sheet: #07110C;
    --welcome-ink: #F6F8F5;
    --welcome-muted: #8FA398;
    --welcome-line: #2C4C3B;
    --welcome-accent: #2FD487;
}

html[data-theme="light"] .landing-page {
    --welcome-sheet: #FFFFFF;
    --welcome-ink: #07110C;
    --welcome-muted: #52635A;
    --welcome-line: #D2DDD6;
    --welcome-accent: #0E7A48;
}

@media (max-width: 600px) {
    /* Accueil : l'écran de bienvenue remplace l'en-tête et le grand titre du site. */
    .landing-page .app-welcome {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        background: var(--welcome-sheet);
    }

    .landing-page .landing-nav,
    .landing-page .scroll-progress,
    .landing-page .landing-status-banner,
    .landing-page main > .landing-hero:first-of-type {
        display: none;
    }

    /* La photo prend la place que laisse la feuille : tout l'écran de bienvenue tient sur l'écran,
       « Découvrir SUIVEL » compris (avant, il passait sous la barre d'accueil de l'iPhone). */
    .app-welcome-photo {
        position: relative;
        flex: 1 1 240px;
        min-height: 240px;
        max-height: 520px;
        overflow: hidden;
        background: #07110C;
    }

    .app-welcome-photo img {
        position: absolute;
        inset: 0;
    }


    .app-welcome-photo img,
    .auth-hero img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 62% 45%;
        display: block;
    }

    /* Voile uni (pas de dégradé) pour que le texte blanc reste lisible sur la photo. */
    .app-welcome-photo::after,
    .auth-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(7, 17, 12, 0.32);
    }

    .app-welcome-brand {
        position: absolute;
        inset: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: env(safe-area-inset-top, 0px) 24px 44px;
        color: #FFFFFF;
        text-align: center;
    }

    .app-welcome-badge,
    .auth-hero-badge {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: #FFFFFF;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 24px rgba(7, 17, 12, 0.25);
        margin-bottom: 6px;
    }

    .app-welcome-name {
        font-size: 28px;
        font-weight: 800;
        letter-spacing: 0.2em;
        padding-left: 0.2em;
        line-height: 1.1;
    }

    .app-welcome-tagline {
        font-size: 16px;
        font-weight: 600;
    }

    .app-welcome-sheet {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        margin-top: -40px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 34px max(24px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
        background: var(--welcome-sheet);
        border-radius: 50% 50% 0 0 / 40px 40px 0 0;
        text-align: center;
    }

    .app-welcome-title {
        margin: 0;
        font-size: 30px;
        line-height: 1.15;
        font-weight: 800;
        letter-spacing: -0.01em;
        color: var(--welcome-ink);
    }

    .app-welcome-text {
        margin: 0 0 10px;
        font-size: 16px;
        line-height: 1.5;
        color: var(--welcome-muted);
    }

    .landing-page .app-welcome-btn {
        width: 100%;
        min-height: 54px;
        font-size: 16px;
    }

    .landing-page .app-welcome-btn-outline {
        background: transparent;
        color: var(--welcome-ink);
        border: 1.5px solid var(--welcome-line);
    }

    .app-welcome-trial {
        margin: 2px 0 0;
        font-size: 14px;
        color: var(--welcome-muted);
    }

    .app-welcome-more {
        margin-top: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 44px;
        font-size: 15px;
        font-weight: 700;
        color: var(--welcome-accent);
        text-decoration: none;
    }

    /* Petits téléphones (Android d'entrée de gamme, barre d'adresse de Chrome affichée) :
       feuille plus compacte pour que tout l'écran de bienvenue tienne. */
    @media (max-height: 680px) {
        .app-welcome-photo {
            flex-basis: 200px;
            min-height: 200px;
        }

        .app-welcome-brand .app-welcome-badge {
            width: 64px;
            height: 64px;
        }

        .app-welcome-sheet {
            gap: 10px;
            padding-top: 28px;
        }

        .app-welcome-title {
            font-size: 26px;
        }

        .app-welcome-text {
            margin-bottom: 4px;
            font-size: 15px;
        }

        .landing-page .app-welcome-btn {
            min-height: 50px;
        }
    }

    /* Connexion, inscription, mot de passe : même photo en bandeau, formulaire sur une feuille. */
    .guest-page .auth-wrapper {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
        background: var(--bg);
    }

    .guest-page .auth-hero {
        display: block;
        position: relative;
        height: 30vh;
        min-height: 200px;
        max-height: 280px;
        overflow: hidden;
        background: #07110C;
    }

    .auth-hero-badge {
        position: absolute;
        left: 50%;
        bottom: 46px;
        z-index: 1;
        transform: translateX(-50%);
        width: 76px;
        height: 76px;
    }

    .guest-page .auth-card {
        position: relative;
        z-index: 2;
        max-width: none;
        margin-top: -30px;
        padding: 30px max(20px, env(safe-area-inset-left, 0px)) calc(28px + env(safe-area-inset-bottom, 0px));
        border: 0;
        border-radius: 50% 50% 0 0 / 30px 30px 0 0;
        background: var(--bg);
        box-shadow: none;
    }

    .guest-page .auth-brand-row {
        display: none !important;
    }

    /* Mode clair : la feuille et le fond ne font qu'un (pas de bande grise sous le formulaire). */
    html[data-theme="light"] body.guest-page,
    html[data-theme="light"] .guest-page .auth-wrapper,
    html[data-theme="light"] .guest-page .auth-card {
        background: #FFFFFF;
    }

    /* Cadrage : la chèvre à gauche, la poule à droite, le logo entre les deux. */
    .app-welcome-photo img {
        object-position: 96% 50%;
    }

    .guest-page .field input,
    .guest-page .field select {
        min-height: 52px;
        border-radius: 14px;
    }
}

/* ============================================================
   Recherche globale (option 2) : gélule dans l'en-tête, Ctrl K, fenêtre de résultats,
   page Recherche ; tableau du cheptel avec panneau de détail sur grand écran.
   ============================================================ */
.topbar-search {
    flex: 0 1 380px;
    min-width: 220px;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 16px;
    border-radius: 22px;
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-search:hover {
    box-shadow: inset 0 0 0 1px var(--border);
}

.topbar-search:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.topbar-search svg {
    flex-shrink: 0;
}

.topbar-search-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search-kbd {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
}

/* Fenêtre de recherche */
/* Seul html est bloqué : bloquer aussi body ferait perdre sa place à l'en-tête collant. */
html.search-open {
    overflow: hidden;
}

.search-palette {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: calc(10vh + env(safe-area-inset-top, 0px)) 16px 16px;
}

.search-palette[hidden] {
    display: none;
}

.search-palette-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 17, 12, 0.55);
}

.search-palette-dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: min(560px, 80vh);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 60px rgba(7, 17, 12, 0.28);
    overflow: hidden;
}

.search-palette-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.search-palette-form svg {
    flex-shrink: 0;
}

.search-palette-form input[type="search"],
.search-field input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-family: inherit;
    font-size: 17px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.search-palette-form input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-palette-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.search-palette-close:hover {
    background: var(--surface-subtle);
    color: var(--text);
}

.search-palette-close svg {
    display: none;
}

.search-palette-results {
    overflow-y: auto;
    padding: 4px 8px 8px;
    overscroll-behavior: contain;
}

.search-palette-results:empty {
    display: none;
}

.search-palette.is-loading .search-palette-results {
    opacity: 0.6;
}

.search-palette-hint {
    margin: 0;
    padding: 18px;
    font-size: 15px;
    color: var(--text-muted);
}

.search-palette-hint[hidden] {
    display: none;
}

.search-palette-more {
    display: block;
    margin: 6px 4px 2px;
    padding: 12px;
    border-radius: 12px;
    color: var(--green);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.search-palette-more:hover,
.search-palette-more:focus-visible {
    background: var(--surface-subtle);
}

/* Résultats (fenêtre et page) */
.search-group-title {
    margin: 14px 12px 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.search-result:hover,
.search-result.is-active,
.search-result:focus-visible {
    background: var(--surface-subtle);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--surface-subtle);
    color: var(--green);
}

.search-result.is-active .search-result-icon,
.search-result:hover .search-result-icon {
    background: var(--surface);
}

.search-result-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.search-result-text strong,
.search-result-text span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-text strong {
    font-size: 15px;
    font-weight: 700;
}

.search-result-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.search-result-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
}

/* Page Recherche */
.search-page-form {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-radius: 26px;
    background: var(--surface);
    color: var(--text-muted);
}

.search-field:focus-within {
    box-shadow: 0 0 0 2px var(--green);
}

.search-page-form .btn {
    min-height: 52px;
}

.search-message {
    margin: 18px 4px;
    font-size: 15px;
    color: var(--text-muted);
}

.search-group .search-group-title {
    margin: 22px 4px 8px;
}

.search-results {
    padding: 6px;
    border-radius: 20px;
    background: var(--surface);
}

/* Cheptel : tableau sur grand écran, liste sur téléphone */
.animal-table {
    display: none;
}

.animal-table th {
    padding: 10px 12px;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.animal-table td {
    padding: 8px 12px;
    font-size: 15px;
}

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

.animal-table-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.animal-table-row:hover {
    background: var(--surface-subtle);
}

.animal-table-row.is-selected {
    background: var(--green-pale);
}

.animal-table-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    color: var(--text);
    text-decoration: none;
}

.animal-table-link:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 10px;
}

.animal-table-link .animal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 17px;
}

.animal-table-name {
    margin-left: 4px;
    font-weight: 500;
    color: var(--text-muted);
}

.animal-detail-panel[hidden] {
    display: none;
}

.animal-detail-panel {
    padding: 12px 14px 16px;
    border-radius: 20px;
    background: var(--bg);
}

.animal-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.animal-detail-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.animal-detail-close:hover {
    background: var(--surface-subtle);
}

.cheptel-layout.is-loading-detail .animal-table-row {
    cursor: progress;
}

.animal-preview-profile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.animal-preview-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 28px;
}

.animal-preview-identity {
    min-width: 0;
}

.animal-preview-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.animal-preview-title span {
    font-weight: 500;
    color: var(--text-muted);
}

.animal-preview-identity p {
    margin: 4px 0 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.animal-preview-section {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 20px;
    background: var(--surface);
}

.animal-preview-section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.animal-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.animal-preview-actions .btn {
    flex: 1 1 auto;
}

.weight-chart-empty {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

@media (min-width: 1024px) {
    .animal-table {
        display: table;
    }

    #animal-cards-list {
        display: none;
    }
}

@media (min-width: 1280px) {
    .cheptel-layout.has-detail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 20px;
        align-items: start;
    }

    .animal-detail-panel {
        position: sticky;
        top: calc(76px + env(safe-area-inset-top, 0px));
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* Téléphone : la recherche s'ouvre par le bouton rond de la barre du bas, en plein écran. */
@media (max-width: 600px) {
    .search-palette {
        padding: 0;
    }

    .search-palette-dialog {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .search-palette-esc {
        display: none;
    }

    .search-palette-close svg {
        display: block;
    }

    .search-page-form .btn {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .search-palette:not([hidden]) .search-palette-backdrop {
        animation: suivelFade 0.2s ease both;
    }

    .search-palette:not([hidden]) .search-palette-dialog {
        animation: suivelPaletteIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .search-palette-group {
        animation: suivelRise 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .search-palette-group:nth-child(2) { animation-delay: 0.04s; }
    .search-palette-group:nth-child(3) { animation-delay: 0.08s; }
    .search-palette-group:nth-child(4) { animation-delay: 0.12s; }

    .animal-detail-panel:not([hidden]) {
        animation: suivelPanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .animal-detail-body > .animal-preview {
        animation: suivelFade 0.25s ease both;
    }
}

@keyframes suivelPaletteIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes suivelPanelIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: none; }
}

/* ============================================================
   Navigation fluide : barre de chargement immédiate et passage doux d'une page à l'autre.
   ============================================================ */
.nav-progress {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    background: var(--green);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    pointer-events: none;
}

.nav-progress.is-active {
    opacity: 1;
    transform: scaleX(0.6);
}

@media (prefers-reduced-motion: no-preference) {
    .nav-progress.is-active {
        animation: suivelNavProgress 6s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    }

    /* Chrome 126+ et Safari 18.2+ : la page suivante apparaît en fondu ; en-tête, barre du bas et menu ne clignotent plus. */
    @view-transition {
        navigation: auto;
    }

    .topbar { view-transition-name: suivel-topbar; }
    .bottom-nav { view-transition-name: suivel-bottom-nav; }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.18s;
    }

    ::view-transition-group(suivel-topbar),
    ::view-transition-group(suivel-bottom-nav) {
        animation-duration: 0s;
    }

    ::view-transition-old(suivel-topbar),
    ::view-transition-old(suivel-bottom-nav) {
        display: none;
    }

    ::view-transition-new(suivel-topbar),
    ::view-transition-new(suivel-bottom-nav) {
        animation: none;
    }
}

/* Bandeau des pages servies sans réseau (copie gardée sur le téléphone). */
.offline-copy-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 12px 12px 16px;
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
}

.offline-copy-banner[hidden] {
    display: none;
}

.offline-copy-banner > svg {
    flex-shrink: 0;
    color: var(--warn, #8A5300);
}

.offline-copy-banner.is-back-online > svg {
    color: var(--green);
}

.offline-copy-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.offline-copy-text strong {
    font-size: 15px;
}

.offline-copy-text span {
    font-size: 14px;
    color: var(--text-muted);
}

.offline-copy-banner .btn {
    flex-shrink: 0;
}

@keyframes suivelNavProgress {
    0% { transform: scaleX(0); }
    15% { transform: scaleX(0.4); }
    100% { transform: scaleX(0.92); }
}

/* ============================================================
   Animations des nouveaux écrans : courtes (0,4 à 1,2 s), sur transform et
   opacité seulement, et coupées si le téléphone demande moins de mouvement.
   ============================================================ */
@keyframes suivelRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes suivelPop {
    0% { opacity: 0; transform: scale(0.6); }
    70% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes suivelPopCentered {
    0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
    70% { opacity: 1; transform: translateX(-50%) scale(1.06); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes suivelZoomOut {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

@keyframes suivelSheetUp {
    from { transform: translateY(60px); }
    to { transform: none; }
}

@keyframes suivelDraw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes suivelFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes suivelRingFill {
    from { stroke-dashoffset: var(--ring-len, 0px); }
    to { stroke-dashoffset: 0px; }
}

@keyframes suivelGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: no-preference) {
    /* Bienvenue (téléphone) : la photo se pose, le logo saute, la feuille monte, les boutons suivent. */
    .app-welcome-photo img {
        animation: suivelZoomOut 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .app-welcome-badge {
        animation: suivelPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
    }

    .app-welcome-name {
        animation: suivelRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
    }

    .app-welcome-tagline {
        animation: suivelRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
    }

    .app-welcome-sheet {
        animation: suivelSheetUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
    }

    .app-welcome-sheet > * {
        animation: suivelRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .app-welcome-sheet > :nth-child(1) { animation-delay: 0.35s; }
    .app-welcome-sheet > :nth-child(2) { animation-delay: 0.42s; }
    .app-welcome-sheet > :nth-child(3) { animation-delay: 0.5s; }
    .app-welcome-sheet > :nth-child(4) { animation-delay: 0.57s; }
    .app-welcome-sheet > :nth-child(5) { animation-delay: 0.63s; }
    .app-welcome-sheet > :nth-child(6) { animation-delay: 0.7s; }

    /* Connexion, inscription : même entrée, plus courte. */
    .auth-hero img,
    .auth-backdrop img {
        animation: suivelZoomOut 1s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .guest-page .auth-hero-badge {
        animation: suivelPopCentered 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
    }

    .guest-page .auth-card {
        animation: suivelSheetUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    /* Accueil : les cadres et les boutons sont en place dès l'ouverture (demande de l'utilisateur) ;
       seul l'anneau de la fiche du jour se remplit, et un bouton rond réagit au doigt. */
    .day-ring-fill {
        animation: suivelRingFill 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
    }

    .quick-tile:active .quick-tile-icon {
        transform: scale(0.92);
    }

    .quick-tile-icon {
        transition: background-color 0.2s ease, transform 0.15s ease;
    }

    /* Résultats : les cadres sont là tout de suite (demande de l'utilisateur) ; seules les barres se remplissent. */
    .chart-card-svg rect,
    .stacked-bar .stacked-seg {
        transform-box: fill-box;
        transform-origin: left center;
        animation: suivelGrow 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
    }

    /* Fiche animal : la courbe de poids se dessine, puis les points apparaissent. */
    .wc-line {
        stroke-dasharray: 1;
        animation: suivelDraw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.2s both;
    }

    .wc-area,
    .wc-dot,
    .wc-val {
        animation: suivelFade 0.4s ease 1.1s both;
    }

    .animal-profile,
    .animal-stats,
    .animal-next {
        animation: suivelRise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .animal-stats { animation-delay: 0.06s; }
    .animal-next { animation-delay: 0.12s; }
}

/* ============================================================
   Capture d'écran d'un paiement d'abonnement : choix par l'éleveur, vérification par le fondateur.
   ============================================================ */
.proof-field {
    max-width: 560px;
}

.proof-picker {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    margin: 4px 0 0;
    padding: 8px 16px;
    border: 1px solid var(--input-border);
    border-radius: 16px;
    background: var(--input-bg);
    color: var(--green);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.proof-picker input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.proof-picker:focus-within {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.proof-picker img {
    width: 52px;
    height: 72px;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.proof-picker.has-proof svg {
    display: none;
}

.proof-hint,
.proof-reason {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.proof-remove {
    align-self: flex-start;
    justify-self: start;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.proof-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 14px;
    font-weight: 700;
}

.proof-thumb {
    width: 48px;
    height: 64px;
    display: block;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-subtle);
    overflow: hidden;
    cursor: pointer;
}

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

.proof-state {
    display: none;
}

.proof-thumb:focus-visible,
.review-image:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.review-dialog {
    width: min(920px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 80px rgba(7, 17, 12, 0.4);
    overflow: hidden;
}

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

.review-dialog::backdrop {
    background: rgba(7, 17, 12, 0.6);
}

.review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px 12px 12px 24px;
    border-bottom: 1px solid var(--border);
}

.review-head h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.review-close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text);
    cursor: pointer;
}

.review-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    overflow: hidden;
}

.review-proof {
    min-height: 320px;
    display: flex;
    padding: 20px;
    background: var(--surface-subtle);
    overflow: auto;
    overscroll-behavior: contain;
}

.review-image {
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: zoom-in;
}

.review-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(62vh, 620px);
    border-radius: 12px;
}

.review-proof.is-zoomed .review-image {
    margin: 0;
    cursor: zoom-out;
}

.review-proof.is-zoomed .review-image img {
    max-width: none;
    max-height: none;
    width: max(165%, 620px);
}

.review-none {
    margin: auto;
    color: var(--text-muted);
    text-align: center;
}

.review-side {
    min-width: 0;
    padding: 20px 24px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.review-amount {
    display: flex;
    flex-direction: column;
    margin: 0 0 10px;
}

.review-amount span {
    color: var(--text-muted);
    font-weight: 500;
}

.review-amount strong {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.review-facts {
    margin: 0;
}

.review-facts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-top: 1px solid var(--border);
}

.review-facts dt {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 15px;
}

.review-facts dd {
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.review-warning {
    margin: 10px 0 16px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.45;
}

.review-dialog form {
    margin: 0;
}

.review-approve,
.review-refuse .btn {
    width: 100%;
    min-height: 50px;
}

.review-refuse {
    margin-top: 6px;
}

.review-refuse summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    color: var(--danger);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.review-refuse summary::-webkit-details-marker {
    display: none;
}

/* Téléphone : une ligne de texte suffit, « Vérifier » ouvre la capture en grand. */
@media (max-width: 900px), (max-height: 500px) and (pointer: coarse) {
    .proof-thumb {
        display: none;
    }

    .proof-state {
        display: inline;
    }
}

@media (max-width: 700px) {
    .review-dialog {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
    }

    .review-head {
        padding-left: 16px;
    }

    .review-body {
        display: block;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .review-proof {
        min-height: 0;
        padding: 14px 16px;
    }

    .review-image img {
        max-height: 52vh;
    }

    .review-proof.is-zoomed {
        max-height: 70vh;
    }

    .review-side {
        padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        overflow: visible;
    }
}

/* ============================================================
   Ordinateur : barre de menu en haut, bandeau photo et panneaux de verre (maquette A + B, décembre 2026).
   Tout est limité à l'application (body.desk-shell) et aux écrans d'ordinateur : le téléphone ne change pas.
   ============================================================ */
.desk-brand,
.desk-nav,
.desk-menu,
.desk-only,
.home-figures,
.work-list,
.work-detail {
    display: none;
}

@media screen and (min-width: 901px) and (min-height: 501px), screen and (min-width: 901px) and (pointer: fine) {
    .desk-shell {
        --bg: #DCE7E0;
        --text-muted: #43524A;
        --desk-gutter: clamp(20px, 2.8vw, 40px);
        --glass-ink: rgba(16, 32, 23, 0.34);
        --glass-ink-edge: rgba(255, 255, 255, 0.26);
        --glass-ink-shine: inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.85), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.5), inset 0 0 18px rgba(255, 255, 255, 0.12), 0 18px 40px -18px rgba(7, 17, 12, 0.6);
        --glass: rgba(255, 255, 255, 0.84);
        --glass-soft: rgba(255, 255, 255, 0.76);
        --glass-solid: #F9FBFA;
        --glass-menu: rgba(255, 255, 255, 0.9);
        --glass-edge: rgba(255, 255, 255, 0.6);
        --glass-shine: inset 1.5px 1.5px 1px -1px #FFFFFF, inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.9), 0 24px 50px -32px rgba(7, 17, 12, 0.4);
        --glass-selected: rgba(255, 255, 255, 0.9);
        --glass-track: rgba(7, 17, 12, 0.08);
        --glass-line: rgba(7, 17, 12, 0.12);
        --band-shade: linear-gradient(90deg, rgba(7, 17, 12, 0.66) 0%, rgba(7, 17, 12, 0.36) 46%, rgba(7, 17, 12, 0.36) 100%);
        background: var(--bg);
    }

    html[data-theme="dark"] .desk-shell {
        --bg: #07110C;
        --text-muted: #A3B5AB;
        --glass-ink: rgba(7, 17, 12, 0.5);
        --glass-ink-edge: rgba(255, 255, 255, 0.16);
        --glass-ink-shine: inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.4), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.2), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
        --glass: rgba(14, 27, 20, 0.86);
        --glass-soft: rgba(14, 27, 20, 0.8);
        --glass-solid: #0E1B14;
        --glass-menu: rgba(14, 27, 20, 0.94);
        --glass-edge: rgba(255, 255, 255, 0.09);
        --glass-shine: inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.24), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.1), 0 24px 50px -32px rgba(0, 0, 0, 0.9);
        --glass-selected: rgba(255, 255, 255, 0.1);
        --glass-track: rgba(255, 255, 255, 0.08);
        --glass-line: rgba(255, 255, 255, 0.1);
        --band-shade: linear-gradient(90deg, rgba(7, 17, 12, 0.82) 0%, rgba(7, 17, 12, 0.6) 46%, rgba(7, 17, 12, 0.6) 100%);
    }

    .desk-shell .desk-only {
        display: revert;
    }

    .desk-shell .phone-only {
        display: none;
    }

    /* La photo est posée en haut de la page ; l'en-tête de chaque page (.page-top ou .page-header) la coupe
       sous lui par un aplat de la couleur du fond. Le bandeau suit ainsi la hauteur du titre et des avis. */
    .desk-shell .app-shell {
        background: transparent;
    }

    .desk-shell .main-area {
        position: relative;
        isolation: isolate;
        overflow: clip;
    }

    .desk-shell .main-area::before {
        content: "";
        position: absolute;
        z-index: -2;
        top: 0;
        left: 0;
        right: 0;
        height: 820px;
        background:
            var(--band-shade),
            url("/images/bandeau-troupeau.webp") center top / max(100%, 1680px) auto no-repeat #2B2A22;
    }

    .desk-shell .content > .page-top,
    .desk-shell .content > .page-header,
    .desk-shell .plus-page > .page-header {
        position: relative;
        margin: 0;
        padding: 30px 0 26px 24px;
        color: #FFFFFF;
    }

    .desk-shell .content > .page-top::after,
    .desk-shell .content > .page-header::after,
    .desk-shell .plus-page > .page-header::after {
        content: "";
        position: absolute;
        z-index: -1;
        top: calc(100% + var(--band-below, 150px));
        left: 50%;
        width: 100vw;
        height: 820px;
        margin-left: -50vw;
        background: var(--bg);
        pointer-events: none;
    }

    /* Titre, sous-pages et boutons sur la même ligne. */
    .desk-shell .page-top {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px 28px;
    }

    .desk-shell .page-top > .page-header {
        flex: 1 1 auto;
        margin: 0;
    }

    .desk-shell .page-top > .sub-nav-pills ~ *,
    .desk-shell .page-top > .page-header:has(+ .sub-nav-pills) {
        flex: 0 1 auto;
    }

    .desk-shell .page-top > .page-top-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-left: auto;
    }

    .desk-shell :is(.page-top, .page-header) .page-title {
        color: #FFFFFF;
        font-size: 30px;
    }

    .desk-shell :is(.page-top, .page-header) .page-subtitle {
        max-width: 68ch;
        margin-top: 4px;
        color: #F3F7F4;
        font-weight: 500;
    }

    .desk-shell :is(.page-top, .page-header) a:not(.btn, .pill-btn, .home-figure) {
        color: #FFFFFF;
    }

    .desk-shell :is(.page-top, .page-header) :is(.btn-secondary, .btn-ghost) {
        min-height: 48px;
        padding: 0 22px;
        background: rgba(255, 255, 255, 0.94);
        color: #07110C;
    }

    .desk-shell :is(.page-top, .page-header) :is(.btn-secondary, .btn-ghost):hover {
        background: #FFFFFF;
    }

    .desk-shell :is(.page-top, .page-header) .btn-primary {
        min-height: 48px;
        padding: 0 22px;
        background: #0E7A48;
        color: #FFFFFF;
    }

    .desk-shell :is(.page-top, .page-header) .badge {
        background: rgba(255, 255, 255, 0.94);
        color: #07110C;
    }

    .desk-shell :is(.page-top, .page-header) :is(.sub-nav-pills, .pill-nav) {
        gap: 2px;
        margin: 0;
        padding: 4px;
        border: 1px solid var(--glass-ink-edge);
        border-radius: 999px;
        background: var(--glass-ink);
        box-shadow: var(--glass-ink-shine);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
        backdrop-filter: blur(20px) saturate(1.5);
    }

    .desk-shell :is(.page-top, .page-header) .pill-btn {
        padding: 0 18px;
        background: transparent;
        color: #FFFFFF;
    }

    .desk-shell :is(.page-top, .page-header) .pill-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }

    .desk-shell :is(.page-top, .page-header) .pill-btn.active {
        background: rgba(255, 255, 255, 0.92);
        color: #07110C;
    }

    .desk-shell .content {
        max-width: calc(1360px + 2 * var(--desk-gutter));
        margin: 0 auto;
        padding: 0 var(--desk-gutter) 40px;
    }

    /* Barre du haut : gélule de verre, qui reste en vue quand la page défile. */
    .desk-shell .topbar,
    :root:not([data-theme="dark"]) .desk-shell .topbar {
        top: calc(16px + env(safe-area-inset-top, 0px));
        width: calc(100% - 2 * var(--desk-gutter));
        max-width: 1360px;
        min-height: 72px;
        margin: calc(20px + env(safe-area-inset-top, 0px)) auto 0;
        padding: 10px 12px 10px 22px;
        flex-wrap: nowrap;
        gap: 10px clamp(8px, 1.4vw, 20px);
        border: 0;
        border-radius: 36px;
        background: transparent;
        color: #FFFFFF;
        view-transition-name: none;
    }

    /* Le verre est sur un calque à part : les menus déroulants peuvent ainsi flouter ce qu'ils recouvrent. */
    .desk-shell .topbar::before {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 0;
        border: 1px solid var(--glass-ink-edge);
        border-radius: inherit;
        background: var(--glass-ink);
        box-shadow: var(--glass-ink-shine);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
        backdrop-filter: blur(20px) saturate(1.5);
        transition: background-color 0.25s ease;
    }

    .is-scrolled .desk-shell .topbar::before {
        background: rgba(10, 26, 18, 0.88);
    }

    .desk-shell .topbar-left,
    .desk-shell .topbar-right {
        flex-wrap: nowrap;
    }

    .desk-shell .topbar-logo,
    .desk-shell .topbar-farm,
    .desk-shell .topbar-avatar,
    .desk-shell #logout-form {
        display: none;
    }

    .desk-brand {
        display: inline-flex;
        align-items: center;
        min-height: 48px;
        text-decoration: none;
    }

    .desk-brand:hover {
        text-decoration: none;
    }

    .desk-nav {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .desk-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 48px;
        padding: 0 clamp(10px, 1.25vw, 18px);
        border-radius: 999px;
        color: #FFFFFF;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        text-decoration: none;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .desk-nav-link:hover {
        background: rgba(255, 255, 255, 0.16);
        color: #FFFFFF;
        text-decoration: none;
    }

    .desk-nav-link.active {
        background: rgba(255, 255, 255, 0.92);
        color: #07110C;
        font-weight: 700;
    }

    .desk-shell .topbar :is(a, button, summary):focus-visible {
        outline: 2px solid #FFFFFF;
        outline-offset: 2px;
    }

    .desk-shell .topbar-search {
        flex: 0 0 48px;
        min-width: 48px;
        width: 48px;
        height: 48px;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.14);
        color: #FFFFFF;
    }

    .desk-shell .topbar-search:hover {
        background: rgba(255, 255, 255, 0.26);
        box-shadow: none;
    }

    .desk-shell .topbar-search-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .desk-shell .topbar-search-kbd {
        display: none;
    }

    /* Tout est à jour : un simple point vert. Le texte ne paraît que s'il y a quelque chose à savoir. */
    .desk-shell #sync-status-indicator {
        min-width: 24px;
        justify-content: center;
        color: #FFFFFF;
    }

    .desk-shell #sync-status-indicator.badge-ok {
        gap: 0;
        font-size: 0;
    }

    .desk-shell #sync-status-indicator.badge-ok::before {
        width: 10px;
        height: 10px;
        background: #2FD487;
    }

    .desk-shell #sync-status-indicator:is(.badge-warn, .badge-danger) {
        padding: 0 14px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.94);
        color: #07110C;
    }

    /* Menus déroulants : Plus, Noter, compte. */
    .desk-menu {
        position: relative;
        display: block;
    }

    .desk-menu > summary {
        list-style: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .desk-menu > summary::-webkit-details-marker {
        display: none;
    }

    .desk-menu > summary svg {
        flex-shrink: 0;
    }

    .desk-menu > .desk-nav-link svg {
        transition: transform 0.2s ease;
    }

    .desk-menu[open] > .desk-nav-link svg {
        transform: rotate(180deg);
    }

    .desk-menu[open] > .desk-nav-link:not(.active) {
        background: rgba(255, 255, 255, 0.2);
    }

    .desk-note-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 48px;
        padding: 0 20px 0 16px;
        border-radius: 999px;
        background: #0E7A48;
        color: #FFFFFF;
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .desk-note-btn:hover {
        background: #0B6139;
    }

    .desk-account-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 3px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.14);
        color: #FFFFFF;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .desk-account-btn:hover {
        background: rgba(255, 255, 255, 0.26);
    }

    .desk-account-farm {
        display: none;
        max-width: 170px;
        padding-left: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .desk-account-initials {
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.94);
        color: #07110C;
        font-size: 14px;
        font-weight: 800;
    }

    .desk-menu-panel {
        position: absolute;
        z-index: 40;
        top: calc(100% + 18px);
        right: 0;
        min-width: 220px;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        padding: 10px;
        border: 1px solid var(--glass-edge);
        border-radius: 24px;
        background: var(--glass-menu);
        box-shadow: var(--glass-shine), 0 30px 70px -20px rgba(7, 17, 12, 0.45);
        -webkit-backdrop-filter: blur(28px) saturate(1.6);
        backdrop-filter: blur(28px) saturate(1.6);
        color: var(--text);
    }

    .desk-menu-panel--wide {
        right: auto;
        left: 50%;
        display: grid;
        grid-template-columns: repeat(3, max-content);
        gap: 4px 12px;
        padding: 16px;
        transform: translateX(-50%);
    }

    .desk-menu-panel--account {
        width: 300px;
    }

    .desk-menu-group h2 {
        margin: 4px 0 4px;
        padding: 0 14px;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 600;
    }

    .desk-menu-panel--account .desk-menu-group + .desk-menu-group {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--glass-line);
    }

    .desk-menu-panel form {
        margin: 0;
    }

    .desk-menu-link {
        width: 100%;
        min-height: 46px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--text);
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        transition: background-color 0.15s ease;
    }

    .desk-menu-link svg {
        flex-shrink: 0;
        color: var(--green);
    }

    .desk-menu-link span:first-of-type {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .desk-menu-link > svg:last-child {
        margin-left: auto;
    }

    .desk-menu-link:hover {
        background: var(--glass-track);
        color: var(--text);
        text-decoration: none;
    }

    .desk-shell .desk-menu-panel :is(a, button):focus-visible {
        outline: 2px solid var(--green);
        outline-offset: -2px;
    }

    .desk-menu-link[aria-current="page"],
    .desk-menu-link[aria-current="true"] {
        background: var(--selected-bg);
    }

    .desk-menu-link.is-danger {
        color: var(--danger);
    }

    .desk-account-name {
        display: flex;
        flex-direction: column;
        margin: 4px 14px 10px;
        font-size: 15px;
        line-height: 1.35;
    }

    .desk-account-name span {
        overflow: hidden;
        color: var(--text-muted);
        font-size: 14px;
        text-overflow: ellipsis;
    }

    .desk-locale {
        display: flex;
        gap: 2px;
        margin: 4px 6px;
        padding: 4px;
        border-radius: 999px;
        background: var(--glass-track);
    }

    .desk-locale button {
        flex: 1 1 0;
        min-height: 40px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--text);
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

    .desk-locale button[aria-pressed="true"] {
        background: var(--surface);
        font-weight: 700;
    }

    /* Panneaux : verre clair. Seuls ceux qui touchent la photo floutent ce qu'ils recouvrent. */
    .desk-shell .content :is(.card, .kpi-card, .action-drawer, .menu-group, .trial-meter-box) {
        border: 1px solid var(--glass-edge);
        border-radius: 24px;
        background: var(--glass);
        box-shadow: var(--glass-shine);
    }

    .desk-shell .content :is(.card, .kpi-card, .action-drawer, .menu-group, .trial-meter-box) :is(.card, .kpi-card, .action-drawer, .menu-group) {
        border: 0;
        border-radius: 16px;
        background: var(--surface-subtle);
        box-shadow: none;
    }

    .desk-shell .content > :is(.card, .action-drawer, .menu-group) {
        padding-inline: 24px;
    }

    .desk-shell .content > .card {
        padding-block: 22px;
    }

    .desk-shell .content > :is(.page-top, .page-header) + *,
    .desk-shell .content > :is(.page-top, .page-header) + * + *,
    .desk-shell .content > :is(.page-top, .page-header) + * + * + *,
    .desk-shell .content > :is(.page-top, .page-header) + * + * + * + * {
        --desk-blur: blur(28px) saturate(1.6);
    }

    .desk-shell .content :is(.card, .kpi-card, .action-drawer, .menu-group, .trial-meter-box) {
        -webkit-backdrop-filter: var(--desk-blur, none);
        backdrop-filter: var(--desk-blur, none);
    }

    .desk-shell .content :is(.grid-2, .grid-3, .grid-4) {
        gap: 16px;
        margin-bottom: 16px;
    }

    .desk-shell .content > :is(.card, .action-drawer, .menu-group) {
        margin-bottom: 16px;
    }

    /* Accueil : les chiffres sur la photo, la liste à gauche, la ligne choisie à droite. */
    .desk-shell .content > .page-top--home {
        --band-below: 264px;
        padding: 46px 0 40px;
    }

    .desk-shell .page-top--home > .page-header {
        padding-left: 24px;
    }

    .home-figures {
        display: flex;
        margin-left: auto;
        padding: 6px;
        border: 1px solid var(--glass-ink-edge);
        border-radius: 28px;
        background: var(--glass-ink);
        box-shadow: var(--glass-ink-shine);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
        backdrop-filter: blur(20px) saturate(1.5);
    }

    .home-figure {
        display: flex;
        flex-direction: column;
        padding: 9px 22px;
        border-radius: 22px;
        color: #FFFFFF;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }

    .home-figure:hover {
        background: rgba(255, 255, 255, 0.14);
        color: #FFFFFF;
        text-decoration: none;
    }

    .home-figure:focus-visible {
        outline: 2px solid #FFFFFF;
        outline-offset: 0;
    }

    .home-figure span {
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
    }

    .home-figure strong {
        font-size: 22px;
        font-weight: 800;
        line-height: 1.25;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .home-grid {
        display: grid;
        grid-template-columns: minmax(320px, 0.54fr) minmax(0, 1fr);
        grid-template-rows: minmax(max(560px, calc(100vh - 304px)), auto);
        gap: 16px;
    }

    .home-grid > .daily-top-grid,
    .home-grid > .watch-card,
    .home-grid > .home-kpi-title,
    .home-grid > .home-kpis,
    .home-grid > .home-logs.is-empty,
    .desk-shell .content .home-grid .action-drawer:not([open]),
    .home-grid:has(.action-drawer[open]) .work-detail {
        display: none;
    }

    .home-grid > .home-drawers {
        display: contents;
    }

    .desk-shell .home-grid > .home-logs {
        grid-column: 1 / -1;
        margin: 0;
    }

    .work-list,
    .work-detail,
    .desk-shell .content .home-grid .action-drawer[open] {
        display: block;
        grid-row: 1;
        margin: 0;
        border: 1px solid var(--glass-edge);
        border-radius: 28px;
        box-shadow: var(--glass-shine);
        -webkit-backdrop-filter: blur(28px) saturate(1.6);
        backdrop-filter: blur(28px) saturate(1.6);
    }

    .work-list {
        grid-column: 1;
        padding: 22px 16px 20px;
        background: var(--glass-soft);
    }

    .work-detail,
    .desk-shell .content .home-grid .action-drawer[open] {
        grid-column: 2;
        align-self: stretch;
        background: var(--glass);
    }

    .work-detail {
        padding: 32px clamp(24px, 3.4vw, 48px);
    }

    /* Formulaire ouvert par « Noter » : il prend la place du détail, son titre sert à le refermer. */
    .desk-shell .content .home-grid .action-drawer[open] > summary {
        padding: 30px clamp(24px, 3.4vw, 48px) 6px;
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 26px;
        font-weight: 800;
        line-height: 1.2;
    }

    .desk-shell .content .home-grid .action-drawer > summary .drawer-chevron {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--glass-track);
    }

    .desk-shell .content .home-grid .action-drawer > .action-drawer-body {
        padding: 14px clamp(24px, 3.4vw, 48px) 32px;
    }

    .work-tabs {
        display: flex;
        gap: 4px;
        margin: 0 8px 6px;
        padding: 4px;
        border-radius: 999px;
        background: var(--glass-track);
    }

    .work-tabs button {
        flex: 1 1 0;
        min-height: 44px;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--text);
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .work-tabs button:hover {
        background: var(--glass-track);
    }

    .work-tabs button[aria-selected="true"] {
        background: var(--surface);
        font-weight: 700;
    }

    .work-group {
        margin: 16px 12px 2px;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 700;
    }

    .work-group.is-late,
    .work-pane-due.is-late {
        color: #784700;
    }

    .work-row {
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 12px;
        border-radius: 14px;
        color: var(--text);
        line-height: 1.35;
        text-decoration: none;
        transition: background-color 0.15s ease;
    }

    .work-row:hover {
        background: var(--glass-track);
        color: var(--text);
        text-decoration: none;
    }

    .work-row[aria-current="true"] {
        background: var(--glass-selected);
        box-shadow: inset 1px 1px 1px -0.5px rgba(255, 255, 255, 0.9), 0 6px 16px -8px rgba(7, 17, 12, 0.35);
    }

    .work-row-title {
        min-width: 0;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .work-row[aria-current="true"] .work-row-title {
        font-weight: 700;
    }

    .work-row-side {
        flex-shrink: 0;
        max-width: 45%;
        color: var(--text-muted);
        font-weight: 500;
        text-align: right;
    }

    .work-row-side.is-urgent,
    .work-pane-due.is-urgent {
        color: var(--danger);
        font-weight: 700;
    }

    .work-more {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        margin: 6px 12px 0;
        font-weight: 700;
    }

    .work-empty {
        margin: 18px 12px 0;
        color: var(--text-muted);
    }

    .work-pane:focus {
        outline: none;
    }

    .work-pane[hidden] {
        display: none;
    }

    .work-pane-due {
        margin: 0 0 4px;
        color: var(--text-muted);
        font-weight: 700;
    }

    .work-pane-title {
        margin: 0;
        font-size: 32px;
        font-weight: 800;
        line-height: 1.15;
        letter-spacing: -0.01em;
        overflow-wrap: anywhere;
    }

    .work-pane-sub {
        max-width: 62ch;
        margin: 8px 0 0;
        color: var(--text-muted);
        font-size: 17px;
        font-weight: 500;
    }

    .work-pane-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 26px;
    }

    .work-detail .btn {
        min-height: 52px;
        padding: 0 28px;
        font-size: 16px;
    }

    .work-form {
        margin-top: 26px;
    }

    .work-form fieldset {
        margin: 0 0 18px;
        padding: 0;
        border: 0;
    }

    .work-form legend {
        margin-bottom: 12px;
        padding: 0;
        font-size: 18px;
        font-weight: 700;
    }

    .work-choices {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .work-choices label {
        position: relative;
        flex: 1 1 150px;
        min-height: 62px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 14px;
        border: 2px solid var(--border);
        border-radius: 16px;
        background: var(--surface);
        font-size: 17px;
        font-weight: 700;
        cursor: pointer;
        transition: border-color 0.15s ease, background-color 0.15s ease;
    }

    .work-choices label:hover {
        border-color: var(--green);
    }

    .work-choices label:has(input:checked) {
        border-color: var(--green);
        background: var(--selected-bg);
    }

    .work-choices label:has(input:focus-visible) {
        outline: 2px solid var(--green);
        outline-offset: 2px;
    }

    .work-choices input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .work-form-end {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 14px;
    }

    .work-form-end .field {
        flex: 0 1 168px;
        min-width: 0;
        margin: 0;
    }

    .work-form-end .field input {
        width: 100%;
        min-width: 0;
        min-height: 52px;
    }

    .work-form-end .field:has(input[type="number"]) {
        flex-basis: 130px;
    }

    .work-pane-heading {
        margin: 34px 0 14px;
        font-size: 18px;
        font-weight: 700;
    }

    .work-pane-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        margin-top: 32px;
    }

    .work-pane-head .work-pane-heading {
        margin: 0 0 4px;
    }

    .work-pane-head a {
        font-weight: 700;
    }

    .work-cycle {
        display: flex;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .work-cycle li {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        padding: 24px 10px 0 0;
        line-height: 1.35;
    }

    .work-cycle li:last-child {
        flex: 0 0 auto;
        padding-right: 0;
    }

    .work-cycle li::before {
        content: "";
        position: absolute;
        z-index: 1;
        top: 0;
        left: 0;
        width: 16px;
        height: 16px;
        border: 2px solid #8A9A91;
        border-radius: 50%;
        background: var(--surface);
    }

    .work-cycle li:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 7px;
        left: 16px;
        right: 0;
        height: 2px;
        background: var(--border);
    }

    .work-cycle li.is-done::before {
        border-color: var(--green);
        background: var(--green);
    }

    .work-cycle li.is-done:not(:last-child)::after {
        background: var(--green);
    }

    .work-cycle li.is-now::before {
        border: 4px solid var(--maize);
    }

    .work-cycle span {
        color: var(--text-muted);
        font-weight: 500;
    }

    .work-cycle li.is-now span {
        color: #784700;
        font-weight: 600;
    }

    .work-facts {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        column-gap: 48px;
        margin: 0;
    }

    .work-facts > div {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 1px solid var(--glass-line);
    }

    .work-facts dt {
        color: var(--text-muted);
        font-weight: 500;
    }

    .work-facts dd {
        margin: 0;
        font-weight: 600;
        text-align: right;
    }

    .work-buildings {
        margin: 24px 0 0;
        padding: 0;
        list-style: none;
    }

    .work-buildings li {
        min-height: 88px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        border-top: 1px solid var(--glass-line);
    }

    .work-buildings li > div {
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .work-buildings strong {
        font-size: 18px;
        font-weight: 700;
    }

    .work-buildings li > div span {
        color: var(--text-muted);
        font-weight: 500;
    }

    .work-link {
        min-height: 44px;
        margin-top: 10px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--green);
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }

    .work-link:hover {
        text-decoration: underline;
    }

    html[data-theme="dark"] :is(.work-group.is-late, .work-pane-due.is-late, .work-cycle li.is-now span) {
        color: var(--maize);
    }

    html[data-theme="dark"] .work-row[aria-current="true"] {
        box-shadow: inset 1px 1px 1px -0.5px rgba(255, 255, 255, 0.35);
    }

    /* Boutons du bandeau et formulaires qu'ils ouvrent. */
    .desk-shell .btn.desk-only {
        display: inline-flex;
    }

    .desk-shell .page-top > .btn {
        margin-left: auto;
    }

    .desk-shell .page-top > .page-header:has(+ .sub-nav-pills) .page-subtitle {
        display: none;
    }

    .desk-shell .content .action-drawer.top-drawer:not([open]) {
        display: none;
    }

    .desk-shell .content .action-drawer > summary {
        min-height: 56px;
        font-size: 15px;
        font-weight: 700;
    }

    .desk-shell .content > .action-drawer {
        padding-inline: 0;
    }

    .desk-shell .content > .action-drawer > summary {
        padding-inline: 24px;
    }

    .desk-shell .content > .action-drawer > .action-drawer-body {
        padding: 18px 24px 24px;
    }

    .desk-shell .content .action-drawer[open] > summary {
        border-bottom-color: var(--glass-line);
        background: transparent;
    }

    .desk-shell .content .top-drawer > summary {
        min-height: 64px;
        color: var(--text);
        font-size: 18px;
        font-weight: 800;
    }

    .desk-shell .content .pill-btn {
        font-family: inherit;
    }

    /* Fiche client : lien de retour au-dessus du titre. */
    .desk-shell .content > .page-top--stack {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .desk-shell .page-top--stack > a:first-child {
        min-height: 32px;
        margin: 0 !important;
        color: #FFFFFF !important;
        font-size: 15px !important;
    }

    .desk-shell .page-top--stack > .page-header {
        width: 100%;
    }

    /* Cheptel : le tableau à gauche, l'animal choisi à droite, deux panneaux séparés. */
    .desk-shell .content > #liste-cheptel {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .desk-shell .cheptel-main,
    .desk-shell .animal-detail-panel {
        border: 1px solid var(--glass-edge);
        border-radius: 28px;
        box-shadow: var(--glass-shine);
        -webkit-backdrop-filter: blur(28px) saturate(1.6);
        backdrop-filter: blur(28px) saturate(1.6);
    }

    .desk-shell .cheptel-main {
        padding: 22px 16px 14px;
        background: var(--glass-soft);
    }

    .desk-shell .cheptel-main > .card-title {
        display: none;
    }

    .desk-shell .cheptel-layout.has-detail {
        gap: 16px;
    }

    .cheptel-filters {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 14px;
        padding: 0 8px 14px;
    }

    .desk-shell .cheptel-filters .pill-nav {
        flex-wrap: nowrap;
        gap: 2px;
        margin: 0;
        padding: 4px;
        border-radius: 999px;
        background: var(--glass-track);
    }

    .desk-shell .cheptel-filters .pill-btn {
        padding: 0 16px;
        background: transparent;
        white-space: nowrap;
    }

    .desk-shell .cheptel-filters .pill-btn:hover {
        background: var(--glass-track);
    }

    .desk-shell .cheptel-filters .pill-btn.active {
        background: var(--surface);
    }

    .desk-shell .cheptel-filters form {
        flex: 1 1 440px;
        display: flex;
        gap: 10px;
        margin: 0 !important;
    }

    .desk-shell .cheptel-filters .field {
        flex: 1 1 120px;
        min-width: 0;
        margin: 0;
    }

    .desk-shell .cheptel-filters .field:last-child {
        flex: 0 0 auto;
    }

    .desk-shell .cheptel-filters :is(input, select) {
        min-height: 48px;
        border-radius: 14px;
    }

    .desk-shell .cheptel-filters .btn {
        min-height: 48px;
    }

    .desk-shell .animal-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .desk-shell .animal-table th {
        padding: 8px 14px;
        border: 0;
        font-size: 14px;
        font-weight: 600;
    }

    .desk-shell .animal-table td {
        height: 52px;
        padding: 2px 14px;
        border: 0;
        font-weight: 500;
    }

    .desk-shell .animal-table td:not(:first-child, .num) {
        color: var(--text-muted);
    }

    .desk-shell .animal-table .num {
        padding-right: 22px;
        font-weight: 600;
    }

    .desk-shell .animal-table .animal-status {
        padding: 0;
        background: none;
        color: inherit;
        font-size: 15px;
        font-weight: 500;
    }

    .desk-shell .animal-table-row:is([data-status="gestante"], [data-status="allaitante"]) .animal-status {
        color: var(--text);
        font-weight: 700;
    }

    .desk-shell .animal-table:not([data-has-photos]) .animal-avatar {
        display: none;
    }

    .desk-shell .animal-table-row {
        background: transparent;
    }

    .desk-shell .animal-table-row > td:first-child {
        border-radius: 14px 0 0 14px;
    }

    .desk-shell .animal-table-row > td:last-child {
        border-radius: 0 14px 14px 0;
    }

    .desk-shell .animal-table-row:hover > td {
        background: var(--glass-track);
    }

    .desk-shell .animal-table-row.is-selected > td {
        background: var(--glass-selected);
    }

    .desk-shell .animal-detail-panel {
        top: calc(104px + env(safe-area-inset-top, 0px));
        max-height: calc(100vh - 124px);
        min-height: 420px;
        padding: 18px 28px 26px;
        background: var(--glass);
        scrollbar-width: thin;
    }

    .desk-shell .animal-detail-head {
        position: absolute;
        z-index: 1;
        top: 14px;
        right: 14px;
        margin: 0;
    }

    .desk-shell .animal-detail-head > span {
        display: none;
    }

    .desk-shell .animal-preview-profile {
        margin: 10px 34px 0 0;
    }

    .desk-shell .animal-preview-title {
        font-size: 26px;
        line-height: 1.2;
    }

    .desk-shell .animal-preview-title span {
        color: inherit;
        font-weight: 800;
    }

    .desk-shell .animal-preview-identity p {
        margin: 4px 0 0;
        font-size: 15px;
        font-weight: 500;
    }

    .animal-preview-next {
        display: flex;
        flex-direction: column;
        margin: 20px 0 0;
    }

    .animal-preview-next span {
        color: var(--text-muted);
        font-weight: 500;
    }

    .animal-preview-next strong {
        font-size: 23px;
        font-weight: 800;
        line-height: 1.25;
    }

    .animal-preview-next.is-late .animal-preview-delay,
    .animal-preview-next.is-late > span:first-child:last-of-type {
        color: #784700;
        font-weight: 700;
    }

    .animal-preview-cycle {
        margin: 20px 0 0;
        padding: 0;
        list-style: none;
    }

    .animal-preview-cycle li {
        position: relative;
        min-height: 40px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding-left: 28px;
    }

    .animal-preview-cycle li:last-child {
        min-height: 0;
    }

    .animal-preview-cycle li::before {
        content: "";
        position: absolute;
        z-index: 1;
        top: 4px;
        left: 0;
        width: 14px;
        height: 14px;
        border: 2px solid #8A9A91;
        border-radius: 50%;
        background: var(--surface);
    }

    .animal-preview-cycle li:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 18px;
        bottom: -4px;
        left: 6px;
        width: 2px;
        background: var(--border);
    }

    .animal-preview-cycle li.is-done::before {
        border-color: var(--green);
        background: var(--green);
    }

    .animal-preview-cycle li.is-done:not(:last-child)::after {
        background: var(--green);
    }

    .animal-preview-cycle li.is-now::before {
        border: 4px solid var(--maize);
    }

    .animal-preview-cycle strong {
        font-weight: 600;
    }

    .animal-preview-cycle span {
        flex-shrink: 0;
        color: var(--text-muted);
        font-weight: 500;
    }

    .desk-shell .animal-preview-section {
        margin: 20px 0 0;
        padding: 0;
        border-radius: 0;
        background: none;
    }

    .animal-preview-facts {
        margin-top: 20px;
        border-top: 1px solid var(--glass-line);
    }

    .desk-shell .animal-preview-actions {
        margin-top: 18px;
    }

    .desk-shell .animal-preview-actions .btn {
        min-height: 50px;
    }

    /* Fiche d'un animal : photo et nom dans le bandeau, chiffres à droite. */
    .desk-shell .page-top--animal .animal-profile {
        flex: 1 1 420px;
        margin: 0;
        padding: 0;
        background: none;
        color: #FFFFFF;
    }

    .desk-shell .page-top--animal .animal-profile :is(.page-title, .animal-profile-name, p) {
        color: #FFFFFF;
    }

    .desk-shell .page-top--animal .animal-stats {
        margin: 0 0 0 auto;
        padding: 14px 8px;
        border: 1px solid var(--glass-ink-edge);
        border-radius: 28px;
        background: var(--glass-ink);
        box-shadow: var(--glass-ink-shine);
        color: #FFFFFF;
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
        backdrop-filter: blur(20px) saturate(1.5);
    }

    .desk-shell .page-top--animal .animal-stats > div {
        padding: 0 20px;
        border: 0;
        background: none;
        text-align: left;
    }

    .desk-shell .page-top--animal .animal-stats :is(strong, span) {
        color: #FFFFFF;
    }

    /* Titre, sous-pages puis boutons : chacun sa place dans le bandeau, quel que soit l'ordre de la page. */
    .desk-shell .page-top > .page-header:has(+ .sub-nav-pills) {
        display: contents;
    }

    .desk-shell .page-top > .page-header:has(+ .sub-nav-pills) > :not(:first-child) {
        order: 2;
        width: 100%;
    }

    .desk-shell .page-top > .sub-nav-pills {
        order: 1;
        margin-right: auto;
    }

    .desk-shell .page-top > .sub-nav-pills ~ * {
        order: 1;
    }

    .desk-shell .page-top .month-switch {
        gap: 10px;
        max-width: none;
        margin: 0 0 0 auto;
    }

    .desk-shell .page-top .month-switch strong {
        min-width: 150px;
        color: #FFFFFF;
        font-size: 18px;
    }

    .desk-shell .page-top .month-switch-btn {
        border: 1px solid rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.14);
        color: #FFFFFF;
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }

    .desk-shell .page-top .month-switch-btn:hover {
        background: rgba(255, 255, 255, 0.28);
    }

    .desk-shell .page-top .result-actions {
        order: 1;
        margin: 0 0 0 auto;
    }

    .desk-shell .page-top--animal .animal-stats {
        order: 2;
        margin-left: 0;
    }

    .desk-shell .page-top--animal .animal-photo-btn {
        min-height: 32px;
        color: #FFFFFF;
    }

    .desk-shell .page-top--animal .animal-profile-photo {
        width: 112px;
    }

    .desk-shell .page-top--animal .animal-profile-status {
        padding: 4px 12px;
        border-radius: 999px;
        font-size: 14px;
    }

    .desk-shell .page-top--stack {
        --band-below: 32px;
    }

    /* Avis : au-dessus du titre, sur la photo ; sous le titre, entre les panneaux. */
    .desk-shell .content > :is(.page-top, .page-header) ~ .alert {
        margin: 0 0 16px;
    }

    .desk-shell .content :is(.result-hero, .result-grid, .animal-next) {
        border: 1px solid var(--glass-edge);
        box-shadow: var(--glass-shine);
        -webkit-backdrop-filter: var(--desk-blur, none);
        backdrop-filter: var(--desk-blur, none);
    }

    .desk-shell .content > .result-hero {
        padding: 26px 28px;
        border-radius: 28px;
        background: var(--glass);
    }

    .desk-shell .result-hero-value {
        font-size: 46px;
    }

    .desk-shell .content > .result-grid {
        margin-bottom: 16px;
        border-radius: 24px;
        background: var(--glass-line);
    }

    .desk-shell .content > .result-grid > div {
        padding: 18px 28px;
        background: var(--glass-solid);
    }

    .desk-shell .content > .animal-next {
        margin-bottom: 16px;
        padding: 18px 24px;
        border-radius: 24px;
        background: var(--glass);
    }

    .desk-shell .content .weight-chart {
        display: block;
        max-width: 460px;
        margin-inline: auto;
    }

    /* Choix d'une période, d'une vue : même piste que les onglets. */
    .desk-shell .content > .pill-nav {
        width: fit-content;
        gap: 2px;
        margin-bottom: 16px;
        padding: 4px;
        border: 1px solid var(--glass-edge);
        border-radius: 30px;
        background: var(--glass);
        box-shadow: var(--glass-shine);
        -webkit-backdrop-filter: var(--desk-blur, none);
        backdrop-filter: var(--desk-blur, none);
    }

    .desk-shell .content > .pill-nav .pill-btn:not(.active) {
        background: transparent;
    }

    .desk-shell .content > .pill-nav .pill-btn:not(.active):hover {
        background: var(--glass-track);
    }

    /* Sous un filtre court, les titres de jour doivent tomber sur le fond uni, pas sur la photo. */
    .desk-shell .content > .page-header:has(+ form.card) {
        --band-below: 58px;
    }

    .desk-shell .plus-page > .page-header {
        --band-below: 0px;
        margin-bottom: 18px;
    }

    .desk-shell .content .plus-page .menu-group,
    .desk-shell .content .plus-page .card {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .desk-shell .content .search-page-form {
        margin-bottom: 20px;
    }

    .desk-shell .content .search-page-form .search-field,
    .desk-shell .content .search-page-form .btn {
        min-height: 52px;
    }

    /* Fiche du jour : le menu du haut ramène déjà à l'accueil. */
    .desk-shell .page-header .pill-nav.is-back {
        display: none;
    }

    .desk-shell .content > :is(.page-top, .page-header) ~ :is(.btn, form > .btn) {
        min-height: 48px;
    }

    .desk-shell .content .check-row {
        border-radius: 20px;
    }

    /* Espaces fondateur et développeur : mêmes onglets que leur barre du bas. */
    .desk-menu-panel--start {
        right: auto;
        left: 0;
    }

    .desk-nav-link .nav-count {
        margin-right: -4px;
        background: #2FD487;
        color: #07110C;
    }

    .desk-nav-link.active .nav-count {
        background: #0E7A48;
        color: #FFFFFF;
    }

    .desk-menu-link .nav-count {
        margin-left: auto;
    }

    .desk-shell--admin .desk-account-farm {
        max-width: 220px;
    }

    .desk-shell .page-top--stack:has(+ .card) {
        --band-below: 150px;
    }

    .desk-shell .page-top--stack .admin-back {
        min-height: 32px;
        margin: 0 0 0 -4px;
    }

    .desk-shell .content > .page-top:has(+ .plus-page) {
        --band-below: 0px;
        margin-bottom: 18px;
    }

    /* Une phrase suit les chiffres (Santé) : la photo s'arrête avant elle. */
    .desk-shell .content > .page-top:has(+ .grid-4 + p) {
        --band-below: 84px;
    }

    .desk-shell .content .admin-filter {
        margin-bottom: 16px;
    }

    .desk-shell .content .admin-filter :is(input, .btn) {
        min-height: 52px;
    }

    .desk-shell .content .admin-filter input {
        border-color: transparent;
    }

    .desk-shell .content .admin-grid-2 {
        gap: 16px;
        margin-bottom: 16px;
    }

    .desk-shell .content .admin-grid-2 > * {
        --desk-blur: inherit;
    }

    .desk-shell .install-banner {
        display: none;
    }

    .desk-shell .content > .alert {
        border-radius: 20px;
        margin-top: 16px;
        margin-bottom: 0;
    }

    /* Navigateurs qui ne savent pas flouter : panneaux presque pleins, toujours lisibles. */
    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .desk-shell {
            --glass-ink: rgba(10, 26, 18, 0.9);
            --glass: rgba(255, 255, 255, 0.97);
            --glass-soft: rgba(255, 255, 255, 0.97);
            --glass-menu: #FFFFFF;
        }

        html[data-theme="dark"] .desk-shell {
            --glass: rgba(14, 27, 20, 0.97);
            --glass-soft: rgba(14, 27, 20, 0.97);
            --glass-menu: #0E1B14;
        }
    }

    /* Même repli pour les personnes qui demandent moins de transparence. */
    @media (prefers-reduced-transparency: reduce) {
        .desk-shell {
            --glass-ink: rgba(10, 26, 18, 0.95);
            --glass: #FFFFFF;
            --glass-soft: #FFFFFF;
            --glass-menu: #FFFFFF;
        }

        html[data-theme="dark"] .desk-shell {
            --glass: #0E1B14;
            --glass-soft: #0E1B14;
            --glass-menu: #0E1B14;
        }
    }

    @media (prefers-reduced-motion: no-preference) {
        .desk-menu[open] > .desk-menu-panel {
            animation: suivelMenuIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
        }
    }
}

@media screen and (min-width: 1240px) and (min-height: 501px), screen and (min-width: 1240px) and (pointer: fine) {
    .desk-account-farm {
        display: block;
    }
}

/* Petits ordinateurs et tablettes à plat : le logo seul, puis « Noter » réduit à son signe. */
@media screen and (min-width: 901px) and (max-width: 1130px) and (min-height: 501px), screen and (min-width: 901px) and (max-width: 1130px) and (pointer: fine) {
    .desk-brand .suivel-brand-text {
        display: none;
    }

    .desk-shell .topbar-right {
        gap: 8px;
    }
}

@media screen and (min-width: 901px) and (max-width: 1010px) and (min-height: 501px), screen and (min-width: 901px) and (max-width: 1010px) and (pointer: fine) {
    .desk-shell .desk-note-btn {
        width: 48px;
        justify-content: center;
        gap: 0;
        padding: 0;
        font-size: 0;
    }
}

@keyframes suivelMenuIn {
    from { opacity: 0; translate: 0 -8px; }
    to { opacity: 1; translate: 0 0; }
}

@media print {
    :root,
    html[data-theme="dark"] {
        --bg: #FFFFFF;
        --surface: #FFFFFF;
        --surface-subtle: #F4F6F5;
        --text: #07110C;
        --text-muted: #52635A;
        --green: #0E7A48;
        --border: #CCCCCC;
    }

    .topbar,
    .bottom-nav,
    .action-drawer,
    .pill-nav,
    .sub-nav-pills,
    .btn,
    .no-print,
    .scroll-top-btn,
    .toast-container,
    .modal-backdrop,
    .pwa-splash,
    .install-banner,
    form {
        display: none !important;
    }

    body,
    .app-shell,
    .main-area,
    .content {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        background: #FFFFFF !important;
        color: #07110C !important;
    }

    .card {
        border: 1px solid #CCCCCC !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .desktop-table-only {
        display: block !important;
    }

    .compact-list {
        display: none !important;
    }

    .table-wrap {
        overflow: visible !important;
        border-color: #CCCCCC !important;
    }

    table {
        font-size: 12px;
    }

    .qr-box {
        border: 2px solid #000000 !important;
        padding: 16px !important;
    }
}

