:root {
    color-scheme: light;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;

    --green-900: #2f4933;
    --green-800: #3d5d42;
    --green-700: #4d7051;
    --green-200: #dce8d8;
    --green-100: #eaf1e6;
    --cream: #fffaf0;
    --gold-100: #fff3d0;
    --gold-400: #d1aa52;
    --text: #273028;
    --muted: #687068;
    --border: #c7d0c2;
    --danger: #9b3c38;
    --shadow: 0 14px 36px rgba(49, 68, 48, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        radial-gradient(
            circle at top left,
            rgba(79, 112, 78, 0.08),
            transparent 27%
        ),
        #eef2e9;
}

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

button,
a,
label {
    -webkit-tap-highlight-color: transparent;
}

button {
    touch-action: manipulation;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Kompakte Kopfzeile */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(45, 70, 48, 0.14);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.site-header-inner {
    width: min(1280px, calc(100% - 24px));
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-right: auto;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--green-100);
    font-size: 21px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 850;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--green-900);
    background: var(--green-100);
}

.user-menu {
    position: relative;
}

.user-menu summary {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 800;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--green-700);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 11px);
    right: 0;
    width: 205px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow);
}

.user-menu-panel a,
.user-menu-panel button {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    padding: 8px 13px;
    border: 0;
    color: var(--text);
    background: #fff;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
    background: var(--green-100);
}

/* Grundlayout */

.page-shell {
    width: min(1280px, calc(100% - 24px));
    margin: 20px auto 70px;
}

.auth-shell {
    width: min(460px, calc(100% - 24px));
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0 auto;
    padding: 30px 0;
}

.flash,
.error-box {
    margin-bottom: 15px;
    padding: 13px 16px;
    border-radius: 12px;
}

.flash-success {
    color: #2e5b37;
    background: #e0f0df;
    border: 1px solid #a6c9a5;
}

.flash-error,
.error-box {
    color: #762f2c;
    background: #fae5e3;
    border: 1px solid #dca6a2;
}

.error-box ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.eyebrow {
    color: var(--green-700);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.page-heading,
.compact-panel {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.page-heading {
    margin-bottom: 17px;
}

.page-heading h1,
.compact-panel h1 {
    margin: 4px 0 0;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.page-heading h1 {
    font-size: clamp(34px, 5vw, 52px);
}

.compact-panel h1 {
    font-size: clamp(31px, 5vw, 46px);
}

/* Buttons */

.button {
    min-height: 41px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 13px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 850;
}

.button-primary {
    color: #fff;
    background: var(--green-700);
}

.button-primary:hover {
    background: var(--green-900);
}

.button-muted {
    color: var(--green-900);
    background: var(--green-100);
}

.button-danger {
    color: #fff;
    background: var(--danger);
}

.button-large {
    min-height: 47px;
    padding-right: 20px;
    padding-left: 20px;
}

.button-small {
    min-height: 35px;
    padding: 5px 10px;
    font-size: 13px;
}

/* Login */

.login-card {
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 23px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-brand {
    padding: 28px 30px 23px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), transparent),
        var(--green-800);
    text-align: center;
}

.login-icon {
    display: block;
    font-size: 58px;
}

.login-brand p {
    margin: 6px 0 0;
    font-weight: 850;
}

.login-brand h1 {
    margin: 4px 0 6px;
    font-size: 36px;
}

.login-brand > span:last-child {
    color: rgba(255,255,255,0.78);
}

.login-card form {
    padding: 25px 30px 29px;
}

/* Formulare */

.form-stack {
    display: grid;
    gap: 15px;
}

.field {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.field > span {
    font-size: 13px;
    font-weight: 850;
}

.field small {
    color: var(--muted);
    line-height: 1.4;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #bfc9ba;
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    outline: none;
}

.field textarea {
    min-height: 91px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--green-700);
    box-shadow: 0 0 0 3px rgba(77, 112, 81, 0.14);
}

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.checkbox-row input {
    width: 19px;
    height: 19px;
    accent-color: var(--green-700);
}

.form-panel,
.table-panel,
.search-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.form-panel {
    padding: 21px;
}

.form-panel + .form-panel {
    margin-top: 15px;
}

.form-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 17px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e0e5dd;
}

.form-panel-head h2 {
    margin: 3px 0 0;
    font-size: 24px;
}

.form-panel-head p {
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

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

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 19px;
}

.sticky-save {
    position: sticky;
    bottom: 12px;
    z-index: 40;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 17px;
    padding: 11px;
    border: 1px solid rgba(75, 105, 75, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

/* Startseite */

.home-intro {
    margin-bottom: 15px;
    padding: 18px 21px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow);
}

.search-panel {
    padding: 13px;
}

.search-main {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px auto auto;
    gap: 9px;
    align-items: end;
}

.search-field input {
    min-height: 45px;
    font-size: 16px;
}

.compact-field {
    gap: 4px;
}

.category-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 15px 0 9px;
    padding-bottom: 4px;
}

.category-tabs a {
    flex: 0 0 auto;
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    padding: 6px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
    font-weight: 850;
}

.category-tabs a:hover,
.category-tabs a.active {
    color: #fff;
    background: var(--green-700);
    border-color: var(--green-700);
}

.result-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 11px 1px;
    color: var(--muted);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.recipe-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    color: inherit;
    background: #fff;
    box-shadow: 0 10px 26px rgba(49, 68, 48, 0.09);
    text-decoration: none;
    transition:
        transform 150ms ease,
        box-shadow 150ms ease;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.recipe-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--green-100);
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-card-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 70px;
}

.difficulty {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.difficulty-leicht {
    background: #477c4d;
}

.difficulty-mittel {
    background: #a7782b;
}

.difficulty-schwer {
    background: #9a403b;
}

.recipe-card-body {
    padding: 16px;
}

.recipe-category {
    color: var(--green-700);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.recipe-card h2 {
    margin: 4px 0 0;
    font-size: 23px;
    line-height: 1.08;
}

.recipe-card p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.48;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
    color: #596159;
    font-size: 13px;
    font-weight: 750;
}

.empty-state {
    padding: 48px 24px;
    border: 1px dashed #abb9a7;
    border-radius: 18px;
    background: rgba(255,255,255,0.65);
    text-align: center;
}

.empty-state > span {
    font-size: 58px;
}

.empty-state h2 {
    margin: 8px 0 0;
}

.empty-state p {
    color: var(--muted);
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 21px;
}

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

/* Bildformular */

.image-form-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1.3fr);
    gap: 15px;
}

.image-upload-box,
.image-preview-box {
    min-height: 215px;
    border: 2px dashed #b9c6b5;
    border-radius: 15px;
}

.image-upload-box {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 20px;
    cursor: pointer;
    text-align: center;
}

.image-upload-box:hover {
    background: var(--green-100);
}

.image-upload-box input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.image-upload-icon {
    font-size: 43px;
}

.image-upload-box strong,
.image-upload-box small {
    display: block;
}

.image-upload-box small {
    margin-top: 5px;
    color: var(--muted);
}

.image-preview-box {
    overflow: hidden;
    background: #f1f4ee;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    min-height: 215px;
    max-height: 350px;
    object-fit: cover;
}

.image-preview-placeholder {
    min-height: 215px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.danger-check {
    width: fit-content;
    margin-top: 13px;
    color: var(--danger);
}

/* Gruppeneditor */

#groups-editor {
    display: grid;
    gap: 14px;
}

.group-editor-card {
    padding: 16px;
    border: 1px solid #bfcaba;
    border-radius: 14px;
    background: #fbfdf9;
}

.group-editor-card-head,
.ingredient-editor-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.group-editor-card-head {
    margin-bottom: 13px;
}

.group-editor-title {
    display: inline;
    margin: 0 0 0 7px;
    font-size: 22px;
}

.group-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
    padding: 13px;
    border-radius: 12px;
    background: var(--gold-100);
    border-left: 5px solid var(--gold-400);
}

.ingredient-editor-heading {
    margin: 14px 0 8px;
}

.ingredient-editor-heading strong,
.ingredient-editor-heading small {
    display: block;
}

.ingredient-editor-heading small {
    margin-top: 2px;
    color: var(--muted);
}

.ingredients-editor-list {
    display: grid;
    gap: 8px;
}

.ingredient-editor-row {
    display: grid;
    grid-template-columns:
        96px
        105px
        minmax(180px, 0.8fr)
        minmax(220px, 1.2fr)
        42px;
    gap: 8px;
    align-items: end;
    padding: 9px;
    border: 1px solid #d5ddd1;
    border-radius: 11px;
    background: #fff;
}

.icon-button {
    width: 42px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 23px;
    font-weight: 900;
}

.danger-icon {
    color: var(--danger);
    background: #f7e7e5;
}

/* Rezeptdetail – bewusst kompakte Kopfleiste */

.recipe-detail-head {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fff;
    box-shadow: var(--shadow);
}

.recipe-detail-image {
    min-height: 190px;
    background: var(--green-100);
}

.recipe-detail-image img {
    width: 100%;
    height: 100%;
    min-height: 190px;
    object-fit: cover;
}

.recipe-detail-placeholder {
    height: 100%;
    min-height: 190px;
    display: grid;
    place-items: center;
    font-size: 72px;
}

.recipe-detail-copy {
    padding: 16px 20px;
}

.recipe-detail-topline {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.recipe-detail h1 {
    margin: 2px 0 0;
    font-size: clamp(31px, 4.6vw, 48px);
    line-height: 1;
    letter-spacing: -0.043em;
}

.recipe-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.recipe-description {
    max-width: 850px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.compact-meta > span {
    min-width: 116px;
    padding: 6px 9px;
    border-radius: 9px;
    background: var(--green-100);
}

.compact-meta small,
.compact-meta strong {
    display: block;
}

.compact-meta small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.compact-meta strong {
    margin-top: 1px;
    font-size: 14px;
}

.detail-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.portion-picker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 3px;
    border-radius: 10px;
    background: #e2e9df;
}

.portion-picker button {
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--green-700);
    cursor: pointer;
    font-size: 19px;
    font-weight: 900;
}

.portion-picker output {
    min-width: 100px;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
}

/* Küchentabelle */

.recipe-table-wrap {
    margin-top: 17px;
}

.recipe-table-heading {
    margin-bottom: 10px;
}

.recipe-table-heading h2 {
    margin: 0;
    font-size: 27px;
}

.recipe-table-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

.recipe-groups {
    display: grid;
    gap: 8px;
}

.recipe-group {
    display: grid;
    grid-template-columns:
        46px
        minmax(0, 1.45fr)
        minmax(220px, 0.85fr)
        54px;
    overflow: hidden;
    border: 1px solid #b7c3b2;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(49, 68, 48, 0.08);
    transition: opacity 140ms ease;
}

.recipe-group-number {
    display: grid;
    place-items: center;
    color: #fff;
    background: #526e50;
    font-size: 18px;
    font-weight: 950;
}

.recipe-group-ingredients {
    min-width: 0;
}

.recipe-ingredient-row {
    display: grid;
    grid-template-columns: 75px 78px minmax(0, 1fr);
    min-height: 55px;
}

.recipe-ingredient-row + .recipe-ingredient-row {
    border-top: 1px solid #d7dfd3;
}

.recipe-amount,
.recipe-unit,
.recipe-ingredient-name {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 8px 9px;
}

.recipe-amount {
    justify-content: flex-end;
    font-size: 16px;
    font-weight: 900;
}

.recipe-unit {
    border-right: 1px solid #d7dfd3;
    border-left: 1px solid #d7dfd3;
}

.recipe-ingredient-name {
    display: block;
    align-content: center;
}

.recipe-ingredient-name strong {
    font-size: 16px;
}

.recipe-ingredient-name small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    line-height: 1.32;
}

.recipe-group-action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 11px 15px;
    border-left: 4px solid var(--gold-400);
    background: var(--gold-100);
}

.recipe-group-action > span {
    color: #846a2f;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.recipe-group-action > strong {
    margin-top: 2px;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.1;
}

.recipe-group-action > small {
    margin-top: 5px;
    line-height: 1.35;
}

.recipe-group-check {
    align-self: center;
    justify-self: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--green-700);
    border-radius: 50%;
    color: var(--green-700);
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 950;
}

.recipe-group.done {
    opacity: 0.45;
}

.recipe-group.done .recipe-group-action > strong {
    text-decoration: line-through;
}

.recipe-group.done .recipe-group-check {
    color: #fff;
    background: var(--green-700);
}

/* Benutzer */

.table-panel {
    overflow: hidden;
}

.responsive-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #e0e5dd;
    text-align: left;
}

th {
    color: #536053;
    background: #f3f6f1;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

td small {
    display: block;
}

.muted-text {
    margin-top: 2px;
    color: var(--muted);
}

.actions-column {
    text-align: right;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.status-chip {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-active {
    color: #315f38;
    background: #dcefdc;
}

.status-inactive {
    color: #7b3430;
    background: #f3dedd;
}

.user-form,
.password-form {
    max-width: 850px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 17px;
}

.checkbox-card {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}

.checkbox-card input {
    width: 20px;
    height: 20px;
    accent-color: var(--green-700);
}

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

.checkbox-card small {
    margin-top: 3px;
    color: var(--muted);
}

/* Responsive */

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

    .ingredient-editor-row {
        grid-template-columns:
            88px
            98px
            minmax(180px, 1fr)
            42px;
    }

    .ingredient-editor-row .field:nth-child(4) {
        grid-column: 1 / 4;
    }

    .ingredient-editor-row .icon-button {
        grid-column: 4;
        grid-row: 1;
    }
}

@media (max-width: 820px) {
    .site-header-inner {
        flex-wrap: wrap;
        gap: 7px;
        padding: 7px 0;
    }

    .brand {
        flex: 1 1 auto;
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }

    .main-nav a {
        flex: 0 0 auto;
    }

    .user-menu-name {
        display: none;
    }

    .search-main {
        grid-template-columns: 1fr 180px;
    }

    .search-main .button {
        width: 100%;
    }

    .recipe-detail-head {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .recipe-detail-topline {
        display: block;
    }

    .recipe-actions {
        margin-top: 8px;
    }

    .recipe-group {
        grid-template-columns: 43px minmax(0, 1fr) 52px;
    }

    .recipe-group-number {
        grid-column: 1;
        grid-row: 1;
    }

    .recipe-group-ingredients {
        grid-column: 2;
        grid-row: 1;
    }

    .recipe-group-check {
        grid-column: 3;
        grid-row: 1;
    }

    .recipe-group-action {
        grid-column: 1 / -1;
        grid-row: 2;
        border-top: 1px solid #dccb9c;
        border-left: 0;
    }

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

@media (max-width: 640px) {
    .page-shell {
        width: min(100%, calc(100% - 14px));
        margin-top: 11px;
    }

    .brand small {
        display: none;
    }

    .page-heading,
    .compact-panel {
        align-items: flex-start;
    }

    .page-heading {
        display: block;
    }

    .page-heading > .button {
        margin-top: 11px;
    }

    .compact-panel {
        padding: 16px;
    }

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

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

    .recipe-card {
        display: grid;
        grid-template-columns: 125px minmax(0, 1fr);
    }

    .recipe-card-image {
        height: 100%;
        min-height: 170px;
    }

    .recipe-card h2 {
        font-size: 20px;
    }

    .form-grid,
    .checkbox-grid,
    .group-action-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .form-panel {
        padding: 15px;
    }

    .form-panel-head,
    .groups-editor-heading {
        display: block;
    }

    .groups-editor-heading .button {
        width: 100%;
        margin-top: 11px;
    }

    .ingredient-editor-row {
        grid-template-columns: 1fr 1fr 42px;
    }

    .ingredient-editor-row .field:nth-child(1) {
        grid-column: 1;
    }

    .ingredient-editor-row .field:nth-child(2) {
        grid-column: 2;
    }

    .ingredient-editor-row .field:nth-child(3),
    .ingredient-editor-row .field:nth-child(4) {
        grid-column: 1 / 3;
    }

    .ingredient-editor-row .icon-button {
        grid-column: 3;
        grid-row: 1;
    }

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

    .recipe-detail-image,
    .recipe-detail-image img,
    .recipe-detail-placeholder {
        min-height: 175px;
        max-height: 230px;
    }

    .recipe-detail-copy {
        padding: 14px 16px;
    }

    .recipe-detail h1 {
        font-size: 37px;
    }

    .compact-meta {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .compact-meta > span {
        min-width: 0;
    }

    .detail-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .portion-picker {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .detail-controls .button {
        width: 100%;
    }

    .recipe-ingredient-row {
        grid-template-columns: 58px 61px minmax(0, 1fr);
    }

    .recipe-amount,
    .recipe-unit,
    .recipe-ingredient-name {
        padding: 7px 6px;
    }

    .recipe-amount,
    .recipe-ingredient-name strong {
        font-size: 14px;
    }

    .table-actions {
        min-width: 190px;
    }

    .sticky-save {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* Druck */

@media print {
    .site-header,
    .flash,
    .error-box,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .page-shell {
        width: 100%;
        margin: 0;
    }

    .recipe-detail-head,
    .recipe-group {
        box-shadow: none;
    }

    .recipe-detail-head {
        grid-template-columns: 160px minmax(0, 1fr);
    }

    .recipe-detail-image,
    .recipe-detail-image img,
    .recipe-detail-placeholder {
        min-height: 130px;
        max-height: 160px;
    }

    .recipe-group {
        grid-template-columns:
            40px
            minmax(0, 1.45fr)
            minmax(190px, 0.85fr);
        break-inside: avoid;
    }

    .recipe-group-check {
        display: none;
    }
}

/* LIBRO SUCHVORSCHLÄGE */

.search-autocomplete {
    position: relative;
    min-width: 0;
}

.search-suggestions {
    position: absolute;
    z-index: 120;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    overflow: hidden;
    max-height: 390px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(39, 57, 40, 0.2);
}

.search-suggestion {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #e4e9e1;
    color: var(--text);
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.search-suggestion:last-child {
    border-bottom: 0;
}

.search-suggestion:hover,
.search-suggestion.active {
    background: var(--green-100);
}

.search-suggestion-label {
    min-width: 0;
    overflow: hidden;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion-type {
    padding: 4px 7px;
    border-radius: 999px;
    color: var(--green-900);
    background: #dfeadc;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.search-suggestion[data-type="Zutat"] .search-suggestion-type {
    color: #755c25;
    background: #fff0c6;
}

.search-suggestion[data-type="Zubereitung"] .search-suggestion-type {
    color: #74443a;
    background: #f5dfd8;
}

.search-suggestions-message {
    padding: 13px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 640px) {
    .search-suggestions {
        position: fixed;
        top: 118px;
        right: 7px;
        left: 7px;
        max-height: min(430px, calc(100vh - 140px));
    }

    .search-suggestion {
        min-height: 53px;
    }
}

/* LIBRO NEUES BRANDING */

.brand {
    flex: 0 0 auto;
}

.brand-logo {
    width: 205px;
    height: auto;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 2px 3px rgba(40, 63, 40, 0.12));
}

.login-logo {
    width: min(330px, 92%);
    height: auto;
    display: block;
    margin: 0 auto 12px;
    padding: 11px 17px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 10px 26px rgba(24, 49, 28, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.login-brand h1 {
    margin-top: 9px;
}

@media (max-width: 820px) {
    .brand-logo {
        width: 185px;
        max-height: 42px;
    }
}

@media (max-width: 460px) {
    .brand-logo {
        width: 160px;
        max-height: 38px;
    }

    .login-logo {
        width: min(290px, 94%);
        padding: 9px 13px;
    }
}

@media print {
    .brand-logo {
        filter: none;
    }
}

