/* Remove raised effect from chalkboard icon in opening panel */
img[alt="Meal Planner"] {
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Remove background and margin from logo for overlap */

.logo-container {
    background: none !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    pointer-events: none;
}
.logo-container img {
    background: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    pointer-events: auto;
    max-width: 250px;
    max-height: 130px;
    width: auto;
    height: auto;
    display: block;
    position: relative;
    transform: none;
}

/* Make icons inside headers/panels larger for visibility */
.app-header img[alt="Meal Planner"],
.options-header img[alt="Meal Planner"],
.subsection-header img[alt="Meal Planner"],
.app-header img.trolly-icon,
.options-header img.trolly-icon,
.subsection-header img.trolly-icon {
    width: 2.2em !important;
    height: 2.2em !important;
    min-width: 2.2em !important;
    min-height: 2.2em !important;
    max-width: 2.4em !important;
    max-height: 2.4em !important;
    vertical-align: middle;
    margin-right: 0.45em;
}
/* Trolly Button (Shopping List) Styles */
 .trolly-btn {
     background: transparent !important;
    width: 260px;
    height: 260px;
     border: none;
     padding: 0;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: none;
     position: static;
 }

 .trolly-btn:active {
     transform: scale(0.97);
 }

 .trolly-icon {
     width: 100%;
     height: 100%;
     max-width: 100%;
     max-height: 100%;
     object-fit: contain;
     border-radius: 0.7em;
     background: transparent !important;
     box-shadow: none;
 }

.meal-planner-btn {
    background: transparent !important;
    width: 230px;
    height: 230px;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    position: static;
}

.meal-planner-icon {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent !important;
    box-shadow: none;
    display: block;
}

.kitchen-buttons-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.9rem;
    width: min(calc(100vw - 1.8rem), 26rem);
    max-width: 100%;
    margin: 0.34rem auto 0;
    position: relative;
    z-index: 10;
}

.kitchen-buttons-row > button {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    :root {
        --silver-background-main-position: center 46%;
    }

    .home-main {
        padding-top: 0.1rem;
    }

    .logo-container {
        margin-bottom: -2.4rem !important;
    }

    .logo-container img {
        max-height: 102px;
    }

    #kitchen-stage {
        max-height: min(calc(100vh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 3.6rem), 36.4rem);
        max-height: min(calc(100svh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 3.6rem), 36.4rem);
    }

    .room-stage-shell {
        margin-top: -1.85rem;
    }

    .room-stage-toolbar {
           margin-top: -2.15rem;
    }

    .trolly-btn {
        width: 215px;
        height: 215px;
        left: 18px;
        bottom: 18px;
        max-width: 90vw;
        max-height: 90vw;
        position: fixed;
    }
    .trolly-icon {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
    }

    .meal-planner-btn {
        width: 185px;
        height: 185px;
        position: fixed;
        right: 18px;
        bottom: 18px;
        max-width: 78vw;
        max-height: 78vw;
    }

    .kitchen-buttons-row {
        width: 100%;
        min-height: 16.25rem;
        margin-top: 0;
        position: static;
    }
}
/* Closing brace for last @media (max-width: 640px) block */


.meal-planner-btn:active {
    transform: scale(0.97);
}

.kitchen-buttons-row button {
    z-index: 10;
    pointer-events: auto;
}

/* Edit Zones Modal Styles */
#edit-zones-modal.modal-overlay {
    align-items: flex-end;
    justify-content: center;
    background: rgba(0,0,0,0.04) !important;
    pointer-events: none;
    padding: calc(0.45rem + var(--safe-top, 0px)) 0.45rem calc(0.55rem + var(--safe-bottom, 0px)) 0.45rem;
    box-sizing: border-box;
    overflow-y: auto;
}
#edit-zones-modal .modal-dialog {
    pointer-events: auto;
    background: #f8f9fa;
    border-radius: 1em 1em 0.55em 0.55em;
    border: 2px solid #d9dcde;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    padding: 0.52em 0.64em 0.58em 0.64em;
    max-width: 430px;
    width: min(95vw, 430px);
    min-width: 220px;
    min-height: 0;
    max-height: calc(100vh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 1.7rem);
    max-height: calc(100svh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 1.7rem);
    margin: 0 auto 0 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#edit-zones-modal .info-box {
    margin-bottom: 0.2em !important;
    padding: 0.34em 0.52em 0.4em 0.52em !important;
    border-radius: 0.85em !important;
    border: 2px solid #c9d2d8 !important;
    background: #f7f9fa !important;
    box-shadow: 0 2px 7px rgba(70, 84, 96, 0.07) !important;
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
}
.edit-zones-modal-heading {
    text-align: center;
    font-size: 0.98rem;
    font-weight: 700;
    color: #2f3b44;
}
.edit-zones-modal-copy {
    margin-top: 0.12rem;
    text-align: center;
    font-size: 0.81rem;
    line-height: 1.25;
    color: #4f5b64;
}
#edit-zones-actions-group-modal {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.32em;
    margin-top: 0.28em;
    padding: 0.28em;
    background: rgba(238, 242, 244, 0.82) !important;
    border: 1px solid #d9e0e4 !important;
    border-radius: 1.05em;
    box-shadow: 0 4px 12px rgba(70, 84, 96, 0.08) !important;
    box-sizing: border-box;
}
#edit-zones-actions-group-modal .edit-zones-modal-btn {
    width: 100%;
    min-height: 2.1rem;
    height: 2.1rem;
    padding: 0.42rem 0.62rem;
    background: #ffffff !important;
    border: 1px solid #c9d2d8 !important;
    border-radius: 0.82em;
    box-shadow: 0 1px 3px rgba(63, 74, 84, 0.08) !important;
    color: #2f3b44;
    font-size: 0.87rem;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#edit-zones-actions-group-modal .edit-zones-modal-btn:disabled {
    opacity: 1;
    background: #e2e7ea !important;
    border-color: #d4dbe0 !important;
    color: #87929b;
    box-shadow: none !important;
    cursor: not-allowed;
}
#edit-zones-actions-group-modal .edit-zones-modal-btn-secondary {
    background: #dde3e7 !important;
}
/* Curved box for modal action buttons only */
/* Remove all debug/test blue backgrounds and borders from modal-dialog and children */
#edit-zones-modal .modal-dialog *:not(#edit-zones-actions-group-modal):not(.edit-zones-actions-row):not(.edit-zones-modal-btn) {
    background: unset !important;
    border: unset !important;
    box-shadow: unset !important;
}
/* Debug: force visible box for modal action row */
/* Remove debug/test blue backgrounds and borders from modal-actions-box and options-actions */
.modal-dialog .options-actions, .modal-actions-box {
    background: var(--surface-panel) !important;
    border-radius: 1.1em !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    padding: 0.7em 0.7em 0.7em 0.7em !important;
    width: 95% !important;
    max-width: 420px !important;
    margin: 1.2em auto 1.2em auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 10 !important;
}
/* Curved box for modal action buttons */
/* .modal-actions-box now styled above with .options-actions for consistency */
/* Standardize font in options panel to match Edit Zones button */
#options-panel, #options-panel * {
    font-family: var(--app-font) !important;
    font-size: 1em !important;
    font-weight: var(--options-font-weight, 600) !important;
    letter-spacing: 0;
}
/* Restore pill/rounded style for Edit Zones/Done Editing button in options-pane-edit */
#edit-zones-btn,
#customise-scene-btn,
#add-room-btn,
#remove-room-btn,
#options-room-prev-btn,
#options-room-next-btn {
    display: block;
    margin: 1em 0 0 0;
    width: 100%;
    padding: 0.48em 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(60,60,60,0.08);
    transition: background 0.13s, color 0.13s;
    cursor: pointer;
}
#edit-zones-btn:hover, #edit-zones-btn:focus,
#customise-scene-btn:hover, #customise-scene-btn:focus,
#add-room-btn:hover, #add-room-btn:focus,
#remove-room-btn:hover, #remove-room-btn:focus,
#options-room-prev-btn:hover, #options-room-prev-btn:focus,
#options-room-next-btn:hover, #options-room-next-btn:focus {
    background: var(--text);
    color: #fff;
}
#add-room-btn:disabled,
#remove-room-btn:disabled,
#options-room-prev-btn:disabled,
#options-room-next-btn:disabled {
    background: var(--primary-dark);
    color: var(--text-muted);
    cursor: default;
}

.add-room-modal-dialog,
.room-manage-modal-dialog {
    width: min(92vw, 26rem);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.add-room-modal-info-box,
.room-manage-modal-info-box {
    width: 100%;
    box-sizing: border-box;
}

.add-room-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.add-room-choice-btn {
    min-height: 6rem;
    padding: 0.95rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: linear-gradient(180deg, var(--card) 0%, var(--primary-dark) 100%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
    box-shadow: 0 8px 18px rgba(70, 84, 96, 0.08);
}

.add-room-choice-btn:hover,
.add-room-choice-btn:focus-visible {
    border-color: rgba(96, 109, 120, 0.42);
    box-shadow: 0 12px 22px rgba(70, 84, 96, 0.14);
    transform: translateY(-1px);
}

.add-room-choice-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.add-room-choice-copy {
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.add-room-modal-actions {
    display: flex;
    justify-content: flex-end;
}

.room-manage-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .add-room-choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    #edit-zones-modal.modal-overlay {
        padding-bottom: calc(var(--safe-bottom, 0px) + min(10.5rem, 21vh));
    }
}

@media (max-width: 640px) {
    #edit-zones-modal.modal-overlay {
        padding-bottom: calc(var(--safe-bottom, 0px) + min(11.75rem, 24vh));
    }
}
/* Force plain style for options panel action buttons */
#options-panel .options-actions button {
    background: var(--surface-panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.4em !important;
    color: var(--text) !important;
    font-size: 1em !important;
    padding: 0.6em 1.2em !important;
    margin: 0 0.2em !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    transition: background 0.13s, color 0.13s !important;
    cursor: pointer !important;
}
#options-panel .options-actions button:hover {
    background: var(--surface-panel-alt) !important;
}
/* Plain style for move/remove modal buttons */
.move-remove-btn {
    background: var(--surface-panel);
    border: 1px solid var(--border);
    border-radius: 0.4em;
    color: var(--text);
    font-size: 1em;
    padding: 0.6em 1.2em;
    margin: 0 0.2em;
    box-shadow: none;
    font-weight: 600;
    transition: background 0.13s, color 0.13s;
    cursor: pointer;
}
.move-remove-btn:hover {
    background: var(--surface-panel-alt);
}
/* Reusable info box style for modals and options/info panels */
.info-box {
    background: var(--surface-panel);
    border-radius: 1.2em;
    border: 1.5px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 1.2em 1.2em 1.5em 1.2em;
    min-width: 260px;
    width: min(92vw, 24rem);
    max-width: 420px;
    margin: 0 auto;
}
/* Share platform button styles */
.share-platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 1.1em;
    background: #f4f6f7;
    color: #222;
    font-size: 0.98em;
    font-weight: 600;
    padding: 0.7em 0.2em 0.3em 0.2em;
    box-shadow: 0 2px 8px rgba(60,60,60,0.06);
    cursor: pointer;
    transition: background 0.13s, box-shadow 0.13s;
    min-width: 5.5em;
    min-height: 5.5em;
    outline: none;
    gap: 0.2em;
}
.share-platform-btn img {
    margin-bottom: 0.2em;
    width: 2.2em;
    height: 2.2em;
    border-radius: 0.5em;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.share-platform-btn[data-platform="whatsapp"] img { background: #25D366; }
.share-platform-btn[data-platform="facebook"] img { background: #1877F3; }
.share-platform-btn[data-platform="messenger"] img { background: #00B2FF; }
.share-platform-btn[data-platform="instagram"] img { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.share-platform-btn[data-platform="twitter"] img { background: #000; }
.share-platform-btn[data-platform="email"] img { background: #EA4335; }
.share-platform-btn[data-platform="sms"] img { background: #25D366; }
.share-platform-btn[data-platform="copy"] img { background: #888; }
.share-platform-btn:active, .share-platform-btn:focus {
    background: #e0e2e4;
    box-shadow: 0 4px 16px rgba(60,60,60,0.13);
}

/* Plain dialog for move/remove modal only */
.move-remove-dialog {
    width: min(96vw, 28rem);
    border-radius: 1.1rem;
    background: #f8f9fa;
    border: 1px solid #e0e2e4;
    box-shadow: 0 18px 40px rgba(48, 54, 60, 0.2);
    padding: 1.2rem 1.1rem 1.1rem 1.1rem;
    gap: 0.85rem;
}

.move-remove-select {
    width: 100%;
    min-height: 2.9rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(65, 76, 87, 0.14);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
}

.move-remove-copy {
    color: #5e6873;
    font-size: 0.94rem;
    line-height: 1.45;
}

.move-remove-bulk-controls {
    display: flex;
    gap: 0.6rem;
}

.move-remove-selection-count {
    color: #5e6873;
    font-size: 0.86rem;
    font-weight: 700;
}

.move-remove-item-list {
    max-height: min(42vh, 18rem);
    overflow-y: auto;
    border: 1px solid #dde3e7;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.35rem;
}

.move-remove-item-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.72rem 0.78rem;
    border-radius: 0.8rem;
    cursor: pointer;
}

.move-remove-item-row:hover {
    background: rgba(238, 242, 244, 0.8);
}

.move-remove-item-check {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.18rem;
    flex: 0 0 auto;
}

.move-remove-item-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 0.16rem;
}

.move-remove-item-copy strong {
    color: #27313a;
    font-weight: 600;
}

.move-remove-item-copy span {
    color: #62707b;
    font-size: 0.9rem;
}

.move-remove-btn-secondary {
    background: #fff;
}

.move-remove-actions-box {
    margin-top: 0.35rem;
    padding: 0.8rem;
    background: var(--surface-panel-soft);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.move-remove-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}
/* Ensure Remove Zone button is only visible in layout edit mode */
#options-panel:not(.layout-editing) #remove-zone-btn {
    display: none !important;
}
.zone-panel-addbox {
    margin: 0.5em 0 0.2em 0;
    padding: 0.5em 0.7em;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
    border-radius: 0.6em;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    box-shadow: 0 2px 8px rgba(60,60,60,0.06);
    max-width: 100%;
    position: relative;
    overflow: visible;
    z-index: 20;
}

.icon-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 5001 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 40, 40, 0.32);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(40, 40, 40, 0.32);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.modal-dialog {
    background: var(--surface-panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 1.1em;
    box-shadow: 0 6px 32px 0 rgba(0,0,0,0.18);
    padding: 2.1em 1.5em 1.5em 1.5em;
    min-width: 320px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

@media (max-width: 600px) {
    .modal-dialog {
        min-width: 0;
        width: 98vw;
        padding: 1.2em 0.7em 1em 0.7em;
    }
}

#meal-planner-modal .meal-planner-dialog {
    width: min(96vw, 52rem);
    max-width: 52rem;
    height: auto;
    max-height: min(94vh, 60rem);
    display: grid;
    grid-template-rows: auto auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.4rem 1.35rem 1.25rem;
    gap: 1.15rem;
    align-self: flex-start !important;
    margin: 0.35rem auto 0 !important;
    overscroll-behavior: none;
}

#meal-planner-modal.modal-overlay {
    background: linear-gradient(180deg, rgba(39, 49, 58, 0.16) 0%, var(--primary) 100%);
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0.15rem 0.75rem 0.75rem !important;
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: none;
}

.meal-planner-title {
    font-size: 1.35rem !important;
    line-height: 1.2;
}

.meal-planner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.meal-planner-header-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.meal-planner-header-icon {
    width: 2.35rem;
    height: 2.35rem;
    object-fit: contain;
    flex: 0 0 auto;
}

.meal-planner-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    min-width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface-panel);
    color: var(--text);
    font-size: 1.1rem;
}

.meal-planner-form {
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 0;
    height: auto;
    min-height: 0;
    overflow: visible;
}

.meal-planner-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.1rem;
}

.meal-planner-tab {
    min-height: 3rem;
    border: 1px solid var(--border);
    border-radius: 0.95rem;
    background: var(--surface-panel-alt);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.meal-planner-tab.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 8px 18px rgba(39, 49, 58, 0.12);
}

.meal-planner-body {
    min-height: 0;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
}

.meal-planner-section[hidden] {
    display: none !important;
}

.meal-planner-week-section,
.meal-planner-mainview {
    min-height: 0;
    height: auto;
}

.meal-planner-mainview {
    overflow: visible;
}

.meal-planner-picker-modal {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0.2rem 0.75rem 0.75rem !important;
    background: linear-gradient(180deg, rgba(39, 49, 58, 0.16) 0%, var(--primary) 100%);
}

.meal-planner-picker-dialog {
    width: 28rem;
    max-width: min(92vw, 28rem);
    height: auto;
    min-height: 29rem;
    max-height: min(90vh, 44rem);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: none;
    padding: 0.8rem;
    margin: 0.2rem auto 0 !important;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
}

.meal-planner-fields {
    display: grid;
    grid-template-rows: auto auto auto auto auto;
    gap: 1rem;
    align-content: start;
    height: auto;
    min-height: 0;
    overflow: visible;
}

.meal-planner-recipe-name {
    min-height: 3.25rem !important;
    padding: 0.8rem 0.9rem !important;
    font-size: 1.05rem !important;
}

#ingredients-list {
    min-height: 8rem;
    max-height: min(36vh, 18rem);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: var(--surface-panel-soft);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
    gap: 0.95rem;
    overscroll-behavior: contain;
}

#ingredients-list:empty {
    min-height: 4.2rem;
    max-height: 4.2rem;
}

.meal-planner-common-panel {
    margin: 0 0 0.2rem 0;
    overflow: hidden;
}

.meal-planner-week-panel {
    margin: 0 0 0.2rem 0;
    overflow: hidden;
}

.meal-planner-week-heading {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meal-planner-week-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem;
    border-radius: 999px;
    background: var(--surface-panel-alt);
}

.meal-planner-week-switch-btn {
    min-height: 2.2rem;
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.meal-planner-week-switch-btn.is-active {
    background: var(--surface-panel);
    color: var(--text);
    box-shadow: 0 2px 6px rgba(60,60,60,0.1);
}

.meal-planner-week-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.meal-planner-week-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
    box-shadow: 0 2px 6px rgba(60,60,60,0.06);
}

.meal-planner-week-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meal-planner-week-slot-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.meal-planner-week-slot-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.meal-planner-week-slot-btn {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    min-height: 4.2rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-panel);
    color: var(--text);
    text-align: left;
    padding: 0.7rem 0.8rem;
}

.meal-planner-week-day {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.meal-planner-week-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.meal-planner-week-date.is-today {
    color: var(--accent);
}

.meal-planner-week-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    overflow-wrap: anywhere;
}

.meal-planner-week-name.is-empty {
    font-weight: 600;
    color: var(--text-muted);
}

.meal-planner-week-slot-label {
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.meal-planner-week-slot-clear-btn {
    min-width: 4.35rem;
    padding: 0 0.8rem;
}

.meal-planner-common-panel .zone-quickpick-grid {
    margin-bottom: 0;
    max-height: min(28vh, 15rem);
    overflow-y: auto;
    padding-right: 0.15rem;
    overscroll-behavior: contain;
}

.meal-planner-common-manage {
    margin-top: 0.6rem;
}

.meal-planner-common-manage[hidden] {
    display: none !important;
}

.meal-planner-common-manage-title {
    padding: 0 0.1rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.meal-planner-common-saved-list {
    max-height: 11rem;
    overflow-y: auto;
    padding: 0.15rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-panel-soft);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: auto;
}

.meal-planner-common-btn {
    min-height: 0;
    display: block;
    padding: 0.7rem 0.8rem;
}

.meal-planner-common-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
}

.meal-planner-saved-recipe-btn {
    font-weight: 600;
}

.meal-planner-ingredient-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    width: 100%;
    margin-bottom: 0.95rem;
    padding-bottom: 0.15rem;
}

.meal-planner-ingredient-actions > button,
#add-ingredient-btn,
#remove-ingredient-btn {
    flex: 1 1 11.25rem;
    min-width: 11.25rem;
    justify-content: center;
    text-align: center;
}

.meal-planner-footer-gap {
    display: block;
    width: 100%;
    min-height: 0.55rem;
}

.meal-planner-actions {
    display: flex;
    width: 100%;
    gap: 0.6rem;
    row-gap: 0.6rem;
    justify-content: flex-start;
    margin-top: 1rem !important;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.meal-planner-actions.is-week-tab {
    display: none;
    justify-content: flex-end;
    margin-top: 0.55rem !important;
    padding-top: 0;
    border-top: 0;
}

.meal-planner-actions.is-week-tab > button {
    flex: 0 0 auto;
    min-width: 9rem;
}

.meal-planner-actions > button {
    margin-top: 0.85rem;
}

.meal-planner-addbox {
    margin: 0;
    padding: 0.55rem 0.7rem 0.7rem;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: 0.45rem;
    height: auto;
    width: 100%;
    min-height: 24.75rem;
    max-height: min(76vh, 34rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: none;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
}

.meal-planner-addbox[hidden] {
    display: none !important;
}

.meal-planner-add-status {
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.ingredient-row {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    min-height: 3.35rem;
    padding: 0.55rem 0.7rem;
    flex-wrap: nowrap;
    border: 1px solid var(--border);
    border-radius: 0.95rem;
    background: var(--surface-panel);
    box-shadow: 0 2px 6px rgba(60,60,60,0.06);
}

.ingredient-summary {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.ingredient-summary-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.ingredient-summary-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ingredient-remove-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
    background: transparent;
    border: 0;
    text-align: left;
}

.ingredient-remove-option strong {
    font-weight: 600;
    color: var(--text);
}

.ingredient-remove-option span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.meal-planner-week-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.78rem 0.9rem;
    background: transparent;
    border: 0;
    text-align: left;
}

.meal-planner-week-option-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 0.16rem;
}

.meal-planner-week-option-copy strong {
    font-weight: 600;
    color: var(--text);
}

.meal-planner-week-option-copy span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.meal-planner-week-option-mark {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.meal-planner-week-picker-section {
    padding: 0.8rem 0.95rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.meal-planner-week-picker-empty {
    padding: 0.7rem 0.95rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.meal-planner-week-picker-actions {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.7rem;
}

.meal-planner-week-single-item-btn,
.meal-planner-week-back-btn {
    width: 100%;
}

.meal-planner-week-item-search {
    margin-bottom: 0.6rem;
}

.meal-planner-shopping-sync-dialog {
    width: min(100%, 28rem);
    max-height: min(84vh, 36rem);
    overflow: auto;
}

.meal-planner-shopping-sync-copy {
    margin-bottom: 0.8rem;
}

.meal-planner-shopping-sync-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.meal-planner-shopping-sync-item {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-panel-soft);
    color: var(--text);
    font-weight: 600;
}

.meal-planner-decision-dialog {
    width: min(100%, 31rem);
}

.meal-planner-decision-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meal-planner-decision-meta {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
}

.meal-planner-decision-actions {
    flex-wrap: wrap;
}

.meal-planner-decision-actions > button {
    flex: 1 1 11rem;
}

.trolly-dialog {
    width: min(96vw, 34rem);
    max-width: 34rem;
    height: min(92vh, 44rem);
    max-height: min(92vh, 44rem);
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    overflow: hidden;
    padding: 1.1rem 1rem 1rem;
    align-self: flex-start;
    margin: 0.35rem auto 0;
}

#trolly-modal.modal-overlay {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 0.15rem 0.75rem 0.75rem !important;
    box-sizing: border-box;
    overflow: hidden;
}

.trolly-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.trolly-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.trolly-header-icon {
    width: 2.5em;
    height: 2.5em;
    border-radius: 0.5em;
    background: transparent;
    box-shadow: none;
}

.trolly-title {
    font-size: 1.18em;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.trolly-items-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.trolly-items-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 0.15rem;
    overscroll-behavior: contain;
}

.trolly-toolbar[hidden] {
    display: none !important;
}

.trolly-toolbar {
    display: flex;
    justify-content: flex-end;
}

.trolly-move-btn {
    width: 100%;
}

.trolly-addbox {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.55rem;
    min-height: 0;
    height: min(44vh, 20rem);
    max-height: min(44vh, 20rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
}

.trolly-addbox .zone-search-input {
    flex: 0 0 auto;
}

.trolly-additem-suggestions {
    flex: 1 1 auto;
    min-height: 6.5rem;
    max-height: min(36vh, 16rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.trolly-zone-picker-copy {
    margin-bottom: 0.65rem;
}

.trolly-zone-picker-list {
    max-height: min(42vh, 18rem);
    overflow-y: auto;
    padding: 0.15rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-panel-soft);
}

.trolly-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface-panel);
}

.trolly-item-check {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
}

.trolly-item-name {
    flex: 1 1 0;
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.trolly-item-name.is-checked {
    text-decoration: line-through;
    color: var(--text-muted);
}

.trolly-remove-btn {
    background: var(--surface-panel-alt);
    color: var(--danger);
    border: 1px solid var(--border);
    border-radius: 0.4em;
    padding: 0.2em 0.7em;
    font-size: 1.1em;
    cursor: pointer;
    flex: 0 0 auto;
}

.trolly-empty {
    color: var(--text-muted);
    font-size: 1em;
    text-align: center;
    padding: 1.2rem 0.5rem;
}

body.shopping-only-mode {
    background: var(--surface-panel-soft);
}

body.shopping-only-mode .app-header,
body.shopping-only-mode .logo-container,
body.shopping-only-mode #kitchen-stage,
body.shopping-only-mode .kitchen-buttons-row,
body.shopping-only-mode #subsection-panel,
body.shopping-only-mode #options-panel {
    display: none !important;
}

body.shopping-only-mode .home-main {
    padding: 0;
    min-height: 100vh;
}

body.shopping-only-mode #trolly-modal.modal-overlay {
    padding: 0 !important;
    background: var(--surface-panel-soft);
}

body.shopping-only-mode .trolly-dialog {
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0.95rem 0.85rem calc(0.9rem + var(--safe-bottom)) !important;
    box-shadow: none !important;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
}

body.shopping-only-mode .trolly-header {
    padding-top: calc(0.25rem + var(--safe-top));
}

#add-ingredient-btn,
#remove-ingredient-btn,
#save-recipe-btn,
#meal-planner-cancel {
    min-height: 3.1rem;
}

.ingredient-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    padding: 0.15rem 0.1rem 0.2rem;
}

.ingredient-box-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
}

.ingredient-box-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    min-width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-panel);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60,60,60,0.06);
}

.ingredient-box-close:hover {
    background: var(--surface-panel-alt);
    border-color: var(--border);
}

.ingredient-search-input {
    min-height: 3rem;
    height: 3rem;
    box-sizing: border-box;
    line-height: 1.3;
    appearance: none;
    -webkit-appearance: none;
    font-size: 0.95rem !important;
    padding: 0.55em 0.8em !important;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
}

.ingredient-search-input.is-locked {
    background: #fff6e5;
    border-color: #dbc48b !important;
    color: #3f3315;
    font-weight: 600;
    opacity: 1;
    cursor: default;
}

.ingredient-suggestions-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

.ingredient-suggestion-option {
    touch-action: pan-y;
    cursor: pointer;
    user-select: none;
}

.meal-planner-addbox.is-detail-view .ingredient-suggestions-list {
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: 0;
}

.meal-planner-addbox.is-detail-view .ingredient-search-input,
.meal-planner-addbox.is-detail-view .meal-planner-add-status {
    display: none;
}

.meal-planner-addbox.is-detail-view .ingredient-detail-form {
    min-height: 100%;
}

.meal-planner-addbox.is-detail-view .ingredient-detail-actions {
    margin-top: auto;
}

.ingredient-remove-option {
    justify-content: space-between;
    gap: 0.85rem;
}

.ingredient-remove-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 0.16rem;
}

.ingredient-remove-copy strong {
    font-weight: 600;
    color: var(--text);
}

.ingredient-remove-copy span {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.ingredient-remove-mark {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.ingredient-detail-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.2rem 0.1rem 0.25rem;
}

.ingredient-detail-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.ingredient-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.ingredient-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ingredient-detail-field select {
    min-height: 3.3rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface-panel);
    color: var(--text);
}

.ingredient-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
}

.ingredient-detail-add-btn {
    min-width: 11rem;
}

.ingredient-detail-back-btn,
.ingredient-detail-add-btn {
    flex: 0 0 auto;
}

.ingredient-suggestion-row.is-selected .ingredient-suggestion-option,
.ingredient-suggestion-option:hover {
    background: transparent !important;
}

.meal-planner-actions {
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    #meal-planner-modal.modal-overlay {
        padding: 0.1rem 0.35rem 0.35rem !important;
    }

    .meal-planner-picker-modal {
        padding: 0.1rem 0.35rem 0.35rem !important;
    }

    #meal-planner-modal .meal-planner-dialog {
        width: min(98vw, 100%);
        max-width: 98vw;
        height: auto;
        max-height: 96vh;
        grid-template-rows: auto auto;
        padding: 1rem 0.85rem 0.95rem;
        margin-top: 0.15rem !important;
    }

    .trolly-dialog {
        width: min(98vw, 100%);
        max-width: 98vw;
        height: 96vh;
        max-height: 96vh;
        padding: 0.95rem 0.8rem 0.85rem;
        margin-top: 0.15rem;
    }

    #trolly-modal.modal-overlay {
        padding: 0.1rem 0.35rem 0.35rem !important;
    }

    .trolly-addbox {
        height: min(40vh, 17rem);
        max-height: min(40vh, 17rem);
    }

    .trolly-additem-suggestions {
        min-height: 5.75rem;
        max-height: min(30vh, 13.5rem);
    }

    .meal-planner-picker-dialog {
        width: 88vw;
        max-width: 25rem;
        height: auto;
        min-height: min(92vh, 38rem);
        max-height: min(92vh, 38rem);
        padding: 0.65rem;
        margin-top: 0.15rem !important;
    }

    .meal-planner-addbox {
        min-height: calc(min(92vh, 38rem) - 4.35rem);
        max-height: calc(min(92vh, 38rem) - 4.35rem);
        padding: 0.45rem 0.55rem 0.55rem;
    }

    .meal-planner-form {
        gap: 0;
    }

    .meal-planner-tabs {
        gap: 0.45rem;
    }

    .meal-planner-week-switch {
        width: 100%;
        justify-content: stretch;
    }

    .meal-planner-week-switch-btn {
        flex: 1 1 0;
        text-align: center;
    }

    .meal-planner-tab {
        min-height: 2.85rem;
        font-size: 0.92rem;
    }

    .meal-planner-body {
        overflow-y: auto;
    }

    .meal-planner-mainview,
    .meal-planner-fields {
        height: auto;
    }

    #ingredients-list {
        min-height: 5.75rem;
        max-height: min(18vh, 8.75rem);
        padding: 0.65rem;
    }

    #ingredients-list:empty {
        min-height: 2rem;
        max-height: 2rem;
        padding-top: 0.18rem;
        padding-bottom: 0.18rem;
    }

    .ingredient-row {
        gap: 0.7rem;
        padding: 0.5rem 0.6rem;
    }

    .meal-planner-ingredient-actions > button {
        flex: 1 1 11.25rem;
        min-width: 11.25rem;
        margin-right: 0 !important;
    }

    .meal-planner-ingredient-actions {
        padding-bottom: 0.1rem;
    }

    .meal-planner-footer-gap {
        min-height: 0.65rem;
    }

    .meal-planner-actions {
        margin-top: 1rem !important;
        padding-top: 1rem;
    }

    #remove-ingredient-btn {
        flex: 1 1 11.25rem;
        min-width: 11.25rem;
    }

    #save-recipe-btn {
        flex: 0 0 auto;
        min-width: 8.25rem;
    }

    .ingredient-detail-grid {
        grid-template-columns: 1fr;
    }

    .ingredient-detail-actions {
        flex-direction: column-reverse;
    }

    .meal-planner-addbox.is-detail-view .ingredient-detail-form {
        gap: 0.7rem;
        padding-bottom: 0.1rem;
    }

    .meal-planner-addbox.is-detail-view .ingredient-detail-grid {
        gap: 0.55rem;
    }

    .meal-planner-addbox.is-detail-view .ingredient-detail-field select {
        min-height: 3rem;
        padding: 0.62rem 0.72rem;
    }

    .meal-planner-addbox.is-detail-view .ingredient-detail-actions {
        flex-direction: row;
        gap: 0.55rem;
    }

    .meal-planner-addbox.is-detail-view .ingredient-detail-actions > button {
        flex: 1 1 0;
        min-width: 0;
    }

    .meal-planner-addbox {
        padding: 0.5rem 0.6rem 0.6rem;
    }

    .meal-planner-week-grid {
        grid-template-columns: 1fr;
    }

    .meal-planner-week-card {
        padding: 0.7rem;
    }

    .meal-planner-common-panel .zone-quickpick-grid {
        max-height: min(24vh, 12rem);
    }
}

#add-ingredient-btn {
    background: #e6f7e6;
    color: #2e7d32;
    border: none;
    border-radius: 0.4em;
    min-height: 2.75rem;
    padding: 0.34em 0.95em;
    font-size: 0.94em;
    cursor: pointer;
    margin-top: 0.2em;
    margin-bottom: 0.55rem;
    transition: background 0.15s;
}
#add-ingredient-btn:hover {
    background: #c8e6c9;
}

#remove-ingredient-btn {
    background: #efe7d4;
    color: #7a5a1c;
    border: none;
    border-radius: 0.4em;
    align-self: stretch;
    min-height: 2.75rem;
    padding: 0.34em 0.95em;
    font-size: 0.94em;
    cursor: pointer;
    margin-top: 0.2em;
    margin-bottom: 0.55rem;
    transition: background 0.15s;
}
#remove-ingredient-btn:hover {
    background: #e3d7b7;
}

#save-recipe-btn {
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 0.4em;
    flex: 0 0 auto;
    min-height: 2.5rem;
    padding: 0.24em 0.9em;
    font-size: 0.88em;
    cursor: pointer;
    margin-top: 0.2rem;
    transition: background 0.15s;
}
#save-recipe-btn:hover {
    background: #388e3c;
}

#meal-planner-cancel {
    background: #eee;
    color: #444;
    border: none;
    border-radius: 0.4em;
    padding: 0.4em 1.2em;
    font-size: 1em;
    cursor: pointer;
    margin-top: 0.2rem;
    transition: background 0.15s;
}
#meal-planner-cancel:hover {
    background: #e0e0e0;
}

.icon-picker-dialog {
    width: min(100%, 28rem);
    max-height: min(80vh, 42rem);
    overflow: auto;
    border-radius: 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e2e4;
    box-shadow: 0 18px 40px rgba(48, 54, 60, 0.2);
    padding: 1rem;
}

.icon-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.icon-picker-title {
    margin: 0;
    font-size: 1rem;
}

.icon-picker-close,
.icon-picker-cancel,
.icon-picker-save {
    border: 1px solid #d8dde2;
    border-radius: 0.8rem;
    background: #fff;
    color: #27313a;
    padding: 0.65rem 0.9rem;
}

.icon-picker-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #5e6873;
    font-size: 0.84rem;
    font-weight: 700;
}

.icon-picker-name-input {
    width: 100%;
    margin-top: 0.35rem;
    border: 1px solid #bcbdb9;
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: #fff;
    color: #27313a;
    font-size: 0.96rem;
}

.icon-picker-item-name {
    margin-bottom: 0.65rem;
    font-size: 1rem;
    font-weight: 700;
    color: #27313a;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.icon-picker-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    border: 1px solid #d8dde2;
    border-radius: 0.9rem;
    background: #fff;
    font-size: 1.35rem;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.icon-picker-option.is-selected {
    border-color: #8d97a1;
    background: #eef2f5;
}
/* Removed stray transition and extra closing brace that caused a syntax error */
.zone-dropdown button.just-added {
    animation: popAdded 0.4s cubic-bezier(.4,2,.6,1) 1;
}
@keyframes popAdded {
    0% { transform: scale(1); background: #e6f0fa; }
    60% { transform: scale(1.12); background: #c6f6d5; }
    100% { transform: scale(1); background: #f3f3f3; }
}
/* Dropdown for zone add button */
.zone-dropdown {
    position: absolute;
    bottom: 2.5rem;
    right: 0.3rem;
    min-width: 8rem;
    background: #fff;
    border: 1.5px solid #bcbdb9;
    border-radius: 0.7rem;
    box-shadow: 0 6px 24px rgba(60,60,60,0.13);
    z-index: 10;
    padding: 0.5rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 1rem;
    box-sizing: border-box;
}
.zone-dropdown[hidden] {
    display: none;
}
.zone-dropdown button {
    background: none;
    border: none;
    color: #27313a;
    text-align: left;
    padding: 0.3rem 0.7rem;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.13s;
    display: flex;
    align-items: center;
}
.zone-dropdown-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.4em;
    border: 1px solid #bcbdb9;
    border-radius: 0.5em;
    padding: 0.5em 0.7em;
    font-size: 1em;
    outline: none;
    background: #f8f9fa;
    color: #27313a;
}

.zone-dropdown-input:focus {
    border-color: var(--accent);
    background: var(--surface-panel);
}

.zone-search-input {
    display: block;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.5em;
    background: var(--surface-panel);
    color: var(--text);
    padding: 0.55em 0.8em;
    font-size: 0.95em;
    margin-bottom: 0.35rem;
}

.zone-search-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(141, 151, 161, 0.16);
}

.zone-quickpick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.zone-quickpick-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.zone-quickpick-helper {
    margin-top: 0.08rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.zone-detail-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.7rem;
}

.zone-detail-action-btn {
    flex: 1 1 0;
    min-height: 3.1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #27313a;
    border-radius: 0.95rem;
    background: #27313a;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(39, 49, 58, 0.12);
}

.zone-detail-action-btn.secondary {
    background: #fff;
    color: #27313a;
    border-color: #d8dde2;
}

.zone-detail-action-btn.danger {
    background: #9f302b;
    color: #fff;
    border-color: #9f302b;
}

.zone-detail-action-btn:hover {
    background: #1f272f;
}

.zone-detail-action-btn.secondary:hover {
    background: #f4f6f7;
}

.zone-detail-action-btn.danger:hover {
    background: #8d2d28;
}

.zone-frequent-edit-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-panel);
    color: var(--text);
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.zone-quickpick-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.zone-quickpick-section-body {
    margin-bottom: 0.55rem;
}

.zone-quickpick-section-body[hidden] {
    display: none !important;
}

.zone-additem-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.zone-additem-status {
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.zone-additem-suggestions {
    position: relative;
    background: linear-gradient(180deg, var(--surface-panel-soft) 0%, var(--surface-panel) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.16);
    max-height: 240px;
    min-height: 3rem;
    overflow-y: auto;
    display: block;
    flex: 1 1 auto;
}

.zone-quickpick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.zone-quickpick-card {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.zone-quickpick-btn {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-panel-alt);
    color: var(--text);
    text-align: left;
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(60,60,60,0.06);
}

.zone-quickpick-edit-btn,
.zone-quickpick-remove-btn,
.zone-suggestion-edit-btn,
.zone-suggestion-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    padding: 0 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface-panel);
    color: var(--text);
    font-size: 0.88rem;
}

.zone-quickpick-remove-btn,
.zone-suggestion-manage-btn {
    color: var(--text-muted);
}

.zone-quickpick-empty {
    grid-column: 1 / -1;
    padding: 0.8rem 0.9rem;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    background: var(--surface-panel);
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

.zone-suggestion-row {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.2rem;
    border-top: 1px solid var(--border);
    background: var(--surface-panel);
}

.zone-suggestion-row:first-child {
    border-top: 0;
}

.zone-suggestion-row.is-selected {
    background: var(--surface-panel-alt);
}

.zone-suggestion-row.is-frequent .zone-suggestion-option {
    font-weight: 700;
}

.zone-suggestion-option {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    border: 0;
    background: transparent !important;
    color: var(--text);
    text-align: left;
    padding: 0.75rem 0.9rem;
    font-size: 0.98rem;
}

.zone-editable-input {
    min-height: 2.35rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-user-modify: read-write-plaintext-only;
}

.zone-editable-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.zone-dropdown-results {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    max-height: 13em;
    overflow-y: auto;
}
.zone-dropdown button:hover {
    background: #f3f3f3;
}
.zone-dropdown button.highlighted {
    background: #e6f0fa;
    color: #1a2a3a;
    color: #2a6a2a;
    background: #f6fff6;
    border: 1px solid #bcbdb9;
    margin-top: 0.2em;
}

/* Add button for each zone */
.zone-add-btn {
    z-index: 3;
    background: #fff;
    color: #27313a;
    border: 1.5px solid #bcbdb9;
    border-radius: 50%;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.3rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(60,60,60,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, box-shadow 0.15s;
    min-width: 0;
    margin: 0;
}
.zone-add-btn:hover {
    background: #f3f3f3;
    box-shadow: 0 4px 16px rgba(60,60,60,0.13);
}
:root {
    --app-font: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --app-font-style: normal;
    --app-font-weight: 400;
    --options-font-weight: 600;
    --primary: rgba(244, 246, 248, 0.86);
    --primary-dark: rgba(219, 224, 228, 0.92);
    --surface-panel: #f8f9fa;
    --surface-panel-soft: #f4f6f8;
    --surface-panel-alt: #e9ecef;
    --accent: #8d97a1;
    --danger: #c95b54;
    --text: #27313a;
    --text-muted: #5e6873;
    --bg: #8d9296;
    --card: rgba(248, 249, 250, 0.74);
    --card-dark: rgba(233, 236, 239, 0.86);
    --border: rgba(65, 76, 87, 0.12);
    --shadow: 0 18px 40px rgba(48, 54, 60, 0.16);
    --radius: 18px;
    --header-h: 60px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --shell-overlay-start: rgba(188, 189, 185, 0.8);
    --shell-overlay-end: rgba(188, 189, 185, 0.8);
    --shell-bg-solid: #bcbdb9;
    --silver-background-image: url('assets/images/Silver%20Background.png');
    --silver-background-layer: var(--silver-background-image) center / cover no-repeat;
    --silver-background-main-position: center 58%;
    --silver-background-main-size: cover;
}

:root[data-font="clean-sans"] {
    --app-font: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --app-font-style: normal;
    --app-font-weight: 400;
    --options-font-weight: 600;
}

:root[data-font="rounded-sans"] {
    --app-font: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif;
    --app-font-style: normal;
    --app-font-weight: 400;
    --options-font-weight: 600;
}

:root[data-font="classic-serif"] {
    --app-font: "Lora", Georgia, "Times New Roman", serif;
    --app-font-style: normal;
    --app-font-weight: 400;
    --options-font-weight: 600;
}

:root[data-font="elegant-italic"] {
    --app-font: "Cormorant Garamond", Georgia, serif;
    --app-font-style: italic;
    --app-font-weight: 700;
    --options-font-weight: 700;
}

:root[data-theme="silver-mist"] {
    --primary: rgba(244, 246, 248, 0.86);
    --primary-dark: rgba(219, 224, 228, 0.92);
    --surface-panel: #f8f9fa;
    --surface-panel-soft: #f4f6f8;
    --surface-panel-alt: #e9ecef;
    --accent: #8d97a1;
    --danger: #c95b54;
    --text: #27313a;
    --text-muted: #5e6873;
    --bg: #8d9296;
    --card: rgba(248, 249, 250, 0.74);
    --card-dark: rgba(233, 236, 239, 0.86);
    --border: rgba(65, 76, 87, 0.12);
    --shadow: 0 18px 40px rgba(48, 54, 60, 0.16);
    --shell-overlay-start: rgba(188, 189, 185, 0.8);
    --shell-overlay-end: rgba(188, 189, 185, 0.8);
    --shell-bg-solid: #bcbdb9;
}

:root[data-theme="sage"] {
    --primary: rgba(243, 247, 241, 0.88);
    --primary-dark: rgba(223, 232, 219, 0.94);
    --surface-panel: #f7f9f4;
    --surface-panel-soft: #f3f7f1;
    --surface-panel-alt: #e8eee4;
    --accent: #7c927a;
    --danger: #c17060;
    --text: #28342c;
    --text-muted: #617162;
    --bg: #889284;
    --card: rgba(247, 249, 244, 0.78);
    --card-dark: rgba(232, 238, 228, 0.88);
    --border: rgba(69, 86, 70, 0.12);
    --shadow: 0 18px 40px rgba(44, 58, 45, 0.16);
    --shell-overlay-start: rgba(187, 200, 183, 0.82);
    --shell-overlay-end: rgba(180, 194, 176, 0.82);
    --shell-bg-solid: #b8c3b5;
}

:root[data-theme="coastal"] {
    --primary: rgba(241, 246, 249, 0.88);
    --primary-dark: rgba(218, 228, 235, 0.94);
    --surface-panel: #f6f9fb;
    --surface-panel-soft: #f1f6f9;
    --surface-panel-alt: #e5ecf1;
    --accent: #6e8ea1;
    --danger: #c76f63;
    --text: #23323b;
    --text-muted: #5b6d79;
    --bg: #7f8f99;
    --card: rgba(246, 249, 251, 0.78);
    --card-dark: rgba(229, 236, 241, 0.88);
    --border: rgba(60, 79, 92, 0.12);
    --shadow: 0 18px 40px rgba(41, 54, 64, 0.17);
    --shell-overlay-start: rgba(180, 193, 201, 0.82);
    --shell-overlay-end: rgba(171, 186, 195, 0.82);
    --shell-bg-solid: #b1bec6;
}

:root[data-theme="terracotta"] {
    --primary: rgba(248, 244, 240, 0.88);
    --primary-dark: rgba(237, 227, 219, 0.94);
    --surface-panel: #faf7f4;
    --surface-panel-soft: #f8f4f0;
    --surface-panel-alt: #f2ebe6;
    --accent: #b27a65;
    --danger: #c05b4f;
    --text: #352c29;
    --text-muted: #75635d;
    --bg: #98857d;
    --card: rgba(250, 247, 244, 0.78);
    --card-dark: rgba(242, 235, 230, 0.88);
    --border: rgba(93, 71, 63, 0.12);
    --shadow: 0 18px 40px rgba(66, 50, 43, 0.16);
    --shell-overlay-start: rgba(205, 188, 179, 0.82);
    --shell-overlay-end: rgba(196, 178, 169, 0.82);
    --shell-bg-solid: #c4b1a6;
}

:root[data-theme="lagoon-pop"] {
    --primary: rgba(223, 241, 243, 0.92);
    --primary-dark: rgba(191, 224, 228, 0.95);
    --surface-panel: #e8f4f5;
    --surface-panel-soft: #ddeef0;
    --surface-panel-alt: #c8dfe2;
    --accent: #3d7f8c;
    --danger: #cb6755;
    --text: #18373c;
    --text-muted: #4d7177;
    --bg: #6f9ca2;
    --card: rgba(232, 244, 245, 0.82);
    --card-dark: rgba(200, 223, 226, 0.9);
    --border: rgba(45, 87, 93, 0.14);
    --shadow: 0 18px 40px rgba(32, 74, 79, 0.18);
    --shell-overlay-start: rgba(146, 194, 198, 0.84);
    --shell-overlay-end: rgba(124, 177, 183, 0.84);
    --shell-bg-solid: #94c1c6;
}

:root[data-theme="sunburst"] {
    --primary: rgba(246, 235, 217, 0.92);
    --primary-dark: rgba(234, 212, 183, 0.95);
    --surface-panel: #f5ebdc;
    --surface-panel-soft: #f0e2cd;
    --surface-panel-alt: #e5cfb2;
    --accent: #c67634;
    --danger: #c85b4f;
    --text: #3f2e20;
    --text-muted: #7c624b;
    --bg: #b98f62;
    --card: rgba(245, 235, 220, 0.84);
    --card-dark: rgba(229, 207, 178, 0.9);
    --border: rgba(114, 82, 47, 0.14);
    --shadow: 0 18px 40px rgba(92, 61, 28, 0.18);
    --shell-overlay-start: rgba(223, 186, 135, 0.84);
    --shell-overlay-end: rgba(210, 165, 108, 0.84);
    --shell-bg-solid: #d5a96f;
}

:root[data-font="elegant-italic"] {
    --text: #000000;
    --text-muted: #1a1a1a;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--app-font);
    font-style: var(--app-font-style);
    font-weight: var(--app-font-weight, 400);
    font-size: 16px;
    background:
        linear-gradient(180deg, var(--shell-overlay-start) 0%, var(--shell-overlay-end) 100%),
        var(--silver-background-image) var(--silver-background-main-position) / var(--silver-background-main-size) no-repeat,
        var(--shell-bg-solid);
    color: var(--text);
    overflow: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.options-panel-open .home-main,
body.options-panel-open #open-options-btn,
body.options-panel-open #install-app-btn {
    pointer-events: none;
}

body.options-panel-open #options-panel,
body.options-panel-open #options-panel * {
    pointer-events: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: calc(var(--header-h) + var(--safe-top));
    padding: calc(0.8rem + var(--safe-top)) 0.9rem 0.8rem;
    background: transparent !important;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 20;
}

.app-header-spacer {
    flex: 1 1 auto;
}

.app-title {
    margin: 0;
    flex: 1 1 auto;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.options-fab,
.header-install-btn,
#subsection-close,
#options-close-btn,
.options-nav-btn,
.options-action-btn,
.delete-item-btn {
    transition: background-color 0.18s ease, transform 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.header-install-btn {
    min-height: 3.2rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: rgba(226, 232, 238, 0.72);
    color: #5e6873;
    box-shadow: inset 0 0 0 1px rgba(141, 151, 161, 0.26);
    font-size: 0.98rem;
    font-weight: 700;
    white-space: nowrap;
}

.header-install-btn[hidden] {
    display: none !important;
}

.options-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    min-height: 3.2rem;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(58, 68, 78, 0.08);
    white-space: nowrap;
}

.options-fab svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}

.options-fab:hover,
.header-install-btn:hover,
#subsection-close:hover,
#options-close-btn:hover,
.options-nav-btn:hover,
.options-action-btn:hover,
.delete-item-btn:hover {
    transform: translateY(-1px);
}

#add-zone-btn {
    display: none;
}

#add-zone-btn.visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-main {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 1rem 0.9rem calc(1rem + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.01rem;
    position: relative;
}

.home-hint {
    margin: 0;
    text-align: center;
    color: rgba(39, 49, 58, 0.76);
    font-size: 0.92rem;
    font-weight: 600;
}

#kitchen-stage {
    position: relative;
    margin: 0 auto;
    width: min(calc(100vw - 1.8rem), 26rem);
    max-width: 100%;
    height: auto;
    max-height: min(calc(100vh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 2rem), 39rem);
    max-height: min(calc(100svh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 2rem), 39rem);
    aspect-ratio: 2 / 3;
    border-radius: 0.9rem;
    overflow: hidden;
    background: none;
    box-shadow: none;
    touch-action: pan-y;
}

.room-stage-shell {
    width: min(calc(100vw - 1.8rem), 26rem);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    position: relative;
}
.room-stage-toolbar {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: -0.12rem;
    position: relative;
    z-index: 24;
}
.room-stage-toolbar[hidden] {
    display: none;
}
.room-stage-toolbar.has-next-only {
    justify-content: flex-end;
}
.room-stage-toolbar.has-prev-only {
    justify-content: flex-start;
}
.room-stage-nav {
    min-width: 11.4rem;
    max-width: calc(50% - 0.7rem);
    min-height: 4.8rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f4ead7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1rem 1.7rem;
    box-shadow: none;
    position: relative;
    z-index: 24;
    overflow: visible;
    isolation: isolate;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}
.room-stage-nav::before {
    content: '';
    position: absolute;
    inset: -0.28rem -0.2rem;
    background: url('assets/images/Arrow.png') center / 100% 100% no-repeat;
    z-index: -1;
    pointer-events: none;
}
.room-stage-nav-prev {
    clip-path: none;
}
.room-stage-nav-next {
    clip-path: none;
}
.room-stage-nav-prev::before {
    transform: scaleX(-1);
}
.room-stage-nav-label {
    font-size: 1rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-wrap: balance;
    max-width: 8rem;
    text-align: center;
    position: relative;
    top: -0.3rem;
}
.room-stage-nav-arrow {
    display: none;
}
.room-stage-nav:hover,
.room-stage-nav:focus-visible {
    background: transparent;
    color: #fff7ea;
    transform: translateY(-1px);
}
.room-stage-nav[hidden] {
    display: none;
}
.room-stage-helper {
    display: none;
}
.kitchen-photo {
    display: block;
    width: 105%;
    height: 105%;
    width: 100%;
    object-fit: contain;
    object-position: 50% 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.kitchen-photo.is-custom {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(calc(-50% + var(--kitchen-photo-offset-x, 0px)), calc(-50% + var(--kitchen-photo-offset-y, 0px))) scale(var(--kitchen-photo-scale, 1));
}

.kitchen-photo.is-default-framed {
    transform: translate(calc(-50% + var(--kitchen-photo-offset-x, 0px)), calc(-50% + var(--kitchen-photo-offset-y, 0px))) scale(var(--kitchen-photo-scale, 1));
}

.kitchen-hotspot {
    position: absolute;
    z-index: 1;
    border: 0;
    border-radius: 0.9rem;
    background: transparent;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform-origin: center center;
}

.kitchen-hotspot:focus-visible {
    outline: 2px solid rgba(39, 49, 58, 0.72);
    outline-offset: 2px;
}

.kitchen-hotspot[data-hotspot="fridge-door"] {
    left: 77%;
    top: 14%;
    width: 20%;
    height: 42%;
}

.kitchen-hotspot[data-hotspot="top-cupboards"] {
    left: 22%;
    top: 4%;
    width: 72%;
    height: 32%;
}

.kitchen-hotspot[data-hotspot="bottom-cupboards"] {
    left: 14%;
    top: 56%;
    width: 80%;
    height: 36%;
}

.hotspot-meta {
    display: none;
}

.edit-mode .kitchen-hotspot {
    background: rgba(141, 151, 161, 0.18) !important;
    box-shadow: inset 0 0 0 2px rgba(108, 118, 128, 0.9) !important;
    cursor: grab;
    touch-action: none;
}

.edit-mode .kitchen-hotspot.selected-zone {
    background: rgba(141, 151, 161, 0.18) !important;
    box-shadow: 0 0 0 4px #ff8c00, 0 0 0 2px #fff !important;
}

.edit-mode .kitchen-hotspot::after {
    content: attr(data-name);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
    pointer-events: none;
}

.resize-handle,
.rotate-handle {
    display: none;
    position: absolute;
    touch-action: none;
    z-index: 2;
}

.resize-handle {
    right: -0.55rem;
    bottom: -0.55rem;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.65rem;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.95);
    cursor: se-resize;
}

.rotate-handle {
    left: 50%;
    top: -0.75rem;
    width: 1.1rem;
    height: 1.1rem;
    margin-left: -0.55rem;
    border-radius: 50%;
    background: #737c85;
    box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.95);
    cursor: grab;
}

.edit-mode .resize-handle,
.edit-mode .rotate-handle {
    display: block;
}

#subsection-panel {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + var(--safe-bottom));
    transform: translateX(-50%);
    z-index: 30;
    margin: 0;
    width: min(calc(100% - 1.8rem), 29rem);
    background: rgba(247, 248, 249, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.9rem;
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    max-height: min(72vh, calc(100vh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 2rem));
    overflow: hidden;
}

#subsection-panel.panel-expanded {
    max-height: none;
    overflow: visible;
}

.subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.subsection-title-row {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.subsection-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.subsection-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border: 1px solid rgba(65, 76, 87, 0.08);
    box-shadow: none;
    font-weight: 700;
    font-size: 1.2rem;
}

.subsection-action-btn.danger {
    color: #8d2d28;
}

.subsection-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#subsection-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.01em;
    color: #1d2730;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subsection-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.7rem;
    height: 2.7rem;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--text);
    border: 1px solid rgba(65, 76, 87, 0.08);
    box-shadow: none;
    flex: 0 0 auto;
}

.subsection-header .zone-add-btn {
    position: static;
    inset: auto;
    z-index: auto;
    right: auto;
    bottom: auto;
    font-size: 1.35rem;
    font-weight: 700;
}

.subsection-header .zone-add-btn.is-back {
    font-size: 1.2rem;
    background: rgba(243, 246, 247, 0.92);
}

.subsection-action-btn:hover,
.subsection-header .zone-add-btn:hover,
.subsection-icon-btn:hover {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: none;
}

#subsection-close,
#options-close-btn {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--text);
}

#list-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(65, 76, 87, 0.08);
}

#subsection-panel.panel-expanded #list-container,
#subsection-panel.panel-expanded #empty-list-msg {
    display: none;
}

#list-container:empty {
    display: none;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid rgba(65, 76, 87, 0.08);
}

.list-item:last-child {
    border-bottom: 0;
}

@media (max-width: 640px) {
    .subsection-header {
        align-items: flex-start;
    }

    #subsection-title {
        font-size: 1.18rem;
    }

    .subsection-header-actions {
        gap: 0.35rem;
    }

    .subsection-action-btn {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.2rem;
    }
}

.list-item-text {
    flex: 1 1 auto;
    min-width: 0;
}

.list-item-name {
    font-size: 0.96rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.list-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    flex: 0 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.list-item-icon-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(65, 76, 87, 0.08);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-muted);
    flex: 0 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.list-item-icon-edit:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
}

.list-item-qty {
    margin-top: 0.18rem;
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.45;
}

.delete-item-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
}

.delete-item-btn:hover {
    background: rgba(201, 91, 84, 0.15);
    color: #8d2d28;
}

#empty-list-msg {
    margin: 0;
    padding: 1.1rem 0.35rem 0.2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

#options-panel[hidden],
#subsection-panel[hidden] {
    display: none !important;
}

#options-panel {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    margin: 0 auto;
    width: min(100%, 34rem);
    min-height: min(calc(100vh - 0.45rem), 48rem);
    padding: 1rem 0.95rem calc(1rem + var(--safe-bottom));
    max-height: min(calc(100vh - 0.45rem), 48rem);
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--surface-panel-alt);
    border-top-left-radius: 1.35rem;
    border-top-right-radius: 1.35rem;
    border: 1px solid var(--border);
    border-bottom: 0;
    box-shadow: 0 -18px 40px rgba(70, 77, 84, 0.16);
    backdrop-filter: blur(16px);
    isolation: isolate;
}

@supports (height: 100svh) {
    #options-panel {
        min-height: min(calc(100svh - 0.45rem), 48rem);
        max-height: min(calc(100svh - 0.45rem), 48rem);
    }
}

#options-panel.layout-editing {
    inset: auto 0.75rem calc(0.75rem + var(--safe-bottom)) auto;
    width: auto;
    max-width: calc(100% - 1.5rem);
    min-height: 0;
    padding: 0.6rem;
    display: block;
    border-radius: 0;
    border-bottom: 1px solid rgba(65, 76, 87, 0.08);
}

#options-panel.layout-editing .options-header,
#options-panel.layout-editing .options-nav,
#options-panel.layout-editing .options-pane-copy {
    display: none;
}

#options-panel.layout-editing .options-pane {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

#options-panel.layout-editing .options-actions {
    flex-wrap: nowrap;
}

#options-panel.layout-editing .options-action-btn {
    min-height: 2.5rem;
    padding: 0 0.95rem;
}

@media (min-width: 980px) {
    body.desktop-web-layout .home-main {
        max-height: none;
        overflow: hidden;
    }

    .room-stage-toolbar {
        gap: 0.7rem;
    }

    .room-stage-nav {
        min-width: 10rem;
        min-height: 4.2rem;
        padding: 0.85rem 1.5rem;
    }

    .room-stage-nav-label {
        font-size: 0.94rem;
        max-width: 7.2rem;
        top: -0.24rem;
    }

    body.desktop-web-layout #kitchen-stage {
        width: min(calc(100vw - 3rem), 42rem);
        max-height: min(calc(100vh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 23rem), 38rem);
        max-height: min(calc(100svh - var(--header-h) - var(--safe-top) - var(--safe-bottom) - 23rem), 38rem);
    }

    body.desktop-web-layout .trolly-btn {
        width: 220px;
        height: 220px;
    }

    body.desktop-web-layout .meal-planner-btn {
        width: 195px;
        height: 195px;
    }

    body.desktop-web-layout #subsection-panel {
        bottom: calc(1.25rem + var(--safe-bottom));
        transform: none;
        max-width: calc(100vw - 3rem);
    }

    body.desktop-options-open #options-panel {
        inset: 0 auto 0 0;
        margin: 0;
        width: 19.5rem;
        height: auto;
        min-height: 100%;
        max-height: none;
        padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
        border: 1px solid rgba(65, 76, 87, 0.08);
        border-top-left-radius: 0;
        border-top-right-radius: 1.35rem;
        border-bottom-right-radius: 1.35rem;
        border-bottom-left-radius: 0;
        box-shadow: 18px 0 40px rgba(70, 77, 84, 0.16);
    }

    body.desktop-options-open .options-nav {
        grid-template-columns: 1fr;
    }

    body.desktop-options-open #subsection-panel {
        max-width: calc(100vw - 3rem);
    }
}

.options-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: -1rem -0.95rem 0.85rem;
    padding: 1rem 0.95rem 0.85rem;
    background: var(--surface-panel-alt);
}

.options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.45rem;
    background: transparent;
}

.options-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.options-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0;
}

.options-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    border-radius: 0.9rem;
    background: var(--surface-panel);
    color: var(--text);
    padding: 0.55rem 0.65rem;
}

.options-nav-btn.active {
    background: var(--accent);
    color: #ffffff;
}

.options-pane {
    min-height: 5rem;
    border-radius: 0;
    background: var(--surface-panel-soft);
    border: 1px solid var(--border);
    padding: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    position: relative;
    z-index: 1;
}

#options-pane-edit {
    min-height: 0;
    background: transparent;
    border: 0;
    padding: 0;
}

#options-pane-alerts,
#options-pane-cloud,
#options-pane-theme {
    min-height: 0;
    background: transparent;
    border: 0;
    padding: 0;
}

/* Ensure info-box inside options-pane fits naturally */
.options-pane .info-box {
    margin: 0 0 1.1em 0 !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.1em 1em 1.1em 1em;
    position: static;
}

.options-pane-copy {
    margin: 0 0 0.9rem;
}

.kitchen-photo-box-title {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    color: #27313a;
}

.kitchen-photo-controls {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.kitchen-photo-controls .options-action-btn {
    flex: 1 1 10rem;
}

.kitchen-photo-status {
    margin-top: 0.75rem;
}

#kitchen-photo-actions-modal.modal-overlay {
    align-items: flex-start !important;
    padding: calc(0.55rem + var(--safe-top, 0px)) 0.75rem calc(0.75rem + var(--safe-bottom, 0px)) !important;
    box-sizing: border-box;
    overflow-y: auto;
}

.kitchen-photo-actions-dialog {
    width: min(96vw, 32rem);
    max-width: 32rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0 auto;
    padding: 1rem;
}

.kitchen-photo-actions-copy {
    margin: 0;
    color: #5e6873;
    font-size: 0.92rem;
    line-height: 1.45;
}

.kitchen-photo-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.kitchen-photo-actions-grid .zone-detail-action-btn {
    min-height: 2.9rem;
}

.expiry-alert-controls {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.expiry-alert-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
}

.expiry-alert-field select {
    min-height: 2.35rem;
    padding: 0.42rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-panel);
    color: var(--text);
}

.expiry-alert-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.expiry-alert-status {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.cloud-sync-fields {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.cloud-sync-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
}

.cloud-sync-field[hidden] {
    display: none !important;
}

.cloud-sync-field-help {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.79rem;
    font-weight: 500;
    line-height: 1.4;
}

.cloud-sync-input,
.cloud-sync-textarea {
    width: 100%;
    min-height: 2.6rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface-panel);
    color: var(--text);
    box-sizing: border-box;
    font: inherit;
}

.cloud-sync-textarea {
    min-height: 6.4rem;
    resize: vertical;
}

.cloud-sync-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.cloud-sync-auth-actions {
    margin-top: 0.6rem;
}

.cloud-sync-actions .options-action-btn {
    flex: 1 1 10rem;
}

.cloud-sync-status {
    margin: 0.8rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.cloud-sync-status[data-tone="success"] {
    color: #2f6b45;
}

.cloud-sync-status[data-tone="error"] {
    color: #8d2d28;
}

.cloud-sync-status:empty {
    display: none;
}

.options-action-btn.is-locked {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

#options-pane-alerts .info-box {
    padding: 0.82em 0.8em 0.86em 0.8em;
    margin-bottom: 0 !important;
}

#options-pane-alerts .options-pane-copy {
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

#options-pane-alerts .options-action-btn {
    min-height: 2.35rem;
    padding: 0 0.82rem;
}

.options-update-panel {
    margin: 0 !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
    padding-top: 0.6rem;
}

.options-footer-spacer {
    flex: 1 1 auto;
    min-height: 0.95rem;
}

#options-panel.layout-editing .options-update-panel {
    display: none;
}

#options-panel.layout-editing .options-footer-spacer {
    display: none;
}

.options-update-build {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.options-update-build span {
    color: var(--text-muted);
    font-weight: 600;
}

.options-update-actions {
    display: flex;
    margin-top: 0.8rem;
}

.options-update-actions .options-action-btn {
    flex: 1 1 auto;
    min-height: 2.55rem;
}

.options-update-status {
    margin: 0.7rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.options-update-status[data-tone="success"] {
    color: #2f6b45;
}

.options-update-status[data-tone="error"] {
    color: #8d2d28;
}

.options-update-status:empty {
    display: none;
}

.theme-palette-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.theme-palette-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.8rem;
    border-radius: 1rem;
    background: var(--surface-panel);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
    text-align: left;
}

.theme-palette-btn.active {
    background: var(--surface-panel-soft);
    box-shadow: inset 0 0 0 2px var(--accent), 0 10px 22px rgba(65, 76, 87, 0.12);
}

.theme-palette-preview {
    display: flex;
    gap: 0.35rem;
}

.theme-palette-swatch {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-palette-label {
    font-size: 0.92rem;
    font-weight: 600;
}

.theme-palette-status {
    margin: 0.8rem 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.theme-font-copy {
    margin-top: 1rem;
}

.font-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.font-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.8rem;
    border-radius: 1rem;
    background: var(--surface-panel);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
    text-align: left;
}

.font-choice-btn.active {
    background: var(--surface-panel-soft);
    box-shadow: inset 0 0 0 2px var(--accent), 0 10px 22px rgba(65, 76, 87, 0.12);
}

.font-choice-sample {
    font-size: 1.55rem;
    line-height: 1;
}

.font-choice-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.font-choice-btn-clean {
    font-family: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

#options-panel .font-choice-btn-clean,
#options-panel .font-choice-btn-clean * {
    font-family: "Manrope", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.font-choice-btn-rounded {
    font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif !important;
}

#options-panel .font-choice-btn-rounded,
#options-panel .font-choice-btn-rounded * {
    font-family: "Nunito", "Trebuchet MS", "Segoe UI", sans-serif !important;
}

.font-choice-btn-serif {
    font-family: "Lora", Georgia, "Times New Roman", serif !important;
}

#options-panel .font-choice-btn-serif,
#options-panel .font-choice-btn-serif * {
    font-family: "Lora", Georgia, "Times New Roman", serif !important;
}

.font-choice-btn-italic {
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-style: italic !important;
    font-weight: 700 !important;
}

#options-panel .font-choice-btn-italic .font-choice-sample {
    font-size: 1.8rem !important;
}

#options-panel .font-choice-btn-italic .font-choice-label {
    font-size: 0.98rem !important;
}

#options-panel .font-choice-btn-italic,
#options-panel .font-choice-btn-italic * {
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-style: italic !important;
    font-weight: 700 !important;
}

.theme-palette-swatch-silver {
    background: #bcbdb9;
}

.theme-palette-swatch-silver-accent {
    background: #8d97a1;
}

.theme-palette-swatch-silver-card {
    background: #f4f6f8;
}

.theme-palette-swatch-sage {
    background: #b8c3b5;
}

.theme-palette-swatch-sage-accent {
    background: #7c927a;
}

.theme-palette-swatch-sage-card {
    background: #f3f7f1;
}

.theme-palette-swatch-coastal {
    background: #b1bec6;
}

.theme-palette-swatch-coastal-accent {
    background: #6e8ea1;
}

.theme-palette-swatch-coastal-card {
    background: #f1f6f9;
}

.theme-palette-swatch-terracotta {
    background: #c4b1a6;
}

.theme-palette-swatch-terracotta-accent {
    background: #b27a65;
}

.theme-palette-swatch-terracotta-card {
    background: #f8f4f0;
}

.theme-palette-swatch-lagoon {
    background: #9fcfd2;
}

.theme-palette-swatch-lagoon-accent {
    background: #2f8f9d;
}

.theme-palette-swatch-lagoon-card {
    background: #e8f7f7;
}

.theme-palette-swatch-sunburst {
    background: #e3b675;
}

.theme-palette-swatch-sunburst-accent {
    background: #d9822b;
}

.theme-palette-swatch-sunburst-card {
    background: #fbf1e2;
}

.options-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.options-actions[hidden] {
    display: none !important;
}

.options-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(65, 76, 87, 0.08);
}

.options-action-btn.secondary {
    display: none;
}

.options-action-btn.secondary.visible {
    display: inline-flex;
}

.options-action-btn.active {
    background: var(--accent);
    color: #ffffff;
}

.options-action-btn.danger {
    color: #8d2d28;
}

.options-action-btn.danger:not(:disabled) {
    background: rgba(201, 91, 84, 0.16);
    box-shadow: inset 0 0 0 1px rgba(201, 91, 84, 0.12);
}

.options-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

#kitchen-photo-editor-modal.modal-overlay {
    align-items: flex-start !important;
    padding: calc(0.55rem + var(--safe-top, 0px)) 0.75rem calc(0.75rem + var(--safe-bottom, 0px)) !important;
    box-sizing: border-box;
    overflow-y: auto;
}

.kitchen-photo-editor-dialog {
    width: min(96vw, 34rem);
    max-width: 34rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0 auto;
    padding: 1rem;
}

.kitchen-photo-editor-copy {
    margin: 0;
    color: #5e6873;
    font-size: 0.92rem;
    line-height: 1.45;
}

.kitchen-photo-editor-preview {
    border: 1px solid #d8dde2;
    border-radius: 1rem;
    background: linear-gradient(180deg, #eef2f4 0%, #f8f9fa 100%);
    padding: 0.6rem;
}

.kitchen-photo-editor-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 0.85rem;
    background: #d9dcde;
    touch-action: none;
    cursor: grab;
}

.kitchen-photo-editor-stage.is-dragging {
    cursor: grabbing;
}

.kitchen-photo-editor-image {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transform: translate(calc(-50% + var(--kitchen-photo-offset-x, 0px)), calc(-50% + var(--kitchen-photo-offset-y, 0px))) scale(var(--kitchen-photo-scale, 1));
}

.kitchen-photo-editor-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 0.85rem;
    pointer-events: none;
}

.kitchen-photo-editor-slider {
    width: 100%;
}

.kitchen-photo-editor-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kitchen-photo-editor-actions > button {
    flex: 1 1 9rem;
}

select {
    width: 100%;
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
}

select:focus-visible,
button:focus-visible {
    outline: 2px solid rgba(39, 49, 58, 0.66);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .app-header {
        gap: 0.45rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .app-title {
        font-size: 1.02rem;
    }

    .options-fab {
        min-width: 2.35rem;
        min-height: 2.35rem;
        padding: 0 0.7rem;
    }

    .header-install-btn {
        min-height: 2.35rem;
        padding: 0 0.85rem;
        font-size: 0.9rem;
    }

    .home-main {
        padding-top: 0;
    }

    .logo-container {
        margin-bottom: -3.4rem !important;
    }

    .logo-container img {
        max-height: 92px;
    }

    #kitchen-stage {
        width: min(100%, 23rem);
        height: min(60.5vh, 33rem);
        height: min(60.5svh, 33rem);
        border-radius: 1.2rem;
    }

    .room-stage-shell {
        gap: 0.08rem;
        margin-top: -2.35rem;
    }

    .room-stage-toolbar {
        gap: 0.6rem;
           margin-top: -2.4rem;
    }

    .room-stage-nav {
        min-width: 8.8rem;
        min-height: 3.95rem;
        padding: 0.76rem 1.3rem;
    }

    .room-stage-nav-label {
        font-size: 0.88rem;
        max-width: 6.6rem;
        top: -0.18rem;
    }

    .kitchen-buttons-row {
        min-height: 14rem;
    }

    #subsection-panel {
        width: min(calc(100% - 1rem), 24rem);
        bottom: calc(0.65rem + var(--safe-bottom));
    }

    #subsection-panel.panel-expanded {
        top: calc(0.5rem + var(--safe-top));
        bottom: calc(0.5rem + var(--safe-bottom));
        max-height: none;
        height: auto;
        overflow: hidden;
    }

    #subsection-panel.panel-expanded .zone-panel-addbox {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        height: 100%;
        overflow: hidden;
    }

    #subsection-panel.panel-expanded .zone-additem-shell {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    #subsection-panel.panel-expanded .zone-additem-suggestions {
        max-height: none;
        min-height: 7rem;
    }

    #options-panel {
        width: 100%;
    }

    #options-panel.layout-editing {
        inset: auto 0.5rem calc(0.5rem + var(--safe-bottom)) 0.5rem;
        width: auto;
        max-width: none;
    }

    .options-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #options-panel.layout-editing .options-actions {
        flex-wrap: wrap;
    }

    .kitchen-photo-controls .options-action-btn,
    .kitchen-photo-editor-actions > button {
        flex-basis: 100%;
    }

    .kitchen-photo-actions-grid {
        grid-template-columns: 1fr;
    }
}
