/* Rezepte – light, airy styles with one fresh accent. Mobile first, readable in the kitchen. */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f5f7f6;
    --text: #16201b;
    --muted: #68736d;
    --line: #e4e9e6;
    --accent: #0e7c7b;
    --accent-dark: #0a5d5c;
    --accent-soft: #e2f2f1;
    --accent-tint: #f1f9f8;
    --ok: #1f7a4b;
    --ok-soft: #e3f2e8;
    --error: #c0362c;
    --error-soft: #fce8e6;
    --hairline: rgba(22, 32, 27, .08);
    --header-bg: rgba(255, 255, 255, .92);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(22, 32, 27, .04), 0 4px 16px rgba(22, 32, 27, .05);
    --shadow-hover: 0 2px 4px rgba(22, 32, 27, .05), 0 12px 32px rgba(22, 32, 27, .09);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 1.35rem; font-weight: 750; margin-top: 1.5em; }
h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.2em; }
@media (min-width: 760px) { h1 { font-size: 2.6rem; } }

[hidden] { display: none !important; }

.icon { flex: none; }

/* ---------- Layout ---------- */

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 760px; }
.container--tiny { max-width: 440px; }

main { padding: 28px 0 72px; }

.site-header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
/* On phones the navigation wraps, so only keep it sticky on larger screens. */
@media (min-width: 760px) {
    .site-header { position: sticky; top: 0; z-index: 10; }
}
.site-header .container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--text);
}
.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
}

.nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--muted);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 550;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.nav__icon { padding: 8px !important; }
.nav__sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-dark);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------- Buttons & forms ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 650;
    font-size: .98rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn--secondary, .btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--secondary:hover, .btn--ghost:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn--ghost .icon { color: var(--accent); }
.btn--danger { background: var(--surface); color: var(--error); border-color: var(--error-soft); }
.btn--danger:hover { background: var(--error-soft); border-color: var(--error-soft); }
.btn--small { min-height: 36px; padding: 4px 14px; font-size: .9rem; }
.btn--block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    flex: none;
}
.icon-btn:hover { background: var(--error-soft); color: var(--error); }
.drag-handle { cursor: grab; touch-action: none; }
.drag-handle:hover { background: none; color: var(--muted); }

label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search],
input:not([type]), select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { font: inherit; max-width: 100%; }

.form-row { margin-bottom: 16px; }
.form-help { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.form-errors { color: var(--error); font-size: .9rem; margin: 4px 0 0; padding: 0; list-style: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }

.check { display: flex; align-items: center; gap: 8px; font-weight: normal; margin: 0; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }

fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { padding: 0; }

.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card > h2:first-child { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.card__head h2 { margin: 0; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions--end { justify-content: flex-end; }

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    padding: 16px 0 12px;
    margin-top: 16px;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Flash messages ---------- */

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.flash--success { background: var(--ok-soft); color: var(--ok); }
.flash--error { background: var(--error-soft); color: var(--error); }

/* ---------- Recipe list ---------- */

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 6px 6px 48px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search input { flex: 1; min-height: 42px; border: 0; padding: 0; background: transparent; font-size: 1.02rem; }
.search input:focus { box-shadow: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chips--sub { margin-top: -14px; }
.chip {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 550;
    transition: border-color .15s ease, background-color .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip--sub { font-size: .86rem; padding: 4px 12px; color: var(--muted); background: var(--surface-2); border-color: transparent; }
.chip--sub.is-active { background: var(--accent-soft); color: var(--accent-dark); border-color: transparent; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.results-bar__count { margin: 0; color: var(--muted); font-size: .92rem; font-weight: 500; }

.view-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.view-switch__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
}
.view-switch__btn:hover { color: var(--text); }
.view-switch__btn[aria-pressed=true] { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(22, 32, 27, .12); }
.view-switch__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 479px) { .view-switch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* Cards (default) */
.recipes { display: grid; gap: 28px 20px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (min-width: 700px) { .recipes--grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 36px 24px; } }

.recipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}
.recipe-card__media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--accent-tint);
    aspect-ratio: 4 / 3;
}
.recipe-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.recipe-card:hover .recipe-card__media img { transform: scale(1.04); }
.recipe-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--accent);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .9), transparent 55%),
        linear-gradient(135deg, var(--accent-soft), var(--accent-tint));
}
.recipe-card__placeholder .icon { opacity: .55; }
.recipe-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.recipe-card__cat { color: var(--accent-dark); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.recipe-card__title { font-weight: 750; font-size: 1.08rem; line-height: 1.3; letter-spacing: -.01em; }
.recipe-card:hover .recipe-card__title { color: var(--accent-dark); }
.recipe-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .86rem; }
.recipe-card__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.recipe-card__chevron { display: none; }
.recipes--grid .recipe-card__extra { display: none; }
.recipe-card:focus-visible { outline: none; }
.recipe-card:focus-visible .recipe-card__media { outline: 3px solid var(--accent); outline-offset: 2px; }

/* List */
.recipes--list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.recipes--list .recipe-card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    transition: background-color .15s ease;
}
.recipes--list .recipe-card:hover { background: var(--accent-tint); }
.recipes--list .recipe-card__media { flex: 0 0 88px; width: 88px; aspect-ratio: 1; border-radius: 12px; }
.recipes--list .recipe-card__placeholder .icon { width: 30px; height: 30px; }
.recipes--list .recipe-card:hover .recipe-card__media img { transform: none; }
.recipes--list .recipe-card__body { flex: 1; }
.recipes--list .recipe-card__title { font-size: 1.05rem; }
.recipes--list .recipe-card__chevron { display: flex; color: var(--muted); }
.recipes--list .recipe-card:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.recipes--list .recipe-card:focus-visible .recipe-card__media { outline: none; }
@media (min-width: 760px) {
    .recipes--list .recipe-card { gap: 20px; padding: 14px 12px; }
    .recipes--list .recipe-card__media { flex-basis: 112px; width: 112px; aspect-ratio: 4 / 3; }
}

.empty { text-align: center; color: var(--muted); padding: 56px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty__icon { display: inline-flex; padding: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }

/* ---------- Recipe view ---------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: -8px 0 18px -4px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 550;
    text-decoration: none;
}
.back-link:hover { color: var(--accent-dark); }

.recipe-head { display: grid; gap: 24px; margin-bottom: 40px; }
@media (min-width: 860px) {
    .recipe-head--photo { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; }
}
.recipe-head--photo .recipe-head__photo { order: -1; }
@media (min-width: 860px) { .recipe-head--photo .recipe-head__photo { order: 0; } }
.recipe-head__photo { border-radius: 22px; overflow: hidden; background: var(--accent-tint); }
.recipe-head__photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.recipe-head h1 { margin-bottom: 12px; }
@media (min-width: 760px) { .recipe-head h1 { font-size: 2.9rem; } }
.recipe-head .lead { color: var(--muted); font-size: 1.12rem; line-height: 1.6; margin: 0 0 4px; max-width: 46em; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
}
.tag:hover { background: var(--accent); color: #fff; }

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 0;
    margin: 22px 0;
    padding: 16px 0;
    list-style: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.facts li { display: flex; align-items: center; gap: 10px; padding: 0 20px 0 0; margin-right: 20px; border-right: 1px solid var(--line); font-size: .98rem; font-weight: 600; }
.facts li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.facts .icon { color: var(--accent); }
.facts strong { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; }

.recipe-head__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.source { margin: 0; font-size: .92rem; color: var(--muted); overflow-wrap: anywhere; }

.section-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 18px; letter-spacing: -.02em; }

.recipe-body { display: grid; gap: 32px; }
@media (min-width: 900px) {
    .recipe-body { grid-template-columns: minmax(300px, 1fr) 1.75fr; align-items: start; gap: 48px; }
}

.ingredients {
    background: var(--accent-tint);
    border-radius: 20px;
    padding: 22px;
}
@media (min-width: 760px) { .ingredients { padding: 26px 28px; } }
.ingredients h3 { color: var(--accent-dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 20px 0 6px; }

.ingredient-list { list-style: none; margin: 0 0 8px; padding: 0; }
.ingredient-list li { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.ingredient-list li:last-child { border-bottom: 0; }
.ingredient-list .amount { flex: 0 0 6.5em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.ingredient-list .note { color: var(--muted); }
.ingredient-list li:has(+ li.is-alt) { border-bottom: 0; padding-bottom: 2px; }
.ingredient-list li.is-alt { padding-top: 2px; }
.or { font-style: italic; font-weight: normal; color: var(--muted); }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps .step { counter-increment: step; position: relative; padding: 0 0 26px 60px; min-height: 44px; }
.steps .step::before {
    content: counter(step);
    position: absolute; left: 0; top: -4px;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.05rem;
}
.steps .step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: 6px;
    width: 2px;
    background: var(--accent-soft);
}
.steps .step-heading { margin: 10px 0 16px; font-size: 1.1rem; font-weight: 750; color: var(--accent-dark); }
.step-duration { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 550; }
.step-text { white-space: pre-line; font-size: 1.06rem; line-height: 1.7; }

.notes-box { margin-top: 20px; padding: 22px; border-radius: 20px; background: var(--surface-2); }
.notes-box .section-title { font-size: 1.15rem; margin-bottom: 8px; }
.notes { white-space: pre-line; }
.recipe-meta { font-size: .85rem; margin-top: 24px; }

/* ---------- Settings ---------- */

.settings__views { display: grid; gap: 10px; }
@media (min-width: 560px) { .settings__views { grid-template-columns: 1fr 1fr; } .settings__views legend { grid-column: 1 / -1; } }
.choice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-weight: normal;
    cursor: pointer;
}
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__icon { display: flex; padding: 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.choice__text { display: flex; flex-direction: column; font-size: .9rem; color: var(--muted); }
.choice__text strong { color: var(--text); font-size: 1rem; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice:has(input:checked) .choice__icon { background: var(--accent); color: #fff; }
.choice:has(input:focus-visible) { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* ---------- Editor ---------- */

.editor .card { margin-bottom: 16px; }
.editor h2 { margin-top: 0; }

.yield-types { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.yield-types .check {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    background: var(--surface);
    cursor: pointer;
}
.yield-types .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.category-choices { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.category-choices .check--depth-1 { padding-left: 14px; }
.category-choices .check--depth-2 { padding-left: 28px; }

.group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
    background: var(--accent-soft);
}
.group__head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.group__head input { font-weight: 600; }
.group input, .group select { background: var(--surface); }

@media (max-width: 759px) {
    .card { padding: 12px; }
    .group { padding: 8px; }
    .ingredient-row .icon-btn, .step-row .icon-btn { width: 30px; }
}

.ingredient-row {
    display: grid;
    grid-template-columns: 30px 1.1fr .9fr 1.3fr 30px;
    grid-template-areas:
        "drag qty max unit del"
        "drag alt name name ."
        "drag note note scal .";
    gap: 6px;
    align-items: center;
    padding: 6px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

/* Alternatives ("oder") hang indented below the ingredient they replace. */
.alt-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}
.alt-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.alt-toggle:not(:has(input:checked)) { border-style: dashed; font-weight: 500; }
.alt-toggle:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.alt-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ingredient-row .f-alt { grid-area: alt; }
.ingredient-row:has([data-alternative]:checked) { margin-left: 28px; border-left: 3px solid var(--accent); }
/* The first ingredient of a group cannot be an alternative. */
[data-collection-target="list"] > .ingredient-row:first-child .alt-toggle { visibility: hidden; }
[data-collection-target="list"] > .ingredient-row:first-child { margin-left: 0; border-left-width: 1px; border-left-color: var(--line); }
.ingredient-row .f-drag { grid-area: drag; align-self: start; }
.ingredient-row .f-qty { grid-area: qty; }
.ingredient-row .f-max { grid-area: max; }
.ingredient-row .f-unit { grid-area: unit; }
.ingredient-row .f-name { grid-area: name; }
.ingredient-row .f-note { grid-area: note; }
.ingredient-row .f-scal { grid-area: scal; font-size: .85rem; }
.ingredient-row .f-del { grid-area: del; align-self: start; }
/* "+ Zutat" and "Hier teilen" sit in the gap between two ingredients. */
.ingredient-row { position: relative; }
.ingredient-row + .ingredient-row { margin-top: 34px; }
.ingredient-gap {
    position: absolute;
    left: 0;
    right: 0;
    top: -33px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.ingredient-gap::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    border-top: 1px dashed var(--accent);
    opacity: .45;
}
.gap-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent-dark);
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.gap-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-collection-target="list"] > .ingredient-row:first-child .ingredient-gap { display: none; }
.ingredient-row .row-errors { grid-column: 2 / -2; }
.ingredient-head { display: none; }

@container ingredients (min-width: 600px) {
    /* Two lines per ingredient: amount and name on top, note and options below. */
    .ingredient-row, .ingredient-head {
        grid-template-columns: 38px 54px 70px 70px 100px 1fr 120px 38px;
    }
    .ingredient-row {
        grid-template-areas:
            "drag alt qty max unit name name del"
            "drag .   note note note note scal .";
    }
    .ingredient-row .f-drag { align-self: center; }
    .ingredient-head { padding: 0 7px; }
    .ingredient-head { display: grid; gap: 6px; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.quick {
    margin-bottom: 14px;
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent-soft);
}
.quick textarea { min-height: 110px; margin: 8px 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92rem; }
.quick summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); }
.quick__status { font-size: .9rem; color: var(--ok); }
.quick__status.is-error { color: var(--error); }

.step-row {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 8px;
    padding: 10px 8px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--accent-soft);
}
.step-row input, .step-row textarea { background: var(--surface); }
.step-row__fields { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
    .step-row__fields { grid-template-columns: 1fr 140px; }
    .step-row__fields .f-text { grid-column: 1 / -1; }
}
.step-row .form-row { margin: 0; }

.photo-preview { max-width: 240px; border-radius: 8px; margin-bottom: 8px; }

/* ---------- Tables (admin) ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .95rem; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--line); color: var(--muted); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--accent { background: var(--accent-soft); color: var(--accent-dark); }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }

.auth-card { margin-top: 8vh; }
.auth-card h1 { text-align: center; }
.muted { color: var(--muted); }
.inline-form { display: inline; }

@media print {
    .site-header, .actions, .sticky-actions, .scaler, .cook-bar, .cook-tabs, .cook-nav, .cook-timers { display: none !important; }
    body { background: #fff; }
}

/* ---------- Scaler (recipe view) ---------- */

turbo-frame#recipe-ingredients { display: block; }
@media (min-width: 900px) {
    .recipe-body turbo-frame#recipe-ingredients { position: sticky; top: 88px; }
}
turbo-frame[aria-busy="true"] .ingredient-list { opacity: .55; transition: opacity .15s; }

.scaler { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 8px; }
.scaler__row { display: flex; align-items: center; gap: 8px; }
.scaler__unit { font-weight: 600; color: var(--muted); }
.scaler__shapes { display: flex; gap: 6px; }
.scaler__shapes .check { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; background: var(--surface); }
.scaler__shapes .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.scaler input[type=number] { width: 4.2em; text-align: center; padding: 6px 4px; -moz-appearance: textfield; }
.scaler input[type=number]::-webkit-inner-spin-button, .scaler input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper input[type=number] { border: 0; border-radius: 0; min-height: 38px; font-weight: 800; font-size: 1.1rem; background: transparent; box-shadow: none; }
.stepper__btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; }
.stepper__btn:hover { background: var(--accent); color: #fff; }
.scale-for { margin: 0 0 4px; font-size: .9rem; }
.scale-info { background: var(--surface); color: var(--accent-dark); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .88rem; margin-bottom: 6px; }
.fixed { margin-left: 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.ingredients__actions { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.ingredients__actions .btn { flex: 1; }

/* ---------- Cooking view ---------- */

.container--cook { max-width: 1280px; }
main:has(.cook) { padding-top: 0; }

.cook { --cook-text: 1.3rem; }
@media (min-width: 760px) { .cook { --cook-text: 1.55rem; } }

.cook-bar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.cook-bar__title { flex: 1; min-width: 0; line-height: 1.25; }
.cook-bar__title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-bar__title span { font-size: .85rem; color: var(--muted); }
.cook-wake.is-on { background: #fff6d6; border-color: #f0d98a; color: #7a5a00; }

.cook-tabs { display: flex; gap: 6px; margin: 12px 0; }
.cook-tabs button {
    flex: 1; min-height: 46px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--muted); font: inherit; font-weight: 650; cursor: pointer;
}
.cook-tabs button[aria-selected=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cook-tabs__count { font-weight: 400; font-size: .85rem; opacity: .85; }

.cook-layout { display: grid; gap: 18px; margin-top: 12px; }
.cook-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cook-panel h2 { margin-top: 0; }
.cook-panel h2 small { font-size: .85rem; color: var(--muted); font-weight: 400; display: block; margin-top: 2px; }

/* Phones: one panel at a time via tabs. Without JS both are shown. */
.cook.is-enhanced .cook-panel:not(.is-active) { display: none; }

@media (min-width: 900px) {
    .cook-tabs { display: none !important; }
    .cook-layout { grid-template-columns: minmax(280px, 1fr) 2fr; align-items: start; }
    .cook.is-enhanced .cook-panel:not(.is-active) { display: block; }
    .cook-ingredients { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; order: 0; }
}

.cook-checklist { list-style: none; margin: 0 0 10px; padding: 0; }
.cook-check {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 4px; margin: 0;
    border-bottom: 1px dashed var(--line);
    font-weight: normal; font-size: 1.08rem; cursor: pointer;
}
.cook-check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--ok); }
.cook-check .amount { flex: 0 0 6.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cook-check .note { color: var(--muted); }
.cook-check:has(input:checked) { color: var(--muted); }
.cook-check:has(input:checked) .amount, .cook-check:has(input:checked) .name { text-decoration: line-through; }
.cook-hint { font-size: .85rem; margin-top: 10px; }

.cook-progress { margin-bottom: 14px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.cook-progress__bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.cook-progress__bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

.cook-step { padding-bottom: 20px; }
.cook-step + .cook-step { border-top: 1px dashed var(--line); padding-top: 16px; }
.cook.is-enhanced .cook-step + .cook-step { border-top: 0; padding-top: 0; }
.cook-step__num { color: var(--muted); font-size: .9rem; font-weight: 600; margin: 0 0 4px; }
.cook.is-enhanced .cook-step__num { display: none; }
.cook-step__heading { font-size: 1.1rem; color: var(--accent-dark); margin: 0 0 6px; }
.cook-step__text { font-size: var(--cook-text); line-height: 1.5; white-space: pre-line; }
.cook-done { font-size: 1.6rem; font-weight: 700; margin: 10px 0 18px; }

.cook-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.cook-timer .btn { min-height: 50px; font-size: 1.05rem; }
.cook-timer__display { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cook-timer.is-running .cook-timer__display { color: var(--accent-dark); }
.cook-timer.is-done .cook-timer__display { color: var(--error); animation: cook-blink 1s steps(2, start) infinite; }
@keyframes cook-blink { to { visibility: hidden; } }

.cook-nav {
    position: sticky; bottom: 0;
    display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--surface) 75%, transparent);
}
.cook-nav .btn { min-height: 58px; font-size: 1.15rem; }
.cook-nav .btn[disabled] { opacity: .45; cursor: default; }

.cook-timers {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 20;
    display: flex; flex-direction: column; gap: 6px;
}
.cook-timers__item {
    border: 0; border-radius: 999px; padding: 8px 16px;
    background: var(--text); color: var(--bg); font: inherit; font-weight: 650; font-variant-numeric: tabular-nums;
    box-shadow: var(--shadow); cursor: pointer;
}
.cook-timers__item.is-done { background: var(--error); }

@media (max-width: 559px) {
    .cook-wake { width: 42px; padding: 0; font-size: 1.2rem; }
    .cook-wake__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.cook-check .name { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

/* ---------- URL import ---------- */

.import-notice {
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.import-notice p { margin: 0 0 6px; }
.import-notice p:last-child { margin-bottom: 0; }
.import-notice ul { margin: 6px 0 0; padding-left: 20px; }
.import-notice__warn { color: var(--error); }
.group [data-collection-target="list"] { min-height: 12px; }

@container ingredients (max-width: 599px) {
    .ingredient-row:has([data-alternative]:checked) { margin-left: 10px; }
}

/* ---------- Recipe editor: tabs and columns ---------- */

.container--editor { max-width: 1320px; }

.editor-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--line);
}
.editor-tabs [role=tab] {
    position: relative;
    padding: 10px 16px;
    margin-bottom: -2px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    cursor: pointer;
}
.editor-tabs [role=tab][aria-selected=true] { color: var(--accent-dark); border-bottom-color: var(--accent); }
.editor-tabs [role=tab].has-error::after {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--error);
    color: #fff;
    font-size: .75rem;
    vertical-align: 1px;
}

.editor-general, .editor-recipe { display: grid; gap: 16px; align-items: start; }
.editor-general > .editor-col > .card + .card { margin-top: 16px; }
.editor-recipe > .card + .card { margin-top: 0; }
.editor-ingredients { container: ingredients / inline-size; }

@media (min-width: 1000px) {
    .editor-general { grid-template-columns: 1.3fr 1fr; }
}
@media (min-width: 1200px) {
    .editor-recipe { grid-template-columns: 1.2fr 1fr; }
}

/* "Verbinden" sits in the gap between two ingredient groups. */
.group { position: relative; }
.group + .group { margin-top: 30px; }
.group-gap {
    position: absolute;
    left: 0;
    right: 0;
    top: -31px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-collection-target="list"] > .group:first-child .group-gap { display: none; }

/* ---------- Redesign: auth pages, phone navigation ---------- */

.auth-card { margin-top: 8vh; padding: 32px 28px; text-align: left; }
.auth-card h1 { text-align: center; font-size: 1.8rem; margin-bottom: 4px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 18px; }
.brand__mark--lg { width: 56px; height: 56px; border-radius: 16px; }
.auth-sub { text-align: center; margin: 0 0 24px; }

.nav--tools { padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line); }

/* Phones: brand and tools on top, main links in a swipeable row below. */
@media (max-width: 759px) {
    .site-header .container { gap: 0; padding-top: 8px; min-height: 0; }
    .nav--tools { border-left: 0; margin: 0; padding: 0; }
    .nav:not(.nav--tools) {
        order: 3;
        flex-wrap: nowrap;
        width: calc(100% + 40px);
        margin: 6px -20px 0;
        padding: 0 20px 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { white-space: nowrap; }
    main { padding-top: 20px; }
    .page-head--hero .actions { width: 100%; flex-wrap: nowrap; }
    .page-head--hero .actions .btn { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; font-size: .92rem; }
    .chips:not(.chips--sub) {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        width: calc(100% + 40px);
        margin-left: -20px;
        padding: 0 20px 2px;
    }
    .chips::-webkit-scrollbar { display: none; }
    .chip { white-space: nowrap; }
    .recipes--grid { gap: 24px 14px; }
    .recipe-card__title { font-size: 1rem; }
}

/* ---------- Redesign: editor, cooking view, admin ---------- */

.group { background: var(--accent-tint); border-color: transparent; }
.step-row { background: var(--accent-tint); border-color: transparent; }
.ingredient-row { border-color: var(--line); }
.quick { background: var(--accent-tint); border-radius: var(--radius-sm); }
.yield-types .check { border-radius: 999px; padding: 8px 16px; }
.yield-types .check:has(input:checked) { color: var(--accent-dark); font-weight: 600; }

.sticky-actions {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    padding: 12px 0;
    margin-top: 24px;
}

input[type=file]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--surface-2); }
.photo-preview { border-radius: var(--radius-sm); }

.editor-tabs { border-bottom-width: 1px; }
.editor-tabs [role=tab] { margin-bottom: -1px; }

.cook-bar { background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.cook-tabs button { border-radius: 999px; }
.cook-panel { border-radius: 20px; }
.cook-ingredients { background: var(--accent-tint); border-color: transparent; box-shadow: none; }
.cook-check { border-bottom: 1px solid var(--hairline); }
.cook-check input { accent-color: var(--accent); }
.cook-check .amount { color: var(--accent-dark); }
.cook-step__heading { color: var(--accent-dark); }
.cook-nav { background: linear-gradient(to top, var(--surface) 75%, transparent); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table { background: var(--surface); }
th { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.import-notice { background: var(--accent-tint); }
td { vertical-align: middle; }
td a:not(.btn) { text-decoration: none; font-weight: 600; }
td a:not(.btn):hover { text-decoration: underline; }

@media (max-width: 479px) { .hide-sm { display: none; } }

/* ---------- Dark mode: the whole page on a slate board ---------- */

.settings__views--3 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .settings__views--3 { grid-template-columns: repeat(3, 1fr); } }

:root[data-mode=dark] {
    color-scheme: dark;
    --slate: #222c30;
    --bg: #222c30;
    --surface: rgba(255, 255, 255, .045);
    --surface-2: rgba(255, 255, 255, .07);
    --text: #f1efe8;
    --muted: rgba(241, 239, 232, .64);
    --line: rgba(241, 239, 232, .13);
    --hairline: rgba(241, 239, 232, .1);
    --accent: #13898a;
    --accent-dark: #8fd8d2;
    --accent-soft: rgba(143, 216, 210, .15);
    --accent-tint: rgba(255, 255, 255, .04);
    --ok: #8fdcae;
    --ok-soft: rgba(143, 220, 174, .14);
    --error: #ff9d92;
    --error-soft: rgba(255, 140, 128, .14);
    --header-bg: rgba(30, 39, 43, .82);
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .25), 0 14px 36px rgba(0, 0, 0, .3);
}

[data-mode=dark] body {
    background-color: var(--slate);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .065 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(ellipse 55% 40% at 12% 8%, rgba(255, 255, 255, .06), transparent 70%),
        radial-gradient(ellipse 45% 35% at 88% 30%, rgba(255, 255, 255, .04), transparent 70%),
        radial-gradient(ellipse 60% 45% at 50% 95%, rgba(255, 255, 255, .035), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .28));
    background-attachment: fixed;
}

[data-mode=dark] .site-header { background: var(--header-bg); border-bottom-color: var(--line); }
[data-mode=dark] h1 { text-shadow: 0 0 1px rgba(241, 239, 232, .35); }

/* Solid fills stay readable: white text on petrol, dark text on chalk. */
[data-mode=dark] .btn:not(.btn--secondary):not(.btn--ghost):not(.btn--danger) { color: #fff; }
[data-mode=dark] .btn--secondary, [data-mode=dark] .btn--ghost { background: transparent; border-color: rgba(241, 239, 232, .28); }
[data-mode=dark] .btn--secondary:hover, [data-mode=dark] .btn--ghost:hover { background: rgba(241, 239, 232, .08); border-color: rgba(241, 239, 232, .45); }
[data-mode=dark] .btn--ghost .icon { color: var(--accent-dark); }
[data-mode=dark] .btn--danger { background: transparent; }
[data-mode=dark] .brand__mark { background: var(--accent); }

[data-mode=dark] input[type=text], [data-mode=dark] input[type=email], [data-mode=dark] input[type=password],
[data-mode=dark] input[type=url], [data-mode=dark] input[type=number], [data-mode=dark] input[type=search],
[data-mode=dark] input:not([type]), [data-mode=dark] select, [data-mode=dark] textarea {
    background: rgba(0, 0, 0, .22);
    border-color: var(--line);
}
[data-mode=dark] select option { background: #222c30; color: var(--text); }
[data-mode=dark] ::placeholder { color: rgba(241, 239, 232, .42); }
[data-mode=dark] input[type=file]::file-selector-button { background: transparent; color: var(--text); border-color: rgba(241, 239, 232, .28); }

[data-mode=dark] .search { background: rgba(0, 0, 0, .22); }
[data-mode=dark] .search:focus-within { background: rgba(0, 0, 0, .3); }
[data-mode=dark] .chip { background: transparent; }
[data-mode=dark] .chip.is-active { background: var(--text); border-color: var(--text); color: #1d2629; }
[data-mode=dark] .view-switch__btn[aria-pressed=true] { background: rgba(241, 239, 232, .14); box-shadow: none; }

[data-mode=dark] .recipe-card__media { background: rgba(0, 0, 0, .2); }
[data-mode=dark] .recipe-card__placeholder {
    color: var(--text);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .07), transparent 60%),
        rgba(0, 0, 0, .18);
    box-shadow: inset 0 0 0 1px rgba(241, 239, 232, .08);
}
[data-mode=dark] .recipe-card__placeholder .icon { opacity: .4; }
[data-mode=dark] .recipes--list .recipe-card:hover { background: rgba(255, 255, 255, .04); }

[data-mode=dark] .card, [data-mode=dark] .cook-panel { background: rgba(255, 255, 255, .04); border-color: var(--line); box-shadow: none; }
[data-mode=dark] .ingredients { background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 1px rgba(241, 239, 232, .07); }
[data-mode=dark] .cook-ingredients { background: rgba(0, 0, 0, .18); }
[data-mode=dark] .notes-box { background: rgba(0, 0, 0, .16); }
[data-mode=dark] .scale-info { background: rgba(255, 255, 255, .06); }
[data-mode=dark] .stepper { background: rgba(0, 0, 0, .2); }
[data-mode=dark] .stepper input[type=number] { background: transparent; }
[data-mode=dark] .stepper__btn { background: rgba(241, 239, 232, .1); color: var(--text); }
[data-mode=dark] .stepper__btn:hover { background: var(--accent); color: #fff; }
[data-mode=dark] .steps .step::before { background: var(--accent); color: #fff; }
[data-mode=dark] .steps .step:not(:last-child)::after { background: rgba(241, 239, 232, .12); }
[data-mode=dark] .tag { background: var(--accent-soft); color: var(--accent-dark); }
[data-mode=dark] .tag:hover { background: var(--accent); color: #fff; }

[data-mode=dark] .group, [data-mode=dark] .step-row, [data-mode=dark] .quick { background: rgba(0, 0, 0, .16); }
[data-mode=dark] .ingredient-row { background: rgba(255, 255, 255, .03); }
[data-mode=dark] .gap-btn { background: #273236; border-color: var(--line); }
[data-mode=dark] .sticky-actions { background: rgba(30, 39, 43, .9); }
[data-mode=dark] .cook-bar { background: rgba(30, 39, 43, .9); }
[data-mode=dark] .cook-nav { background: linear-gradient(to top, rgba(30, 39, 43, .96) 75%, transparent); }
[data-mode=dark] .cook-wake.is-on { background: rgba(255, 214, 102, .16); border-color: rgba(255, 214, 102, .4); color: #ffe08a; }
[data-mode=dark] .cook-progress__bar { background: rgba(241, 239, 232, .12); }

[data-mode=dark] table, [data-mode=dark] th { background: transparent; }
[data-mode=dark] th { background: rgba(255, 255, 255, .05); }
[data-mode=dark] .badge { background: rgba(241, 239, 232, .12); }
[data-mode=dark] .choice:has(input:checked) { background: var(--accent-soft); }
[data-mode=dark] .choice:has(input:checked) .choice__icon { color: #fff; }

@media print {
    [data-mode=dark] body { background: #fff; color: #000; }
}
[data-mode=dark] .search input { background: transparent; border: 0; }
[data-mode=dark] .cook-nav { background: none; }
[data-mode=dark] .cook-bar { background: rgba(34, 44, 48, .55); backdrop-filter: blur(10px); }

.nav__form { display: inline-flex; margin: 0; }
.nav button.nav__icon { display: inline-flex; align-items: center; border: 0; background: none; color: var(--muted); border-radius: 999px; cursor: pointer; font: inherit; }
.nav button.nav__icon:hover { color: var(--text); background: var(--surface-2); }

.settings h2 { margin-top: 0; }
.settings + .settings { margin-top: 20px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.notice p { margin: 0; }
