/* Familienkochbuch — die eine CSS-Datei, das Handy zuerst (gelesen wird in
   der Küche). Gestaltung „Porzellan & Leinen“ (Philipp, 23.10.2026): Leinen
   als Grund, Porzellangrün als Hauptfarbe, Rosé und Gold als Zierde, wie
   auf seinen Fotos vom gedeckten Tisch. Überschriften in Fraunces, Text in
   Source Sans 3 (beide SIL Open Font License, public/assets/fonts). Für
   Leserinnen und Leser von 30 bis 80: 18 px Grundschrift, Knöpfe und Felder
   mindestens 48 px hoch, kräftige Kontraste auch für leise Texte. */

@font-face {
    font-family: "Fraunces";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fraunces-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-400-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}

:root {
    --text: #2a2622;
    --text-leise: #5f574f;
    --grund: #faf7f1;
    --flaeche: #ffffff;
    --linie: #e7dfd3;
    --linie-stark: #b3a796;
    --akzent: #2f5d50;
    --akzent-hover: #23483e;
    --auf-akzent: #ffffff;
    --rose: #a8475f;
    --gold: #b8975a;
    /* Teller auf Kacheln ohne Foto: Fläche dahinter und feiner Innenring */
    --teller-grund: #efe8dc;
    --teller-ring: #e2d3b5;
    /* „Bitte prüfen“ der Rezepterkennung */
    --pruefen-grund: #fff4cc;
    --pruefen-rand: #c99700;
    --pruefen-text: #4a3b00;
    --ok: #2f6b3a;
    --fehler: #b3261e;
    --schatten: 0 1px 2px rgba(60, 40, 20, 0.06), 0 6px 18px rgba(60, 40, 20, 0.07);
    --rund: 14px;
    --rund-klein: 10px;
    --titelschrift: "Fraunces", Georgia, "Times New Roman", serif;
    --textschrift: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --abstand: 1rem;
    --breite: 46rem;
    --breite-gross: 72rem;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #ece7df;
        --text-leise: #bcb3a8;
        --grund: #151a18;
        --flaeche: #1e2522;
        --linie: #323c38;
        --linie-stark: #66736d;
        --akzent: #8fc3ae;
        --akzent-hover: #b3d8c9;
        --auf-akzent: #10231c;
        --rose: #e3a2b3;
        --gold: #c9ad78;
        --teller-grund: #1a201e;
        --teller-ring: #4a4434;
        --pruefen-grund: #3a3214;
        --pruefen-rand: #b8901e;
        --pruefen-text: #f3e2a6;
        --ok: #8cc68a;
        --fehler: #f08a80;
        --schatten: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    }
}

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

/* hidden gilt auch, wo eine Klasse display setzt */
[hidden] {
    display: none !important;
}

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

body {
    margin: 0;
    font-family: var(--textschrift);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--grund);
}

a {
    color: var(--akzent);
}

a:hover,
a:focus-visible {
    color: var(--akzent-hover);
}

h1,
h2,
h3 {
    font-family: var(--titelschrift);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 1.9rem;
    margin: 0 0 var(--abstand);
}

/* Kopf */

.kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1.25rem;
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
    padding: 0.75rem var(--abstand);
}

.kopf-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--titelschrift);
    font-weight: 600;
    font-size: 1.4rem;
    text-decoration: none;
    color: var(--akzent);
}

.zweig {
    flex: none;
    width: 2.2rem;
    height: 0.9rem;
    color: var(--gold);
}

.kopf-menue {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
}

.kopf-menue a,
.kopf-menue .knopf-link {
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
}

.kopf-menue a:hover,
.kopf-menue .knopf-link:hover {
    color: var(--akzent);
    text-decoration: underline;
}

.kopf-menue form {
    margin: 0;
}

.testdatenbank {
    margin: 0;
    padding: 0.25rem var(--abstand);
    background: #b3261e;
    color: #fff;
    font-weight: 600;
    text-align: center;
}

/* Inhalt */

.inhalt {
    max-width: var(--breite);
    margin: 0 auto;
    padding: 1.5rem var(--abstand) 3rem;
}

/* Startseite und Rezept: breiter, für Kacheln und zwei Spalten */
.inhalt.breit {
    max-width: var(--breite-gross);
}

.fehlernummer {
    color: var(--text-leise);
    font-size: 0.95rem;
}

h2 {
    font-size: 1.4rem;
    margin: 2rem 0 0.75rem;
}

h3 {
    font-size: 1.15rem;
}

/* Überschrift mit goldener Linie bis zum Rand */
.abschnitt {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.abschnitt::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--gold);
    opacity: 0.6;
}

.leise {
    color: var(--text-leise);
    font-size: 0.95rem;
}

/* Meldungen */

.meldung {
    padding: 0.8rem 1rem;
    border-radius: var(--rund-klein);
    border: 1px solid var(--linie);
    border-left-width: 5px;
    background: var(--flaeche);
}

.meldung-ok {
    border-color: var(--ok);
    border-left-color: var(--ok);
}

.meldung-fehler {
    border-color: var(--fehler);
    color: var(--fehler);
}

/* Formulare */

.formular {
    max-width: 28rem;
}

.feld {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0 0 1rem;
}

fieldset.feld {
    border: 0;
    padding: 0;
    margin: 0 0 1rem;
}

.feld label,
.feld legend {
    font-weight: 600;
    padding: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    font: inherit;
    /* ab 16 px zoomt iOS beim Tippen nicht in das Feld */
    font-size: max(1.0625rem, 16px);
    min-height: 3rem;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--linie-stark);
    border-radius: var(--rund-klein);
    background: var(--flaeche);
    color: var(--text);
    width: 100%;
}

::placeholder {
    color: var(--text-leise);
    opacity: 0.8;
}

textarea {
    line-height: 1.5;
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible,
a:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

/* Kästchen links, der Text bricht eingerückt um */
.haken,
.feld .haken {
    display: block;
    position: relative;
    margin: 0 0 0.75rem;
    padding-left: 1.9rem;
    font-weight: 400;
}

.haken input {
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1.3rem;
    height: 1.3rem;
    margin: 0;
    accent-color: var(--akzent);
}

.erklaerung {
    color: var(--text-leise);
    font-size: 0.95rem;
}

.feldfehler {
    color: var(--fehler);
    font-size: 0.95rem;
}

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.6rem 1.25rem;
    border: 1.5px solid var(--akzent);
    border-radius: var(--rund-klein);
    background: var(--akzent);
    color: var(--auf-akzent);
    text-decoration: none;
    cursor: pointer;
}

.knopf:hover {
    background: var(--akzent-hover);
    border-color: var(--akzent-hover);
    color: var(--auf-akzent);
}

.knopf-leise {
    background: var(--flaeche);
    color: var(--akzent);
}

.knopf-leise:hover {
    background: var(--flaeche);
    color: var(--akzent-hover);
    border-color: var(--akzent-hover);
}

.knopf-link {
    font: inherit;
    padding: 0;
    border: 0;
    background: none;
    color: var(--akzent);
    text-decoration: underline;
    cursor: pointer;
}

/* Listen und Angaben */

.liste,
.geraete {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.liste li,
.geraete li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--linie);
}

.geraete li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.geraete form,
.geraete p {
    margin: 0;
}

.inaktiv {
    opacity: 0.6;
}

.marke {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--linie-stark);
    border-radius: 999px;
    color: var(--text-leise);
    margin-left: 0.25rem;
}

.marke-warnung {
    border-color: var(--fehler);
    color: var(--fehler);
}

.angaben {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0 0 0.5rem;
}

.angaben dt {
    font-weight: 600;
}

.angaben dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.knopf-warnung {
    background: var(--fehler);
    border-color: var(--fehler);
    color: #fff;
}

.knopf-warnung:hover {
    background: var(--fehler);
    border-color: var(--fehler);
    color: #fff;
    filter: brightness(0.9);
}

/* Nur für Screenreader, z. B. Beschriftungen, die aus dem Umfeld klar sind */
.unsichtbar {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.formular-breit {
    max-width: 40rem;
}

.nebeneinander {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.nebeneinander input[type="text"] {
    flex: 1 1 10rem;
    /* sonst bestimmt die Vorgabebreite des Felds (size=20) den Umbruch */
    min-width: 0;
    width: auto;
}

input.kurz {
    width: 5rem;
}

/* Nur in einer Zeile; in einer Spalte (.feld) legte die Basis die Höhe fest */
.nebeneinander input.kurz {
    flex: 0 0 5rem;
}

.zeitfelder {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1rem;
}

.zeitfelder .feld {
    margin: 0;
}

.zeitfelder label {
    font-weight: 400;
}

details > summary {
    cursor: pointer;
}

.einheiten summary {
    color: var(--text-leise);
    font-size: 0.9rem;
}

.einheiten p {
    margin: 0.25rem 0 0;
}

/* Vorschau der Zutaten */

.vorschau {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--linie-stark);
    border-radius: 6px;
    background: var(--flaeche);
    overflow-x: auto;
}

.vorschau-titel {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--text-leise);
}

.vorschau table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95rem;
}

.vorschau th {
    text-align: left;
    font-weight: 600;
    color: var(--text-leise);
    border-bottom: 1px solid var(--linie);
}

.vorschau td,
.vorschau th {
    padding: 0.2rem 0.5rem 0.2rem 0;
    vertical-align: top;
}

.vorschau .menge {
    white-space: nowrap;
}

.vorschau .gruppe td {
    font-weight: 600;
    padding-top: 0.5rem;
}

.zusatz {
    color: var(--text-leise);
}

/* Suche */

.suche {
    margin: 0.75rem 0 1rem;
}

.suche-zeile {
    display: flex;
    gap: 0.5rem;
}

.suche input[type="search"] {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: max(1.0625rem, 16px);
    min-height: 3.25rem;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--linie-stark);
    border-radius: var(--rund-klein);
    background: var(--flaeche);
    color: var(--text);
}

/* Schlagwort und Eingetragen von: am Handy untereinander, am Desktop nebeneinander */
.suche-filter {
    display: grid;
    grid-template-columns: auto minmax(0, 16rem);
    align-items: center;
    gap: 0.5rem 0.6rem;
    margin-top: 0.6rem;
    font-size: 1rem;
}

.suche-filter select {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Kategorien zum Antippen */
.kategorie-wahl {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

.kategorie-wahl a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.3rem 0.95rem;
    border: 1.5px solid var(--linie);
    border-radius: 999px;
    background: var(--flaeche);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
}

.kategorie-wahl a:hover {
    border-color: var(--akzent);
    color: var(--akzent);
}

.kategorie-wahl a[aria-current="true"] {
    background: var(--akzent);
    border-color: var(--akzent);
    color: var(--auf-akzent);
}

.kategorie-wahl .anzahl {
    font-size: 0.85rem;
    opacity: 0.75;
}

.suchergebnis {
    color: var(--text-leise);
}

.rezeptliste .leer {
    grid-column: 1 / -1;
    padding: 0.75rem 0;
}

/* Rezeptliste: Fotokacheln, am Handy zwei, am Desktop vier nebeneinander */

.titelzeile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.titelzeile h1 {
    margin: 0;
}

.kategorie h2 {
    margin-top: 1.75rem;
}

.rezeptliste {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.kachel {
    background: var(--flaeche);
    border-radius: var(--rund);
    box-shadow: var(--schatten);
    overflow: hidden;
}

.kachel a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--text);
    text-decoration: none;
}

.kachel a:hover .kachel-titel {
    color: var(--akzent);
    text-decoration: underline;
}

.vorschaubild {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--linie);
}

/* Ohne jedes Foto: Porzellanteller mit dem Symbol der Kategorie (teile/teller.twig) */
.teller-flaeche {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--teller-grund);
}

.teller {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--flaeche);
    border: 2px solid var(--gold);
    box-shadow: inset 0 0 0 5px var(--flaeche), inset 0 0 0 6px var(--teller-ring);
    color: var(--akzent);
}

.teller svg {
    width: 50%;
    height: 50%;
    stroke-width: 1.25;
}

.teller-zweig svg {
    width: 62%;
    height: auto;
    color: var(--gold);
}

/* Klein: in der Verwaltung neben dem Namen */
.teller.klein {
    width: 2rem;
    flex: none;
    border-width: 1.5px;
    box-shadow: none;
}

.teller.klein svg {
    width: 62%;
    height: 62%;
    stroke-width: 1.5;
}

.teller.klein.teller-zweig svg {
    width: 80%;
    height: auto;
}

.kachel-text {
    padding: 0.6rem 0.75rem 0.8rem;
    line-height: 1.3;
}

.kachel-titel {
    font-weight: 600;
}

.kachel-kategorie {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.9rem;
    color: var(--text-leise);
}

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

/* Fotos auf der Rezeptseite */

.titelbild {
    margin: 0 0 1rem;
}

.titelbild img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-radius: var(--rund);
    box-shadow: var(--schatten);
}

.titelbild figcaption {
    margin-top: 0.25rem;
    color: var(--text-leise);
    font-size: 0.9rem;
}

/* Rezepterkennung aus Fotos (erkennung.js), über dem Formular „Neues Rezept“ */
.erkennung {
    max-width: 40rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1.1rem 1.1rem;
    background: var(--flaeche);
    border: 1.5px dashed var(--gold);
    border-radius: var(--rund);
}

.erkennung h2 {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.erkennung p {
    margin: 0;
}

.erkennung-wahl {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin: 0.9rem 0 0.75rem;
}

/* Der Knopf „Fotos wählen“ ist die Beschriftung des unsichtbaren Dateifelds */
.erkennung-wahl input:focus-visible + label {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

.erkennung-wahl input:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.erkennung-vorschau {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.erkennung-foto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
}

.erkennung-foto img {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border: 1px solid var(--linie);
    border-radius: var(--rund-klein);
}

.erkennung-foto .knopf-link {
    min-height: 2.75rem;
    font-size: 0.95rem;
}

.erkennung-status {
    margin-top: 0.6rem !important;
}

.erkennung-status:empty {
    display: none;
}

.erkennung-status.ok {
    color: var(--ok);
    font-weight: 600;
}

.erkennung-status.fehler {
    color: var(--fehler);
    font-weight: 600;
}

/* Während des Lesens dreht sich ein kleiner Kreis vor dem Text */
.erkennung[aria-busy="true"] .erkennung-status::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    vertical-align: -0.15em;
    border: 2px solid var(--linie-stark);
    border-top-color: var(--akzent);
    border-radius: 50%;
    animation: drehen 0.9s linear infinite;
}

@keyframes drehen {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .erkennung[aria-busy="true"] .erkennung-status::before {
        animation: none;
    }
}

.erkennung-pruefen {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--pruefen-grund);
    border-left: 4px solid var(--pruefen-rand);
    color: var(--pruefen-text);
}

.erkennung-pruefen p {
    font-weight: 600;
}

.erkennung-pruefen ul {
    margin: 0.3rem 0 0;
    padding-left: 1.2rem;
}

.erkennung-hinweis {
    margin-top: 0.75rem !important;
    font-size: 0.9rem;
    color: var(--text-leise);
}

.knopf:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Übersicht der Rezepterkennung in der Verwaltung */
.ki-summe {
    margin-bottom: 0.4rem;
}

.ki-budget {
    display: block;
    width: 100%;
    max-width: 24rem;
    height: 1rem;
    margin: 0 0 1.5rem;
}

/* Foto-Layer (fotolayer.js): das Foto groß über der Seite, sanft eingeblendet */
html.layer-offen {
    overflow: hidden;
}

.fotolayer {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(18, 16, 14, 0.94);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fotolayer[open] {
    display: flex;
    flex-direction: column;
}

.fotolayer.sichtbar {
    opacity: 1;
}

.fotolayer::backdrop {
    background: transparent;
}

.fotolayer-bild {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 0;
}

.fotolayer-bild img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    max-height: calc(100dvh - 9rem);
    object-fit: contain;
    border-radius: var(--rund-klein);
}

.fotolayer-bild figcaption {
    margin-top: 0.6rem;
    color: #ece7df;
    text-align: center;
}

.fotolayer-leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem 0.9rem;
    padding: 0.75rem 1rem max(0.9rem, env(safe-area-inset-bottom));
}

.fotolayer-knopf {
    min-width: 3rem;
    min-height: 3rem;
    padding: 0 0.6rem;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--rund-klein);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.fotolayer-knopf:hover {
    background: rgba(255, 255, 255, 0.12);
}

.fotolayer-schliessen {
    padding: 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.fotolayer-zaehler {
    min-width: 3.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fotolayer :focus-visible {
    outline-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .fotolayer {
        transition: none;
    }
}

/* Geschichte zum Rezept: wie eine eingelegte Notiz; lang zunächst gekürzt (geschichte.js) */
.geschichte {
    max-width: 44rem;
    margin: 0.75rem 0 1.25rem;
    padding: 0.9rem 1.1rem 1rem;
    background: var(--flaeche);
    border-left: 3px solid var(--gold);
    box-shadow: var(--schatten);
}

.geschichte h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    color: var(--akzent);
}

.geschichte-text {
    font-family: var(--titelschrift);
    font-style: italic;
    font-weight: 400;
    font-size: 1.08rem;
    line-height: 1.65;
}

.geschichte-text p {
    margin: 0 0 0.6rem;
}

.geschichte-text p:last-child {
    margin-bottom: 0;
}

/* Etwa fünf Zeilen, unten sanft ausgeblendet */
.geschichte-text.gekuerzt {
    max-height: 8.6em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
    mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.geschichte-knopf {
    margin-top: 0.5rem;
    font-weight: 600;
    min-height: 2.75rem;
}

/* Ohne Titelbild, nur für wer das Rezept bearbeiten darf: Anstoß für ein Foto */
.foto-hinweis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1.5px dashed var(--linie-stark);
    border-radius: var(--rund);
    color: var(--text-leise);
}

.foto-hinweis p {
    flex: 1 1 14rem;
    margin: 0;
}

.galerie {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0 0 1rem;
}

.galerie img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--rund-klein);
    box-shadow: var(--schatten);
}

.galerie .leise {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.85rem;
}

/* Seite „Fotos“ */

.fotoliste {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.fotoliste li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--linie);
}

.foto-vorschau {
    flex: 0 0 7rem;
}

.foto-vorschau img {
    display: block;
    width: 7rem;
    height: 7rem;
    object-fit: cover;
    border-radius: 6px;
}

.foto-angaben {
    flex: 1 1 14rem;
    min-width: 0;
}

.foto-angaben select {
    width: auto;
    flex: 0 0 auto;
}

.foto-angaben .aktionen {
    margin-top: 0.5rem;
}

.fortschritt {
    list-style: none;
    padding: 0;
    font-size: 0.95rem;
}

.fortschritt .ok {
    color: var(--ok);
}

.fortschritt .fehler {
    color: var(--fehler);
}

/* Rezept */

.rezept-kategorie {
    margin: 0;
    color: var(--text-leise);
    font-size: 1rem;
}

.rezept h1 {
    font-size: 2.1rem;
    margin-bottom: 0.3rem;
}

/* „von Oma …“ — ein Hauch Rosé */
.herkunft {
    margin: 0 0 0.5rem;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--rose);
}

.schlagworte {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0;
    margin: 0.5rem 0;
}

.schlagworte li {
    font-size: 0.95rem;
    border: 1.5px solid var(--linie);
    border-radius: 999px;
    background: var(--flaeche);
}

.schlagworte a {
    display: block;
    padding: 0.2rem 0.8rem;
    color: var(--text-leise);
    text-decoration: none;
}

.schlagworte a:hover {
    color: var(--akzent);
}

.rezept-kategorie a {
    color: inherit;
}

.zeiten {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 1rem 0;
}

.zeiten dt {
    font-size: 0.95rem;
    color: var(--text-leise);
}

.zeiten dd {
    margin: 0;
    font-weight: 600;
}

.umrechnen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.umrechnen input {
    width: 4.5rem;
    text-align: center;
}

.bezug {
    margin: 0 0 0.5rem;
}

.faktoren {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}

.faktoren a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.3rem 0.9rem;
    border: 1.5px solid var(--linie);
    border-radius: 999px;
    background: var(--flaeche);
    text-decoration: none;
    white-space: nowrap;
}

.faktoren a.aktiv {
    background: var(--akzent);
    border-color: var(--akzent);
    color: var(--auf-akzent);
}

.umgerechnet {
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.8rem;
    border-left: 4px solid var(--gold);
    border-radius: 4px;
    background: var(--grund);
    font-size: 1rem;
}

/* Rezeptkarte: die Zutaten auf einer weißen Karte, wie ein Teller auf Leinen */
.rezeptkarte {
    padding: 1rem 1.1rem 0.75rem;
    background: var(--flaeche);
    border-radius: var(--rund);
    box-shadow: var(--schatten);
}

.rezeptkarte h2 {
    margin-top: 0.1rem;
}

.zutaten h3 {
    font-size: 1.1rem;
    color: var(--akzent);
    margin: 1rem 0 0.25rem;
}

.zutatenliste {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.zutatenliste li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--linie);
}

.zutatenliste li:last-child {
    border-bottom: 0;
}

.zutatenliste .menge {
    text-align: right;
    font-weight: 600;
    color: var(--akzent);
    font-variant-numeric: tabular-nums;
}

/* Schritte mit Nummern in Kreisen */
.schritte {
    list-style: none;
    counter-reset: schritt;
    padding: 0;
    margin: 0;
}

.schritte li {
    counter-increment: schritt;
    position: relative;
    min-height: 2rem;
    margin-bottom: 1rem;
    padding-left: 2.85rem;
}

.schritte li::before {
    content: counter(schritt);
    position: absolute;
    left: 0;
    top: -0.05rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--akzent);
    border-radius: 50%;
    background: var(--akzent);
    color: var(--auf-akzent);
    font-family: var(--titelschrift);
    font-weight: 600;
    font-size: 1rem;
}

.rezept-spalten {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.rezept-spalten .abschnitt {
    margin-top: 0.4rem;
}

.rezept-fuss {
    margin-top: 2rem;
    color: var(--text-leise);
    font-size: 0.9rem;
}

.aktionen {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.aktionen form {
    margin: 0;
}

.bestaetigen > summary {
    list-style: none;
}

.bestaetigen > summary::-webkit-details-marker {
    display: none;
}

.bestaetigen[open] > summary {
    margin-bottom: 0.5rem;
}

.bestaetigen form {
    padding: 0.75rem;
    border: 1.5px solid var(--fehler);
    border-radius: var(--rund-klein);
    background: var(--flaeche);
}

.bestaetigen form p {
    margin-top: 0;
}

/* Kategorien */

.kategorien {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
}

.kategorien li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--linie);
}

.kategorien .aktionen {
    align-items: center;
    margin-bottom: 0;
}

.kategorien .aktionen .leise {
    margin-right: auto;
}

.symbol-knopf {
    justify-content: center;
    width: 3rem;
    padding: 0;
}

/* Symbol einer Kategorie wählen: alle Teller zum Antippen */
.symbolwahl {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
}

.symbol-feld {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem 0.7rem;
    border: 1.5px solid var(--linie);
    border-radius: var(--rund);
    background: var(--teller-grund);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.25;
    cursor: pointer;
}

.symbol-feld .teller {
    width: 4.5rem;
}

.symbol-feld input {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    accent-color: var(--akzent);
}

.symbol-feld:has(input:checked) {
    border-color: var(--akzent);
    box-shadow: 0 0 0 2px var(--akzent);
}

.symbol-feld:has(input:focus-visible) {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

/* Varianten und Anmerkungen */

.variante,
.varianten {
    margin: 0.25rem 0;
    font-size: 0.95rem;
    color: var(--text-leise);
}

.anmerkung {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--linie);
}

.anmerkung-kopf {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--text-leise);
}

.anmerkung-kopf strong {
    color: var(--text);
}

.anmerkung-text {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.anmerkung-aktionen {
    margin-top: 0.4rem;
}

.anmerkung-aktionen details[open] {
    flex: 1 1 100%;
}

.anmerkung-neu {
    margin-top: 1rem;
    max-width: 40rem;
}

/* Werkzeugleiste der Rezeptseite: Kochansicht, Drucken */

.werkzeuge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.wachstatus {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-leise);
}

.wachstatus:empty {
    display: none;
}

.nur-druck {
    display: none;
}

/* Fotoband oben auf der Startseite (App\Services\Gestaltung) */

.fotoband {
    display: block;
    width: 100%;
    height: 9.5rem;
    margin: 0 0 1.25rem;
    object-fit: cover;
    object-position: center 45%;
    border-radius: var(--rund);
    box-shadow: var(--schatten);
}

/* Anmeldeseiten (anmeldung/rahmen.twig): Foto, darüber die Karte */

.anmeldung {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.anmeldung-bild {
    flex: none;
    /* Niedrig genug, dass am Handy der Knopf noch zu sehen ist */
    height: 30vh;
    min-height: 10rem;
    /* Familienfoto, nicht im Repo (App\Services\Gestaltung); fehlt es, bleibt die Farbe */
    background: var(--linie) url("/gestaltung/anmelden") center 60% / cover no-repeat;
}

.anmeldung-karte {
    position: relative;
    width: 100%;
    max-width: 27rem;
    margin: -2.5rem auto 2rem;
    padding: 1.5rem 1.25rem 1.75rem;
    background: var(--flaeche);
    border-radius: var(--rund);
    box-shadow: 0 10px 30px rgba(40, 30, 20, 0.14);
}

.anmeldung-marke {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.25rem;
    font-family: var(--titelschrift);
    font-weight: 600;
    font-size: 2rem;
    line-height: 1.15;
    text-align: center;
}

.anmeldung-marke .zweig {
    width: 3rem;
    height: 1.2rem;
}

.anmeldung-unter {
    margin: 0 0 1.25rem;
    text-align: center;
    color: var(--text-leise);
}

.anmeldung-karte h1 {
    margin: 0.75rem 0 1rem;
    font-size: 1.45rem;
    text-align: center;
}

.anmeldung-karte .knopf[type="submit"] {
    width: 100%;
}

/* Kochansicht (kochansicht.js): große Schrift, nur Zutaten und Schritte, zum Abhaken */

@media screen {
    html.kochansicht {
        font-size: 125%;
    }

    .kochansicht .kopf,
    .kochansicht .meldung,
    .kochansicht .rezept-kategorie,
    .kochansicht .herkunft,
    .kochansicht .schlagworte,
    .kochansicht .titelbild,
    .kochansicht .foto-hinweis,
    .kochansicht .geschichte,
    .kochansicht .galerie-abschnitt,
    .kochansicht .rezept-fuss,
    .kochansicht .aktionen,
    .kochansicht .variante,
    .kochansicht .varianten,
    .kochansicht .anmerkung-neu,
    .kochansicht .anmerkungen.leer {
        display: none;
    }

    .kochansicht .inhalt {
        padding-top: 0.5rem;
    }

    /* Die Leiste bleibt klein: Bei großer Schrift verdeckte sie sonst das Rezept */
    .kochansicht .werkzeuge {
        gap: 0.4rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--linie);
    }

    .kochansicht .werkzeuge .knopf {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .kochansicht [data-aktion="drucken"] {
        display: none;
    }

    .kochansicht .zutatenliste li,
    .kochansicht .schritte li {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .kochansicht .zutatenliste li {
        position: relative;
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
        padding-left: 2.25rem;
    }

    .kochansicht .schritte li {
        margin-bottom: 1.1rem;
    }

    /* Zutaten: Kästchen zum Abhaken, außerhalb des Rasters der Zeile */
    .kochansicht .zutatenliste li::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0.6rem;
        width: 1.3rem;
        height: 1.3rem;
        border: 2px solid var(--linie-stark);
        border-radius: 4px;
        background: var(--flaeche);
    }

    .kochansicht .zutatenliste .abgehakt::before {
        border-color: var(--akzent);
        background: var(--akzent);
        box-shadow: inset 0 0 0 3px var(--flaeche);
    }

    /* Schritte: Der Nummernkreis ist leer, solange der Schritt offen ist,
       und gefüllt, wenn er erledigt ist */
    .kochansicht .schritte li::before {
        background: var(--flaeche);
        color: var(--akzent);
    }

    .kochansicht .schritte .abgehakt::before {
        background: var(--akzent);
        color: var(--auf-akzent);
    }

    .kochansicht .abgehakt {
        opacity: 0.45;
    }

    .kochansicht .zutatenliste .abgehakt .zutat {
        text-decoration: line-through;
    }

    .kochansicht .zutatenliste li:focus-visible,
    .kochansicht .schritte li:focus-visible {
        outline: 3px solid var(--akzent);
        outline-offset: 2px;
    }
}

/* Druck (Architektur 5.4): A4, ohne Menü und Knöpfe, kleines Titelbild,
   Zutaten zweispaltig — ein Rezept passt so meist auf eine Seite */

@media print {
    @page {
        size: A4;
        margin: 15mm;
    }

    html {
        font-size: 10.5pt;
    }

    body {
        background: #fff;
        color: #000;
    }

    .kopf,
    .testdatenbank,
    .fotoband,
    .foto-hinweis,
    .meldung,
    .werkzeuge,
    .aktionen,
    .umrechnen,
    .faktoren,
    .schlagworte,
    .galerie-abschnitt,
    .nur-bildschirm,
    .titelbild figcaption,
    .varianten,
    .anmerkung-neu,
    .anmerkungen.leer {
        display: none !important;
    }

    .anmerkung {
        padding: 1mm 0;
        border: 0;
        break-inside: avoid;
    }

    .nur-druck {
        display: block;
    }

    /* Die Geschichte steht im Druck klein am Ende */
    .geschichte {
        max-width: none;
        margin: 5mm 0 0;
        padding: 0 0 0 4mm;
        background: none;
        border-left: 1.5px solid #999;
        box-shadow: none;
        break-inside: avoid;
    }

    .geschichte h2 {
        margin: 0 0 1mm;
        font-size: 11pt;
        color: #000;
    }

    .geschichte-text {
        font-size: 9.5pt;
        line-height: 1.45;
    }

    .inhalt {
        max-width: none;
        padding: 0;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    h1,
    .rezept h1 {
        font-size: 20pt;
        margin: 0 0 2mm;
    }

    h2 {
        font-size: 13pt;
        margin: 5mm 0 2mm;
        break-after: avoid;
    }

    .titelbild {
        float: right;
        width: 38%;
        margin: 0 0 4mm 6mm;
    }

    .titelbild img {
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .zeiten {
        margin: 2mm 0;
    }

    .rezept-spalten {
        display: block;
    }

    .rezeptkarte {
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .abschnitt::after {
        display: none;
    }

    .umgerechnet {
        border: 0;
        padding: 0;
        background: none;
        font-style: italic;
    }

    .zutaten-abschnitte {
        columns: 2;
        column-gap: 8mm;
        clear: both;
    }

    .zutaten h3 {
        margin: 2mm 0 1mm;
        break-after: avoid;
    }

    .zutatenliste li {
        grid-template-columns: 5.5rem 1fr;
        gap: 2mm;
        padding: 0.6mm 0;
        border: 0;
        break-inside: avoid;
    }

    .schritte li {
        min-height: 0;
        margin-bottom: 1.5mm;
        padding-left: 2.2rem;
        break-inside: avoid;
    }

    /* Hintergründe druckt der Browser meist nicht: Kreis nur als Rand */
    .schritte li::before {
        width: 1.5rem;
        height: 1.5rem;
        background: none;
        border: 1.5px solid #000;
        color: #000;
        font-size: 0.85rem;
    }

    .rezept-fuss {
        margin-top: 6mm;
        font-size: 8.5pt;
    }
}

/* Nur am Bildschirm, sonst überstimmt es die Druckregeln (A4 ist breiter als 48rem) */
@media screen and (min-width: 48rem) {
    h1 {
        font-size: 2.4rem;
    }

    .rezept h1 {
        font-size: 2.7rem;
    }

    .kopf {
        padding-left: max(var(--abstand), calc((100% - var(--breite-gross)) / 2 + var(--abstand)));
        padding-right: max(var(--abstand), calc((100% - var(--breite-gross)) / 2 + var(--abstand)));
    }

    .rezeptliste {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.25rem;
    }

    /* Rezept: Rezeptkarte links, beim Lesen der Schritte mitlaufend */
    .rezept-spalten {
        grid-template-columns: minmax(19rem, 25rem) 1fr;
        gap: 2.5rem;
        align-items: start;
    }

    .fotoband {
        height: 15rem;
    }

    .suche-filter {
        grid-template-columns: auto minmax(0, 14rem) auto minmax(0, 14rem);
        justify-content: start;
        column-gap: 0.6rem;
    }

    .suche-filter select + label {
        margin-left: 1rem;
    }

    /* Breit und flach, damit das Rezept gleich darunter beginnt */
    .titelbild img {
        max-height: min(28rem, 60vh);
    }

    .rezept-spalten .rezeptkarte {
        position: sticky;
        top: 1rem;
    }

    .anmeldung {
        flex-direction: row;
    }

    .anmeldung-bild {
        flex: 0 0 55%;
        height: auto;
        background-position: center;
    }

    .anmeldung-karte {
        align-self: center;
        margin: 2rem auto;
        padding: 2rem 2rem 2.25rem;
    }

    .anmeldung-karte h1 {
        font-size: 1.6rem;
    }
}
