/* =========================================================
   MON CARNET GOURMAND
   V1.6.0.7d.2 — EN-TÊTE LISIBLE SANS SCROLL
   ========================================================= */

.notebook-overview[hidden],
.notebook-category-screen[hidden],
.notebook-recipe-screen[hidden],
.notebook-empty[hidden],
.notebook-no-results[hidden],
.recipe-library[hidden] {
    display: none !important;
}

.notebook-overview {
    margin-bottom: 14px;
    padding: 15px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background:
        linear-gradient(
            135deg,
            rgba(232, 238, 227, 0.9),
            rgba(255, 255, 255, 0.9)
        );
    box-shadow: var(--shadow-soft);
}

.notebook-overview strong {
    margin-top: 4px;
    display: block;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
}

.notebook-create-button {
    min-height: 42px;
    padding: 9px 12px;
    flex: 0 0 auto;
    border: 1px solid rgba(125, 146, 112, 0.24);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-brown);
    background: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 850;
}

.notebook-create-button span {
    font-size: 17px;
    line-height: 1;
}

.notebook-navigation-shell {
    min-width: 0;
}

/* =========================================================
   ÉCRAN 1 — CATÉGORIES
   ========================================================= */

.notebook-category-screen {
    padding: 14px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: var(--radius-large);
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.96),
            rgba(255, 249, 241, 0.9)
        );
    box-shadow: var(--shadow-soft);
}

.notebook-category-screen-heading {
    margin-bottom: 13px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.notebook-category-screen-heading h2 {
    margin-top: 3px;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 21px;
    line-height: 1.1;
}

.notebook-category-screen-heading p {
    max-width: 190px;
    color: var(--color-text-soft);
    font-size: 9px;
    line-height: 1.45;
    text-align: right;
}

.notebook-category-grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 9px;
}

.notebook-category-card {
    --category-color: #72513f;
    --category-soft: rgba(245, 237, 228, 0.96);

    position: relative;
    min-width: 0;
    min-height: 104px;
    padding: 12px 7px 10px;
    overflow: hidden;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 17px;
    display: grid;
    grid-template-rows:
        34px
        auto
        auto;
    justify-items: center;
    align-content: center;
    gap: 4px;
    color: var(--category-color);
    background:
        linear-gradient(
            150deg,
            rgba(255, 255, 255, 0.9),
            var(--category-soft)
        );
    text-align: center;
    box-shadow:
        0 6px 15px
        rgba(86, 55, 39, 0.06);
    transition:
        transform 160ms ease,
        box-shadow 160ms ease;
}

.notebook-category-card:active {
    transform: scale(0.98);
}

.notebook-category-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--category-color);
}

.notebook-category-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.8);
    font-size: 17px;
}

.notebook-category-name {
    width: 100%;
    overflow: hidden;
    color: var(--category-color);
    font-size: 10px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-category-count {
    color: var(--color-text-soft);
    font-size: 7px;
    font-weight: 750;
}

.notebook-category-arrow {
    position: absolute;
    right: 8px;
    bottom: 7px;
    color: var(--category-color);
    font-size: 15px;
    font-weight: 900;
    opacity: 0.62;
}

.notebook-category-card[data-category="all"] {
    --category-color: #72513f;
    --category-soft: rgba(245, 237, 228, 0.96);
}

.notebook-category-card[data-category="entree"] {
    --category-color: #55704b;
    --category-soft: rgba(224, 237, 216, 0.96);
}

.notebook-category-card[data-category="plat"] {
    --category-color: #a95d3c;
    --category-soft: rgba(247, 227, 220, 0.96);
}

.notebook-category-card[data-category="dessert"] {
    --category-color: #a7556d;
    --category-soft: rgba(249, 226, 234, 0.96);
}

.notebook-category-card[data-category="boisson"] {
    --category-color: #4d7395;
    --category-soft: rgba(225, 238, 249, 0.96);
}

.notebook-category-card[data-category="accompagnement"] {
    --category-color: #957124;
    --category-soft: rgba(249, 238, 202, 0.96);
}

.notebook-category-card[data-category="autre"] {
    --category-color: #765991;
    --category-soft: rgba(236, 228, 246, 0.96);
}

/* =========================================================
   ÉCRAN 2 — RECETTES
   ========================================================= */

.notebook-recipe-screen {
    min-width: 0;
}

.notebook-recipe-screen-header {
    margin-bottom: 12px;
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.notebook-category-back {
    min-width: 105px;
    padding: 10px;
    border: 1px solid rgba(111, 64, 44, 0.12);
    border-radius: 16px;
    display: grid;
    grid-template-columns:
        32px
        minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    color: var(--color-brown-dark);
    background: rgba(255, 255, 255, 0.88);
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.notebook-category-back > span:first-child {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--color-cream-dark);
    font-size: 15px;
}

.notebook-category-back strong {
    display: block;
    font-size: 9px;
}

.notebook-category-back small {
    margin-top: 2px;
    display: block;
    color: var(--color-text-soft);
    font-size: 6px;
    line-height: 1.3;
}

.notebook-current-category {
    --category-color: #72513f;
    --category-soft: rgba(245, 237, 228, 0.92);

    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 16px;
    display: grid;
    grid-template-columns:
        43px
        minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.92),
            var(--category-soft)
        );
    box-shadow: var(--shadow-soft);
}

.notebook-current-category-icon {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--category-color);
    background: rgba(255, 255, 255, 0.78);
    font-size: 21px;
}

.notebook-current-category h2 {
    margin-top: 2px;
    overflow: hidden;
    color: var(--category-color);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-current-category p {
    margin-top: 3px;
    color: var(--color-text-soft);
    font-size: 7px;
}

.notebook-recipe-screen[data-category="entree"]
.notebook-current-category {
    --category-color: #55704b;
    --category-soft: rgba(224, 237, 216, 0.9);
}

.notebook-recipe-screen[data-category="plat"]
.notebook-current-category {
    --category-color: #a95d3c;
    --category-soft: rgba(247, 227, 220, 0.9);
}

.notebook-recipe-screen[data-category="dessert"]
.notebook-current-category {
    --category-color: #a7556d;
    --category-soft: rgba(249, 226, 234, 0.9);
}

.notebook-recipe-screen[data-category="boisson"]
.notebook-current-category {
    --category-color: #4d7395;
    --category-soft: rgba(225, 238, 249, 0.9);
}

.notebook-recipe-screen[data-category="accompagnement"]
.notebook-current-category {
    --category-color: #957124;
    --category-soft: rgba(249, 238, 202, 0.9);
}

.notebook-recipe-screen[data-category="autre"]
.notebook-current-category {
    --category-color: #765991;
    --category-soft: rgba(236, 228, 246, 0.9);
}

.notebook-recipe-tools {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 17px;
    display: grid;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
}

.notebook-search {
    position: relative;
    display: block;
}

.notebook-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
}

.notebook-search input {
    width: 100%;
    min-height: 46px;
    padding: 10px 42px 10px 40px;
    border: 1px solid rgba(111, 64, 44, 0.14);
    border-radius: 14px;
    outline: none;
    color: var(--color-text);
    background: rgba(255, 253, 248, 0.94);
    font: inherit;
    font-size: 11px;
}

.notebook-search input:focus {
    border-color: rgba(201, 120, 82, 0.62);
    box-shadow:
        0 0 0 4px
        rgba(201, 120, 82, 0.1);
}

.notebook-search-clear {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--color-terracotta-dark);
    background: var(--color-rose-soft);
    font-size: 18px;
}

.notebook-search-clear[hidden],
.notebook-results-status button[hidden] {
    display: none;
}

.notebook-recipe-controls {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: end;
    gap: 10px;
}

.notebook-sort {
    display: grid;
    gap: 4px;
}

.notebook-sort > span {
    color: var(--color-text-soft);
    font-size: 7px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.notebook-sort select {
    width: 100%;
    min-height: 37px;
    padding: 7px 28px 7px 9px;
    border: 1px solid rgba(111, 64, 44, 0.12);
    border-radius: 11px;
    outline: none;
    color: var(--color-brown-dark);
    background: rgba(255, 255, 255, 0.86);
    font: inherit;
    font-size: 8px;
    font-weight: 750;
}

.notebook-results-status {
    display: grid;
    justify-items: end;
    gap: 4px;
    text-align: right;
}

.notebook-results-status strong {
    color: var(--color-brown-dark);
    font-size: 8px;
}

.notebook-results-status button {
    border: 0;
    color: var(--color-terracotta-dark);
    background: transparent;
    font-size: 7px;
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =========================================================
   CARTES DE RECETTES
   ========================================================= */

.recipe-library {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    align-items: stretch;
    gap: 9px;
}

.recipe-card {
    --category-color: #765991;
    --category-soft: rgba(236, 228, 246, 0.66);

    position: relative;
    min-width: 0;
    min-height: 178px;
    padding: 12px 10px 10px;
    overflow: hidden;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 17px;
    display: grid;
    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto;
    gap: 8px;
    background:
        linear-gradient(
            150deg,
            rgba(255, 255, 255, 0.97),
            var(--category-soft)
        );
    box-shadow:
        0 7px 18px
        rgba(86, 55, 39, 0.08);
    cursor: pointer;
}

.recipe-card-accent {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--category-color);
}

.recipe-card[data-category="entree"] {
    --category-color: #55704b;
    --category-soft: rgba(224, 237, 216, 0.66);
}

.recipe-card[data-category="plat"] {
    --category-color: #a95d3c;
    --category-soft: rgba(247, 227, 220, 0.66);
}

.recipe-card[data-category="dessert"] {
    --category-color: #a7556d;
    --category-soft: rgba(249, 226, 234, 0.66);
}

.recipe-card[data-category="boisson"] {
    --category-color: #4d7395;
    --category-soft: rgba(225, 238, 249, 0.66);
}

.recipe-card[data-category="accompagnement"] {
    --category-color: #957124;
    --category-soft: rgba(249, 238, 202, 0.66);
}

.recipe-card[data-category="autre"] {
    --category-color: #765991;
    --category-soft: rgba(236, 228, 246, 0.66);
}

.recipe-card-category {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--category-color);
}

.recipe-card-category-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.76);
    font-size: 12px;
}

.recipe-card-category-label {
    min-width: 0;
    overflow: hidden;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.recipe-card-title {
    margin: 0;
    max-height: 3.55em;
    overflow: hidden;
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(13px, 3.4vw, 16px);
    line-height: 1.18;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.recipe-card-open {
    width: 100%;
    min-height: 34px;
    padding: 7px 7px;
    border: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #ffffff;
    background: var(--category-color);
    font-size: 8px;
    font-weight: 900;
}

.recipe-card-open span {
    font-size: 14px;
    line-height: 1;
}

/* =========================================================
   ÉTATS VIDES
   ========================================================= */

.notebook-empty,
.notebook-no-results {
    min-height: 280px;
    padding: 28px 21px;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: var(--radius-large);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.95),
            rgba(255, 248, 238, 0.9)
        );
    box-shadow: var(--shadow-card);
    text-align: center;
}

.notebook-no-results-icon,
.notebook-empty-icon {
    width: 66px;
    height: 66px;
    margin-bottom: 15px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: var(--color-green-soft);
    font-size: 30px;
}

.notebook-no-results h2,
.notebook-empty h2 {
    color: var(--color-brown-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.notebook-no-results p,
.notebook-empty p {
    max-width: 320px;
    margin-top: 10px;
    color: var(--color-text-soft);
    font-size: 11px;
    line-height: 1.55;
}

.notebook-no-results button {
    min-height: 40px;
    margin-top: 15px;
    padding: 8px 12px;
    border: 1px solid rgba(125, 146, 112, 0.24);
    border-radius: 12px;
    color: var(--color-brown);
    background: var(--color-green-soft);
    font-size: 9px;
    font-weight: 850;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 390px) {
    .notebook-overview {
        align-items: flex-start;
        flex-direction: column;
    }

    .notebook-create-button {
        width: 100%;
        justify-content: center;
    }

    .notebook-category-screen-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .notebook-category-screen-heading p {
        max-width: none;
        text-align: left;
    }

    .notebook-recipe-screen-header {
        grid-template-columns: 1fr;
    }

    .notebook-category-back {
        min-width: 0;
    }

    .notebook-recipe-controls {
        grid-template-columns: 1fr;
    }

    .notebook-results-status {
        justify-items: start;
        text-align: left;
    }
}

@media (min-width: 720px) {
    .notebook-category-grid {
        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );
    }

    .recipe-library {
        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );
        gap: 11px;
    }
}

@media (min-width: 980px) {
    .recipe-library {
        grid-template-columns:
            repeat(
                5,
                minmax(0, 1fr)
            );
    }
}

@media (prefers-reduced-motion: reduce) {
    .notebook-category-card {
        transition: none;
    }
}


/* =========================================================
   V1.6.0.7c — CATÉGORIES PREMIUM ET LISIBILITÉ
   ========================================================= */

/* ---------- En-tête de la page catégories ---------- */

.notebook-category-screen {
    padding: 16px;
}

.notebook-category-screen-heading {
    margin-bottom: 16px;
    align-items: center;
}

.notebook-category-screen-heading h2 {
    font-size: 24px;
}

.notebook-category-screen-heading p {
    max-width: 220px;
    font-size: 11px;
    line-height: 1.5;
}

/* ---------- Grille des catégories ---------- */

.notebook-category-grid {
    gap: 10px;
}

.notebook-category-card {
    min-height: 108px;
    padding: 14px 9px 12px;
    grid-template-rows:
        40px
        auto
        auto;
    gap: 5px;
    border-radius: 19px;
}

.notebook-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 20px;
}

.notebook-category-name {
    font-size: 12px;
    line-height: 1.25;
}

.notebook-category-count {
    font-size: 9px;
    line-height: 1.3;
}

.notebook-category-arrow {
    right: 10px;
    bottom: 8px;
    font-size: 18px;
}

/*
 * La carte « Toutes » devient l’entrée principale du carnet.
 * Elle occupe toute la largeur, puis les six catégories
 * restantes forment exactement deux rangées de trois cartes.
 */

.notebook-category-card[data-category="all"] {
    min-height: 82px;
    grid-column: 1 / -1;
    grid-template-columns:
        48px
        minmax(0, 1fr)
        30px;
    grid-template-rows:
        auto
        auto;
    justify-items: start;
    align-items: center;
    align-content: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 13px 15px;
    text-align: left;
}

.notebook-category-card[data-category="all"]
.notebook-category-icon {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 23px;
}

.notebook-category-card[data-category="all"]
.notebook-category-name {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 15px;
    white-space: normal;
}

.notebook-category-card[data-category="all"]
.notebook-category-count {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 10px;
}

.notebook-category-card[data-category="all"]
.notebook-category-arrow {
    position: static;
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    font-size: 25px;
}

/* ---------- Écran des recettes : titres et outils ---------- */

.notebook-category-back {
    min-width: 116px;
    padding: 11px;
}

.notebook-category-back strong {
    font-size: 11px;
}

.notebook-category-back small {
    font-size: 8px;
}

.notebook-current-category {
    padding: 13px 15px;
    grid-template-columns:
        48px
        minmax(0, 1fr);
}

.notebook-current-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 23px;
}

.notebook-current-category h2 {
    font-size: 21px;
}

.notebook-current-category p {
    font-size: 9px;
}

.notebook-recipe-tools {
    padding: 14px;
}

.notebook-search input {
    min-height: 49px;
    font-size: 13px;
}

.notebook-sort > span {
    font-size: 9px;
}

.notebook-sort select {
    min-height: 40px;
    font-size: 10px;
}

.notebook-results-status strong {
    font-size: 10px;
}

.notebook-results-status button {
    font-size: 9px;
}

/* ---------- Cartes de recettes plus lisibles ---------- */

.recipe-card {
    min-height: 184px;
    padding: 13px 11px 11px;
    gap: 9px;
}

.recipe-card-category-icon {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 14px;
}

.recipe-card-category-label {
    font-size: 8.5px;
}

.recipe-card-title {
    font-size: clamp(15px, 3.8vw, 18px);
    line-height: 1.18;
}

.recipe-card-open {
    min-height: 38px;
    font-size: 9.5px;
}

/* ---------- Ajustements petits écrans ---------- */

@media (max-width: 390px) {
    .notebook-category-screen {
        padding: 14px;
    }

    .notebook-category-screen-heading h2 {
        font-size: 22px;
    }

    .notebook-category-screen-heading p {
        font-size: 10px;
    }

    .notebook-category-card {
        min-height: 103px;
    }

    .notebook-category-card[data-category="all"] {
        min-height: 78px;
    }

    .notebook-recipe-screen-header {
        gap: 9px;
    }

    .recipe-card-title {
        font-size: 15px;
    }
}


/* =========================================================
   V1.6.0.7d — PAGE CATÉGORIES SANS SCROLL

   Les cartes de catégories ne sont pas modifiées.
   Seules les zones d’information et leurs espacements
   sont compactés sur le premier écran du Carnet.
   ========================================================= */

/*
 * Les deux blocs supérieurs occupent une seule rangée :
 * - titre du Carnet ;
 * - compteur et bouton Nouvelle recette.
 *
 * Cette disposition s’applique uniquement lorsque l’écran
 * des catégories est affiché.
 */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
) {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
    align-items: stretch;
    column-gap: 9px;
    row-gap: 10px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading {
    min-width: 0;
    min-height: 74px;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(111, 64, 44, 0.1);
    border-radius: 18px;
    align-items: center;
    gap: 9px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading
.back-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading
.section-kicker {
    font-size: 8px;
    line-height: 1.2;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading h1 {
    margin-top: 2px;
    font-size: 25px;
    line-height: 1;
    white-space: nowrap;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview {
    min-width: 0;
    min-height: 74px;
    margin: 0;
    padding: 9px 10px;
    border-radius: 18px;
    gap: 7px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview
.section-kicker {
    font-size: 8px;
    line-height: 1.2;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview strong {
    margin-top: 2px;
    font-size: 18px;
    line-height: 1.05;
    white-space: nowrap;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button {
    min-height: 38px;
    padding: 7px 8px;
    border-radius: 12px;
    gap: 2px;
    font-size: 8px;
    line-height: 1.15;
    text-align: center;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button span {
    font-size: 15px;
}

/*
 * Le contenu dynamique et l’état vide occupent toujours
 * toute la largeur sous les deux blocs supérieurs.
 */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-navigation-shell,
#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-empty {
    grid-column: 1 / -1;
}

/* Introduction du sommaire plus compacte. */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen {
    padding-top: 11px;
    padding-bottom: 11px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen-heading {
    min-height: 0;
    margin-bottom: 9px;
    align-items: center;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen-heading
.section-kicker {
    font-size: 8px;
    line-height: 1.15;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen-heading h2 {
    margin-top: 1px;
    font-size: 20px;
    line-height: 1.05;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen-heading p {
    display: none;
}

/*
 * Aucun changement sur :
 * .notebook-category-card
 * .notebook-category-icon
 * .notebook-category-name
 * .notebook-category-count
 */

/* Très petits écrans : maintien de la rangée compacte. */

@media (max-width: 359px) {
    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    ) {
        column-gap: 7px;
        row-gap: 8px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading,
    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview {
        min-height: 70px;
        padding: 8px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading h1 {
        font-size: 22px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview strong {
        font-size: 16px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    .notebook-create-button {
        padding-right: 6px;
        padding-left: 6px;
        font-size: 7px;
    }
}


/* =========================================================
   V1.6.0.7d.1 — EN-TÊTE COMPACT SANS CHEVAUCHEMENT

   Correction exclusive de la rangée supérieure.
   Les cartes de catégories restent inchangées.
   ========================================================= */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
) {
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(0, 0.92fr);
}

/* ---------- Bloc titre du Carnet ---------- */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading {
    overflow: hidden;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading > div {
    min-width: 0;
    overflow: hidden;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading h1 {
    max-width: 100%;
    overflow: hidden;
    font-size: 23px;
    line-height: 1.02;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Bloc compteur et nouvelle recette ---------- */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview {
    overflow: hidden;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: center;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview > div {
    min-width: 0;
    overflow: hidden;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    min-height: 42px;
    padding: 5px 6px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    overflow: hidden;
    font-size: 7px;
    line-height: 1.1;
    white-space: normal;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button span {
    font-size: 17px;
}

/* ---------- Écrans étroits ---------- */

@media (max-width: 380px) {
    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    ) {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 0.86fr);
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading {
        gap: 7px;
        padding-right: 8px;
        padding-left: 8px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading .back-button {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading h1 {
        font-size: 20px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview {
        padding-right: 7px;
        padding-left: 7px;
        gap: 5px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview strong {
        font-size: 14px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    .notebook-create-button {
        width: 66px;
        min-width: 66px;
        max-width: 66px;
        font-size: 6.5px;
    }
}


/* =========================================================
   V1.6.0.7d.2 — EN-TÊTE LISIBLE SANS SCROLL

   Les cartes de catégories restent strictement inchangées.
   Les deux blocs supérieurs reprennent toute la largeur,
   avec une hauteur réduite et aucun texte tronqué.
   ========================================================= */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
) {
    display: block;
}

/* ---------- Titre du Carnet ---------- */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading {
    width: 100%;
    min-height: 68px;
    margin: 0 0 9px;
    padding: 9px 13px;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 11px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading > div {
    min-width: 0;
    overflow: visible;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading
.back-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading
.section-kicker {
    font-size: 9px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .page-heading h1 {
    max-width: none;
    overflow: visible;
    font-size: 29px;
    line-height: 1;
    text-overflow: clip;
    white-space: nowrap;
}

/* ---------- Compteur et création ---------- */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview {
    width: 100%;
    min-height: 62px;
    margin: 0 0 9px;
    padding: 8px 12px;
    overflow: visible;
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 10px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview > div {
    min-width: 0;
    overflow: visible;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview
.section-kicker {
    font-size: 8px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
> .notebook-overview strong {
    max-width: none;
    overflow: visible;
    font-size: 19px;
    line-height: 1;
    text-overflow: clip;
    white-space: nowrap;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button {
    width: auto;
    min-width: 116px;
    max-width: none;
    min-height: 40px;
    padding: 7px 10px;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    overflow: visible;
    font-size: 9px;
    line-height: 1.15;
    white-space: nowrap;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-create-button span {
    font-size: 18px;
}

/* ---------- Le sommaire reste compact ---------- */

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen {
    padding-top: 10px;
    padding-bottom: 10px;
}

#view-notebook.is-active:has(
    #notebookCategoryScreen:not([hidden])
)
.notebook-category-screen-heading {
    margin-bottom: 8px;
}

/* ---------- Téléphones étroits ---------- */

@media (max-width: 380px) {
    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading {
        min-height: 64px;
        padding-right: 10px;
        padding-left: 10px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .page-heading h1 {
        font-size: 26px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview {
        min-height: 58px;
        padding-right: 9px;
        padding-left: 9px;
        gap: 7px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    > .notebook-overview strong {
        font-size: 17px;
    }

    #view-notebook.is-active:has(
        #notebookCategoryScreen:not([hidden])
    )
    .notebook-create-button {
        min-width: 104px;
        padding-right: 8px;
        padding-left: 8px;
        font-size: 8px;
    }
}
