html, body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0 1rem;
    color: #1f2a24;
}

h1:focus {
    outline: none;
}

.lade-hinweis {
    margin-top: 3rem;
    text-align: center;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.kopf {
    align-items: center;
    border-bottom: 1px solid #d5ddd8;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.kopf nav {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.kopf nav a.active {
    font-weight: 600;
}

.angemeldet-als {
    color: #5a6b62;
}

.formular {
    display: grid;
    gap: 0.75rem;
    max-width: 24rem;
}

.formular label {
    display: grid;
    gap: 0.25rem;
}

.formular input,
.formular textarea,
.einladungslink {
    box-sizing: border-box;
    font: inherit;
    padding: 0.4rem 0.5rem;
    width: 100%;
}

.fehler {
    color: #a12622;
    margin: 0;
}

.hinweis {
    color: #2f6f4f;
    margin: 0;
}

/* Einstellungen: zweiter Faktor und Passkeys */
.qr-code svg {
    height: auto;
    max-width: 14rem;
    width: 100%;
}

.codes {
    columns: 2;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    max-width: 24rem;
    padding-left: 1.25rem;
}

.bestaetigung {
    border: 1px solid #b7c9be;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem 1rem 1rem;
}

.passkey-liste,
.verbindungen-liste {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}

.passkey-liste li,
.verbindungen-liste li {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.passkey-name,
.verbindung-name {
    font-weight: 600;
}

.passkey-datum,
.verbindung-datum {
    color: #5a6b62;
}

/* Einstellungen: Verbindungen der Assistenten (STORY-016); der Schlüssel erscheint einmal in einem hervorgehobenen Kasten. */
.neue-verbindung {
    border: 1px solid #b7c9be;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem 1rem 1rem;
}

/* Der Schlüssel hat 46 Zeichen: Das Feld darf breiter sein als die übrigen Formularfelder. */
.neue-verbindung .formular {
    max-width: 34rem;
}

.neue-verbindung input {
    box-sizing: border-box;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    padding: 0.4rem 0.5rem;
    width: 100%;
}

.passkey-anmeldung {
    margin-top: 1rem;
}

/* Einstellungen: eigene Angaben, Mitglieder, Daten und Konto (STORY-014) */
.warnung {
    color: #a12622;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.formular.angaben {
    max-width: 32rem;
}

.formular.angaben textarea {
    resize: vertical;
}

.angaben .allergene legend {
    font-weight: 600;
}

.mitglieder-liste {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}

.mitglieder-liste li {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.mitglied-name {
    font-weight: 600;
}

.mitglied-rolle {
    color: #5a6b62;
}

.einladung {
    display: grid;
    gap: 0.25rem;
    margin-top: 0.75rem;
    max-width: 32rem;
}

/* Zutaten: Liste, Suche und Formular. Mobil zuerst (ab 390 px bedienbar, kein waagerechtes Scrollen). */
.werkzeugleiste {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.suchfeld {
    display: grid;
    flex: 1 1 14rem;
    gap: 0.25rem;
}

.suchfeld input,
.zutat-formular input[type="text"],
.zutat-formular input[type="number"],
.zutat-formular select,
.zutat-auswahl input {
    box-sizing: border-box;
    font: inherit;
    min-width: 0;
    padding: 0.4rem 0.5rem;
    width: 100%;
}

.werkzeugleiste button,
.zutaten-liste button,
.zutat-formular button {
    font: inherit;
    min-height: 2.5rem;
    padding: 0.25rem 0.75rem;
}

.hauptaktion {
    font-weight: 600;
}

.gefahr {
    color: #a12622;
}

.anzahl {
    color: #5a6b62;
    margin: 0 0 0.5rem 0;
}

.zutaten-liste {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.zutaten-liste li {
    align-items: center;
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
}

.zutat-kopf {
    display: grid;
    min-width: 0;
}

.zutat-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.zutat-details {
    color: #5a6b62;
    font-size: 0.9rem;
}

.fehler-zeile {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.zutat-aktionen {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.zutat-formular {
    margin-bottom: 2rem;
    max-width: 40rem;
}

.formular.breit {
    max-width: 40rem;
}

.zutat-formular fieldset {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.75rem;
    margin: 0;
    min-width: 0;
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
}

.zutat-formular .naehrwerte {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.zutat-formular .naehrwerte legend,
.zutat-formular .einheiten legend,
.zutat-formular .allergene legend {
    font-weight: 600;
}

.hilfe {
    color: #5a6b62;
    font-size: 0.9rem;
    margin: 0;
}

.einheiten-tabelle {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.einheiten-tabelle th {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
}

.einheiten-tabelle th:last-child,
.einheiten-tabelle td:last-child {
    width: 6.5rem;
}

.einheiten-tabelle td {
    padding: 0.2rem 0.25rem 0.2rem 0;
}

.nur-lesehilfe {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.allergene-gitter {
    display: grid;
    gap: 0.25rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.formular .auswahl {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    min-height: 2rem;
}

.formular .auswahl input {
    flex: none;
    height: 1.25rem;
    width: 1.25rem;
}

.formular-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Zutaten-Autocomplete (Komponente ZutatAuswahl) */
.zutat-auswahl {
    position: relative;
}

.zutat-auswahl label {
    display: grid;
    gap: 0.25rem;
}

.zutat-auswahl-treffer {
    background: #fff;
    border: 1px solid #b7c9be;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    left: 0;
    list-style: none;
    margin: 0.25rem 0 0 0;
    padding: 0.25rem 0;
    position: absolute;
    right: 0;
    z-index: 10;
}

.zutat-auswahl-treffer li {
    align-items: baseline;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
}

.zutat-auswahl-treffer li.aktiv,
.zutat-auswahl-treffer li:hover {
    background: #e8f0eb;
}

.zutat-auswahl-leer {
    color: #5a6b62;
    cursor: default;
}

.zutat-auswahl-abteilung {
    color: #5a6b62;
    font-size: 0.85rem;
}

.kopf nav {
    flex-wrap: wrap;
}

/* Rezepte: Liste, Detail und Formular. Mobil zuerst (ab 390 px bedienbar, kein waagerechtes Scrollen). */
.knopf {
    align-items: center;
    border: 1px solid #767676;
    border-radius: 0.25rem;
    box-sizing: border-box;
    color: inherit;
    display: inline-flex;
    font: inherit;
    min-height: 2.5rem;
    padding: 0.25rem 0.75rem;
    text-decoration: none;
}

.tagfilter {
    display: grid;
    gap: 0.25rem;
}

.tagfilter select,
.rezept-formular textarea,
.rezept-formular select,
.portionswahl input {
    box-sizing: border-box;
    font: inherit;
    min-width: 0;
    padding: 0.4rem 0.5rem;
}

.rezept-formular {
    grid-template-columns: minmax(0, 1fr);
}

.rezept-formular input[type="text"],
.rezept-formular input[type="number"] {
    min-width: 0;
}

.rezept-formular textarea {
    width: 100%;
}

.allergenfilter,
.rezept-formular fieldset {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin: 0 0 0.5rem 0;
    min-width: 0;
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
}

.allergenfilter legend,
.rezept-formular legend {
    font-weight: 600;
}

.allergenfilter .auswahl {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    min-height: 2rem;
}

.rezepte-liste {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.rezepte-liste > li {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
}

.rezept-titel {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Vorschaufoto in der Liste: links ein Quadrat, rechts der Text. */
.rezepte-liste > li.mit-vorschau {
    column-gap: 0.75rem;
    grid-template-columns: 4.5rem 1fr;
}

.rezepte-liste > li.mit-vorschau > :not(.rezept-vorschau) {
    grid-column: 2;
}

.rezept-vorschau {
    border-radius: 0.375rem;
    grid-column: 1;
    grid-row: 1 / span 5;
    height: 4.5rem;
    object-fit: cover;
    width: 4.5rem;
}

/* Fotos auf der Detailseite: untereinander, auf breiten Schirmen nebeneinander; nie breiter als der Schirm. */
.foto-liste {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
    list-style: none;
    margin: 0 0 1rem 0;
    padding: 0;
}

.foto-liste > li {
    display: grid;
    gap: 0.5rem;
    align-content: start;
}

.foto-liste img {
    background: #e8f0eb;
    border-radius: 0.5rem;
    display: block;
    height: auto;
    max-width: 100%;
}

.foto-wahl {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.foto-wahl input[type="file"] {
    font: inherit;
    max-width: 100%;
    min-height: 2.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tags li {
    background: #e8f0eb;
    border-radius: 1rem;
    font-size: 0.85rem;
    padding: 0.1rem 0.6rem;
}

.rezept-abschnitt {
    margin-bottom: 1.5rem;
}

.portionswahl {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.portionswahl label {
    display: grid;
    gap: 0.25rem;
}

.portionswahl input {
    width: 6rem;
}

.portionswahl button,
.rezept-formular button,
.rezept-abschnitt button {
    font: inherit;
    min-height: 2.5rem;
    min-width: 2.5rem;
    padding: 0.25rem 0.75rem;
}

.rezept-zutaten {
    display: grid;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rezept-zutaten li {
    border-bottom: 1px solid #e3e9e5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    padding: 0.35rem 0;
}

.rezept-zutaten .menge {
    font-variant-numeric: tabular-nums;
    min-width: 6rem;
}

.anleitung {
    overflow-wrap: anywhere;
}

.anleitung pre {
    overflow-x: auto;
}

.naehrwerte-liste {
    display: grid;
    gap: 0.25rem 1rem;
    grid-template-columns: max-content 1fr;
    margin: 0;
}

.naehrwerte-liste dt {
    font-weight: 600;
}

.naehrwerte-liste dd {
    margin: 0;
}

.rezept-zeilen {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0.75rem 0 0 0;
    padding: 0;
}

.rezept-zeilen > li {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    padding: 0.5rem 0.75rem;
}

.rezept-zeilen > li > .zutat-name,
.rezept-zeilen > li > .zeilen-aktionen {
    grid-column: 1 / -1;
}

.zeilen-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.neue-zutat {
    border: 1px solid #b7c9be;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
}

.neue-zutat label {
    display: grid;
    gap: 0.25rem;
}

.neue-zutat input,
.neue-zutat select {
    box-sizing: border-box;
    font: inherit;
    padding: 0.4rem 0.5rem;
    width: 100%;
}

.neue-zutat h2 {
    font-size: 1.1rem;
    margin: 0;
}

.zutat-auswahl-neu {
    font-weight: 600;
}

/* Plan: Tagesliste mobil (ein Tag unter dem anderen), Wochenraster ab 1024 px. Kein waagerechtes Scrollen. */
.plan-leiste select {
    box-sizing: border-box;
    font: inherit;
    max-width: 100%;
    min-width: 0;
    padding: 0.4rem 0.5rem;
}

.plan-neu {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 0.75rem 0.75rem 0.75rem;
}

.plan-neu h2,
.plan h2 {
    font-size: 1.2rem;
}

.plan-tage {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr);
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.plan-tag {
    align-content: start;
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
}

.plan-tag h3 {
    font-size: 1rem;
    margin: 0;
}

.plan-tag button,
.mahlzeit-formular button,
.mahlzeit-formular input,
.mahlzeit-formular select {
    box-sizing: border-box;
    font: inherit;
    max-width: 100%;
    min-height: 2.5rem;
    min-width: 0;
    padding: 0.25rem 0.5rem;
}

.mahlzeit-formular input[type="radio"],
.mahlzeit-formular input[type="checkbox"] {
    min-height: 0;
}

.mahlzeiten {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mahlzeit {
    border-top: 1px solid #e8f0eb;
    display: grid;
    gap: 0.25rem;
    padding-top: 0.5rem;
}

.mahlzeit-art {
    color: #5a6b62;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.mahlzeit-titel {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mahlzeit-vorschau {
    border-radius: 0.375rem;
    height: 3rem;
    object-fit: cover;
    width: 3rem;
}

.tagessumme {
    margin: 0;
}

.mahlzeit-formular {
    border-top: 1px solid #b7c9be;
    display: grid;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.mahlzeit-formular h4 {
    margin: 0;
}

.mahlzeit-formular label {
    display: grid;
    gap: 0.25rem;
}

.mahlzeit-formular label.auswahl {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    min-height: 2rem;
}

.mahlzeit-formular fieldset {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin: 0;
    min-width: 0;
    padding: 0.25rem 0.75rem 0.5rem 0.75rem;
}

.mahlzeit-formular legend {
    font-weight: 600;
}

.mahlzeit-formular .hilfe,
.mahlzeit-formular .gewaehltes-rezept {
    margin: 0;
}

@media (min-width: 1024px) {
    .plan-tage {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    /* Der erste Tag steht in der Spalte seines Wochentags (Montag = 1, Klasse beginnt-spalte-N). */
    .plan-tag.beginnt-spalte-2 { grid-column-start: 2; }
    .plan-tag.beginnt-spalte-3 { grid-column-start: 3; }
    .plan-tag.beginnt-spalte-4 { grid-column-start: 4; }
    .plan-tag.beginnt-spalte-5 { grid-column-start: 5; }
    .plan-tag.beginnt-spalte-6 { grid-column-start: 6; }
    .plan-tag.beginnt-spalte-7 { grid-column-start: 7; }

    /* Ein geöffnetes Formular bekommt die ganze Zeile: In einer Siebtelspalte wäre es zu schmal. */
    .plan-tage > .plan-tag.mit-formular {
        grid-column: 1 / -1;
    }
}

/* Einkauf: eine Spalte, große Antippflächen (mindestens 3 rem hoch), kein waagerechtes Scrollen ab 360 px. */
.einkauf-leiste button,
.einkauf-panel button,
.einkauf-panel input,
.einkauf-panel select,
.einkauf-abschluss button {
    box-sizing: border-box;
    font: inherit;
    max-width: 100%;
    min-height: 2.5rem;
    min-width: 0;
    padding: 0.25rem 0.5rem;
}

.einkauf-formular input[type="radio"] {
    min-height: 0;
}

.einkauf-panel {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 0.75rem 0.75rem 0.75rem;
}

.einkauf-panel h2,
.einkauf-abteilung h2 {
    font-size: 1.2rem;
}

.einkauf-formular fieldset {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin: 0;
    min-width: 0;
    padding: 0.25rem 0.75rem 0.5rem 0.75rem;
}

.einkauf-formular legend {
    font-weight: 600;
}

.einkauf-formular .gewaehltes-rezept {
    margin: 0;
}

.einkauf-positionen {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
}

.einkauf-position {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.einkauf-position.abgehakt {
    background: #f1f5f2;
}

.einkauf-position.abgehakt .position-name,
.einkauf-position.abgehakt .position-menge {
    color: #5a6b62;
    text-decoration: line-through;
}

.position-haken {
    align-items: center;
    background: none;
    border: 0;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.25rem 0;
    text-align: left;
    width: 100%;
}

.haken-kasten {
    align-items: center;
    border: 2px solid #2f6f4f;
    border-radius: 0.375rem;
    color: #2f6f4f;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 700;
    height: 1.75rem;
    justify-content: center;
    width: 1.75rem;
}

.position-text {
    display: grid;
    min-width: 0;
}

.position-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.position-menge {
    color: #1f2a24;
}

.einkauf-position .zutat-aktionen button {
    font: inherit;
    min-height: 2.5rem;
    padding: 0.25rem 0.75rem;
}

.einkauf-position .zutat-aktionen label {
    display: grid;
    gap: 0.25rem;
}

.einkauf-position .zutat-aktionen input {
    box-sizing: border-box;
    font: inherit;
    min-height: 2.5rem;
    padding: 0.25rem 0.5rem;
    width: 100%;
}

/* Offline-Betrieb und Fassung (STORY-013) */
.offline-hinweis {
    background: #fff3cd;
    border-radius: 0.25rem;
    color: #664d03;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.6rem;
}

.nur-online {
    border: 1px solid #d5ddd8;
    border-radius: 0.5rem;
    margin-top: 2rem;
    padding: 0.5rem 1rem 1rem 1rem;
    text-align: center;
}

.nur-online-titel {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.neue-fassung {
    align-items: center;
    background: #e8f3ec;
    border: 1px solid #2f6f4f;
    border-radius: 0.5rem;
    bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    left: 1rem;
    padding: 0.6rem 1rem;
    position: fixed;
    right: 1rem;
    z-index: 900;
}

.fassung {
    color: #5a6b62;
    font-size: 0.75rem;
    margin: 2rem 0 1rem 0;
    text-align: center;
}
