/* Gemeinsame Styles für Menüplan und Lieblingsessen */

.mp,
.sheet,
.ctx {
    --mp-accent: #ec4899;
    --mp-accent-dark: #db2777;
    --mp-soft: #fdf2f8;
    --mp-soft-2: #fce7f3;
    --mp-line: #fbcfe8;
    --mp-text: #1f2937;
    --mp-muted: #6b7280;
    --mp-card-shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 14px rgba(236, 72, 153, 0.08);
    --meal-breakfast: #d97706;
    --meal-lunch: #059669;
    --meal-dinner: #db2777;
    --meal-snack: #7c3aed;
}

.mp {
    min-height: calc(100vh - 80px);
    padding: 96px 20px 48px;
    background: linear-gradient(180deg, #fff5fa 0%, #ffffff 320px);
    color: var(--mp-text);
    /* Einblend-Animationen dürfen die Seite nie breiter als den Bildschirm machen */
    overflow-x: clip;
}

.mp-inner {
    max-width: 1180px;
    margin: 0 auto;
}

/* Kopfbereich */
.mp-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.mp-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--mp-text);
    margin: 0;
}

.mp-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
    color: var(--mp-muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.mp-group:visited {
    color: var(--mp-muted);
}

.mp-group i {
    color: var(--mp-accent);
}

.mp-week {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-week-label {
    text-align: center;
    min-width: 150px;
}

.mp-week-kw {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mp-accent);
}

.mp-week-range {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.mp-round-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--mp-line);
    background: #fff;
    color: var(--mp-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mp-round-btn:visited {
    color: var(--mp-accent);
}

.mp-round-btn:hover,
.mp-round-btn:active {
    background: var(--mp-soft);
}

.mp-today-btn {
    border: 1px solid var(--mp-line);
    background: #fff;
    color: var(--mp-accent);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0 0.9rem;
    height: 42px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.mp-today-btn:visited {
    color: var(--mp-accent);
}

/* Tages-Tabs (nur mobil) */
.mp-days {
    display: none;
}

/* Woche (Desktop): pro Tag eine Zeile mit den geplanten Gerichten */
.mp-day {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    border-radius: 18px;
}

.mp-day.is-today {
    border-color: var(--mp-line);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

.mp-day-head {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.2rem 0 0 0.2rem;
}

.mp-day-name {
    font-weight: 700;
    font-size: 1rem;
}

.mp-day-date {
    font-size: 0.85rem;
    color: var(--mp-muted);
}

.mp-day-badge {
    align-self: flex-start;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: var(--mp-accent);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
}

.mp-day-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.mp-day-items {
    display: contents;
}

.mp-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 52px;
    border: 1.5px dashed var(--mp-line);
    border-radius: 14px;
    background: transparent;
    color: var(--mp-muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mp-add:hover,
.mp-add:active {
    border-color: var(--mp-accent);
    color: var(--mp-accent);
    background: var(--mp-soft);
}

/* Gericht-Karte */
.meal-card {
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    border-radius: 14px;
    box-shadow: var(--mp-card-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.meal-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(17, 24, 39, 0.05), 0 10px 22px rgba(236, 72, 153, 0.14);
}

.meal-card:active {
    transform: scale(0.99);
}

.meal-card.just-saved {
    animation: mealSaved 1.6s ease;
}

@keyframes mealSaved {
    0% { box-shadow: 0 0 0 3px var(--mp-accent); }
    100% { box-shadow: var(--mp-card-shadow); }
}

.meal-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #111 center / cover no-repeat;
}

.meal-thumb.insta,
.detail-hero.insta {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 95%);
}

.meal-thumb-insta {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    color: #fff;
    font-size: 1.9rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.meal-thumb-insta small {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.detail-hero .meal-thumb-insta {
    font-size: 2.6rem;
}

.detail-hero .meal-thumb-insta small {
    font-size: 0.85rem;
}

.meal-thumb-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 0, 0, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.meal-body {
    padding: 0.65rem 0.75rem 0.7rem;
}

.meal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.meal-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--meal-color, var(--mp-muted));
}

.meal-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.meal-breakfast { --meal-color: var(--meal-breakfast); }
.meal-lunch { --meal-color: var(--meal-lunch); }
.meal-dinner { --meal-color: var(--meal-dinner); }
.meal-snack { --meal-color: var(--meal-snack); }

.meal-score {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mp-text);
}

.meal-score i {
    color: #f59e0b;
    font-size: 0.7rem;
}

.meal-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.meal-desc {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--mp-muted);
    line-height: 1.4;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.25rem 0.6rem 0.25rem 0.3rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--mp-soft);
    color: var(--mp-text);
    border: 1px solid var(--mp-soft-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-chip:visited {
    color: var(--mp-text);
}

.link-chip-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
    background: var(--mp-accent);
}

.link-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-youtube .link-chip-icon {
    background: #ff0000;
}

.type-instagram .link-chip-icon {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.type-recipe .link-chip-icon {
    background: #f59e0b;
}

/* Leerer Zustand */
.mp-empty {
    max-width: 480px;
    margin: 2rem auto;
    text-align: center;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
}

.mp-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--mp-soft);
    color: var(--mp-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.mp-empty p {
    color: var(--mp-muted);
    margin-bottom: 1.25rem;
}

.mp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    padding: 0 1.1rem;
    border-radius: 14px;
    border: none;
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mp-btn-primary {
    background: var(--mp-accent);
    color: #fff;
}

.mp-btn-primary:visited {
    color: #fff;
}

.mp-btn-primary:hover {
    background: var(--mp-accent-dark);
}

.mp-btn-ghost {
    background: var(--mp-soft);
    color: var(--mp-accent);
}

.mp-btn-danger {
    background: #fff1f2;
    color: #e11d48;
}

.mp-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Sheets (Bearbeiten + Details) */
.sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(17, 24, 39, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sheet.active {
    display: flex;
    animation: sheetFade 0.18s ease;
}

@keyframes sheetFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sheet-panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.25);
    overflow: hidden;
}

.sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.5rem;
}

.sheet-overline {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mp-accent);
}

.sheet-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--mp-text);
    overflow-wrap: anywhere;
}

.sheet-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--mp-soft);
    color: var(--mp-muted);
    font-size: 1rem;
    cursor: pointer;
}

.sheet-body {
    padding: 0.5rem 1.25rem 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sheet-foot {
    display: flex;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mp-soft-2);
    background: #fff;
}

.sheet-foot .mp-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 0.7rem;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .sheet-foot {
        gap: 0.45rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sheet-foot .mp-btn:not(.mp-btn-icon) i {
        display: none;
    }
}

.sheet-foot .mp-btn-icon {
    flex: 0 0 48px;
    padding: 0;
}

.field {
    margin-top: 1rem;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mp-muted);
    margin-bottom: 0.4rem;
}

.field input,
.field textarea {
    width: 100%;
    border: 1.5px solid var(--mp-soft-2);
    background: #fff;
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

.field-title input {
    font-size: 1.15rem;
    font-weight: 600;
}

.title-wrap {
    position: relative;
}

.suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 5;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
    padding: 0.3rem;
    max-height: 240px;
    overflow-y: auto;
}

.suggestions.open {
    display: block;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 0.6rem 0.65rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--mp-text);
    text-align: left;
    cursor: pointer;
}

.suggestion:hover,
.suggestion:active {
    background: var(--mp-soft);
}

.suggestion-title {
    flex: 1;
    min-width: 0;
}

.suggestion mark {
    background: none;
    color: var(--mp-accent);
    font-weight: 700;
}

.suggestion-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mp-muted);
}

.suggestion-score i {
    color: #f59e0b;
}

.field-hint {
    min-height: 1.1rem;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--mp-muted);
}

.field-hint i {
    color: var(--mp-accent);
}

.field textarea {
    min-height: 72px;
    resize: vertical;
}

.chip-row {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

.choice-chip {
    flex-shrink: 0;
    border: 1.5px solid var(--mp-soft-2);
    background: #fff;
    color: var(--mp-text);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.choice-chip.active {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    background: var(--mp-soft);
    padding: 0.25rem;
    border-radius: 14px;
}

.segmented button {
    border: none;
    background: transparent;
    border-radius: 11px;
    padding: 0.6rem 0.2rem;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mp-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.segmented button.active {
    background: #fff;
    color: var(--mp-accent);
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
}

.day-picker {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.3rem;
}

.day-picker button {
    border: 1.5px solid var(--mp-soft-2);
    background: #fff;
    border-radius: 12px;
    padding: 0.5rem 0;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mp-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.day-picker button.active {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.link-add-row {
    display: flex;
    gap: 0.5rem;
}

.link-add-row input {
    flex: 1;
    min-width: 0;
}

.link-add-btn {
    flex-shrink: 0;
    width: 52px;
    border-radius: 14px;
    border: none;
    background: var(--mp-accent);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}

.link-detect {
    min-height: 1.2rem;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--mp-muted);
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem;
    border: 1px solid var(--mp-soft-2);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    color: var(--mp-text);
}

.link-row:visited {
    color: var(--mp-text);
}

.link-row-media {
    flex-shrink: 0;
    width: 72px;
    height: 44px;
    border-radius: 9px;
    background: var(--mp-soft) center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.link-row-media.type-instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.link-row-media.type-recipe {
    background: #fef3c7;
    color: #b45309;
}

.link-row-media.type-other {
    background: var(--mp-soft-2);
    color: var(--mp-accent);
}

.link-row-text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.link-row-title {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-row-host {
    font-size: 0.75rem;
    color: var(--mp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-row-remove {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--mp-soft);
    color: var(--mp-muted);
    cursor: pointer;
}

.link-row-open {
    flex-shrink: 0;
    color: var(--mp-muted);
    font-size: 0.85rem;
    padding-right: 0.4rem;
}

/* Detailansicht */
.detail-hero {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    max-height: 240px;
    width: 100%;
    background: #111 center / cover no-repeat;
    flex-shrink: 0;
}

.detail-hero .meal-thumb-play {
    width: 56px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.detail-hero-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(17, 24, 39, 0.55);
    color: #fff;
    cursor: pointer;
}

.detail-desc {
    color: var(--mp-text);
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.detail-section {
    margin-top: 1.1rem;
}

.detail-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mp-muted);
    margin-bottom: 0.5rem;
}

.rating-card {
    background: var(--mp-soft);
    border-radius: 16px;
    padding: 0.9rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.rating-big {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--mp-text);
}

.rating-big small {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mp-muted);
}

.rating-summary-text {
    font-size: 0.85rem;
    color: var(--mp-muted);
    line-height: 1.35;
}

.rating-stars {
    color: #f59e0b;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.rate-label {
    margin: 0.9rem 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mp-muted);
}

.rate-row {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.25rem;
}

.rate-row button {
    aspect-ratio: 1;
    min-width: 0;
    border: 1.5px solid var(--mp-line);
    background: #fff;
    border-radius: 10px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--mp-text);
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.rate-row button.filled {
    background: var(--mp-accent);
    border-color: var(--mp-accent);
    color: #fff;
}

.member-ratings {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.member-rating {
    display: grid;
    grid-template-columns: 90px 1fr 28px;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
}

.member-rating-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-rating-bar {
    height: 8px;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.member-rating-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--mp-accent);
}

.member-rating-value {
    text-align: right;
    font-weight: 700;
}

.rating-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--mp-muted);
}

.rating-empty .mp-btn {
    min-height: 40px;
    font-size: 0.88rem;
}

.detail-history {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.history-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    color: var(--mp-text);
}

.history-pill i {
    color: var(--mp-accent);
}

.mp-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    z-index: 2500;
    background: #1f2937;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    width: max-content;
    max-width: calc(100% - 32px);
    text-align: center;
}

.mp-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.mp-sheet-open {
    overflow: hidden;
}

@media (max-width: 1024px) and (min-width: 769px) {
    .mp-day {
        grid-template-columns: 100px minmax(0, 1fr);
    }
}

/* ---------- iPhone / mobil ---------- */
@media (max-width: 768px) {
    .mp {
        padding: 76px 0 calc(32px + env(safe-area-inset-bottom));
        background: #fff;
    }

    .mp-inner {
        padding: 0 16px;
    }

    .mp-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.9rem;
        margin-bottom: 0.9rem;
    }

    .mp-title {
        font-size: 1.75rem;
    }

    .mp-week {
        justify-content: space-between;
        background: var(--mp-soft);
        border-radius: 16px;
        padding: 0.3rem;
    }

    .mp-week .mp-round-btn {
        border: none;
        background: #fff;
        border-radius: 12px;
        width: 44px;
        height: 44px;
    }

    .mp-week-label {
        flex: 1;
        min-width: 0;
    }

    .mp-today-btn {
        height: 44px;
        border: none;
        border-radius: 12px;
    }

    .mp-days {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.3rem;
        margin-bottom: 1rem;
    }

    .mp-day-tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.05rem;
        padding: 0.5rem 0 0.65rem;
        border: none;
        border-radius: 14px;
        background: transparent;
        color: var(--mp-text);
        font: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .mp-day-tab-name {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--mp-muted);
    }

    .mp-day-tab-date {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .mp-day-tab.is-today .mp-day-tab-date {
        color: var(--mp-accent);
    }

    .mp-day-tab-dot {
        position: absolute;
        bottom: 5px;
        width: 5px;
        height: 5px;
        border-radius: 50%;
    }

    .mp-day-tab.has-items .mp-day-tab-dot {
        background: var(--mp-line);
    }

    .mp-day-tab.active {
        background: var(--mp-accent);
    }

    .mp-day-tab.active .mp-day-tab-name,
    .mp-day-tab.active .mp-day-tab-date {
        color: #fff;
    }

    .mp-day-tab.active.has-items .mp-day-tab-dot {
        background: #fff;
    }

    .mp-day {
        display: none;
        padding: 0;
        margin: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .mp-day.active {
        display: block;
        animation: dayIn 0.2s ease;
    }

    .mp-day.is-today {
        box-shadow: none;
    }

    @keyframes dayIn {
        from { opacity: 0; transform: translateY(4px); }
        to { opacity: 1; transform: none; }
    }

    .mp-day-head {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
        padding: 0 0 0.75rem;
    }

    .mp-day-name {
        font-size: 1.3rem;
    }

    .mp-day-badge {
        align-self: center;
        margin-top: 0;
    }

    .mp-day-body {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
    }

    .mp-add {
        min-height: 54px;
        font-size: 0.95rem;
    }

    .meal-card {
        border-radius: 16px;
    }

    .meal-card:hover {
        transform: none;
    }

    .meal-card.has-thumb {
        display: flex;
    }

    .meal-card.has-thumb .meal-thumb {
        flex: 0 0 116px;
        aspect-ratio: auto;
        min-height: 88px;
    }

    .meal-card.has-thumb .meal-body {
        flex: 1;
        min-width: 0;
    }

    .meal-card .meal-thumb-insta {
        font-size: 1.5rem;
    }

    .meal-card .meal-thumb-insta small {
        font-size: 0.65rem;
    }

    .meal-card .meal-thumb-play {
        width: 34px;
        height: 24px;
        border-radius: 7px;
        font-size: 0.7rem;
    }

    .meal-body {
        padding: 0.8rem 0.9rem 0.85rem;
    }

    .meal-title {
        font-size: 1.05rem;
    }

    .meal-desc {
        font-size: 0.88rem;
    }

    .link-chip {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    }

    .link-chip-icon {
        width: 22px;
        height: 22px;
    }

    .sheet {
        align-items: flex-end;
        padding: 0;
    }

    .sheet-panel {
        max-width: none;
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 22px 22px 0 0;
        animation: sheetUp 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    @keyframes sheetUp {
        from { transform: translateY(100%); }
        to { transform: none; }
    }

    .sheet-panel::before {
        content: '';
        position: absolute;
        top: 0.5rem;
        left: 50%;
        z-index: 2;
        width: 38px;
        height: 5px;
        margin-left: -19px;
        border-radius: 3px;
        background: rgba(229, 231, 235, 0.9);
    }

    .sheet-head {
        padding-top: 1.4rem;
    }

    .detail-hero {
        max-height: none;
    }

    .detail-hero + .sheet-head {
        padding-top: 1rem;
    }
}

/* ---------- Bild wählen: Verlauf aller gezeichneten Bilder (Einkauf, Gerichte, Dates) ---------- */

.ic-hint {
    margin: 0 0 0.9rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--mp-muted);
}

.ic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.ic-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.4rem 0.6rem;
    border: 2px solid var(--mp-soft-2);
    border-radius: 18px;
    background: #fff;
    font: inherit;
    color: var(--mp-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background-color 0.2s ease;
}

.ic-choice:active {
    transform: scale(0.95);
}

.ic-choice.is-active {
    border-color: var(--mp-accent);
    background: var(--mp-soft);
}

/* Haken beim gewählten Bild */
.ic-choice.is-active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mp-accent);
    color: #fff;
    font-size: 0.65rem;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.ic-choice.is-busy {
    opacity: 0.5;
}

.ic-pic {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ic-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ic-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--mp-muted);
    white-space: nowrap;
}

.ic-choice.is-active .ic-label {
    color: var(--mp-accent-dark);
}

.ic-choice.is-pending {
    border-style: dashed;
    cursor: default;
}

.ic-choice.is-pending .ic-pic {
    border-radius: 50%;
    background: var(--mp-soft-2);
}

.ic-loading,
.ic-empty {
    grid-column: 1 / -1;
    padding: 1.4rem 0;
    text-align: center;
    color: var(--mp-muted);
    font-size: 0.9rem;
}

#imagePickerRedraw {
    flex: 1;
}

/* Eigene Beschreibung fürs neue Bild (über «Neu zeichnen», bleibt sichtbar, auch wenn der Verlauf scrollt) */
.ic-wish {
    padding: 0.75rem 1.25rem 0;
    border-top: 1px solid var(--mp-soft-2);
    background: #fff;
}

.ic-wish-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mp-muted);
}

.ic-wish-label i {
    margin-right: 0.2rem;
    color: var(--mp-accent);
    font-size: 0.75rem;
}

.ic-wish-label span {
    font-weight: 500;
    opacity: 0.75;
}

.ic-wish input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    border: 1.5px solid var(--mp-soft-2);
    background: #fff;
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ic-wish input:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

.ic-wish input:disabled {
    opacity: 0.6;
}

.ic-wish + .sheet-foot {
    border-top: 0;
}

/* Beschreibung unter einem Bild im Verlauf */
.ic-note {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    color: var(--mp-muted);
    opacity: 0.85;
}

/* ---------- KI-Bild wird gerade gezeichnet ----------
   Gleicher Effekt überall (Einkauf, Gerichte, Dates): der Platzhalter atmet und leuchtet rosa, ohne Text. */

.ai-drawing {
    animation: aiDrawing 1.6s ease-in-out infinite;
}

@keyframes aiDrawing {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.9);
        filter: drop-shadow(0 0 0 rgba(236, 72, 153, 0));
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
        filter: drop-shadow(0 0 9px rgba(236, 72, 153, 0.6));
    }
}

/* Fertiges Bild springt sanft herein */
.ai-arrived {
    animation: aiArrived 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes aiArrived {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ai-drawing {
        animation-duration: 3s;
    }
}

/* ---------- Seitenkopf der Tab-Seiten: Gruppe links, runde Knöpfe rechts ----------
   Die gleichen Knöpfe stehen als .mp-sticky-tool in der Suchleiste und gleiten dort hinein,
   sobald der Kopf weggescrollt ist. Einkaufsliste, Essen und Dates nutzen genau das. */

.mp-top.mp-top-app {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.mp-top-app > :first-child {
    min-width: 0;
}

.mp-top-app .mp-group {
    margin-top: 0;
    font-weight: 600;
}

.mp-top-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-icon-btn {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: var(--mp-soft-2);
    color: var(--mp-accent-dark);
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.mp-icon-btn:active {
    transform: scale(0.9);
}

.mp-icon-btn-primary {
    background: var(--mp-accent);
    color: #fff;
}

/* Kleine Zahl oben rechts, z.B. offene Gerichte */
.mp-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--mp-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

.mp-sticky-tool .mp-badge {
    top: 4px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 0.6rem;
    line-height: 15px;
}

.mp-badge[hidden] {
    display: none;
}

.mp-icon-btn.rolling i,
.mp-sticky-tool.rolling i {
    animation: mp-roll 0.6s ease-in-out infinite;
}

@keyframes mp-roll {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ---------- Suchleiste, die oben kleben bleibt und beim Scrollen kompakt wird ---------- */

.mp-sticky {
    --mp-sticky-top: 84px;
    position: sticky;
    top: var(--mp-sticky-top);
    z-index: 40;
    margin-bottom: 1rem;
    /* Die Höhe bleibt beim Verkleinern gleich, damit die Seite nicht springt; freie Fläche lässt Taps durch */
    pointer-events: none;
}

.mp-sticky-bar {
    min-width: 0;
    pointer-events: auto;
    border: 1px solid transparent;
    border-radius: 22px;
    transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.mp-sticky.is-stuck .mp-sticky-bar {
    padding: 6px;
    background-color: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        0 10px 30px rgba(17, 24, 39, 0.12),
        0 2px 8px rgba(236, 72, 153, 0.08);
}

.mp-sticky-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-sticky-row > :first-child {
    flex: 1;
    min-width: 0;
}

.mp-sticky.is-stuck .mp-sticky-row input {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    border-radius: 16px;
}

/* Kleine runde Knöpfe, die erst im kompakten Zustand hereinschwappen */
.mp-sticky-tool {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 42px;
    margin-left: -0.5rem;
    padding: 0;
    border: none;
    border-radius: 14px;
    background: var(--mp-soft-2);
    color: var(--mp-accent-dark);
    font-size: 1rem;
    opacity: 0;
    transform: scale(0.5);
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        margin 0.35s ease,
        opacity 0.2s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.2s ease;
}

.mp-sticky.is-stuck .mp-sticky-tool {
    width: 42px;
    margin-left: 0;
    opacity: 1;
    transform: none;
}

.mp-sticky-tool:active {
    transform: scale(0.9) !important;
}

.mp-sticky-tool-primary {
    background: var(--mp-accent);
    color: #fff;
}

.mp-sticky.show-extra .mp-sticky-tool[data-sticky-toggle] {
    background: var(--mp-accent);
    color: #fff;
}

/* Punkt, wenn ein Filter aktiv ist */
.mp-sticky-tool[data-sticky-toggle].has-filter::after {
    content: '';
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mp-accent);
    box-shadow: 0 0 0 2px #fff;
}

.mp-sticky.show-extra .mp-sticky-tool[data-sticky-toggle].has-filter::after {
    background: #fff;
    box-shadow: none;
}

.mp-sticky-extra {
    display: grid;
    /* minmax(0, …): breite Filterreihen dürfen die Leiste nicht über den Bildschirm hinaus drücken */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    margin-top: 0.75rem;
    transition: grid-template-rows 0.3s ease, margin 0.3s ease, opacity 0.2s ease;
}

.mp-sticky-extra > * {
    min-height: 0;
    min-width: 0;
}

.mp-sticky.is-stuck .mp-sticky-extra > * {
    overflow: hidden;
}

.mp-sticky.is-stuck .mp-sticky-extra {
    margin-top: 0.45rem;
}

.mp-sticky.is-stuck:not(.show-extra) .mp-sticky-extra {
    grid-template-rows: 0fr;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .mp-sticky {
        --mp-sticky-top: 76px;
    }

    body.has-tabbar .mp-sticky {
        --mp-sticky-top: calc(8px + env(safe-area-inset-top));
    }
}

/* ---------- Menüplan als feste App-Ansicht auf dem Handy ---------- */

@media (max-width: 768px) {
    html:has(.mp-plan),
    body:has(.mp-plan) {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .mp.mp-plan {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
        overflow: hidden;
        /* Senkrecht scrollt nur die Liste, waagrecht wischt man die Tage */
        touch-action: pan-y;
    }

    .mp-plan .mp-inner {
        flex: 1;
        min-height: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .mp-plan .mp-top,
    .mp-plan .mp-days {
        flex: none;
    }

    .mp-plan .mp-days {
        margin-bottom: 0.4rem;
    }

    .mp-plan #menuGrid {
        flex: 1;
        min-height: 0;
        margin: 0 -16px;
        padding: 0.6rem 16px calc(var(--app-tabbar-height, 64px) + 48px + env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mp-plan .mp-day.active {
        animation: none;
        will-change: transform;
    }

    .mp-plan .mp-day-body {
        align-items: stretch;
    }

    /* Der Tagestitel bleibt beim Scrollen der Liste oben stehen */
    .mp-plan .mp-day-head {
        position: sticky;
        top: -0.6rem;
        z-index: 2;
        margin: -0.6rem -16px 0;
        padding: 0.6rem 16px 0.75rem;
        background: linear-gradient(180deg, #fff 75%, rgba(255, 255, 255, 0));
    }
}

/* ---------- Langes Drücken: Kontextmenü wie beim iPhone ---------- */

.ui-card,
.meal-card,
.vp-card,
.vp-activity,
.vp-pack-item {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.meal-card a {
    -webkit-touch-callout: none;
}

/* Beim Gedrückthalten leicht kleiner werden, bevor das Menü aufgeht */
.mp .pressing {
    transform: scale(0.96) !important;
    transition: transform 0.45s ease !important;
}

.ctx {
    position: fixed;
    inset: 0;
    z-index: 2100;
    color: var(--mp-text);
    -webkit-user-select: none;
    user-select: none;
}

.ctx-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.2);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ctx.open .ctx-backdrop {
    opacity: 1;
}

.ctx-preview {
    position: fixed;
    margin: 0;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.ctx.open .ctx-preview {
    transform: scale(1.03);
    box-shadow: 0 22px 50px rgba(17, 24, 39, 0.25);
}

.ctx.closing .ctx-preview {
    transform: none;
    box-shadow: none;
}

.ctx-menu {
    position: fixed;
    width: 250px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    backdrop-filter: blur(30px) saturate(190%);
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}

.ctx.open .ctx-menu {
    opacity: 1;
    transform: none;
}

.ctx.closing .ctx-menu {
    opacity: 0;
    transform: scale(0.8);
    transition-duration: 0.18s;
}

.ctx-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-bottom: 0.5px solid rgba(17, 24, 39, 0.12);
    background: none;
    color: inherit;
    font: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ctx-menu button:last-child {
    border-bottom: none;
}

.ctx-menu button:active {
    background: rgba(17, 24, 39, 0.07);
}

.ctx-menu button i {
    width: 1.2rem;
    text-align: center;
    opacity: 0.85;
}

.ctx-menu .ctx-gap {
    height: 7px;
    background: rgba(17, 24, 39, 0.06);
}

.ctx-menu .ctx-danger {
    color: #e11d48;
}

@media (prefers-reduced-motion: reduce) {
    .ctx-preview,
    .ctx-menu,
    .mp .pressing {
        transition: none;
    }
}

/* ---------- Gericht-Ansicht (Menüplan und Lieblingsessen) ---------- */

.week-toggle {
    grid-template-columns: repeat(2, 1fr) !important;
}

.day-picker button small {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.8;
}

.day-picker button:disabled {
    opacity: 0.35;
    cursor: default;
}

.dish-sheet .dish-scroll {
    padding: 0;
    flex: 1 1 auto;
}

.dish-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--mp-soft);
    color: var(--mp-muted);
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.has-hero .dish-close {
    background: rgba(17, 24, 39, 0.45);
    color: #fff;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.dish-hero {
    max-height: 260px;
}

.dish-head {
    padding: 1rem 1.25rem 0;
}

.dish-head.no-hero {
    padding-top: 1.4rem;
    padding-right: 3.75rem;
}

.dish-head h2 {
    margin: 0.15rem 0 0;
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--mp-text);
    overflow-wrap: anywhere;
}

.dish-facts {
    display: flex;
    gap: 0.4rem;
    margin: 0.7rem -1.25rem 0;
    padding: 0 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.dish-facts::-webkit-scrollbar {
    display: none;
}

.dish-fact {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: var(--mp-soft);
    color: var(--mp-text);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.dish-fact i {
    color: var(--mp-accent);
    font-size: 0.75rem;
}

.dish-fact .fa-star,
.dish-fact .fa-trophy {
    color: #f59e0b;
}

.dish-fact small {
    font-weight: 500;
    color: var(--mp-muted);
    margin-left: -0.25rem;
}

.dish-fact.is-muted {
    color: var(--mp-muted);
    font-weight: 500;
}

.dish-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 1rem 1.25rem 0;
}

.dish-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 64px;
    padding: 0.6rem 0.25rem;
    border: none;
    border-radius: 16px;
    background: var(--mp-soft);
    color: var(--mp-accent);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.dish-action:visited {
    color: var(--mp-accent);
}

.dish-action i {
    font-size: 1.15rem;
}

.dish-action span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dish-action.is-primary,
.dish-action.is-primary:visited {
    background: var(--mp-accent);
    color: #fff;
}

.dish-action.is-primary span {
    color: #fff;
}

.dish-action:active,
.dish-mini:active,
.dish-delete:active {
    transform: scale(0.95);
}

.dish-body {
    padding: 0.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
}

.dish-desc {
    margin-top: 1rem;
}

.dish-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--mp-muted);
}

.dish-note i {
    color: var(--mp-accent);
    margin-right: 0.2rem;
}

.dish-planned {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.6rem 0.6rem 0.75rem;
    border: 1px solid var(--mp-soft-2);
    border-radius: 16px;
    background: #fff;
}

.dish-planned-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--mp-soft);
    color: var(--mp-accent);
}

.dish-planned-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--mp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dish-mini {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 36px;
    padding: 0 0.8rem;
    border: none;
    border-radius: 10px;
    background: var(--mp-soft);
    color: var(--mp-accent);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.dish-mini.is-danger {
    width: 36px;
    padding: 0;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
}

.dish-meta {
    margin-top: 1.1rem;
    font-size: 0.8rem;
    color: var(--mp-muted);
}

.dish-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 46px;
    margin-top: 1rem;
    border: none;
    border-radius: 14px;
    background: #fef2f2;
    color: #dc2626;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

@media (max-width: 768px) {
    .dish-hero {
        max-height: none;
    }

    .dish-sheet .sheet-panel::before {
        background: rgba(255, 255, 255, 0.85);
    }

    .dish-sheet .sheet-panel:not(.has-hero)::before {
        background: rgba(229, 231, 235, 0.9);
    }
}

@media (max-width: 360px) {
    .dish-actions {
        gap: 0.35rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .dish-action span {
        font-size: 0.68rem;
        letter-spacing: -0.01em;
    }
}

/* ---------- Einheitliche Karte für alle Listen (Menüplan, Lieblingsessen, Dateideen, Ferien) ---------- */

.ui-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.6rem;
}

.ui-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.75rem 0.6rem 0.6rem;
    border: 1px solid var(--mp-soft-2);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--mp-card-shadow);
    color: var(--mp-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    animation: uiCardIn 0.3s ease both;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

@keyframes uiCardIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.ui-card:hover {
    box-shadow: 0 2px 4px rgba(17, 24, 39, 0.05), 0 10px 24px rgba(236, 72, 153, 0.14);
}

.ui-card:active,
.ui-card.pressing {
    transform: scale(0.98);
}

.ui-card:focus-visible {
    outline: 2px solid var(--mp-accent);
    outline-offset: 2px;
}

.ui-card.just-saved {
    animation: uiCardSaved 0.9s ease;
}

@keyframes uiCardSaved {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5); }
    100% { box-shadow: 0 0 0 12px rgba(236, 72, 153, 0); }
}

.ui-card-media {
    position: relative;
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-tone, linear-gradient(135deg, #f9a8d4, #ec4899)) center / cover no-repeat;
    color: #fff;
    font-size: 1.35rem;
    overflow: visible;
}

.ui-card-media.has-image {
    background-color: #111;
}

.ui-card-media.has-image > i {
    display: none;
}

.ui-card-media .ui-play {
    width: 28px;
    height: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    font-size: 0.6rem;
}

.ui-card-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--mp-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-card-badge.rank-1 { background: #fbbf24; }
.ui-card-badge.rank-2 { background: #9ca3af; }
.ui-card-badge.rank-3 { background: #d97706; }

.ui-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ui-card-over {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-over, var(--mp-accent));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--mp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    hyphens: auto;
}

.ui-card-sub {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--mp-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-card-end {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.2rem;
    text-align: right;
}

.ui-score {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--mp-text);
}

.ui-score i {
    color: #f59e0b;
    font-size: 0.75rem;
}

.ui-score.is-new {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mp-muted);
}

.ui-end-note {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mp-muted);
}

.ui-end-note.is-todo {
    color: var(--mp-accent);
}

.ui-chevron {
    color: #d1d5db;
    font-size: 0.85rem;
}

.ui-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--mp-soft);
    color: #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}

.ui-icon-btn.active {
    color: var(--mp-accent);
}

.ui-icon-btn:active {
    transform: scale(0.85);
}

.ui-card.is-past .ui-card-media {
    filter: saturate(0.55);
    opacity: 0.85;
}

/* Farbtöne für Bild-Platzhalter und Überzeile */
.ui-tone-pink { --ui-tone: linear-gradient(135deg, #f9a8d4, #ec4899); --ui-over: #db2777; }
.ui-tone-rose { --ui-tone: linear-gradient(135deg, #f472b6, #db2777); --ui-over: #db2777; }
.ui-tone-amber { --ui-tone: linear-gradient(135deg, #fde68a, #fb923c); --ui-over: #d97706; }
.ui-tone-green { --ui-tone: linear-gradient(135deg, #6ee7b7, #059669); --ui-over: #059669; }
.ui-tone-violet { --ui-tone: linear-gradient(135deg, #c4b5fd, #7c3aed); --ui-over: #7c3aed; }
.ui-tone-blue { --ui-tone: linear-gradient(135deg, #bfdbfe, #6366f1); --ui-over: #4f46e5; }
.ui-tone-sky { --ui-tone: linear-gradient(135deg, #38bdf8, #6366f1); --ui-over: #0284c7; }
.ui-tone-teal { --ui-tone: linear-gradient(135deg, #34d399, #0d9488); --ui-over: #0d9488; }
.ui-tone-insta { --ui-tone: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); --ui-over: #db2777; }
.ui-tone-muted { --ui-over: var(--mp-muted); }

@media (max-width: 768px) {
    .ui-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

.ui-icon-btn.pop {
    animation: uiPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes uiPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Suchfeld in der klebenden Leiste */
.mp-search {
    position: relative;
}

.mp-search i {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mp-muted);
}

.mp-search input {
    width: 100%;
    border: 1.5px solid var(--mp-soft-2);
    background: #fff;
    border-radius: 14px;
    padding: 0.8rem 0.9rem 0.8rem 2.6rem;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
}

.mp-search input:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

/* ---------- Zutaten im Gericht: Tabelle mit Bildern ---------- */

.dish-ing-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dish-ing-count:not(:empty) {
    min-width: 1.4rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--mp-soft-2);
    color: var(--mp-accent-dark);
    font-size: 0.72rem;
    text-align: center;
    letter-spacing: 0;
}

.ing-table {
    border: 1px solid var(--mp-soft-2);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--mp-card-shadow);
    overflow: hidden;
}

/* Werkzeugzeile über der Tabelle: Status links, «Bearbeiten» rechts */
.ing-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: -0.15rem 0 0.5rem;
    min-height: 0;
}

.ing-tools:empty {
    display: none;
}

.ing-tools-hint {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--mp-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ing-tools-hint i {
    color: #16a34a;
}

.ing-tools-hint.is-manage i {
    color: #ef4444;
}

.ing-tool {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 32px;
    padding: 0 0.8rem;
    border: 1px solid var(--mp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--mp-accent-dark);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ing-tool.is-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.ing-tool.is-primary {
    border-color: var(--mp-accent);
    background: var(--mp-accent);
    color: #fff;
}

/* Eine Zeile: vorne die Zutat, dahinter (beim Wischen sichtbar) «Entfernen» */
.ing-row {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f3f4f6;
    background: #ef4444;
    max-height: 220px;
}

.ing-row-behind {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    padding-right: 1.2rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.ing-row.is-armed .ing-row-behind {
    opacity: 1;
}

.ing-row.is-armed .ing-row-behind i {
    transform: scale(1.2);
}

.ing-row-front {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 56px;
    padding: 0.4rem 0.5rem 0.4rem 0.7rem;
    background: #fff;
    color: var(--mp-text);
    touch-action: pan-y;
    transition: transform 0.22s ease, background 0.15s ease;
}

.ing-row.is-swiping .ing-row-front {
    transition: none;
}

.ing-row.is-leaving {
    max-height: 0;
    transition: max-height 0.2s ease 0.1s;
}

.ing-row.is-on-list .ing-row-front {
    background: #f7fdf9;
}

.ing-row.is-new .ing-row-front {
    animation: ing-row-in 0.5s ease;
}

@keyframes ing-row-in {
    from { background: var(--mp-soft-2); }
    to { background: #fff; }
}

.ing-row-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #fafafa;
}

.ing-row-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.ing-row-icon .ing-letter {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
}

/* Name antippen = Name ändern */
.ing-row-tap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.05rem;
    align-self: stretch;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ing-row-name {
    max-width: 100%;
    font-size: 0.98rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ing-row-sub {
    max-width: 100%;
    font-size: 0.74rem;
    color: #16a34a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Menge antippen = Menge ändern */
.ing-row-qty-btn {
    flex: none;
    max-width: 38%;
    display: flex;
    align-items: center;
    align-self: stretch;
    padding: 0 0.15rem;
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ing-row-qty {
    max-width: 100%;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--mp-soft);
    color: var(--mp-accent-dark);
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ing-row-qty.is-empty {
    background: none;
    border: 1px dashed #e5e7eb;
    color: #b6bcc6;
    font-weight: 500;
}

.ing-row-qty-btn:active .ing-row-qty {
    background: var(--mp-soft-2);
}

/* Wagen: auf die Einkaufsliste / ist schon drauf */
.ing-cart {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--mp-line);
    border-radius: 14px;
    background: #fff;
    color: var(--mp-accent);
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ing-cart:active {
    transform: scale(0.9);
}

.ing-cart.is-on {
    border-color: #22c55e;
    background: #22c55e;
    color: #fff;
}

.ing-cart:disabled {
    opacity: 0.6;
}

/* Bearbeiten-Modus: rotes Minus vorne, kein Wagen */
.ing-minus {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 40px;
    margin-right: -0.2rem;
    padding: 0;
    border: none;
    background: none;
    color: #ef4444;
    font-size: 1.35rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: ing-minus-in 0.2s ease;
}

@keyframes ing-minus-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.ing-row-grip {
    width: 0.3rem;
}

.ing-table.is-managing .ing-new {
    display: none;
}

/* Bearbeiten direkt in der Zeile */
.ing-row.is-editing {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.65rem 0.7rem 0.7rem;
    background: var(--mp-soft);
}

.ing-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ing-row.is-editing .ing-row-icon {
    background: #fff;
}

.ing-edit-name,
.ing-edit-qty {
    min-width: 0;
    height: 42px;
    padding: 0 0.7rem;
    border: 1.5px solid var(--mp-line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
}

.ing-edit-name {
    flex: 1;
    font-weight: 600;
}

.ing-edit-name:focus,
.ing-edit-qty:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

/* Menge mit Einheit: − [ 500 g ] +  und darunter die Einheiten zum Antippen (überall gleich) */
.qty-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.qty-amount {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 46px;
    padding: 0 0.25rem;
    border: 1.5px solid var(--mp-line);
    border-radius: 14px;
    background: #fff;
}

.qty-amount:focus-within {
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

.qty-step {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 11px;
    background: var(--mp-soft);
    color: var(--mp-accent-dark);
    font-size: 0.85rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.qty-step:active {
    background: var(--mp-soft-2);
}

.qty-num {
    flex: 1;
    min-width: 0;
    width: 0;
    height: 100%;
    border: none;
    background: none;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    text-align: right;
    color: var(--mp-text);
}

.qty-num:focus {
    outline: none;
}

.qty-num::placeholder {
    color: #c4c9d1;
    font-weight: 500;
}

.qty-unit-label {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--mp-accent-dark);
    white-space: nowrap;
}

/* Einheiten: eine Zeile zum seitlich Wischen */
.qty-units {
    display: flex;
    gap: 0.35rem;
    padding-bottom: 0.1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.qty-units::-webkit-scrollbar {
    display: none;
}

.qty-unit {
    flex: none;
    min-width: 42px;
    height: 34px;
    padding: 0 0.7rem;
    border: 1px solid var(--mp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--mp-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.qty-unit.is-active {
    border-color: var(--mp-accent);
    background: var(--mp-accent);
    color: #fff;
}

.qty-note {
    height: 42px;
    padding: 0 0.8rem;
    border: 1.5px solid var(--mp-line);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
}

.qty-note:focus {
    outline: none;
    border-color: var(--mp-accent);
    box-shadow: 0 0 0 3px var(--mp-soft-2);
}

/* Seiten-Stile für Formularfelder (.field input) hier nicht übernehmen */
.qty-field input.qty-num,
.qty-field input.qty-num:focus {
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 17px;
    font-weight: 700;
}

.qty-field input.qty-note {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 0.8rem;
    border-radius: 12px;
    font-size: 16px;
}

.ing-row.is-editing .ing-row-main .ing-act {
    flex: 1;
}

.ing-act {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 42px;
    min-height: 42px;
    padding: 0 0.8rem;
    border: 1px solid var(--mp-line);
    border-radius: 12px;
    background: #fff;
    color: var(--mp-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ing-act.is-danger {
    color: #dc2626;
    border-color: #fecaca;
}

.ing-act.is-primary {
    border-color: var(--mp-accent);
    background: var(--mp-accent);
    color: #fff;
}

/* Hinweis mit «Rückgängig» (Zutat entfernt, auf die Liste gesetzt) */
.ing-undo {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 2600;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 0.55rem 0.6rem 0.55rem 1rem;
    border-radius: 22px;
    background: #1f2937;
    color: #fff;
    font-size: 0.88rem;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 0.2s ease, transform 0.25s ease;
}

.ing-undo.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.ing-undo-text {
    min-width: 0;
    line-height: 1.3;
}

.ing-undo-btn {
    flex: none;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #f9a8d4;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ing-swipe-hint {
    text-align: center;
}

.dish-shop.is-done {
    background: #f0fdf4;
    color: #15803d;
    text-decoration: none;
}

.dish-shop.is-done .ing-foot-go {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Neue Zutat: letzte Zeile der Tabelle */
.ing-new {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 54px;
    padding: 0.45rem 0.9rem 0.45rem 0.7rem;
    margin: 0;
}

.ing-new-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--mp-soft-2);
    color: var(--mp-accent);
}

.ing-new-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: none;
    background: none;
    font: inherit;
    font-size: 16px;
    color: var(--mp-text);
}

.ing-new-input::placeholder {
    color: #9ca3af;
}

.ing-new-input:focus {
    outline: none;
}

.ing-new:focus-within {
    background: #fffafd;
}

.ing-table + .ing-suggest {
    margin-top: 0.6rem;
}

.ing-hint {
    margin-top: 0.55rem;
    padding: 0 0.2rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--mp-muted);
}

.ing-foot .dish-shop {
    margin-top: 0.7rem;
}

.dish-shop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 46px;
    margin-top: 0.6rem;
    border: none;
    border-radius: 14px;
    background: var(--mp-soft);
    color: var(--mp-accent-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dish-shop:disabled {
    opacity: 0.6;
}

/* Zutaten aus dem Rezept-Link holen */
.dish-shop.is-import {
    background: linear-gradient(120deg, #fdf2f8, #fff7ed);
    color: var(--mp-text);
    font-weight: 600;
}

.dish-shop.is-import i {
    color: var(--mp-accent);
}

.dish-shop.is-import:disabled {
    opacity: 1;
    color: var(--mp-muted);
}

/* Das Zutaten-Blatt liegt über der Gericht-Ansicht */
#ingredientSheet {
    z-index: 2050;
}

/* Vorschläge beim Tippen */
.ing-sug-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ing-sug-icon img { width: 100%; height: 100%; object-fit: contain; }
.ing-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fce7f3;
    color: #be185d;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ing-suggest {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.ing-suggest:empty { display: none; }
.ing-sug {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 14px;
    border: 1px solid #eef0f3;
    background: #f8fafc;
    color: var(--mp-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}
.ing-sug:active { transform: scale(0.95); }
.ing-sug-name { overflow-wrap: anywhere; line-height: 1.2; }
.ing-sug small { color: var(--mp-muted); font-weight: 500; }
.ing-sug.is-fix { background: #ecfdf5; border-color: #bbf7d0; }
.ing-sug.is-raw { background: #fff; border-style: dashed; border-color: #f3d0e2; color: #be185d; }
.ing-sug.is-raw .ing-sug-icon { color: #ec4899; }

/* ---------- Gezeichnete Bilder für Gerichte (gleicher Stil wie die Einkaufsliste) ---------- */

.ui-card-media.is-dish {
    background: var(--ui-soft, #fdf2f8);
    color: var(--ui-over, #db2777);
}

.ui-card-media.is-dish .dish-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.ui-card-media.is-dish.has-dish-icon > i,
.dish-art.has-dish-icon > i {
    display: none;
}

.ui-card.is-past .ui-card-media.is-dish {
    filter: saturate(0.6);
}

/* Kleines Zeichen für Video, Instagram oder Rezept */
.ui-link-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    background: #6b7280;
    color: #fff;
    font-size: 0.62rem;
}

.ui-link-badge.type-youtube { background: #ff0000; }
.ui-link-badge.type-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 95%); }
.ui-link-badge.type-recipe { background: #f59e0b; }

.ui-tone-pink, .ui-tone-rose { --ui-soft: #fdf2f8; }
.ui-tone-amber { --ui-soft: #fff7ed; }
.ui-tone-green { --ui-soft: #ecfdf5; }
.ui-tone-violet { --ui-soft: #f5f3ff; }
.ui-tone-blue, .ui-tone-sky { --ui-soft: #eef2ff; }
.ui-tone-teal { --ui-soft: #f0fdfa; }

/* Gericht-Ansicht: Bild neben dem Titel statt grosser Video-Vorschau */
.dish-head.has-art {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 0.9rem;
}

.dish-head.has-art .dish-facts {
    grid-column: 1 / -1;
}

.dish-art {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fdf2f8, #fce7f3);
    color: var(--mp-accent);
    font-size: 1.8rem;
}

.dish-art .dish-icon {
    width: 66px;
    height: 66px;
    object-fit: contain;
}

button.dish-art {
    padding: 0;
    border: none;
    font: inherit;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button.dish-art:active {
    transform: scale(0.94);
}

/* Bild des Gerichts gross */
.dish-zoom {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
    background: rgba(253, 242, 248, 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    cursor: zoom-out;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

.dish-zoom.open {
    background: rgba(253, 242, 248, 0.92);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.dish-zoom img {
    width: min(62vw, 260px, 40vh);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.dish-zoom-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--mp-text);
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.3s ease;
}

.dish-zoom.open .dish-zoom-title {
    opacity: 1;
    transform: none;
}

.dish-head-text {
    min-width: 0;
}

/* ---------- Listen wie in den iPhone-Einstellungen (Mehr, Gruppen, Profil, Spiele) ---------- */

.set-page {
    background: #faf7f9;
}

@media (max-width: 768px) {
    body.has-tabbar:has(.set-page) {
        background: #faf7f9;
    }
}

.set-inner {
    max-width: 620px;
}

.set-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.set-head .mp-title {
    flex: 1;
    min-width: 0;
}

/* Zurück zur Mehr-Seite, wie der Zurück-Knopf auf dem iPhone */
.set-back,
.set-back:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0 0 0.35rem -0.2rem;
    padding: 0.2rem 0.2rem;
    color: var(--mp-accent);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.set-back i {
    font-size: 0.95rem;
}

.set-sub {
    margin: -0.6rem 0 1.1rem;
    color: var(--mp-muted);
    font-size: 0.95rem;
}

.set-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    box-shadow: var(--mp-card-shadow);
    color: var(--mp-text);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, background 0.15s ease;
}

a.set-card:visited {
    color: var(--mp-text);
}

a.set-card:active {
    transform: scale(0.98);
    background: var(--mp-soft);
}

.set-avatar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(145deg, #f9a8d4, #ec4899 70%, #db2777);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 4px 12px rgba(236, 72, 153, 0.25);
}

.set-avatar-lg {
    width: 88px;
    height: 88px;
    font-size: 2rem;
}

.set-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.set-card-text strong {
    font-size: 1.15rem;
    font-weight: 650;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-card-text small {
    color: var(--mp-muted);
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-section {
    margin-top: 1.6rem;
}

.set-section-title {
    margin: 0 0 0.45rem 1rem;
    color: var(--mp-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.set-foot {
    margin: 0.45rem 1rem 0;
    color: var(--mp-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.set-list {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--mp-soft-2);
    box-shadow: var(--mp-card-shadow);
}

.set-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 0.55rem 0.9rem 0.55rem 0.8rem;
    border: 0;
    background: none;
    color: var(--mp-text);
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.set-row:visited {
    color: var(--mp-text);
}

.set-row:active,
.set-row:hover {
    background: var(--mp-soft);
}

div.set-row:hover,
label.set-row:hover {
    background: none;
}

/* Trennlinie erst ab dem Text, wie auf dem iPhone */
.set-row + .set-row::before,
.set-row + .set-field::before,
.set-field + .set-row::before,
.set-field + .set-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3.55rem;
    right: 0;
    border-top: 1px solid rgba(17, 24, 39, 0.07);
}

.set-list-plain .set-row + .set-row::before,
.set-list-plain .set-field + .set-field::before,
.set-list-plain .set-row + .set-field::before,
.set-list-plain .set-field + .set-row::before {
    left: 1rem;
}

.set-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #fff;
    font-size: 0.9rem;
    background: var(--tint, var(--mp-accent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.set-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
}

.set-label > span,
.set-label > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-label small {
    color: var(--mp-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.set-hint {
    flex: 0 1 auto;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mp-muted);
    font-size: 0.88rem;
}

.set-chevron {
    flex: none;
    color: #c7c7cc;
    font-size: 0.8rem;
}

.set-check {
    flex: none;
    color: var(--mp-accent);
    font-size: 1rem;
}

.set-row-danger,
.set-row-danger:visited {
    justify-content: center;
    color: #e11d48;
    font-weight: 600;
}

.set-row-accent,
.set-row-accent:visited {
    color: var(--mp-accent);
}

.set-row-accent .set-label {
    font-weight: 500;
}

/* Eingabefeld als Listenzeile */
.set-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 54px;
    margin: 0;
    padding: 0.35rem 1rem;
}

.set-field > label {
    flex: none;
    width: 34%;
    margin: 0;
    color: var(--mp-text);
    font-size: 1rem;
    font-weight: 500;
}

.set-field input,
.set-field textarea,
.set-field select {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0;
    border: 0;
    background: transparent;
    color: var(--mp-text);
    font: inherit;
    font-size: 16px;
    text-align: right;
    outline: none;
}

.set-field input::placeholder,
.set-field textarea::placeholder {
    color: #b8b8be;
}

.set-field input[readonly] {
    color: var(--mp-muted);
}

.set-field-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    padding-top: 0.7rem;
}

.set-field-stack > label {
    width: auto;
    color: var(--mp-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.set-field-stack textarea {
    min-height: 84px;
    resize: vertical;
    text-align: left;
    line-height: 1.45;
}

/* Schalter wie auf dem iPhone */
.set-switch {
    flex: none;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 51px;
    height: 31px;
    margin: 0;
    border-radius: 16px;
    background: rgba(120, 120, 128, 0.2);
    cursor: pointer;
    transition: background 0.25s ease;
}

.set-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.set-switch:checked {
    background: #34c759;
}

.set-switch:checked::after {
    transform: translateX(20px);
}

.set-legal {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.6rem 0 0.5rem;
    font-size: 0.82rem;
}

.set-legal a,
.set-legal a:visited {
    color: var(--mp-muted);
    text-decoration: none;
}

/* Mitteilungen im Listen-Stil (push.js zeichnet den Inhalt) */
.set-list .push-settings {
    color: var(--mp-text);
}

.set-list .push-row {
    min-height: 54px;
    padding: 0.55rem 0.9rem 0.55rem 0.8rem;
    gap: 0.8rem;
}

.set-list .push-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 0.9rem;
    background: #ef4444;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.set-list .push-text strong {
    font-size: 1rem;
    font-weight: 500;
}

.set-list .push-text small {
    color: var(--mp-muted);
    font-size: 0.8rem;
}

.set-list .push-options {
    margin: 0;
    border-top: 0;
}

.set-list .push-option {
    position: relative;
    gap: 0.8rem;
    min-height: 54px;
    padding: 0.55rem 0.9rem 0.55rem 3.55rem;
    border-bottom: 0;
}

.set-list .push-option::before,
.set-list .push-test::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3.55rem;
    right: 0;
    border-top: 1px solid rgba(17, 24, 39, 0.07);
}

.set-list .push-option span {
    flex: 1;
    min-width: 0;
    order: 1;
}

.set-list .push-option strong {
    font-size: 0.95rem;
    font-weight: 500;
}

.set-list .push-option small {
    color: var(--mp-muted);
    font-size: 0.8rem;
}

.set-list .push-option input {
    order: 2;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: none;
    width: 51px;
    height: 31px;
    border-radius: 16px;
    background: rgba(120, 120, 128, 0.2);
    cursor: pointer;
    transition: background 0.25s ease;
}

.set-list .push-option input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.set-list .push-option input:checked {
    background: #34c759;
}

.set-list .push-option input:checked::after {
    transform: translateX(20px);
}

.set-list .push-test {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.95rem 0.9rem 0.95rem 3.55rem;
    text-align: left;
    color: var(--mp-accent);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Kachel-Raster für Startseiten von Bereichen (Spiele, Fragen, Entscheiden) */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.6rem;
    min-height: 150px;
    padding: 1rem;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(150deg, var(--tint-a), var(--tint-b));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--tint-b) 30%, transparent);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile:visited {
    color: #fff;
}

.tile:active {
    transform: scale(0.96);
}

.tile::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -40px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 1.2rem;
}

.tile strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.tile small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.82rem;
    opacity: 0.9;
}

.tile-wide {
    grid-column: 1 / -1;
    min-height: 120px;
}

@media (min-width: 769px) {
    .tile-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tile:hover {
        transform: translateY(-3px);
    }
}
