:root {
    color-scheme: light;

    --background: #f4f0e7;
    --surface: #fffdf8;
    --surface-raised: #eee9df;
    --surface-soft: #f8f5ee;

    --border: #d8d1c5;
    --border-strong: #9aa69c;

    --text: #26362c;
    --text-muted: #687169;

    --accent: #557158;
    --accent-hover: #6f8d72;
    --accent-text: #fffdf8;

    --danger: #b85757;
    --danger-hover: #cc6868;
    --danger-background: rgba(184, 87, 87, 0.1);

    --success: #4e8762;
    --success-background: rgba(78, 135, 98, 0.1);

    --sidebar-background: #ebe9df;
    --sidebar-surface: #f6f3eb;
    --sidebar-surface-active: #dfe8dd;
    --sidebar-border: #d4cec1;
    --sidebar-text: #26362c;
    --sidebar-muted: #70776f;
    --sidebar-accent: #557158;

    --shadow-soft: 0 0.8rem 2.2rem rgba(52, 61, 54, 0.08);

    --max-width: 1440px;
    --sidebar-width: 18rem;
    --sidebar-collapsed-width: 5.25rem;
}

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

    --background: #101612;
    --surface: #182019;
    --surface-raised: #222c24;
    --surface-soft: #141b16;

    --border: #344138;
    --border-strong: #56645a;

    --text: #eef0e8;
    --text-muted: #aab3aa;

    --accent: #9fbd92;
    --accent-hover: #b6d0aa;
    --accent-text: #142017;

    --danger: #df7777;
    --danger-hover: #ef8b8b;
    --danger-background: rgba(223, 119, 119, 0.12);

    --success: #7ac291;
    --success-background: rgba(122, 194, 145, 0.12);

    --sidebar-background: #121a15;
    --sidebar-surface: #19231c;
    --sidebar-surface-active: #27372b;
    --sidebar-border: #324136;
    --sidebar-text: #eef0e8;
    --sidebar-muted: #a1aca2;
    --sidebar-accent: #9fbd92;

    --shadow-soft: 0 0.8rem 2.4rem rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}

body {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at top left,
            color-mix(in srgb, var(--accent) 10%, transparent),
            transparent 34rem
        ),
        var(--background);

    transition:
        background-color 180ms ease,
        color 180ms ease;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(
        calc(100% - 2rem),
        var(--max-width)
    );

    margin-inline: auto;
}

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;

    border-bottom: 1px solid var(--border);

    background: rgba(16, 18, 20, 0.9);
    backdrop-filter: blur(12px);
}

.header-content {
    min-height: 4.5rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--text);

    font-size: 1.15rem;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-nav > a:not(.button-primary) {
    color: var(--text-muted);
    text-decoration: none;
}

.site-nav > a:not(.button-primary):hover {
    color: var(--text);
}

.main-content {
    padding-block: 3rem 5rem;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;

    margin-bottom: 2rem;
}

.page-header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-page-header {
    margin-bottom: 2rem;
}

.eyebrow {
    margin: 0 0 0.5rem;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-number {
    margin: 0 0 0.35rem;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

h1 {
    margin: 0;

    font-size: clamp(2.4rem, 7vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

h2 {
    margin-top: 0;

    font-size: 1.25rem;
}

h3 {
    margin: 0;

    font-size: 1rem;
}

.page-description {
    max-width: 44rem;
    margin: 1.25rem 0 0;

    color: var(--text-muted);

    line-height: 1.65;
}

.result-count {
    color: var(--text-muted);

    font-size: 0.9rem;
}

.button-primary,
.button-secondary,
.button-danger,
.button-danger-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2.8rem;

    border-radius: 0.65rem;
    padding: 0.75rem 1.1rem;

    font-weight: 720;
    text-decoration: none;

    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.button-primary {
    border: 1px solid var(--accent);

    background: var(--accent);
    color: var(--accent-text);
}

.button-primary:hover {
    border-color: var(--accent-hover);

    background: var(--accent-hover);

    transform: translateY(-1px);
}

.button-secondary {
    border: 1px solid var(--border);

    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--border-strong);

    background: var(--surface-raised);
}

.button-danger {
    border: 1px solid var(--danger);

    background: var(--danger);
    color: #1a0c0c;
}

.button-danger:hover {
    border-color: var(--danger-hover);

    background: var(--danger-hover);
}

.button-danger-secondary {
    border: 1px solid rgba(223, 107, 107, 0.55);

    background: transparent;
    color: var(--danger);
}

.button-danger-secondary:hover {
    border-color: var(--danger);

    background: var(--danger-background);
}

.button-small {
    min-height: 2.3rem;
    padding: 0.5rem 0.8rem;

    font-size: 0.85rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.action-row-centered {
    justify-content: center;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    gap: 0.75rem;

    margin-bottom: 1.5rem;
}

.search-form input {
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;

    background: var(--surface);
    color: var(--text);
    outline: none;
}

.search-form input:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(215, 164, 82, 0.14);
}

.search-summary {
    margin: 0 0 1.5rem;

    color: var(--text-muted);
}

.cocktail-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.cocktail-card {
    min-height: 10rem;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;

    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.25rem;

    background: var(--surface);

    text-decoration: none;

    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.cocktail-card:hover {
    transform: translateY(-3px);

    border-color: var(--accent);

    background: var(--surface-raised);
}

.cocktail-card-name {
    font-size: 1.3rem;
    font-weight: 720;
    line-height: 1.2;
}

.cocktail-card-link {
    color: var(--accent);

    font-size: 0.85rem;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: 0.9rem;
    padding: 3rem 1.5rem;

    background: var(--surface);

    text-align: center;
}

.empty-state p {
    margin-bottom: 1.5rem;

    color: var(--text-muted);
}

.empty-state h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

.back-link {
    display: inline-block;

    color: var(--text-muted);

    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 2rem;
}

.recipe {
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;

    background: var(--surface);
}

.recipe-header {
    padding: clamp(1.5rem, 5vw, 3.5rem);

    border-bottom: 1px solid var(--border);

    background:
        linear-gradient(
            135deg,
            rgba(215, 164, 82, 0.13),
            transparent 65%
        );
}

.recipe-header h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
}

.recipe-layout {
    display: grid;
    grid-template-columns:
        minmax(16rem, 0.8fr) 1.2fr;
}

.recipe-section {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.recipe-section + .recipe-section {
    border-left: 1px solid var(--border);
}

.ingredient-list {
    display: grid;
    gap: 0.8rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.ingredient-list > li {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;

    line-height: 1.5;
}

.ingredient-list > li:last-child {
    border-bottom: 0;
}

.preparation {
    margin: 0;

    color: var(--text-muted);

    font-size: 1.05rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;

    margin-bottom: 2rem;
}

.flash {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;

    background: var(--surface);
}

.flash-success {
    border-color: rgba(119, 200, 149, 0.55);

    background: var(--success-background);
    color: var(--success);
}

.flash-error {
    border-color: rgba(223, 107, 107, 0.55);

    background: var(--danger-background);
    color: var(--danger);
}

.error-summary {
    margin-bottom: 1.5rem;

    border: 1px solid rgba(223, 107, 107, 0.55);
    border-radius: 0.85rem;
    padding: 1.25rem;

    background: var(--danger-background);
}

.error-summary h2 {
    margin-bottom: 0.75rem;

    color: var(--danger);
}

.error-summary ul {
    display: grid;
    gap: 0.4rem;

    margin: 0;
    padding-left: 1.25rem;
}

.cocktail-form {
    display: grid;
    gap: 1.25rem;
}

.form-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);

    background: var(--surface);
}

.form-section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1.5rem;
}

.form-section-heading h2 {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.ingredient-grid {
    grid-template-columns:
        minmax(12rem, 2fr)
        repeat(3, minmax(7rem, 1fr));
}

.field {
    display: grid;
    align-content: start;
    gap: 0.45rem;

    min-width: 0;
}

.field > span {
    color: var(--text-muted);

    font-size: 0.82rem;
    font-weight: 700;
}

.field-wide {
    grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.8rem 0.9rem;

    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}

.field textarea {
    resize: vertical;

    line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(215, 164, 82, 0.14);
}

.ingredient-editor-list {
    display: grid;
    gap: 1rem;
}

.ingredient-editor-row {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;

    background: var(--surface-soft);
}

.ingredient-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.remove-row-button {
    border: 0;
    padding: 0.25rem;

    background: transparent;
    color: var(--danger);

    font-size: 0.8rem;
}

.remove-row-button:hover {
    color: var(--danger-hover);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;

    margin-top: 0.25rem;
}

.delete-card {
    max-width: 46rem;

    border: 1px solid rgba(223, 107, 107, 0.45);
    border-radius: 1rem;
    padding: clamp(1.5rem, 5vw, 3rem);

    background:
        linear-gradient(
            135deg,
            rgba(223, 107, 107, 0.09),
            transparent 70%
        ),
        var(--surface);
}

.delete-card h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
}

.delete-warning {
    margin: 2rem 0 0;

    font-size: 1.1rem;
    line-height: 1.6;
}

.delete-note {
    margin: 1rem 0 2rem;

    color: var(--text-muted);

    line-height: 1.6;
}

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;
    overflow: hidden;

    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .ingredient-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ingredient-name-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .main-content {
        padding-top: 2rem;
    }

    .header-content {
        align-items: flex-start;
        flex-direction: column;

        padding-block: 1rem;
    }

    .site-nav {
        width: 100%;

        justify-content: space-between;
    }

    .page-header {
        align-items: start;
        flex-direction: column;
        gap: 1rem;
    }

    .page-header-actions {
        width: 100%;

        justify-content: space-between;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .detail-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .recipe-layout {
        grid-template-columns: 1fr;
    }

    .recipe-section + .recipe-section {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .form-grid,
    .ingredient-grid {
        grid-template-columns: 1fr;
    }

    .ingredient-name-field,
    .field-wide {
        grid-column: auto;
    }

    .form-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions > * {
        width: 100%;
    }
}

/* Zutatenverwaltung */

.data-table-wrapper {
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: 0.9rem;

    background: var(--surface);
}

.data-table {
    width: 100%;
    min-width: 58rem;

    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;

    border-bottom: 1px solid var(--border);

    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--text-muted);

    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--surface-raised);
}

.table-note {
    display: block;

    max-width: 22rem;
    margin-top: 0.35rem;

    color: var(--text-muted);

    font-size: 0.82rem;
    line-height: 1.45;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;

    white-space: nowrap;
}

.table-actions a {
    color: var(--accent);

    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.table-actions a:hover {
    color: var(--accent-hover);
}

.table-actions .danger-link {
    color: var(--danger);
}

.table-actions .danger-link:hover {
    color: var(--danger-hover);
}

.status-badge {
    display: inline-flex;

    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.55rem;

    background: var(--surface-soft);
    color: var(--text-muted);

    font-size: 0.78rem;
    white-space: nowrap;
}

.form-help {
    max-width: 48rem;
    margin: -0.35rem 0 1.5rem;

    color: var(--text-muted);

    font-size: 0.92rem;
    line-height: 1.6;
}

.form-grid-three {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

@media (max-width: 820px) {
    .form-grid-three {
        grid-template-columns: 1fr;
    }
}

/* Zutaten-Autocomplete und mobiler Erstellungsdialog */

.ingredient-autocomplete {
    position: relative;
}

.ingredient-autocomplete > label {
    display: contents;
}

.autocomplete-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% - 1.1rem);
    right: 0;
    left: 0;

    max-height: 20rem;
    overflow-y: auto;

    border: 1px solid var(--border-strong);
    border-radius: 0.75rem;
    padding: 0.35rem;

    background: var(--surface-raised);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.38);
}

.autocomplete-option {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    border: 0;
    border-radius: 0.55rem;
    padding: 0.8rem 0.85rem;

    background: transparent;
    color: var(--text);

    text-align: left;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
    background: rgba(215, 164, 82, 0.13);
    outline: none;
}

.autocomplete-option-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-option-meta {
    flex: 0 0 auto;

    color: var(--text-muted);

    font-size: 0.78rem;
}

.autocomplete-create-option {
    border-top: 1px solid var(--border);
    border-radius: 0 0 0.55rem 0.55rem;

    color: var(--accent);
}

.autocomplete-create-symbol {
    flex: 0 0 auto;

    font-size: 1.35rem;
    line-height: 1;
}

.field-message {
    min-height: 1.15rem;
    margin: 0;

    color: var(--text-muted);

    font-size: 0.76rem;
}

.field-message.is-selected {
    color: var(--success);
}

.ingredient-editor-row.has-selection-error {
    border-color: var(--danger);
}

.ingredient-editor-row.has-selection-error .field-message {
    color: var(--danger);
}

.ingredient-dialog,
.premix-dialog,
.catalog-dialog {
    width: min(42rem, calc(100% - 2rem));
    max-height: min(48rem, calc(100dvh - 2rem));

    border: 1px solid var(--border-strong);
    border-radius: 1rem;
    padding: 0;

    background: var(--surface);
    color: var(--text);

    box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.55);
}

.ingredient-dialog::backdrop,
.premix-dialog::backdrop,
.catalog-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.dialog-form {
    max-height: inherit;

    display: flex;
    flex-direction: column;
}

.dialog-header,
.dialog-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 1.25rem;

    background: var(--surface);
}

.dialog-header {
    border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
    margin: 0;
}

.dialog-close {
    width: 2.75rem;
    height: 2.75rem;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--text-muted);

    font-size: 1.5rem;
    line-height: 1;
}

.dialog-close:hover {
    color: var(--text);
}

.dialog-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;

    display: grid;
    gap: 1rem;

    padding: 1.25rem;
}

.dialog-actions {
    border-top: 1px solid var(--border);

    justify-content: flex-end;
}

.dialog-help {
    margin: 0;
}

.dialog-errors {
    border: 1px solid rgba(223, 107, 107, 0.55);
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;

    background: var(--danger-background);
    color: var(--danger);
}

.dialog-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

@media (max-width: 600px) {
    .ingredient-dialog,
.premix-dialog,
.catalog-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;

        border: 0;
        border-radius: 0;
    }

    .dialog-header,
    .dialog-body,
    .dialog-actions {
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-left: max(1rem, env(safe-area-inset-left));
    }

    .dialog-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .dialog-actions {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .dialog-actions > * {
        min-height: 3rem;
    }

    .autocomplete-menu {
        position: fixed;
        z-index: 40;
        top: auto;
        right: 0.75rem;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        left: 0.75rem;

        max-height: min(18rem, 42dvh);
    }
}


.card-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.form-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recipe-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    border-bottom: 1px solid var(--border);
    background: var(--border);
}

.recipe-meta-grid > div {
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface-soft);
}

.recipe-meta-grid span {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.recipe-step-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.recipe-step-list li::marker {
    color: var(--accent);
    font-weight: 800;
}

.step-editor-list {
    display: grid;
    gap: 1rem;
}

.step-editor-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.step-number {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(215, 164, 82, 0.15);
    color: var(--accent);
    font-weight: 800;
}

.inventory-entry-list {
    display: grid;
    gap: 1rem;
}

.inventory-entry-row {
    display: grid;
    grid-template-columns: minmax(14rem, 2fr) 1fr 0.65fr auto;
    align-items: end;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.result-card {
    margin-top: 1.5rem;
}

@media (max-width: 980px) {
    .form-grid-four,
    .recipe-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-entry-row {
        grid-template-columns: minmax(12rem, 2fr) 1fr 0.7fr;
    }

    .inventory-entry-row .remove-row-button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 720px) {
    .form-grid-four,
    .recipe-meta-grid,
    .inventory-entry-row {
        grid-template-columns: 1fr;
    }

    .step-editor-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .step-editor-row .remove-row-button {
        grid-column: 2;
        justify-self: end;
    }

    .site-nav {
        flex-wrap: wrap;
    }
}


/* Verschachtelte Rezeptkomponenten und Premix-Dialog */

.form-section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.ingredient-entry {
    display: grid;
    gap: 0.45rem;
}

.ingredient-entry-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.ingredient-entry-title {
    min-width: 0;
    font-size: 1.05rem;
}

.ingredient-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.status-badge-link {
    text-decoration: none;
}

.status-badge-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.component-breakdown {
    display: grid;
    gap: 0.45rem;
    margin: 0.15rem 0 0 1rem;
    padding: 0 0 0 0.9rem;
    border-left: 1px solid var(--border-strong);
    list-style: none;
}

.component-breakdown li {
    display: grid;
    gap: 0.35rem;
    border: 0;
    padding: 0;
}

.component-breakdown-line {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.component-breakdown-marker {
    flex: 0 0 auto;
    color: var(--accent);
}

.premix-dialog {
    width: min(64rem, calc(100% - 2rem));
    max-height: min(58rem, calc(100dvh - 2rem));
}

.premix-dialog-body {
    gap: 1.25rem;
}

.dialog-section {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.dialog-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dialog-section-heading h3,
.dialog-section-heading p {
    margin: 0;
}

.dialog-section-heading p {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.compact-component-list,
.compact-step-list {
    display: grid;
    gap: 0.75rem;
}

.compact-component-row {
    display: grid;
    grid-template-columns:
        auto
        minmax(14rem, 2fr)
        minmax(7rem, 0.7fr)
        minmax(7rem, 0.7fr)
        auto;
    align-items: start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
}

.compact-row-number {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    margin-top: 1.55rem;
    border-radius: 999px;
    background: rgba(215, 164, 82, 0.14);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.compact-remove-button {
    margin-top: 1.75rem;
}

.compact-step-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
}

.compact-help {
    margin: 0;
}

@media (max-width: 860px) {
    .compact-component-row {
        grid-template-columns: auto 1fr 1fr;
    }

    .compact-component-row .ingredient-autocomplete {
        grid-column: 2 / -1;
    }

    .compact-remove-button {
        grid-column: 2 / -1;
        justify-self: end;
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    .form-section-actions {
        width: 100%;
    }

    .form-section-actions > * {
        flex: 1 1 auto;
    }

    .ingredient-entry-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .component-breakdown {
        margin-left: 0.35rem;
    }

    .compact-component-row,
    .compact-step-row {
        grid-template-columns: 1fr;
    }

    .compact-component-row .ingredient-autocomplete,
    .compact-remove-button {
        grid-column: auto;
    }

    .compact-row-number {
        display: none;
    }

    .compact-remove-button {
        justify-self: start;
        margin-top: 0;
    }

    .dialog-section-heading {
        align-items: stretch;
        flex-direction: column;
    }
}


/* Kategorie, Methode, Glasware, Eis und Garnitur verwalten */
.catalog-dialog {
    width: min(34rem, calc(100% - 2rem));
}

[data-catalog-select] optgroup {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .catalog-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
}


/* Löschen im Stammdaten-Dialog */

.catalog-dialog-actions {
    justify-content: space-between;
}

.catalog-dialog-action-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.catalog-delete-button {
    margin-right: auto;
}

@media (max-width: 600px) {
    .catalog-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .catalog-dialog-action-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .catalog-delete-button {
        width: 100%;
        margin-right: 0;
    }
}


/* Administration */

.admin-page-header {
    margin-bottom: 1.75rem;
}

.admin-quick-links {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-quick-card {
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.15rem;
    background: var(--surface);
    text-decoration: none;
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.admin-quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--surface-raised);
}

.admin-quick-card strong {
    font-size: 1.15rem;
    line-height: 1.25;
}

.admin-quick-card > span:last-child {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-quick-kicker {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-section-navigation {
    position: sticky;
    z-index: 5;
    top: 5.25rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.65rem;
    background: rgba(25, 28, 31, 0.94);
    backdrop-filter: blur(12px);
}

.admin-section-navigation a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 0.6rem;
    padding: 0.65rem 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.admin-section-navigation a:hover {
    background: var(--surface-raised);
    color: var(--text);
}

.admin-section-navigation span {
    min-width: 1.6rem;
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
    background: var(--surface-soft);
    color: var(--accent);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-catalog-stack {
    display: grid;
    gap: 1.25rem;
}

.admin-catalog-section {
    scroll-margin-top: 10rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--surface);
}

.admin-catalog-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-catalog-header h2 {
    margin-bottom: 0.45rem;
    font-size: 1.55rem;
}

.admin-catalog-header p {
    max-width: 46rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.admin-entry-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-create-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.admin-entry-list {
    display: grid;
    gap: 0.7rem;
}

.admin-entry-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.admin-entry-edit-form {
    display: grid;
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(5rem, auto)
        auto;
    align-items: center;
    gap: 0.7rem;
}

.admin-entry-name input {
    background: var(--surface);
}

.admin-usage {
    min-width: 5.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.admin-usage strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
}

.button-danger-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.admin-empty-state {
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    color: var(--text-muted);
    text-align: center;
}

.admin-future-card {
    margin-top: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: rgba(25, 28, 31, 0.55);
}

.admin-future-card h2 {
    margin-bottom: 0.75rem;
}

.admin-future-card p:last-child {
    max-width: 52rem;
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

@media (max-width: 980px) {
    .admin-quick-links {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .site-nav {
        flex-wrap: wrap;
    }

    .admin-section-navigation {
        top: 8.8rem;
    }

    .admin-catalog-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .admin-create-form {
        grid-template-columns: 1fr;
    }

    .admin-entry-row {
        grid-template-columns: 1fr;
    }

    .admin-entry-row > form:last-child {
        width: 100%;
    }

    .admin-entry-row > form:last-child button {
        width: 100%;
    }

    .admin-entry-edit-form {
        grid-template-columns: 1fr;
    }

    .admin-usage {
        text-align: left;
    }

    .admin-usage strong {
        display: inline;
        margin-right: 0.25rem;
    }
}

@media (max-width: 520px) {
    .admin-quick-links {
        grid-template-columns: 1fr;
    }

    .admin-quick-card {
        min-height: 8rem;
    }

    .admin-section-navigation {
        position: static;
    }
}


/* Wareneinsatz und Rezeptkalkulation */

.costing-card {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.1rem, 3vw, 1.6rem);
    background:
        linear-gradient(
            135deg,
            rgba(201, 159, 82, 0.08),
            rgba(25, 28, 31, 0.15)
        ),
        var(--surface);
}

.costing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.costing-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.costing-summary-grid {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.75rem;
}

.costing-total {
    min-width: 9.5rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-soft);
    text-align: right;
}

.costing-total span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.costing-total strong {
    color: var(--accent);
    font-size: 1.35rem;
}

.costing-component-list {
    display: grid;
    gap: 0.55rem;
}

.costing-component-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
}

.costing-component-row:last-child {
    border-bottom: 0;
}

.costing-component-row > div {
    display: grid;
    gap: 0.15rem;
}

.costing-component-row > div span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.costing-component-price {
    flex: 0 0 auto;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.costing-incomplete {
    color: var(--warning, #d8aa57);
}

.costing-warning {
    margin-top: 1rem;
    border: 1px solid rgba(216, 170, 87, 0.45);
    border-radius: 0.75rem;
    padding: 0.9rem;
    background: rgba(216, 170, 87, 0.08);
}

.costing-warning > strong {
    display: block;
    margin-bottom: 0.5rem;
}

.costing-warning ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.2rem;
}

.costing-warning li {
    padding-left: 0.15rem;
}

.costing-warning li a {
    display: inline-block;
    margin-left: 0.4rem;
    color: var(--accent);
    font-weight: 700;
}

.costing-note {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .costing-header {
        flex-direction: column;
    }

    .costing-summary-grid {
        width: 100%;
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .costing-total {
        width: 100%;
        min-width: 0;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .costing-summary-grid {
        grid-template-columns: 1fr;
    }

    .costing-component-row {
        align-items: flex-start;
    }
}


/* Rollen und globale erweiterte Ansicht */

.access-denied {
    max-width: 42rem;
    margin-inline: auto;
}


/* Anmeldung und Benutzerverwaltung */

.account-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.4rem;
    border-left: 1px solid var(--border);
    padding-left: 0.9rem;
}

.account-identity {
    display: grid;
    gap: 0.05rem;
    text-align: right;
}

.account-identity strong {
    font-size: 0.82rem;
}

.account-identity span {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.auth-layout {
    min-height: min(68vh, 42rem);
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(19rem, 0.9fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 6rem);
    padding-block: 3rem;
}

.auth-intro h1 {
    max-width: 12ch;
    margin-bottom: 1rem;
    font-size: clamp(2.2rem, 7vw, 4.5rem);
    line-height: 0.98;
}

.auth-intro > p:not(.eyebrow) {
    max-width: 38rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.auth-security-note {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

.auth-card {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--surface);
    box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, 0.18);
}

.auth-submit {
    width: 100%;
    margin-top: 0.35rem;
}

.user-admin-list {
    display: grid;
    gap: 1rem;
}

.user-admin-card {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1fr)
        minmax(15rem, auto)
        auto;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.1rem;
    background: var(--surface);
}

.user-admin-identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.user-admin-identity h2 {
    overflow: hidden;
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface-soft);
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 900;
}

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

.status-badge-admin {
    border-color: rgba(201, 159, 82, 0.4);
    color: var(--accent);
}

.status-active {
    color: #8fd3a7;
}

.status-inactive {
    color: var(--text-muted);
    opacity: 0.75;
}

.user-admin-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(7rem, 1fr));
    gap: 1rem;
    margin: 0;
}

.user-admin-meta div {
    display: grid;
    gap: 0.15rem;
}

.user-admin-meta dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.user-admin-meta dd {
    margin: 0;
    font-size: 0.78rem;
}

.user-form-card {
    max-width: 58rem;
    margin-inline: auto;
}

.user-form {
    display: grid;
    gap: 1.25rem;
}

.form-section-help {
    margin-top: -0.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.checkbox-disabled {
    opacity: 0.7;
}

@media (max-width: 1040px) {
    .header-content {
        align-items: flex-start;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .account-menu {
        width: 100%;
        justify-content: flex-end;
        border-left: 0;
        border-top: 1px solid var(--border);
        margin-left: 0;
        padding-top: 0.65rem;
        padding-left: 0;
    }

    .user-admin-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .user-admin-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 760px) {
    .auth-layout {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-block: 1.5rem;
    }

    .auth-intro h1 {
        max-width: none;
    }

    .user-admin-card {
        grid-template-columns: 1fr;
    }

    .user-admin-meta {
        grid-column: auto;
        grid-row: auto;
    }

    .user-admin-card > .action-row {
        width: 100%;
    }

    .user-admin-card > .action-row > * {
        flex: 1;
    }

    .user-admin-card > .action-row a,
    .user-admin-card > .action-row button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .account-menu {
        align-items: stretch;
        flex-direction: column;
    }

    .account-identity {
        text-align: left;
    }

    .account-menu form,
    .account-menu button {
        width: 100%;
    }

    .user-admin-meta {
        grid-template-columns: 1fr;
    }
}


/* Benutzergruppen und Berechtigungen */

.status-warning {
    color: #d8aa57;
}

.permission-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.permission-group-card {
    display: grid;
    gap: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.2rem;
    background: var(--surface);
}

.permission-group-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.permission-group-card h2 {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
}

.permission-group-card header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.permission-group-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.permission-group-stats > div {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.permission-group-stats strong,
.permission-group-stats span {
    display: block;
}

.permission-group-stats strong {
    color: var(--accent);
    font-size: 1.25rem;
}

.permission-group-stats span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.permission-group-form-card {
    max-width: 72rem;
    margin-inline: auto;
}

.permission-group-form,
.permission-sections {
    display: grid;
    gap: 1.25rem;
}

.permission-section {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.permission-section legend {
    padding-inline: 0.45rem;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.permission-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.permission-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.85rem;
    background: var(--surface);
    cursor: pointer;
}

.permission-checkbox:hover {
    border-color: var(--accent);
}

.permission-checkbox input {
    margin-top: 0.2rem;
}

.permission-checkbox span,
.permission-checkbox strong,
.permission-checkbox small {
    display: block;
}

.permission-checkbox strong {
    margin-bottom: 0.2rem;
    font-size: 0.86rem;
}

.permission-checkbox small {
    color: var(--text-muted);
    line-height: 1.4;
}

.account-password-layout {
    min-height: min(68vh, 42rem);
}

@media (max-width: 820px) {
    .permission-group-grid,
    .permission-checkbox-grid {
        grid-template-columns: 1fr;
    }
}


/* Datenbank-Backups */

.backup-page-header {
    align-items: flex-end;
}

.backup-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(201, 159, 82, 0.38);
    border-radius: 1rem;
    padding: 1rem 1.15rem;
    background: rgba(201, 159, 82, 0.07);
}

.backup-warning-icon {
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(201, 159, 82, 0.55);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 900;
}

.backup-warning strong {
    display: block;
    margin-bottom: 0.25rem;
}

.backup-warning p {
    max-width: 52rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}


.backup-upload-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    align-items: end;
    gap: clamp(1rem, 3vw, 2rem);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.4rem);
    background: var(--surface);
}

.backup-upload-copy h2 {
    margin: 0.25rem 0 0.45rem;
    font-size: 1.1rem;
}

.backup-upload-copy p:last-child {
    max-width: 48rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.backup-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
}

.backup-file-field {
    min-width: 0;
}

.backup-file-field input[type="file"] {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.45rem;
    background: var(--surface-soft);
    color: var(--text);
}

.backup-file-field input[type="file"]::file-selector-button {
    margin-right: 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 0.55rem;
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
    cursor: pointer;
}

.backup-file-field input[type="file"]::file-selector-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.backup-list {
    display: grid;
    gap: 1rem;
}

.backup-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.4rem);
    background: var(--surface);
}

.backup-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.backup-card-header h2 {
    overflow-wrap: anywhere;
    margin: 0.55rem 0 0;
    font-size: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.backup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.backup-size {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.backup-meta {
    display: grid;
    grid-template-columns:
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        minmax(15rem, 1.4fr);
    gap: 1rem;
    margin: 0 0 1.1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.backup-meta div {
    display: grid;
    gap: 0.2rem;
}

.backup-meta dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.backup-meta dd {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

@media (max-width: 760px) {

    .backup-upload-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .backup-upload-form {
        grid-template-columns: 1fr;
    }

    .backup-upload-form button {
        width: 100%;
    }

    .backup-page-header {
        align-items: stretch;
    }

    .backup-page-header > form,
    .backup-page-header > form button {
        width: 100%;
    }

    .backup-card-header {
        flex-direction: column;
    }

    .backup-meta {
        grid-template-columns: 1fr;
    }

    .backup-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .backup-actions > *,
    .backup-actions a,
    .backup-actions button {
        width: 100%;
    }
}


/* Änderungsprotokoll */

.audit-page-header {
    align-items: flex-end;
}

.audit-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.audit-filter-card {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1.5fr)
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        auto;
    align-items: end;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--surface);
}

.audit-filter-actions {
    display: flex;
    gap: 0.55rem;
}

.audit-list {
    display: grid;
    gap: 0.8rem;
}

.audit-card {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(12rem, auto)
        auto;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        background 160ms ease;
}

.audit-card:hover {
    border-color: rgba(201, 159, 82, 0.5);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.audit-card-main {
    min-width: 0;
}

.audit-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-card h2 {
    overflow: hidden;
    margin: 0.55rem 0 0.25rem;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-card p {
    overflow: hidden;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-card-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(7rem, 1fr));
    gap: 1rem;
    margin: 0;
}

.audit-card-meta div,
.audit-detail-meta div {
    display: grid;
    gap: 0.15rem;
}

.audit-card-meta dt,
.audit-detail-meta dt {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.audit-card-meta dd,
.audit-detail-meta dd {
    margin: 0;
    font-size: 0.8rem;
}

.audit-card-arrow {
    color: var(--accent);
    font-size: 1.15rem;
}

.audit-action-create,
.audit-action-backup_create {
    color: #8fd3a7;
}

.audit-action-update,
.audit-action-password_change,
.audit-action-password_reset {
    color: var(--accent);
}

.audit-action-delete,
.audit-action-backup_delete {
    color: #e59a9a;
}

.audit-action-backup_restore {
    color: #9eb8e8;
}

.pagination {
    display: grid;
    grid-template-columns:
        minmax(7rem, 1fr)
        auto
        minmax(7rem, 1fr);
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.pagination > :last-child {
    justify-self: end;
}

.pagination-status {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.audit-detail-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 4vw, 1.6rem);
    background: var(--surface);
}

.audit-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.audit-detail-header h1 {
    overflow-wrap: anywhere;
    margin: 0.65rem 0 0.35rem;
}

.audit-detail-header p {
    max-width: 52rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.audit-event-number {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

.audit-detail-meta {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(8rem, 1fr));
    gap: 1rem;
    margin: 1.35rem 0 0;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.audit-change-section {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    background: var(--surface);
}

.audit-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audit-section-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
}

.audit-change-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.audit-change-list {
    display: grid;
    gap: 0.75rem;
}

.audit-change-row {
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 0.8rem;
    padding: 0.9rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-change-row h3 {
    margin: 0 0 0.75rem;
    color: var(--text);
    font-size: 0.82rem;
}

.audit-change-changed {
    border-left-color: var(--accent);
}

.audit-change-added {
    border-left-color: #8fd3a7;
}

.audit-change-removed {
    border-left-color: #df8b8b;
}

.audit-change-values {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
    align-items: stretch;
    gap: 0.65rem;
}

.audit-change-value {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.7rem;
    background: var(--surface-soft);
}

.audit-change-value span {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.audit-change-value strong {
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.45;
}

.audit-change-arrow {
    align-self: center;
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 900;
}

.audit-no-change {
    border: 1px dashed var(--border);
    border-radius: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.audit-no-change p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.audit-full-comparison {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
}

.audit-full-comparison > summary {
    cursor: pointer;
    padding: 1rem 1.15rem;
    color: var(--text);
    font-weight: 800;
    list-style-position: inside;
}

.audit-full-comparison[open] > summary {
    border-bottom: 1px solid var(--border);
}

.audit-comparison {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.audit-payload-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.audit-payload-card > header {
    margin-bottom: 0.9rem;
}

.audit-payload-card h2 {
    margin: 0.15rem 0 0;
    font-size: 1rem;
}

.audit-readable-fields {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.audit-readable-row {
    display: grid;
    grid-template-columns:
        minmax(8rem, 0.38fr)
        minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.audit-readable-row:last-child {
    border-bottom: 0;
}

.audit-readable-row dt {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.audit-readable-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.audit-readable-fields-compact {
    margin-top: 0.75rem;
}

.audit-readable-fields-compact .audit-readable-row {
    grid-template-columns:
        minmax(7rem, 0.32fr)
        minmax(0, 1fr);
    padding: 0.55rem 0.65rem;
}

.audit-readable-value {
    white-space: pre-wrap;
}

.audit-readable-empty,
.audit-empty-payload {
    color: var(--text-muted);
}

.audit-component-list {
    display: grid;
    gap: 0.7rem;
}

.audit-component {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-component-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.audit-component-header strong {
    display: block;
    overflow-wrap: anywhere;
}

.audit-component-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.audit-component-measure {
    flex: 0 0 auto;
    border: 1px solid rgba(201, 159, 82, 0.45);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.audit-component-note {
    margin: 0.7rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.audit-component-breakdown {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}

.audit-component-breakdown > summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.audit-component-breakdown[open] > summary {
    margin-bottom: 0.65rem;
}

.audit-component-breakdown .audit-component {
    background: rgba(0, 0, 0, 0.14);
}

.audit-step-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.audit-step-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-step-number {
    width: 1.65rem;
    height: 1.65rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #151515;
    font-size: 0.72rem;
    font-weight: 900;
}

.audit-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-generic-list {
    display: grid;
    gap: 0.65rem;
}

.audit-generic-item {
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.08);
}

.audit-empty-payload {
    margin: 0;
}

@media (max-width: 1120px) {
    .audit-filter-card {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .audit-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .audit-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .audit-card-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .audit-detail-meta {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .audit-page-header {
        align-items: stretch;
    }

    .audit-count {
        align-self: flex-start;
    }

    .audit-filter-card {
        grid-template-columns: 1fr;
    }

    .audit-filter-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .audit-filter-actions > * {
        width: 100%;
    }

    .audit-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .audit-card-meta {
        grid-template-columns: 1fr;
    }

    .pagination {
        grid-template-columns: 1fr;
    }

    .pagination > *,
    .pagination > :last-child {
        justify-self: stretch;
        text-align: center;
    }

    .audit-detail-header {
        flex-direction: column;
    }

    .audit-detail-meta {
        grid-template-columns: 1fr;
    }

    .audit-comparison {
        grid-template-columns: 1fr;
    }

    .audit-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-change-values {
        grid-template-columns: 1fr;
    }

    .audit-change-arrow {
        justify-self: center;
        transform: rotate(90deg);
    }

    .audit-readable-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .audit-component-header {
        flex-direction: column;
    }

    .audit-component-measure {
        align-self: flex-start;
    }
}


/* Kalkulierbare Garnituren */

.garnish-cost-form {
    display: grid;
    gap: 1rem;
}

.garnish-form-heading p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.garnish-form-grid {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1fr)
        minmax(13rem, 0.9fr)
        minmax(13rem, 1fr);
    gap: 0.8rem;
}

.garnish-component-editor {
    display: grid;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.08);
}

.garnish-component-editor[hidden] {
    display: none;
}

.garnish-component-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.garnish-component-rows {
    display: grid;
    gap: 0.65rem;
}

.garnish-component-row {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1.35fr)
        minmax(6rem, 0.55fr)
        minmax(6rem, 0.55fr)
        minmax(9rem, 0.8fr)
        auto;
    align-items: end;
    gap: 0.65rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.garnish-component-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.garnish-remove-component {
    min-height: 2.7rem;
}

.garnish-admin-list {
    display: grid;
    gap: 0.8rem;
}

.garnish-admin-card {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.garnish-admin-card > details > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem;
    list-style: none;
}

.garnish-admin-card > details > summary::-webkit-details-marker {
    display: none;
}

.garnish-admin-card > details[open] > summary {
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.85rem;
}

.garnish-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.garnish-summary-action {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.garnish-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.ingredient-usage-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

@media (max-width: 980px) {
    .garnish-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .garnish-note-field {
        grid-column: 1 / -1;
    }

    .garnish-component-row {
        grid-template-columns:
            minmax(12rem, 1fr)
            minmax(6rem, 0.5fr)
            minmax(6rem, 0.5fr);
    }

    .garnish-component-row .field:nth-of-type(4) {
        grid-column: 1 / -2;
    }
}

@media (max-width: 680px) {
    .garnish-form-grid,
    .garnish-component-row {
        grid-template-columns: 1fr;
    }

    .garnish-note-field,
    .garnish-component-row .field:nth-of-type(4) {
        grid-column: auto;
    }

    .garnish-component-heading,
    .garnish-admin-card > details > summary {
        align-items: stretch;
        flex-direction: column;
    }

    .garnish-component-heading button,
    .garnish-remove-component,
    .garnish-delete-form,
    .garnish-delete-form button {
        width: 100%;
    }
}


/* Layout-Korrektur für Garniturformulare */

.garnish-cost-form > .button-primary {
    justify-self: start;
    width: auto;
    min-width: 12rem;
}

.garnish-component-editor {
    min-width: 0;
}

.garnish-component-rows,
.garnish-component-row {
    min-width: 0;
}

.garnish-component-row > .field {
    min-width: 0;
}

.garnish-component-row input,
.garnish-component-row select {
    width: 100%;
    min-width: 0;
}

.garnish-remove-component {
    align-self: end;
    width: auto;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .garnish-component-row {
        grid-template-columns:
            minmax(12rem, 1.4fr)
            minmax(7rem, 0.6fr)
            minmax(7rem, 0.6fr)
            minmax(10rem, 1fr);
    }

    .garnish-remove-component {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 760px) {
    .garnish-cost-form > .button-primary {
        justify-self: stretch;
        width: 100%;
    }

    .garnish-remove-component {
        justify-self: stretch;
        width: 100%;
    }
}


/* Garniturformular: einspaltiges Layout und gemeinsame Aktionsleiste */

.admin-create-form.garnish-cost-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.garnish-component-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.garnish-component-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.garnish-component-actions .button-primary,
.garnish-component-actions .button-secondary {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .garnish-component-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .garnish-component-actions {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .garnish-component-actions .button-primary,
    .garnish-component-actions .button-secondary {
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .garnish-component-actions {
        grid-template-columns: 1fr;
    }
}


/* Cocktail-Suche und kombinierbare Filter */

.cocktail-filter-card {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(0.9rem, 3vw, 1.2rem);
    background: var(--surface);
}

.cocktail-filter-form {
    display: grid;
    gap: 0.9rem;
}

.cocktail-search-row {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1fr)
        auto
        auto;
    align-items: end;
    gap: 0.75rem;
}

.cocktail-search-field {
    min-width: 0;
}

.cocktail-search-field input {
    width: 100%;
}

.cocktail-advanced-filters {
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
}

.cocktail-advanced-filters > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    list-style-position: inside;
}

.cocktail-advanced-filters[open] > summary {
    margin-bottom: 0.9rem;
}

.cocktail-filter-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.cocktail-filter-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
}

.active-filter-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
}

.active-filter-heading {
    margin-right: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(201, 159, 82, 0.4);
    border-radius: 999px;
    padding: 0.42rem 0.68rem;
    background: rgba(201, 159, 82, 0.07);
    color: var(--text);
    font-size: 0.76rem;
}

.active-filter-chip strong {
    color: var(--accent);
}

.cocktail-card-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}

@media (max-width: 1080px) {
    .cocktail-filter-grid {
        grid-template-columns:
            repeat(3, minmax(10rem, 1fr));
    }
}

@media (max-width: 780px) {
    .cocktail-search-row {
        grid-template-columns: 1fr 1fr;
    }

    .cocktail-search-field {
        grid-column: 1 / -1;
    }

    .cocktail-filter-grid {
        grid-template-columns:
            repeat(2, minmax(10rem, 1fr));
    }
}

@media (max-width: 540px) {
    .cocktail-search-row,
    .cocktail-filter-grid {
        grid-template-columns: 1fr;
    }

    .cocktail-search-field {
        grid-column: auto;
    }

    .cocktail-search-row > *,
    .cocktail-search-row button,
    .cocktail-search-row a,
    .cocktail-filter-footer > *,
    .cocktail-filter-footer button,
    .cocktail-filter-footer a {
        width: 100%;
    }

    .cocktail-filter-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cocktail-advanced-filters > summary {
        align-items: flex-start;
    }
}


/* Zutatengruppen und Zutatenkategorien */
.taxonomy-section { margin-top:1.25rem; border:1px solid var(--border); border-radius:1rem; padding:clamp(1rem,3vw,1.35rem); background:var(--surface); }
.taxonomy-section-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.taxonomy-section-header h2 { margin:.15rem 0 .35rem; }
.taxonomy-section-header p:last-child { margin:0; color:var(--text-muted); }
.taxonomy-create-form,.taxonomy-edit-form { display:grid; grid-template-columns:minmax(12rem,1fr) minmax(14rem,1.4fr) minmax(6rem,.35fr) auto auto; align-items:end; gap:.75rem; }
.taxonomy-create-form { margin-bottom:1rem; border:1px solid var(--border); border-radius:.85rem; padding:.9rem; background:var(--surface-soft); }
.taxonomy-category-form { grid-template-columns:minmax(12rem,1fr) minmax(12rem,1fr) minmax(6rem,.35fr) auto auto; }
.taxonomy-list { display:grid; gap:.75rem; }
.taxonomy-card { border:1px solid var(--border); border-radius:.85rem; padding:.85rem; background:var(--surface-soft); }
.taxonomy-card .taxonomy-edit-form { grid-template-columns:minmax(12rem,1fr) minmax(14rem,1.4fr) minmax(6rem,.35fr) auto minmax(10rem,auto) auto; }
.taxonomy-card .taxonomy-category-form { grid-template-columns:minmax(12rem,1fr) minmax(12rem,1fr) minmax(6rem,.35fr) auto minmax(7rem,auto) auto; }
.taxonomy-active-field { align-self:center; margin-bottom:.45rem; }
.taxonomy-usage { display:flex; flex-wrap:wrap; gap:.35rem; align-self:center; }
.taxonomy-delete-form { display:flex; justify-content:flex-end; margin-top:.75rem; border-top:1px solid var(--border); padding-top:.75rem; }
@media (max-width:1100px) {
 .taxonomy-create-form,.taxonomy-category-form,.taxonomy-card .taxonomy-edit-form,.taxonomy-card .taxonomy-category-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .taxonomy-description-field,.taxonomy-usage { grid-column:1/-1; }
}
@media (max-width:620px) {
 .taxonomy-section-header { flex-direction:column; }
 .taxonomy-create-form,.taxonomy-category-form,.taxonomy-card .taxonomy-edit-form,.taxonomy-card .taxonomy-category-form { grid-template-columns:1fr; }
 .taxonomy-description-field,.taxonomy-usage { grid-column:auto; }
 .taxonomy-create-form button,.taxonomy-edit-form button,.taxonomy-delete-form,.taxonomy-delete-form button { width:100%; }
}


/* Bearbeitbare Cocktailmerkmale */

.characteristic-section {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    background: var(--surface);
}

.characteristic-create-form,
.characteristic-edit-form {
    display: grid;
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(14rem, 1.5fr)
        minmax(6rem, 0.35fr)
        auto
        auto;
    align-items: end;
    gap: 0.75rem;
}

.characteristic-create-form {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.9rem;
    background: var(--surface-soft);
}

.characteristic-list,
.characteristic-assignment-list {
    display: grid;
    gap: 0.75rem;
}

.characteristic-card,
.characteristic-assignment-card {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem;
    background: var(--surface-soft);
}

.characteristic-edit-form {
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(14rem, 1.5fr)
        minmax(6rem, 0.35fr)
        auto
        auto
        auto;
}

.characteristic-assignment-card {
    display: grid;
    grid-template-columns:
        minmax(12rem, 0.7fr)
        minmax(18rem, 2fr)
        auto;
    align-items: center;
    gap: 1rem;
}

.characteristic-checkboxes,
.cocktail-characteristics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.characteristic-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
    background: var(--surface);
    font-size: 0.78rem;
    cursor: pointer;
}

.characteristic-chip {
    border: 1px solid rgba(201, 159, 82, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    background: rgba(201, 159, 82, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}

@media (max-width: 1000px) {
    .characteristic-create-form,
    .characteristic-edit-form,
    .characteristic-assignment-card {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .characteristic-description,
    .characteristic-checkboxes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .characteristic-create-form,
    .characteristic-edit-form,
    .characteristic-assignment-card {
        grid-template-columns: 1fr;
    }

    .characteristic-description,
    .characteristic-checkboxes {
        grid-column: auto;
    }

    .characteristic-create-form button,
    .characteristic-edit-form button,
    .characteristic-assignment-card button {
        width: 100%;
    }
}


/* Kompakte Zutatenansicht und globale erweiterte Ansicht */

.advanced-view-toggle[aria-pressed="true"] {
    border-color: var(--accent);
    background: rgba(225, 170, 82, 0.12);
    color: var(--accent);
}

.data-table-ingredients {
    min-width: 42rem;
}

.data-table th.advanced-view-column,
.data-table td.advanced-view-column {
    display: none;
}

html.advanced-view-enabled
.data-table th.advanced-view-column,
html.advanced-view-enabled
.data-table td.advanced-view-column {
    display: table-cell;
}

html.advanced-view-enabled
.data-table-ingredients {
    min-width: 54rem;
}

.ingredient-actions-header,
.ingredient-actions-cell {
    position: sticky;
    right: 0;

    min-width: 10.5rem;

    background: var(--surface);
    box-shadow: -1px 0 0 var(--border);
}

.ingredient-actions-header {
    z-index: 3;
}

.ingredient-actions-cell {
    z-index: 2;
}

.data-table-ingredients tbody tr:hover
.ingredient-actions-cell {
    background: var(--surface-raised);
}

@media (max-width: 1040px) {
    .advanced-view-toggle {
        order: 1;
    }

    .account-menu {
        order: 2;
    }
}


/* Icon Set 3 – Geometric Badge */

.icon-sprite {
    position: absolute;

    width: 0;
    height: 0;
    overflow: hidden;

    pointer-events: none;
}

.site-nav {
    gap: 0.5rem;
}

.header-icon-action {
    --badge-edge: var(--border-strong);
    --badge-shape: polygon(
        28% 0,
        72% 0,
        100% 28%,
        100% 72%,
        72% 100%,
        28% 100%,
        0 72%,
        0 28%
    );

    position: relative;
    isolation: isolate;

    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    margin: 0;
    border: 0;
    padding: 0;

    clip-path: var(--badge-shape);

    background: var(--badge-edge);
    color: var(--text);

    text-decoration: none;

    transition:
        color 140ms ease,
        background-color 140ms ease,
        transform 140ms ease,
        filter 140ms ease;
}

.header-icon-action::before {
    content: "";

    position: absolute;
    z-index: -1;
    inset: 2px;

    clip-path: var(--badge-shape);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.035),
            transparent 55%
        ),
        var(--surface-soft);
}

.header-icon-action:hover {
    --badge-edge: var(--accent);

    color: var(--accent-hover);
    transform: translateY(-1px);
}

.header-icon-action:focus-visible {
    outline: none;

    filter:
        drop-shadow(0 0 0.2rem rgba(215, 164, 82, 0.75))
        drop-shadow(0 0 0.55rem rgba(215, 164, 82, 0.28));
}

.header-icon-action.is-current,
.advanced-view-toggle[aria-pressed="true"] {
    --badge-edge: var(--accent);

    color: var(--accent);
}

.header-icon-action.is-current::before,
.advanced-view-toggle[aria-pressed="true"]::before {
    background:
        linear-gradient(
            145deg,
            rgba(215, 164, 82, 0.14),
            transparent 62%
        ),
        var(--surface-soft);
}

.ui-icon {
    width: 1.45rem;
    height: 1.45rem;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

.account-menu form {
    margin: 0;
}

@media (max-width: 720px) {
    .header-icon-action {
        width: 2.85rem;
        height: 2.85rem;
    }
}

@media (max-width: 520px) {
    .account-menu {
        align-items: center;
        flex-direction: row;
        justify-content: flex-end;
    }

    .account-identity {
        margin-right: auto;
    }

    .account-menu form {
        width: auto;
    }

    .account-menu .header-icon-action {
        width: 2.75rem;
        height: 2.75rem;
    }
}


/* Desktop-Aufräumen – Icon-Metadaten, globale erweiterte Ansicht und kompakte Aktionen */

.page-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cocktail-advanced-filters {
    border-top: 0;
    padding-top: 0;
}

.cocktail-advanced-filters > summary.cocktail-filter-toggle {
    width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    list-style: none;
}

.cocktail-advanced-filters > summary.cocktail-filter-toggle::-webkit-details-marker {
    display: none;
}

.cocktail-advanced-filters[open] > summary.cocktail-filter-toggle {
    margin-bottom: 0;
}

.cocktail-filter-toggle .ui-icon {
    width: 1rem;
    height: 1rem;
    transition: transform 140ms ease;
}

.cocktail-advanced-filters[open]
.cocktail-filter-toggle .ui-icon {
    transform: rotate(180deg);
}

.filter-count-badge {
    border: 1px solid rgba(23, 18, 10, 0.38);
    border-radius: 999px;
    padding: 0.18rem 0.45rem;
    background: rgba(23, 18, 10, 0.12);
    color: var(--accent-text);
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.cocktail-filter-panel {
    margin-top: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
}

.cocktail-characteristic-filter {
    grid-column: span 2;
    margin: 0;
    border: 0;
    padding: 0;
}

.cocktail-characteristic-filter legend {
    margin-bottom: 0.2rem;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.field-help {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.4;
}

.characteristic-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.characteristic-filter-option {
    position: relative;
    cursor: pointer;
}

.characteristic-filter-option input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.characteristic-filter-option span {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.72rem;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    transition:
        border-color 140ms ease,
        background 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.characteristic-filter-option:hover span {
    border-color: var(--border-strong);
    color: var(--text);
}

.characteristic-filter-option input:checked + span {
    border-color: var(--accent);
    background: rgba(215, 164, 82, 0.14);
    color: var(--accent);
}

.characteristic-filter-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.cocktail-grid {
    align-items: stretch;
}

.cocktail-card {
    min-height: 14.5rem;
    gap: 1rem;
}

.cocktail-card-content,
.cocktail-card-heading {
    display: grid;
}

.cocktail-card-content {
    gap: 1rem;
}

.cocktail-card-heading {
    gap: 0.2rem;
}

.cocktail-card-name {
    min-height: 2.4em;
}

.cocktail-card .cocktail-characteristics {
    min-height: 1.85rem;
    align-content: start;
}

.characteristic-chip-more {
    color: var(--text-muted);
    border-color: var(--border);
    background: var(--surface-soft);
}

.cocktail-card-attributes {
    align-content: start;
    margin-top: 0;
}

.cocktail-attribute-chip {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.36rem 0.58rem;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.2;
}

.cocktail-attribute-chip .ui-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    color: var(--accent);
    stroke-width: 1.85;
}

.cocktail-attribute-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-characteristics {
    margin-top: 1.25rem;
}

.recipe-meta-grid > .recipe-meta-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.recipe-meta-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--surface);
    color: var(--accent);
    text-transform: none;
    letter-spacing: normal;
}

.recipe-meta-icon .ui-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.recipe-meta-copy {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    color: inherit;
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.recipe-meta-copy > span {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recipe-meta-copy strong {
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.advanced-view-section {
    display: none;
}

html.advanced-view-enabled .advanced-view-section {
    display: block;
}

.recipe > .advanced-view-section {
    margin: 1.25rem;
}

.icon-action-row,
.table-icon-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.geometric-icon-button,
.table-icon-action {
    --small-badge-edge: var(--border-strong);
    --small-badge-shape: polygon(
        28% 0,
        72% 0,
        100% 28%,
        100% 72%,
        72% 100%,
        28% 100%,
        0 72%,
        0 28%
    );

    position: relative;
    isolation: isolate;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    clip-path: var(--small-badge-shape);
    background: var(--small-badge-edge);
    color: var(--text);
    text-decoration: none;
    transition:
        color 140ms ease,
        background 140ms ease,
        transform 140ms ease;
}

.geometric-icon-button::before,
.table-icon-action::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 2px;
    clip-path: var(--small-badge-shape);
    background: var(--surface-soft);
}

.geometric-icon-button {
    width: 3rem;
    height: 3rem;
}

.table-icon-action {
    width: 2.45rem;
    height: 2.45rem;
}

.geometric-icon-button .ui-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.table-icon-action .ui-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.geometric-icon-button:hover,
.table-icon-action:hover {
    --small-badge-edge: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.geometric-icon-button-danger,
.table-icon-action-danger {
    color: var(--danger);
}

.geometric-icon-button-danger:hover,
.table-icon-action-danger:hover {
    --small-badge-edge: var(--danger);
    color: var(--danger-hover);
}

.geometric-icon-button:focus-visible,
.table-icon-action:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 0.35rem rgba(215, 164, 82, 0.5));
}

.ingredient-actions-header,
.ingredient-actions-cell {
    min-width: 7rem;
}

.component-breakdown-disclosure {
    margin-top: 0.15rem;
}

.component-breakdown-disclosure > summary {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    list-style: none;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 750;
}

.component-breakdown-disclosure > summary::-webkit-details-marker {
    display: none;
}

.component-breakdown-disclosure > summary .ui-icon {
    width: 0.95rem;
    height: 0.95rem;
    transition: transform 140ms ease;
}

.component-breakdown-disclosure[open] > summary .ui-icon {
    transform: rotate(180deg);
}

.component-breakdown-disclosure > .component-breakdown {
    margin-top: 0.65rem;
}

@media (max-width: 780px) {
    .cocktail-characteristic-filter {
        grid-column: 1 / -1;
    }

    .cocktail-card {
        min-height: 0;
    }

    .cocktail-card-name {
        min-height: 0;
    }
}

@media (max-width: 540px) {
    .cocktail-advanced-filters > summary.cocktail-filter-toggle {
        width: 100%;
    }

    .recipe > .advanced-view-section {
        margin: 0.85rem;
    }

    .recipe-meta-grid > .recipe-meta-item {
        min-width: 0;
    }
}

/* Spezifische Rezeptmetadaten und kompakte Merkmalsauswahl */

.cocktail-card-attributes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    width: 100%;
    margin-top: auto;
}

.cocktail-attribute-tile {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.42rem;
    text-align: center;
}

.cocktail-attribute-icon,
.recipe-meta-icon {
    --metadata-badge-shape: polygon(
        28% 0,
        72% 0,
        100% 28%,
        100% 72%,
        72% 100%,
        28% 100%,
        0 72%,
        0 28%
    );

    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    clip-path: var(--metadata-badge-shape);
    background: var(--border-strong);
    color: var(--accent);
}

.cocktail-attribute-icon::before,
.recipe-meta-icon::before {
    content: "";
    position: absolute;
    inset: 1px;
    clip-path: var(--metadata-badge-shape);
    background: var(--surface-soft);
}

.cocktail-attribute-icon {
    width: 3.15rem;
    height: 3.15rem;
}

.cocktail-attribute-icon .ui-icon,
.recipe-meta-icon .ui-icon {
    position: relative;
    z-index: 1;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cocktail-attribute-icon .ui-icon {
    width: 2rem;
    height: 2rem;
    stroke-width: 1.95;
}

.recipe-meta-grid > .recipe-meta-item {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.65rem;
    padding: 1.05rem 0.8rem;
    text-align: center;
}

.recipe-meta-grid .recipe-meta-icon {
    width: 3.35rem;
    height: 3.35rem;
    color: var(--accent);
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.recipe-meta-icon .ui-icon {
    width: 2.05rem;
    height: 2.05rem;
    stroke-width: 1.55;
}

.recipe-meta-item > strong {
    width: 100%;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.characteristic-multiselect-field {
    min-width: 0;
    margin: 0;
    border: 0;
    padding: 0;
}

.cocktail-filter-grid > .characteristic-multiselect-field {
    grid-column: span 2;
}

.cocktail-form .characteristic-multiselect-field {
    margin-top: 1rem;
}

.characteristic-multiselect-field > legend {
    margin-bottom: 0.2rem;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.characteristic-multiselect {
    position: relative;
    margin-top: 0.28rem;
}

.characteristic-multiselect > summary {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.62rem 0.8rem;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    list-style: none;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        background 140ms ease;
}

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

.characteristic-multiselect > summary:hover,
.characteristic-multiselect[open] > summary {
    border-color: var(--border-strong);
    background: var(--surface);
}

.characteristic-multiselect > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.characteristic-multiselect > summary > span:first-child {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.characteristic-multiselect-count {
    min-width: 1.65rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(215, 164, 82, 0.45);
    border-radius: 999px;
    padding: 0.14rem 0.42rem;
    background: rgba(215, 164, 82, 0.1);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
}

.characteristic-multiselect > summary .ui-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    transition: transform 140ms ease;
}

.characteristic-multiselect[open] > summary .ui-icon {
    transform: rotate(180deg);
}

.characteristic-multiselect-panel {
    position: absolute;
    z-index: 30;
    inset: calc(100% + 0.45rem) 0 auto;
    border: 1px solid var(--border-strong);
    border-radius: 0.8rem;
    padding: 0.55rem;
    background: var(--surface);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.38);
}

.characteristic-multiselect-options {
    max-height: 19rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.1rem;
}

.characteristic-multiselect-option {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.6rem;
    border-radius: 0.55rem;
    padding: 0.55rem;
    color: var(--text);
    cursor: pointer;
}

.characteristic-multiselect-option:hover {
    background: var(--surface-soft);
}

.characteristic-multiselect-option input {
    width: 1rem;
    height: 1rem;
    margin: 0.16rem 0 0;
    accent-color: var(--accent);
}

.characteristic-multiselect-option > span {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.characteristic-multiselect-option strong {
    font-size: 0.82rem;
    line-height: 1.25;
}

.characteristic-multiselect-option small {
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.characteristic-multiselect-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.45rem;
    border-top: 1px solid var(--border);
    padding: 0.45rem 0.25rem 0;
}

.button-text {
    border: 0;
    padding: 0.35rem 0.45rem;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.button-text:hover {
    text-decoration: underline;
}

@media (max-width: 780px) {
    .cocktail-filter-grid > .characteristic-multiselect-field {
        grid-column: 1 / -1;
    }

    .characteristic-multiselect-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .cocktail-card-attributes {
        gap: 0.4rem;
    }

    .cocktail-attribute-icon {
        width: 2.8rem;
        height: 2.8rem;
    }

    .cocktail-attribute-icon .ui-icon {
        width: 1.75rem;
        height: 1.75rem;
    }

    .characteristic-multiselect-panel {
        position: static;
        margin-top: 0.45rem;
        box-shadow: none;
    }
}


/* Phase 1 – Desktop-Grundlayout mit einklappbarer Seitenleiste */

.app-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr);

    transition: grid-template-columns 180ms ease;
}

.app-sidebar {
    position: sticky;
    z-index: 20;
    top: 0;

    min-width: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;

    border-right: 1px solid var(--sidebar-border);

    background:
        linear-gradient(
            180deg,
            color-mix(
                in srgb,
                var(--sidebar-accent) 5%,
                transparent
            ),
            transparent 18rem
        ),
        var(--sidebar-background);
    color: var(--sidebar-text);

    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.app-main {
    min-width: 0;
}

.app-authenticated .main-content {
    width: min(
        calc(100% - 3rem),
        var(--max-width)
    );

    padding-block: 3rem 5rem;
}

.auth-main-content {
    padding-block: 3rem 5rem;
}

.sidebar-header {
    flex: 0 0 auto;

    border-bottom: 1px solid var(--sidebar-border);
    padding: 1rem;
}

.sidebar-brand-row {
    min-height: 3.25rem;

    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sidebar-brand {
    min-width: 0;
    flex: 1 1 auto;

    display: flex;
    align-items: center;
    gap: 0.8rem;

    color: var(--sidebar-text);

    font-family:
        Georgia,
        "Times New Roman",
        serif;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.02;
    text-decoration: none;
}

.sidebar-brand-mark {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border: 1px solid var(--sidebar-border);
    border-radius: 50%;

    background: var(--sidebar-surface);
    color: var(--sidebar-accent);
}

.sidebar-brand-mark .sidebar-icon {
    width: 1.45rem;
    height: 1.45rem;
}

.sidebar-brand-copy {
    overflow: hidden;

    white-space: nowrap;
}

.sidebar-collapse-toggle {
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    margin: 0;
    border: 1px solid var(--sidebar-border);
    border-radius: 50%;
    padding: 0;

    background: var(--sidebar-surface);
    color: var(--sidebar-muted);

    transition:
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.sidebar-collapse-toggle:hover {
    border-color: var(--sidebar-accent);
    color: var(--sidebar-accent);
}

.sidebar-collapse-toggle:focus-visible,
.sidebar-link:focus-visible,
.sidebar-user-link:focus-visible,
.sidebar-user-action:focus-visible,
.sidebar-footer-action:focus-visible,
.sidebar-subnavigation a:focus-visible {
    outline: 2px solid var(--sidebar-accent);
    outline-offset: 2px;
}

.sidebar-collapse-icon {
    width: 1.15rem;
    height: 1.15rem;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 180ms ease;
}

.sidebar-user-panel {
    display: grid;
    gap: 0.5rem;

    margin-top: 1rem;
}

.sidebar-user-link,
.sidebar-user-action {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;

    border: 1px solid transparent;
    border-radius: 0.8rem;
    padding: 0.55rem;

    background: transparent;
    color: var(--sidebar-text);

    text-align: left;
    text-decoration: none;

    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease;
}

.sidebar-user-link:hover,
.sidebar-user-action:hover,
.sidebar-user-link.is-current,
.sidebar-user-action[aria-pressed="true"] {
    border-color: var(--sidebar-border);
    background: var(--sidebar-surface);
}

.sidebar-user-action[aria-pressed="true"] {
    color: var(--sidebar-accent);
}

.sidebar-user-avatar {
    width: 2.2rem;
    height: 2.2rem;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--sidebar-accent);
    color: var(--accent-text);

    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.sidebar-user-copy {
    min-width: 0;

    display: grid;
    gap: 0.1rem;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy strong {
    font-size: 0.9rem;
}

.sidebar-user-copy span {
    color: var(--sidebar-muted);

    font-size: 0.72rem;
}

.sidebar-navigation {
    min-height: 0;
    flex: 1 1 auto;

    display: flex;
    flex-direction: column;
    gap: 1rem;

    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-section {
    display: grid;
    gap: 0.3rem;
}

.sidebar-section-title {
    margin: 0 0 0.25rem;
    padding-inline: 0.65rem;

    color: var(--sidebar-muted);

    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-link,
.sidebar-footer-action {
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;

    border: 1px solid transparent;
    border-radius: 0.75rem;
    padding: 0.65rem 0.7rem;

    background: transparent;
    color: var(--sidebar-text);

    font-size: 0.88rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;

    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.sidebar-link:hover,
.sidebar-footer-action:hover {
    border-color: var(--sidebar-border);
    background: var(--sidebar-surface);
    color: var(--sidebar-accent);
}

.sidebar-link.is-current {
    border-color: color-mix(
        in srgb,
        var(--sidebar-accent) 30%,
        var(--sidebar-border)
    );

    background: var(--sidebar-surface-active);
    color: var(--sidebar-accent);
}

.sidebar-quick-link {
    border-color: color-mix(
        in srgb,
        var(--sidebar-accent) 25%,
        var(--sidebar-border)
    );
}

.sidebar-icon {
    width: 1.35rem;
    height: 1.35rem;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

.sidebar-label {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-navigation-group > .sidebar-link {
    grid-template-columns:
        1.75rem
        minmax(0, 1fr)
        1rem;
}

.sidebar-group-chevron {
    width: 1rem;
    height: 1rem;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-subnavigation {
    display: grid;
    gap: 0.12rem;

    margin: 0.25rem 0 0 1.55rem;
    border-left: 1px solid var(--sidebar-border);
    padding-left: 0.7rem;
}

.sidebar-subnavigation a {
    border-radius: 0.55rem;
    padding: 0.5rem 0.65rem;

    color: var(--sidebar-muted);

    font-size: 0.76rem;
    font-weight: 620;
    line-height: 1.3;
    text-decoration: none;
}

.sidebar-subnavigation a:hover,
.sidebar-subnavigation a.is-current {
    background: var(--sidebar-surface);
    color: var(--sidebar-accent);
}

.sidebar-footer {
    flex: 0 0 auto;

    display: grid;
    gap: 0.25rem;

    border-top: 1px solid var(--sidebar-border);
    padding: 0.8rem 1rem 1rem;

    background: var(--sidebar-background);
}

.sidebar-footer form {
    margin: 0;
}

.sidebar-footer-action {
    border: 0;
}

.sidebar-logout-action:hover {
    color: var(--danger);
}

.theme-icon-sun {
    display: none;
}

.theme-icon-moon {
    display: block;
}

html[data-theme="dark"] .theme-icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-icon-moon {
    display: none;
}

html.sidebar-collapsed .app-shell {
    grid-template-columns:
        var(--sidebar-collapsed-width)
        minmax(0, 1fr);
}

html.sidebar-collapsed .sidebar-brand-row {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
}

html.sidebar-collapsed .sidebar-brand {
    flex: 0 0 auto;
}

html.sidebar-collapsed .sidebar-brand-copy,
html.sidebar-collapsed .sidebar-user-copy,
html.sidebar-collapsed .sidebar-label,
html.sidebar-collapsed .sidebar-section-title,
html.sidebar-collapsed .sidebar-group-chevron,
html.sidebar-collapsed .sidebar-subnavigation {
    display: none;
}

html.sidebar-collapsed .sidebar-collapse-icon {
    transform: rotate(180deg);
}

html.sidebar-collapsed .sidebar-user-link,
html.sidebar-collapsed .sidebar-user-action,
html.sidebar-collapsed .sidebar-link,
html.sidebar-collapsed .sidebar-footer-action {
    grid-template-columns: 1.75rem;
    justify-content: center;
    justify-items: center;

    padding-inline: 0.55rem;
}

html.sidebar-collapsed .sidebar-user-link,
html.sidebar-collapsed .sidebar-user-action {
    grid-template-columns: 2.2rem;
}

html.sidebar-collapsed .sidebar-navigation,
html.sidebar-collapsed .sidebar-header,
html.sidebar-collapsed .sidebar-footer {
    padding-inline: 0.75rem;
}

html.sidebar-collapsed .sidebar-navigation {
    align-items: stretch;
}

html.sidebar-collapsed .sidebar-brand-mark {
    width: 2.5rem;
    height: 2.5rem;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns:
            var(--sidebar-collapsed-width)
            minmax(0, 1fr);
    }

    .app-sidebar .sidebar-brand-copy,
    .app-sidebar .sidebar-user-copy,
    .app-sidebar .sidebar-label,
    .app-sidebar .sidebar-section-title,
    .app-sidebar .sidebar-group-chevron,
    .app-sidebar .sidebar-subnavigation {
        display: none;
    }

    .app-sidebar .sidebar-brand-row {
        display: grid;
        justify-items: center;
        gap: 0.55rem;
    }

    .app-sidebar .sidebar-user-link,
    .app-sidebar .sidebar-user-action,
    .app-sidebar .sidebar-link,
    .app-sidebar .sidebar-footer-action {
        grid-template-columns: 1.75rem;
        justify-content: center;
        justify-items: center;

        padding-inline: 0.55rem;
    }

    .app-sidebar .sidebar-user-link,
    .app-sidebar .sidebar-user-action {
        grid-template-columns: 2.2rem;
    }

    .app-sidebar .sidebar-navigation,
    .app-sidebar .sidebar-header,
    .app-sidebar .sidebar-footer {
        padding-inline: 0.75rem;
    }

    .sidebar-collapse-toggle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell,
    .sidebar-collapse-icon,
    .sidebar-link,
    .sidebar-footer-action,
    body {
        transition: none;
    }
}
