@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

:root {
    --bottom-nav-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* iOS paints a grey flash/box over tapped elements; kill it app-wide.
       The overlay attaches to whichever element receives the touch (often a
       span/svg inside a button), so per-button rules aren't enough. */
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: #F8F8F8;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: #F8F8F8;
    color: #2D2D2D;
    min-height: 100%;
    width: 100%;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

/* App content wrapper */
.app-content {
    background: #F8F8F8;
}

body.recipe-detail-open {
    /* Allow document scroll for pull-to-refresh on recipe page */
}

/* Hide other sections when recipe is open to prevent background scroll */
body.recipe-detail-open .section:not(#recipe-detail-section) {
    display: none !important;
}

/* Completely hide the app header on recipe detail page */
body.recipe-detail-open .app-header {
    display: none !important;
}

body.recipe-detail-open,
html:has(body.recipe-detail-open) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: #FFFFFF !important;
}

/* Override all section padding/min-height for recipe detail */
body.recipe-detail-open #recipe-detail-section {
    min-height: auto !important;
    padding-bottom: 0 !important;
    /* Full-bleed: the fixed header ignores section padding (it's position:fixed),
       so the scrolling content must too — otherwise the content looks pinched
       15px narrower than the header above it. Inner cards keep their own insets. */
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: #FFFFFF !important;
}

body.recipe-detail-open #recipe-scroll-area {
    background: #FFFFFF !important;
}

body.recipe-detail-open #recipe-detail-section .section-content,
body.recipe-detail-open #recipe-tab-content-wrapper {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    background: #FFFFFF !important;
}

body.recipe-detail-open .app-content {
    background: #FFFFFF !important;
}

body.recipe-detail-open .recipe-tab-content {
    padding: 16px 0 0 0 !important;
    flex: 1;
}

body.recipe-detail-open .recipe-tab-content > *:last-child {
    margin-bottom: 0 !important;
}

.recipe-add-row,
.recipe-add-row.recipe-ingredient-item,
.recipe-add-row.recipe-instruction-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 8px !important;
    cursor: pointer !important;
    border-bottom: none !important;
    background: transparent !important;
    gap: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-family: 'Quicksand', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #F7941D !important;
    line-height: 1.4 !important;
}

.recipe-add-row *,
.recipe-add-row.recipe-ingredient-item *,
.recipe-add-row.recipe-instruction-item * {
    flex: 0 0 auto !important;
    min-width: auto !important;
    text-align: left !important;
    color: #F7941D !important;
    font-family: 'Quicksand', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Back button row in recipe header */

.recipe-back-btn {
    width: 44px !important;
    height: 44px !important;
    z-index: 1;
    position: absolute;
    left: 7px;
    top: 9px;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    color: #2D2D2D !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.recipe-back-btn:hover,
.recipe-back-btn:focus,
.recipe-back-btn:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.recipe-back-btn svg {
    stroke: #2D2D2D !important;
    fill: none !important;
    width: 22px !important;
    height: 22px !important;
}

.recipe-back-btn svg polyline {
    stroke: #2D2D2D !important;
}

header:not(.app-header) {
    text-align: center;
    margin-bottom: 30px;
    color: #2D2D2D;
}

/* Ensure app-header has no bottom margin */
.app-header {
    margin-bottom: 0 !important;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    color: #666666;
    font-weight: 500;
}

.return-home {
    text-align: center;
    margin-bottom: 25px;
}

.section {
    display: none !important;
    visibility: hidden !important;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    pointer-events: none;
    background: #F8F8F8;
}

#paste-recipe-section {
    overflow: hidden !important;
    overflow-y: hidden !important;
}

.section.active {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto;
    padding-top: 0;
}

.home-section {
    overflow: hidden !important;
    padding-bottom: 0 !important;
    background: #F8F8F8;
}

.section:not(.home-section) {
    padding-bottom: 0;
    margin-bottom: 0;
    min-height: auto;
    background: #F8F8F8;
}

/* Section content wrapper - provides bottom spacing to clear fixed nav */
.section-content {
    padding-bottom: 24px;
}

/* Form toggle class */
.form-hidden {
    display: none !important;
}

.form-visible {
    display: block !important;
}

/* Add meal toggle button states - ALWAYS orange on mobile */
/* Unified button base styles for meal action buttons */
#add-meal-toggle-btn,
#upload-recipe-btn {
    width: 220px !important;
    height: 48px !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#add-meal-toggle-btn {
    background-color: #F7941D !important;
    background: #F7941D !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
}

#upload-recipe-btn {
    background-color: #FAF8F5 !important;
    background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
    color: #2D2D2D !important;
    border: 1.5px solid #F7941D !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

/* Toggle button active state - stays highlighted while form is open */
#add-meal-toggle-btn.is-active {
    background-color: #E07A10 !important;
    background: #E07A10 !important;
}

/* Only apply hover darkening on devices that actually support hover (mouse/trackpad) */
@media (hover: hover) and (pointer: fine) {
    #add-meal-toggle-btn:hover {
        background-color: #E07A10 !important;
        background: #E07A10 !important;
        transform: translateY(-2px);
    }
    #upload-recipe-btn:hover {
        background-color: #F0EBE5 !important;
        background: linear-gradient(135deg, #F0EBE5 0%, #E8E3DD 100%) !important;
        transform: translateY(-2px);
    }
}

/* On touch devices - show brief active state, then return to orange */
@media (hover: none), (pointer: coarse) {
    #add-meal-toggle-btn {
        background-color: #F7941D !important;
        background: #F7941D !important;
        transition: background-color 0.15s ease, background 0.15s ease;
    }
    
    #upload-recipe-btn {
        background-color: #FAF8F5 !important;
        background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
        transition: background-color 0.15s ease, background 0.15s ease;
    }
    
    /* Toggle button stays highlighted while form is open - MUST be inside media query */
    #add-meal-toggle-btn.is-active,
    #add-meal-toggle-btn.is-active:hover,
    #add-meal-toggle-btn.is-active:focus {
        background-color: #E07A10 !important;
        background: #E07A10 !important;
    }
    
    /* Hover should NOT change color on touch (unless is-active) */
    #add-meal-toggle-btn:not(.is-active):hover {
        background-color: #F7941D !important;
        background: #F7941D !important;
    }
    
    #upload-recipe-btn:hover {
        background-color: #FAF8F5 !important;
        background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
    }
    
    /* Active state shows darker color briefly while finger is down */
    #add-meal-toggle-btn:active {
        background-color: #E07A10 !important;
        background: #E07A10 !important;
        transform: scale(0.98);
    }
    
    #upload-recipe-btn:active {
        background-color: #E8E3DD !important;
        background: linear-gradient(135deg, #E8E3DD 0%, #DED9D3 100%) !important;
        transform: scale(0.98);
    }
    
    /* Focus should return to orange (unless is-active) */
    #add-meal-toggle-btn:not(.is-active):focus {
        background-color: #F7941D !important;
        background: #F7941D !important;
    }
    
    #upload-recipe-btn:focus {
        background-color: #FAF8F5 !important;
        background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
    }
}

#add-meal-toggle-btn:focus,
#add-meal-toggle-btn:active,
#add-meal-toggle-btn:visited,
#add-meal-toggle-btn:target {
    background-color: #F7941D !important;
    background: #F7941D !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

#upload-recipe-btn:focus,
#upload-recipe-btn:active,
#upload-recipe-btn:visited,
#upload-recipe-btn:target {
    background-color: #FAF8F5 !important;
    background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.controls.single-line {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
}

.controls.single-line .btn {
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Quicksand', sans-serif;
}
@media (hover: hover) and (pointer: fine) {
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
}


.btn-primary {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-primary:hover {
    background: #E07A10;
}
}


.btn-success {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-success:hover {
    background: #E07A10;
}
}


.btn-info {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-info:hover {
    background: #E07A10;
}
}


.btn-secondary {
    background: #666666;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-secondary:hover {
    background: #555555;
}
}


.btn-danger {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-danger:hover {
    background: #E07A10;
}
}


.btn-warning {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.btn-warning:hover {
    background: #E07A10;
}
}


.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.output {
    background: transparent;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
    min-height: 300px;
    border: none;
}

.meals-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.meals-filter-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.meals-filter {
    position: relative;
    flex-shrink: 0;
    height: 36px;
}

.sort-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sort-pill-text {
    font-size: 12.5px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    color: #666;
    white-space: nowrap;
}

.sort-pill-chevron {
    flex-shrink: 0;
}

.sort-pill-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: none;
    background: transparent;
    font-size: 16px;
}

.meals-filter select {
    padding: 0 28px 0 10px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    background: white;
    color: #2D2D2D;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    height: 36px;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A58CAA' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.meals-filter select:focus {
    outline: none;
    border-color: #F7941D;
}

.meals-search-wrap {
    flex: 1;
    position: relative;
    height: 36px;
    align-self: center;
}

.meals-search-icon {
    position: absolute;
    left: 12px;
    top: 11px;
    pointer-events: none;
    display: block;
}

.meals-search-wrap input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 32px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: white;
    color: #2D2D2D;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.meals-search-wrap input:focus {
    border-color: #F7941D;
}

.meals-search-wrap input::placeholder {
    color: #ccc;
    font-weight: 500;
}

/* ✕ clear button — appears only while there's search text */
.meals-search-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: none;   /* shown via JS when the field has text */
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    color: #C7C0B8 !important;
    font-size: 13px !important;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.meals-search-clear:active {
    color: #9A9188 !important;
}

/* In the day chooser sheet the search wrap is a flex row, so the ✕ sits as
   a flex child instead of being absolutely positioned. */
.sheet-search-wrap .meals-search-clear {
    position: static;
    transform: none;
    flex-shrink: 0;
}

/* Keep typed text clear of the ✕ */
.meals-search-wrap input {
    padding-right: 32px;
}

.meals-filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.meals-filter-chips::-webkit-scrollbar {
    display: none;
}

.meals-chip {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    font-family: 'Quicksand', sans-serif;
    background: #fff;
    color: #888;
    border: 1px solid #eee;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.meals-chip.active {
    background: rgba(247, 148, 29, 0.1);
    color: #F7941D;
    border-color: rgba(247, 148, 29, 0.3);
}

.meals-count {
    font-size: 11px;
    color: #A09A90;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.meal-card {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 14px;
    padding: 9px 16px;
    box-shadow: 0 0.5px 6px rgba(0, 0, 0, 0.025);
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    gap: 10px;
}


.meal-fav-heart {
    flex-shrink: 0;
    cursor: pointer;
    z-index: 5;
    line-height: 1;
    /* 44px hit area (Apple HIG) without changing the card's visual size */
    width: 44px;
    height: 44px;
    margin: -12px -12px -12px -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
.meal-fav-heart:hover {
}
}


.meal-fav-heart.empty svg path {
    fill: none;
    stroke: #ddd;
    stroke-width: 2;
}

.meal-fav-heart.filled svg path {
    fill: #F7941D;
    stroke: #F7941D;
    stroke-width: 2;
}

#recipe-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 0 44px;
    width: 100%;
    box-sizing: border-box;
}

button.recipe-share-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    z-index: 1;
    position: absolute !important;
    right: 7px !important;
    top: 9px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    font-size: 0 !important;
    color: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

button.recipe-share-btn:active,
button.recipe-share-btn:focus,
button.recipe-share-btn:hover {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

button.recipe-share-btn svg {
    stroke: #999999 !important;
    fill: none !important;
    width: 20px !important;
    height: 20px !important;
}


#docked-grocery-btn .grocery-ready-inner {
    background: #F9E4C4;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    pointer-events: auto;
    cursor: pointer;
    max-width: 420px;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
}

.grocery-ready-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.grocery-ready-title {
    font-weight: 700;
    font-size: 15px;
    color: #2D2D2D;
}

.grocery-ready-detail {
    font-size: 13px;
    color: #8A8A8A;
    font-weight: 500;
}

.grocery-ready-view {
    color: #F7941D;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Quicksand', sans-serif;
}

.recipe-title-edit-icon {
    display: none !important;
}

#recipe-title {
    cursor: pointer;
}

.recipe-title-edit-icon svg {
    width: 12px;
    height: 12px;
}

.recipe-title-edit-icon svg path {
    fill: none;
    stroke: #666666;
    stroke-width: 1.5;
}

.recipe-title-edit-input {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    padding: 6px 10px;
    border: 2px solid #F7941D;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    color: #33302B;
    background: white;
    text-align: left;
}

.recipe-title-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.2);
}

.meal-card h3 {
    color: #2D2D2D;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
}

.meal-card p {
    margin-bottom: 4px;
    line-height: 1.3;
    color: #2D2D2D;
}

.meal-card p.meal-card-meta {
    color: #555555;
    font-size: 0.75rem;
    font-weight: 400;
    margin-bottom: 0;
}

.diet-filters {
    margin-bottom: 15px;
}

.diet-tag {
    display: inline-block;
    background: #F7941D;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 5px;
    border: 1px solid #E0E0E0;
    font-weight: 500;
}

.ingredients-list, .steps-list {
    margin: 15px 0;
    padding-left: 25px;
}

.ingredients-list li, .steps-list li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #2D2D2D;
}

.week-plan {
    display: grid;
    gap: 20px;
}

.week-plan h2 {
    text-align: center;
    color: #2D2D2D;
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
}

.day-plan {
    background: white;
    border-radius: 14px;
    padding: 11px 16px;
    box-shadow: 0 0.5px 6px rgba(0, 0, 0, 0.025);
    margin-bottom: 4px;
    border: none;
}

.day-plan h3 {
    color: #F0A94E;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.meal-details {
    position: relative;
    transition: all 0.3s ease;
}

.meal-details.draggable {
    cursor: move;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
@media (hover: hover) and (pointer: fine) {
.meal-details.draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
}


.meal-details.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drag-handle {
    color: #888888 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    cursor: grab;
    padding: 0 8px;
    user-select: none;
    line-height: 1;
    letter-spacing: 2px;
}

.drag-handle:active {
    cursor: grabbing;
    color: #F7941D !important;
}

.meal-content {
    flex: 1;
}

.meal-details h4 {
    color: #2D2D2D;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.day-plan.drag-over {
    background-color: #F8F8F8;
    transform: scale(1.02);
}

.empty-meal-slot {
    padding: 20px;
    text-align: center;
    color: #666666;
    font-style: italic;
    border: 2px dashed #E0E0E0;
    border-radius: 20px;
    background: #F8F8F8;
}

.drag-instructions {
    text-align: center;
    color: #666666;
    font-style: italic;
    margin-bottom: 20px;
    padding: 15px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.add-meal-form {
    background: #FFFFFF;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0E0E0;
}

.add-meal-form h3 {
    margin-bottom: 20px;
    color: #2D2D2D;
    text-align: center;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2D2D2D;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-size: 14px;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #F7941D;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.meals-list h2 {
    text-align: center;
    color: #2D2D2D;
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
}

.meals-list h3 {
    color: #2D2D2D;
    margin: 30px 0 20px 0;
    font-size: 1.3rem;
    border-bottom: 2px solid #F7941D;
    padding-bottom: 8px;
    font-weight: 600;
}

/* Meal plan container - no background */
.generated-meals {
    background: transparent;
    padding: 0;
    margin: 0 auto 20px auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* Clean styling for meals display (no container) */
.meals-display {
    padding: 0;
    margin: 0;
}

.meals-display .meals-header h3,
.generated-meals h3 {
    text-align: center;
    color: #2D2D2D;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.meals-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 25px;
    padding-bottom: 80px;
}

.meal-summary-card {
    background: #FFFFFF;
    border-radius: 15px;
    padding: 12px 15px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #E0E0E0;
    transition: all 0.3s ease;
}

.meal-summary-card.custom {
    background: #F8F8F8;
}

.meal-summary-card {
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
.meal-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
}


.click-hint {
    font-size: 0.8rem;
    color: #666666;
    font-style: italic;
    margin-top: 8px !important;
}

.meal-summary-card h4 {
    color: #2D2D2D;
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.meal-summary-card p {
    margin-bottom: 4px;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #2D2D2D;
}

.meal-card-buttons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.edit-btn, .remove-btn {
    background: transparent;
    color: #666666;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    line-height: 1;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn {
    background: transparent;
}
@media (hover: hover) and (pointer: fine) {
.edit-btn:hover {
    background: #F7941D;
    color: white;
    border-color: #F7941D;
}
}


.remove-btn {
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 400;
}
@media (hover: hover) and (pointer: fine) {
.remove-btn:hover {
    background: #F7941D;
    color: white;
    border-color: #F7941D;
}
}


/* Clean delete X for meal cards */
.meal-delete-x {
    position: absolute;
    top: 11px;
    right: 12px;
    font-size: 15px;
    color: #BDBDBD;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
    z-index: 5;
}
@media (hover: hover) and (pointer: fine) {
.meal-delete-x:hover {
    color: #999999;
}
}


.meal-card-content {
    flex: 1;
    min-width: 0;
}

.meal-card h4 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    color: #2D2D2D;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    padding-right: 30px;
}

.meal-card-meta {
    margin: 4px 0 0 0;
    font-size: 11px;
    color: #8A8A8A;
    font-weight: 500;
    line-height: 1;
    display: flex;
    align-items: center;
}

.meal-title-clickable {
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
.meal-title-clickable:hover {
    color: #2D2D2D;
}
}


/* Recipe Detail Section - uses document scroll for pull-to-refresh support */
#recipe-detail-section {
    display: none !important;
    visibility: hidden !important;
    width: 100%;
    pointer-events: none;
}

#recipe-detail-section.active {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto;
}

/* Fixed Recipe Header - completely removed from scroll flow */
#recipe-fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #F8F8F8;
    padding: 0;
    box-sizing: border-box;
}

#recipe-fixed-header > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Recipe content area - scrolls with document, offset by header height */
#recipe-scroll-area {
    padding: 0;
    padding-top: var(--recipe-header-height, 200px);
    max-width: 100%;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
}

#recipe-header {
    text-align: center;
    margin-bottom: 0;
    padding-top: 0;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

#recipe-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
    -webkit-tap-highlight-color: transparent !important;
    flex-wrap: nowrap;
    padding: 0 44px;
    width: 100%;
    box-sizing: border-box;
}

#recipe-title {
    font-size: 1.15rem;
    color: #2D2D2D;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent !important;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

#recipe-meta {
    color: #888888;
    font-size: 0.9rem;
    margin-top: 16px;
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 0.5px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.meta-separator {
    color: #BBBBBB;
}

.meta-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #F7941D;
}

.meta-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: none;
    -webkit-tap-highlight-color: transparent !important;
}

.meta-dropdown:hover,
.meta-dropdown:active {
    background: transparent !important;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    stroke: #888888;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s ease;
}

.meta-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: scroll;
    min-width: 120px;
    margin-top: 5px;
    scrollbar-width: auto;
    scrollbar-color: #F7941D #E0E0E0;
    -webkit-overflow-scrolling: touch;
}

.dropdown-menu::-webkit-scrollbar {
    width: 14px !important;
    display: block !important;
    -webkit-appearance: none !important;
    background: #E0E0E0 !important;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #E0E0E0 !important;
    border-radius: 0 12px 12px 0 !important;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: #F7941D !important;
    border-radius: 7px !important;
    border: 3px solid #E0E0E0 !important;
    min-height: 40px !important;
}
@media (hover: hover) and (pointer: fine) {
.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #E07A10 !important;
}
}


.dropdown-menu::-webkit-scrollbar-corner {
    background: #E0E0E0 !important;
}

#cooking-time-menu,
#servings-menu {
    padding-right: 5px;
}

.dropdown-menu::after {
    content: '▼';
    position: sticky;
    bottom: 0;
    display: block;
    text-align: center;
    padding: 6px 0;
    background: linear-gradient(to top, white 60%, transparent);
    color: #F7941D;
    font-size: 10px;
    pointer-events: none;
}

.dropdown-menu.scrolled-bottom::after {
    display: none;
}

.meta-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu-item {
    padding: 10px 16px;
    text-align: center;
    cursor: pointer;
    color: #2D2D2D;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.dropdown-menu-item:hover {
    background: rgba(0, 0, 0, 0.2);
}
}


.dropdown-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-menu-item.selected {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

#recipe-servings-display,
#recipe-cooking-time {
    color: #666666;
    font-size: 0.9rem;
}

#recipe-save-btn.title-fav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    outline: none !important;
    padding: 0;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
#recipe-save-btn.title-fav-btn:hover {
    transform: scale(1.1);
}
}


#recipe-save-btn.title-fav-btn:focus,
#recipe-save-btn.title-fav-btn:active {
    outline: none !important;
}

#recipe-save-btn.title-fav-btn .heart-icon {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
}

#recipe-save-btn.title-fav-btn .heart-path {
    transition: all 0.2s ease !important;
}

#recipe-save-btn.title-fav-btn .heart-path.empty {
    stroke: #666 !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

#recipe-save-btn.title-fav-btn .heart-path.filled {
    fill: #FF4444 !important;
    stroke: #FF4444 !important;
    stroke-width: 1 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

/* Back Button - fixed position, same level as hamburger menu */
.back-button-container {
    position: fixed;
    top: 20px;
    left: 15px;
    z-index: 50;
}

.back-button {
    background: rgba(245, 243, 240, 0.92) !important;
    border: none !important;
    cursor: pointer;
    padding: 4px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    box-shadow: none !important;
    transition: background 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.back-button:hover {
    background: rgba(235, 232, 228, 0.95) !important;
}
}


.back-button:active,
.back-button:focus {
    background: rgba(245, 243, 240, 0.92) !important;
    outline: none !important;
}

.back-button svg {
    width: 14px;
    height: 14px;
    stroke: #666666;
    stroke-width: 2.5;
    fill: none;
}

/* Tab Bar - part of fixed header, stays visible while content scrolls */
#recipe-tabs {
    display: flex !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
    background: #F8F8F8;
    border-bottom: 1px solid #E0E0E0;
}

.recipe-tab-btn {
    background: #F8F8F8 !important;
    border: none !important;
    border-bottom: 4px solid transparent !important;
    border-radius: 0 !important;
    padding: 14px 6px;
    font-size: 0.8rem;
    font-family: 'Quicksand', sans-serif;
    color: #888888 !important;
    font-weight: 500;
    cursor: pointer;
    transition: none;
    white-space: nowrap;
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
    box-shadow: none !important;
    position: relative;
}

@media (min-width: 480px) {
    .recipe-tab-btn {
        padding: 16px 16px;
        font-size: 0.9rem;
        flex: 1 1 0;
    }
}
@media (hover: hover) and (pointer: fine) {
.recipe-tab-btn:hover {
    background: #F8F8F8 !important;
    color: #888888 !important;
    transform: none !important;
    box-shadow: none !important;
}
}


.recipe-tab-btn:active,
.recipe-tab-btn:focus {
    background: #F8F8F8 !important;
    color: #888888 !important;
    transform: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.recipe-tab-btn.active {
    background: #FFFFFF !important;
    color: #2D2D2D !important;
    border-bottom: 4px solid #F7941D !important;
    font-weight: 600;
}

.recipe-tab-btn.active:focus,
.recipe-tab-btn.active:active {
    background: #FFFFFF !important;
    color: #2D2D2D !important;
}

/* Single shared wrapper for all tab content - no card, flat layout */
#recipe-tab-content-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - var(--recipe-header-height, 200px) - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--recipe-header-height, 200px) - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* Individual tab content - content-first layout with clean spacing */
.recipe-tab-content {
    width: 100%;
    box-sizing: border-box;
    position: relative;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - var(--recipe-header-height, 200px) - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--recipe-header-height, 200px) - var(--bottom-nav-height) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 16px 4px 0 4px;
    background: #FFFFFF;
    overflow-x: hidden;
}

.recipe-tab-content ul,
.recipe-tab-content #recipe-notes-content {
    /* No separate scroll - parent handles it */
    max-height: none;
    overflow-y: visible;
}

.tab-edit-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 0.85rem;
    color: #666666;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.tab-edit-btn:hover {
    color: #F7941D;
}
}


#recipe-ingredients-list,
#recipe-instructions-list {
    list-style: none;
    padding: 0 !important;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.recipe-ingredient-item {
    padding: 10px 8px;
    border-bottom: 1px solid #E8E8E8;
    color: #2D2D2D;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 10px;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    margin-bottom: 0 !important;
    justify-content: space-between !important;
    transition: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

.recipe-ingredient-item:hover,
.recipe-ingredient-item:active,
.recipe-ingredient-item:focus {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

.recipe-ingredient-item:last-child {
    border-bottom: none;
}

.ingredient-name {
    flex: 1 1 auto;
    min-width: 0;
    color: #2D2D2D;
    text-align: left;
    font-weight: 400;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ingredient-qty {
    font-weight: 400;
    color: #888888;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
    flex-grow: 0;
    font-size: 0.85rem;
}

.recipe-instruction-item {
    padding: 14px 0 !important;
    border-bottom: 1px solid #E8E8E8 !important;
    color: #2D2D2D !important;
    line-height: 1.6 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    margin-bottom: 0 !important;
    justify-content: flex-start !important;
    transition: none !important;
    text-align: left !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    outline: none !important;
}

.recipe-instruction-item:hover,
.recipe-instruction-item:active,
.recipe-instruction-item:focus {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}

.recipe-instruction-item:last-child {
    border-bottom: none !important;
}

.step-number {
    font-weight: 700 !important;
    color: #F7941D !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline !important;
    min-width: auto !important;
}

.step-text {
    flex: 1 !important;
    line-height: 1.6 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    min-width: 0 !important;
    outline: none !important;
    display: inline !important;
}

#recipe-notes-content {
    color: #444444;
    line-height: 1.8;
    font-style: normal;
    text-align: left;
}

.add-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.add-item input {
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-size: 14px;
    min-width: 250px;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.add-item input:focus {
    outline: none;
    border-color: #F7941D;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.grocery-list {
    text-align: center;
}

.grocery-list h2 {
    color: #2D2D2D;
    margin-bottom: 12px;
    font-size: 2rem;
    font-weight: 700;
}

.grocery-list h3 {
    color: #2D2D2D;
    margin: 25px 0 15px 0;
    text-align: center;
    font-weight: 600;
}

.grocery-items {
    list-style: none;
    padding: 0;
    padding-bottom: 100px;
    max-width: 600px;
    margin: 0 auto;
}

.grocery-item {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    gap: 15px;
    box-shadow: none;
    border: 1px solid #E0E0E0;
    transition: none;
}
@media (hover: hover) and (pointer: fine) {
.grocery-item:hover {
    transform: none;
    box-shadow: none;
}
}


.grocery-item.checked {
    opacity: 0.7;
    background: #F8F8F8;
}

.grocery-item.checked .item-name {
    text-decoration: line-through;
}

.grocery-item input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #F7941D;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.grocery-item .item-name {
    text-transform: capitalize;
    font-weight: 500;
    color: #2D2D2D;
    font-size: 1rem;
    flex: 1;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #F8F8F8;
    border-radius: 12px;
    padding: 2px 6px;
    border: 1px solid #E0E0E0;
}

.qty-btn {
    background: #F7941D;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}
@media (hover: hover) and (pointer: fine) {
.qty-btn:hover {
    background: #E07A10;
    transform: scale(1.1);
}
}


.qty-btn.minus {
    background: #666666;
}
@media (hover: hover) and (pointer: fine) {
.qty-btn.minus:hover {
    background: #555555;
}
}


.quantity {
    color: #2D2D2D;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    font-size: 12px;
}

.grocery-item .aisle-info {
    background: #F7941D;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 10px;
}

.grocery-item .aisle-info.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
.grocery-item .aisle-info.clickable:hover {
    background: #E07A10;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(247, 148, 29, 0.4);
}
}


.grocery-items.completed {
    margin-top: 25px;
}

.aisle-header {
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 0;
    color: #F7941D;
    text-align: left;
    text-transform: uppercase;
    box-shadow: none;
    background: transparent;
    margin: 18px 0 8px 0;
    max-width: 600px;
    font-family: 'Quicksand', sans-serif;
    border-bottom: 1px solid rgba(247, 148, 29, 0.3);
    letter-spacing: 0.5px;
}

.aisle-display {
    background: #F7941D;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
.aisle-display:hover {
    background: #E07A10;
    transform: scale(1.05);
}
}


.home-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.home-nav-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.home-nav-btn {
    background: #F7941D;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    font-family: 'Quicksand', sans-serif;
}
@media (hover: hover) and (pointer: fine) {
.home-nav-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}
}


.home-nav-btn .nav-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.home-nav-btn h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.home-nav-btn p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

.meal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.meal-modal-content {
    background: #FFFFFF;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid #E0E0E0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid #E0E0E0;
}

.modal-header h2 {
    margin: 0;
    color: #2D2D2D;
    font-size: 1.8rem;
    font-weight: 600;
}

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    color: #666666;
    line-height: 1;
    padding: 5px;
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
.close-modal:hover {
    color: #F7941D;
    transform: scale(1.1);
}
}


.modal-body {
    padding: 0 30px 30px;
}

.modal-body .meal-card {
    margin-bottom: 0;
    padding: 20px 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.grocery-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #E0E0E0;
}

.meal-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

.day-meal-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    padding-top: 10px;
    border-top: 1px solid #E0E0E0;
}

.day-meal-controls .btn {
    padding: 8px 15px;
    font-size: 14px;
    min-width: 45px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
.day-meal-controls .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
}


.cancelled-meal {
    text-align: center;
    padding: 40px 20px;
    background: #F8F8F8;
    border-radius: 20px;
    color: #2D2D2D;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Custom Modal Popup Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    max-width: 500px;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid #E0E0E0;
    transform: scale(0.7);
    transition: all 0.3s ease;
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1);
}

/* Override global button styles for buttons inside custom-modal */
.custom-modal button:first-child:not(.btn-destructive-text) {
    background: #F7941D !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
}

.custom-modal button:last-child:not(.btn-destructive-text):not(:first-child) {
    background: #E0E0E0 !important;
    color: #2D2D2D !important;
    box-shadow: none !important;
}

.custom-modal .btn-destructive-text {
    background: transparent !important;
    color: #666666 !important;
    border: none !important;
    box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) {
.custom-modal .btn-destructive-text:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #444444 !important;
}
}


/* Remove shadows from edit ingredient modal inputs */
#edit-ingredient-modal input,
#edit-ingredient-modal select {
    box-shadow: none !important;
}

.custom-modal-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.custom-modal-title {
    color: #2D2D2D;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.custom-modal-message {
    color: #666666;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.custom-modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Quicksand', sans-serif;
    min-width: 100px;
}
@media (hover: hover) and (pointer: fine) {
.custom-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
}


.custom-modal-btn.primary {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.custom-modal-btn.primary:hover {
    background: #E07A10;
}
}


.custom-modal-btn.secondary {
    background: #E0E0E0;
    color: #2D2D2D;
    box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
.custom-modal-btn.secondary:hover {
    background: #D0D0D0;
}
}


.custom-modal-btn.success {
    background: #F7941D;
    color: white;
}
@media (hover: hover) and (pointer: fine) {
.custom-modal-btn.success:hover {
    background: #E07A10;
}
}


.custom-modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-size: 14px;
    font-family: 'Quicksand', sans-serif;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.custom-modal-input:focus {
    outline: none;
    border-color: #F7941D;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Floating Love Button */
.love-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #F7941D;
    color: #2D2D2D;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(247, 148, 29, 0.4);
    transition: all 0.3s ease;
    z-index: 1001;
    white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
.love-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(247, 148, 29, 0.6);
    background: #F7941D;
}
}


.love-button:active {
    transform: translateY(0) scale(0.98);
}

/* Love Popup Modal */
.love-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 148, 29, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.love-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.love-modal {
    background: #F8F8F8;
    border-radius: 30px;
    padding: 40px 35px;
    max-width: 90%;
    max-width: 450px;
    min-width: 320px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(247, 148, 29, 0.4);
    border: 2px solid #F7941D;
    transform: scale(0.7) rotate(-5deg);
    transition: all 0.4s ease;
    position: relative;
}

.love-modal-overlay.show .love-modal {
    transform: scale(1) rotate(0deg);
}

.love-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #F7941D;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
    padding: 5px;
}
@media (hover: hover) and (pointer: fine) {
.love-modal-close:hover {
    color: #E07A10;
    transform: scale(1.2);
}
}


.love-modal-heart {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes smoothSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.love-modal-message {
    color: #2D2D2D;
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 25px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(247, 148, 29, 0.3);
}

.love-modal-signature {
    color: #F7941D;
    font-size: 1rem;
    font-style: italic;
    margin-top: 15px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .meal-modal-content {
        max-width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .controls.single-line {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
    }

    .controls.single-line .btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .output {
        padding: 20px;
    }

    .meals-grid {
        flex-direction: column;
        gap: 4px;
    }

    .add-item {
        flex-direction: column;
        align-items: center;
    }

    .add-item input {
        min-width: 200px;
    }

    .item-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .item-controls {
        align-self: stretch;
        justify-content: space-between;
    }

    .quantity-controls {
        padding: 2px 6px;
    }

    .qty-btn {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .quantity {
        font-size: 11px;
        min-width: 14px;
    }

    .home-nav-btn {
        padding: 25px 20px;
    }

    .home-nav-btn .nav-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }

    .home-nav-btn h3 {
        font-size: 1.3rem;
    }

    .home-nav-btn p {
        font-size: 0.9rem;
    }

    .love-button {
        top: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 12px;
    }

    .love-modal {
        padding: 30px 25px;
        margin: 20px;
    }

    .love-modal-message {
        font-size: 1.2rem;
    }

    .love-modal-heart {
        font-size: 3rem;
        margin-bottom: 15px;
    }
}

/* Drag and Drop Styles */
.sortable-meal-list {
  position: relative;
}

.draggable-meal {
  transition: all 0.3s ease;
  cursor: move;
}
@media (hover: hover) and (pointer: fine) {
.draggable-meal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
}


.draggable-meal.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.drag-handle {
  font-weight: 900 !important;
  user-select: none;
  padding: 0 8px;
  transition: color 0.3s ease;
  font-size: 18px !important;
  color: #888888 !important;
  letter-spacing: 2px;
}
@media (hover: hover) and (pointer: fine) {
.drag-handle:hover {
  color: #F7941D !important;
}
}


.eating-out-meal {
  background: #FAFAFA !important;
  border: 1px dashed #D0D0D0 !important;
  opacity: 0.85;
}

.eating-out-meal .item-name {
  font-weight: 500;
  color: #999999;
  font-style: italic;
}

/* Generator Section */
.generator-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-week-plan {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.custom-day-slot {
  background: #FFFFFF;
  border-radius: 14px;
  padding: 11px 16px;
  border: 2px dashed #E0E0E0;
  box-shadow: 0 0.5px 6px rgba(0, 0, 0, 0.025);
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 100px;
}
@media (hover: hover) and (pointer: fine) {
.custom-day-slot:hover {
  border-color: #F7941D;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
}


.custom-day-slot.has-meal {
  border-style: solid;
  border-color: #F7941D;
  background: #FFFFFF;
}

.custom-day-slot.eating-out {
  border-style: solid;
  border-color: #F7941D;
  background: #FFFFFF;
}

.day-label {
  font-weight: 700;
  color: #666666;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.meal-slot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.empty-slot-text {
  color: #666666;
  font-style: italic;
  font-size: 15px;
}

.selected-meal-name {
  color: #2D2D2D;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  word-break: break-word;
}

.eating-out-text {
  color: #F7941D;
  font-weight: 600;
  font-size: 16px;
}

.meal-slot-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.meal-slot-btn-text {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #666666;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  padding: 2px 8px !important;
  border-radius: 0 !important;
  transition: color 0.2s ease;
  outline: none !important;
}
@media (hover: hover) and (pointer: fine) {
.meal-slot-btn-text:hover {
  color: #F7941D;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
}


.meal-slot-btn-text:focus {
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.meal-slot-btn-text.remove {
  color: #E57373;
}
@media (hover: hover) and (pointer: fine) {
.meal-slot-btn-text.remove:hover {
  color: #EF5350;
  background: transparent !important;
}
}


.meal-selection-item {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 14px;
  padding: 9px 16px;
  box-shadow: 0 0.5px 6px rgba(0, 0, 0, 0.025);
  cursor: pointer;
  margin-bottom: 8px;
  gap: 10px;
  -webkit-user-select: none;
  user-select: none;
}

.meal-selection-item .meal-card-content {
  flex: 1;
  min-width: 0;
}

.meal-selection-item h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #2D2D2D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding-right: 10px;
}

.meal-selection-item .meal-card-meta {
  margin: 4px 0 0 0;
  font-size: 11px;
  color: #999;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
}

.meal-selection-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.meal-selection-overlay.visible {
  opacity: 1;
}

.meal-selection-overlay .meal-selection-content {
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.meal-selection-overlay.visible .meal-selection-content {
  transform: translateY(0);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.meal-selection-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: #FFFFFF;
  border-radius: 0;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-drag-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0 20px;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.sheet-drag-zone:active {
  cursor: grabbing;
}

.sheet-handle {
  width: 32px;
  height: 3px;
  background: #DCDCDC;
  border-radius: 1.5px;
  pointer-events: none;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 20px 16px;
  border-bottom: 1px solid #E0E0E0;
  flex-shrink: 0;
}

.sheet-header-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 500;
  color: #2D2D2D;
  font-family: 'Quicksand', sans-serif;
  line-height: 1.2;
}

.sheet-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: #BBB;
  font-family: 'Quicksand', sans-serif;
}

.sheet-close {
  font-size: 17px;
  color: #BBB;
  cursor: pointer;
  padding: 2px 0 0 0;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}

.sheet-search-wrap {
  display: flex;
  align-items: center;
  margin: 12px 16px;
  flex-shrink: 0;
  background: #F4F4F4;
  border: 1px solid #EBEBEB;
  border-radius: 14px;
  padding: 0 14px;
  height: 48px;
}

.meal-selection-content input#meal-search-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 14px 0 14px 26px;
  border: none;
  border-radius: 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  line-height: 1.2;
  color: #2D2D2D;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B0B0B0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat left center;
  background-size: 16px 16px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.meal-selection-content input#meal-search-input::placeholder {
  color: #999;
}

.meal-selection-content input#meal-search-input:focus {
  outline: none;
  box-shadow: none;
}

.sheet-search-wrap:focus-within {
  border-color: #F7941D;
  background: white;
}

.sheet-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sheet-chips::-webkit-scrollbar {
  display: none;
}

#meal-selection-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px 16px;
  background: #F8F8F8;
}

.sheet-surprise-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  margin: 4px 20px 10px 20px;
  padding: 13px 16px !important;
  background: rgba(247, 148, 29, 0.1) !important;
  color: #E07A10 !important;
  border: 1.5px solid #F7941D !important;
  border-radius: 16px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.sheet-surprise-btn:active { background: rgba(247, 148, 29, 0.2) !important; }
.meal-selection-content .sheet-surprise-btn:hover,
.meal-selection-content .sheet-surprise-btn:focus {
  background: rgba(247, 148, 29, 0.1) !important;
  color: #E07A10 !important;
  outline: none !important;
}
.sheet-surprise-emoji { font-size: 17px; }

.meal-selection-footer {
  padding: 18px 20px;
  border-top: 1px solid #EBEBEB;
  flex-shrink: 0;
  text-align: center;
}

.meal-selection-footer button,
.meal-selection-footer button:focus,
.meal-selection-footer button:active,
.meal-selection-footer button:hover {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #D4615A !important;
  padding: 0 !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  transform: none !important;
}

/* Section Header Styles - hidden since title moved to app-header */
.section-header {
  display: none;
}

/* Add breathing room under header for Meals and Planner tabs */
#meals-section .section-content,
#generator-section .section-content {
  padding-top: 20px;
}

#generator-section .section-content {
  /* Extra room for the docked "Grocery list ready" banner (~72px) so the
     last day card can scroll fully above it */
  padding-bottom: calc(96px + var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}


/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

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

/* Bottom Navigation */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #F8F8F8;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--bottom-nav-height);
  padding: 6px 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: none;
  z-index: 1000;
  border-top: 1px solid rgba(247, 148, 29, 0.35);
  border-radius: 16px 16px 0 0;
}

/* Extend background color to cover iOS safe area */
.bottom-nav::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-bottom, 0px);
  background: #F8F8F8;
  z-index: -1;
}

/* SEAM FIX: Remove box-shadow from all sections - THIS IS THE CAUSE */
.section,
.section.active,
#grocery-section,
#meals-section,
#generator-section,
#recipe-detail-section {
  box-shadow: none !important;
}

/* Force same background everywhere */
html, body, .app-content, .section, .section-content, .bottom-nav {
  background: #F8F8F8 !important;
}

.bottom-nav .nav-tab {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  color: #666666 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  padding: 5px 10px !important;
  font-family: 'Quicksand', sans-serif !important;
  transition: color 0.2s ease !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-width: auto !important;
  min-height: auto !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* id-keyed so these win over the runtime theme's injected
   button:not(...):hover rule (specificity 0,4,1). #bottom-nav .nav-tab = 1,2,0.
   Without this, a tapped tab gets painted with the theme accent (#666666) and
   the sticky iOS :hover leaves a charcoal box behind the tab. */
#bottom-nav .nav-tab,
#bottom-nav .nav-tab:hover,
#bottom-nav .nav-tab:active,
#bottom-nav .nav-tab:focus {
  background: none !important;
  background-color: transparent !important;
  color: #666666 !important;
  transform: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#bottom-nav .nav-tab.active,
#bottom-nav .nav-tab.active:hover,
#bottom-nav .nav-tab.active:active,
#bottom-nav .nav-tab.active:focus {
  color: #F7941D !important;
}

.bottom-nav .nav-tab svg {
  width: 24px !important;
  height: 24px !important;
}

/* Tap to edit hint */
.tap-to-edit-hint {
  text-align: center;
  font-size: 11px;
  color: #888888;
  opacity: 0.7;
  font-style: italic;
  font-weight: 500;
  margin: 0 0 12px 0;
  padding: 0;
}

/* Clickable instruction items */
.recipe-instruction-item {
  cursor: pointer;
  padding: 14px 0;
  margin-bottom: 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid #E8E8E8;
  transition: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
}

.recipe-instruction-item:hover,
.recipe-instruction-item:active,
.recipe-instruction-item:focus {
  background: transparent;
  box-shadow: none;
  outline: none;
  transform: none;
}

.recipe-instruction-item:last-child {
  border-bottom: none;
}

#recipe-notes-list .recipe-instruction-item {
  border-bottom: 1px solid #E8E8E8 !important;
}

.note-text {
  flex: 1;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  min-height: 1.6em;
  outline: none !important;
}

#recipe-notes-content {
  cursor: pointer;
  padding: 16px 0;
  background: transparent;
  border-radius: 0;
  min-height: 60px;
  transition: none;
  line-height: 1.8;
  color: #444444;
}
@media (hover: hover) and (pointer: fine) {
#recipe-notes-content:hover {
  background: transparent !important;
}
}


/* Action Row - reusable full-width tappable row (like Delete Ingredient) */
.action-row {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #EEEEEE;
  text-align: center;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.action-row:active {
  background-color: rgba(0, 0, 0, 0.04);
}

.action-row-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  display: inline-block;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.action-row-text:active {
  background-color: rgba(0, 0, 0, 0.06);
}

/* Orange variant (Add actions) */
.action-row-text.action-orange {
  color: #F7941D;
}

/* Red variant (Delete actions) */
.action-row-text.action-red {
  color: #C62828;
}

/* Notes tab - remove divider from Add Note row for consistency with other empty tabs */
.add-note-action-row {
  border-top: none;
  margin-top: 16px;
  padding-top: 0;
}

/* For list items that contain action rows */
.action-row-wrapper {
  list-style: none !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) {
.action-row-wrapper:hover {
  background: transparent !important;
}
}


/* Remove top border when action row is inside a wrapper (list already has bottom borders) */
.action-row-wrapper .action-row {
  border-top: none;
  margin-top: 8px;
  padding-top: 8px;
}

/* Remove top border when action row follows a list (list items have bottom borders) */
ul + .action-row-wrapper .action-row,
.recipe-tab-content ul + li.action-row-wrapper .action-row {
  border-top: none;
  margin-top: 4px;
}

/* Legacy inline add button - keeping for backwards compatibility */
.inline-add-btn-wrapper {
  list-style: none !important;
  display: block !important;
  width: 100% !important;
  padding: 12px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  text-align: center !important;
}
@media (hover: hover) and (pointer: fine) {
.inline-add-btn-wrapper:hover {
  background: transparent !important;
}
}


.inline-add-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  width: auto !important;
  max-width: fit-content !important;
  padding: 6px 8px !important;
  border: none !important;
  background: #F7941D !important;
  border-radius: 12px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  color: white !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  box-shadow: none !important;
  outline: none !important;
  white-space: nowrap !important;
  transform: none !important;
}
@media (hover: hover) and (pointer: fine) {
.inline-add-btn:hover {
  background: #F7941D;
}
}


.inline-add-btn .plus-icon {
  color: white;
  font-weight: 600;
  font-size: 0.7rem;
}

.inline-add-btn:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Inline editable row for adding ingredients/steps */
.inline-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #E0E0E0;
  animation: inlineRowFadeIn 0.15s ease;
}

.inline-add-row.instruction-row {
  align-items: flex-start;
}

@keyframes inlineRowFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.inline-add-row input,
.inline-add-row textarea {
  flex: 1;
  border: none;
  border-bottom: 1px dashed #CCC;
  padding: 6px 4px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  background: transparent;
  color: #2D2D2D;
  outline: none;
  transition: border-color 0.2s ease;
}

.inline-add-row input:focus,
.inline-add-row textarea:focus {
  border-bottom-color: #F7941D;
}

.inline-add-row input::placeholder,
.inline-add-row textarea::placeholder {
  color: #AAA;
  font-style: italic;
}

.inline-add-row .qty-input {
  width: 50px;
  text-align: center;
  flex: 0 0 50px;
}

.inline-add-row .unit-input {
  width: 60px;
  flex: 0 0 60px;
}

.inline-add-row textarea {
  min-height: 40px;
  resize: none;
  line-height: 1.5;
}

/* Ensure inline add row is visible above keyboard */
.inline-add-row {
  scroll-margin-bottom: 300px;
}

/* When keyboard is likely open, add extra bottom padding */
#recipe-ingredients-list:has(.inline-add-row),
#recipe-instructions-list:has(.inline-add-row) {
  padding-bottom: 350px !important;
}

/* Simple Grocery List - FORCE horizontal row layout */
.simple-grocery-list {
  list-style: none !important;
  padding: 0 !important;
  padding-bottom: 60px !important;
  margin: 0 !important;
  background: transparent !important;
  width: 100% !important;
}

.simple-grocery-list li {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: block !important;
}

.simple-grocery-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 20px 7px 6px !important;
  background: transparent !important;
  cursor: pointer !important;
  border-bottom: 1px solid #F0F0F0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  transition: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  outline: none !important;
}

.simple-grocery-item:hover,
.simple-grocery-item:active,
.simple-grocery-item:focus {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.simple-grocery-list *,
.simple-grocery-list *:hover,
.simple-grocery-list *:active,
.simple-grocery-list *:focus {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.swipe-container,
.swipe-container:hover,
.swipe-container:active,
.swipe-container:focus,
.swipe-content,
.swipe-content:hover,
.swipe-content:active,
.swipe-content:focus {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

.grocery-item-info,
.grocery-item-info:hover,
.grocery-item-info:active,
.grocery-item-info:focus {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.simple-grocery-item.checked {
  opacity: 0.4 !important;
}

.simple-grocery-item.checked .grocery-item-name {
  text-decoration: line-through !important;
  color: #999999 !important;
}

.grocery-checkbox {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  border-radius: 50% !important;
  border: 2px solid #CCCCCC !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
}

.grocery-checkbox.checked {
  background: #F7941D !important;
  border-color: #F7941D !important;
}

.grocery-item-info {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  flex: 1 !important;
  justify-content: space-between !important;
  width: 100% !important;
}

.grocery-item-name {
  font-size: 17px !important;
  color: #2D2D2D !important;
  font-weight: 400 !important;
  text-align: left !important;
  flex: 1 !important;
  min-width: 0 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.grocery-item-qty {
  font-size: 13px !important;
  color: #555555 !important;
  font-weight: 400 !important;
  text-align: right !important;
  flex-shrink: 0 !important;
  letter-spacing: 0.3px !important;
}

/* Swipe to delete */
.swipe-container {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.swipe-delete-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: #FF3B30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 25px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.swipe-container.swiping .swipe-delete-bg {
  opacity: 1;
}

/* Tick-off strike (the motion itself is driven by the Web Animations API in
   toggleGroceryItem — JS keyframes, immune to stylesheet conflicts). */
.simple-grocery-item .grocery-item-name {
  transition: color 0.2s ease;
}
.simple-grocery-item.checking-off .grocery-item-name {
  text-decoration: line-through;
  color: #B8B2A8;
}

.swipe-content {
  position: relative;
  background: #F8F8F8;
  transition: transform 0.2s ease;
  z-index: 1;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
}

.swipe-container.swiping .swipe-content {
  transition: none;
}

.swipe-content.deleting {
  transform: translateX(-100%);
  transition: transform 0.25s ease-out;
}

/* Docked Grocery Add Bar */
.grocery-add-bar {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border-top: 1px solid #E8E8E8;
    padding: 8px 16px;
}

.grocery-add-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F5F5F5;
    border-radius: 25px;
    padding: 10px 14px;
    cursor: pointer;
}

.grocery-add-bar-placeholder {
    font-size: 0.9rem;
    font-weight: 400;
    color: #AAAAAA;
    font-family: 'Quicksand', sans-serif;
}

.grocery-add-bar-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grocery-add-bar-mic {
    cursor: pointer;
}

.grocery-add-bar-divider {
    width: 1px;
    height: 18px;
    background: #D5D5D5;
}

.grocery-add-bar-plus {
    display: flex;
    align-items: center;
    justify-content: center;
}

#grocery-section .section-content {
    padding-bottom: calc(60px + var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}

/* Floating Action Buttons Container - fixed position, always visible */
.grocery-fab-container {
  position: fixed;
  bottom: 100px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 100;
}

/* Floating Add Button (FAB) */
.grocery-fab {
  width: 48px;
  height: 48px;
  background: #F7941D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.grocery-fab:hover {
  transform: scale(1.1);
}
}


.grocery-fab:active {
  transform: scale(0.95);
}

.grocery-fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

/* Add Meal Card (inline at top of meals list) */
.add-meal-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 4px;
    border: 1.5px dashed #D5D5D5;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
}

.add-meal-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #F7941D;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.add-meal-card-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #888888;
    font-family: 'Quicksand', sans-serif;
}

/* Meal Context Menu */
.meal-context-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  display: none;
}

.meal-context-overlay.active {
  display: block;
}

.meal-context-menu {
  position: fixed;
  z-index: 10002;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  min-width: 180px;
  overflow: hidden;
  display: none;
  border: 1px solid #E5E5E5;
}

.meal-context-menu.active {
  display: block;
}

.meal-context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #2D2D2D;
  -webkit-tap-highlight-color: transparent;
}

.meal-context-delete {
  color: #D32F2F;
}

.meal-context-separator {
  height: 0.5px;
  background: #E5E5E5;
  margin: 0 12px;
}

.planner-day-picker-title {
  padding: 13px 18px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Meals FAB - removed, now uses header + button */

.meals-fab {
  width: 48px;
  height: 48px;
  background: #F7941D;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.meals-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(247, 148, 29, 0.5);
}
}


.meals-fab:active {
  transform: scale(0.95);
}

/* Meals Action Sheet Overlay */
.meals-action-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.meals-action-sheet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Meals Action Sheet (bottom sheet) */
.meals-action-sheet {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: #F8F8F8;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 20px 20px;
  z-index: 10002;
  transform: translateY(calc(100% + 20px));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  visibility: hidden;
}

.meals-action-sheet.active {
  transform: translateY(0);
  visibility: visible;
}

/* ===== Onboarding / How Prepiva works tour ===== */
.tour-top {
  display: flex;
  justify-content: flex-end;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 0 18px;
  flex-shrink: 0;
}
.tour-skip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #A09A90 !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 10px 12px !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
#onboarding-overlay .tour-skip:hover, #onboarding-overlay .tour-skip:focus,
#onboarding-overlay .tour-skip:active {
  background: transparent !important; color: #A09A90 !important;
  outline: none !important; box-shadow: none !important;
}

.tour-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tour-track::-webkit-scrollbar { display: none; }

.tour-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 34px 30px 34px;
  box-sizing: border-box;
}

.tour-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 150px;
  margin-bottom: 26px;
}

.tour-tile {
  width: 78px; height: 78px;
  border-radius: 22px;
  background: #FFFFFF;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
}
.tour-tile.t1 { transform: rotate(-8deg) translateY(8px); }
.tour-tile.t2 { transform: translateY(-8px); width: 88px; height: 88px; font-size: 44px; }
.tour-tile.t3 { transform: rotate(8deg) translateY(8px); }
.tour-tile.solo { width: 96px; height: 96px; font-size: 46px; background: rgba(247, 148, 29, 0.12); box-shadow: none; }

.tour-art-rows { flex-direction: column; gap: 12px; }
.tour-row {
  display: flex; align-items: center; gap: 12px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  padding: 12px 16px;
  width: 230px;
}
.tour-day {
  font-family: 'Quicksand', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  color: #F0A94E;
  width: 34px; text-align: left;
}
.tour-mini { font-size: 20px; }
.tour-badge {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(247, 148, 29, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.tour-badge-num {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700; color: #E07A10; font-size: 15px;
}
.tour-line {
  height: 9px; border-radius: 5px;
  background: #EFEAE4;
  flex: 0 0 90px;
}
.tour-line.long { flex-basis: 130px; }

.tour-timer {
  padding: 16px 30px;
  background: #F7941D;
  color: #FFFFFF;
  border-radius: 28px;
  font-family: 'Quicksand', sans-serif;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(247, 148, 29, 0.4);
  font-variant-numeric: tabular-nums;
}

.tour-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 23px;
  font-weight: 700;
  color: #2D2D2D;
  margin: 0 0 10px 0;
}
.tour-sub {
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #7A7A7A;
  line-height: 1.55;
  max-width: 300px;
  margin: 0;
}

.tour-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 24px calc(26px + env(safe-area-inset-bottom, 0px)) 24px;
}
.tour-dots { display: flex; gap: 8px; }
.tour-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #E2DCD4;
  transition: background 0.2s ease, transform 0.2s ease;
}
.tour-dot.active { background: #F7941D; transform: scale(1.25); }

.tour-next {
  width: 100%;
  max-width: 340px;
  padding: 16px !important;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 26px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 18px rgba(247, 148, 29, 0.38) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
#onboarding-overlay .tour-next:active { background: #E07A10 !important; }
#onboarding-overlay .tour-next:hover, #onboarding-overlay .tour-next:focus {
  background: #F7941D !important; color: #FFFFFF !important; outline: none !important;
}

/* ===== Meals empty state (cold-start) ===== */
.meals-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 24px;
  gap: 6px;
}
.meals-empty-emoji { font-size: 42px; margin-bottom: 6px; }
/* Warm welcome badge for the first-run empty state */
.meals-welcome-badge {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(247, 148, 29, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.meals-empty-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #2D2D2D;
}
.meals-empty-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #8A8A8A;
  max-width: 288px;
  line-height: 1.5;
}
.meals-empty-secondary {
  margin-top: 6px;
  padding: 10px 18px;
  background: transparent !important;
  color: #8A857C !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.meals-empty-secondary:active { opacity: 0.6; }
.meals-empty-secondary:hover, .meals-empty-secondary:focus {
  background: transparent !important; color: #8A857C !important; outline: none !important; opacity: 1;
}
.meals-empty-cta {
  margin-top: 16px;
  padding: 14px 26px;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 24px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.32) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.meals-empty-cta:active { background: #E07A10 !important; }
.meals-empty-cta:hover, .meals-empty-cta:focus { background: #F7941D !important; outline: none !important; }

/* ===== Suggest a Meal sheet ===== */
/* Suggest a Meal — full-screen page, slides in from the right like a
   pushed screen (replaces the old bottom sheet) */
.suggest-page {
  position: fixed;
  inset: 0;
  z-index: 10006;
  background: #F8F8F8;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.35, 1), visibility 0.28s;
}

.suggest-page.active {
  transform: translateX(0);
  visibility: visible;
}

.suggest-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-bottom: 1px solid #F0EBE5;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
  flex-shrink: 0;
}

.suggest-page-x {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: 24px !important;
  height: auto !important;
  padding: 2px 0 !important;
  font-size: 17px !important;
  color: #9A9188 !important;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.suggest-page-title {
  font-size: 15px;
  font-weight: 700;
  color: #2D2D2D;
  font-family: 'Quicksand', sans-serif;
}

.suggest-page-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 12px;
}

.suggest-page-footer {
  flex-shrink: 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #F8F8F8 75%, rgba(248, 248, 248, 0));
}

.suggest-hero {
  font-size: 21px;
  font-weight: 700;
  color: #2D2D2D;
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 16px;
}

.suggest-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B7B0A6;
  font-family: 'Quicksand', sans-serif;
  margin: 16px 0 8px 2px;
}

.suggest-prompt-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #E8E3DD;
  border-radius: 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  color: #2D2D2D;
  background: #FFFFFF;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.suggest-prompt-input:focus { border-color: #F7941D; }

.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggest-chip {
  padding: 8px 14px;
  border: 1.5px solid #E8E3DD;
  border-radius: 18px;
  background: #FFFFFF !important;
  color: #6B6B6B !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.suggest-chip.active {
  background: rgba(247, 148, 29, 0.12) !important;
  border-color: #F7941D;
  color: #E07A10 !important;
}
.suggest-chip:hover, .suggest-chip:focus { outline: none !important; }

.suggest-go-btn, .suggest-more-btn {
  width: 100%;
  margin-top: 14px;
  padding: 15px 16px;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 16px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.32) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.suggest-go-btn:active, .suggest-more-btn:active { background: #E07A10 !important; }
.suggest-go-btn:hover, .suggest-go-btn:focus,
.suggest-more-btn:hover, .suggest-more-btn:focus {
  background: #F7941D !important; outline: none !important;
}
.suggest-more-btn {
  background: #FFFFFF !important;
  color: #E07A10 !important;
  border: 1.5px solid #F7941D !important;
  box-shadow: none !important;
}
.suggest-more-btn:active { background: #FFF6EA !important; }
.suggest-more-btn:hover, .suggest-more-btn:focus { background: #FFFFFF !important; }

.suggest-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.suggest-results-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #2D2D2D;
}
.suggest-back-btn {
  /* padding:0 is load-bearing — the global button rule's 12px/18px padding
     would consume the whole 36px border-box and collapse the circle */
  width: 36px !important; height: 36px !important;
  padding: 0 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 50% !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12) !important;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.suggest-back-btn:hover, .suggest-back-btn:focus, .suggest-back-btn:active {
  background: #FFFFFF !important; outline: none !important;
}

.suggest-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}
.suggest-card-head { display: flex; align-items: flex-start; gap: 12px; }
.suggest-card-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.suggest-card-title { font-family: 'Quicksand', sans-serif; font-size: 15.5px; font-weight: 700; color: #2D2D2D; }
.suggest-card-desc { font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 500; color: #7A7A7A; line-height: 1.35; }
.suggest-card-meta { font-family: 'Quicksand', sans-serif; font-size: 12.5px; font-weight: 600; color: #A09A90; margin-top: 2px; }

.suggest-card-actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.suggest-add-btn {
  flex: 1;
  padding: 11px 14px;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 12px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}
.suggest-add-btn:active { background: #E07A10 !important; }
.suggest-add-btn:hover, .suggest-add-btn:focus { background: #F7941D !important; outline: none !important; }
.suggest-review-btn {
  padding: 11px 14px;
  background: transparent !important;
  color: #8A8A8A !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.suggest-review-btn:hover, .suggest-review-btn:focus, .suggest-review-btn:active {
  background: transparent !important; color: #8A8A8A !important; outline: none !important;
}
.suggest-added-badge {
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #4CAF50;
  padding: 6px 0;
}

.suggest-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 34px 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #8A8A8A;
}
.suggest-spinner {
  width: 34px; height: 34px;
  border: 3px solid #F0EBE5;
  border-top-color: #F7941D;
  border-radius: 50%;
  -webkit-animation: suggestSpin 0.8s linear infinite;
  animation: suggestSpin 0.8s linear infinite;
}
@-webkit-keyframes suggestSpin { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } }
@keyframes suggestSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.suggest-error {
  padding: 24px 8px;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #C0392B;
}
/* ---- id-scoped state resets ----
   The runtime theme injects a high-specificity button hover rule with an
   accent background at specificity 0,5,1, which outranks any single-class
   rule and paints tapped buttons grey - sticky hover on iOS. These
   id-scoped rules are 1,n,1 and win decisively. */
#suggest-sheet button:hover,
#suggest-sheet button:focus {
  outline: none !important;
  transform: none !important;
}
#suggest-sheet .suggest-go-btn:hover,
#suggest-sheet .suggest-go-btn:focus,
#suggest-sheet .suggest-add-btn:hover,
#suggest-sheet .suggest-add-btn:focus {
  background: #F7941D !important;
  color: #FFFFFF !important;
}
#suggest-sheet .suggest-go-btn:active,
#suggest-sheet .suggest-add-btn:active {
  background: #E07A10 !important;
}
#suggest-sheet .suggest-more-btn:hover,
#suggest-sheet .suggest-more-btn:focus {
  background: #FFFFFF !important;
  color: #E07A10 !important;
  box-shadow: none !important;
}
#suggest-sheet .suggest-more-btn:active { background: #FFF6EA !important; }
#suggest-sheet .suggest-chip:hover,
#suggest-sheet .suggest-chip:focus {
  background: #FFFFFF !important;
  color: #6B6B6B !important;
  box-shadow: none !important;
}
#suggest-sheet .suggest-chip:active,
#suggest-sheet .suggest-chip.active,
#suggest-sheet .suggest-chip.active:hover,
#suggest-sheet .suggest-chip.active:focus {
  background: rgba(247, 148, 29, 0.12) !important;
  border-color: #F7941D !important;
  color: #E07A10 !important;
  box-shadow: none !important;
}
#suggest-sheet .suggest-review-btn:hover,
#suggest-sheet .suggest-review-btn:focus,
#suggest-sheet .suggest-review-btn:active {
  background: transparent !important;
  color: #8A8A8A !important;
  box-shadow: none !important;
}
#suggest-sheet .suggest-back-btn:hover,
#suggest-sheet .suggest-back-btn:focus,
#suggest-sheet .suggest-back-btn:active {
  background: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}
#meals-grid .meals-empty-cta:hover,
#meals-grid .meals-empty-cta:focus {
  background: #F7941D !important;
  color: #FFFFFF !important;
  outline: none !important;
}
#meals-grid .meals-empty-cta:active { background: #E07A10 !important; }

/* ---- Non-blocking toast ---- */
/* Toast: light warm card with an orange accent rail — matches the app's
   white-on-off-white surfaces instead of the old heavy black pill. */
#prepiva-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.97);
  bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 10008;
  background: #FFFFFF;
  color: #3A352E;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  padding: 13px 20px 13px 24px;
  border-radius: 16px;
  border: 1px solid #F0EBE4;
  border-left: 4px solid #F7941D;
  box-shadow: 0 8px 28px -8px rgba(60, 50, 35, 0.28);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: calc(100% - 40px);
  text-align: center;
}
#prepiva-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.meals-action-sheet-handle {
  width: 40px;
  height: 4px;
  background: #D0D0D0;
  border-radius: 2px;
  margin: 0 auto 10px auto;
}

.meals-action-sheet-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #FFFFFF;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  -webkit-tap-highlight-color: transparent;
}

.choice-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(247, 148, 29, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.choice-card-title {
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #2A2A2A;
}

.choice-card-desc {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #AAAAAA;
  line-height: 1.3;
}

.choice-card-chevron {
  flex-shrink: 0;
}

/* ===== PLANNER FAB AND ACTION SHEET ===== */
.planner-fab-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.planner-fab {
  height: 44px;
  padding: 0 20px;
  background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%);
  border: 1.5px solid #F7941D;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.planner-fab-text {
  color: #2D2D2D;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
}
@media (hover: hover) and (pointer: fine) {
.planner-fab:hover {
  background: linear-gradient(135deg, #F0EBE5 0%, #E8E3DD 100%);
  transform: scale(1.02);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}
}


.planner-fab:active {
  transform: scale(0.98);
  background: linear-gradient(135deg, #EBE6E0 0%, #E5E0DA 100%);
}

/* Planner Action Sheet Overlay */
.planner-action-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.planner-action-sheet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Planner Action Sheet (bottom sheet) */
.planner-action-sheet {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: #F8F8F8;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 20px 20px;
  z-index: 10002;
  transform: translateY(calc(100% + 20px));
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  visibility: hidden;
}

.planner-action-sheet.active {
  transform: translateY(0);
  visibility: visible;
}

.planner-action-sheet-handle {
  width: 40px;
  height: 4px;
  background: #D0D0D0;
  border-radius: 2px;
  margin: 0 auto 10px auto;
}

.planner-action-sheet-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}


/* Expanded mic clone in center of screen */
.grocery-mic-expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  width: 120px;
  height: 120px;
  background: #F7941D;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10002;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(247, 148, 29, 0.5);
}

.voice-live-text {
  position: absolute;
  top: -58px;
  left: 50%;
  transform: translateX(-50%);
  color: #33302B;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  padding: 8px 16px;
  background: #FFFFFF;
  border-radius: 16px;
  white-space: nowrap;
  max-width: 82vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 16px rgba(40, 30, 10, 0.18);
  font-family: 'Quicksand', sans-serif;
}

.grocery-mic-expanded.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: pulse-mic-center 1.5s infinite;
}

/* Live audio-level ring around the mic (scaled in JS from the input level) */
.mic-level-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: rgba(247, 148, 29, 0.22);
  transform: scale(1);
  pointer-events: none;
  z-index: 10001;
  will-change: transform;
}

.grocery-mic-expanded.hiding {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

.grocery-mic-expanded svg {
  width: 50px;
  height: 50px;
}

.mic-hint {
  position: absolute;
  bottom: -76px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #6B655C;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  padding: 8px 16px;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(40, 30, 10, 0.18);
  line-height: 1.4;
  font-family: 'Quicksand', sans-serif;
}


@keyframes pulse-mic-center {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 10px 40px rgba(247, 148, 29, 0.5);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 14px 52px rgba(247, 148, 29, 0.62);
  }
}

/* Overlay behind mic when listening */
.mic-listening-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mic-listening-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.grocery-fab-container.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Scroll to Bottom Button */
.scroll-to-bottom-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 65px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #888888;
  color: white;
  padding: 4px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  font-family: 'Quicksand', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 101;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.scroll-to-bottom-btn:hover {
  transform: translateX(-50%) scale(1.05);
}
}


.scroll-to-bottom-btn:active {
  transform: translateX(-50%) scale(0.98);
}

.scroll-to-bottom-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Overlay to block clicks when input bar is open */
.grocery-input-overlay {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
  touch-action: none;
}

.grocery-input-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Dark overlay for edit grocery modal */
.grocery-edit-overlay {
  display: none;
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10100;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.grocery-edit-overlay.active {
  /* Centered card, matching the recipe's Edit Ingredient modal */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* Expandable Input Bar - bottom sheet style */
.grocery-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  background: white;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  visibility: hidden;
  pointer-events: none;
  flex-direction: column;
  align-items: stretch;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
  gap: 16px;
  z-index: 10002;
  box-sizing: border-box;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1), visibility 0.35s, bottom 0.1s ease;
}

.grocery-input-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
}

.grocery-input-bar-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #2D2D2D;
}

/* Grab handle, matching the app's other bottom sheets */
.grocery-sheet-handle {
  width: 40px;
  height: 4px;
  background: #D8D2C8;
  border-radius: 2px;
  margin: -8px auto 0 auto;
  flex-shrink: 0;
}

.grocery-input-bar-close {
  background: none !important;
  border: none !important;
  font-size: 20px;
  color: #999 !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
  line-height: 1;
  font-weight: 300;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.grocery-input-bar-close:hover,
.grocery-input-bar-close:focus,
.grocery-input-bar-close:active {
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #666 !important;
}

.grocery-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.grocery-input-field-wrapper {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.grocery-input-row .grocery-input-field-wrapper input {
  flex: 1;
  min-width: 0;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  padding: 14px 48px 14px 16px;
  outline: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  color: #2D2D2D;
  background: #F8F8F8;
  box-sizing: border-box;
}

.grocery-input-row .grocery-input-field-wrapper input:focus {
  border-color: #E0E0E0 !important;
  background: white;
}

.grocery-input-row .grocery-input-field-wrapper input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.grocery-input-row .grocery-input-field-wrapper input[type="search"]::-webkit-search-decoration,
.grocery-input-row .grocery-input-field-wrapper input[type="search"]::-webkit-search-cancel-button,
.grocery-input-row .grocery-input-field-wrapper input[type="search"]::-webkit-search-results-button,
.grocery-input-row .grocery-input-field-wrapper input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.grocery-input-row .grocery-input-field-wrapper input::placeholder {
  color: #999999;
}

.grocery-mic-inline {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  border-radius: 50%;
}

.grocery-mic-inline:active {
  background: rgba(153, 153, 153, 0.1) !important;
}

.grocery-mic-inline svg path {
  fill: #BDBDBD;
}

.grocery-mic-inline:active svg path {
  fill: #999;
}

.grocery-mic-inline.listening {
  opacity: 0.5;
}

.grocery-input-bar.expanded {
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  min-height: 50vh;
  min-height: 50dvh;
  max-height: 65vh;
  max-height: 65dvh;
  overflow-y: auto;
}

.grocery-sheet-handle {
  width: 36px;
  height: 4px;
  background: #D5D5D5;
  border-radius: 2px;
  margin: 0 auto 8px auto;
  flex-shrink: 0;
}

.grocery-input-bar input {
  flex: 1;
  min-width: 0;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  color: #2D2D2D;
  background: #F8F8F8;
  box-sizing: border-box;
}

.grocery-input-bar input:focus {
  border-color: #E0E0E0 !important;
  background: white !important;
  box-shadow: none !important;
  outline: none !important;
}

.grocery-input-bar input::placeholder {
  color: #999999;
}

/* Sits just left of the inline mic so it never covers the placeholder text */
.inline-add-check {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%) scale(0.5);
  font-size: 18px;
  color: #F7941D;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

.inline-add-check.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.grocery-input-inline-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.grocery-inline-add {
  background: #F7941D !important;
  border: none !important;
  color: #FFFFFF !important;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 14px 18px;
  border-radius: 14px;
  flex: none;
  white-space: nowrap;
  box-shadow: 0 3px 9px rgba(247, 148, 29, 0.35);
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
  box-shadow: none !important;
}

.grocery-inline-add.disabled {
  background: #EDE8E0 !important;
  color: #B3ACA1 !important;
  box-shadow: none !important;
  cursor: default;
  pointer-events: none;
}

.grocery-inline-add:hover,
.grocery-inline-add:focus {
  background: #F7941D !important;
  color: #FFFFFF !important;
  outline: none !important;
  box-shadow: none !important;
}

.grocery-input-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: transparent !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  font-size: 20px;
  font-weight: 400;
  transition: all 0.2s ease;
  flex-shrink: 0;
  opacity: 0.7;
  box-shadow: none !important;
  padding: 0;
}
@media (hover: hover) and (pointer: fine) {
.grocery-input-close:hover {
  background: transparent !important;
  color: #2D2D2D;
  opacity: 1;
  transform: scale(1.1);
}
}


/* Quick items grid */
.grocery-quick-items-wrapper {
  margin-top: 4px;
}

.grocery-quick-items-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #A39B8E;
  margin-bottom: 10px;
}


.grocery-quick-items {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.grocery-quick-btn {
  background: linear-gradient(180deg, #FAF8F5 0%, #F0EBE5 100%) !important;
  border: 1px solid #E0E0E0 !important;
  border-radius: 20px;
  padding: 10px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #2D2D2D !important;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  -webkit-tap-highlight-color: transparent;
}

.grocery-quick-btn:hover,
.grocery-quick-btn:active,
.grocery-quick-btn:focus {
  background: linear-gradient(180deg, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important;
  transform: none;
  outline: none;
}

.grocery-quick-btn.selected {
  border-color: #F7941D !important;
  background: linear-gradient(180deg, #FAF8F5 0%, #F0EBE5 100%) !important;
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.04);
}

/* Subtle highlight animation for newly added grocery items - fade in and out */
@keyframes itemAddedHighlight {
  0% {
    background-color: #E8E8E8;
    box-shadow: 0 0 12px rgba(45, 45, 45, 0.2);
  }
  80% {
    background-color: #E8E8E8;
    box-shadow: 0 0 12px rgba(45, 45, 45, 0.2);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.item-added-highlight {
  animation: itemAddedHighlight 1.5s ease-out !important;
  border-radius: 8px !important;
}

.simple-grocery-item.item-added-highlight {
  background-color: #E8E8E8 !important;
  box-shadow: 0 0 12px rgba(45, 45, 45, 0.2) !important;
}

.recipe-ingredient-item.ingredient-highlight-flash {
  animation: ingredientHighlight 1.5s ease-out !important;
  border-radius: 8px !important;
  background-color: rgba(247, 148, 29, 0.15) !important;
}

@keyframes ingredientHighlight {
  0% { background-color: rgba(247, 148, 29, 0.3); }
  100% { background-color: transparent; }
}

/* Edit Grocery Item Modal */
.edit-grocery-popup {
  position: relative;
  background: #FAFAFA;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  padding: 24px 20px;
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10101;
  margin: 0;
  border: none;
  flex-shrink: 0;
  animation: editCardIn 0.22s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes editCardIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.edit-grocery-popup .modal-buttons {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
}

.edit-grocery-save-btn {
  width: auto !important;
  flex: none !important;
  padding: 8px 26px !important;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 14px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 9px rgba(247, 148, 29, 0.32) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.edit-grocery-popup .edit-grocery-save-btn:active { background: #E07A10 !important; }
.edit-grocery-popup .edit-grocery-save-btn:hover,
.edit-grocery-popup .edit-grocery-save-btn:focus {
  background: #F7941D !important; color: #FFFFFF !important; outline: none !important;
}

.edit-grocery-cancel-btn {
  width: auto !important;
  flex: none !important;
  padding: 8px 18px !important;
  margin-top: 0 !important;
  background: transparent !important;
  color: #8A8A8A !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.edit-grocery-popup .edit-grocery-cancel-btn:hover,
.edit-grocery-popup .edit-grocery-cancel-btn:focus,
.edit-grocery-popup .edit-grocery-cancel-btn:active {
  background: transparent !important; color: #8A8A8A !important;
  outline: none !important; box-shadow: none !important;
}

.edit-grocery-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.edit-grocery-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #2D2D2D;
  text-align: center;
}

.edit-grocery-cancel, 
.edit-grocery-buttons button:last-child {
  background: transparent !important;
  color: #888888 !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.modal-buttons button:last-child,
.modal-buttons button[onclick*="close"] {
  background: transparent !important;
  color: #888888 !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
}

.edit-grocery-save,
.edit-grocery-buttons button:first-child {
  background: #F7941D !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.2s ease !important;
}

.modal-buttons button:first-child,
.modal-buttons button[onclick*="save"] {
  background: #F7941D !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
}

#edit-ingredient-modal .modal-buttons button[onclick*="close"] {
  background: transparent !important;
  color: #888888 !important;
  border: none !important;
  box-shadow: none !important;
}

button#save-ingredient-btn {
  padding: 6px 24px !important;
  border-radius: 12px !important;
}
@media (hover: hover) and (pointer: fine) {
.edit-grocery-cancel:hover,
.modal-buttons button:last-child:hover {
  background: transparent !important;
}
}

@media (hover: hover) and (pointer: fine) {
.edit-grocery-save:hover,
.modal-buttons button:first-child:hover {
  background: #e8850f !important;
}
}


.edit-grocery-field {
  margin-bottom: 14px;
}

.edit-grocery-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #666666;
  margin-bottom: 6px;
}

.edit-grocery-field input {
  width: 100%;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  color: #2D2D2D;
  background: #FFFFFF;
  box-sizing: border-box;
}

.edit-grocery-field input:focus {
  border-color: #F7941D;
  background: white;
  outline: none;
}

#edit-grocery-aisle {
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  border: 1px solid #E0E0E0 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important;
  color: #2D2D2D !important;
  background: #FFFFFF !important;
  box-sizing: border-box !important;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 40px !important;
}

#edit-grocery-aisle:focus {
  border-color: #F7941D !important;
  background-color: white !important;
  outline: none;
}

/* Generated from source row */
.edit-grocery-source-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 10px;
  border-bottom: 1px solid #E0E0E0;
}

.edit-grocery-source-label {
  font-size: 13px;
  font-weight: 600;
  color: #666666;
}

.edit-grocery-source-value {
  font-size: 14px;
  color: #888888;
}

.edit-grocery-source-value.tappable {
  color: #F7941D;
  cursor: pointer;
  font-weight: 500;
}
@media (hover: hover) and (pointer: fine) {
.edit-grocery-source-value.tappable:hover {
  text-decoration: underline;
}
}


/* Source meals list modal */
.source-meals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.source-meal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #F8F8F8;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
.source-meal-item:hover {
  background: #E8E8E8;
}
}


.source-meal-name {
  font-size: 15px;
  color: #2D2D2D;
  font-weight: 500;
}

.source-meal-arrow {
  font-size: 18px;
  color: #F7941D;
  font-weight: 600;
}

.edit-grocery-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

/* Save button style updated via .edit-grocery-save block above */
.edit-grocery-delete-section {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #EEEEEE;
  text-align: center;
}

.edit-grocery-delete-link {
  background: transparent;
  border: none;
  color: #C62828;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
@media (hover: hover) and (pointer: fine) {
.edit-grocery-delete-link:hover {
  color: #B71C1C;
}
}


/* Grocery item info wrapper (clickable area for edit) */
.grocery-item-info {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}

/* Quantity row with amount and unit */
.edit-grocery-quantity-row {
  display: flex;
  gap: 10px;
}

.edit-grocery-quantity-row input {
  flex: 1;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  color: #2D2D2D;
  background: #F8F8F8;
  box-sizing: border-box;
}

.edit-grocery-quantity-row input:focus {
  border-color: #F7941D;
  background: white;
  outline: none;
}

.edit-grocery-quantity-row select {
  flex: 1;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  color: #2D2D2D;
  background: #F8F8F8;
  box-sizing: border-box;
  cursor: pointer;
}

.edit-grocery-quantity-row select:focus {
  border-color: #F7941D;
  background: white;
  outline: none;
}



/* Voice Confirmation Popup */



















@media (hover: hover) and (pointer: fine) {

}


/* Bulk selection mode */
.bulk-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 0px;
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: flex-basis 0.25s ease-out, width 0.25s ease-out, opacity 0.2s ease-out, padding 0.25s ease-out;
  padding: 0;
}

.simple-grocery-list.selection-mode .bulk-checkbox {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  opacity: 1;
  padding-left: 12px;
}

.bulk-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #CCCCCC;
  border-radius: 3px;
  background: white !important;
  cursor: pointer;
  position: relative;
  margin: 0;
}

/* Unchecked state - hide checkmark */
.bulk-checkbox input[type="checkbox"]::after {
  content: none !important;
  display: none !important;
}

/* Checked state - show orange background */
.bulk-checkbox.checked input[type="checkbox"],
.bulk-checkbox input[type="checkbox"].checked {
  background: #F7941D !important;
  border-color: #F7941D !important;
}

/* Checked state - show checkmark */
.bulk-checkbox.checked input[type="checkbox"]::after,
.bulk-checkbox input[type="checkbox"].checked::after {
  content: '' !important;
  display: block !important;
  position: absolute;
  left: 50%;
  top: 45%;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  -webkit-transform: translate(-50%, -55%) rotate(45deg);
  transform: translate(-50%, -55%) rotate(45deg);
}


/* Bottom action bar for bulk delete */
.bulk-action-bar {
  position: fixed;
  bottom: 130px;
  left: 20px;
  right: 80px;
  background: transparent;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  display: none;
  justify-content: flex-start;
  gap: 12px;
  z-index: 100;
}

.bulk-action-bar.visible {
  display: flex;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.bulk-action-bar button {
  padding: 11px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

/* Delete — primary action (solid orange, like the app's primary CTAs) */
.bulk-delete-btn {
  background: #F7941D !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
}

.bulk-delete-btn:active {
  background: #E07A10 !important;
}

.bulk-delete-btn:hover,
.bulk-delete-btn:focus {
  background: #F7941D !important;
  color: white !important;
  outline: none !important;
}

.bulk-delete-btn:disabled {
  background: #ccc !important;
  color: #888 !important;
  box-shadow: none !important;
}

/* Cancel — secondary action (cream with orange border, like Done/upload buttons) */
.bulk-cancel-btn {
  background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important;
  border: 1.5px solid #F7941D !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.bulk-cancel-btn:active {
  background: linear-gradient(to bottom, #EBE6E0 0%, #E5E0DA 100%) !important;
}

.bulk-cancel-btn:hover,
.bulk-cancel-btn:focus {
  background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important;
  outline: none !important;
}

/* ===== Meal multi-select (same visual language as the grocery list) ===== */
#meals-grid.meal-selection-mode .bulk-checkbox {
  flex: 0 0 26px;
  width: 26px;
  min-width: 26px;
  opacity: 1;
}

.meal-card.selected {
  background: #FFF7EE;
  box-shadow: 0 0.5px 6px rgba(247, 148, 29, 0.18);
}

/* In selection mode the whole card is one tap target */
#meals-grid.meal-selection-mode .meal-card,
#meals-grid.meal-selection-mode .meal-card * {
  cursor: pointer;
}

/* App-styled confirm dialog buttons — Cancel is the quiet action, the
   destructive confirm is the distinct soft-red one (matches multi-select). */
#prepiva-confirm-modal .modal-buttons button {
  flex: 1;
  padding: 12px 0 !important;
  border-radius: 16px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none !important;
  appearance: none !important;
}

#prepiva-confirm-modal .prepiva-confirm-cancel {
  background: #F6F2ED !important;
  color: #2D2D2D !important;
  border: none !important;
  box-shadow: none !important;
}

#prepiva-confirm-modal .prepiva-confirm-cancel:active {
  background: #EBE6E0 !important;
}

#prepiva-confirm-modal .prepiva-confirm-ok {
  background: #FFF0F0 !important;
  color: #D32F2F !important;
  border: none !important;
  box-shadow: none !important;
}

#prepiva-confirm-modal .prepiva-confirm-ok:active {
  background: #FFE3E0 !important;
}

/* While selecting, the search/sort/chips row is frozen — any of them would
   re-render the list and silently drop the selection. */
.meals-header.selection-frozen {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Selection header — replaces the app header while selecting (iOS Photos
   pattern): ✕ | n selected | Select all */
.meal-select-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10005;   /* above the app header, below full-screen modals */
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-bottom: 1px solid #F0EBE5;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
}

.meal-select-header.visible {
  display: flex;
}

.meal-select-x {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 2px 6px !important;
  font-size: 17px !important;
  color: #9A9188 !important;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.meal-select-count {
  font-size: 15px;
  font-weight: 700;
  color: #2D2D2D;
}

.meal-select-all {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 2px 4px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #F7941D !important;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Twin soft buttons above the tab bar */
.meal-bulk-bar {
  left: 20px;
  right: 20px;
  bottom: 96px;
  gap: 12px;
}

.meal-bulk-bar button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 16px;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.meal-bulk-planner {
  background: #FFFFFF !important;
  color: #2D2D2D !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08) !important;
}

.meal-bulk-planner:active {
  background: #F6F2ED !important;
}

.meal-bulk-delete {
  background: #FFF0F0 !important;
  color: #D32F2F !important;
  box-shadow: none !important;
}

.meal-bulk-delete:active {
  background: #FFE3E0 !important;
}

.meal-bulk-bar button:disabled {
  opacity: 0.45;
}

/* Selected item highlight */
.swipe-container.selected .swipe-content {
  background: #FFF3E0;
}

/* ===== Grocery tab redesign ===== */

/* Shop Online — full-width orange banner */
.shop-online-banner {
  display: flex !important;
  align-items: center !important;
  gap: 14px;
  width: 100% !important;
  padding: 16px 16px !important;
  margin: 0 0 12px 0;
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 22px !important;
  box-shadow: 0 4px 14px rgba(247, 148, 29, 0.3) !important;
  cursor: pointer;
  text-align: left !important;
  font-family: 'Quicksand', sans-serif !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
}

.shop-online-banner:active {
  background: #E07A10 !important;
}

.shop-online-banner:hover,
.shop-online-banner:focus {
  background: #F7941D !important;
  color: #FFFFFF !important;
  outline: none !important;
}

.sob-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.sob-title {
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
}

.sob-sub {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.sob-chevron {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Share / Copy — one white card split in two */
.grocery-actions-card {
  display: flex;
  align-items: stretch;
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 0 0 14px 0;
  overflow: hidden;
}

.grocery-action-half {
  flex: 1;
  display: flex !important;
  align-items: center !important;
  gap: 11px;
  padding: 14px 14px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  text-align: left !important;
  font-family: 'Quicksand', sans-serif !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  min-width: 0;
}

.grocery-action-half:active {
  background: #FAF7F3 !important;
}

.grocery-action-half:hover,
.grocery-action-half:focus {
  background: transparent !important;
  outline: none !important;
}

.gac-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(247, 148, 29, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.gac-text b {
  font-size: 14px;
  font-weight: 700;
  color: #2D2D2D;
  white-space: nowrap;
}

.gac-text small {
  font-size: 11.5px;
  font-weight: 500;
  color: #8A8A8A;
  white-space: nowrap;
}

.grocery-actions-divider {
  width: 1px;
  background: #F0EDE9;
  margin: 10px 0;
  flex-shrink: 0;
}

/* Modern aisle headers with icon badge */
.aisle-header-modern {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #2D2D2D !important;
  padding: 12px 0 10px 0 !important;
  border-bottom: 1px solid rgba(247, 148, 29, 0.25) !important;
  margin: 16px 0 6px 0 !important;
}

.aisle-header-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(247, 148, 29, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.aisle-badge-number {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: #E07A10;
}

.aisle-header-name {
  flex: 1;
}

/* ===== PERMISSION MODALS ===== */
.permission-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10200;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.permission-modal.show {
  display: flex;
}

.permission-modal-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: permissionModalIn 0.3s ease;
}

@keyframes permissionModalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.permission-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.permission-modal-content h3 {
  color: #2D2D2D;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.permission-modal-content p {
  color: #888888;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.permission-note {
  font-size: 12px !important;
  color: #AAAAAA !important;
  margin-bottom: 20px !important;
}

.permission-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.permission-allow-btn {
  background: #F7941D;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.2s ease;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35);
}
@media (hover: hover) and (pointer: fine) {
.permission-allow-btn:hover {
  background: #E07A10;
}
}


.permission-cancel-btn {
  background: transparent !important;
  color: #666666 !important;
  border: none !important;
  padding: 10px 24px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: color 0.2s ease, background 0.2s ease;
  box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) {
.permission-cancel-btn:hover {
  color: #444444 !important;
  background: rgba(0, 0, 0, 0.05) !important;
}
}

/* ===== HOME QUICK ACTIONS ===== */
.home-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 400px;
  margin: 0 auto;
  padding: 0 15px;
}

.home-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 16px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  aspect-ratio: 1 / 1;
  min-height: 120px;
}
@media (hover: hover) and (pointer: fine) {
.home-action-card:hover {
  border-color: #F7941D;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.15);
}
}


.home-action-card:active {
  transform: scale(0.98);
}

.home-action-card.secondary {
  background: #F7941D !important;
  border-color: #F7941D !important;
}
@media (hover: hover) and (pointer: fine) {
.home-action-card.secondary:hover {
  border-color: #F7941D;
  background: #F7941D;
}
}


.home-action-card.secondary .home-action-icon {
  background: #FFFFFF !important;
  color: #F7941D !important;
}

.home-action-card.secondary .home-action-label {
  color: #2D2D2D;
}

.home-action-icon {
  width: 48px;
  height: 48px;
  background: #FFF5E6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #F7941D;
  margin-bottom: 12px;
}

.home-action-label {
  font-size: 14px;
  font-weight: 600;
  color: #3D3D3D;
  text-align: center;
}

/* Nutrition Tab Styles */
.nutrition-container {
  padding: 12px 0;
  text-align: center;
}

.nutrition-calories-display {
  text-align: center;
  margin-bottom: 12px;
}

.nutrition-calories-number {
  display: block;
  font-size: 36px;
  font-weight: 700;
  color: #F7941D;
  line-height: 1.2;
}

/* ===== Nutrition estimate strip (demoted, collapsible) ===== */
.nutrition-estimate {
  margin: 8px 0 4px 0;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.nutrition-est-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px !important;
  background: #FFFFFF !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.recipe-tab-content .nutrition-est-header:hover,
.recipe-tab-content .nutrition-est-header:focus,
.recipe-tab-content .nutrition-est-header:active {
  background: #FFFFFF !important; outline: none !important; box-shadow: none !important;
}

.nutrition-est-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #2D2D2D;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nutrition-est-icon { flex-shrink: 0; }

.nutrition-est-summary {
  flex: 1;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #A09A90;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* When the card is open the body shows the full figure — the header summary
   would just duplicate it (truncated), so hide it. */
.nutrition-estimate.open .nutrition-est-summary { display: none; }

.nutrition-est-chev {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nutrition-estimate.open .nutrition-est-chev { transform: rotate(180deg); }

.nutrition-est-body {
  padding: 4px 16px 16px 16px;
}

.nutrition-est-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0 12px 0;
}
.nutrition-est-cals {
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  color: #F7941D;
  font-family: 'Quicksand', sans-serif;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nutrition-est-caps-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #948C80;
  white-space: nowrap;
}

.nutrition-mode-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
  border-radius: 25px;
  overflow: hidden;
  border: none;
  background: #E8E8E8;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 3px;
}

.nutrition-mode-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  border: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #555 !important;
  cursor: pointer;
  border-radius: 22px;
  box-shadow: none !important;
  outline: none !important;
}

.nutrition-mode-btn.active {
  background: #F7941D !important;
  background-color: #F7941D !important;
  color: #fff !important;
}

.nutrition-calories-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  margin-top: 4px;
}

.nutrition-macros {
  display: flex;
  justify-content: space-around;
  margin: 10px 0 12px 0;
  gap: 6px;
}

.macro-block {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  background: #F8F8F8;
  border-radius: 10px;
}

.macro-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.macro-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #3D3D3D;
}

#nutrition-breakdown-container {
  margin-top: 12px;
  border-radius: 0 !important;
  overflow: hidden;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.breakdown-toggle,
.breakdown-toggle:hover,
.breakdown-toggle:focus,
.breakdown-toggle:focus-visible,
.breakdown-toggle:focus-within,
.breakdown-toggle:active {
  width: 100%;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
  padding: 10px 0;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #F7941D;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.breakdown-toggle-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  display: inline-block;
}

#nutrition-breakdown-container.expanded .breakdown-toggle-arrow {
  transform: rotate(180deg);
}

.breakdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

#nutrition-breakdown-container.expanded .breakdown-content {
  max-height: 2000px;
}

.breakdown-item {
  padding: 8px 4px;
  border-bottom: 1px solid #ECECEC;
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-item-name {
  font-family: 'Quicksand', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #2D2D2D;
  margin-bottom: 2px;
}

.breakdown-item-values {
  font-family: 'Quicksand', sans-serif;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.breakdown-grams {
  font-weight: 500;
  color: #888;
  font-size: 12px;
}

.breakdown-source {
  font-size: 10px;
  color: #aaa;
  font-weight: 500;
  margin-left: 4px;
}

.breakdown-not-found {
  color: #cc6600;
  font-style: italic;
}

.breakdown-item-low-confidence {
  border-left: 3px solid #F7941D;
  padding-left: 8px;
}

.breakdown-low-conf {
  font-size: 10px;
  color: #F7941D;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
}

.breakdown-merged {
  font-size: 10px;
  color: #4CAF50;
  font-weight: 600;
  margin-left: 6px;
  text-transform: uppercase;
}

.breakdown-total {
  border-top: 2px solid #F7941D;
  border-bottom: none;
  margin-top: 4px;
  padding-top: 10px;
}

.breakdown-total .breakdown-item-name {
  font-weight: 700;
  color: #F7941D;
  font-size: 13px;
}

.breakdown-total .breakdown-item-values {
  font-weight: 700;
  color: #2D2D2D;
  font-size: 13px;
}

.nutrition-calculate-btn {
  background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important;
  border: 1.5px solid #F7941D !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  margin-bottom: 8px;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none !important;
  box-shadow: none !important;
}

.nutrition-calculate-btn:focus,
.nutrition-calculate-btn:focus-visible,
.nutrition-calculate-btn:focus-within,
.nutrition-calculate-btn:active,
.nutrition-calculate-btn:hover {
  background: linear-gradient(135deg, #FAF8F5 0%, #F0EBE5 100%) !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.nutrition-note {
  font-size: 13px;
  color: #888;
  margin: 10px 0;
}

.nutrition-assumed {
  font-size: 13px;
  color: #666;
  background: #FFF8E7;
  border-left: 3px solid #F7941D;
  padding: 10px 15px;
  margin: 15px 0;
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

.nutrition-assumed strong {
  color: #3D3D3D;
  display: block;
  margin-bottom: 5px;
}

.nutrition-disclaimer {
  font-size: 9px;
  color: #AAAAAA;
  opacity: 0.8;
  font-style: italic;
  margin-top: 10px;
  margin-bottom: 0;
}

/* Timer Button in Meta Row */
.meta-timer-btn {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
  color: #666;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  transition: color 0.2s ease;
  -webkit-box-shadow: none !important;
}
@media (hover: hover) and (pointer: fine) {
.meta-timer-btn:hover {
  color: inherit;
  background: none !important;
  box-shadow: none !important;
}
}


.timer-dropdown-arrow {
  margin-left: 2px;
  vertical-align: middle;
  opacity: 0.8;
}

.meta-timer-btn:focus {
  outline: none !important;
  box-shadow: none !important;
  background: none !important;
}

.meta-timer-btn:active {
  outline: none !important;
  box-shadow: none !important;
  background: none !important;
}

.meta-timer-btn::before,
.meta-timer-btn::after {
  display: none !important;
}

/* Timer Modal (Bottom Sheet) */
.timer-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
}

.timer-modal.active {
  display: block;
}

.timer-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.timer-modal-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  padding-bottom: 40px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.timer-modal.active .timer-modal-content {
  transform: translateY(0);
}

/* iOS-style Wheel Picker */
.timer-wheel-content {
  background: #F8F8F8;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  overflow: hidden;
}

.timer-wheel-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #2D2D2D;
  padding: 20px 20px 10px 20px;
}

.timer-wheel-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.timer-wheel-cancel,
.timer-wheel-start {
  border: none;
  border-radius: 25px;
  cursor: pointer;
  padding: 14px 40px;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 600;
  min-width: 120px;
}

.timer-wheel-start {
  background: #F7941D;
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
.timer-wheel-start:hover {
  background: #e8850f;
}
}


.timer-wheel-cancel {
  background: #E0E0E0 !important;
  color: #2D2D2D !important;
}
@media (hover: hover) and (pointer: fine) {
.timer-wheel-cancel:hover {
  background: #D0D0D0 !important;
}
}


.timer-wheel-cancel:active,
.timer-wheel-cancel:focus {
  background: #E0E0E0 !important;
  color: #2D2D2D !important;
}

.timer-wheel-picker {
  display: flex;
  position: relative;
  height: 300px;
  padding: 0 10px;
}

.timer-wheel-highlight {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 50px;
  transform: translateY(-50%);
  background: #E8E8E8;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.timer-wheel {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}

.timer-wheel-scroll {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 125px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.timer-wheel-scroll::-webkit-scrollbar {
  display: none;
}

.timer-wheel-item {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 22px;
  font-weight: 400;
  color: #999;
  transition: color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.timer-wheel-item.selected {
  color: #2D2D2D;
  font-weight: 600;
}

.timer-wheel-label {
  font-size: 15px;
  font-weight: 500;
  color: #2D2D2D;
  margin-left: -5px;
  margin-right: 10px;
  pointer-events: none;
  z-index: 3;
  white-space: nowrap;
}

.timer-start-btn {
  background: #F7941D;
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
.timer-start-btn:hover {
  background: #E5850A;
}
}


.timer-pause-btn {
  background: #666;
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
.timer-pause-btn:hover {
  background: #555;
}
}


.timer-resume-btn {
  background: #4CAF50;
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
.timer-resume-btn:hover {
  background: #43A047;
}
}


.timer-reset-btn {
  background: #F8F8F8;
  border: 1px solid #E0E0E0;
  color: #666;
}
@media (hover: hover) and (pointer: fine) {
.timer-reset-btn:hover {
  background: #EAEAEA;
}
}


/* Floating Timer Pill */
.floating-timer-pill {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #2D2D2D;
  color: #fff;
  padding: 10px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1500;
  animation: pillSlideUp 0.3s ease;
}

@keyframes pillSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

#floating-timer-time {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: center;
}

.floating-timer-controls {
  display: flex;
  gap: 8px;
}

.floating-timer-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.floating-timer-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: #fff;
}
@media (hover: hover) and (pointer: fine) {
.floating-timer-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}
}


.floating-timer-btn:active {
  background: rgba(255, 255, 255, 0.25) !important;
}

.floating-timer-pill.finishing .floating-timer-btn {
  background: rgba(0, 0, 0, 0.2) !important;
}
@media (hover: hover) and (pointer: fine) {
.floating-timer-pill.finishing .floating-timer-btn:hover {
  background: rgba(0, 0, 0, 0.3) !important;
}
}


.floating-timer-pill.finishing {
  background: #F7941D;
  animation: pillPulse 0.5s ease infinite alternate;
}

@keyframes pillPulse {
  from {
    box-shadow: 0 4px 15px rgba(247, 148, 29, 0.3);
  }
  to {
    box-shadow: 0 4px 25px rgba(247, 148, 29, 0.6);
  }
}

#timer-complete-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#timer-complete-popup.show {
  opacity: 1;
  visibility: visible;
}

.timer-popup-content {
  background: #fff;
  border-radius: 20px;
  padding: 40px 50px;
  text-align: center;
  animation: popupBounce 0.4s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes popupBounce {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.timer-popup-icon {
  width: 80px;
  height: 80px;
  background: #F7941D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 40px;
  color: #fff;
  animation: iconPulse 0.6s ease infinite alternate;
}

@keyframes iconPulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(247, 148, 29, 0.4);
  }
  to {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(247, 148, 29, 0);
  }
}

.timer-popup-title {
  font-size: 24px;
  font-weight: 600;
  color: #2D2D2D;
  margin-bottom: 8px;
}

.timer-popup-subtitle {
  font-size: 16px;
  color: #666;
}

.timer-popup-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: center;
}

.timer-popup-btn {
  padding: 12px 32px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #F7941D;
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
.timer-popup-btn:hover {
  background: #e8850f;
  transform: scale(1.02);
}
}


.timer-popup-btn:active {
  transform: scale(0.98);
}

.timer-popup-btn.secondary {
  background: #E0E0E0 !important;
  color: #2D2D2D !important;
}
@media (hover: hover) and (pointer: fine) {
.timer-popup-btn.secondary:hover {
  background: #D0D0D0 !important;
}
}


.timer-popup-btn.secondary:active,
.timer-popup-btn.secondary:focus {
  background: #E0E0E0 !important;
  color: #2D2D2D !important;
}

/* ===== ADD MEAL PAGE STYLES ===== */
#add-meal-section {
  overflow-y: auto !important;
}

.add-meal-page {
  padding: 0 24px 0 24px;
  background: #F8F8F8;
  min-height: 0;
}

.add-meal-page.section-content {
  padding-bottom: 10px;
}

.add-meal-page form > *:last-child {
  margin-bottom: 0;
}

.header-add-meal-btn {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  position: absolute;
  right: 75px;
  top: 50%;
  transform: translateY(-50%);
  -webkit-tap-highlight-color: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  z-index: 1;
}

.header-add-meal-btn:hover,
.header-add-meal-btn:active,
.header-add-meal-btn:focus {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  transform: translateY(-50%) !important;
  -webkit-tap-highlight-color: transparent !important;
}

.add-meal-page .section-header {
  display: none;
}

.header-save-pill {
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  font-family: 'Quicksand', sans-serif !important;
  background: none !important;
  background-color: transparent !important;
  color: #F7941D;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  box-shadow: none !important;
  transition: none !important;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.header-save-pill:hover,
.header-save-pill:active,
.header-save-pill:focus {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.add-meal-form-wrapper {
  width: calc(100% + 48px);
  margin: 0 -24px;
  background: transparent;
  padding: 0;
}

.add-meal-form-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Title field — white bg, bottom divider only */
.ios-title-row {
  background: #FFFFFF;
  border: none;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 0 16px;
  margin-bottom: 18px;
}

.ios-title-row input[type="text"],
input.ios-title-input {
  display: block;
  width: 100% !important;
  height: 44px;
  padding: 0 !important;
  margin: 0;
  font-size: 17px !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  color: #2D2D2D;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  box-sizing: border-box;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: none !important;
  flex: none !important;
}

.ios-title-row input[type="text"]::placeholder,
input.ios-title-input::placeholder {
  color: #C7C7CC;
  font-weight: 400;
}

.ios-title-row input[type="text"]:focus,
input.ios-title-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.ios-group {
  background: #FFFFFF;
  border: none;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 18px;
}

.ios-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  position: relative;
}

.ios-row-input {
  width: 100%;
  height: 44px;
  padding: 0;
  margin: 0;
  font-size: 17px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  color: #2D2D2D;
  background: transparent;
  border: none;
  border-radius: 0;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.ios-row-input::placeholder {
  color: #C7C7CC;
  font-weight: 400;
}

.ios-row-select {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ios-row-label {
  font-size: 17px;
  font-weight: 400;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  flex-shrink: 0;
}

.ios-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.ios-row-value {
  font-size: 17px;
  font-weight: 400;
  font-family: 'Quicksand', sans-serif;
  color: #C7C7CC;
}

.ios-chevron {
  flex-shrink: 0;
}

.ios-separator {
  height: 1px;
  background: #F4F1ED;
  margin-left: 16px;
}

.ios-hidden-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.ios-ingredient-list {
  display: flex;
  flex-direction: column;
}

.ios-ingredient-list .ingredient-item {
  display: flex;
  flex-direction: column;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 17px;
  font-weight: 400;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  animation: iosSlideIn 0.2s ease forwards;
}

.ios-ingredient-list .ingredient-item + .ingredient-item {
  border-top: 0.5px solid #C6C6C8;
  margin-left: 0;
}

.ios-ingredient-list .ingredient-item .ingredient-edit {
  flex: 1;
  padding: 0 !important;
  margin: 0;
  font-size: 17px !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  color: #2D2D2D;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: none !important;
  line-height: 1.4;
  min-height: 24px;
}

.ios-ingredient-list .ingredient-item .chip-remove {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
  color: #C7C7CC !important;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}

.ios-ingredient-list .ingredient-item.removing {
  animation: iosSlideOut 0.2s ease forwards;
}

/* Ingredient group — rounded card matching the app's card language */
.ios-ingredient-group {
  background: #FFFFFF;
  border: none;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 18px;
}

/* Add ingredient row — flat, no rounded container */
.ios-add-ingredient-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-top: 1px solid #F4F1ED;
}

.ios-ingredient-list:empty + .ios-add-ingredient-row {
  border-top: none;
}

/* Shared flat input for ingredient row */
.ios-add-ingredient-row input[type="text"],
input.ios-flat-input {
  flex: 1 !important;
  height: 44px;
  padding: 0 !important;
  margin: 0;
  font-size: 17px !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  color: #2D2D2D;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: none !important;
}

.ios-add-ingredient-row input[type="text"]::placeholder,
input.ios-flat-input::placeholder {
  color: #C7C7CC;
}

.ios-add-ingredient-row input[type="text"]:focus,
input.ios-flat-input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Instruction group — mirrors ingredient group */
.ios-instruction-group {
  background: #FFFFFF;
  border: none;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 18px;
}

.ios-instruction-list .instruction-item {
  display: flex;
  align-items: flex-start;
  min-height: 44px;
  padding: 0 16px;
  font-size: 17px;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  border-bottom: 0.5px solid #C6C6C8;
  gap: 10px;
}

.ios-instruction-list .instruction-item:last-child {
  border-bottom: none;
}

.instruction-item .step-number {
  /* The global .step-number rule renders this as a 28px orange circle with
     !important; the old padding-top/line-height here (meant for a plain "1.")
     survived and pushed the digit low-and-left inside that circle. Zero them
     so flex centering actually centres the number. */
  flex-shrink: 0;
  padding-top: 0 !important;
  line-height: 1 !important;
  /* Row text starts 10px down (textarea padding); nudge the circle down to
     match so it sits beside the first line instead of riding the divider. */
  margin-top: 7px !important;
}

.instruction-item .step-text {
  flex: 1;
  padding: 10px 0;
  line-height: 1.4;
  word-break: break-word;
  display: none;
}

.instruction-item .step-remove {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  padding-top: 8px !important;
  margin: 0 !important;
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
  color: #C7C7CC !important;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  flex-shrink: 0;
}

.instruction-item .step-edit {
  flex: 1;
  padding: 10px 0 !important;
  margin: 0;
  font-size: 17px !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  resize: none !important;
  overflow: hidden !important;
  color: #2D2D2D;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: none !important;
  line-height: 1.4;
  min-height: 24px;
  word-break: break-word;
}

.ios-instruction-list .instruction-item.removing {
  animation: iosSlideOut 0.2s ease forwards;
}

.ios-add-instruction-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-top: 1px solid #F4F1ED;
}

.ios-instruction-list:empty + .ios-add-instruction-row {
  border-top: none;
}

.ios-add-instruction-row input[type="text"] {
  flex: 1 !important;
  height: 44px;
  padding: 0 !important;
  margin: 0;
  font-size: 17px !important;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  color: #2D2D2D;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: none !important;
}

.ios-add-instruction-row input[type="text"]::placeholder {
  color: #C7C7CC;
}

.ios-add-instruction-row input[type="text"]:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.ios-add-btn,
.ios-add-btn:focus,
.ios-add-btn:active,
.ios-add-btn:hover {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0 !important;
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  color: inherit !important;
}

.ios-textarea-row {
  padding: 0;
  display: block;
}

.ios-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 17px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 400;
  color: #2D2D2D;
  background: transparent;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  outline: none;
  resize: none;
  min-height: 44px;
  overflow: hidden;
  display: block;
}

.ios-textarea::placeholder {
  color: #C7C7CC;
  font-weight: 400;
}

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

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


/* Excluded Items Review Sheet */
#excluded-items-sheet .excluded-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F0;
  transition: opacity 0.2s ease, transform 0.2s ease, height 0.2s ease, padding 0.2s ease;
}

#excluded-items-sheet .excluded-item-row.removing {
  opacity: 0;
  transform: translateX(20px);
  height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

#excluded-items-sheet .excluded-item-name {
  color: #2D2D2D;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* "Always ✕" badge on personal staples — tap to stop always-skipping */
#excluded-items-sheet .excluded-personal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(247, 148, 29, 0.12);
  color: #E07A10;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

#excluded-items-sheet .excluded-item-add-btn {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  color: #F7941D !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer;
  padding: 4px 0 !important;
  font-family: 'Quicksand', sans-serif;
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: none !important;
}
@media (hover: hover) and (pointer: fine) {
#excluded-items-sheet .excluded-item-add-btn:hover {
  color: #E07A10 !important;
}
}


#excluded-items-sheet #add-all-excluded-btn {
  background: #F7941D !important;
  border: none !important;
  color: white !important;
  padding: 12px 24px !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
}
@media (hover: hover) and (pointer: fine) {
#excluded-items-sheet #add-all-excluded-btn:hover {
  background: #E07A10 !important;
}
}


/* Create Grocery Confirm Modal - Cancel button override */
#cancel-grocery-modal-btn {
  background: transparent !important;
  border: none !important;
  color: #666666 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Generate Plan Confirm Modal - Cancel button override */
.plan-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
}

.plan-modal-card {
  background: white;
  border-radius: 20px;
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: left;
}

.plan-modal-title {
  color: #2D2D2D;
  margin: 0 0 4px 0;
  font-size: 18px;
  text-align: center;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
}

.plan-modal-section-label {
  color: #BBB;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 18px 0 12px 0;
  font-family: 'Quicksand', sans-serif;
}

.plan-pref-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid #F0F0F0;
  -webkit-tap-highlight-color: transparent;
}

.plan-pref-row:last-of-type {
  border-bottom: none;
}

.plan-pref-check {
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.plan-pref-check input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.plan-pref-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #D0D0D0;
  background: white;
  transition: all 0.15s ease;
}

.plan-pref-check input:checked ~ .plan-pref-checkmark {
  background: #F7941D;
  border-color: #F7941D;
}

.plan-pref-check input:checked ~ .plan-pref-checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

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

.plan-pref-label {
  font-size: 14.5px;
  font-weight: 500;
  color: #2D2D2D;
  font-family: 'Quicksand', sans-serif;
  line-height: 1.3;
}

.plan-pref-desc {
  font-size: 12px;
  font-weight: 500;
  color: #AAA;
  font-family: 'Quicksand', sans-serif;
  line-height: 1.3;
}

.plan-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #F0F0F0;
}

.plan-modal-cancel,
.plan-modal-cancel:focus,
.plan-modal-cancel:active,
.plan-modal-cancel:hover {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  color: #888888 !important;
  box-shadow: none !important;
  border-radius: 12px !important;
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  font-family: 'Quicksand', sans-serif !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  -webkit-tap-highlight-color: transparent;
}

.plan-modal-confirm,
.plan-modal-confirm:focus,
.plan-modal-confirm:active,
.plan-modal-confirm:hover {
  padding: 4px 22px !important;
  height: 28px !important;
  box-sizing: border-box !important;
  background: #F7941D !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  font-family: 'Quicksand', sans-serif !important;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  display: inline-flex !important;
  align-items: center !important;
  -webkit-tap-highlight-color: transparent;
}

.scan-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scan-overlay.active {
  display: flex;
  opacity: 1;
}

.scan-overlay-card {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 28px 24px 20px;
  max-width: 380px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: scanCardIn 0.4s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes scanCardIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.scan-close-btn {
  position: absolute !important;
  top: 12px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #F0F0F0 !important;
  border: none !important;
  color: #888 !important;
  font-size: 16px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  z-index: 2;
}

.scan-hero-wrapper {
  text-align: center;
  margin-bottom: 8px;
}

.scan-hero-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  animation: scanHeroIn 0.6s cubic-bezier(0.2, 0, 0, 1) 0.1s both;
}

@keyframes scanHeroIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scan-title {
  font-size: 24px;
  font-weight: 700;
  color: #1F1F1F;
  margin: 0 0 4px;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
}

.scan-subtitle {
  font-size: 14px;
  color: #999999;
  margin: 0 0 20px;
  text-align: center;
  font-weight: 500;
  font-family: 'Quicksand', sans-serif;
}

.scan-progress-track {
  background: #EEEEEE;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin: 0 10px 22px;
}

.scan-progress-fill {
  height: 100%;
  background: #F7941D;
  border-radius: 6px;
  width: 0%;
  transition: width 0.4s ease;
}

.scan-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin-bottom: 22px;
}

.scan-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 85px;
}

.scan-step span {
  font-size: 11px;
  color: #BBBBBB;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  font-family: 'Quicksand', sans-serif;
}

.scan-step.active span {
  color: #1F1F1F;
  font-weight: 600;
}

.scan-step.done span {
  color: #F7941D;
  font-weight: 600;
}

.scan-step-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #CCCCCC;
  transition: background 0.3s ease, color 0.3s ease;
}

.scan-step.active .scan-step-icon {
  background: #FFF3E0;
  color: #F7941D;
}

.scan-step.active .scan-step-icon svg {
  stroke: #F7941D;
}

.scan-step.done .scan-step-icon {
  background: #FFF3E0;
  color: #F7941D;
}

.scan-step.done .scan-step-icon svg {
  stroke: #F7941D;
}

.scan-step-arrow {
  color: #CCCCCC;
  margin-top: 12px;
  display: flex;
  align-items: center;
}

.scan-tip-box {
  background: #FFF8F0;
  border: 1px solid #FFE0B2;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}

.scan-tip-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.scan-tip-box p {
  margin: 0;
  font-size: 13px;
  color: #2D2D2D;
  line-height: 1.5;
  font-family: 'Quicksand', sans-serif;
}

.scan-brand {
  text-align: center;
  padding-top: 4px;
}

.scan-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #F7941D;
  font-family: 'Quicksand', sans-serif;
}

.scan-brand-bar {
  width: 36px;
  height: 3px;
  background: #F7941D;
  border-radius: 2px;
  margin: 6px auto 0;
}

/* ===== PHOTO SOURCE MODAL ===== */
.photo-source-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 10003;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photo-source-overlay.active {
  display: flex;
  opacity: 1;
}

.photo-source-card {
  width: 300px;
  max-width: 85vw;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: photoSourceIn 0.25s ease;
}

@keyframes photoSourceIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.photo-source-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
  background: #FFFFFF;
  border-radius: 14px 14px 0 0;
  padding: 18px 16px 14px;
  margin: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.photo-source-list {
  background: #FFFFFF;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border-top: 0.5px solid #E5E5EA;
}

.photo-source-row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  gap: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.photo-source-row + .photo-source-row {
  border-top: 0.5px solid #E5E5EA;
}

.photo-source-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #FFF3E0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.photo-source-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  color: #2D2D2D;
}

.photo-source-chevron {
  flex-shrink: 0;
}

.photo-source-cancel,
.photo-source-cancel:focus,
.photo-source-cancel:active,
.photo-source-cancel:hover {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px 0 !important;
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 14px !important;
  font-size: 16px !important;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  color: #E53935 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  transform: none !important;
}


/* ===== Prepiva button system (use for all NEW buttons) =====
   primary  = solid orange CTA
   secondary = cream with orange border
   tertiary  = quiet text button
   All include iOS sticky hover/focus resets (tapped buttons must return to
   their resting colour). Legacy buttons migrate to these opportunistically. */
.btn-primary-p {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  background: #F7941D !important; color: #FFFFFF !important;
  border: none !important; border-radius: 24px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 16px !important; font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.35) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important; appearance: none !important;
}
.btn-primary-p:active { background: #E07A10 !important; }
.btn-primary-p:hover, .btn-primary-p:focus {
  background: #F7941D !important; color: #FFFFFF !important; outline: none !important;
}
.btn-primary-p:disabled { opacity: 0.5 !important; }

.btn-secondary-p {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important;
  border: 1.5px solid #F7941D !important; border-radius: 24px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 15px !important; font-weight: 600 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important; appearance: none !important;
}
.btn-secondary-p:active { background: linear-gradient(to bottom, #EBE6E0 0%, #E5E0DA 100%) !important; }
.btn-secondary-p:hover, .btn-secondary-p:focus {
  background: linear-gradient(to bottom, #FAF8F5 0%, #F0EBE5 100%) !important;
  color: #2D2D2D !important; outline: none !important;
}

.btn-tertiary-p {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  background: transparent !important; color: #8A8A8A !important;
  border: none !important; box-shadow: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 14px !important; font-weight: 600 !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important; appearance: none !important;
}
.btn-tertiary-p:active { opacity: 0.6; }
.btn-tertiary-p:hover, .btn-tertiary-p:focus {
  background: transparent !important; color: #8A8A8A !important;
  outline: none !important; box-shadow: none !important; opacity: 1 !important;
}

/* Meal emoji tile — same visual language as the grocery aisle badges */
.meal-emoji-tile {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(247, 148, 29, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  line-height: 1;
  flex-shrink: 0;
}

/* Photo-less meals: monogram on the tonal tile (replaces the emoji) */
.meal-emoji-tile.meal-monogram {
  font-family: 'Quicksand', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #E07A10;
  letter-spacing: 0.01em;
}

/* Gentle pulse while this dish's photo is being generated (animation is
   applied inline from JS — the reliable pattern on-device) */
@keyframes tilePulse {
  0%, 100% { background: rgba(247, 148, 29, 0.1); }
  50% { background: rgba(247, 148, 29, 0.22); }
}

/* ============================================================
   RECIPE PAGE — Option A visual refresh (hero + chips + cards)
   ============================================================ */

/* Header + tabs share the same soft ground so white cards read against it */
#recipe-fixed-header { background: #F8F8F8 !important; }
#recipe-tabs,
.recipe-tab-btn,
.recipe-tab-btn:hover,
.recipe-tab-btn:active,
.recipe-tab-btn:focus { background: #F8F8F8 !important; }
#recipe-tabs { border-bottom: 1px solid #E7E1D8 !important; }
.recipe-tab-btn.active {
  background: #F8F8F8 !important;
  color: #2D2D2D !important;
  border-bottom: 4px solid #F7941D !important;
}

/* --- Topbar: floating back / share circles --- */
.recipe-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px 16px;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}
.recipe-topbar .recipe-back-btn,
.recipe-topbar button.recipe-share-btn {
  position: static !important;
  left: auto !important; right: auto !important; top: auto !important;
  width: 38px !important; height: 38px !important; min-width: 38px !important;
  border-radius: 50% !important;
  background: #FFFFFF !important;
  box-shadow: 0 2px 6px rgba(60,50,35,0.10) !important;
}
.recipe-topbar .recipe-back-btn svg,
.recipe-topbar button.recipe-share-btn svg { stroke: #3D3D3D !important; }
.recipe-topbar .recipe-back-btn svg polyline { stroke: #3D3D3D !important; }

/* --- Hero band --- */
/* Non-photo heroes get a warmer, lighter fade so the gradient stays vibrant */

/* --- Meta chips --- */
#recipe-meta {
  border-bottom: none !important;
  margin-top: 0 !important;
  padding: 14px 14px 4px 14px !important;
  gap: 8px !important;
  justify-content: stretch !important;
  max-width: 900px;
  margin-left: auto; margin-right: auto;
  box-sizing: border-box;
}
#recipe-meta .meta-dropdown {
  flex: 1 1 0;
  min-width: 0;
  background: #FFFFFF;
  border-radius: 15px !important;
  padding: 10px 11px !important;
  box-shadow: 0 2px 6px rgba(60,50,35,0.06);
  justify-content: flex-start;
  gap: 8px !important;
}
#recipe-meta #recipe-cooking-time,
#recipe-meta #recipe-servings-display {
  font-weight: 700; color: #2D2D2D; font-size: 0.9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 350px) {
  #recipe-meta #recipe-cooking-time,
  #recipe-meta #recipe-servings-display { font-size: 0.8rem; }
  .meta-cook-chip { padding: 8px 11px; font-size: 12px; }
}
#recipe-meta .meta-dropdown .dropdown-arrow { margin-left: auto; }

/* --- Content sits on the soft ground so cards read as cards --- */
.recipe-tab-content {
  background: #F8F8F8 !important;
  padding: 14px 0 24px 0 !important;
}

/* Ingredient list as a white card + orange quantity pills */
#recipe-ingredients-list {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 2px 16px !important;
  box-shadow: 0 3px 10px rgba(60,50,35,0.06);
}

/* Cards are inset 14px on each side so they read as cards and line up with
   the hero above (which also sits at a 14px margin). */
#recipe-ingredients-list,
#recipe-instructions-list,
#recipe-notes-list {
  width: auto !important;
  max-width: none !important;
  margin-left: 14px !important;
  margin-right: 14px !important;
}
.recipe-ingredient-item { padding: 13px 0 !important; border-bottom: 1px solid #F0ECE5 !important; }
.ingredient-qty {
  color: #8A8175 !important;
  background: transparent;
  padding: 0;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}

/* Instruction list as a white card + numbered circles joined by a line */
#recipe-instructions-list,
#recipe-notes-list {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 2px 16px !important;
  box-shadow: 0 3px 10px rgba(60,50,35,0.06);
}
.recipe-instruction-item { position: relative; padding: 15px 0 !important; border-bottom: 1px solid #F0ECE5 !important; }
.step-number {
  width: 28px !important; height: 28px !important; min-width: 28px !important;
  border-radius: 50% !important;
  background: #F7941D !important;
  color: #FFFFFF !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  font-size: 13px !important; font-weight: 700 !important;
  box-shadow: 0 3px 7px -1px rgba(247,148,29,0.5);
  flex-shrink: 0 !important;
  margin-top: 1px;
}
/* The "+ Add step" marker is an action, not a numbered step — plain orange +. */
.recipe-add-row.recipe-instruction-item .step-number {
  background: transparent !important;
  color: #F7941D !important;
  box-shadow: none !important;
  font-size: 24px !important;
  font-weight: 500 !important;
}

/* Nutrition estimate card spacing on the new soft ground (aligned to 14px) */
.nutrition-estimate { margin: 12px 14px 4px 14px; }

/* ============================================================
   RECIPE PAGE v2 — collapsible sections (replaces tabs)
   ============================================================ */

/* Clean headline: slim accent bar + dark title (no banner, no emoji) */
.recipe-headline {
  padding: 6px 20px 2px 20px;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}
.recipe-headline::before {
  content: "";
  display: block;
  width: 34px; height: 4px;
  border-radius: 3px;
  background: #F7941D;
  margin-bottom: 12px;
}
#recipe-fixed-header .recipe-headline #recipe-title-row {
  justify-content: flex-start !important;
  padding: 0 !important;
  flex-wrap: wrap;
}
#recipe-fixed-header .recipe-headline #recipe-title {
  color: #33302B !important;
  font-size: 1.4rem !important;
  text-align: left !important;
  line-height: 1.15 !important;
  text-shadow: none !important;
  max-width: 100% !important;
}

/* The scroll area becomes the single scroller for all three sections */
body.recipe-detail-open #recipe-scroll-area {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: var(--recipe-header-height, 180px);
  padding-bottom: calc(var(--bottom-nav-height, 56px) + env(safe-area-inset-bottom, 0px) + 28px);
  background: #F8F8F8 !important;
}

/* Dish photo banner (user photo or AI-generated) above the sections */
#recipe-image-wrap {
  position: relative;
  /* Generated dish photos are exact squares — a square frame shows the WHOLE
     plate with zero cropping (the meal-card tiles are square for the same
     reason). Capped at 400px so tablets get a centred square, not a monster. */
  width: min(calc(100% - 28px), 400px);
  aspect-ratio: 1 / 1;
  margin: 14px auto 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #E9E4DC;
}
#recipe-image-wrap #recipe-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
}
#recipe-image-wrap #recipe-image.loaded { opacity: 1; }

/* "Creating your dish photo…" state: small JS-driven spinner + quiet caption
   on the soft beige block (CSS keyframes proved unreliable on-device). */
#recipe-image-shimmer {
  position: absolute; inset: 0;
  background: #E9E4DC;
  display: none;
  align-items: center;
  justify-content: center;
}
.mealimg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mealimg-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid #DCD5C9;
  border-top-color: #F7941D;
  border-radius: 50%;
}
.mealimg-loading-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #948C80;
  font-family: 'Quicksand', sans-serif;
  letter-spacing: 0.01em;
}

/* Regenerate: small frosted circle over the photo (AI images only) */
#recipe-image-regen {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 32px; height: 32px;
  border-radius: 50% !important;
  border: none !important;
  background: rgba(255,255,255,0.85) !important;
  color: #6B655C !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  box-shadow: 0 2px 8px rgba(40,30,10,0.25) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent !important;
}
#recipe-image-regen:hover,
#recipe-image-regen:focus,
#recipe-image-regen:active {
  background: rgba(255,255,255,0.85) !important;
  color: #6B655C !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(40,30,10,0.25) !important;
}
#recipe-image-regen.spinning svg { animation: smoothSpin 0.9s linear infinite; }



/* Lists sit directly on the section card now — strip the old card treatment */
#recipe-ingredients-list,
#recipe-instructions-list,
#recipe-notes-list {
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Meal-card tile showing the dish photo instead of the emoji */
.meal-emoji-tile.has-photo {
  overflow: hidden;
  background: #E9E4DC;
  padding: 0;
}
.meal-emoji-tile.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   RECIPE PAGE v3 — segmented tabs (Ingredients / Method / Notes)
   ============================================================ */

/* Sticky segmented control: scrolls with the photo, then pins just below the
   fixed header so switching is always one tap away. */
#recipe-seg {
  position: sticky;
  /* The scroll container's padding-top (header height) already insets the
     sticky rectangle, so 0 pins exactly below the fixed header. */
  top: 0;
  z-index: 20;
  /* Solid halo masks list rows peeking around the pinned bar's margins */
  box-shadow: 0 0 0 10px #F8F8F8;
  display: flex;
  gap: 0;
  margin: 12px 14px 0 14px;
  max-width: 872px;
  padding: 3px;
  background: #E7E5E2;
  border-radius: 14px;
  box-sizing: border-box;
}
@media (min-width: 900px) { #recipe-seg { margin-left: auto; margin-right: auto; } }
.recipe-seg-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 0 !important;
  border: none !important;
  border-radius: 11px !important;
  background: transparent !important;
  color: #948C80 !important;
  font-family: 'Quicksand', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
  box-shadow: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.recipe-seg-btn:hover, .recipe-seg-btn:focus, .recipe-seg-btn:active {
  background: transparent !important;
  color: #948C80 !important;
  box-shadow: none !important;
  outline: none !important;
}
.recipe-seg-btn.active,
.recipe-seg-btn.active:hover, .recipe-seg-btn.active:focus, .recipe-seg-btn.active:active {
  background: #FFFFFF !important;
  color: #33302B !important;
  box-shadow: 0 1px 5px rgba(60,50,35,0.14) !important;
}

/* Tab panels: one white card each, aligned with the hero/photo at 14px */
#recipe-tab-panels {
  padding: 12px 14px 8px 14px;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}
.recipe-panel {
  background: #FFFFFF;
  border-radius: 18px;
  padding: 4px 16px 8px 16px;
  box-shadow: 0 3px 10px rgba(60,50,35,0.06);
}
.recipe-panel .nutrition-estimate { margin: 10px 0 6px 0; }

/* Cook chip lives in the meta row — always visible on every tab */
.meta-cook-chip {
  padding: 9px 14px;
  border-radius: 15px;
  font-size: 13px;
  align-self: stretch;
  align-items: center;
}

/* Quick-add chips: emoji marker + selected / dimmed states */
.grocery-quick-btn .quick-btn-emoji {
  font-size: 15px;
  margin-right: 6px;
  line-height: 1;
}
.grocery-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.grocery-quick-btn.selected .quick-btn-emoji { filter: grayscale(0); }
.grocery-quick-btn.dimmed {
  opacity: 0.35;
}

/* ===== Voice review sheet (multi-item confirmation) ===== */
.voice-review-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10005;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}
.voice-review-overlay.active { opacity: 1; pointer-events: auto; }

.voice-review-sheet {
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.16);
  padding: 8px 20px calc(18px + env(safe-area-inset-bottom, 0px)) 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.voice-review-overlay.active .voice-review-sheet { transform: translateY(0); }

.voice-review-header { text-align: center; margin: 4px 0 14px; }
.voice-review-header h3 {
  margin: 0; font-size: 19px; font-weight: 700; color: #33302B;
  font-family: 'Quicksand', sans-serif;
}
.voice-review-header p {
  margin: 4px 0 0; font-size: 12.5px; color: #A39B8E; font-weight: 600;
  font-family: 'Quicksand', sans-serif;
}

.voice-review-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 0;
}
.voice-review-row { display: flex; align-items: center; gap: 10px; }
.voice-review-input {
  flex: 1; min-width: 0;
  border: 1px solid #E0E0E0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #33302B;
  background: #FFFFFF;
  box-sizing: border-box;
}
.voice-review-input:focus { outline: none; border-color: #F7941D; }
.voice-review-remove {
  width: 36px; height: 36px; flex: none;
  padding: 0 !important;
  border: none !important; border-radius: 50% !important;
  background: #F4F0EA !important;
  color: #A39B8E !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.voice-review-remove svg { display: block; }
.voice-review-remove:hover,
.voice-review-remove:focus { background: #F4F0EA !important; color: #A39B8E !important; }
.voice-review-remove:active { background: #E8E1D6 !important; }

.voice-review-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.voice-review-add {
  background: #F7941D !important;
  color: #FFFFFF !important;
  border: none;
  border-radius: 15px;
  padding: 14px 30px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(247, 148, 29, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.voice-review-add.disabled {
  background: #EDE8E0 !important; color: #B3ACA1 !important;
  box-shadow: none; pointer-events: none;
}
.voice-review-cancel {
  background: transparent !important; border: none !important;
  color: #8A8A8A !important;
  box-shadow: none !important;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px; font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.voice-review-cancel:hover,
.voice-review-cancel:focus,
.voice-review-cancel:active { background: transparent !important; color: #8A8A8A !important; }

/* Friendly empty states on recipe tabs */
.recipe-empty-hint {
  /* Full reset: the theme engine injects generic li borders/shadows that turned
     this quiet hint into a raised pill. */
  list-style: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 16px 2px 4px 2px !important;
  color: #C2BBAF !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: 'Quicksand', sans-serif !important;
}
