.calendar-cell.cell-generating {position:relative;cursor:wait}
.calendar-cell.cell-generating .cell-wrapper>:not(.generation-plus) {visibility:hidden}
.calendar-cell .generation-plus {display:inline-block!important;visibility:visible;animation:generation-spin 1s linear infinite;transform-origin:center}

.desktop-timeline-meal-card:hover,.desktop-timeline-slot-row:hover {background:var(--ff-bg-subtle)!important;color:var(--ff-text-primary)!important;border-color:var(--ff-border-strong);outline:none;box-shadow:none}
.desktop-timeline-meal-card:focus-visible {background:var(--ff-bg-subtle)!important;outline:2px solid var(--ff-text-secondary);outline-offset:2px}
.native-recipe-pane {width:520px;max-width:96vw;background:var(--ff-bg-app);font-family:FFSettingsRoboto,Roboto,Arial,sans-serif}
.native-recipe-pane h2,.native-recipe-pane strong,.native-recipe-pane summary,.native-recipe-pane button {font-family:FFSettingsRoboto,Roboto,Arial,sans-serif}
body.dark-theme .native-recipe-pane {--ff-bg-app:#101012;--ff-bg-surface:#19191f;--ff-bg-card:#202027;--ff-border:rgba(255,255,255,.12);--ff-border-strong:#33343a;--ff-text-primary:#f6f6f7;--ff-text-secondary:#b5b5c0;--ff-orange:#ff6b35}
.native-recipe-pane .schedule-quickview-header,.native-recipe-pane .recipe-drawer-header {background:var(--ff-bg-app);padding:22px 24px;border-bottom:1px solid var(--ff-border)}
.native-recipe-pane .schedule-quickview-title,.native-recipe-pane #recipe-drawer-title {color:var(--ff-orange);font-size:1.3rem}
.native-recipe-pane .schedule-quickview-body,.native-recipe-pane .recipe-drawer-body {display:block;padding:24px;overflow-y:auto;overflow-anchor:none}
.native-recipe-heading {display:flex;align-items:flex-start;gap:12px;justify-content:space-between}
.native-recipe-heading h2 {font-size:1.75rem;line-height:1.25;margin:0;font-weight:900}
.native-recipe-subtitle {font-size:1.3rem;font-weight:700;color:var(--ff-text-secondary);margin:16px 0 20px}
.native-recipe-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.native-recipe-metrics>div {display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:90px;border:1px solid var(--ff-border-strong);border-radius:14px;background:var(--ff-bg-surface);padding:12px 4px;gap:5px;text-align:center}
.native-recipe-metrics strong {font-size:1.8rem;color:var(--ff-orange);font-weight:900}
.native-recipe-metrics span,.native-recipe-macros strong {color:var(--ff-text-secondary);font-weight:700;font-size:1.05rem}
.native-recipe-macros {padding:14px;border:1px solid var(--ff-border-strong);border-radius:12px;background:var(--ff-bg-surface);margin-top:12px;text-align:center}
.native-recipe-macro-bar {display:flex;height:10px;overflow:hidden;border-radius:12px;margin-bottom:12px}
.native-recipe-macro-bar .protein {background:var(--ff-orange)}
.native-recipe-macro-bar .carbs {background:var(--ff-green)}
.native-recipe-macro-bar .fat {background:var(--ff-purple)}
.native-recipe-tags {display:flex;gap:8px;flex-wrap:wrap;padding:16px 0;border-bottom:1px solid var(--ff-border)}
.native-recipe-tags span {padding:4px 10px;border-radius:99px;border:1px solid var(--ff-border-strong);font-weight:700;font-size:1.05rem}
.native-recipe-tabs {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}
.native-recipe-tabs button {background:var(--ff-bg-card);color:var(--ff-text-secondary);border:0;border-radius:12px;padding:15px 6px;font:inherit;font-size:1.25rem;font-weight:900;cursor:pointer}
.native-recipe-tabs [aria-selected=true] {background:var(--ff-orange);color:#000}
.native-recipe-pane [role=tabpanel][hidden],.native-recipe-pane [hidden] {display:none!important}
.native-recipe-ingredients,.native-recipe-instructions {padding:0;list-style:none;margin:0}
.native-recipe-ingredients>li {background:var(--ff-bg-card);border-radius:12px;margin:12px 0;overflow:hidden}
.native-recipe-ingredients summary {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:15px 14px;font-size:1.5rem;font-weight:700;cursor:pointer;list-style:none}
.native-recipe-ingredients summary::-webkit-details-marker {display:none}
.native-recipe-ingredients summary img {width:22px;height:22px;transition:transform .15s ease}
.native-recipe-ingredients details[open] summary img {transform:rotate(180deg)}
.native-ingredient-details {padding:0 14px 16px;border-top:1px solid var(--ff-border)}
.native-ingredient-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}
.native-ingredient-metrics span {display:flex;flex-direction:column;color:var(--ff-text-secondary);font-size:.8rem;gap:5px}
.native-ingredient-metrics strong {color:var(--ff-text-primary);font-size:.92rem}
.native-ingredient-preferences {display:flex;gap:8px}
.native-ingredient-preferences button,.native-recipe-options button {padding:9px 12px;border:1px solid var(--ff-border-strong);border-radius:8px;background:var(--ff-bg-subtle);color:var(--ff-text-primary);font:inherit;cursor:pointer}
.native-ingredient-preferences [aria-pressed=true] {border-color:var(--ff-orange);color:var(--ff-orange)}
.native-recipe-instructions li {background:var(--ff-bg-surface);border:1px solid var(--ff-border-strong);border-radius:12px;margin:12px 0;padding:18px 16px;font-size:1.5rem;line-height:1.55}
.native-recipe-instructions li>strong {color:var(--ff-orange);font-size:1.4rem}
.native-recipe-instructions p {margin:14px 0 0}
.native-recipe-footer,.native-recipe-pane .schedule-quickview-footer {padding:16px 24px;background:var(--ff-bg-app);display:flex;flex-direction:row;justify-content:flex-end;border-top:1px solid var(--ff-border)}
.native-recipe-primary {border:0;border-radius:16px;padding:16px 24px;background:var(--ff-orange);color:#000;font:inherit;font-size:1.35rem;font-weight:900;cursor:pointer}
.native-recipe-pane .native-recipe-primary {width:max-content!important;flex:0 0 auto;min-width:156px}
.native-recipe-pane img {filter:invert(50%) sepia(98%) saturate(1893%) hue-rotate(338deg) brightness(105%) contrast(103%)}
.native-recipe-options {position:relative;flex-shrink:0}
.native-recipe-options summary {cursor:pointer;list-style:none;padding:4px}
.native-recipe-options summary::-webkit-details-marker {display:none}
.native-recipe-options summary img {width:26px;height:26px}
.native-recipe-options>div {position:absolute;right:0;top:100%;width:180px;z-index:5;background:var(--ff-bg-card);border:1px solid var(--ff-border-strong);padding:8px;border-radius:10px;box-shadow:0 6px 24px #0004;display:grid;gap:6px}
.native-cook-check {display:flex;gap:8px;padding:12px 14px;color:var(--ff-text-secondary);font-size:.95rem;align-items:center}
.native-cook-check input {appearance:auto!important;width:20px!important;height:20px!important;accent-color:var(--ff-orange)}
.native-recipe-unavailable {font-size:.85rem;color:var(--ff-text-secondary);margin:14px 0}
@media(prefers-reduced-motion:reduce){.calendar-cell .generation-plus{animation:none}.native-recipe-ingredients summary img{transition:none}}
/* Keep the recipe summary and tabs fixed; scroll only their content. */
.native-recipe-pane .schedule-quickview-body,.native-recipe-pane .recipe-drawer-body {display:flex;flex-direction:column;min-height:0;overflow:hidden;padding-bottom:0;gap:0}
.native-recipe-summary,.native-recipe-tabs {flex:0 0 auto}
.native-recipe-scroll {flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:16px;scrollbar-gutter:stable}
.native-recipe-ingredients>li {position:relative}
.native-recipe-ingredients summary {touch-action:pan-y;position:relative;background:var(--ff-bg-card);transition:transform .2s ease;user-select:none}
.native-preference-status {margin-left:auto;font-size:1.2rem}
.native-recipe-ingredients .ingredient-liked summary {background:color-mix(in srgb,var(--ff-green) 15%,var(--ff-bg-app))}
.native-recipe-ingredients .ingredient-disliked summary {background:color-mix(in srgb,#ff4768 15%,var(--ff-bg-app))}
.native-swipe-hint {display:none;position:absolute;inset:0;padding:16px;align-items:center;justify-content:flex-end;color:#ff4768;background:#ff476825;font-size:1.2rem;font-weight:700}
.ingredient-dragging .native-swipe-hint {display:flex}
.ingredient-dragging.swipe-like .native-swipe-hint {justify-content:flex-start;color:var(--ff-green);background:#09796925}
.ingredient-dragging summary {transform:translateX(var(--ingredient-drag));transition:none}
#recipe-list .recipe-tags [hidden] {display:none!important}
.recipe-tags-more {color:var(--ff-text-secondary);flex:0 0 auto;white-space:nowrap;padding:0 4px}
@media(prefers-reduced-motion:reduce){.native-recipe-ingredients summary{transition:none}}
.native-add-plan-dialog {width:440px;max-width:90vw;padding:24px;border:1px solid var(--ff-border);border-radius:16px;background:var(--ff-bg-surface);color:var(--ff-text-primary)}
.native-add-plan-dialog::backdrop {background:#0008}
.native-add-plan-dialog label {display:grid;gap:8px}
.native-add-plan-dialog select {width:100%;padding:12px;background:var(--ff-bg-card);color:var(--ff-text-primary);border:1px solid var(--ff-border);border-radius:8px}
.native-add-plan-dialog form>div {display:flex;justify-content:flex-end;gap:12px;margin-top:24px}
.native-add-plan-dialog button[type=submit] {background:var(--ff-orange);color:#000}
.native-preference-status {display:inline-flex;color:var(--ff-green);align-items:center}
.ingredient-disliked .native-preference-status {color:#ff4768}
.native-ingredient-source {font-size:.8rem;line-height:1.4;color:var(--ff-text-secondary);margin:10px 0}
.native-ingredient-macros {margin:12px 0}

.desktop-timeline-meal-card .generation-plus {animation:timeline-plus-spin 1s linear infinite;transform-origin:center;opacity:1}
@keyframes timeline-plus-spin {from{transform:translateY(-50%) rotate(0deg)}to{transform:translateY(-50%) rotate(360deg)}}
.schedule-event-add {display:grid;place-items:center;flex:1;width:100%;height:100%;padding:0;margin:0;align-self:stretch;background:transparent;color:var(--ff-green);font:inherit;border:0}
.schedule-event-add.batch-event-add {color:var(--ff-purple)}
.schedule-event-add:hover {background:var(--ff-bg-subtle)}
.calendar-cell.event-cell {display:flex;flex-direction:column;gap:4px}
@media(prefers-reduced-motion:reduce){.desktop-timeline-meal-card .generation-plus{animation:none}}

/* Desktop Shop/Batch editors follow the native form hierarchy. */
.desktop-plan-editor.modal {position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:min(720px,calc(100% - 48px));max-width:720px;height:min(860px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--ff-border);border-radius:18px;background:var(--ff-bg-app);color:var(--ff-text-primary);overflow:hidden;--editor-accent:var(--ff-green)}
.desktop-plan-editor.batch-plan-editor {--editor-accent:var(--ff-purple)}
.desktop-plan-editor .modal-content {display:flex;flex-direction:column;width:100%;height:100%;max-height:none;overflow:hidden;padding:0!important}
.plan-editor-header {display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;min-height:76px;padding:12px 20px;border-bottom:1px solid var(--ff-border);flex-shrink:0;box-sizing:border-box}
.desktop-plan-editor .plan-editor-header h2 {margin:0;font-size:1.35rem;color:var(--ff-text-primary);text-align:center}
.plan-editor-header button {background:transparent;color:var(--ff-text-secondary);font:inherit;font-weight:700;padding:10px 4px;justify-self:start}
.desktop-plan-editor .plan-editor-header button[type=submit] {justify-self:end;background:transparent;color:var(--editor-accent);border:0;font-size:1.05rem}
.plan-editor-body {flex:1;overflow:hidden;padding:28px 24px 24px;min-height:0;display:flex;flex-direction:column;gap:24px}
.plan-editor-body>:not(.plan-editor-allocation) {flex-shrink:0}
.plan-editor-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 18px}
.plan-editor-field {display:block;position:relative;min-width:0}
.plan-editor-field.field-wide {grid-column:1/-1}
.plan-editor-field>span {position:absolute;top:-.7em;left:12px;padding:0 6px;background:var(--ff-bg-app);color:var(--ff-text-secondary);font-size:.9rem;z-index:1}
.desktop-plan-editor .plan-editor-field :is(input,select) {display:block;width:100%;min-height:58px;box-sizing:border-box;border:1px solid var(--ff-border);border-radius:8px;background:transparent;color:var(--ff-text-primary);padding:14px 16px;font:inherit;font-size:1.05rem}
.desktop-plan-editor .plan-editor-field :is(input,select):focus-visible {outline:2px solid var(--editor-accent);outline-offset:1px}
.plan-editor-repeat {display:flex;align-items:center;justify-content:space-between;gap:20px;cursor:pointer}
.plan-editor-repeat>span {display:grid;gap:6px}
.plan-editor-repeat strong {font-size:1.05rem}
.plan-editor-repeat small {color:var(--ff-text-secondary);line-height:1.4}
.plan-editor-repeat input {appearance:none;width:46px;height:27px;min-width:46px;border:1px solid var(--ff-border);border-radius:20px;background:var(--ff-bg-subtle);position:relative;cursor:pointer}
.plan-editor-repeat input:after {content:'';position:absolute;width:19px;height:19px;top:3px;left:3px;background:var(--ff-text-secondary);border-radius:50%;transition:transform .15s ease}
.plan-editor-repeat input:checked {background:var(--editor-accent);border-color:var(--editor-accent)}
.plan-editor-repeat input:checked:after {transform:translateX(19px);background:#000}
.plan-editor-body h3 {margin:0;font-size:1.2rem}
.plan-editor-allocation {flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;display:grid;align-content:start;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:3px}
.plan-allocation-card {position:relative;display:flex;padding:16px;border:2px solid transparent;border-radius:12px;background:var(--ff-bg-subtle);cursor:pointer;min-width:0}
.plan-allocation-card>span {display:grid;gap:7px;min-width:0;line-height:1.35}
.plan-allocation-card small {color:var(--ff-text-secondary);font-size:.85rem}
.plan-allocation-card strong {font-size:1rem;overflow-wrap:anywhere}
.plan-allocation-card input {position:absolute;width:1px;height:1px;opacity:0}
.plan-allocation-card:has(input:checked) {border-color:var(--editor-accent);background:color-mix(in srgb,var(--editor-accent) 12%,var(--ff-bg-app))}
.plan-allocation-card:has(input:focus-visible) {outline:2px solid var(--editor-accent);outline-offset:2px}
.plan-allocation-card.allocation-locked {opacity:.55;cursor:default}
.plan-editor-error {margin:0;color:#ed4662}
.desktop-library-primary-row .desktop-add-custom-meal {margin-left:auto;flex-shrink:0}
@media(max-width:600px){.desktop-plan-editor.modal{width:calc(100% - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}.plan-editor-header{padding:10px 14px}.plan-editor-body{padding:26px 18px}.plan-editor-allocation{grid-template-columns:minmax(0,1fr)}}

.desktop-plan-editor #desktop-batch-save,.desktop-plan-editor #desktop-shop-save {background:transparent!important;color:var(--editor-accent)!important;border:0}
.desktop-plan-editor #desktop-batch-save:hover,.desktop-plan-editor #desktop-shop-save:hover {background:color-mix(in srgb,var(--editor-accent) 10%,transparent)!important;color:var(--editor-accent)!important}
/* Keep native-style editor accents above legacy dark modal/checkbox rules. */
body .desktop-plan-editor .plan-editor-field :is(input,select):focus {border-color:var(--editor-accent)!important;outline:2px solid var(--editor-accent)!important;outline-offset:1px;box-shadow:none!important}
body .desktop-plan-editor .plan-editor-repeat input[type=checkbox] {appearance:none!important;display:block!important;position:relative!important;width:46px!important;height:27px!important;min-width:46px!important;margin:0!important;padding:0!important;border:1px solid var(--ff-border)!important;border-radius:20px!important;background:var(--ff-bg-subtle)!important;box-shadow:none!important;outline-offset:3px}
body .desktop-plan-editor .plan-editor-repeat input[type=checkbox]::before {display:none!important;content:none!important}
body .desktop-plan-editor .plan-editor-repeat input[type=checkbox]::after {content:''!important;display:block!important;position:absolute!important;top:3px!important;left:3px!important;width:19px!important;height:19px!important;border:0!important;border-radius:50%!important;background:var(--ff-text-secondary)!important;transform:none!important;box-shadow:none!important}
body .desktop-plan-editor .plan-editor-repeat input[type=checkbox]:checked {background:var(--editor-accent)!important;border-color:var(--editor-accent)!important}
body .desktop-plan-editor .plan-editor-repeat input[type=checkbox]:checked::after {background:#000!important;transform:translateX(19px)!important}
body .desktop-plan-editor .plan-allocation-card {text-align:left!important}
body .desktop-plan-editor .plan-allocation-card {justify-content:flex-start!important;align-items:stretch!important}
body .desktop-plan-editor .plan-allocation-card>span {width:100%;text-align:left;justify-items:start}

/* Rotate the existing glyph about the centre of its cell, not its text baseline. */
.calendar-cell.empty-cell .cell-wrapper,
.calendar-cell.cell-generating .cell-wrapper {position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.calendar-cell.empty-cell {position:relative}
.calendar-cell .plus-icon {flex:0 0 auto;width:1em;height:1em;line-height:1;text-align:center}
.calendar-cell.cell-generating .cell-wrapper>:not(.generation-plus) {display:none}
