/*
 * Gestaltungslinie ruhrcoder, Belegung für Spirituosen. Referenz für die gelockerte Linie
 * (Rundungen 8/12 px, zwei dezente Schattenstufen) und die zweigeteilte Anmeldung.
 *
 * Ein Satz Namen, zwei Belegungen. Die Werte gehören zur gemeinsamen Gestaltungslinie und
 * stammen nicht aus diesem Projekt; wer sie ändert, ändert sie zuerst dort.
 *
 * Zwei Rollen gehen über die Tabelle der Linie hinaus, weil deren Werte sonst die eigene
 * Kontrastvorgabe verfehlen:
 *
 *   --accent-text     Der Akzent als Schrift. Im Hellen genügt primary-light (5:1 auf bg),
 *                     im Dunklen trägt das helle Stahlgrau.
 *   --control-border  Der Umriss eines Bedienelements. Die Haarlinie (10 % Schwarz) erreicht
 *                     nur 1,26:1 und machte ein Eingabefeld auf weißem Grund unsichtbar.
 *
 * Beide Belegungen führen denselben Satz Namen; ein Test hält das.
 */

/* ── Schriften ────────────────────────────────────────────────────────────
 *
 * Mitgeliefert statt nachgeladen: Ein fremdes Verteilnetz erführe sonst von jedem Besuch.
 * Variable Fonts, eine Datei trägt alle Gewichte. Nur „latin“ und „latin-ext“; mehr braucht
 * eine deutschsprachige Oberfläche nicht.
 */

@font-face {
    font-family: "Roboto Flex";
    font-style: normal;
    font-weight: 300 900;
    font-stretch: 100%;
    font-display: swap;
    src: url("../fonts/roboto-flex-latin-o_mNbu_.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
        U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Roboto Flex";
    font-style: normal;
    font-weight: 300 900;
    font-stretch: 100%;
    font-display: swap;
    src: url("../fonts/roboto-flex-latin-ext-c_otkH2.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
        U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Roboto Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/roboto-mono-latin-gDELsEF.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
        U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Roboto Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/roboto-mono-latin-ext-SJsT-p8.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
        U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Farbrollen, helle Belegung ───────────────────────────────────────── */

:root {
    color-scheme: light;

    --primary: #2f4858;
    --primary-dark: #0d2b38;
    --primary-light: #26708f;
    --on-primary: #ffffff;
    --accent-text: #26708f;

    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface-raised: #ebebeb;
    --surface-hover: #e4e4e4;

    /* Das Logo ist dunkelblau auf Weiß gezeichnet und steht deshalb in beiden Belegungen
       auf demselben hellen Plättchen. */
    --brand-plate: #ffffff;

    --text: #1a1a1a;
    --text-muted: #5a5a5a;

    --border: rgba(0, 0, 0, 0.1);
    --control-border: #8e8e8e;
    --focus: #26708f;

    /* Gedeckt gehalten; die Aussage tragen Wort und Zeichen, nie die Farbe allein. */
    --state-ok-text: #2c6b3f;
    --state-ok-bg: #e1efe4;
    --state-ok-border: #a9cdb4;

    --state-warn-text: #8a5a17;
    --state-warn-bg: #f6eddd;
    --state-warn-border: #e0c48d;

    --state-error-text: #96332f;
    --state-error-bg: #f5e3e3;
    --state-error-border: #dfafad;

    --state-neutral-text: #5a5a5a;
    --state-neutral-bg: #ebebeb;
    --state-neutral-border: #dcdcdc;

    /* Zwei Stufen, beide dezent: ruhende Fläche und angehobene Fläche (Überfahren,
       Überlagerung). Die Haarlinie trennt weiter; der Schatten gibt nur Halt. */
    --shadow-sm: 0 1px 2px rgba(15, 25, 35, 0.06), 0 1px 3px rgba(15, 25, 35, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 25, 35, 0.1), 0 2px 4px rgba(15, 25, 35, 0.06);

    /* Aromengruppen und Sterne; im Dunklen heller, damit sie auf dunklem Grund tragen. */
    --wheel-fruity: #c2504a;
    --wheel-citrus: #c99422;
    --wheel-floral: #b45f9b;
    --wheel-herbal: #5d8f4e;
    --wheel-spicy: #b8642a;
    --wheel-sweet: #c98a4b;
    --wheel-nutty: #8d6e4f;
    --wheel-woody: #7a5537;
    --wheel-smoky: #5b6670;
    --wheel-maritime: #2f7f9a;
    --star: #c68a12;
    --star-empty: #d4d4d4;

    /* Grundraster 8 px. Ecken 8 px an Bedienelementen, 12 px an Flächen. */
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --radius: 0.5rem;
    --radius-surface: 0.75rem;
    --radius-pill: 999px;
    --hairline: 1px;
    --sidebar-width: 15rem;

    --font: "Roboto Flex", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --line-height: 1.65;
}

/* ── Farbrollen, dunkle Belegung ──────────────────────────────────────── */

[data-theme="dark"] {
    color-scheme: dark;

    --primary: #c5d0d6;
    --primary-dark: #94a3ab;
    --primary-light: #dde5e9;
    --on-primary: #0f1923;
    --accent-text: #dde5e9;

    --bg: #0f1923;
    --surface: #152030;
    --surface-raised: #1a2535;
    --surface-hover: #213048;

    --brand-plate: #ffffff;

    --text: #e4edf2;
    --text-muted: #8aa3b0;

    --border: rgba(255, 255, 255, 0.08);
    --control-border: #5a7288;
    --focus: #dde5e9;

    --state-ok-text: #8fd3a3;
    --state-ok-bg: #16301f;
    --state-ok-border: #2c6b3f;

    --state-warn-text: #e0bc7c;
    --state-warn-bg: #332612;
    --state-warn-border: #8a6a28;

    --state-error-text: #e8a29e;
    --state-error-bg: #341b1b;
    --state-error-border: #8a3a36;

    --state-neutral-text: #8aa3b0;
    --state-neutral-bg: #1a2535;
    --state-neutral-border: #2e3e50;

    /* Auf dunklem Grund muss ein Schatten dunkler sein, um überhaupt sichtbar zu werden. */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);

    /* Aromengruppen und Sterne; im Dunklen heller, damit sie auf dunklem Grund tragen. */
    --wheel-fruity: #e8837d;
    --wheel-citrus: #e8c15e;
    --wheel-floral: #d892c4;
    --wheel-herbal: #8fc27f;
    --wheel-spicy: #e39a62;
    --wheel-sweet: #e6b37f;
    --wheel-nutty: #c3a283;
    --wheel-woody: #b98d6b;
    --wheel-smoky: #9aa6b0;
    --wheel-maritime: #6fbfd9;
    --star: #e0bc7c;
    --star-empty: #3a4a5c;
}

/*
 * Ohne ausdrückliche Wahl bleibt die Seite hell und folgt nicht dem Betriebssystem, wie
 * in den übrigen Anwendungen der Werkstatt. Wer es dunkel will, schaltet um; die Wahl
 * hängt am Bildschirm und überlebt als Cookie.
 */

/* ── Grundlagen ───────────────────────────────────────────────────────── */

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

/* „hidden“ heißt verborgen, auch wenn eine Klasse wie .button ein eigenes display setzt. Sonst
   wären Knöpfe sichtbar, die ein Controller erst zeigt, wenn der Browser die Funktion kann. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: var(--line-height);
}

/* Der Fokus wird gezeichnet, nicht angedeutet; hier einmal für alles Bedienbare. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: var(--radius);
}

a {
    color: var(--accent-text);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Unsichtbar, bis er den Fokus bekommt; dann steht er vorn. */
.skip-link {
    position: absolute;
    top: -3rem;
    left: var(--space-2);
    z-index: 10;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background-color: var(--primary);
    color: var(--on-primary);
    text-decoration: none;
    transition: top 0.1s;
}

.skip-link:focus {
    top: var(--space-1);
}

/* ── Gerüst ───────────────────────────────────────────────────────────── */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* min-width: 0, sonst wächst die Grid-Spalte mit der breitesten Tabelle und die ganze Seite
   scrollt seitlich, statt nur die Tabelle in ihrer Karte. */
.page {
    width: 100%;
    min-width: 0;
    padding: var(--space-4) var(--space-3);
}

/* Lesbares Maß für Fließtext und Formulare; eine Zeile über hundert Zeichen liest niemand gern. */
.card > p,
.card > form {
    max-width: 40rem;
}

/* ── Seitenleiste ─────────────────────────────────────────────────────── */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2);
    border-right: var(--hairline) solid var(--border);
    background-color: var(--surface);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

/* Der Rundungsradius beschneidet die hellen Ecken der Zeichnung mit. */
.brand-mark {
    display: block;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    background-color: var(--brand-plate);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Der aktive Punkt ist gefüllt und trägt aria-current, nicht nur eine andere Schriftfarbe. */
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
}

/* Abmelden ist ein Formular-Knopf, sieht aber aus wie die übrigen Punkte. */
.sidebar__form {
    margin: 0;
}

button.sidebar__link {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sidebar__link:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}

.sidebar__link--active {
    background-color: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
}

.sidebar__link--active:hover {
    background-color: var(--primary-dark);
    color: var(--on-primary);
}

.sidebar__glyph {
    display: inline-flex;
    flex: none;
    justify-content: center;
    width: 1.25rem;
}

/* Überschrift einer Gruppe in der Leiste, etwa der freigegebenen Lager. */
.sidebar__group-title {
    margin: var(--space-2) 0 0.25rem;
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Nebensächliches sitzt unten und abgesetzt. */
.sidebar__aside {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: auto;
    padding-top: var(--space-2);
    border-top: var(--hairline) solid var(--border);
}

.sidebar__user {
    margin: 0 0 var(--space-1);
    padding: 0 0.75rem;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Am Handy trägt die Leiste nicht neben dem Inhalt. Sie legt sich quer über den Kopf und
 * behält Reihenfolge und Aussehen ihrer Punkte; die Beschriftung weicht dem Zeichen,
 * bleibt aber für die Sprachausgabe stehen.
 */
@media (max-width: 48rem) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-1);
        padding: var(--space-1) var(--space-2);
        border-right: 0;
        border-bottom: var(--hairline) solid var(--border);
    }

    .brand > span {
        display: none;
    }

    .sidebar__nav,
    .sidebar__aside {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar__aside {
        margin-top: 0;
        margin-left: auto;
        padding-top: 0;
        border-top: 0;
    }

    .sidebar__user {
        display: none;
    }

    .sidebar__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .sidebar__link {
        padding: 0.5rem 0.65rem;
    }

    .page {
        padding: var(--space-3) var(--space-2);
    }
}

/* ── Seitenkopf ───────────────────────────────────────────────────────── */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.page-head__title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
}

.page-head__lead {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
}

.page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* Klein, gesperrt, in Großbuchstaben: Es ersetzt große Zwischenüberschriften. */
.section-label {
    margin: var(--space-4) 0 var(--space-2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Suche und Filter ─────────────────────────────────────────────────── */

.searchbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.searchbox {
    position: relative;
    flex: 1 1 18rem;
    min-width: 12rem;
}

.searchbox__icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

form .searchbox__input {
    margin-bottom: 0;
    padding-left: 2.25rem;
    padding-right: 2.25rem;
}

.searchbox__clear {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    padding: 0.15rem 0.5rem;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.searchbox__clear:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}

.filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* Der aktive Chip ist gefüllt, fett und mit Haken versehen, nicht nur andersfarbig. */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius-pill);
    background-color: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.chip:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}

.chip--active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
}

.chip--active:hover {
    background-color: var(--primary-dark);
    color: var(--on-primary);
}

/* Ein Filter, der wirkt, aber nicht zu sehen ist, sieht aus wie fehlende Daten. */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Kachel ───────────────────────────────────────────────────────────── */

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: var(--space-2);
}

/* Beim Überfahren wechseln Rand und Schatten; die Kachel springt nicht, sie wird nur deutlicher. */
.tile {
    display: block;
    overflow: hidden;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: var(--surface);
    color: inherit;
    text-decoration: none;
}

a.tile:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.tile__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    padding: 0.6rem 0.9rem;
    background-color: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
}

.tile__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Das Zeichen schmückt; die Aussage trägt die Beschriftung daneben. */
.tile__glyph {
    flex: none;
    font-size: 1.5rem;
    opacity: 0.28;
}

.tile__body {
    padding: 0.75rem 0.9rem;
    overflow-wrap: anywhere;
}

.tile__body p {
    margin: 0 0 0.35rem;
}

.tile__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/*
 * Das Hauptfoto in einer quadratischen Fläche, damit die Reihen gleich hoch bleiben. Ganz
 * gezeigt statt beschnitten: Flaschen sind hochkant, und abgeschnitten wäre das Etikett.
 */
.tile__photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    background-color: var(--surface-raised);
}

/* ── Listenansicht ────────────────────────────────────────────────────── */

.bottle-list {
    display: grid;
    gap: var(--space-1);
}

.bottle-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bottle-row:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.bottle-row__photo {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    overflow: hidden;
    border-radius: var(--radius);
    background-color: var(--surface-raised);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.bottle-row__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bottle-row__main {
    display: grid;
    min-width: 0;
}

.bottle-row__name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottle-row__status .tile__badges {
    margin: 0;
}

@media (max-width: 48rem) {
    .bottle-row {
        grid-template-columns: 3rem 1fr;
    }

    .bottle-row__status {
        grid-column: 2;
    }
}

.view-switch {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 var(--space-1);
}

/* Weitere Filter: zugeklappt, solange keiner wirkt; Suche und Status bleiben immer sichtbar. */
.filter-panel {
    flex: 1 1 100%;
    padding: var(--space-1) var(--space-2);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
}

.filter-panel__summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-panel[open] .filter-panel__summary {
    margin-bottom: var(--space-2);
}

.filter-panel .button {
    margin-bottom: var(--space-1);
}

/* ── Fotos ────────────────────────────────────────────────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.photo-card {
    margin: 0;
    overflow: hidden;
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface-raised);
}

/* Das Hauptfoto ist am Rahmen und am Wort erkennbar, nicht an der Farbe allein. */
.photo-card--main {
    border-color: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--primary-light);
}

.photo-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.photo-card__pending {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    margin: 0;
    padding: var(--space-1);
    text-align: center;
}

.photo-card__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.35rem;
    background-color: var(--surface);
}

.photo-card__actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.photo-card__actions form {
    margin: 0;
}

/* Knopf nur mit Zeichen; die Beschriftung trägt aria-label. 44 px Klickfläche nach WCAG. */
.icon-button {
    display: inline-grid;
    place-items: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.icon-button:hover {
    background-color: var(--surface-hover);
}

.photo-upload {
    margin-top: var(--space-2);
}

/* Erbt Farbe und Größe der Schrift daneben und passt sich so beiden Belegungen an. */
.icon {
    width: 1em;
    height: 1em;
    flex: none;
    vertical-align: -0.125em;
}

/* ── Angaben, Karte, Leerzustand ──────────────────────────────────────── */

.detail-rows {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    gap: 0.3rem var(--space-2);
    margin: 0;
}

.detail-rows dt {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.card {
    padding: var(--space-2) var(--space-3);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow-sm);
    background-color: var(--surface);
}

.card + .card,
.tiles + .card {
    margin-top: var(--space-2);
}

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

/* „Nichts vorhanden“ und „nichts gefunden“ sind zwei Lagen und brauchen zwei Sätze. */
.empty-state {
    padding: var(--space-4) var(--space-3);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius-surface);
    background-color: var(--surface);
    text-align: center;
}

.empty-state__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.empty-state__text {
    margin: 0 0 var(--space-2);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state__text:last-child {
    margin-bottom: 0;
}

/* ── Zustandsabzeichen ────────────────────────────────────────────────── */

/* Zeichen und Wort tragen die Aussage, die Farbe unterstützt sie nur. */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.6rem;
    border: var(--hairline) solid var(--state-neutral-border);
    border-radius: var(--radius-pill);
    background-color: var(--state-neutral-bg);
    color: var(--state-neutral-text);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--ok {
    border-color: var(--state-ok-border);
    background-color: var(--state-ok-bg);
    color: var(--state-ok-text);
}

.badge--warn {
    border-color: var(--state-warn-border);
    background-color: var(--state-warn-bg);
    color: var(--state-warn-text);
}

.badge--error {
    border-color: var(--state-error-border);
    background-color: var(--state-error-bg);
    color: var(--state-error-text);
}

/* Ausdrücklich neutral, wo eine Zustandsliste sonst eine Lücke in der Farbreihe hätte. */
.badge--neutral {
    border-color: var(--state-neutral-border);
}

/* ── Schaltflächen ────────────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border: var(--hairline) solid transparent;
    border-radius: var(--radius);
    background-color: var(--primary);
    color: var(--on-primary);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background-color: var(--primary-dark);
}

.button--secondary {
    border-color: var(--control-border);
    background-color: var(--surface);
    color: var(--text);
}

.button--secondary:hover {
    background-color: var(--surface-hover);
}

/* Gesperrt heißt sichtbar gesperrt; der Grund steht als Satz daneben. */
.button:disabled {
    border-color: var(--state-neutral-border);
    background-color: var(--state-neutral-bg);
    color: var(--state-neutral-text);
    cursor: not-allowed;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.actions form {
    margin: 0;
}

/* ── Formulare ────────────────────────────────────────────────────────── */

/* .field-group: Beschriftung und Feld außerhalb eines Formulars, etwa der Einladungslink. */
form label,
.field-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

form input,
form textarea,
form select,
.field-group input {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    margin-bottom: var(--space-2);
    padding: 0.55rem 0.75rem;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius);
    background-color: var(--surface);
    color: var(--text);
    font: inherit;
}

/*
 * Ein Ankreuzfeld ist kein Eingabefeld. Als Block über die volle Breite stünde es allein
 * in seiner Zeile, und niemand sähe mehr, welches Kästchen zu welchem Wort gehört.
 */
form input[type="checkbox"] {
    display: inline-block;
    width: 1.15rem;
    min-height: 0;
    height: 1.15rem;
    margin: 0;
    accent-color: var(--primary-light);
}

form label:has(> input[type="checkbox"]),
.checkbox-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
    font-weight: 400;
}

.form-row {
    margin-bottom: var(--space-2);
}

/*
 * Kurze Felder nebeneinander, sobald Platz ist; am Handy untereinander. Die Spaltenbreite
 * richtet sich nach dem Formular, nicht nach dem Fenster.
 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: 0 var(--space-2);
}

/* Eine Merkmalsgruppe je Kategorie; ohne JavaScript stehen alle untereinander. */
.attribute-set {
    min-width: 0;
    margin: 0 0 var(--space-2);
    padding: var(--space-2);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius);
}

.attribute-set__legend {
    padding: 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Statusauswahl neben der Hauptaktion: Feld und Knopf in einer Reihe. */
.status-select {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    align-items: center;
}

form.status-select select {
    width: auto;
    margin: 0;
}

/* Freitext behält seine Zeilenumbrüche. */
.prose {
    white-space: pre-line;
}

/* Die ganze Kachel ist die Fläche zum Tippen; am Handy trifft der Daumen sonst das Wort daneben. */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    gap: var(--space-1);
    margin-bottom: 0.35rem;
}

.choice-chip {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius);
    background-color: var(--surface);
    font-weight: 400;
    cursor: pointer;
}

.choice-chip:hover {
    background-color: var(--surface-hover);
}

.choice-chip:has(input:checked) {
    border-color: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--primary-light);
    font-weight: 600;
}

.choice-chip:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

form .choice-chip input[type="radio"] {
    display: inline-block;
    width: 1.1rem;
    min-height: 0;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--primary-light);
}

.form-row > input,
.form-row > select,
.form-row > textarea {
    margin-bottom: 0.35rem;
}

.help-text {
    margin: 0 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Ein fehlerhaftes Feld ist am Rand zu erkennen, nicht nur am Text darunter. */
form input[aria-invalid="true"],
form textarea[aria-invalid="true"],
form select[aria-invalid="true"] {
    border-color: var(--state-error-text);
}

/* Unter dem Feld liest sich die Meldung als Antwort auf die eigene Eingabe. */
.field-error {
    margin: 0 0 0.35rem;
    padding: 0;
    color: var(--state-error-text);
    font-size: 0.85rem;
    list-style: none;
}

.field-error .icon {
    margin-right: 0.35rem;
}

/* ── Hinweise ─────────────────────────────────────────────────────────── */

.notice {
    margin: 0 0 var(--space-3);
    padding: 0.6rem 0.9rem;
    border: var(--hairline) solid var(--state-neutral-border);
    border-left-width: 3px;
    border-radius: var(--radius-surface);
    background-color: var(--state-neutral-bg);
    color: var(--state-neutral-text);
}

.notice--error {
    border-color: var(--state-error-border);
    background-color: var(--state-error-bg);
    color: var(--state-error-text);
}

.notice--success {
    border-color: var(--state-ok-border);
    background-color: var(--state-ok-bg);
    color: var(--state-ok-text);
}

.notice--warn {
    border-color: var(--state-warn-border);
    background-color: var(--state-warn-bg);
    color: var(--state-warn-text);
}

/* ── Einladung ────────────────────────────────────────────────────────── */

/*
 * QR-Code neben dem Link, am Handy darunter. Der Code bringt seine weiße Fläche in beiden
 * Belegungen mit: Eine Kamera braucht den Kontrast, gleich welches Erscheinungsbild gilt.
 */
.invitation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.invitation__qr {
    flex: none;
    width: 14rem;
    height: 14rem;
    border-radius: var(--radius);
    background-color: var(--brand-plate);
}

.invitation__link {
    flex: 1 1 18rem;
    min-width: 0;
}

/* ── Blätterung ───────────────────────────────────────────────────────── */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
}

.pagination p {
    margin: 0;
}

/* ── Erscheinungsbild umschalten ──────────────────────────────────────── */

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.theme-switch:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}

/* ── Anmeldung ────────────────────────────────────────────────────────── */

/*
 * Zweigeteilt: Die Markenfläche links sagt, wo man ist, das Formular rechts steht allein
 * auf ruhigem Grund. Am Handy wird die Marke zum schmalen Band, damit die Felder ohne
 * Scrollen über der Tastatur bleiben.
 */
.auth {
    display: grid;
    grid-template-columns: minmax(20rem, 5fr) 7fr;
    min-height: 100vh;
}

.auth__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-4) clamp(var(--space-4), 5vw, 5rem);
    background-color: var(--primary);
    color: var(--on-primary);
}

.auth__logo {
    width: 10rem;
    height: 10rem;
    border-radius: var(--radius-surface);
    background-color: var(--brand-plate);
}

.auth__name {
    margin: 0;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.auth__tagline {
    max-width: 26rem;
    margin: var(--space-1) auto 0;
    font-size: 1.1rem;
    opacity: 0.85;
}

.auth__main {
    position: relative;
    display: grid;
    place-items: center;
    padding: var(--space-4) var(--space-3);
}

.auth__switch {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
}

.auth__panel {
    width: 100%;
    max-width: 24rem;
}

.auth__title {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.auth__lead {
    margin: 0.35rem 0 var(--space-4);
    color: var(--text-muted);
}

.auth__capslock {
    margin: 0.35rem 0 0;
    color: var(--state-warn-text);
    font-size: 0.85rem;
}

.auth__hint {
    margin: var(--space-3) 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 48rem) {
    .auth {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth__brand {
        flex-direction: row;
        gap: var(--space-2);
        padding: var(--space-2);
    }

    .auth__logo {
        width: 3rem;
        height: 3rem;
    }

    .auth__name {
        font-size: 1.35rem;
    }

    .auth__tagline {
        display: none;
    }

    .auth__main {
        align-items: start;
        padding: var(--space-4) var(--space-2);
    }

    .auth__switch {
        top: var(--space-2);
        right: var(--space-2);
    }

    .auth__panel {
        margin-top: var(--space-3);
    }
}

/* ── Eingabefeld mit Zeichen ──────────────────────────────────────────── */

/* Das Zeichen links sagt auf einen Blick, was in das Feld gehört; die Beschriftung bleibt. */
.input-icon {
    position: relative;
}

.input-icon__glyph {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

form .input-icon input {
    margin-bottom: 0;
    padding-left: 2.6rem;
}

form .input-icon input:has(~ .input-icon__toggle:not([hidden])) {
    padding-right: 3rem;
}

.input-icon__toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.input-icon__toggle:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}

/* Der Fokus liegt sichtbar am Feld, nicht nur am Rand des Browsers. */
form input:focus-visible {
    border-color: var(--focus);
    outline: 2px solid var(--focus);
    outline-offset: 0;
}

.button--block {
    width: 100%;
    margin-top: var(--space-1);
    font-weight: 600;
}

/* Wer Bewegung im System abgeschaltet hat, bekommt auch hier keine. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* ── Verkostungen ─────────────────────────────────────────────────────── */

/*
 * Skalen 0–5 als Reihe gleich breiter Felder. Der Kreis des Auswahlknopfs bleibt für Tastatur
 * und Sprachausgabe im Dokument, sichtbar ist nur das Feld mit der Ziffer.
 */
.tasting-form .choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tasting-form .choice-chip {
    position: relative;
    flex: 1 1 0;
    min-width: 2.25rem;
    justify-content: center;
    padding: 0.4rem 0.25rem;
    white-space: nowrap;
}

.rating-preview .stars {
    font-size: 1.6rem;
}

form.tasting-form .choice-chip input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.scale-row {
    display: grid;
    grid-template-columns: minmax(7rem, 11rem) 1fr;
    gap: var(--space-1);
    align-items: center;
    margin-bottom: var(--space-1);
}

.scale-row__label {
    font-weight: 600;
}

.scale-row--small .scale-row__label {
    font-weight: 400;
}

.scale-row--small .choice-chip {
    min-height: 2.25rem;
}

@media (max-width: 40rem) {
    .scale-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.aroma-panel {
    margin: 0 0 var(--space-2);
    padding: var(--space-2);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius-surface);
}

.aroma-panel__title {
    padding: 0 0.35rem;
    font-weight: 600;
}

.aroma-wheel__chart {
    display: block;
    width: min(100%, 22rem);
    margin: 0 auto var(--space-2);
}

.aroma-wheel__segment {
    cursor: pointer;
    outline: none;
}

.aroma-wheel__segment path {
    fill: var(--group-color);
    fill-opacity: 0.1;
    stroke: var(--surface);
    stroke-width: 2;
    transition: fill-opacity 0.15s ease;
}

/* Die Farbtiefe ist die Intensität: kaum getönt für „nicht gewählt“, satt für 5. */
.aroma-wheel__segment[data-intensity="1"] path { fill-opacity: 0.3; }
.aroma-wheel__segment[data-intensity="2"] path { fill-opacity: 0.45; }
.aroma-wheel__segment[data-intensity="3"] path { fill-opacity: 0.6; }
.aroma-wheel__segment[data-intensity="4"] path { fill-opacity: 0.78; }
.aroma-wheel__segment[data-intensity="5"] path { fill-opacity: 0.95; }

.aroma-wheel__segment--active path,
.aroma-wheel__segment:hover path {
    stroke: var(--text);
    stroke-width: 2.5;
}

.aroma-wheel__segment:focus-visible path {
    stroke: var(--focus);
    stroke-width: 4;
}

/* Der helle Rand um die Schrift hält sie auf jeder Farbtiefe lesbar. */
.aroma-wheel__segment text,
.aroma-wheel__hint {
    fill: var(--text);
    font-size: 11px;
    font-weight: 600;
    paint-order: stroke;
    stroke: var(--surface);
    stroke-width: 3px;
    stroke-linejoin: round;
    pointer-events: none;
}

.aroma-wheel__segment .aroma-wheel__level {
    font-size: 13px;
}

.aroma-wheel__hint {
    fill: var(--text-muted);
    font-weight: 400;
}

.rating-input {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.rating-input__slider {
    flex: 1;
    accent-color: var(--primary-light);
}

form .rating-input input[type="number"] {
    width: 6rem;
}

/*
 * Fünf Sterne, anteilig gefüllt: Der Verlauf endet bei den Punkten, die Schrift selbst ist
 * durchsichtig und zeigt nur den Verlauf. Die Füllung kommt in Schritten von 5 Punkten aus
 * dem Datenattribut, weil die Gestaltungslinie Stile am Element ausschließt.
 */
.stars[data-rating="0"] { --rating: 0; }
.stars[data-rating="5"] { --rating: 5; }
.stars[data-rating="10"] { --rating: 10; }
.stars[data-rating="15"] { --rating: 15; }
.stars[data-rating="20"] { --rating: 20; }
.stars[data-rating="25"] { --rating: 25; }
.stars[data-rating="30"] { --rating: 30; }
.stars[data-rating="35"] { --rating: 35; }
.stars[data-rating="40"] { --rating: 40; }
.stars[data-rating="45"] { --rating: 45; }
.stars[data-rating="50"] { --rating: 50; }
.stars[data-rating="55"] { --rating: 55; }
.stars[data-rating="60"] { --rating: 60; }
.stars[data-rating="65"] { --rating: 65; }
.stars[data-rating="70"] { --rating: 70; }
.stars[data-rating="75"] { --rating: 75; }
.stars[data-rating="80"] { --rating: 80; }
.stars[data-rating="85"] { --rating: 85; }
.stars[data-rating="90"] { --rating: 90; }
.stars[data-rating="95"] { --rating: 95; }
.stars[data-rating="100"] { --rating: 100; }

.stars {
    --rating: 0;
    display: inline-block;
    background: linear-gradient(90deg, var(--star) calc(var(--rating) * 1%), var(--star-empty) calc(var(--rating) * 1%));
    background-clip: text;
    color: transparent;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    line-height: 1;
}

@media (forced-colors: active) {
    .stars {
        background: none;
        color: CanvasText;
    }
}

.rating-line,
.rating-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.rating-line {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.rating-summary {
    margin: 0 0 var(--space-2);
}

/* Diagramm und Werte nebeneinander, wo Platz ist; am Handy untereinander. */
.radar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--space-2);
}

.radar__chart {
    display: block;
    width: min(100%, 22rem);
}

.radar__grid,
.radar__axis {
    fill: none;
    stroke: var(--border);
    stroke-width: 1;
}

.radar__area {
    stroke-width: 2;
    stroke-linejoin: round;
}

.radar__area--1 {
    fill: var(--primary-light);
    fill-opacity: 0.25;
    stroke: var(--primary-light);
}

.radar__area--2 {
    fill: var(--wheel-spicy);
    fill-opacity: 0.2;
    stroke: var(--wheel-spicy);
}

.radar__label {
    fill: var(--text-muted);
    font-size: 11px;
}

.radar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin: var(--space-1) 0 0;
    padding: 0;
    list-style: none;
}

.radar__swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.4rem;
    border-radius: 0.2rem;
    vertical-align: -0.05rem;
}

.radar__swatch--1 {
    background-color: var(--primary-light);
}

.radar__swatch--2 {
    background-color: var(--wheel-spicy);
}

.radar__table {
    margin: var(--space-1) auto 0;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.radar__table th,
.radar__table td {
    padding: 0.15rem 0.6rem;
}

.radar__table th[scope="row"] {
    font-weight: 400;
    text-align: left;
}

.radar__table td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tasting-list {
    display: grid;
    gap: var(--space-2);
    margin: var(--space-2) 0;
    padding: 0;
    list-style: none;
}

.tasting {
    padding-top: var(--space-2);
    border-top: var(--hairline) solid var(--border);
}

.tasting__head,
.tasting__rating {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tasting__head {
    justify-content: space-between;
}

.aroma-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: var(--space-1) 0;
    padding: 0;
    list-style: none;
}

.aroma-chip {
    --group-color: var(--text-muted);
    padding: 0.15rem 0.6rem;
    border: var(--hairline) solid color-mix(in srgb, var(--group-color) 45%, var(--surface));
    border-radius: var(--radius-pill);
    background-color: color-mix(in srgb, var(--group-color) 16%, var(--surface));
    font-size: 0.85rem;
}

.aroma-chip__level {
    font-weight: 600;
}

.aroma-wheel__segment--fruity,
.aroma-chip--fruity {
    --group-color: var(--wheel-fruity);
}

.aroma-wheel__segment--citrus,
.aroma-chip--citrus {
    --group-color: var(--wheel-citrus);
}

.aroma-wheel__segment--floral,
.aroma-chip--floral {
    --group-color: var(--wheel-floral);
}

.aroma-wheel__segment--herbal,
.aroma-chip--herbal {
    --group-color: var(--wheel-herbal);
}

.aroma-wheel__segment--spicy,
.aroma-chip--spicy {
    --group-color: var(--wheel-spicy);
}

.aroma-wheel__segment--sweet,
.aroma-chip--sweet {
    --group-color: var(--wheel-sweet);
}

.aroma-wheel__segment--nutty,
.aroma-chip--nutty {
    --group-color: var(--wheel-nutty);
}

.aroma-wheel__segment--woody,
.aroma-chip--woody {
    --group-color: var(--wheel-woody);
}

.aroma-wheel__segment--smoky,
.aroma-chip--smoky {
    --group-color: var(--wheel-smoky);
}

.aroma-wheel__segment--maritime,
.aroma-chip--maritime {
    --group-color: var(--wheel-maritime);
}

/* Die Wissensabschnitte stehen als eigene Karten untereinander, mit etwas Abstand. */
.knowledge + .knowledge {
    margin-top: var(--space-2);
}

/* ── KI-Vorschläge ─────────────────────────────────────────────────────── */

.item-list {
    display: grid;
    gap: var(--space-1);
    margin: var(--space-2) 0;
    padding: 0;
    list-style: none;
}

.suggestion-field {
    margin: 0 0 var(--space-2);
    padding: var(--space-2);
    border: var(--hairline) solid var(--border);
    border-radius: var(--radius-surface);
}

.suggestion-field legend {
    padding: 0 0.35rem;
    font-weight: 600;
}

/* Zahlen rechtsbündig und gleich breit, damit sich Spalten vergleichen lassen. */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: var(--hairline) solid var(--border);
    text-align: left;
}

.data-table td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table thead th + th {
    text-align: right;
}

/* ── Erfassung ─────────────────────────────────────────────────────────── */

/* Drei Wege nebeneinander am Desktop, untereinander am Handy; jeder ist eine eigene Karte. */
.capture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--space-2);
    align-items: start;
}

.capture-grid .card {
    margin: 0;
}

.card__title {
    margin: 0 0 var(--space-1);
    font-size: 1.1rem;
}

.barcode-scanner {
    margin-bottom: var(--space-2);
}

.barcode-scanner__video {
    display: block;
    width: 100%;
    max-height: 16rem;
    border-radius: var(--radius);
    background-color: var(--surface-raised);
    object-fit: cover;
}

/* Gefundene Bilder als Raster; die ganze Kachel ist die Fläche zum Antippen. */
.candidate-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.candidate-image {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    border: var(--hairline) solid var(--control-border);
    border-radius: var(--radius);
    background-color: var(--surface);
    font-weight: 400;
    cursor: pointer;
}

.candidate-image:has(input:checked) {
    border-color: var(--primary-light);
    box-shadow: inset 0 0 0 1px var(--primary-light);
}

.candidate-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: calc(var(--radius) - 2px);
    background-color: var(--surface-raised);
}

.candidate-image__source {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Kleinkram ────────────────────────────────────────────────────────── */

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Sichtbar für die Sprachausgabe, unsichtbar auf dem Bildschirm. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ── Marktpreise ───────────────────────────────────────────────────────── */

/* Händler links, Preis rechts in gleich breiten Ziffern; Hinweise brechen am Handy darunter um.
   Im Lesemaß der Karte, sonst steht der Preis am Desktop eine Bildschirmbreite vom Händler entfernt. */
.offer-list,
.offer-details,
.data-table--narrow {
    max-width: 40rem;
}

.offer-list {
    margin: var(--space-1) 0;
    padding-left: 1.2rem;
}

.offer-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    align-items: baseline;
    padding: 0.2rem 0;
}

.offer-list__price {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.offer-details summary {
    cursor: pointer;
    color: var(--text-muted);
}

.price-chart {
    margin: var(--space-2) 0;
}

.price-chart__svg {
    display: block;
    width: 100%;
    max-width: 32rem;
    height: auto;
}

.price-chart__band {
    fill: var(--primary-light);
    fill-opacity: 0.15;
}

.price-chart__line {
    fill: none;
    stroke: var(--primary-light);
    stroke-width: 2;
    stroke-linejoin: round;
}

.price-chart__dot {
    fill: var(--primary-light);
}

.value-up {
    color: var(--state-ok-text);
}

.value-down {
    color: var(--state-error-text);
}

/* Breite Tabellen scrollen in ihrer Karte, nie die ganze Seite. */
.table-scroll {
    overflow-x: auto;
}

/* Das Datum neben dem Flaschennamen ist eine Nebenangabe, auch in der fetten Kopfspalte. */
.data-table th .hint {
    font-weight: 400;
}


/* ── Tasting-Abende ───────────────────────────────────────────────────── */

.event-list,
.participant-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-list li,
.participant-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: var(--hairline) solid var(--border);
}

.event-list li:last-child,
.participant-list li:last-child {
    border-bottom: 0;
}

.participant-list li {
    display: block;
}

.participant-list__head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    align-items: center;
}

.event-bottles {
    margin: 0 0 var(--space-2);
    padding: 0;
    list-style: none;
}

/* Nummer, Name mit Gründen, Werkzeuge: am Handy rutschen die Werkzeuge unter den Namen. */
.event-bottles__item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: flex-start;
    padding: 0.6rem 0;
    border-bottom: var(--hairline) solid var(--border);
    background-color: var(--surface);
}

.event-bottles__number {
    flex: 0 0 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--surface-hover);
    font-weight: 700;
    line-height: 2rem;
    text-align: center;
}

.event-bottles__body {
    display: flex;
    flex: 1 1 14rem;
    flex-direction: column;
    gap: 0.15rem;
}

.event-bottles__tools {
    display: flex;
    gap: 0.25rem;
}

/* Ziehen und Pfeile gibt es nur mit JavaScript; ohne bleibt „Empfehlung übernehmen“. */
.sortable-only {
    display: none;
}

.sortable--active .sortable-only,
form:has(.sortable--active) .sortable-only {
    display: inline-flex;
}

.sortable--active .event-bottles__item {
    cursor: grab;
}

.sortable__item--dragging {
    opacity: 0.5;
}

.event-add {
    margin-top: var(--space-2);
}

.event-add summary,
.guest-link summary {
    cursor: pointer;
    color: var(--text-muted);
}

.choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 0.25rem var(--space-2);
    margin: var(--space-1) 0 var(--space-2);
}

.guest-link {
    margin-top: var(--space-1);
}

/* Das aktuelle Glas hebt sich ab, auch ohne Farbe: dickerer Rand plus Abzeichen im Titel. */
.rating-card--current {
    border-width: 2px;
    border-color: var(--primary-light);
}

.rating-card + .rating-card {
    margin-top: var(--space-2);
}

.progress-table__current {
    text-decoration: underline;
}

.progress-table__done {
    color: var(--state-ok-text);
}

.guest-shell {
    min-height: 100vh;
}

.guest-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-bottom: var(--hairline) solid var(--border);
    background-color: var(--surface);
}

/* ── Export ───────────────────────────────────────────────────────────── */

.export-files {
    margin-top: var(--space-2);
}

/* ── Passkeys ─────────────────────────────────────────────────────────── */

/* Name und Knopf in einer Zeile, am Handy untereinander. */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    align-items: center;
}

.inline-form input[type="text"] {
    flex: 1 1 12rem;
    min-width: 0;
}

/* Gefundene Preise abgesetzt vom Suchknopf darüber. */
.price-review {
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: var(--hairline) solid var(--border);
}

/* ── Import ───────────────────────────────────────────────────────────── */

/* Die Auswahl passt sich an; am Handy bleibt sie neben Kopf und Beispielen sichtbar. */
.import-columns select {
    width: 100%;
    min-width: 8rem;
}

.import-columns td.import-columns__samples {
    text-align: left;
    color: var(--text-muted);
}

.import-issues {
    margin: var(--space-1) 0 var(--space-2);
    padding-left: 1.2rem;
}
