:root {
    --bg: #14120f;
    --bg-elevated: #1c1a16;
    --surface: #211e19;
    --surface-hover: #29251f;
    --ink: #ece6db;
    --ink-dim: #a89f8f;
    --ink-faint: #756c5d;
    --accent: #e0a94a;
    --accent-bright: #f0bd63;
    --accent-dim: rgba(224, 169, 74, 0.14);
    --accent-glow: rgba(224, 169, 74, 0.25);
    --line: rgba(255, 255, 255, 0.08);
    --line-bright: rgba(255, 255, 255, 0.14);
    --shadow: rgba(0, 0, 0, 0.45);
    --green: #7ea86f;
    --red: #d9705c;
    font-size: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    overflow-x: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -5%, rgba(224, 169, 74, 0.06), transparent 60%),
        radial-gradient(ellipse 700px 500px at 100% 20%, rgba(126, 168, 111, 0.04), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

header.site-header {
    background: rgba(20, 18, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-inner {
    width: min(800px, 100% - 3.5rem);
    margin: 0 auto;
    padding: 1.1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-add-row {
    width: min(800px, 100% - 3.5rem);
    margin: 0 auto;
    padding: 0 0 0.9rem;
    display: flex;
    justify-content: center;
}

.add-recipe-btn {
    width: 100%;
    max-width: 320px;
}

header.site-header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

header.site-header h1 span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-faint);
}

nav.tabs {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 0.3rem;
    border-radius: 12px;
    border: 1px solid var(--line);
}

nav.tabs button {
    background: transparent;
    border: none;
    color: var(--ink-dim);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

nav.tabs button:hover { background: var(--surface-hover); color: var(--ink); }

nav.tabs button.active {
    background: var(--accent);
    color: #1a1511;
    font-weight: 600;
}

nav.tabs.tabs-fluid button {
    flex: 1 1 0;
    text-align: center;
}

main {
    width: min(800px, 100% - 3.5rem);
    margin: 2rem auto;
    padding: 0;
}

.view { display: none; }
.view.active { display: block; animation: fadein 0.25s ease; }

/* Rezeptübersicht darf breiter sein als die restliche Seite, damit die
   Suchleiste und das Karten-Grid mehr Raum nutzen - bricht dafür aus dem
   schmaleren main-Container aus und zentriert sich eigenständig im Viewport
   (klassisches "breakout"-Pattern via 50vw). */
#view-recipes, #view-weekplan {
    --view-width: min(1200px, 100vw - 3.5rem);
    width: var(--view-width);
    position: relative;
    left: 50%;
    margin-left: calc(var(--view-width) * -0.5);
}

@keyframes fadein {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.toolbar {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.4rem;
}

#view-recipes .toolbar { justify-content: center; }

input[type=text], input[type=search], input[type=url], input[type=date],
input[type=number], input[type=password], select, textarea {
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--ink);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

textarea { width: 100%; resize: vertical; line-height: 1.6; }

button.btn, a.btn {
    font-family: inherit;
    background: var(--accent);
    color: #1a1511;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-block;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

button.btn:hover, a.btn:hover { background: var(--accent-bright); box-shadow: 0 4px 16px var(--accent-glow); text-decoration: none; }
button.btn:active, a.btn:active { transform: translateY(1px); }

button.btn.secondary, a.btn.secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

button.btn.secondary:hover, a.btn.secondary:hover { background: var(--accent-dim); box-shadow: none; }

button.btn.ghost, a.btn.ghost {
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid var(--line);
}
button.btn.ghost:hover, a.btn.ghost:hover { background: var(--surface-hover); color: var(--ink); box-shadow: none; }

button.btn.small, a.btn.small { padding: 0.35rem 0.8rem; font-size: 0.82rem; }

.chip {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent-bright);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0.1rem;
}

.chip.removable { cursor: pointer; }
.chip.removable::after { content: " ×"; }

.filter-dropdown {
    position: relative;
}
.filter-dropdown summary {
    list-style: none;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.95rem;
    color: var(--ink);
    white-space: nowrap;
}
.filter-dropdown summary::-webkit-details-marker { display: none; }
.filter-dropdown summary::after { content: " ▾"; color: var(--ink-faint); }
.filter-dropdown[open] summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.filter-dropdown-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.3rem);
    left: 0;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.filter-dropdown-panel label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: normal;
    padding: 0.35rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
}
.filter-dropdown-panel label:hover { background: var(--surface-hover); }
.filter-dropdown-panel .filter-divider {
    border: none;
    border-top: 1px solid var(--line);
    margin: 0.4rem 0.1rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
}

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--shadow);
    border-color: var(--line-bright);
}

.recipe-card .thumb {
    height: 150px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    font-size: 2.2rem;
}

/* Eigene Fotos werden vollständig (nicht zugeschnitten) und verkleinert gezeigt. */
.recipe-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.recipe-card .body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.recipe-card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.recipe-card .meta { font-size: 0.8rem; color: var(--ink-faint); }
.recipe-card .cats { margin-top: auto; }

.card-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 2px 12px var(--shadow);
}

.recipe-detail h2 {
    color: var(--ink);
    margin-top: 0;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.9rem;
}

.recipe-detail .detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.2rem;
}

.recipe-detail img.hero {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.recipe-detail img.hero.hero-small {
    max-width: 110px;
    margin-top: 1.2rem;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}
.recipe-detail img.hero.hero-small:hover {
    opacity: 0.85;
}

.own-photos-gallery {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}
.own-photos-gallery img {
    height: 90px;
    width: 90px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}
.own-photos-gallery img:hover { opacity: 0.85; }

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 2rem;
    cursor: zoom-out;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line-bright);
    color: var(--ink);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 201;
}

.recipe-detail h4 {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.7rem;
}

.recipe-detail .meta-row {
    display: flex;
    gap: 1.2rem;
    color: var(--ink-dim);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.recipe-detail ul.ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-detail ul.ingredients li {
    display: flex;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-dim);
}

.recipe-detail ul.ingredients li .amt {
    flex: 0 0 90px;
    color: var(--ink);
    font-weight: 600;
}

.recipe-detail ul.ingredients li .ing-name {
    flex: 1;
    min-width: 0;
}

.recipe-detail .instructions {
    white-space: pre-wrap;
    line-height: 1.75;
    color: var(--ink-dim);
}

.steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.step {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
    line-height: 1.6;
}

.step:hover { border-color: var(--line-bright); }

.step-num {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent-bright);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.step-text { color: var(--ink-dim); cursor: pointer; flex: 1 1 240px; min-width: 0; }

.step.done {
    background: var(--surface);
    border-color: var(--line);
}
.step.done .step-num {
    background: var(--green);
    color: #10240b;
}
.step.done .step-text {
    color: var(--ink-faint);
    text-decoration: line-through;
}

.step-timer-area {
    flex: 0 0 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.2rem;
}
.step-timer-area:empty { display: none; }

.timer-badge {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--accent-bright);
    background: var(--accent-dim);
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
}
.timer-badge.expired {
    color: #1a1511;
    background: var(--accent);
}

.step.timer-done {
    animation: timer-pulse 1s ease-in-out infinite;
}
@keyframes timer-pulse {
    0%, 100% { border-color: var(--line); box-shadow: none; }
    50% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
}

.recipe-detail .source-img {
    margin-top: 1rem;
}
.recipe-detail .source-img img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.recipe-detail .source-img summary { cursor: pointer; color: var(--ink-faint); font-size: 0.85rem; }

form.recipe-form { display: flex; flex-direction: column; gap: 1.1rem; }
form.recipe-form label {
    font-weight: 600; color: var(--ink-dim); font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    display: block; margin-bottom: 0.4rem;
}
form.recipe-form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
form.recipe-form .row > div { flex: 1; min-width: 180px; }
form.recipe-form input, form.recipe-form textarea, form.recipe-form select { width: 100%; }

.ingredient-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.ingredient-row input.amount { width: 120px; flex: none; }
.ingredient-row input.name { flex: 1; }

.dropzone {
    border: 1.5px dashed var(--line-bright);
    border-radius: 14px;
    padding: 2.2rem;
    text-align: center;
    color: var(--ink-faint);
    background: var(--bg-elevated);
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-dim); }

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 0.8rem;
}
.preview-thumb {
    position: relative;
    width: 90px;
    height: 90px;
}
.preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
}
.preview-thumb-remove {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1511;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.7rem;
    margin-top: 0.8rem;
}
.gallery-item {
    position: relative;
    aspect-ratio: 1;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: zoom-in;
}
.gallery-item-remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(20, 18, 15, 0.75);
    color: var(--ink);
    border: 1px solid var(--line-bright);
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}
.gallery-add-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 1.5px dashed var(--line-bright);
    border-radius: 10px;
    color: var(--ink-faint);
    cursor: pointer;
    font-size: 1.6rem;
    background: var(--bg-elevated);
    transition: border-color 0.15s ease;
}
.gallery-add-tile:hover { border-color: var(--accent); color: var(--accent); }

.weekplan-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0.5rem;
    margin: -0.5rem;
}
.weekplan-table th:first-child,
.weekplan-table td:first-child {
    width: 90px;
}
.weekplan-table th {
    background: transparent;
    padding: 0.5rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--ink-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.weekplan-table th .weekday-date {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--ink-dim);
}
.weekplan-table td {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.9rem 0.7rem;
    vertical-align: top;
    min-height: 120px;
    height: auto;
    background: var(--surface);
}
.weekplan-cell .slot-label { font-size: 0.75rem; color: var(--ink-faint); text-transform: uppercase; }
.weekplan-cell .recipe-pill {
    background: var(--accent-dim);
    border-radius: 10px;
    padding: 0.65rem 0.7rem;
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.weekplan-cell .recipe-pill span {
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--ink);
    word-break: break-word;
}
.weekplan-cell .recipe-pill button {
    align-self: flex-end;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}
.weekplan-cell .recipe-pill button:hover {
    background: rgba(0, 0, 0, 0.08);
}
.weekplan-cell .recipe-pill .plan-persons {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
}
.weekplan-cell .recipe-pill .plan-persons button {
    align-self: auto;
    background: var(--surface);
    border: 1px solid var(--line);
}
.weekplan-cell button.add-slot {
    background: none; border: 1px dashed var(--line); border-radius: 8px; width: 100%;
    padding: 0.4rem; color: var(--ink-faint); cursor: pointer; margin-top: 0.3rem; font-size: 0.8rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.weekplan-cell button.add-slot:hover { border-color: var(--accent); color: var(--accent); }

.week-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.week-nav h3 { margin: 0; color: var(--ink); font-weight: 600; }

.result-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.1rem;
    margin-bottom: 0.8rem;
}
.result-item h4 { margin: 0 0 0.4rem 0; color: var(--ink); font-size: 1.02rem; }
.result-item .src { font-size: 0.8rem; color: var(--ink-faint); word-break: break-all; }

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ink-faint);
    padding: 3.5rem 1rem;
}

.spinner {
    display: inline-block;
    width: 1em; height: 1em;
    border: 2px solid var(--accent-dim);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 50;
    padding: 1rem;
}
.modal {
    background: var(--bg-elevated); border: 1px solid var(--line-bright); border-radius: 16px; padding: 1.6rem;
    max-width: 500px; width: 100%; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.shopping-list {
    list-style: none; padding: 0; margin: 1rem 0 0;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.shopping-list li {
    display: flex; align-items: center; gap: 0.7rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; padding: 0.7rem 0.9rem;
}
.shopping-list li.checked { opacity: 0.55; }
.shopping-list li.checked .shopping-item-text { text-decoration: line-through; }
.shopping-list input[type="checkbox"] {
    width: 1.2rem; height: 1.2rem; flex-shrink: 0; cursor: pointer;
}
.shopping-item-text { flex: 1; line-height: 1.4; }
.shopping-list li button {
    background: none; border: none; color: var(--ink-faint);
    cursor: pointer; font-size: 1rem; padding: 0.2rem 0.4rem; flex-shrink: 0;
}
.shopping-list li button:hover { color: var(--red); }
.shopping-list li.shopping-group-title {
    background: none; border: none; padding: 0.9rem 0.2rem 0.1rem;
    font-weight: bold; color: var(--accent-dark); justify-content: space-between;
}
.shopping-list li.shopping-group-title span {
    font-weight: normal; font-size: 0.78rem; color: var(--ink-faint);
}
.shopping-list-empty { color: var(--ink-light); padding: 1rem 0; }

.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-bright);
    padding: 0.85rem 1.3rem; border-radius: 10px; z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.error { border-color: var(--red); color: var(--red); }

.global-timer-banner {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}

.global-timer-pill {
    background: var(--surface);
    border: 1px solid var(--line-bright);
    color: var(--ink);
    padding: 0.4rem 0.5rem 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto;
}
.global-timer-pill.expired {
    border-color: var(--accent);
    color: var(--accent-bright);
    background: var(--accent-dim);
    animation: timer-pulse 1s ease-in-out infinite;
}

.gt-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.1rem 0.2rem;
    line-height: 1;
}
.gt-close:hover { opacity: 1; }

footer {
    text-align: center; padding: 2.5rem 1rem; color: var(--ink-faint); font-size: 0.82rem;
}

@media (max-width: 700px) {
    :root { font-size: 15px; }

    .header-inner {
        width: min(800px, 100% - 2rem);
        padding: 0.8rem 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .header-add-row {
        width: min(800px, 100% - 2rem);
        padding: 0 0 0.7rem;
    }
    .add-recipe-btn { max-width: none; }
    header.site-header h1 {
        font-size: 1.25rem;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        text-align: center;
    }
    header.site-header h1 span { font-size: 0.8rem; }

    nav.tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.2rem;
        gap: 0.35rem;
        max-width: 100%;
    }
    nav.tabs button {
        flex: 0 0 auto;
        padding: 0.55rem 0.85rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    main { width: min(800px, 100% - 2rem); margin: 1rem auto; }

    #view-recipes, #view-weekplan {
        --view-width: 100%;
        width: 100%;
        position: static;
        left: auto;
        margin-left: 0;
    }

    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar input, .toolbar select, .toolbar button { width: 100%; }

    .card-panel { padding: 1.1rem; border-radius: 12px; }

    .recipe-grid { grid-template-columns: 1fr; gap: 0.9rem; }
    .recipe-card .thumb { height: 170px; }

    .recipe-detail .detail-grid { grid-template-columns: 1fr; gap: 1.2rem; }
    .recipe-detail h2 { font-size: 1.4rem; }
    .recipe-detail .meta-row { flex-wrap: wrap; gap: 0.5rem 1rem; }

    form.recipe-form .row { flex-direction: column; gap: 0.8rem; }
    .ingredient-row { flex-wrap: wrap; }
    .ingredient-row input.amount { width: 90px; }
    .ingredient-row input.name { min-width: 120px; }

    button.btn, button.btn.small { padding: 0.65rem 1rem; font-size: 0.92rem; }

    /* Wochenplan: aus der 7-Spalten-Tabelle wird eine vertikale Tagesliste */
    .weekplan-table, .weekplan-table thead, .weekplan-table tbody,
    .weekplan-table tr, .weekplan-table th, .weekplan-table td {
        display: block;
        width: 100%;
    }
    .weekplan-table { border-spacing: 0; margin: 0; }
    .weekplan-table tr:first-child { display: none; }
    .weekplan-table tr:last-child { border: none; }
    .weekplan-table td {
        height: auto;
        margin-bottom: 0.6rem;
        border-radius: 10px;
        position: relative;
        padding: 0.8rem 0.9rem;
    }
    .weekplan-table td::before {
        content: attr(data-day);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--accent);
        font-weight: 600;
        margin-bottom: 0.35rem;
        letter-spacing: 0.04em;
    }

    .week-nav { flex-wrap: wrap; justify-content: space-between; }
    .week-nav h3 { flex-basis: 100%; text-align: center; order: -1; }

    .modal { padding: 1.2rem; max-height: 90vh; }

    .toast { left: 1rem; right: 1rem; bottom: 1rem; text-align: center; }
}

/* ─── Timer-Alarm-Dialog (zentriert, große Bedienelemente) ─── */
.timer-alarm-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    overflow-y: auto;
}
.timer-alarm-card {
    width: 100%; max-width: 26rem;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 18px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-shadow: 0 0 0 6px var(--accent-glow), 0 20px 50px rgba(0,0,0,0.6);
    animation: timer-pulse 1s ease-in-out infinite;
}
.timer-alarm-icon { font-size: 3rem; line-height: 1; }
.timer-alarm-card h2 { margin: 0.5rem 0 1rem; color: var(--accent-bright); }
.timer-alarm-list { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.9rem; }
.timer-alarm-label { display: block; font-weight: 600; margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.timer-alarm-actions { display: flex; gap: 0.6rem; }
.timer-alarm-actions .btn { flex: 1; padding: 0.9rem 0.5rem; font-size: 1.05rem; }
button.btn.timer-alarm-stop {
    background: var(--accent); color: #1a1511; font-weight: 700; border: none;
}
.timer-alarm-actions .timer-alarm-stop { flex: 2; }
.timer-alarm-stop-all { width: 100%; margin-top: 0.6rem; padding: 0.9rem; font-size: 1.05rem; }

.global-timer-pill { white-space: nowrap; max-width: calc(100vw - 2rem); }
.gt-label {
    overflow: hidden; text-overflow: ellipsis; max-width: 11rem;
    opacity: 0.75; margin-left: 0.4rem;
}
.gt-label::before { content: "· "; }
.timer-alarm-label {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 600px) { .toast { bottom: 4.5rem; } }
