:root {
    --bg: #070807;
    --surface: #111411;
    --surface-2: #181c18;
    --line: rgba(193, 255, 35, 0.14);
    --text: #f3f5ef;
    --muted: #9fa89a;
    --lime: #b7f51c;
    --lime-2: #7faa12;
    --danger: #ff6b6b;
    --radius: 22px;
    --mobile-nav-clearance: 0px;
    --mobile-nav-mask: 0px;
}

* {
    box-sizing: border-box;
}

html {
    background: #050806;
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: rgba(183, 245, 28, 0.58) #050806;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 11px;
    height: 11px;
    background: #050806;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #050806;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    border: 3px solid #050806;
    border-radius: 999px;
    background: rgba(183, 245, 28, 0.62);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 0 10px rgba(183, 245, 28, 0.1);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(202, 255, 58, 0.82);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
    background: #050806;
}

@media (min-width: 981px) {
    html,
    body,
    .app-shell,
    .main-panel,
    .dashboard,
    .panel,
    .meal-list,
    .macro-list,
    .free-meal-form {
        scrollbar-width: thin;
        scrollbar-color: rgba(183, 245, 28, 0.58) #050806;
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    .app-shell::-webkit-scrollbar,
    .main-panel::-webkit-scrollbar,
    .dashboard::-webkit-scrollbar,
    .panel::-webkit-scrollbar,
    .meal-list::-webkit-scrollbar,
    .macro-list::-webkit-scrollbar,
    .free-meal-form::-webkit-scrollbar {
        width: 11px;
        height: 11px;
        background: #050806;
    }

    html::-webkit-scrollbar-track,
    body::-webkit-scrollbar-track,
    .app-shell::-webkit-scrollbar-track,
    .main-panel::-webkit-scrollbar-track,
    .dashboard::-webkit-scrollbar-track,
    .panel::-webkit-scrollbar-track,
    .meal-list::-webkit-scrollbar-track,
    .macro-list::-webkit-scrollbar-track,
    .free-meal-form::-webkit-scrollbar-track {
        border-radius: 999px;
        background: #050806;
        box-shadow: inset 0 0 0 1px rgba(183, 245, 28, 0.03);
    }

    html::-webkit-scrollbar-thumb,
    body::-webkit-scrollbar-thumb,
    .app-shell::-webkit-scrollbar-thumb,
    .main-panel::-webkit-scrollbar-thumb,
    .dashboard::-webkit-scrollbar-thumb,
    .panel::-webkit-scrollbar-thumb,
    .meal-list::-webkit-scrollbar-thumb,
    .macro-list::-webkit-scrollbar-thumb,
    .free-meal-form::-webkit-scrollbar-thumb {
        border: 3px solid #050806;
        border-radius: 999px;
        background: linear-gradient(180deg, rgba(183, 245, 28, 0.68), rgba(114, 156, 18, 0.72));
    }

    html::-webkit-scrollbar-thumb:hover,
    body::-webkit-scrollbar-thumb:hover,
    .app-shell::-webkit-scrollbar-thumb:hover,
    .main-panel::-webkit-scrollbar-thumb:hover,
    .dashboard::-webkit-scrollbar-thumb:hover,
    .panel::-webkit-scrollbar-thumb:hover,
    .meal-list::-webkit-scrollbar-thumb:hover,
    .macro-list::-webkit-scrollbar-thumb:hover,
    .free-meal-form::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, rgba(207, 255, 61, 0.88), rgba(142, 200, 22, 0.86));
    }

    html::-webkit-scrollbar-corner,
    body::-webkit-scrollbar-corner,
    .app-shell::-webkit-scrollbar-corner,
    .main-panel::-webkit-scrollbar-corner,
    .dashboard::-webkit-scrollbar-corner,
    .panel::-webkit-scrollbar-corner,
    .meal-list::-webkit-scrollbar-corner,
    .macro-list::-webkit-scrollbar-corner,
    .free-meal-form::-webkit-scrollbar-corner {
        background: #050806;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 16%, rgba(183, 245, 28, 0.16), transparent 28rem),
        linear-gradient(135deg, #030403 0%, #0c100d 48%, #050605 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(5, 6, 5, 0.76);
    backdrop-filter: blur(18px);
}

.brand,
.profile-pill,
.nav-item,
.panel,
.gate-card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(25, 29, 25, 0.94), rgba(10, 12, 10, 0.92));
}

.brand-mark,
.gate-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--lime), var(--lime-2));
    color: #071006;
    font-weight: 950;
    letter-spacing: 0;
}

.brand-mark {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand strong {
    display: block;
    font-size: 0.96rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand span,
.muted {
    color: var(--muted);
}

.brand span {
    display: block;
    margin-top: 2px;
    font-size: 0.76rem;
}

.nav-list {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.nav-item {
    padding: 13px 14px;
    border-radius: 16px;
    color: #dfe6d7;
    background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
    color: #071006;
    background: linear-gradient(135deg, var(--lime), #d6ff54);
    font-weight: 800;
}

.main-panel {
    min-width: 0;
    padding: 32px clamp(18px, 4vw, 54px) 96px;
}

.topbar,
.hero-grid,
.content-grid,
.panel-head {
    display: grid;
    gap: 18px;
}

.topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 24px;
}

.topbar-brand {
    display: none;
    place-items: center;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.topbar-brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar h1 {
    margin: 4px 0 0;
    font-size: clamp(2rem, 4vw, 4.2rem);
    line-height: 0.95;
}

.eyebrow {
    margin: 0;
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.profile-pill {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #191e19;
    color: var(--lime);
    font-weight: 900;
}

.diagnostic-link {
    justify-self: end;
    grid-column: 1 / -1;
    width: max-content;
    margin-top: -8px;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(183, 245, 28, 0.055);
    color: var(--lime);
    font-size: 0.74rem;
    font-weight: 850;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) minmax(220px, 0.8fr);
}

.daily-context-card {
    min-height: 0;
    margin-bottom: 18px;
    border-color: rgba(183, 245, 28, 0.2);
    background:
        linear-gradient(135deg, rgba(183, 245, 28, 0.08), transparent 42%),
        linear-gradient(145deg, rgba(24, 29, 24, 0.98), rgba(8, 11, 9, 0.98));
}

.daily-context-head,
.daily-context-actions,
.context-recommendation {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.daily-context-head h2 {
    margin-bottom: 4px;
}

.context-storage-pill {
    flex: none;
    border: 1px solid rgba(183, 245, 28, 0.2);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(183, 245, 28, 0.07);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 850;
}

.daily-context-question {
    margin-top: 18px;
    color: #dfe6d8;
    font-weight: 700;
}

.daily-context-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.daily-context-choices button,
.daily-context-actions button,
.daily-context-actions a {
    min-height: 44px;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 14px;
    padding: 10px 13px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.daily-context-choices button:hover,
.daily-context-choices button:focus-visible,
.daily-context-actions button:hover,
.daily-context-actions a:hover {
    border-color: rgba(183, 245, 28, 0.5);
    background: rgba(183, 245, 28, 0.12);
    color: var(--lime);
}

.daily-context-choices button:disabled,
.daily-context-actions button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.context-recommendation {
    align-items: stretch;
    margin-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 18px;
}

.context-recommendation > div {
    flex: 1 1 0;
    min-width: 0;
}

.context-recommendation small,
.context-recommendation strong {
    display: block;
}

.context-recommendation small {
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.context-recommendation strong {
    margin-top: 5px;
    font-size: 1.08rem;
}

.context-recommendation p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.context-reason {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 18px;
}

.daily-context-actions {
    align-items: center;
    justify-content: flex-start;
    margin-top: 16px;
}

.daily-context-actions a {
    margin-left: auto;
    color: #ffb35c;
    border-color: rgba(255, 145, 26, 0.22);
}

@media (max-width: 700px) {
    .daily-context-card {
        padding: 18px;
    }

    .daily-context-head,
    .context-recommendation,
    .daily-context-actions {
        display: grid;
    }

    .context-storage-pill {
        width: max-content;
    }

    .daily-context-choices {
        grid-template-columns: 1fr;
    }

    .context-reason {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-left: 0;
        padding-top: 15px;
        padding-left: 0;
    }

    .daily-context-actions a {
        margin-left: 0;
        text-align: center;
    }
}

/* Phase 52 - lecture assistée d'une étiquette, image locale temporaire */
.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;
}

body.label-photo-modal-open {
    overflow: hidden;
}

.label-photo-modal[hidden],
.label-photo-stage[hidden],
.label-crop-workspace[hidden],
.label-source-comparison[hidden] {
    display: none !important;
}

.label-photo-modal {
    position: fixed;
    inset: 0;
    z-index: 3050;
    padding: clamp(10px, 2vw, 24px);
    color: #f4f8f5;
    background: rgba(2, 6, 4, 0.97);
}

.label-photo-shell {
    width: min(1280px, 100%);
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(173, 255, 47, 0.2);
    background: #07100b;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
}

.label-photo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 17, 12, 0.97);
}

.label-photo-header h2 {
    margin: 3px 0 0;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
}

.label-photo-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(18px, 3vw, 34px);
    scrollbar-color: rgba(173, 255, 47, 0.55) #050806;
}

.label-photo-stage {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.label-photo-intro,
.label-assisted-note,
.label-validation-feedback,
.label-warning-list,
.label-validation-ok,
.label-allergy-caution,
.label-photo-error {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    background: #0a1510;
}

.label-photo-intro strong,
.label-assisted-note strong,
.label-validation-feedback strong,
.label-warning-list strong,
.label-validation-ok strong {
    display: block;
    margin-bottom: 6px;
    color: #dfff9b;
}

.label-photo-intro p,
.label-assisted-note p,
.label-validation-feedback p,
.label-source-comparison p {
    margin: 0;
    color: #aab8ae;
}

.label-photo-actions,
.label-barcode-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.label-photo-help,
.label-field-hint,
.label-barcode-actions span {
    color: #93a198;
    font-size: 0.82rem;
}

.label-photo-error {
    margin-top: 16px;
    border-color: rgba(255, 92, 92, 0.5);
    color: #ffd1d1;
    background: rgba(67, 9, 9, 0.55);
}

.label-crop-workspace {
    margin-top: 20px;
}

.label-crop-guide {
    position: relative;
    width: min(900px, 100%);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(173, 255, 47, 0.3);
    border-radius: 6px;
    background: #020503;
}

.label-crop-guide canvas,
.label-reference-panel canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    background: #020503;
}

.label-crop-guide span {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    padding: 9px 12px;
    color: #f6fff1;
    background: rgba(2, 6, 4, 0.82);
    text-align: center;
    pointer-events: none;
}

.label-crop-controls {
    width: min(900px, 100%);
    margin: 18px auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.label-crop-controls label {
    display: grid;
    gap: 7px;
    color: #d8e1da;
    font-size: 0.82rem;
    font-weight: 700;
}

.label-crop-controls input[type="range"] {
    width: 100%;
    accent-color: #b8ff38;
}

.label-transcription-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.35fr);
    gap: 22px;
    align-items: start;
    margin-top: 18px;
}

.label-reference-panel {
    position: sticky;
    top: 0;
    min-width: 0;
}

.label-reference-panel canvas {
    border: 1px solid rgba(173, 255, 47, 0.26);
    border-radius: 6px;
}

.label-reference-panel .meal-action-btn {
    width: 100%;
    margin-top: 10px;
}

.label-product-form {
    min-width: 0;
}

.label-product-form fieldset {
    min-width: 0;
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
}

.label-product-form legend {
    padding: 0 8px;
    color: #dfff9b;
    font-weight: 800;
}

.label-fields-grid,
.label-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

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

.label-product-form label,
.label-photo-stage .barcode-portion-grid label {
    min-width: 0;
    display: grid;
    gap: 7px;
    color: #d8e1da;
    font-size: 0.84rem;
    font-weight: 700;
}

.label-product-form label > small {
    color: #8f9c93;
    font-weight: 500;
}

.label-product-form label[data-field-status]::after {
    content: attr(data-field-status-label);
    width: fit-content;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 4px;
    color: #9eaaa1;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.68rem;
    font-weight: 700;
}

.label-product-form label[data-field-status="conflicting"]::after {
    border-color: rgba(255, 162, 54, 0.48);
    color: #ffd098;
    background: rgba(63, 34, 5, 0.42);
}

.label-product-form label[data-field-status="conflicting"] input,
.label-product-form label[data-field-status="conflicting"] select,
.label-product-form label[data-field-status="conflicting"] textarea {
    border-color: rgba(255, 162, 54, 0.66);
}

.label-photo-modal input:not([type="checkbox"]):not([type="range"]),
.label-photo-modal select,
.label-photo-modal textarea {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 5px;
    padding: 9px 11px;
    color: #f4f8f5;
    background: #050b08;
    font: inherit;
}

.label-photo-modal textarea {
    min-height: 82px;
    resize: vertical;
}

.label-photo-modal input:focus,
.label-photo-modal select:focus,
.label-photo-modal textarea:focus,
.label-photo-modal button:focus-visible {
    outline: 2px solid rgba(184, 255, 56, 0.62);
    outline-offset: 2px;
}

.label-product-form fieldset > label {
    margin-top: 13px;
}

.label-kj-convert {
    margin-top: 14px;
}

.label-source-comparison {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid rgba(173, 255, 47, 0.18);
    border-radius: 6px;
    background: #08120d;
}

.label-source-comparison > strong {
    display: block;
    margin-bottom: 6px;
    color: #dfff9b;
}

.label-source-comparison > label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.label-source-comparison input {
    grid-row: 1 / span 2;
    width: 18px;
    height: 18px;
}

.label-source-comparison small {
    color: #94a198;
    overflow-wrap: anywhere;
}

.label-validation-feedback:empty {
    display: none;
}

.label-validation-feedback,
.label-validation-summary {
    margin-top: 16px;
}

.label-validation-feedback ul,
.label-warning-list ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.label-warning-list {
    margin-top: 12px;
    border-color: rgba(255, 162, 54, 0.45);
    color: #ffd098;
    background: rgba(63, 34, 5, 0.5);
}

.label-validation-ok {
    margin-top: 12px;
    color: #d8e1da;
}

.label-allergy-caution {
    margin-top: 12px;
    border-color: rgba(255, 193, 92, 0.38);
    color: #ffe0ad;
}

.label-photo-trigger {
    border-color: rgba(184, 255, 56, 0.34);
}

@media (max-width: 920px) {
    .label-transcription-layout {
        grid-template-columns: 1fr;
    }

    .label-reference-panel {
        position: static;
    }

    .label-reference-panel canvas {
        max-height: 52vh;
    }

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

@media (max-width: 700px) {
    .label-photo-modal {
        padding: 0;
    }

    .label-photo-shell {
        border: 0;
    }

    .label-photo-header {
        padding: 13px 15px;
    }

    .label-photo-body {
        padding: 16px 14px calc(34px + env(safe-area-inset-bottom));
        scrollbar-width: none;
    }

    .label-photo-body::-webkit-scrollbar {
        display: none;
    }

    .label-crop-controls,
    .label-fields-grid,
    .label-nutrition-grid,
    .label-photo-stage .barcode-portion-grid {
        grid-template-columns: 1fr;
    }

    .label-photo-actions .meal-action-btn,
    .label-barcode-actions .meal-action-btn,
    .label-photo-stage .barcode-form-actions .meal-action-btn {
        flex: 1 1 180px;
    }

    .label-crop-guide canvas,
    .label-reference-panel canvas {
        aspect-ratio: 4 / 3;
    }

    .label-product-form fieldset {
        padding: 13px;
    }
}

.content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 18px;
}

.panel {
    position: relative;
    overflow: hidden;
    min-height: 170px;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(26, 30, 26, 0.96), rgba(9, 11, 9, 0.96));
}

.score-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
}

.panel h2,
.gate-card h1 {
    margin: 6px 0 8px;
}

.calories-card strong,
.goal-card strong,
.workout-card strong,
.weekly-panel strong {
    display: block;
    margin: 28px 0 8px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 0.95;
}

.workout-card strong {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.goal-card strong {
    font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.profile-source-pill {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    margin-top: 14px;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(183, 245, 28, 0.06);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 850;
}

.ring,
.mini-ring {
    display: grid;
    place-items: center;
    flex: none;
    width: 150px;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle closest-side, #131713 72%, transparent 74%),
        conic-gradient(var(--lime) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.09) 0);
}

.ring span {
    font-size: 3rem;
    font-weight: 950;
}

.mini-ring {
    width: 116px;
    margin: 22px auto 12px;
}

.hydration-panel {
    text-align: center;
}

.hydration-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.hydration-actions button,
.hydration-correct {
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 14px;
    padding: 9px 8px;
    background: rgba(183, 245, 28, 0.07);
    color: var(--lime);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.hydration-actions button:disabled,
.hydration-correct:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.hydration-correct {
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
}

.hydration-guidance {
    display: block;
    margin-top: 12px;
    font-size: 0.82rem;
}

.macro-list,
.meal-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.macro-panel {
    align-self: start;
    min-height: 0;
    padding-bottom: 18px;
}

.macro-panel .panel-head {
    gap: 8px;
}

.macro-panel h2 {
    margin-bottom: 2px;
}

.macro-panel .macro-list {
    gap: 10px;
    margin-top: 10px;
}

.macro-row {
    display: grid;
    gap: 6px;
}

.macro-top,
.meal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.macro-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lime), #e4ff75);
}

.meal-row {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
}

.meal-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.meal-tabs button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 9px 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.meal-tabs button.active {
    background: rgba(183, 245, 28, 0.16);
    border-color: rgba(183, 245, 28, 0.35);
    color: var(--lime);
}

.meal-tabs button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.day-status {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

button.meal-row {
    width: 100%;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.meal-row.is-clickable {
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.meal-row.is-clickable:hover,
.meal-row.selected {
    border-color: rgba(183, 245, 28, 0.36);
    background: rgba(183, 245, 28, 0.08);
}

.meal-row.validated {
    border-color: rgba(183, 245, 28, 0.58);
}

.meal-row strong,
.meal-row span,
.meal-row em {
    display: block;
}

.meal-row em {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

.meal-row small {
    color: var(--lime);
    font-weight: 800;
}

.meal-selection {
    min-height: 20px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.84rem;
}

.meal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.meal-action-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 850;
    cursor: pointer;
}

.meal-action-btn.primary {
    background: var(--lime);
    color: #071006;
}

.meal-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.meal-portion-select,
.plan-portion-select,
.journal-edit select,
.journal-edit input {
    border: 1px solid rgba(183, 245, 28, 0.16);
    border-radius: 12px;
    padding: 9px 10px;
    background: #07110c;
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

.free-meal-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.free-meal-form[hidden] {
    display: none;
}

.free-meal-form input,
.free-meal-form select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
}

.sport-product-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(183, 245, 28, 0.15);
    border-radius: 8px;
    background: rgba(5, 12, 8, 0.72);
}

.sport-product-form[hidden],
.product-step[hidden],
.recent-products[hidden],
.product-confirm-row[hidden] {
    display: none;
}

.product-form-head,
.product-form-actions,
.recent-product-item,
.recent-product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-step-indicator,
.product-help,
.product-caution {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.product-step {
    display: grid;
    gap: 10px;
}

.product-step > label,
.product-fields-grid label,
.product-nutrition-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.product-fields-grid,
.product-inline-fields,
.product-nutrition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.product-confirmation {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(183, 245, 28, 0.13);
    border-radius: 8px;
    background: rgba(183, 245, 28, 0.04);
}

.product-confirmation span,
.product-confirmation small {
    color: var(--muted);
}

.sport-product-form input,
.sport-product-form select {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 11px;
    background: #07110c;
    color: var(--text);
    font: inherit;
}

.product-confirm-row {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start;
}

.product-confirm-row input {
    width: 18px;
    margin-top: 2px;
    accent-color: var(--lime);
}

.product-form-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.recent-products {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.product-stocks { display: grid; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(183, 245, 28, .12); }
.product-stocks-head, .stock-form-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.product-stocks-head small { color: var(--lime); font-weight: 850; }
.product-stocks-head p { margin: 4px 0 0; max-width: 54ch; color: var(--muted); font-size: .74rem; }
.stock-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid rgba(183, 245, 28, .14); border-radius: 8px; background: rgba(5, 12, 8, .72); }
.stock-form[hidden] { display: none; }
.stock-form label { display: grid; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.stock-form input, .stock-form select { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: #07110c; color: var(--text); font: inherit; }
.stock-default-choice { grid-template-columns: auto minmax(0, 1fr) !important; align-items: center; align-self: end; min-height: 42px; }
.stock-default-choice input { width: 18px; height: 18px; accent-color: var(--lime); }
.stock-form-actions { grid-column: 1 / -1; justify-content: flex-start; }
.product-stock-list { display: grid; gap: 9px; }
.product-stock-item { display: grid; gap: 7px; padding: 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; background: rgba(255,255,255,.025); }
.product-stock-item[data-stock-status="low"] { border-color: rgba(255,171,48,.34); }
.product-stock-item[data-stock-status="empty"] { opacity: .68; }
.product-stock-item > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.product-stock-item span, .product-stock-item small { color: var(--muted); }
.product-stock-item p { margin: 0; font-size: .8rem; }
.stock-expiry.soon { color: #f4bf63; }
.stock-expiry.expired { color: #ff8585; font-weight: 800; }
.product-stock-item .recent-product-actions { justify-content: flex-start; }
.product-stock-item button:disabled { cursor: not-allowed; opacity: .45; }
.low-stock-alert-panel { margin: 14px 0; border-color: rgba(255,171,48,.24); }
.low-stock-alert-panel[hidden] { display: none; }
.low-stock-alert-list { display: grid; gap: 9px; margin-top: 12px; }
.low-stock-alert-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid rgba(255,171,48,.18); border-radius: 8px; background: rgba(255,171,48,.045); }
.low-stock-alert-item > div:first-child { display: grid; gap: 3px; }
.low-stock-alert-item small { color: var(--muted); }

.recent-products > small {
    color: var(--lime);
    font-weight: 850;
}

.recent-product-item {
    align-items: flex-start;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.recent-product-item > div:first-child {
    display: grid;
    gap: 4px;
}

.recent-product-item small {
    color: var(--muted);
}

.recent-product-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.recent-product-actions button {
    border: 1px solid rgba(183, 245, 28, 0.14);
    border-radius: 10px;
    padding: 7px 9px;
    background: rgba(183, 245, 28, 0.045);
    color: var(--text);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.journal-product-quantity {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.consumed-total > span {
    display: grid;
    gap: 3px;
}

.consumed-total small {
    color: var(--muted);
    font-size: 0.68rem;
}

.consumed-box {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consumed-box small {
    color: var(--lime);
    font-weight: 850;
}

.consumed-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.consumed-item {
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

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

.journal-edit {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px !important;
}

.journal-edit input {
    width: 82px;
}

.journal-edit button {
    border: 1px solid rgba(183, 245, 28, 0.15);
    border-radius: 10px;
    padding: 6px 8px;
    background: rgba(183, 245, 28, 0.05);
    color: var(--text);
    font: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.journal-status {
    color: var(--lime);
}

.consumed-item div,
.consumed-right {
    display: grid;
    gap: 4px;
}

.consumed-item small {
    color: rgba(238, 247, 229, 0.52);
    font-weight: 700;
}

.consumed-item.empty {
    align-items: center;
}

.consumed-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(183, 245, 28, 0.14);
    border-radius: 14px;
    background: rgba(183, 245, 28, 0.055);
    color: var(--text);
    font-size: 0.82rem;
}

.journal-remove-btn {
    justify-self: end;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(7, 17, 12, 0.78);
    color: var(--lime);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
    cursor: pointer;
}

.journal-remove-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.week-dots {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
    margin: 18px 0 12px;
}

.week-dots span {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.week-dots span.done {
    background: linear-gradient(90deg, var(--lime), #e4ff75);
}

.gate-link[aria-disabled="true"] {
    pointer-events: none;
    background: rgba(183, 245, 28, 0.18);
    color: var(--lime);
}

.auth-gate {
    display: none;
    min-height: calc(100vh - 120px);
    place-items: center;
}

.app-shell[data-state="locked"] .auth-gate,
.app-shell[data-state="checking"] .auth-gate {
    display: grid;
}

.gate-card {
    width: min(440px, 100%);
    padding: 30px;
    border-radius: 28px;
    background: rgba(13, 16, 13, 0.94);
    text-align: center;
}

.gate-mark {
    margin: 0 auto 18px;
}

.gate-link {
    display: inline-flex;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--lime);
    color: #071006;
    font-weight: 900;
}

.bottom-nav {
    display: none;
}

.profile-page {
    min-height: 100vh;
    padding: 30px clamp(16px, 4vw, 54px) 54px;
}

.profile-hero,
.profile-layout,
.profile-form,
.field-grid,
.choice-grid {
    display: grid;
    gap: 18px;
}

.profile-hero {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 24px;
}

.profile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.profile-brand small {
    color: var(--muted);
}

.profile-layout {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
}

.profile-intro {
    position: sticky;
    top: 28px;
}

.profile-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 0.96;
}

.profile-status {
    margin-top: 18px;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 16px;
    padding: 12px;
    background: rgba(183, 245, 28, 0.07);
    color: var(--lime);
    font-size: 0.84rem;
    font-weight: 850;
}

.profile-status[data-state="dirty"],
.profile-status[data-state="saving"] {
    border-color: rgba(255, 162, 54, 0.34);
    background: rgba(255, 162, 54, 0.09);
    color: #ffb362;
}

.profile-status[data-state="error"] {
    border-color: rgba(255, 92, 92, 0.34);
    background: rgba(255, 92, 92, 0.09);
    color: #ff8a8a;
}

.profile-status[data-state="loading"],
.profile-status[data-state="idle"] {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
}

.profile-card {
    min-height: 0;
}

.profile-card h2 {
    margin: 6px 0 16px;
}

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

.profile-card label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.profile-card input,
.profile-card select,
.profile-card textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
}

.profile-card textarea {
    min-height: 86px;
    resize: vertical;
}

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

.choice-grid label {
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.035);
}

.choice-grid input {
    width: auto;
    accent-color: var(--lime);
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-actions .meal-action-btn[disabled] {
    cursor: wait;
    opacity: 0.68;
}

.profile-link {
    grid-column: auto;
    margin-top: 0;
}

.plans-top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: end;
}

.plans-page .profile-hero {
    grid-template-columns: minmax(0, 1fr) auto;
}

.plans-page .profile-brand {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(25, 29, 25, 0.94), rgba(10, 12, 10, 0.92));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.plans-page .profile-brand .brand-mark {
    flex: 0 0 48px;
}

.plans-page .profile-brand > span:last-child {
    min-width: 0;
}

.plans-page .profile-brand strong {
    overflow-wrap: anywhere;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plans-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    column-gap: 18px;
    row-gap: 14px;
    align-items: start;
}

.plans-intro {
    grid-row: 1 / span 4;
    position: sticky;
    top: 28px;
}

.plans-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
}

.plans-intro {
    min-height: 0;
}

.plans-mini-summary {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.plans-mini-summary span {
    border: 1px solid rgba(183, 245, 28, 0.12);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(183, 245, 28, 0.045);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 820;
}

.plans-summary,
.plans-hydration,
.plans-advice,
.plans-grid {
    grid-column: 2;
}

.plans-summary {
    grid-row: 1;
}

.plans-grid {
    grid-row: 2;
}

.plans-hydration {
    grid-row: 3;
}

.plans-advice {
    grid-row: 4;
}

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

.plans-guidance {
    color: var(--text);
    font-size: 1rem;
    font-weight: 760;
    line-height: 1.45;
}

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

.plans-metrics span {
    border: 1px solid rgba(183, 245, 28, 0.12);
    border-radius: 14px;
    padding: 10px;
    background: rgba(183, 245, 28, 0.055);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.plans-metrics strong {
    display: block;
    color: var(--lime);
    font-size: 1.15rem;
}

.plans-metrics.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 12px 0;
}

.plan-meal-card {
    min-height: 0;
}

.plan-meal-card.inactive {
    opacity: 0.58;
}

.plan-status {
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(183, 245, 28, 0.07);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.plan-alt {
    color: var(--muted);
    font-size: 0.82rem;
}

.plan-note {
    margin: 10px 0 0;
    border: 1px solid rgba(183, 245, 28, 0.12);
    border-radius: 14px;
    padding: 10px;
    background: rgba(183, 245, 28, 0.05);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.plan-actions button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.plan-actions a {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(183, 245, 28, 0.18);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(183, 245, 28, 0.07);
    color: var(--lime);
    font-size: 0.78rem;
    font-weight: 850;
}

.plan-actions button:first-child {
    background: var(--lime);
    color: #071006;
}

.plan-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.plan-portion-select {
    min-width: 82px;
}

@media (max-width: 640px) {
    .stock-form { grid-template-columns: 1fr; }
    .product-stock-item > div:first-child { display: grid; }
    .low-stock-alert-item { display: grid; }
    .consumed-item {
        display: grid;
    }

    .consumed-right,
    .journal-edit {
        justify-content: flex-start;
    }

    .product-inline-fields,
    .product-nutrition-grid {
        grid-template-columns: 1fr;
    }

    .sport-product-form {
        padding: 13px;
    }

    .product-form-head,
    .recent-product-item {
        align-items: stretch;
    }

    .recent-product-item {
        display: grid;
    }

    .recent-product-actions {
        justify-content: flex-start;
    }

    .consumed-total {
        display: grid;
    }

    .consumed-total strong {
        overflow-wrap: anywhere;
    }
}

.plan-hydration-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.plan-hydration-steps span {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 780;
}

.recipes-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.recipes-page {
    padding-bottom: 56px;
}

.recipes-hero {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: -30px calc(clamp(16px, 4vw, 54px) * -1) 18px;
    padding: 18px clamp(16px, 4vw, 54px);
    border-bottom: 1px solid rgba(183, 245, 28, 0.08);
    background:
        linear-gradient(180deg, rgba(5, 8, 6, 0.96), rgba(5, 8, 6, 0.84)),
        radial-gradient(circle at 82% 0%, rgba(183, 245, 28, 0.12), transparent 24rem);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.recipes-page .profile-brand {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(25, 29, 25, 0.94), rgba(10, 12, 10, 0.92));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.recipes-page .profile-brand .brand-mark {
    flex: 0 0 48px;
}

.recipes-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.recipes-intro {
    display: grid;
    grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
    align-items: end;
    gap: 18px;
    min-height: 0;
}

.recipes-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
}

.recipes-guide,
.recipes-grid {
    grid-column: auto;
}

.recipes-guide {
    position: sticky;
    top: 102px;
    z-index: 7;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    min-height: 0;
    padding: 14px 18px;
    background:
        linear-gradient(145deg, rgba(26, 30, 26, 0.88), rgba(9, 11, 9, 0.92)),
        radial-gradient(circle at 92% 0%, rgba(183, 245, 28, 0.07), transparent 18rem);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 14px 34px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px) saturate(112%);
    -webkit-backdrop-filter: blur(18px) saturate(112%);
}

.recipes-guide > div:first-child {
    display: contents;
}

.recipes-guide > div:first-child .eyebrow {
    display: none;
}

.recipes-guide > div:first-child h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 1.16rem;
    line-height: 1.15;
}

.recipes-guide > div:first-child .muted {
    grid-column: 1;
    min-width: 0;
    margin: 0;
    color: rgba(200, 209, 201, 0.72);
    font-size: 0.72rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.recipes-summary-strip span {
    min-width: 0;
    border: 1px solid rgba(183, 245, 28, 0.12);
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(183, 245, 28, 0.045);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 820;
    overflow-wrap: anywhere;
}

.recipe-filters {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.recipe-filters button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.recipe-filters button.active {
    border-color: rgba(183, 245, 28, 0.36);
    background: rgba(183, 245, 28, 0.16);
    color: var(--lime);
}

.recipe-state {
    grid-column: 2;
    justify-self: end;
    margin: 0;
    color: rgba(224, 232, 225, 0.78);
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1.3;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .recipes-guide > div:first-child h2,
    .recipes-guide > div:first-child .muted,
    .recipe-filters,
    .recipe-state {
        grid-column: 1;
    }

    .recipe-state {
        justify-self: start;
    }
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 14px;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: visible;
}

.recipe-photo-frame {
    position: relative;
    display: grid;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(183, 245, 28, 0.045), rgba(255, 255, 255, 0.018)),
        #080b09;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.recipe-card-photo {
    aspect-ratio: 4 / 3;
    margin-bottom: 14px;
}

.recipe-photo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-photo-image[hidden] {
    display: none;
}

.recipe-photo-unavailable {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.recipe-photo-unavailable[hidden] {
    display: none;
}

.recipe-card.detail-open {
    grid-column: 1 / -1;
}

.recipe-card-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.recipe-title-box {
    min-width: 0;
}

.recipe-card h2 {
    overflow-wrap: anywhere;
    hyphens: auto;
    line-height: 1.12;
}

.recipe-card .plans-guidance {
    margin: 0 0 4px;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.recipe-tags span {
    border: 1px solid rgba(183, 245, 28, 0.13);
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(183, 245, 28, 0.055);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 820;
}

.recipe-detail {
    display: grid;
    gap: 18px;
    min-width: 0;
    margin-top: 14px;
    border: 1px solid rgba(183, 245, 28, 0.13);
    border-radius: 16px;
    padding: clamp(14px, 2vw, 22px);
    background:
        linear-gradient(145deg, rgba(31, 37, 31, 0.82), rgba(8, 11, 9, 0.92)),
        radial-gradient(circle at 94% 0%, rgba(183, 245, 28, 0.08), transparent 22rem);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 20px 50px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(118%);
    -webkit-backdrop-filter: blur(18px) saturate(118%);
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
    overflow: hidden;
    animation: recipe-detail-reveal 180ms ease-out both;
}

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

.recipe-detail p {
    margin: 0;
}

.recipe-detail-photo {
    position: relative;
    min-width: 0;
    min-height: clamp(180px, 27vw, 300px);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    background: #080b09;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.recipe-detail-photo > .recipe-photo-image {
    display: block;
    width: 100%;
    height: clamp(180px, 27vw, 300px);
    object-fit: cover;
}

.recipe-detail-photo-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    min-height: clamp(180px, 27vw, 300px);
    padding: 22px;
    background:
        linear-gradient(145deg, rgba(183, 245, 28, 0.045), rgba(255, 255, 255, 0.018)),
        radial-gradient(circle at 50% 35%, rgba(183, 245, 28, 0.1), transparent 12rem);
    color: var(--muted);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.recipe-detail-photo-placeholder img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: saturate(0.8);
    opacity: 0.76;
}

.recipe-detail-heading {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.recipe-detail-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.recipe-detail-description {
    max-width: 72ch;
    color: var(--muted);
    font-size: 0.92rem;
}

.recipe-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 9px;
}

.recipe-detail-meta > span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    min-width: 0;
    border: 1px solid rgba(183, 245, 28, 0.12);
    border-radius: 8px;
    padding: 10px;
    background:
        linear-gradient(145deg, rgba(183, 245, 28, 0.065), rgba(255, 255, 255, 0.022));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    color: var(--text);
    overflow-wrap: anywhere;
}

.recipe-detail-meta i {
    grid-row: 1 / 3;
    font-style: normal;
    font-size: 1.12rem;
}

.recipe-detail-meta small,
.recipe-detail-macros small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 760;
}

.recipe-detail-meta strong,
.recipe-detail-macros strong {
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.2;
}

.recipe-detail-section {
    display: grid;
    gap: 11px;
    min-width: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.recipe-detail-section h4 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: var(--lime);
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.recipe-detail-section h4 > span {
    color: rgba(183, 245, 28, 0.5);
}

.recipe-detail-section h4 > small {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: none;
}

.recipe-detail-macros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 9px;
}

.recipe-detail-macros > span {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 11px;
    background: rgba(3, 6, 4, 0.36);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    overflow-wrap: anywhere;
}

.recipe-detail-macros strong {
    color: var(--lime);
    font-size: 1rem;
}

.recipe-ingredient-list,
.recipe-step-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.recipe-ingredient-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
    list-style: none;
}

.recipe-ingredient-list li {
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 8px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.022);
}

.recipe-ingredient-list strong {
    border-radius: 999px;
    padding: 4px 7px;
    background: rgba(183, 245, 28, 0.09);
    color: var(--lime);
    font-size: 0.74rem;
    text-align: center;
    white-space: nowrap;
}

.recipe-ingredient-list span {
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.recipe-ingredient-list small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.72rem;
}

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

.recipe-step-list li {
    position: relative;
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px 7px 46px;
    color: var(--text);
    overflow-wrap: anywhere;
    counter-increment: recipe-step;
}

.recipe-step-list li::before {
    content: counter(recipe-step);
    position: absolute;
    top: 3px;
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(183, 245, 28, 0.2);
    border-radius: 50%;
    background: rgba(183, 245, 28, 0.08);
    color: var(--lime);
    font-weight: 850;
}

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

.recipe-detail-badges span {
    max-width: 100%;
    border: 1px solid rgba(183, 245, 28, 0.16);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(183, 245, 28, 0.065);
    color: var(--text);
    font-size: 0.73rem;
    font-weight: 780;
    overflow-wrap: anywhere;
}

.recipe-detail-badges-alert span {
    border-color: rgba(255, 176, 77, 0.2);
    background: rgba(255, 176, 77, 0.075);
    color: #f2c587;
}

.recipe-detail-pending {
    border: 1px solid rgba(183, 245, 28, 0.11);
    border-left: 2px solid rgba(183, 245, 28, 0.42);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(183, 245, 28, 0.035);
    color: var(--muted);
    font-size: 0.78rem;
}

.recipe-detail-reason {
    display: grid;
    gap: 6px;
    min-width: 0;
    border: 1px solid rgba(183, 245, 28, 0.13);
    border-radius: 10px;
    padding: 13px 14px;
    background:
        linear-gradient(135deg, rgba(183, 245, 28, 0.075), rgba(255, 255, 255, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.recipe-detail-reason > p:last-child {
    color: var(--text);
    overflow-wrap: anywhere;
}

@keyframes recipe-detail-reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    .recipe-detail {
        gap: 15px;
        border-radius: 14px;
        padding: 12px;
    }

    .recipe-detail-photo,
    .recipe-detail-photo > .recipe-photo-image,
    .recipe-detail-photo-placeholder {
        min-height: 180px;
        height: 180px;
    }

    .recipe-detail-meta,
    .recipe-detail-macros {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .recipe-detail-meta > span,
    .recipe-detail-macros > span {
        padding: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .recipe-detail {
        animation: none;
    }
}

.recipe-actions {
    margin-top: auto;
    padding-top: 12px;
}

.tracking-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.tracking-page {
    padding-bottom: 56px;
}

.tracking-hero {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: -30px calc(clamp(16px, 4vw, 54px) * -1) 18px;
    padding: 18px clamp(16px, 4vw, 54px);
    border-bottom: 1px solid rgba(183, 245, 28, 0.08);
    background:
        linear-gradient(180deg, rgba(5, 8, 6, 0.96), rgba(5, 8, 6, 0.84)),
        radial-gradient(circle at 82% 0%, rgba(183, 245, 28, 0.12), transparent 24rem);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.tracking-page .profile-brand {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(25, 29, 25, 0.94), rgba(10, 12, 10, 0.92));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.tracking-page .profile-brand .brand-mark {
    flex: 0 0 48px;
}

.tracking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.tracking-intro,
.tracking-summary {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 18px;
    min-height: 0;
}

.tracking-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
}

.tracking-score-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    grid-column: 1 / -1;
}

.tracking-ring {
    width: 128px;
}

.tracking-ring span {
    font-size: 2.5rem;
}

.tracking-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tracking-summary-pills span {
    border: 1px solid rgba(183, 245, 28, 0.13);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(183, 245, 28, 0.055);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
}

.tracking-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tracking-metric {
    min-height: 0;
}

.tracking-metric h2 {
    overflow-wrap: anywhere;
}

.tracking-bar {
    height: 8px;
    margin: 16px 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.tracking-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--lime), #e4ff75);
}

.tracking-metric.over .tracking-bar span {
    background: linear-gradient(90deg, #ffd27a, #ff8f70);
}

.tracking-metric.todo .tracking-bar span {
    background: linear-gradient(90deg, rgba(183, 245, 28, 0.56), rgba(183, 245, 28, 0.2));
}

.tracking-journal,
.tracking-week,
.tracking-tips {
    min-height: 0;
}

.tracking-journal-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.tracking-journal-item,
.tracking-empty {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 0.86rem;
}

.tracking-journal-item strong,
.tracking-journal-item small {
    display: block;
}

.tracking-journal-item strong {
    color: var(--text);
}

.tracking-journal-item small {
    margin-top: 3px;
    color: rgba(238, 247, 229, 0.52);
}

.tracking-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 12px;
}

.tracking-week-day {
    display: grid;
    gap: 6px;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 10px 8px;
    background:
        linear-gradient(180deg, rgba(183, 245, 28, 0.12), rgba(255, 255, 255, 0.025));
    text-align: center;
}

.tracking-week-day.current {
    border-color: rgba(183, 245, 28, 0.42);
    box-shadow: 0 12px 34px rgba(183, 245, 28, 0.12);
}

.tracking-week-day span,
.tracking-week-day small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 820;
}

.tracking-week-day strong {
    color: var(--lime);
    font-size: 1.25rem;
}

.lists-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.lists-page {
    padding-bottom: 56px;
}

.lists-page .profile-brand {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(25, 29, 25, 0.94), rgba(10, 12, 10, 0.92));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.lists-page .profile-brand .brand-mark {
    flex: 0 0 48px;
}

.lists-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.68fr) minmax(0, 1.32fr);
    gap: 14px;
    align-items: start;
}

.lists-intro {
    position: sticky;
    top: 104px;
    min-height: 0;
}

.lists-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
}

.lists-summary,
.lists-actions-panel,
.lists-category-grid,
.lists-guidance {
    grid-column: 2;
}

.lists-actions-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 0;
}

.lists-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.lists-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.shopping-category {
    min-height: 0;
}

.shopping-items {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.shopping-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
}

.shopping-item > label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

.shopping-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--lime);
}

.shopping-item strong,
.shopping-item small {
    display: block;
}

.shopping-item strong {
    color: var(--text);
}

.shopping-item small {
    margin-top: 3px;
    color: rgba(238, 247, 229, 0.52);
    font-size: 0.76rem;
    font-weight: 760;
}

.shopping-item em {
    color: var(--lime);
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.shopping-item > button {
    border: 0;
    padding: 5px 0;
    background: transparent;
    color: rgba(238, 247, 229, .52);
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}

.shopping-item > button:hover { color: var(--lime); }

.shopping-item.checked {
    border-color: rgba(183, 245, 28, 0.28);
    background: rgba(183, 245, 28, 0.07);
}

.shopping-item.checked strong {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(183, 245, 28, 0.55);
}

.shopping-item.limited {
    opacity: 0.74;
}

.lists-metrics strong {
    overflow-wrap: anywhere;
}

.purchased-stock-panel[hidden] { display: none; }
.purchased-stock-panel { grid-column: 2; display: grid; gap: 14px; border-color: rgba(183,245,28,.2); }
.purchased-stock-panel form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.purchased-stock-panel label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.purchased-stock-panel input, .purchased-stock-panel select { min-width: 0; width: 100%; padding: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: #07110c; color: var(--text); font: inherit; }

@media (max-width: 980px) {
    :root {
        --mobile-nav-clearance: 118px;
        --mobile-nav-mask: 108px;
    }

    html,
    body {
        height: 100%;
        overflow: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-padding-bottom: calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom, 0px));
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .app-shell {
        position: relative;
        grid-template-columns: 1fr;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
        padding-bottom: 0;
    }

    .app-shell::after {
        content: "";
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 4;
        height: calc(var(--mobile-nav-mask) + env(safe-area-inset-bottom, 0px));
        background:
            linear-gradient(180deg, rgba(7, 8, 7, 0), rgba(7, 8, 7, 0.96) 30%, #070807 100%),
            radial-gradient(circle at 50% 100%, rgba(183, 245, 28, 0.1), transparent 72%);
        pointer-events: none;
    }

    .sidebar {
        display: none;
    }

    .hero-grid,
    .content-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .main-panel {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 22px 16px calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom, 0px));
    }

    .main-panel::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .dashboard {
        padding-bottom: 0;
    }

    .dashboard::after {
        content: "";
        display: block;
        height: calc(var(--mobile-nav-clearance) + env(safe-area-inset-bottom, 0px));
        pointer-events: none;
    }

    .topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 12px;
        margin-bottom: 16px;
    }

    .diagnostic-link {
        justify-self: start;
        margin-top: -4px;
    }

    .topbar-brand {
        display: grid;
    }

    .topbar h1 {
        font-size: clamp(1.75rem, 8vw, 2.55rem);
    }

    .content-grid {
        margin-top: 14px;
    }

    .panel {
        min-height: 132px;
        padding: 18px;
        border-radius: 20px;
    }

    .score-card {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 16px;
    }

    .ring {
        width: 118px;
    }

    .ring span {
        font-size: 2.45rem;
    }

    .mini-ring {
        width: 96px;
        margin: 14px auto 8px;
    }

    .calories-card strong,
    .goal-card strong,
    .workout-card strong,
    .weekly-panel strong {
        margin: 18px 0 6px;
        font-size: clamp(1.65rem, 8vw, 2.35rem);
    }

    .workout-card strong,
    .goal-card strong {
        font-size: clamp(1.35rem, 6vw, 1.9rem);
    }

    .macro-list,
    .meal-list {
        gap: 12px;
        margin-top: 14px;
    }

    .meal-row {
        padding: 12px;
        border-radius: 14px;
    }

    .week-dots {
        margin: 14px 0 10px;
    }

    .bottom-nav {
        position: fixed;
        right: 14px;
        bottom: 14px;
        left: 14px;
        z-index: 5;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 8px;
        border: 1px solid rgba(213, 255, 92, 0.16);
        border-radius: 22px;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
            linear-gradient(135deg, rgba(17, 22, 17, 0.86), rgba(6, 8, 6, 0.88));
        box-shadow:
            0 18px 42px rgba(0, 0, 0, 0.58),
            inset 0 1px 0 rgba(255, 255, 255, 0.12),
            inset 0 -1px 0 rgba(183, 245, 28, 0.08);
        backdrop-filter: blur(22px) saturate(1.18);
        -webkit-backdrop-filter: blur(22px) saturate(1.18);
    }

    .bottom-nav a {
        padding: 10px 6px;
        border-radius: 16px;
        color: var(--muted);
        text-align: center;
        font-size: 0.76rem;
        font-weight: 800;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
    }

    .bottom-nav a.active {
        background:
            radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.52), transparent 36%),
            linear-gradient(180deg, #dfff66 0%, var(--lime) 48%, #8fc914 100%);
        color: #071006;
        box-shadow:
            0 8px 22px rgba(183, 245, 28, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.42),
            inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    }

    .profile-page {
        padding: 22px 14px 34px;
    }

    .profile-body {
        height: auto;
        overflow: auto;
    }

    .recipes-html,
    .lists-html,
    .tracking-html,
    .plans-body,
    .recipes-body,
    .lists-body,
    .tracking-body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .recipes-html::-webkit-scrollbar,
    .lists-html::-webkit-scrollbar,
    .tracking-html::-webkit-scrollbar,
    .plans-body::-webkit-scrollbar,
    .recipes-body::-webkit-scrollbar,
    .lists-body::-webkit-scrollbar,
    .tracking-body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .plans-page,
    .recipes-page,
    .lists-page,
    .tracking-page {
        min-height: auto;
        padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
    }

    .profile-hero,
    .profile-layout,
    .plans-layout,
    .recipes-layout,
    .lists-layout,
    .tracking-layout,
    .tracking-intro,
    .tracking-summary,
    .field-grid,
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .plans-intro,
    .lists-intro,
    .recipes-intro {
        position: static;
    }

    .plans-summary,
    .plans-hydration,
    .plans-advice,
    .plans-grid,
    .lists-summary,
    .lists-actions-panel,
    .lists-category-grid,
    .lists-guidance,
    .purchased-stock-panel,
    .recipes-guide,
    .recipes-grid {
        grid-column: auto;
        grid-row: auto;
    }

    .plans-grid,
    .recipes-grid,
    .lists-category-grid,
    .purchased-stock-panel form,
    .plans-metrics,
    .plans-metrics.compact,
    .plan-hydration-steps {
        grid-template-columns: 1fr;
    }

    .plans-top-actions {
        justify-content: start;
    }

    .plans-page .profile-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .plans-page .profile-brand,
    .recipes-page .profile-brand,
    .lists-page .profile-brand,
    .tracking-page .profile-brand {
        width: 100%;
    }

    .plans-page .profile-brand .brand-mark,
    .recipes-page .profile-brand .brand-mark,
    .lists-page .profile-brand .brand-mark,
    .tracking-page .profile-brand .brand-mark {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    .recipes-hero,
    .lists-hero,
    .tracking-hero {
        position: static;
        margin: 0 0 14px;
        padding: 0;
        border-bottom: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .recipes-page .profile-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .tracking-page .profile-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .lists-page .profile-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .recipes-intro,
    .recipes-guide,
    .lists-actions-panel {
        grid-template-columns: 1fr;
    }

    .recipes-intro {
        gap: 12px;
    }

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

    .recipes-guide {
        position: static;
    }

    .lists-actions {
        justify-content: flex-start;
    }

    .shopping-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .shopping-item > label {
        grid-column: 1 / -1;
    }

    .shopping-item em {
        grid-column: 1;
        justify-self: start;
    }

    .tracking-progress-grid {
        grid-template-columns: 1fr;
    }

    .tracking-score-row {
        grid-template-columns: 1fr;
    }

    .tracking-ring {
        width: 112px;
    }

    .tracking-week-grid {
        grid-template-columns: repeat(7, minmax(58px, 1fr));
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .tracking-week-grid::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .tracking-journal-item {
        display: grid;
    }

    .recipe-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .recipe-filters::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .recipe-filters button {
        flex: 0 0 auto;
    }

    .profile-intro {
        position: relative;
        top: auto;
    }
}

@media (max-width: 420px) {
    :root {
        --mobile-nav-clearance: 128px;
        --mobile-nav-mask: 116px;
    }

    .main-panel {
        padding-right: 12px;
        padding-left: 12px;
    }

    .topbar-brand {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .score-card {
        grid-template-columns: 1fr;
    }

    .ring {
        width: 108px;
    }

    .panel {
        min-height: 122px;
        padding: 16px;
    }

    .bottom-nav {
        right: 10px;
        bottom: 10px;
        left: 10px;
        gap: 6px;
        padding: 7px;
    }

    .bottom-nav a {
        padding: 9px 6px;
        font-size: 0.76rem;
    }
}

/* Phase 39 - navigation unifiee JC-Nutrition */
.app-shell-unified {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-navigation {
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
}

.navigation-head {
    position: relative;
}

.app-navigation .brand {
    width: 100%;
}

.brand-copy,
.brand-copy strong,
.brand-copy small {
    display: block;
    min-width: 0;
}

.brand-copy strong {
    line-height: 1.15;
}

.brand-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
}

.app-navigation .nav-list {
    flex: 0 0 auto;
}

.navigation-cross-app {
    display: grid;
    gap: 8px;
    margin-top: auto;
    padding-top: 28px;
}

.navigation-cross-app > span {
    padding-left: 12px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.fitness-nav-item {
    border-color: rgba(255, 145, 26, 0.24);
    background: linear-gradient(135deg, rgba(255, 139, 24, 0.12), rgba(255, 255, 255, 0.025));
    color: #ffb35c;
}

.fitness-nav-item:hover,
.fitness-nav-item:focus-visible {
    border-color: rgba(255, 159, 43, 0.52);
    background: linear-gradient(135deg, rgba(255, 139, 24, 0.2), rgba(255, 255, 255, 0.04));
    color: #ffc47c;
}

.nav-drawer-toggle,
.nav-drawer-close,
.nav-drawer-backdrop {
    display: none;
}

.secondary-main-panel {
    padding: 0;
}

.secondary-main-panel .profile-page {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
}

.secondary-main-panel .recipes-guide {
    top: 18px;
}

.bottom-nav {
    display: none !important;
}

@media (max-width: 980px) {
    :root {
        --mobile-nav-clearance: 0px;
        --mobile-nav-mask: 0px;
    }

    html,
    body,
    .recipes-html,
    .lists-html,
    .tracking-html,
    .plans-body,
    .recipes-body,
    .lists-body,
    .tracking-body,
    .profile-body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    .recipes-html::-webkit-scrollbar,
    .lists-html::-webkit-scrollbar,
    .tracking-html::-webkit-scrollbar,
    .plans-body::-webkit-scrollbar,
    .recipes-body::-webkit-scrollbar,
    .lists-body::-webkit-scrollbar,
    .tracking-body::-webkit-scrollbar,
    .profile-body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body.nav-open {
        position: fixed;
        right: 0;
        left: 0;
        width: 100%;
        overflow: hidden;
    }

    .app-shell-unified {
        display: block;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .app-shell-unified::after {
        display: none;
    }

    .app-shell-unified .main-panel {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        padding: 80px 14px calc(32px + env(safe-area-inset-bottom, 0px));
    }

    .app-shell-unified .secondary-main-panel {
        padding: 68px 0 calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .app-shell-unified .profile-page {
        min-height: 0;
        padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px));
    }

    .app-shell-unified .dashboard::after {
        display: none;
    }

    .nav-drawer-toggle {
        position: fixed;
        top: calc(14px + env(safe-area-inset-top, 0px));
        left: 14px;
        z-index: 42;
        display: grid;
        place-content: center;
        gap: 5px;
        width: 46px;
        height: 46px;
        border: 1px solid rgba(183, 245, 28, 0.24);
        border-radius: 14px;
        background: rgba(8, 11, 8, 0.94);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
        color: var(--lime);
        cursor: pointer;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .nav-drawer-toggle span {
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .nav-drawer-backdrop {
        position: fixed;
        inset: 0;
        z-index: 38;
        display: block;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        transition: opacity 180ms ease;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .nav-drawer-backdrop[hidden] {
        display: none;
    }

    .app-navigation {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        display: flex;
        width: min(330px, 88vw);
        height: 100vh;
        height: 100dvh;
        padding: calc(18px + env(safe-area-inset-top, 0px)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
        border-right: 1px solid rgba(183, 245, 28, 0.16);
        background: rgba(5, 8, 6, 0.98);
        box-shadow: 28px 0 70px rgba(0, 0, 0, 0.62);
        transform: translateX(-105%);
        transition: transform 220ms ease;
        visibility: visible;
    }

    .nav-open .app-navigation {
        transform: translateX(0);
    }

    .nav-open .nav-drawer-backdrop {
        opacity: 1;
    }

    .nav-open .nav-drawer-toggle {
        visibility: hidden;
    }

    .navigation-head {
        padding-right: 48px;
    }

    .nav-drawer-close {
        position: absolute;
        top: 4px;
        right: 0;
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.045);
        color: var(--text);
        font: inherit;
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
    }

    .app-navigation .nav-list {
        margin-top: 20px;
    }

    .app-navigation .nav-item {
        min-height: 46px;
        display: flex;
        align-items: center;
    }

    .navigation-cross-app {
        padding-top: 18px;
    }

    .topbar-brand {
        display: none;
    }

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

    .secondary-main-panel .recipes-guide {
        top: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-navigation,
    .nav-drawer-backdrop {
        transition: none;
    }
}

/* Phase 51 - scanner de produits emballés */
body.barcode-modal-open {
    overflow: hidden;
}

.barcode-modal[hidden],
.barcode-stage[hidden] {
    display: none !important;
}

.barcode-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(2, 6, 4, 0.96);
    color: #f4f8f5;
    padding: clamp(10px, 2vw, 24px);
}

.barcode-modal-shell {
    width: min(1120px, 100%);
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(173, 255, 47, 0.2);
    background: #07100b;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
}

.barcode-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 17, 12, 0.96);
}

.barcode-modal-header h2 {
    margin: 3px 0 0;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
}

.barcode-close {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(173, 255, 47, 0.34);
    border-radius: 6px;
    color: #d9ff8c;
    background: #0c1811;
    font-weight: 800;
    cursor: pointer;
}

.barcode-modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(18px, 3vw, 34px);
    scrollbar-color: rgba(173, 255, 47, 0.55) #050806;
}

.barcode-stage {
    width: min(860px, 100%);
    margin: 0 auto;
}

.barcode-intro,
.barcode-product-origin,
.barcode-summary,
.barcode-result,
.barcode-allergy-warning,
.barcode-comparison {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    background: #0a1510;
}

.barcode-intro strong,
.barcode-product-origin strong,
.barcode-summary strong,
.barcode-result strong {
    display: block;
    margin-bottom: 6px;
    color: #dfff9b;
}

.barcode-intro p,
.barcode-product-origin span,
.barcode-summary p,
.barcode-result p {
    margin: 0;
    color: #aab8ae;
}

.barcode-camera {
    position: relative;
    width: min(680px, 100%);
    aspect-ratio: 4 / 3;
    margin: 0 auto 18px;
    overflow: hidden;
    border: 1px solid rgba(173, 255, 47, 0.28);
    border-radius: 6px;
    background: #020503;
}

.barcode-camera video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.barcode-viewfinder {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 34%;
    height: 32%;
    border: 2px solid #b8ff38;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.34), inset 0 0 28px rgba(184, 255, 56, 0.1);
    pointer-events: none;
}

.barcode-camera p {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    margin: 0;
    padding: 8px;
    color: white;
    background: rgba(2, 6, 4, 0.78);
    text-align: center;
}

.barcode-scan-actions,
.barcode-form-actions,
.barcode-comparison-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.barcode-manual-entry {
    margin-top: 24px;
}

.barcode-manual-entry > label,
.barcode-product-form > label,
.barcode-fields-grid label,
.barcode-nutrition-grid label,
.barcode-portion-grid label {
    display: grid;
    gap: 7px;
    color: #d8e1da;
    font-size: 0.84rem;
    font-weight: 700;
}

.barcode-manual-entry > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 8px;
}

.barcode-modal input,
.barcode-modal select {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 5px;
    padding: 9px 11px;
    color: #f4f8f5;
    background: #050b08;
    font: inherit;
}

.barcode-modal input:focus,
.barcode-modal select:focus {
    outline: 2px solid rgba(184, 255, 56, 0.5);
    outline-offset: 1px;
}

.barcode-loading-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 5px;
    background: #101b14;
}

.barcode-loading-bar span {
    display: block;
    width: 42%;
    height: 100%;
    background: linear-gradient(90deg, #8fdc24, #d4ff69);
    animation: barcode-loading 1.1s ease-in-out infinite alternate;
}

@keyframes barcode-loading {
    from { transform: translateX(-15%); }
    to { transform: translateX(150%); }
}

.barcode-fields-grid,
.barcode-nutrition-grid,
.barcode-portion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

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

.barcode-allergy-warning {
    margin-top: 14px;
    border-color: rgba(255, 162, 54, 0.45);
    color: #ffd098;
    background: rgba(63, 34, 5, 0.5);
}

.barcode-comparison {
    margin-top: 14px;
}

.barcode-comparison > label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.barcode-comparison input {
    width: 18px;
    min-height: 18px;
    grid-row: 1 / span 2;
}

.barcode-comparison small {
    color: #94a198;
    overflow-wrap: anywhere;
}

.barcode-comparison-actions button,
.barcode-portion-shortcuts button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(173, 255, 47, 0.2);
    border-radius: 5px;
    color: #dce8df;
    background: #0b1710;
    cursor: pointer;
}

.barcode-portion-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 18px;
}

.barcode-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    color: #d8e1da;
}

.barcode-confirm-check input {
    width: 20px;
    min-height: 20px;
    flex: 0 0 20px;
}

.barcode-scan-trigger {
    border-color: rgba(184, 255, 56, 0.5);
}

@media (max-width: 700px) {
    .barcode-modal {
        padding: 0;
    }

    .barcode-modal-shell {
        border: 0;
    }

    .barcode-modal-header {
        padding: 13px 15px;
    }

    .barcode-modal-body {
        padding: 16px 14px calc(34px + env(safe-area-inset-bottom));
        scrollbar-width: none;
    }

    .barcode-modal-body::-webkit-scrollbar {
        display: none;
    }

    .barcode-fields-grid,
    .barcode-nutrition-grid,
    .barcode-portion-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .barcode-manual-entry > div {
        grid-template-columns: 1fr;
    }

    .barcode-camera {
        aspect-ratio: 3 / 4;
        max-height: 58vh;
    }

    .barcode-form-actions .meal-action-btn,
    .barcode-scan-actions .meal-action-btn {
        flex: 1 1 180px;
    }
}

/* Bandeau de filtres adaptatif : la hauteur de grille reste stable pendant la transition. */
.secondary-main-panel .recipes-guide {
    min-height: var(--recipes-guide-expanded-height, 136px);
    clip-path: inset(0 round 16px);
    isolation: isolate;
    transition:
        clip-path 240ms ease,
        box-shadow 240ms ease;
    will-change: clip-path;
}

.secondary-main-panel .recipes-guide::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 0;
    height: var(--recipes-guide-compact-height, 54px);
    border: 1px solid rgba(183, 245, 28, 0.11);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(18, 23, 19, 0.975), rgba(5, 8, 6, 0.988)),
        radial-gradient(circle at 88% 0%, rgba(183, 245, 28, 0.09), transparent 18rem);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        inset 0 -1px 0 rgba(183, 245, 28, 0.075),
        0 10px 22px rgba(0, 0, 0, 0.36);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(20px) saturate(108%);
    -webkit-backdrop-filter: blur(20px) saturate(108%);
    transition: opacity 240ms ease;
}

.secondary-main-panel .recipes-guide > div:first-child h2,
.secondary-main-panel .recipes-guide > div:first-child .muted,
.secondary-main-panel .recipes-guide .recipe-state {
    transition:
        opacity 200ms ease,
        transform 240ms ease,
        visibility 0s linear 240ms;
}

.secondary-main-panel .recipes-guide .recipe-filters {
    position: relative;
    z-index: 1;
    transform: translateY(0);
    transition: transform 240ms ease;
    will-change: transform;
}

.secondary-main-panel .recipes-guide.is-compact {
    clip-path: inset(0 0 calc(100% - var(--recipes-guide-compact-height, 54px)) 0 round 16px);
    pointer-events: none;
}

.secondary-main-panel .recipes-guide.is-compact::after {
    opacity: 1;
}

.secondary-main-panel .recipes-guide.is-compact > div:first-child h2,
.secondary-main-panel .recipes-guide.is-compact > div:first-child .muted,
.secondary-main-panel .recipes-guide.is-compact .recipe-state {
    opacity: 0;
    transform: translateY(-7px);
    visibility: hidden;
}

.secondary-main-panel .recipes-guide.is-compact .recipe-filters {
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    padding: 0;
    transform: translateY(calc(-1 * var(--recipes-guide-filter-shift, 0px)));
    pointer-events: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.secondary-main-panel .recipes-guide.is-compact .recipe-filters::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@media (max-width: 980px) {
    html.recipes-html {
        overflow-y: auto;
    }

    body.recipes-body {
        overflow: visible;
    }

    .secondary-main-panel .recipes-guide {
        position: sticky;
        top: calc(68px + env(safe-area-inset-top, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .secondary-main-panel .recipes-guide,
    .secondary-main-panel .recipes-guide > div:first-child h2,
    .secondary-main-panel .recipes-guide > div:first-child .muted,
    .secondary-main-panel .recipes-guide .recipe-state,
    .secondary-main-panel .recipes-guide .recipe-filters,
    .secondary-main-panel .recipes-guide::after {
        transition: none;
    }
}

/* Phase 59.1 - passe UX/UI transversale */
:root {
    --content-max: 1440px;
    --focus-ring: #d7ff69;
    --success: #72d64b;
    --warning: #ffb35c;
}

body {
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

button:disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.58;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 5000;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--lime);
    color: #071006;
    font-weight: 900;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.mobile-app-bar {
    display: none;
}

.main-panel > .dashboard,
.secondary-main-panel .profile-page {
    width: min(100%, var(--content-max));
    margin-right: auto;
    margin-left: auto;
}

.secondary-main-panel .profile-page {
    max-width: var(--content-max);
}

.page-intro {
    border-color: rgba(183, 245, 28, 0.2);
    background:
        linear-gradient(145deg, rgba(24, 29, 24, 0.98), rgba(8, 11, 9, 0.98)),
        radial-gradient(circle at 92% 8%, rgba(183, 245, 28, 0.1), transparent 20rem);
}

.page-intro h1 {
    max-width: 16ch;
    letter-spacing: 0;
}

.panel h1,
.panel h2,
.panel h3 {
    text-wrap: balance;
}

.panel p,
.panel li,
.panel label,
.panel small {
    text-wrap: pretty;
}

.meal-action-btn,
.daily-context-actions :where(button, a),
.lists-actions button,
.recipe-filters button,
.recipe-card button,
.journal-edit button,
.journal-remove-btn,
.hydration-actions button {
    min-height: 44px;
}

.meal-action-btn,
.lists-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
}

.meal-action-btn.primary,
.lists-actions button:first-child {
    border-color: rgba(183, 245, 28, 0.48);
    background: linear-gradient(135deg, var(--lime), #d6ff54);
    color: #071006;
    box-shadow: 0 10px 24px rgba(183, 245, 28, 0.14);
}

.meal-action-btn:hover,
.lists-actions button:hover,
.recipe-filters button:hover {
    border-color: rgba(183, 245, 28, 0.36);
}

.meal-action-btn.primary:hover,
.lists-actions button:first-child:hover {
    border-color: rgba(221, 255, 117, 0.8);
    background: #d6ff54;
}

.field-grid input,
.field-grid select,
.profile-card textarea,
.free-meal-form input,
.free-meal-form select,
.purchased-stock-panel input,
.purchased-stock-panel select {
    min-height: 46px;
}

.choice-grid label {
    min-height: 46px;
}

.choice-grid input,
.shopping-item input,
.barcode-confirm-check input {
    width: 22px;
    height: 22px;
    min-height: 22px;
}

.profile-status,
.recipe-state,
.action-state {
    overflow-wrap: anywhere;
}

.recipe-state[data-state="loading"],
.action-state[data-state="loading"] {
    color: var(--warning);
}

.recipe-state[data-state="success"],
.action-state[data-state="success"] {
    color: var(--success);
}

.recipe-state[data-state="error"],
.action-state[data-state="error"] {
    color: #ff8a8a;
}

@media (min-width: 1360px) {
    .hero-grid {
        grid-template-columns: minmax(320px, 1.55fr) repeat(3, minmax(0, 1fr));
    }

    .score-card {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

@media (min-width: 981px) and (max-width: 1359px) {
    .hero-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.plans-metrics span {
    min-height: 72px;
}

.recipe-card {
    height: 100%;
}

.recipe-card .meal-action-btn,
.recipe-card [data-recipe-detail] {
    margin-top: auto;
}

.recipe-filter-reset {
    border-color: rgba(255, 107, 107, 0.24) !important;
    background: rgba(255, 107, 107, 0.06) !important;
    color: #ffaaaa !important;
}

.recipe-filter-reset[hidden] {
    display: none !important;
}

.recipes-empty,
.recipes-error {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed rgba(183, 245, 28, 0.24);
    border-radius: 12px;
    text-align: center;
}

.tracking-progress-grid [role="progressbar"] {
    min-width: 0;
}

.tracking-week-day {
    min-height: 92px;
}

.shopping-item > label {
    min-height: 44px;
}

.shopping-item > button {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 107, 107, 0.18);
    border-radius: 8px;
    color: #ff9b9b;
}

.shopping-item > button:hover {
    border-color: rgba(255, 107, 107, 0.42);
    color: #ffc0c0;
}

.updates-page {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    gap: 18px;
    align-items: start;
}

.updates-intro {
    position: sticky;
    top: 28px;
}

.updates-intro h1 {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.98;
}

.updates-timeline {
    position: relative;
    display: grid;
    gap: 14px;
    padding-left: 20px;
}

.updates-timeline::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--lime), rgba(183, 245, 28, 0.08));
}

.update-entry {
    position: relative;
    min-height: 0;
}

.update-entry::before {
    content: "";
    position: absolute;
    top: 30px;
    left: -23px;
    width: 10px;
    height: 10px;
    border: 2px solid #071006;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(183, 245, 28, 0.12);
}

.update-entry-current {
    border-color: rgba(183, 245, 28, 0.34);
}

.update-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.update-version {
    border: 1px solid rgba(183, 245, 28, 0.28);
    border-radius: 999px;
    padding: 5px 9px;
    background: rgba(183, 245, 28, 0.08);
    color: var(--lime);
    font-weight: 900;
}

.update-entry h2 {
    margin: 16px 0 6px;
}

.update-entry p {
    margin: 0;
    color: var(--muted);
}

.diagnostic-page table {
    table-layout: fixed;
}

.diagnostic-page :where(th, td) {
    overflow-wrap: anywhere;
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .sidebar,
    .mobile-app-bar,
    .nav-drawer-toggle,
    .recipes-guide,
    .recipes-hero,
    .bottom-nav {
        background: #080b08;
    }
}

@media (max-width: 980px) {
    .mobile-app-bar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 49;
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        min-height: calc(66px + env(safe-area-inset-top, 0px));
        padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
        border-bottom: 1px solid rgba(183, 245, 28, 0.14);
        background: rgba(5, 8, 6, 0.94);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(18px) saturate(112%);
        -webkit-backdrop-filter: blur(18px) saturate(112%);
    }

    .mobile-app-bar .nav-drawer-toggle {
        position: static;
        display: grid;
        width: 46px;
        height: 46px;
    }

    .mobile-app-identity {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 10px;
    }

    .mobile-app-mark {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.06);
    }

    .mobile-app-mark img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-app-identity strong,
    .mobile-app-identity small {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-app-identity strong {
        font-size: 0.9rem;
        letter-spacing: 0;
        text-transform: uppercase;
    }

    .mobile-app-identity small {
        margin-top: 1px;
        color: var(--lime);
        font-size: 0.74rem;
        font-weight: 800;
    }

    .nav-drawer-backdrop {
        z-index: 50;
    }

    .app-navigation {
        z-index: 51;
    }

    .nav-open .mobile-app-bar {
        visibility: hidden;
    }

    .app-shell-unified .main-panel {
        padding-top: calc(82px + env(safe-area-inset-top, 0px));
    }

    .app-shell-unified .secondary-main-panel {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
    }

    .topbar-brand {
        display: none;
    }

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

    .topbar h1 {
        font-size: clamp(1.75rem, 8vw, 2.45rem);
    }

    .page-intro h1,
    .profile-intro h1,
    .plans-intro h1,
    .recipes-intro h1,
    .updates-intro h1 {
        max-width: none;
        font-size: clamp(1.85rem, 8vw, 2.55rem);
        line-height: 1.02;
    }

    .profile-actions {
        position: sticky;
        bottom: 0;
        z-index: 12;
        margin: 0 -4px;
        padding: 12px 4px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(183, 245, 28, 0.14);
        background: rgba(5, 8, 6, 0.96);
        box-shadow: 0 -16px 28px rgba(0, 0, 0, 0.28);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .profile-actions .meal-action-btn {
        flex: 1 1 100%;
    }

    .field-grid input,
    .field-grid select,
    .profile-card textarea,
    .free-meal-form input,
    .free-meal-form select,
    .purchased-stock-panel input,
    .purchased-stock-panel select {
        font-size: 1rem;
    }

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

    .plans-metrics span {
        min-height: 68px;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .recipe-filters button {
        min-height: 42px;
    }

    .tracking-week-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow-x: visible;
    }

    .tracking-week-day {
        min-height: 84px;
    }

    .shopping-item {
        gap: 10px;
    }

    .shopping-item > button {
        min-height: 44px;
    }

    .updates-page {
        grid-template-columns: 1fr;
    }

    .updates-intro {
        position: static;
    }

    .updates-timeline {
        padding-left: 16px;
    }

    .update-entry::before {
        left: -19px;
    }
}

@media (max-width: 430px) {
    .panel {
        padding: 16px;
    }

    .daily-context-head,
    .daily-context-actions,
    .context-recommendation,
    .update-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-context-actions :where(button, a),
    .lists-actions button,
    .meal-actions .meal-action-btn {
        width: 100%;
    }

    .plans-metrics,
    .plans-metrics.compact,
    .recipes-summary-strip {
        grid-template-columns: 1fr;
    }

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

    .shopping-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .shopping-item > label {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
