/* =====================================================================
   Rezepte: Sammlung, Import, Detail, Editor
   Baut auf den Tokens in app.css auf.
   ===================================================================== */

.page-head-row { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.add-btn { min-height: 2.75rem; padding: 0 1.1rem; }
.btn-small { min-height: 2.5rem; padding: 0 1rem; font-size: var(--step--1); }
.hint { font-size: var(--step--1); }
.optional { font-weight: 500; color: var(--ink-faint); }
.plain-link { color: inherit; text-decoration: none; }
.chevron { width: 1.1rem; height: 1.1rem; transform: rotate(180deg); color: var(--ink-faint); }
.search { margin-bottom: 1.25rem; }
.textarea { min-height: 0; padding: .8rem 1rem; line-height: 1.45; resize: vertical; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin: 0 0 1rem -.35rem;
    padding: .35rem .5rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: var(--step--1);
    text-decoration: none;
}
.back-link:hover { background: var(--surface-sunk); }
.back-link svg { width: 1.1rem; height: 1.1rem; }

/* ---------- Teller mit Gericht ---------- */
.dish-plate {
    --plate-size: 100%;
    position: relative;
    width: var(--plate-size);
    aspect-ratio: 1;
    border-radius: 50%;
    padding: 7%;
    background: var(--plate-rim);
    box-shadow: var(--plate-shadow);
    flex: none;
}

.dish-plate img,
.dish-plate .dish-empty {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    object-fit: cover;
    background: var(--plate-well);
}

.dish-plate .dish-empty { color: var(--ink-faint); box-shadow: inset 0 2px 6px rgba(42, 27, 48, .08); }
.dish-plate .dish-empty svg { width: 40%; min-width: 1.1rem; opacity: .75; }
.dish-plate .dish-empty path { vector-effect: non-scaling-stroke; stroke-width: 1.75px; }

/* ---------- Sammlung ---------- */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1.75rem 1.25rem;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    color: inherit;
    text-decoration: none;
}

.recipe-card .dish-plate { margin-bottom: .5rem; transition: transform .35s var(--spring); }
.recipe-card:hover .dish-plate { transform: rotate(-4deg) scale(1.02); }
.recipe-card:active .dish-plate { transform: scale(.97); }

.recipe-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--step-1);
    line-height: 1.12;
    text-wrap: balance;
}

.recipe-card-meta { font-size: var(--step--1); color: var(--ink-soft); }

.skeleton .dish-plate { background: var(--surface-sunk); box-shadow: none; animation: pulse 1.4s ease-in-out infinite; }
.skeleton span { height: 1rem; width: 70%; border-radius: 6px; background: var(--surface-sunk); }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Laufende Importe ---------- */
.import-list { margin-bottom: 1.75rem; }
.import-list > li { padding: 0; }

.import-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: 100%;
    padding: .75rem 1rem;
    color: inherit;
    text-decoration: none;
}
.import-row .grow { display: flex; flex-direction: column; }

.import-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--saffron); flex: none; }
.import-dot[data-status="queued"], .import-dot[data-status="running"] { animation: pulse 1s ease-in-out infinite; }
.import-dot[data-status="review"] { background: var(--basil); }
.import-dot[data-status="failed"] { background: var(--radicchio); }

/* ---------- Hinzufügen-Auswahl ---------- */
.choice-list { display: flex; flex-direction: column; gap: .5rem; }

.choice {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: .9rem 1rem;
    border: 0;
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--spring), background-color .15s;
}
.choice:hover { background: var(--surface-sunk); }
.choice:active { transform: scale(.98); }
.choice:focus-within { outline: 3px solid var(--basil); outline-offset: 2px; }
.choice > svg { width: 1.6rem; height: 1.6rem; color: var(--basil-deep); flex: none; }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- Import: Warten ---------- */
.import-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    padding-top: 2rem;
}
.import-wait h1 { font-size: var(--step-3); }
.import-wait p { margin: 0 auto; }
.plate-spin .plate { animation: plate-wobble 2.4s ease-in-out infinite; }

@keyframes plate-wobble {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg) translateY(-4px); }
}

/* ---------- Aktionen am Seitenende ---------- */
.sticky-actions {
    position: sticky;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + .5rem);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-top: 2rem;
    padding: 1.25rem 0 .25rem;
    background: linear-gradient(to bottom, transparent, var(--kalk) 35%);
}

.action-row { display: flex; gap: .5rem; }
.action-row .grow { flex: 1; }

/* ---------- Editor ---------- */
.editor-section { font-family: var(--font-display); font-size: var(--step-2); }

.editor-head { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.editor-image { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.editor-head .grow { flex: 1 1 16rem; }
.input-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }

.editor-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: span 2; }

.pills { display: flex; flex-wrap: wrap; gap: .4rem; }

.pill {
    min-height: 2.5rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--line);
    color: var(--ink-soft);
    font: 600 var(--step--1)/1 var(--font-body);
    cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.pill[aria-pressed="true"] { background: var(--basil-tint); color: var(--basil-deep); box-shadow: inset 0 0 0 1.5px var(--basil); }

.check { display: flex; align-items: center; gap: .65rem; font-weight: 600; cursor: pointer; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--basil); flex: none; }

.ingredient-rows,
.step-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }

/* Name oben (das Wichtigste), darunter Menge · Einheit · Hinweis */
.ingredient-row {
    display: grid;
    grid-template-columns: 4.5rem 6rem 1fr auto;
    grid-template-areas: "name name name remove" "amount unit note note";
    gap: .4rem;
    padding: .6rem;
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}
.ingredient-row .input { min-height: 2.75rem; padding: 0 .75rem; border-radius: var(--radius-s); }
.ingredient-row .amount { grid-area: amount; }
.ingredient-row .unit { grid-area: unit; }
.ingredient-row .name { grid-area: name; font-weight: 600; }
.ingredient-row .note { grid-area: note; font-size: var(--step--1); }
.ingredient-row .icon-btn { grid-area: remove; }
.ingredient-row.is-new .name { box-shadow: inset 3px 0 0 var(--saffron); }

.new-dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border-radius: 50%; background: var(--saffron); }

.step-row {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .6rem;
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}
.step-row .textarea { border-radius: var(--radius-s); }
.step-options { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.step-options .input { flex: 1 1 12rem; min-height: 2.6rem; }
.step-options .btn { margin-left: auto; }

@media (max-width: 24rem) {
    .ingredient-row {
        grid-template-columns: 4.5rem 1fr auto;
        grid-template-areas: "name name remove" "amount unit unit" "note note note";
    }
}

/* ---------- Detail ---------- */
.recipe-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.recipe-hero .dish-plate { margin-bottom: .5rem; animation: plate-arrive .8s var(--ease-out) both; }
.recipe-hero h1 { font-size: clamp(2.2rem, 9vw, var(--step-5)); }
.recipe-hero p { margin: 0 auto; }

.facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.facts li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2.1rem;
    padding: 0 .85rem;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
    font-size: var(--step--1);
    font-weight: 600;
}
.facts svg { width: 1rem; height: 1rem; }
.facts .effort[data-effort="1"] { background: var(--basil-tint); box-shadow: none; color: var(--basil-deep); }
.facts .effort[data-effort="3"] { background: var(--radicchio-tint); box-shadow: none; color: var(--radicchio); }

.prep-note {
    display: flex;
    gap: .9rem;
    padding: 1rem 1.1rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-m);
    background: var(--saffron-tint);
}
.prep-note svg { width: 1.5rem; height: 1.5rem; flex: none; }
.prep-note p { margin-top: .2rem; }

.recipe-section { margin-bottom: 2.5rem; }
.recipe-section > h2 { margin-bottom: 1rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.group-title { font-family: var(--font-body); font-size: var(--step--1); font-weight: 700; color: var(--ink-soft); margin: 1.25rem 0 .4rem; }

.stepper {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line);
}
.stepper span { min-width: 6.5rem; text-align: center; font-size: var(--step--1); }
.stepper .icon-btn { width: 2.4rem; height: 2.4rem; }
.stepper .icon-btn:disabled { opacity: .35; }

.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--line);
}
.ingredients .qty { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 1.25rem; }
.steps-list li { position: relative; padding-left: 3rem; counter-increment: step; }
.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -.1rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--basil-tint);
    color: var(--basil-deep);
    font-family: var(--font-display);
    font-weight: 800;
}
.steps-list p { line-height: 1.6; }

.timer-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .5rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    background: var(--saffron-tint);
    font-size: var(--step--1);
    font-weight: 700;
}
.timer-chip svg { width: 1rem; height: 1rem; }

.source { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 1.5rem; }
.source svg { width: .9rem; height: .9rem; vertical-align: -.1em; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- iPhone-Einrichtung ---------- */
.secret-box {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .75rem .75rem 1rem;
    border-radius: var(--radius-m);
    background: var(--surface);
    box-shadow: inset 0 0 0 1.5px var(--saffron);
}
.secret-box code { flex: 1; overflow-wrap: anywhere; font-size: .9rem; }
.setup-steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }

.setup-steps code,
.hint code {
    padding: .05rem .35rem;
    border-radius: 6px;
    background: var(--surface-sunk);
    font-size: .88em;
    overflow-wrap: anywhere;
}
