:root {
    --bg: #e9e1d4;
    --surface: #fffdf8;
    --surface-soft: #f8f2e8;
    --text: #332a23;
    --muted: #7c7064;
    --line: #ded2c2;
    --accent: #8a4937;
    --accent-dark: #643226;
    --accent-soft: #f1e1d9;
    --green: #68745d;
    --danger: #9b342e;
    --radius: 22px;
    --shadow: 0 24px 60px rgba(66, 47, 33, .12);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

body.home-page {
    min-height: 100vh;
    padding: clamp(14px, 2vw, 28px);
    background:
        radial-gradient(circle at top left, rgba(255,255,255,.65), transparent 35%),
        var(--bg);
}

h1, h2, h3, p { margin-top: 0; }

a { color: inherit; }

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-window {
    width: min(1380px, 100%);
    min-height: calc(100vh - clamp(28px, 4vw, 56px));
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid rgba(111, 87, 67, .15);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px clamp(22px, 4vw, 54px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, .96);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.brand-mark svg { width: 31px; height: 31px; }

.brand small,
.brand strong { display: block; }

.brand small {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: .76rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.brand strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 500;
    line-height: 1.15;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-badge {
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: .8rem;
    font-weight: 700;
}

.text-link {
    color: var(--accent-dark);
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
}

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

.home-shell {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
    padding: clamp(44px, 6vw, 84px) 0 clamp(48px, 6vw, 76px);
    flex: 1;
}

.success,
.alert {
    margin-bottom: 24px;
    padding: 14px 18px;
    border-radius: 14px;
}

.success { background: #eaf5ee; color: #2f6b49; }
.alert { background: #f8e8e6; color: var(--danger); }

.welcome {
    max-width: 680px;
    margin-bottom: 34px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.welcome h1 {
    margin-bottom: 8px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.3rem, 5vw, 4.4rem);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.02;
}

.welcome p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .78fr);
    gap: clamp(24px, 4vw, 46px);
    align-items: start;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.action-card {
    min-height: 174px;
    padding: 25px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: rgba(138, 73, 55, .48);
    background: #fffaf3;
}

.action-card:focus-visible,
.latest-recipe:focus-visible,
.print-button:focus-visible,
.text-link:focus-visible,
.brand:focus-visible {
    outline: 3px solid rgba(138, 73, 55, .28);
    outline-offset: 4px;
}

.action-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
}

.action-icon svg { width: 29px; height: 29px; }

.action-copy strong,
.action-copy small { display: block; }

.action-copy strong {
    margin-bottom: 6px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 500;
    line-height: 1.2;
}

.action-copy small {
    color: var(--muted);
    font-size: .91rem;
}

.action-arrow {
    align-self: end;
    color: var(--accent);
    font-size: 1.5rem;
    transition: transform .18s ease;
}

.action-card:hover .action-arrow { transform: translateX(4px); }

.home-sidebar { display: grid; gap: 18px; }

.count-panel,
.latest-panel,
.print-button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.count-panel {
    padding: 24px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    background: var(--accent-dark);
    color: #fffaf5;
}

.count-panel span {
    max-width: 120px;
    font-size: .9rem;
    line-height: 1.25;
}

.count-panel strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
    line-height: 1;
}

.latest-panel {
    padding: 24px;
    background: var(--surface-soft);
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 500;
}

.section-heading a {
    color: var(--accent);
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.section-heading a:hover { text-decoration: underline; }

.latest-list { display: grid; }

.latest-recipe {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
}

.latest-recipe:first-child { border-top: 0; padding-top: 0; }
.latest-recipe:last-child { padding-bottom: 0; }

.latest-thumb {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: #e8dbcb;
    color: var(--accent-dark);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
}

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

.latest-recipe strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
}

.latest-recipe:hover strong { color: var(--accent); }

.empty-state {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .9rem;
}

.print-button {
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    background: var(--green);
    color: #fff;
    text-decoration: none;
    transition: transform .18s ease, filter .18s ease;
}

.print-button:hover { transform: translateY(-2px); filter: brightness(.96); }
.print-button svg { width: 34px; height: 34px; }
.print-button strong,
.print-button small { display: block; }
.print-button strong { margin-bottom: 3px; }
.print-button small { color: rgba(255,255,255,.78); font-size: .78rem; }

.home-footer {
    padding: 16px clamp(22px, 4vw, 54px);
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
}

/* Stili già utilizzati nelle altre pagine */
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 32px clamp(20px, 5vw, 72px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

h1, h2 { font-family: Georgia, serif; font-weight: 500; }
.topbar h1 { font-size: clamp(2rem, 4vw, 4rem); margin: 0; }
.subtitle, .help { color: var(--muted); }
.kicker { display: block; margin-bottom: 6px; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar nav, .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 700; cursor: pointer; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.secondary { background: transparent; }
.shell { width: min(1180px, calc(100% - 36px)); margin: 34px auto 70px; }
.recipe-form { display: grid; gap: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); }
.panel h2 { margin-bottom: 22px; }
.grid { display: grid; gap: 18px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
.field { display: grid; gap: 8px; margin-top: 16px; }
.field span, .check span { font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; }
.field textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; }
.hero { margin: 0 0 26px; }
.hero img { display: block; width: 100%; max-height: 620px; object-fit: cover; border-radius: var(--radius); }
.meta { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.meta div { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.meta span, .meta strong { display: block; }
.meta span { font-size: .82rem; color: var(--muted); }
.intro { max-width: 850px; margin: 34px 0; font-family: Georgia, serif; font-size: 1.25rem; }
.recipe-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.7fr); gap: 24px; align-items: start; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { display: grid; grid-template-columns: minmax(70px, auto) 1fr; gap: 5px 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ingredients small { grid-column: 2; color: var(--muted); }
.note { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-panel { grid-row: span 2; }
}

@media (max-width: 720px) {
    body.home-page { padding: 0; }
    .app-window { min-height: 100vh; border: 0; border-radius: 0; }
    .home-header { align-items: flex-start; }
    .brand small { display: none; }
    .header-actions { max-width: 150px; }
    .admin-badge { display: none; }
    .home-shell { width: min(100% - 28px, 1180px); padding-top: 38px; }
    .main-actions { grid-template-columns: 1fr; }
    .action-card { min-height: 136px; }
    .home-sidebar { grid-template-columns: 1fr; }
    .latest-panel { grid-row: auto; }
    .home-footer { flex-direction: column; gap: 4px; }
    .topbar { flex-direction: column; }
    .two, .four, .meta, .recipe-layout { grid-template-columns: 1fr; }
    .full { grid-column: auto; }
}

@media (max-width: 430px) {
    .home-header { padding: 18px; }
    .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
    .brand strong { font-size: 1.2rem; }
    .action-card { padding: 20px; grid-template-columns: auto 1fr; }
    .action-arrow { display: none; }
    .action-icon { width: 50px; height: 50px; border-radius: 15px; }
}


/* =========================================================
   HOME — MOCKUP APPROVATO
   ========================================================= */

body.home-page {
    padding: 0;
    background: #eef4fa;
    color: #0a3f7c;
}

.app-window {
    width: 100%;
    min-height: 100vh;
    border: 1px solid #b8c7d8;
    border-radius: 0;
    box-shadow: none;
    background: #ffffff;
}

.mockup-header {
    display: block;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #b6cce3;
}

.window-title {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 26px;
    border-bottom: 2px solid #0a4a91;
    color: #111;
    font-size: 1rem;
}

.window-chef {
    color: #0a4a91;
    font-size: 1.35rem;
}

.mockup-branding {
    min-height: 142px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 32px;
    padding: 18px 48px 14px 31%;
    position: relative;
}

.mockup-branding h1 {
    margin: 0;
    color: #0a4a91;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(2rem, 3vw, 3.1rem);
    font-weight: 800;
    letter-spacing: .02em;
    text-align: center;
}

.mockup-branding img {
    display: block;
    width: min(290px, 24vw);
    height: auto;
    object-fit: contain;
}

.home-shell {
    width: 100%;
    padding: 0;
}

.welcome {
    margin: 0;
    padding: 64px 34% 30px 37%;
    max-width: none;
}

.welcome .eyebrow,
.welcome p {
    display: none;
}

.welcome h1 {
    margin: 0;
    color: #0a427f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 600;
    letter-spacing: 0;
}

.mockup-content {
    display: grid;
    grid-template-columns: minmax(260px, 21%) minmax(0, 1fr);
    min-height: 680px;
    border-top: 1px solid #d6e2ee;
}

.kitchen-visual {
    height: 464px;
    min-height: 0;
    align-self: start;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.kitchen-visual img {
    display: block;
    height: 100%;
    width: auto;
    max-width: none;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 31%);
    gap: 0;
    align-items: stretch;
}

.main-actions {
    padding: 0 40px 74px;
    align-content: start;
    gap: 24px;
}

.action-card {
    min-height: 220px;
    padding: 28px 28px 28px 24px;
    border-radius: 16px;
    border: 1px solid #d7dee7;
    background: #fff;
    box-shadow: 0 5px 14px rgba(30, 60, 90, .10);
}

.action-card:hover {
    border-color: #8aafd2;
    background: #fbfdff;
}

.action-icon {
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: #edf5fc;
    color: #0a4a91;
}

.action-icon svg {
    width: 55px;
    height: 55px;
}

.action-copy strong {
    color: #073b76;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.action-copy small {
    color: #333;
    font-size: .95rem;
    line-height: 1.7;
}

.action-arrow {
    color: #0a4a91;
    font-size: 2rem;
    align-self: center;
}

.home-sidebar {
    padding: 18px 44px 40px;
    border-left: 1px solid #b7cde3;
    background: #fbfdff;
    gap: 26px;
}

.count-panel {
    padding: 25px 30px;
    justify-content: center;
    background: #f2f8fd;
    color: #073b76;
    border: 1px solid #bdd4ea;
    border-radius: 10px;
}

.count-panel span {
    max-width: none;
    font-size: 1.15rem;
    font-weight: 700;
}

.count-panel strong {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 3rem;
    font-weight: 700;
}

.latest-panel {
    padding: 0;
    border: 0;
    background: transparent;
}

.section-heading h2 {
    color: #073b76;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.section-heading a {
    display: none;
}

.latest-recipe {
    grid-template-columns: 102px minmax(0, 1fr);
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid #dbe4ed;
}

.latest-thumb {
    width: 102px;
    height: 98px;
    border-radius: 9px;
    background: #edf3f8;
}

.latest-recipe strong {
    color: #073b76;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.print-button {
    grid-template-columns: 48px 1fr;
    min-height: 64px;
    border: 2px solid #0a4a91;
    border-radius: 8px;
    background: #fff;
    color: #0a4a91;
}

.print-button small {
    display: none;
}

.home-footer {
    min-height: 68px;
    padding: 0 48px;
    align-items: center;
    border-top: 1px solid #b7cde3;
    background: #f5faff;
    color: #222;
    font-size: .95rem;
}

@media (max-width: 1050px) {
    .mockup-branding {
        padding-left: 24px;
    }

    .welcome {
        padding: 42px 24px 24px;
    }

    .mockup-content {
        grid-template-columns: 1fr;
    }

    .kitchen-visual {
        display: none;
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        border-left: 0;
        border-top: 1px solid #b7cde3;
    }
}

@media (max-width: 720px) {
    .mockup-branding {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .mockup-branding img {
        width: 230px;
        margin: 0 auto;
    }

    .main-actions {
        padding: 0 18px 36px;
    }

    .home-sidebar {
        padding: 24px 18px 32px;
    }
}


/* =========================================================
   CORREZIONI PROPORZIONI HOME
   ========================================================= */

/* Titolo principale centrato rispetto alle due colonne di pulsanti */
.mockup-branding {
    grid-template-columns: 21% minmax(0, 1fr) 31%;
    padding: 18px 0 14px;
}

.mockup-branding h1 {
    grid-column: 2;
    justify-self: center;
    width: 100%;
    text-align: center;
}

.mockup-branding img {
    grid-column: 3;
    justify-self: center;
    width: min(290px, 82%);
}

/* "Cosa vuoi fare?" centrato rispetto al contenitore dei pulsanti */
.welcome {
    display: grid;
    grid-template-columns: 21% minmax(0, 1fr) 31%;
    padding: 64px 0 30px;
}

.welcome h1 {
    grid-column: 2;
    width: 100%;
    text-align: center;
}

/* L'immagine laterale ha circa la stessa altezza delle due righe di pulsanti */
.mockup-content {
    min-height: 0;
    align-items: start;
}

.kitchen-visual {
    height: 464px;
    min-height: 0;
    align-self: start;
}

.home-layout {
    align-items: start;
}

.main-actions {
    padding: 0 40px;
}

/* La colonna destra non forza più i pulsanti a tutta larghezza */
.home-sidebar {
    align-items: start;
}

.count-panel {
    width: fit-content;
    min-width: 250px;
    padding: 18px 24px;
    justify-content: flex-start;
}

.count-panel span {
    white-space: nowrap;
}

.count-panel strong {
    font-size: 2.35rem;
}

.latest-panel {
    width: 100%;
}

.print-button {
    width: fit-content;
    min-width: 250px;
    min-height: 0;
    padding: 14px 20px;
}

.print-button svg {
    width: 29px;
    height: 29px;
}

@media (max-width: 1050px) {
    .mockup-branding,
    .welcome {
        grid-template-columns: minmax(0, 1fr);
        padding-left: 24px;
        padding-right: 24px;
    }

    .mockup-branding h1,
    .mockup-branding img,
    .welcome h1 {
        grid-column: 1;
    }

    .kitchen-visual {
        display: none;
    }
}

@media (max-width: 720px) {
    .count-panel,
    .print-button {
        width: 100%;
        min-width: 0;
    }
}


/* Area gestione ricette */
.recipe-management-list {
    display: grid;
    gap: 12px;
}

.recipe-management-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.recipe-management-row:last-child {
    border-bottom: 0;
}

.recipe-management-row strong,
.recipe-management-row small {
    display: block;
}

.recipe-management-row small {
    margin-top: 4px;
    color: var(--muted);
}

@media (max-width: 560px) {
    .recipe-management-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   SFOGLIA RICETTE
   ========================================================= */

.browse-page {
    margin: 0;
    min-width: 320px;
    color: #073a78;
    background: #eef5fb;
}

.browse-page .app-window {
    min-height: 100vh;
    background: #fff;
}

.browse-header {
    background: #fff;
    border-bottom: 1px solid #b9d2ec;
}

.browse-header .window-title {
    height: 52px;
    padding: 0 24px;
    border-bottom: 2px solid #0d4b91;
}

.browse-branding {
    min-height: 92px;
    display: grid;
    grid-template-columns: 220px 1fr 270px;
    align-items: center;
}

.browse-home-button {
    width: 126px;
    min-height: 48px;
    margin-left: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 2px solid #07509b;
    border-radius: 9px;
    color: #073f7f;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.browse-home-button svg {
    width: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.browse-title {
    text-align: center;
}

.browse-title h1 {
    margin: 0;
    font-size: clamp(28px, 2.7vw, 42px);
    color: #063e7b;
    letter-spacing: -1px;
}

.title-divider {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.title-divider span {
    width: 100px;
    height: 2px;
    background: #c2d8ed;
}

.title-divider svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #07509b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.browse-logo {
    justify-self: center;
    width: 210px;
    max-height: 80px;
    object-fit: contain;
}

.browse-shell {
    min-height: calc(100vh - 190px);
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    background: linear-gradient(90deg, #fff 0%, #f7fbff 100%);
}

.browse-kitchen {
    align-self: stretch;
    overflow: hidden;
    background: #fff;
}

.browse-kitchen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.browse-content {
    min-width: 0;
    padding: 18px 30px 0 16px;
}

.browse-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr)) auto;
    gap: 16px 38px;
    align-items: end;
    margin-bottom: 20px;
}

.browse-search {
    grid-column: 1 / 4;
    height: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    border: 1px solid #a9c9e8;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(17, 74, 127, .18);
}

.browse-search svg,
.show-all-button svg,
.select-wrap svg {
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    fill: none;
    stroke: #0870d1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.browse-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #25486d;
    background: transparent;
    font: inherit;
    font-size: 18px;
}

.show-all-button {
    min-height: 48px;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid #a9c9e8;
    border-radius: 8px;
    color: #073f7f;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.browse-filter {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.browse-filter > label {
    white-space: nowrap;
    font-weight: 700;
    font-size: 17px;
}

.select-wrap {
    min-width: 0;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
    border: 1px solid #a9c9e8;
    border-radius: 8px;
    background: #fff;
}

.select-wrap svg {
    width: 24px;
    height: 24px;
}

.select-wrap select {
    width: 100%;
    height: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding-right: 12px;
    color: #073f7f;
    background: transparent;
    font: inherit;
    font-weight: 600;
}

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

.browse-recipe-card {
    min-width: 0;
    min-height: 150px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    padding: 12px;
    border: 1px solid #d1dce7;
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 8px rgba(34, 70, 105, .15);
}

.browse-recipe-image {
    width: 190px;
    height: 126px;
    align-self: center;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    background: #eef4fa;
}

.browse-recipe-info {
    min-width: 0;
    padding: 3px 3px 0 18px;
    display: flex;
    flex-direction: column;
}

.browse-recipe-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.browse-recipe-title-row h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #063d79;
    font-size: 21px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.favorite-star {
    color: #ffc000;
    font-size: 29px;
    line-height: 1;
}

.browse-recipe-meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: #123e6e;
    font-size: 15px;
}

.browse-recipe-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.browse-recipe-meta svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.browse-recipe-meta b {
    font-weight: 400;
}

.browse-recipe-bottom {
    margin-top: auto;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.recipe-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-badge,
.rating-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.status-badge.tried {
    color: #14702a;
    background: #e3f5e5;
}

.status-badge.to-try {
    color: #a95e0b;
    background: #fff0dc;
}

.rating-badge {
    color: #865003;
    background: #fff3df;
}

.open-recipe-button {
    min-height: 34px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: 0 0 auto;
    border: 1px solid #6fa9ea;
    border-radius: 9px;
    color: #0455bb;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.open-recipe-button span {
    font-size: 25px;
    line-height: 1;
}

.browse-pagination {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 58px;
}

.browse-pagination a,
.browse-pagination .disabled {
    min-height: 36px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #6fa9ea;
    border-radius: 9px;
    color: #0455bb;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.browse-pagination .disabled {
    opacity: .4;
}

.browse-pagination strong {
    color: #083b75;
}

.browse-empty {
    min-height: 420px;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
}

.browse-empty h2 {
    margin-bottom: 4px;
}

.browse-empty p {
    margin-top: 0;
    color: #536d88;
}

.browse-footer {
    min-height: 44px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #b9d2ec;
    color: #243e5b;
    background: #f6fbff;
}

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

@media (max-width: 1250px) {
    .browse-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .browse-recipe-card {
        grid-template-columns: 145px minmax(0, 1fr);
    }

    .browse-recipe-image {
        width: 145px;
    }

    .browse-recipe-title-row h2 {
        font-size: 18px;
    }

    .browse-recipe-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    .browse-branding {
        grid-template-columns: 160px 1fr 180px;
    }

    .browse-home-button {
        margin-left: 18px;
    }

    .browse-logo {
        width: 165px;
    }

    .browse-kitchen {
        display: none;
    }

    .browse-shell {
        display: block;
    }

    .browse-content {
        padding: 18px;
    }

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

    .browse-search {
        grid-column: 1 / 2;
    }

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

@media (max-width: 680px) {
    .browse-branding {
        grid-template-columns: auto 1fr;
        padding: 12px;
    }

    .browse-logo {
        display: none;
    }

    .browse-home-button {
        width: 52px;
        margin-left: 0;
    }

    .browse-home-button span {
        display: none;
    }

    .browse-title h1 {
        font-size: 25px;
    }

    .browse-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .browse-search {
        grid-column: auto;
    }

    .browse-filter {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .recipe-browser-grid {
        gap: 12px;
    }

    .browse-recipe-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .browse-recipe-image {
        width: 110px;
        height: 110px;
    }

    .browse-recipe-meta {
        font-size: 13px;
    }

    .browse-pagination {
        gap: 8px;
    }

    .browse-pagination a,
    .browse-pagination .disabled {
        padding: 0 8px;
        font-size: 12px;
    }

    .browse-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 8px 14px;
    }
}


/* =========================================================
   PAGINA RICETTA
   ========================================================= */

.recipe-view-page {
    margin: 0;
    min-width: 320px;
    color: #102c4d;
    background: #eef5fb;
}

.recipe-view-header {
    background: #fff;
    border-bottom: 1px solid #bed3e9;
}

.recipe-view-header .window-title {
    height: 52px;
    padding: 0 24px;
    border-bottom: 2px solid #0d4b91;
}

.recipe-view-branding {
    min-height: 92px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 310px;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
}

.recipe-back-button,
.recipe-print-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #82aee0;
    border-radius: 7px;
    color: #064388;
    background: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.recipe-back-button {
    width: 160px;
}

.recipe-print-button {
    width: 118px;
    cursor: pointer;
}

.recipe-heading {
    min-width: 0;
    text-align: center;
}

.recipe-heading h1 {
    margin: 0;
    overflow: hidden;
    color: #063f83;
    font-size: clamp(30px, 3vw, 43px);
    line-height: 1.1;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.recipe-rating {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rating-stars {
    display: inline-flex;
    gap: 3px;
}

.rating-stars span {
    color: #c7d0da;
    font-size: 25px;
    line-height: 1;
}

.rating-stars span.filled {
    color: #ffb000;
}

.rating-number {
    color: #6b7c90;
    font-size: 15px;
}

.recipe-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
}

.recipe-view-logo {
    width: 180px;
    max-height: 76px;
    object-fit: contain;
}

.recipe-view-shell {
    min-height: calc(100vh - 202px);
    display: grid;
    grid-template-columns: 210px 270px minmax(430px, 1fr) 330px;
    background: linear-gradient(90deg, #fff 0%, #fbfdff 100%);
}

.recipe-view-kitchen {
    overflow: hidden;
}

.recipe-view-kitchen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.recipe-info-panel {
    padding: 22px 20px;
    border-right: 1px solid #d0deeb;
    background: rgba(248, 252, 255, .9);
}

.recipe-info-panel h2,
.recipe-content-section h2,
.recipe-side-card h2 {
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #06428a;
    font-size: 18px;
}

.recipe-facts {
    margin: 0;
}

.recipe-facts > div {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 9px 0;
}

.recipe-facts dt {
    color: #07468f;
    font-size: 13px;
    line-height: 1.35;
}

.recipe-facts dd {
    margin: 0;
    color: #293849;
    font-size: 13px;
    line-height: 1.35;
}

.recipe-main-column {
    min-width: 0;
    padding: 14px 16px 20px;
}

.recipe-hero-image {
    width: 100%;
    height: 208px;
    display: block;
    object-fit: cover;
    border-radius: 8px;
    background: #eef3f8;
}

.recipe-content-section {
    padding: 20px 12px 18px;
    border-bottom: 1px solid #bdd3e8;
}

.recipe-content-section:last-child {
    border-bottom: 0;
}

.ingredient-list,
.procedure-list {
    margin: 0;
    padding-left: 30px;
}

.ingredient-list {
    list-style: disc;
}

.ingredient-list li {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    margin: 8px 0;
    color: #161f29;
    font-size: 14px;
}

.ingredient-list small {
    display: block;
    margin-top: 2px;
    color: #718093;
}

.ingredient-quantity {
    white-space: nowrap;
}

.procedure-list li {
    padding-left: 8px;
    margin: 0 0 8px;
    color: #161f29;
    font-size: 14px;
    line-height: 1.5;
}

.recipe-side-column {
    padding: 14px 24px 14px 0;
}

.recipe-side-card {
    margin-bottom: 14px;
    padding: 20px;
    border: 1px solid #d0dce7;
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tag-list span {
    padding: 8px 18px;
    border-radius: 18px;
    color: #08428a;
    background: #e9eef6;
    font-size: 13px;
    font-weight: 700;
}

.side-text {
    color: #1d2732;
    font-size: 14px;
    line-height: 1.65;
}

.recipe-note {
    padding: 14px;
    border-radius: 7px;
    color: #30291c;
    background: #fff4d8;
    font-size: 14px;
    font-style: italic;
    line-height: 1.65;
}

.recipe-empty-text {
    color: #718093;
    font-size: 14px;
}

.recipe-view-footer {
    min-height: 92px;
    padding: 0 86px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr) auto;
    gap: 36px;
    align-items: center;
    border-top: 1px solid #bdd3e8;
    background: #f8fbfe;
}

.recipe-nav-slot {
    min-width: 0;
}

.recipe-nav-slot.next {
    text-align: right;
}

.recipe-nav-slot a {
    min-height: 64px;
    padding: 0 20px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #d2dfe9;
    border-radius: 7px;
    color: #073f83;
    background: #fff;
    text-decoration: none;
}

.recipe-nav-slot strong,
.recipe-nav-slot small {
    display: block;
}

.recipe-nav-slot small {
    margin-top: 6px;
    overflow: hidden;
    color: #617084;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.recipe-position {
    color: #003f91;
    font-weight: 700;
    white-space: nowrap;
}

.recipe-edit-button {
    min-height: 48px;
    padding: 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #fff;
    background: #064a98;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .recipe-view-shell {
        grid-template-columns: 170px 240px minmax(380px, 1fr) 280px;
    }

    .recipe-facts > div {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .recipe-view-footer {
        padding: 0 28px;
        gap: 18px;
    }
}

@media (max-width: 1040px) {
    .recipe-view-branding {
        grid-template-columns: 170px 1fr 190px;
        padding: 0 16px;
    }

    .recipe-header-actions {
        gap: 10px;
    }

    .recipe-view-logo {
        width: 130px;
    }

    .recipe-view-kitchen {
        display: none;
    }

    .recipe-view-shell {
        grid-template-columns: 240px minmax(0, 1fr) 280px;
    }

    .recipe-view-footer {
        grid-template-columns: 1fr auto 1fr;
    }

    .recipe-edit-button {
        grid-column: 1 / -1;
        justify-self: center;
        margin-bottom: 14px;
    }
}

@media (max-width: 780px) {
    .recipe-view-branding {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .recipe-header-actions {
        display: none;
    }

    .recipe-back-button {
        width: 52px;
    }

    .recipe-back-button span:last-child {
        display: none;
    }

    .recipe-heading h1 {
        font-size: 25px;
    }

    .recipe-view-shell {
        display: block;
    }

    .recipe-info-panel,
    .recipe-main-column,
    .recipe-side-column {
        padding: 16px;
        border-right: 0;
    }

    .recipe-side-column {
        padding-top: 0;
    }

    .recipe-hero-image {
        height: 220px;
    }

    .recipe-view-footer {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
        text-align: center;
    }

    .recipe-nav-slot.next {
        text-align: center;
    }

    .recipe-nav-slot a {
        width: 100%;
        box-sizing: border-box;
    }

    .recipe-edit-button {
        grid-column: auto;
        margin-bottom: 0;
    }
}

@media print {
    .recipe-view-page {
        background: #fff;
    }

    .window-title,
    .recipe-back-button,
    .recipe-print-button,
    .recipe-view-kitchen,
    .recipe-view-footer {
        display: none !important;
    }

    .recipe-view-branding {
        min-height: 78px;
        grid-template-columns: 1fr auto;
        padding: 0;
    }

    .recipe-heading {
        text-align: left;
    }

    .recipe-view-logo {
        width: 150px;
    }

    .recipe-view-shell {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr) 260px;
        min-height: auto;
    }

    .recipe-info-panel,
    .recipe-main-column,
    .recipe-side-column {
        break-inside: avoid;
    }
}


/* =========================================================
   CERCA RICETTE
   ========================================================= */

.search-page {
    margin: 0;
    min-width: 320px;
    color: #153457;
    background: #edf4fa;
}

.search-header {
    background: #fff;
    border-bottom: 1px solid #bdd2e8;
}

.search-header .window-title {
    height: 52px;
    padding: 0 24px;
    border-bottom: 2px solid #0c4b91;
}

.search-branding {
    min-height: 94px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 250px;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
}

.search-home-button {
    width: 136px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid #3779be;
    border-radius: 7px;
    color: #084482;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.search-home-button svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.search-page-title {
    text-align: center;
}

.search-page-title h1 {
    margin: 0;
    color: #084486;
    font-size: clamp(30px, 3vw, 42px);
    line-height: 1.1;
}

.search-page-title .title-divider {
    width: 290px;
    max-width: 80%;
    margin: 10px auto 0;
}

.search-logo {
    justify-self: end;
    width: 205px;
    max-height: 82px;
    object-fit: contain;
}

.search-shell {
    min-height: calc(100vh - 202px);
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    background: #fff;
}

.search-kitchen {
    overflow: hidden;
    border-right: 1px solid #c8d9e9;
}

.search-kitchen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.search-content {
    min-width: 0;
    padding: 26px 26px 14px;
}

.recipe-search-form {
    text-align: center;
}

.recipe-search-form > h2 {
    margin: 0 0 16px;
    color: #084487;
    font-size: 24px;
}

.main-search-field {
    width: min(900px, 78%);
    min-height: 62px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid #aebccb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(17, 47, 80, .11);
}

.main-search-field svg {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    fill: none;
    stroke: #0d3766;
    stroke-width: 1.9;
}

.main-search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    color: #26384c;
    background: transparent;
    font: inherit;
    font-size: 20px;
}

.main-search-field input::placeholder {
    color: #788393;
    opacity: 1;
}

.main-search-button {
    width: 246px;
    min-height: 50px;
    margin: 14px auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(180deg, #0d579e 0%, #064687 100%);
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.main-search-button svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.advanced-toggle {
    margin: 0 auto 16px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    color: #0550a0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.advanced-toggle .toggle-arrow {
    font-size: 24px;
    line-height: .5;
    transition: transform .2s ease;
}

.advanced-toggle.collapsed .toggle-arrow {
    transform: rotate(-90deg);
}

.advanced-search {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) 180px;
    gap: 20px;
    align-items: end;
    padding: 16px 26px 14px;
    border: 1px solid #b5cee8;
    border-radius: 8px;
    background: linear-gradient(180deg, #f7fbff 0%, #f1f6fb 100%);
    text-align: left;
}

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

.advanced-filter label {
    display: block;
    margin: 0 0 9px 4px;
    color: #0a3d79;
    font-size: 14px;
    font-weight: 700;
}

.advanced-select,
.sort-select {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid #c7d2df;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(20, 55, 90, .08);
}

.advanced-select > span,
.sort-select > span {
    color: #1263b7;
    font-size: 20px;
}

.advanced-select select,
.sort-select select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #263342;
    background: transparent;
    font: inherit;
    font-size: 14px;
}

.advanced-checks {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 13px;
    color: #2e3945;
    font-size: 14px;
}

.advanced-checks label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.advanced-checks input {
    width: 18px;
    height: 18px;
    accent-color: #0c54a0;
}

.check-star,
.small-star {
    color: #f3ad00;
    font-size: 22px;
    line-height: 1;
}

.reset-search {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0756ab;
    font-weight: 700;
    text-decoration: none;
}

.search-results-heading {
    margin: 16px 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.search-results-heading h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #083d79;
    font-size: 17px;
}

.search-sort {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #14365d;
    font-size: 13px;
}

.sort-select {
    min-width: 166px;
    min-height: 34px;
}

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

.search-recipe-card {
    min-width: 0;
    min-height: 126px;
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d7dee6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(17, 44, 76, .08);
}

.search-recipe-image {
    width: 144px;
    height: 100%;
    min-height: 126px;
    display: block;
    object-fit: cover;
}

.search-recipe-body {
    min-width: 0;
    padding: 11px 12px 10px 18px;
    display: flex;
    flex-direction: column;
}

.search-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.search-card-heading h3 {
    margin: 2px 0 8px;
    overflow: hidden;
    color: #073f80;
    font-size: 18px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.search-favorite {
    color: #0d4c91;
    font-size: 30px;
    line-height: 1;
}

.search-favorite.active {
    color: #f2a800;
}

.search-card-meta,
.search-status-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #303a45;
    font-size: 13px;
}

.search-card-meta b,
.search-status-rating b {
    color: #183b64;
    font-weight: 400;
}

.difficulty-bars {
    color: #17a836;
    font-size: 18px;
}

.search-card-footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.search-status {
    font-size: 21px;
    line-height: 1;
}

.search-status.tried {
    color: #20b636;
}

.search-status.to-try {
    color: #f1a900;
}

.search-open-button {
    min-width: 134px;
    min-height: 38px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #84aee0;
    border-radius: 6px;
    color: #06438a;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.search-empty {
    margin: 30px auto;
    padding: 42px;
    border: 1px solid #d6e0ea;
    border-radius: 10px;
    background: #f8fbfe;
    text-align: center;
}

.search-empty h2 {
    color: #073f80;
}

.search-empty a {
    color: #064a98;
    font-weight: 700;
}

.search-pagination {
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
}

.search-pagination a,
.search-pagination span {
    min-width: 132px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #b8cde3;
    border-radius: 6px;
    color: #0a4a90;
    background: #fff;
    text-decoration: none;
}

.search-pagination .disabled {
    color: #a7b4c3;
    background: #f8fafc;
}

.search-pagination strong {
    color: #0d3765;
    white-space: nowrap;
}

.search-footer {
    min-height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid #bdd3e8;
    color: #354253;
    background: #f7fafe;
    font-size: 14px;
}

.search-footer strong {
    color: #06458e;
}

@media (max-width: 1280px) {
    .search-branding {
        grid-template-columns: 180px minmax(0, 1fr) 200px;
    }

    .search-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .advanced-search {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .advanced-checks {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .reset-search {
        align-self: center;
    }

    .search-recipe-card {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .search-recipe-image {
        width: 120px;
    }
}

@media (max-width: 980px) {
    .search-kitchen {
        display: none;
    }

    .search-shell {
        display: block;
    }

    .search-branding {
        grid-template-columns: 160px minmax(0, 1fr) 150px;
        padding: 0 16px;
    }

    .search-logo {
        width: 145px;
    }

    .main-search-field {
        width: calc(100% - 36px);
    }

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

    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .search-branding {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .search-logo {
        display: none;
    }

    .search-home-button {
        width: 52px;
    }

    .search-home-button span {
        display: none;
    }

    .search-content {
        padding: 18px 12px;
    }

    .main-search-field {
        width: auto;
    }

    .main-search-field input {
        font-size: 16px;
    }

    .advanced-search {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .advanced-checks {
        grid-column: auto;
        align-items: flex-start;
        flex-direction: column;
    }

    .reset-search {
        align-self: flex-start;
    }

    .search-results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-sort {
        width: 100%;
    }

    .sort-select {
        flex: 1;
    }

    .search-recipe-card {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    .search-recipe-image {
        width: 105px;
    }

    .search-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-open-button {
        align-self: stretch;
    }

    .search-pagination {
        gap: 8px;
    }

    .search-pagination a,
    .search-pagination span {
        min-width: 0;
        padding: 0 10px;
    }

    .search-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px 18px;
    }
}

/* =========================================================
   PAGINA RICETTA — RIFINITURA PROFESSIONALE
   ========================================================= */

.recipe-view-page {
    --recipe-blue: #06458e;
    --recipe-blue-dark: #073a78;
    --recipe-blue-soft: #eef6fd;
    --recipe-border: #c8daeb;
    --recipe-shadow: 0 6px 18px rgba(23, 65, 108, .09);
    background: #edf4fa;
}

.recipe-view-page .app-window {
    overflow: visible;
}

.recipe-view-branding {
    position: relative;
    background: rgba(255, 255, 255, .98);
}

.recipe-back-button,
.recipe-print-button,
.recipe-nav-slot a,
.recipe-edit-button {
    transition: border-color .18s ease, background-color .18s ease, color .18s ease,
                box-shadow .18s ease, transform .18s ease;
}

.recipe-back-button:hover,
.recipe-print-button:hover,
.recipe-nav-slot a:hover {
    border-color: #4d8dcc;
    background: #f5faff;
    box-shadow: 0 4px 12px rgba(18, 76, 132, .10);
    transform: translateY(-1px);
}

.recipe-edit-button:hover {
    background: #043d80;
    box-shadow: 0 5px 14px rgba(4, 61, 128, .22);
    transform: translateY(-1px);
}

.recipe-back-button:focus-visible,
.recipe-print-button:focus-visible,
.recipe-nav-slot a:focus-visible,
.recipe-edit-button:focus-visible {
    outline: 3px solid rgba(25, 109, 190, .28);
    outline-offset: 3px;
}

.recipe-heading h1 {
    padding-inline: 8px;
    text-wrap: balance;
}

.recipe-view-shell {
    align-items: stretch;
}

.recipe-info-panel,
.recipe-side-column {
    align-self: start;
}

.recipe-info-panel {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #aac5df transparent;
}

.recipe-info-panel h2,
.recipe-content-section h2,
.recipe-side-card h2 {
    letter-spacing: -.01em;
}

.recipe-facts > div {
    border-bottom: 1px solid rgba(190, 211, 232, .52);
}

.recipe-facts > div:last-child {
    border-bottom: 0;
}

.recipe-facts dt {
    font-weight: 700;
}

.recipe-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.recipe-status.is-tried {
    color: #188936;
}

.recipe-status.is-to-try {
    color: #a56b00;
}

.recipe-fact-rating,
.recipe-favorite-mark.is-active {
    color: #e9a300;
    font-weight: 700;
}

.recipe-main-column {
    padding-top: 16px;
}

.recipe-hero-image {
    height: clamp(220px, 28vw, 360px);
    border: 1px solid #d2dfeb;
    box-shadow: var(--recipe-shadow);
}

.uses-default-image .recipe-hero-image {
    object-fit: contain;
    padding: 28px;
    background: linear-gradient(145deg, #f7fbff, #eaf3fb);
}

.recipe-content-section {
    padding-inline: 14px;
}

.ingredient-list li {
    position: relative;
    padding: 2px 0 2px 2px;
}

.ingredient-list li::before {
    content: '';
    position: absolute;
    left: -17px;
    top: .72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #1261ac;
}

.ingredient-list {
    list-style: none;
}

.ingredient-quantity {
    color: #143f70;
    font-weight: 700;
}

.procedure-list {
    counter-reset: recipe-step;
    padding-left: 0;
    list-style: none;
}

.procedure-list li {
    counter-increment: recipe-step;
    position: relative;
    min-height: 32px;
    padding: 4px 0 10px 42px;
    margin-bottom: 5px;
}

.procedure-list li::before {
    content: counter(recipe-step);
    position: absolute;
    top: 1px;
    left: 0;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #aac7e3;
    border-radius: 50%;
    color: #07509b;
    background: #f4f9fe;
    font-size: 12px;
    font-weight: 800;
}

.recipe-side-column {
    position: sticky;
    top: 0;
}

.recipe-side-card {
    box-shadow: 0 3px 12px rgba(31, 72, 113, .06);
}

.recipe-side-card:last-child {
    margin-bottom: 0;
}

.tag-list span {
    border: 1px solid transparent;
    transition: border-color .15s ease, background-color .15s ease;
}

.tag-list span:hover {
    border-color: #b5cee7;
    background: #f0f6fc;
}

.side-text {
    white-space: normal;
}

.recipe-note {
    border-left: 4px solid #e2b64c;
    box-shadow: inset 0 0 0 1px rgba(224, 181, 69, .12);
}

.recipe-view-footer {
    position: relative;
    z-index: 2;
}

.recipe-nav-slot a {
    max-width: 290px;
}

.recipe-nav-slot.next a {
    margin-left: auto;
}

@media (max-width: 1280px) {
    .recipe-info-panel,
    .recipe-side-column {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .recipe-hero-image {
        height: clamp(220px, 25vw, 310px);
    }
}

@media (max-width: 780px) {
    .recipe-view-page .app-window {
        overflow: hidden;
    }

    .recipe-view-branding {
        min-height: 78px;
    }

    .recipe-rating {
        flex-wrap: wrap;
    }

    .rating-stars span {
        font-size: 21px;
    }

    .recipe-info-panel {
        background: #f7fbff;
        border-bottom: 1px solid var(--recipe-border);
    }

    .recipe-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 18px;
    }

    .recipe-facts > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .recipe-hero-image {
        height: clamp(210px, 54vw, 340px);
    }
}

@media (max-width: 480px) {
    .recipe-facts {
        grid-template-columns: 1fr;
    }

    .recipe-heading h1 {
        font-size: 22px;
        white-space: normal;
    }

    .recipe-content-section h2,
    .recipe-side-card h2,
    .recipe-info-panel h2 {
        font-size: 17px;
    }

    .ingredient-list li {
        grid-template-columns: 66px minmax(0, 1fr);
    }

    .recipe-position {
        white-space: normal;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    .recipe-view-page,
    .recipe-view-page .app-window {
        background: #fff !important;
    }

    .recipe-view-page .app-window {
        overflow: visible;
    }

    .recipe-view-header {
        border-bottom: 1px solid #aebfd0;
    }

    .recipe-view-branding {
        min-height: 64px;
    }

    .recipe-heading h1 {
        font-size: 24pt;
        white-space: normal;
    }

    .recipe-view-shell {
        grid-template-columns: 48mm minmax(0, 1fr);
        gap: 5mm;
    }

    .recipe-info-panel {
        position: static;
        max-height: none;
        padding: 4mm;
        border: 1px solid #ccd7e1;
    }

    .recipe-main-column {
        padding: 0;
    }

    .recipe-side-column {
        position: static;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4mm;
        padding: 4mm 0 0;
    }

    .recipe-side-card {
        margin: 0;
        padding: 4mm;
        box-shadow: none;
        break-inside: avoid;
    }

    .recipe-hero-image {
        height: 62mm;
        box-shadow: none;
    }

    .recipe-content-section {
        padding: 5mm 0;
    }

    .recipe-facts > div {
        grid-template-columns: 25mm minmax(0, 1fr);
        padding: 2mm 0;
    }

    .ingredient-list li,
    .procedure-list li,
    .side-text,
    .recipe-note {
        font-size: 9.5pt;
    }
}

/* =========================================================
   RICETTA — CORREZIONE DEFINITIVA ANTEPRIMA DI STAMPA
   ========================================================= */
@media print {
    .recipe-view-shell {
        display: grid !important;
        grid-template-columns: 44mm minmax(0, 1fr) !important;
        column-gap: 6mm !important;
        align-items: start !important;
        width: 100% !important;
    }

    .recipe-info-panel {
        grid-column: 1 !important;
        min-width: 0 !important;
        width: 44mm !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    .recipe-facts {
        display: block !important;
        width: 100% !important;
    }

    .recipe-facts > div {
        display: block !important;
        width: 100% !important;
        padding: 2.2mm 0 !important;
        border-bottom: 1px solid #d7e0e8 !important;
    }

    .recipe-facts > div:last-child {
        border-bottom: 0 !important;
    }

    .recipe-facts dt,
    .recipe-facts dd {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        white-space: normal !important;
    }

    .recipe-facts dt {
        margin-bottom: 0.8mm !important;
        font-size: 8pt !important;
        line-height: 1.2 !important;
    }

    .recipe-facts dd {
        font-size: 9pt !important;
        line-height: 1.3 !important;
    }

    .recipe-main-column {
        grid-column: 2 !important;
        min-width: 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .recipe-hero-image {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 58mm !important;
        object-fit: cover !important;
        box-sizing: border-box !important;
    }

    .recipe-content-section,
    .ingredient-list,
    .procedure-list {
        min-width: 0 !important;
        width: 100% !important;
    }

    .recipe-side-column {
        grid-column: 1 / -1 !important;
        clear: both !important;
    }
}

/* =========================================================
   NUOVA RICETTA — EDITOR RIFINITO
   ========================================================= */
body.recipe-editor-page {
    margin: 0;
    min-width: 320px;
    background: #edf4fa;
    color: #123d6d;
}

.recipe-editor-page .app-window {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #f7fbff;
}

.recipe-editor-header {
    background: #fff;
    border-bottom: 1px solid #b9d2ec;
}

.recipe-editor-header .window-title {
    min-height: 52px;
    border-bottom: 2px solid #0d4b91;
}

.recipe-editor-branding {
    min-height: 116px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 250px;
    align-items: center;
    gap: 24px;
    padding: 14px 42px;
}

.recipe-editor-back {
    width: fit-content;
    min-width: 132px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid #07509b;
    border-radius: 9px;
    color: #073f7f;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.recipe-editor-back:hover {
    background: #eef6fd;
    transform: translateX(-2px);
}

.recipe-editor-title {
    text-align: center;
}

.recipe-editor-title > span {
    display: block;
    margin-bottom: 3px;
    color: #1871bd;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .13em;
}

.recipe-editor-title h1 {
    margin: 0;
    color: #063e7b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(29px, 3vw, 43px);
    font-weight: 800;
    letter-spacing: -.025em;
}

.recipe-editor-title p {
    margin: 6px 0 0;
    color: #56718d;
    font-size: .94rem;
}

.recipe-editor-logo {
    justify-self: end;
    width: min(215px, 100%);
    max-height: 84px;
    object-fit: contain;
}

.recipe-editor-shell {
    width: min(1420px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 46px;
}

.recipe-editor-alert {
    margin: 0 0 22px;
    padding: 15px 18px;
    border: 1px solid #edb7b2;
    border-radius: 10px;
    color: #8c2722;
    background: #fff1ef;
    font-weight: 700;
}

.recipe-editor-form {
    display: grid;
    gap: 24px;
}

.recipe-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.recipe-editor-main {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.editor-panel,
.editor-side-panel {
    border: 1px solid #c7d9ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(27, 72, 112, .08);
}

.editor-panel {
    padding: 26px 28px 30px;
}

.editor-panel-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 17px;
    border-bottom: 1px solid #dce8f2;
}

.editor-panel-number {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #07509b;
    font-weight: 800;
}

.editor-panel-heading h2,
.editor-side-panel h2 {
    margin: 0;
    color: #073f7f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
}

.editor-panel-heading p,
.editor-side-panel header p {
    margin: 4px 0 0;
    color: #647d95;
    font-size: .89rem;
}

.editor-grid {
    display: grid;
    gap: 18px 20px;
}

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

.editor-field-full {
    grid-column: 1 / -1;
}

.editor-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.editor-field > span {
    color: #174b7c;
    font-size: .9rem;
    font-weight: 800;
}

.editor-field > span b {
    color: #b3261e;
}

.editor-field input,
.editor-field select,
.editor-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #a9c7e2;
    border-radius: 9px;
    color: #193e63;
    background: #fff;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.editor-field input,
.editor-field select {
    min-height: 46px;
    padding: 10px 13px;
}

.editor-field textarea {
    padding: 13px 14px;
    line-height: 1.55;
    resize: vertical;
}

.editor-field input::placeholder,
.editor-field textarea::placeholder {
    color: #91a5b8;
}

.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
    outline: 0;
    border-color: #1673c3;
    box-shadow: 0 0 0 3px rgba(22, 115, 195, .14);
    background: #fbfdff;
}

.editor-field select:disabled {
    color: #8a9bab;
    background: #edf2f6;
    cursor: not-allowed;
}

.editor-field small {
    color: #6d8195;
    font-size: .8rem;
    line-height: 1.45;
}

.editor-input-suffix {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.editor-input-suffix input {
    border-radius: 9px 0 0 9px;
}

.editor-input-suffix > span {
    min-width: 76px;
    display: grid;
    place-items: center;
    padding: 0 12px;
    border: 1px solid #a9c7e2;
    border-left: 0;
    border-radius: 0 9px 9px 0;
    color: #56718d;
    background: #f1f7fc;
    font-size: .82rem;
    font-weight: 700;
}

.ingredient-format-guide {
    margin-bottom: 12px;
    padding: 10px 13px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border: 1px dashed #8eb7dc;
    border-radius: 9px;
    color: #245b8e;
    background: #f2f8fd;
    font-size: .82rem;
    font-weight: 700;
}

.ingredient-format-guide i {
    color: #87a3bd;
    font-style: normal;
}

.editor-ingredients-textarea {
    font-family: Consolas, 'Courier New', monospace !important;
    font-size: .92rem !important;
}

.editor-notes-grid {
    margin-top: 18px;
}

.recipe-editor-sidebar {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 18px;
}

.editor-side-panel {
    padding: 21px;
}

.editor-side-panel header {
    margin-bottom: 16px;
}

.image-upload-preview {
    position: relative;
    height: 205px;
    margin-bottom: 13px;
    overflow: hidden;
    border: 1px solid #c8d8e7;
    border-radius: 11px;
    background: #edf3f8;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.image-upload-preview > span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    overflow: hidden;
    padding: 7px 9px;
    border-radius: 7px;
    color: #fff;
    background: rgba(5, 48, 91, .82);
    font-size: .76rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.editor-file-button {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 1px solid #65a2da;
    border-radius: 9px;
    color: #07509b;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}

.editor-file-button:hover {
    background: #eef7ff;
}

.editor-file-button:focus-within,
.editor-file-input:focus + .editor-file-button {
    outline: 3px solid rgba(22, 115, 195, .2);
    outline-offset: 2px;
}

.editor-side-help {
    margin: 9px 0 0;
    color: #71869a;
    font-size: .77rem;
    text-align: center;
}

.editor-side-panel .editor-field + .editor-field {
    margin-top: 14px;
}

.editor-choice {
    margin-top: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    border: 1px solid #cbdbe9;
    border-radius: 10px;
    background: #f8fbfe;
    cursor: pointer;
}

.editor-choice input {
    width: 17px;
    height: 17px;
    accent-color: #07509b;
}

.editor-choice-icon {
    color: #f0a500;
    font-size: 22px;
    text-align: center;
}

.editor-choice strong,
.editor-choice small {
    display: block;
}

.editor-choice strong {
    color: #174b7c;
    font-size: .88rem;
}

.editor-choice small {
    margin-top: 2px;
    color: #71869a;
    font-size: .75rem;
    line-height: 1.35;
}

.editor-reminder-panel {
    color: #184d78;
    background: #eef7fd;
}

.editor-reminder-panel ul {
    margin: 13px 0 0;
    padding-left: 19px;
    color: #56718d;
    font-size: .84rem;
    line-height: 1.7;
}

.recipe-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    min-height: 82px;
    padding: 15px 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border: 1px solid #bfd3e6;
    border-radius: 13px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -5px 18px rgba(22, 66, 105, .1);
    backdrop-filter: blur(8px);
}

.editor-cancel-button,
.editor-save-button {
    min-height: 48px;
    padding: 0 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.editor-cancel-button {
    border: 1px solid #9fb8cf;
    color: #315c83;
    background: #fff;
}

.editor-save-button {
    border: 1px solid #07509b;
    color: #fff;
    background: #07509b;
    box-shadow: 0 4px 10px rgba(7, 80, 155, .2);
}

.editor-save-button:hover,
.editor-cancel-button:hover {
    transform: translateY(-1px);
    filter: brightness(.98);
}

.recipe-editor-page a:focus-visible,
.recipe-editor-page button:focus-visible,
.recipe-editor-page label:focus-within {
    outline-color: rgba(22, 115, 195, .45);
}

@media (max-width: 1050px) {
    .recipe-editor-branding {
        grid-template-columns: 150px minmax(0, 1fr) 190px;
        padding-right: 24px;
        padding-left: 24px;
    }

    .recipe-editor-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}

@media (max-width: 860px) {
    .recipe-editor-branding {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .recipe-editor-logo {
        display: none;
    }

    .recipe-editor-layout {
        grid-template-columns: 1fr;
    }

    .recipe-editor-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editor-reminder-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .recipe-editor-branding {
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 18px;
        text-align: center;
    }

    .recipe-editor-back {
        min-width: 0;
        justify-self: start;
    }

    .recipe-editor-title p {
        display: none;
    }

    .recipe-editor-shell {
        width: calc(100% - 24px);
        padding-top: 15px;
    }

    .editor-panel {
        padding: 20px 17px 22px;
    }

    .editor-grid-two,
    .recipe-editor-sidebar {
        grid-template-columns: 1fr;
    }

    .editor-field-full,
    .editor-reminder-panel {
        grid-column: auto;
    }

    .ingredient-format-guide {
        align-items: flex-start;
    }

    .recipe-editor-actions {
        padding: 12px;
    }

    .editor-cancel-button,
    .editor-save-button {
        flex: 1 1 0;
        padding: 0 13px;
    }
}

/* =========================================================
   MODIFICA RICETTA, CRONOLOGIA E DUPLICAZIONE
   ========================================================= */
.recipe-editor-success {
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 1px solid #a8d7b5;
    border-radius: 10px;
    color: #17622f;
    background: #edf9f0;
    font-weight: 700;
}
.edit-recipe-facts { margin: 0; display: grid; gap: 0; }
.edit-recipe-facts div { padding: 11px 0; border-top: 1px solid #dbe7f2; }
.edit-recipe-facts div:first-child { border-top: 0; padding-top: 0; }
.edit-recipe-facts dt { color: #66809c; font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.edit-recipe-facts dd { margin: 3px 0 0; color: #073f7f; font-weight: 700; overflow-wrap: anywhere; }
.editor-remove-choice { margin-top: 14px; }
.editor-remove-choice .editor-choice-icon { color: #a13b35; background: #fff0ee; }
.edit-history-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.edit-history-list li { padding-left: 14px; border-left: 3px solid #b8d5ee; }
.edit-history-list time { color: #52718f; font-size: .78rem; font-weight: 700; }
.edit-history-list p { margin: 3px 0 0; color: #173e67; font-size: .9rem; line-height: 1.45; }
.edit-duplicate-panel p { color: #5d7187; font-size: .9rem; }
.editor-duplicate-button,
.editor-secondary-save {
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid #0a5ca8;
    border-radius: 9px;
    color: #07509b;
    background: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.editor-duplicate-button { width: 100%; }
.edit-save-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.management-row-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.management-row-actions form { margin: 0; }
@media (max-width: 720px) {
    .edit-actions { align-items: stretch; }
    .edit-save-buttons { width: 100%; display: grid; }
    .editor-secondary-save, .edit-save-buttons .editor-save-button { width: 100%; }
    .management-row-actions { width: 100%; }
}
/* =========================================================
   GESTIONE RICETTE
   ========================================================= */

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

.management-page {
    background:
        radial-gradient(circle at 8% 0%, rgba(18, 109, 184, .08), transparent 29rem),
        #f4f7fb;
}

.management-shell {
    display: grid;
    gap: 22px;
    max-width: 1540px;
}

.management-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.management-summary-card {
    position: relative;
    min-width: 0;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid #dbe6f1;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(26, 63, 99, .055);
}

.management-summary-card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -38px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(13, 100, 175, .055);
}

.management-summary-label {
    display: block;
    margin-bottom: 5px;
    color: #52718f;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.management-summary-card strong {
    position: relative;
    z-index: 1;
    display: block;
    color: #073f7f;
    font-size: clamp(1.7rem, 2.5vw, 2.35rem);
    line-height: 1;
}

.management-summary-card small {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 8px;
    color: #6d8094;
    font-size: .84rem;
}

.management-workspace {
    overflow: hidden;
    border: 1px solid #d8e4ef;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(26, 63, 99, .075);
}

.management-toolbar {
    padding: 24px;
    border-bottom: 1px solid #e1e9f1;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.management-toolbar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}

.management-toolbar-heading h2 {
    margin: 2px 0 3px;
    color: #073f7f;
    font-size: 1.42rem;
}

.management-toolbar-heading p {
    margin: 0;
    color: #6a7f94;
    font-size: .9rem;
}

.management-section-kicker {
    color: #1a70b9;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.management-new-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    white-space: nowrap;
}

.management-new-button span {
    font-size: 1.15rem;
    line-height: 1;
}

.management-filters {
    display: grid;
    grid-template-columns: minmax(270px, 1.65fr) minmax(160px, .65fr) minmax(150px, .6fr);
    gap: 14px;
    align-items: end;
}

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

.management-search svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    fill: none;
    stroke: #62809d;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.management-search input,
.management-select select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cddbe8;
    border-radius: 10px;
    color: #163e66;
    background: #fff;
    font: inherit;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.management-search input {
    padding: 10px 14px 10px 43px;
}

.management-search input:focus,
.management-select select:focus {
    border-color: #2b82c6;
    box-shadow: 0 0 0 3px rgba(43, 130, 198, .13);
}

.management-select {
    display: grid;
    gap: 6px;
}

.management-select > span {
    color: #4f6d89;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.management-select select {
    padding: 9px 36px 9px 12px;
}

.management-toggle-group {
    grid-column: 1 / -2;
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.management-toggle {
    position: relative;
    cursor: pointer;
}

.management-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.management-toggle span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #d1deea;
    border-radius: 999px;
    color: #476783;
    background: #fff;
    font-size: .84rem;
    font-weight: 700;
    transition: .17s ease;
}

.management-toggle span::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border: 2px solid #9eb3c6;
    border-radius: 50%;
    transition: .17s ease;
}

.management-toggle input:checked + span {
    border-color: #2b82c6;
    color: #07509b;
    background: #eef7ff;
}

.management-toggle input:checked + span::before {
    border-color: #1a70b9;
    background: #1a70b9;
    box-shadow: inset 0 0 0 2px #eef7ff;
}

.management-toggle input:focus-visible + span {
    outline: 3px solid rgba(43, 130, 198, .25);
    outline-offset: 2px;
}

.management-reset {
    min-height: 38px;
    padding: 7px 4px;
    border: 0;
    color: #4d6b86;
    background: transparent;
    font: inherit;
    font-size: .84rem;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.management-reset:hover {
    color: #07509b;
}

.management-table-wrap {
    position: relative;
    overflow-x: auto;
}

.management-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
}

.management-table th {
    padding: 12px 13px;
    border-bottom: 1px solid #dce6ef;
    color: #5c758e;
    background: #f5f8fb;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.management-table th:first-child {
    padding-left: 22px;
}

.management-table th:last-child {
    padding-right: 22px;
}

.management-table td {
    padding: 13px;
    border-bottom: 1px solid #e8eef4;
    color: #294d70;
    font-size: .87rem;
    vertical-align: middle;
}

.management-table tbody tr {
    transition: background .16s ease, box-shadow .16s ease;
}

.management-table tbody tr:hover {
    background: #f9fcff;
}

.management-table tbody tr:last-child td {
    border-bottom: 0;
}

.management-table tr[hidden] {
    display: none;
}

.management-photo-column {
    width: 76px;
}

.management-photo-cell {
    padding-left: 22px !important;
}

.management-thumbnail {
    display: block;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid #d5e1ec;
    border-radius: 11px;
    background: #edf3f8;
    box-shadow: 0 3px 9px rgba(31, 66, 99, .08);
}

.management-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.management-thumbnail:hover img {
    transform: scale(1.04);
}

.management-title-cell {
    min-width: 245px;
}

.management-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.management-title-line > a {
    color: #0a4d8d;
    font-size: .98rem;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
}

.management-title-line > a:hover {
    color: #0872c5;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.management-favorite {
    color: #d78c00;
    font-size: 1.05rem;
}

.management-title-meta {
    display: flex;
    gap: 7px 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: #76899c;
    font-size: .74rem;
}

.management-title-meta span {
    position: relative;
}

.management-title-meta span + span::before {
    content: "•";
    position: absolute;
    left: -8px;
    color: #b4c1cd;
}

.management-title-meta .is-public {
    color: #18703a;
    font-weight: 700;
}

.management-title-meta .is-private {
    color: #8a6270;
    font-weight: 700;
}

.management-category {
    display: inline-flex;
    max-width: 170px;
    padding: 5px 9px;
    overflow: hidden;
    border: 1px solid #d5e3ee;
    border-radius: 999px;
    color: #365f82;
    background: #f5f9fc;
    font-size: .78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.management-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: max-content;
    font-size: .8rem;
    font-weight: 750;
}

.management-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.management-status.is-tried {
    color: #247041;
}

.management-status.is-tried span {
    background: #36a65a;
    box-shadow: 0 0 0 3px rgba(54, 166, 90, .12);
}

.management-status.is-to-try {
    color: #9a6424;
}

.management-status.is-to-try span {
    background: #e5a13c;
    box-shadow: 0 0 0 3px rgba(229, 161, 60, .14);
}

.management-rating {
    color: #db9309;
    font-size: .91rem;
    letter-spacing: .02em;
    white-space: nowrap;
}

.management-rating span {
    color: #c9d3dc;
}

.management-time,
.management-table time {
    color: #456683;
    white-space: nowrap;
}

.management-muted {
    color: #93a2b1;
    font-size: .8rem;
}

.management-sort {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.management-sort:hover,
.management-sort.is-active {
    color: #0759a3;
}

.management-sort-indicator {
    min-width: 10px;
    color: #8ca2b6;
    font-size: .65rem;
}

.management-sort.is-active .management-sort-indicator {
    color: #1672bd;
}

.management-actions-heading {
    width: 216px;
    text-align: right !important;
}

.management-actions-cell {
    padding-right: 22px !important;
}

.management-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    opacity: .7;
    transition: opacity .16s ease;
}

.management-row:hover .management-actions,
.management-actions:focus-within {
    opacity: 1;
}

.management-actions form {
    margin: 0;
}

.management-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #466985;
    background: transparent;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease, transform .16s ease;
}

.management-icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.management-icon-button:hover {
    border-color: #cbddeb;
    color: #0759a3;
    background: #eef7ff;
    transform: translateY(-1px);
}

.management-icon-button:focus-visible {
    outline: 3px solid rgba(43, 130, 198, .24);
    outline-offset: 1px;
}

.management-icon-button.is-danger:hover {
    border-color: #efd0cd;
    color: #a73934;
    background: #fff1ef;
}

.management-empty-filter,
.management-empty-static {
    padding: 62px 24px;
    text-align: center;
}

.management-empty-filter h3,
.management-empty-static h3 {
    margin: 12px 0 6px;
    color: #184f82;
}

.management-empty-filter p,
.management-empty-static p {
    margin: 0 0 18px;
    color: #6a8094;
}

.management-empty-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #2777b7;
    background: #edf7ff;
    font-size: 1.7rem;
}

.management-print-frame {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 1px;
    height: 1px;
    border: 0;
    visibility: hidden;
}

@media (max-width: 1120px) {
    .management-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .management-filters {
        grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .7fr) minmax(145px, .7fr);
    }
}

@media (max-width: 760px) {
    .management-shell {
        gap: 15px;
    }

    .management-summary {
        gap: 10px;
    }

    .management-summary-card {
        padding: 17px;
    }

    .management-summary-card small {
        display: none;
    }

    .management-workspace {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .management-toolbar {
        padding: 18px;
        border: 1px solid #d8e4ef;
        border-radius: 15px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(26, 63, 99, .055);
    }

    .management-toolbar-heading {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 17px;
    }

    .management-new-button {
        width: 100%;
    }

    .management-filters {
        grid-template-columns: 1fr;
    }

    .management-toggle-group {
        grid-column: auto;
    }

    .management-reset {
        justify-self: start;
    }

    .management-table-wrap {
        overflow: visible;
    }

    .management-table {
        display: block;
        min-width: 0;
    }

    .management-table thead {
        display: none;
    }

    .management-table tbody {
        display: grid;
        gap: 12px;
    }

    .management-table tr {
        position: relative;
        display: grid;
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 0 12px;
        padding: 15px;
        border: 1px solid #d8e4ef;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 7px 20px rgba(26, 63, 99, .055);
    }

    .management-table td {
        display: block;
        padding: 7px 0;
        border: 0;
    }

    .management-photo-cell {
        grid-row: 1 / span 2;
        padding: 0 !important;
    }

    .management-thumbnail {
        width: 68px;
        height: 68px;
    }

    .management-title-cell {
        min-width: 0;
        padding-top: 0 !important;
    }

    .management-table td:not(.management-photo-cell):not(.management-title-cell):not(.management-actions-cell) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        align-items: center;
        border-top: 1px solid #edf1f5;
    }

    .management-table td:not(.management-photo-cell):not(.management-title-cell):not(.management-actions-cell)::before {
        content: attr(data-label);
        color: #70869a;
        font-size: .7rem;
        font-weight: 800;
        letter-spacing: .045em;
        text-transform: uppercase;
    }

    .management-actions-cell {
        grid-column: 1 / -1;
        margin-top: 5px;
        padding: 10px 0 0 !important;
        border-top: 1px solid #e5edf3 !important;
    }

    .management-actions {
        justify-content: flex-start;
        opacity: 1;
    }

    .management-icon-button {
        width: 39px;
        height: 39px;
        border-color: #d7e3ed;
        background: #fbfdff;
    }
}

@media (max-width: 470px) {
    .management-summary {
        grid-template-columns: 1fr 1fr;
    }

    .management-summary-card {
        padding: 14px;
        border-radius: 12px;
    }

    .management-summary-card strong {
        font-size: 1.65rem;
    }

    .management-summary-label {
        font-size: .66rem;
    }

    .management-toolbar {
        padding: 15px;
    }

    .management-toggle-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .management-toggle span {
        width: 100%;
    }

    .management-table tr {
        grid-template-columns: 58px minmax(0, 1fr);
        padding: 13px;
    }

    .management-thumbnail {
        width: 56px;
        height: 56px;
    }

    .management-title-line > a {
        font-size: .91rem;
    }

    .management-title-meta {
        gap: 5px 10px;
    }

    .management-actions {
        justify-content: space-between;
    }
}


/* =========================================================
   ACCESSO HOME NELLA COLONNA SINISTRA DELL'HEADER
   ========================================================= */

.mockup-access {
    grid-column: 1;
    justify-self: start;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 34px;
}

.mockup-access .text-link {
    color: #0d4b91;
    font-weight: 700;
    text-decoration: none;
}

.mockup-access .text-link:hover {
    text-decoration: underline;
}

@media (max-width: 1050px) {
    .mockup-access {
        grid-column: 1;
        justify-self: center;
        padding-left: 0;
        margin-bottom: 10px;
    }
}


/* =========================================================
   RIFINITURE HOME E HEADER GESTIONE RICETTE
   ========================================================= */

.mockup-access-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #073f7f;
    font-weight: 700;
    text-decoration: none;
}

.mockup-access-link svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mockup-access-link:hover {
    color: #0a5ca8;
    text-decoration: none;
}

.management-page {
    color: #073f7f;
    background: #eef5fb;
}

.management-header {
    background: #fff;
    border-bottom: 1px solid #b9d2ec;
}

.management-header .window-title {
    height: 52px;
    padding: 0 24px;
    border-bottom: 2px solid #0d4b91;
}

.management-branding {
    min-height: 112px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 330px;
    align-items: center;
    gap: 20px;
    padding: 12px 34px;
}

.management-home-button,
.management-logout-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #9fc3e4;
    border-radius: 9px;
    color: #073f7f;
    background: #fff;
    font-weight: 700;
    text-decoration: none;
}

.management-home-button {
    width: 126px;
}

.management-logout-button {
    width: 104px;
}

.management-home-button svg,
.management-logout-button svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.management-home-button:hover,
.management-logout-button:hover {
    border-color: #0a5ca8;
    background: #f4f9fd;
}

.management-page-title {
    text-align: center;
}

.management-page-title > span {
    display: block;
    margin-bottom: 3px;
    color: #7c604f;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
}

.management-page-title h1 {
    margin: 0;
    color: #063e7b;
    font-size: clamp(28px, 2.7vw, 42px);
    letter-spacing: -1px;
}

.management-page-title .title-divider svg {
    width: 29px;
    height: 29px;
}

.management-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.management-logo {
    width: 190px;
    max-height: 76px;
    object-fit: contain;
}

.management-page .management-shell {
    max-width: 1540px;
    padding-top: 26px;
}

@media (max-width: 1050px) {
    .management-branding {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 20px 24px;
    }

    .management-header-actions {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .management-header-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .management-home-button,
    .management-logout-button {
        width: 100%;
        max-width: 240px;
    }
}


/* =========================================================
   RICETTA — LAYOUT DI STAMPA DEDICATO
   ========================================================= */

.recipe-print-layout {
    display: none;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 9mm 10mm;
    }

    html,
    body {
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #172536 !important;
        font-family: Arial, Helvetica, sans-serif !important;
    }

    /*
     * La pagina web non viene adattata alla stampa:
     * viene nascosta e sostituita da un layout autonomo.
     */
    .recipe-view-page > .app-window {
        display: none !important;
    }

    .recipe-print-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .print-recipe-title {
        width: 100%;
        margin: 0 0 3mm;
        padding: 4mm 5mm 3.5mm;
        border: 1px solid #7799b8;
        border-radius: 2mm;
        box-sizing: border-box;
        text-align: center;
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .print-recipe-title h1 {
        margin: 0;
        color: #073f7f;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 20pt;
        font-weight: 600;
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    .print-recipe-rating {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3mm;
        margin-top: 1.5mm;
        color: #d89200;
        font-size: 10pt;
    }

    .print-recipe-rating strong {
        color: #52677c;
        font-size: 8.5pt;
    }

    .print-recipe-facts {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        width: 100%;
        margin: 0 0 3mm;
        border: 1px solid #9fb7cd;
        border-radius: 2mm;
        overflow: hidden;
        box-sizing: border-box;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-recipe-facts > div {
        min-width: 0;
        padding: 2.2mm 2.5mm;
        border-right: 1px solid #d3e0eb;
        box-sizing: border-box;
    }

    .print-recipe-facts > div:last-child {
        border-right: 0;
    }

    .print-recipe-facts span,
    .print-recipe-facts strong {
        display: block;
    }

    .print-recipe-facts span {
        margin-bottom: .6mm;
        color: #5d7690;
        font-size: 6.5pt;
        font-weight: 700;
        letter-spacing: .035em;
        text-transform: uppercase;
    }

    .print-recipe-facts strong {
        color: #1c344e;
        font-size: 7.8pt;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .print-recipe-top {
        display: grid;
        grid-template-columns: minmax(55mm, 42%) minmax(0, 1fr);
        width: 100%;
        margin: 0 0 3mm;
        border: 1px solid #7799b8;
        border-radius: 2mm;
        overflow: hidden;
        box-sizing: border-box;
        background: #fff;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-recipe-photo {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        min-width: 0;
        padding: 4mm;
        border-right: 1px solid #7799b8;
        box-sizing: border-box;
        background: #f7fafc;
    }

    .print-recipe-photo img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: 72mm;
        margin: 0;
        object-fit: contain;
        object-position: center top;
    }

    .uses-default-image .print-recipe-photo img {
        max-height: 55mm;
        padding: 4mm;
        box-sizing: border-box;
    }

    .print-recipe-ingredients {
        min-width: 0;
        padding: 4mm 4.5mm;
        box-sizing: border-box;
    }

    .print-recipe-ingredients h2,
    .print-recipe-procedure h2 {
        margin: 0 0 2mm;
        padding-bottom: 1.4mm;
        border-bottom: 1px solid #cbdbe8;
        color: #06428a;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 12pt;
        line-height: 1.15;
    }

    .print-recipe-ingredients ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .print-recipe-ingredients li {
        display: grid;
        grid-template-columns: 23mm minmax(0, 1fr);
        gap: 1.5mm;
        margin: 0 0 1.1mm;
        font-size: 8.2pt;
        line-height: 1.18;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-ingredient-quantity {
        color: #264d70;
        font-weight: 700;
        white-space: nowrap;
    }

    .print-recipe-ingredients small {
        display: block;
        margin-top: .3mm;
        color: #667b90;
        font-size: 7.2pt;
        line-height: 1.15;
    }

    .print-recipe-procedure {
        width: 100%;
        margin: 0 0 3mm;
        padding: 4mm 4.5mm;
        border: 1px solid #7799b8;
        border-radius: 2mm;
        box-sizing: border-box;
        background: #fff;
    }

    .print-recipe-procedure ol {
        margin: 0;
        padding: 0;
        list-style: none;
        counter-reset: print-step;
    }

    .print-recipe-procedure li {
        position: relative;
        counter-increment: print-step;
        min-height: 4.5mm;
        margin: 0 0 1.5mm;
        padding: 0 0 0 9mm;
        font-size: 8.5pt;
        line-height: 1.27;
        text-indent: 0;
        orphans: 3;
        widows: 3;
    }

    .print-recipe-procedure li::before {
        content: counter(print-step) ".";
        position: absolute;
        top: 0;
        left: 0;
        width: 7mm;
        color: #06428a;
        font-weight: 700;
        text-align: right;
        line-height: 1.27;
    }

    .print-recipe-notes {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3mm;
        width: 100%;
        margin: 0 0 3mm;
        box-sizing: border-box;
    }

    .print-recipe-notes > div {
        min-width: 0;
        padding: 3mm;
        border: 1px solid #a9bdcf;
        border-radius: 2mm;
        box-sizing: border-box;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-recipe-notes h3 {
        margin: 0 0 1mm;
        color: #06428a;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 9pt;
    }

    .print-recipe-notes p {
        margin: 0;
        font-size: 7.5pt;
        line-height: 1.25;
    }

    .print-recipe-footer {
        display: flex;
        justify-content: space-between;
        gap: 6mm;
        padding-top: 2mm;
        border-top: 1px solid #c4d4e1;
        color: #718294;
        font-size: 7pt;
    }
}


/* =========================================================
   FORM RICETTA — TEMPO CON UNITÀ SELEZIONABILE
   ========================================================= */

.editor-time-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    align-items: stretch;
}

.editor-time-control input {
    min-width: 0;
    border-radius: 8px 0 0 8px !important;
}

.editor-time-control select {
    min-width: 0;
    padding: 0 12px;
    border: 1px solid #a9c9e8;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    color: #073f7f;
    background: #f5faff;
    font: inherit;
    font-weight: 700;
}

@media (max-width: 520px) {
    .editor-time-control {
        grid-template-columns: minmax(0, 1fr) 100px;
    }
}


/* =========================================================
   FORM RICETTA — CARATTERISTICHE ALIMENTARI
   ========================================================= */

.food-characteristics-panel {
    border-color: #c9dceb;
}

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

.food-characteristic-choice {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #bfd3e5;
    border-radius: 9px;
    background: #f8fbfe;
    color: #173c63;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
}

.food-characteristic-choice:hover {
    border-color: #7da8cf;
    background: #f1f7fc;
}

.food-characteristic-choice input {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    accent-color: #0d4b91;
}

.food-characteristic-choice:has(input:checked) {
    border-color: #0d4b91;
    background: #eaf4fc;
    color: #073f7f;
}

.food-characteristics-help {
    margin: 10px 0 0;
    color: #60778e;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .food-characteristics-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   CARATTERISTICHE ALIMENTARI — BADGE E FILTRI
   ========================================================= */

.recipe-food-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.recipe-food-badge,
.print-food-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #a9c9e8;
    border-radius: 999px;
    background: #eef6fd;
    color: #0b4a8b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.food-filter-box {
    margin: 14px 0 0;
    padding: 14px;
    border: 1px solid #c7d9e8;
    border-radius: 10px;
    background: #f8fbfe;
}

.food-filter-box legend,
.browse-filter-label {
    color: #0a4686;
    font-weight: 800;
}

.food-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
}

.food-filter-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    cursor: pointer;
    color: #274a6e;
    font-size: 14px;
    font-weight: 700;
}

.food-filter-options input {
    width: 16px;
    height: 16px;
    accent-color: #0d4b91;
}

.food-filter-help {
    display: block;
    margin: 9px 0 0;
    color: #62798f;
    font-size: 12px;
    line-height: 1.4;
}

.browse-food-filter {
    min-width: 260px;
}

@media print {
    .recipe-food-badges {
        display: none !important;
    }

    .print-food-badges {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2mm;
        margin: 0 0 3mm;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-food-badges span {
        min-height: 0;
        padding: 1.3mm 2.3mm;
        border-radius: 10mm;
        font-size: 7.5pt;
    }
}

@media (max-width: 720px) {
    .browse-food-filter {
        min-width: 0;
        width: 100%;
    }
}


/* =========================================================
   SFOGLIA — PANNELLO CARATTERISTICHE ALIMENTARI V2
   ========================================================= */

.browse-controls {
    align-items: end;
}

/* Il pannello occupa tutta la larghezza tra ricerca e filtri ordinari. */
.browse-food-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(230px, 1.05fr) minmax(0, 4fr);
    gap: 22px;
    margin: 4px 0 4px;
    padding: 20px;
    border: 1px solid #b8d2ec;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(248,252,255,.97), rgba(255,255,255,.98));
    box-sizing: border-box;
    box-shadow: 0 6px 18px rgba(35, 84, 132, .055);
}

.browse-food-intro {
    align-self: center;
    padding: 4px 2px;
}

.browse-food-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.browse-food-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #1564b8;
    font-size: 28px;
    line-height: 1;
}

.browse-food-intro h2 {
    margin: 0;
    color: #083f7d;
    font-size: 17px;
    line-height: 1.2;
}

.browse-food-intro p {
    margin: 12px 0 0;
    max-width: 330px;
    color: #31597f;
    font-size: 13px;
    line-height: 1.55;
}

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

.browse-food-choice {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    column-gap: 12px;
    min-height: 138px;
    padding: 16px 15px 14px;
    border: 1px solid #bfd5eb;
    border-radius: 12px;
    background: #fff;
    color: #173e67;
    box-sizing: border-box;
    cursor: pointer;
    transition:
        border-color .16s ease,
        background .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

.browse-food-choice:hover {
    border-color: #78a9d6;
    box-shadow: 0 7px 16px rgba(24, 75, 126, .08);
    transform: translateY(-1px);
}

.browse-food-choice input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.browse-food-choice-icon {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1px;
    color: #397e3c;
    font-size: 38px;
    line-height: 1;
}

.browse-food-choice:nth-child(3) .browse-food-choice-icon {
    color: #df9400;
}

.browse-food-choice:nth-child(4) .browse-food-choice-icon {
    color: #2b7bc9;
}

.browse-food-choice-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.browse-food-choice-copy strong {
    display: block;
    margin: 1px 0 8px;
    color: #073f7f;
    font-size: 15px;
    line-height: 1.2;
}

.browse-food-choice-copy small {
    display: block;
    color: #496885;
    font-size: 11.5px;
    line-height: 1.45;
}

.browse-food-check {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: 22px;
    height: 22px;
    margin-top: 12px;
    border: 1.5px solid #73869b;
    border-radius: 5px;
    background: #fff;
    box-sizing: border-box;
    transition: .15s ease;
}

.browse-food-choice.is-checked {
    border-color: #0e58a2;
    background: #f1f7fd;
    box-shadow: inset 0 0 0 1px rgba(14,88,162,.06);
}

.browse-food-choice.is-checked .browse-food-check {
    border-color: #0e58a2;
    background: #0e58a2;
}

.browse-food-choice.is-checked .browse-food-check::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.browse-food-filter,
.food-filter-help {
    /* Neutralizza il vecchio layout della prima implementazione. */
    min-width: 0;
}

/* I filtri normali restano su una sola fascia sotto il pannello. */
.browse-controls > .browse-filter:not(.browse-food-filter) {
    align-self: end;
}

@media (max-width: 1180px) {
    .browse-food-panel {
        grid-template-columns: 1fr;
    }

    .browse-food-intro p {
        max-width: none;
    }

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

@media (max-width: 720px) {
    .browse-food-panel {
        padding: 14px;
    }

    .browse-food-options {
        grid-template-columns: 1fr;
    }

    .browse-food-choice {
        min-height: 112px;
    }
}


/* =========================================================
   INGREDIENTI — ELENCO SEMPLICE A LARGHEZZA COMPLETA
   ========================================================= */

/*
 * Il nuovo formato usa una sola riga completa per ogni ingrediente.
 * La vecchia griglia 76px + testo era pensata per quantità/unità separate
 * e restringeva la voce alla prima colonna.
 */
.ingredient-list li {
    display: block;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.45;
    overflow-wrap: normal;
    word-break: normal;
}

.ingredient-list li > span {
    display: block;
    width: 100%;
    min-width: 0;
}

.ingredient-list {
    width: 100%;
    box-sizing: border-box;
}

/* Stessa correzione nella stampa. */
@media print {
    .print-recipe-ingredients li {
        display: block;
        width: 100%;
        margin: 0 0 1.1mm;
        font-size: 8.2pt;
        line-height: 1.22;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-recipe-ingredients li > span {
        display: block;
        width: 100%;
        min-width: 0;
    }
}


/* =========================================================
   STAMPA — RIPRISTINO PUNTI ELENCO INGREDIENTI
   ========================================================= */

@media print {
    .print-recipe-ingredients ul {
        margin: 0;
        padding-left: 4.5mm;
        list-style: disc outside;
    }

    .print-recipe-ingredients li {
        display: list-item;
        width: 100%;
        padding-left: .5mm;
        margin: 0 0 1.1mm;
        font-size: 8.2pt;
        line-height: 1.22;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-recipe-ingredients li::marker {
        color: #0d4b91;
        font-size: .9em;
    }

    .print-recipe-ingredients li > span {
        display: inline;
        width: auto;
        min-width: 0;
    }
}

/* =========================================================
   VALUTAZIONE IN DECIMI — 5 STELLE CON MEZZE STELLE
   ========================================================= */
.editor-rating-field { align-items: flex-start; }
.editor-star-rating {
    display: inline-flex;
    gap: 5px;
    width: max-content;
    padding: 5px 0 2px;
    cursor: pointer;
    user-select: none;
}
.editor-star-rating.is-disabled { cursor: not-allowed; opacity: .48; }
.editor-rating-star,
.rating-stars span,
.print-rating-star {
    position: relative;
    display: inline-block;
    color: #c7d0da;
}
.editor-rating-star { font-size: 31px; line-height: 1; }
.editor-rating-star.is-full,
.rating-stars span.filled,
.print-rating-star.is-full { color: #ffb000; }
.editor-rating-star.is-half,
.rating-stars span.half,
.print-rating-star.is-half {
    color: #c7d0da;
}
.editor-rating-star.is-half::before,
.rating-stars span.half::before,
.print-rating-star.is-half::before {
    content: '★';
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    color: #ffb000;
    white-space: nowrap;
}
.editor-rating-value {
    display: block;
    margin-top: 2px;
    color: var(--accent-dark);
    font-size: .95rem;
}
.editor-star-rating:focus-visible {
    outline: 3px solid rgba(138, 73, 55, .28);
    outline-offset: 4px;
    border-radius: 6px;
}
@media print {
    .print-recipe-rating > span { display: inline-flex; gap: .5mm; }
    .print-rating-star { line-height: 1; }
}


/* =========================================================
   VALUTAZIONE — 10 CAPPELLI DEL RICETTARIO
   ========================================================= */

.editor-hat-rating {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
    margin-top: 7px;
    max-width: 260px;
}

.editor-rating-hat {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 2px;
    cursor: pointer;
    border-radius: 7px;
    line-height: 1;
    transition: transform .12s ease, background .12s ease;
}

.editor-rating-hat img,
.recipe-rating-hat {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(1);
    opacity: .18;
    transition: opacity .12s ease, filter .12s ease, transform .12s ease;
}

.editor-rating-hat.is-filled img,
.recipe-rating-hat.is-filled {
    filter: none;
    opacity: 1;
}

.editor-rating-hat:hover,
.editor-rating-hat:focus-visible {
    background: rgba(13, 75, 145, .08);
    outline: none;
}

.editor-rating-hat:hover img,
.editor-rating-hat:focus-visible img {
    transform: translateY(-1px);
}

.editor-hat-rating.is-disabled {
    opacity: .55;
}

.editor-hat-rating.is-disabled .editor-rating-hat {
    cursor: not-allowed;
}

.editor-rating-value {
    display: block;
    margin-top: 8px;
}

.recipe-hats {
    display: inline-grid;
    grid-template-columns: repeat(10, 22px);
    gap: 3px;
    align-items: center;
}

.recipe-rating-hat {
    width: 22px;
}

.recipe-rating-empty {
    color: #6b7c90;
    font-size: 15px;
}

.recipe-hats-print {
    grid-template-columns: repeat(10, 5mm);
    gap: .65mm;
}

.recipe-hats-print .recipe-rating-hat {
    width: 5mm;
}

@media (max-width: 700px) {
    .recipe-hats {
        grid-template-columns: repeat(10, 18px);
        gap: 2px;
    }

    .recipe-rating-hat {
        width: 18px;
    }
}

@media print {
    .recipe-hats-print {
        display: inline-grid !important;
    }

    .recipe-hats-print .recipe-rating-hat {
        filter: grayscale(1);
        opacity: .16;
    }

    .recipe-hats-print .recipe-rating-hat.is-filled {
        filter: none;
        opacity: 1;
    }
}


/* =========================================================
   VOTO A CAPPELLI — VARIANTE ORO + CAPPELLI VUOTI
   Solo la grafica della valutazione viene modificata.
   ========================================================= */

/* Cappello non assegnato: sagoma vuota, neutra */
.editor-rating-hat img,
.recipe-rating-hat {
    content: url("../images/chef-hat-rating-empty.png");
    filter: none !important;
    opacity: 1 !important;
}

/* Cappello assegnato: oro caldo */
.editor-rating-hat.is-filled img,
.recipe-rating-hat.is-filled {
    content: url("../images/chef-hat-rating-gold.png");
    filter: none !important;
    opacity: 1 !important;
}

/* Mantiene la stessa resa anche in stampa */
@media print {
    .recipe-hats-print .recipe-rating-hat {
        content: url("../images/chef-hat-rating-empty.png");
        filter: none !important;
        opacity: 1 !important;
    }

    .recipe-hats-print .recipe-rating-hat.is-filled {
        content: url("../images/chef-hat-rating-gold.png");
        filter: none !important;
        opacity: 1 !important;
    }
}
