body {
    font-family: Arial, sans-serif;
    background: rgba(0, 0, 0, 0.5) url('/files/blatt-brett-brot-349610_bearb.jpg') repeat center center fixed;
    background-size: cover;
    color: #333;
    margin: 0;
    padding: 5px;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
}


/* === Mobile Ansicht (Smartphones hochkant) === */
@media only screen and (max-width: 767px) {
    body {
        /* background: none; */
        background-color: #333;
        margin: 0;
        padding: 5px;
    }

    .recipe {
        max-width: 100%;
        margin: 0;
        padding: 10px;
        border: 1px solid #ddd; /* Rahmen bleibt auf Mobil */
        border-radius: 8px;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    }

    .logo {
        opacity: 0; /* Logo sanft ausgeblendet auf Mobile */
        pointer-events: none; /* Klicks verhindern */
    }
}


/* === Printausgabe === */
@media print {
    /* Reset: kein Hintergrund, kein Rand, maximale Breite nutzen */
    body {
        background: none !important;
        color: #000;
        margin: 0;
        padding: 0;
        font-size: 11pt;
    }

    .recipe {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* Navigation, Menü, Footer verstecken */
    .topbar, .menu-drawer, .menu-overlay,
    footer, .recipe-id,
    .button, .btn-sm, .form-actions,
    #macroBar { display: none !important; }

    /* Logo oben rechts im Druck */
    .logo {
        display: block !important;
        position: absolute;
        top: 0;
        right: 0;
        width: 3cm;
        height: auto;
        aspect-ratio: 5 / 3;
        opacity: 1 !important;
        pointer-events: none;
    }
    .logo::before {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        background-image: url('/files/perfekte-balance-logo.jpg');
        background-size: contain;
        background-repeat: no-repeat;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Überschriften: schwarz, kompakt */
    h1.title {
        color: #000;
        font-size: 16pt;
        margin: 0 0 4pt 0;
    }

    h2 {
        color: #000;
        border-bottom: 0.5pt solid #000;
        font-size: 11pt;
        margin: 8pt 0 4pt 0;
        padding-bottom: 2pt;
    }

    section { margin-bottom: 6pt; }

    /* Tabellen: keine Farben */
    table th {
        background: #eee !important;
        color: #000 !important;
        font-size: 9pt;
    }
    table td { font-size: 10pt; }

    /* Info-Chips: flach drucken, kein Rahmen */
    .info-chips {
        border: none;
        background: none;
        gap: 0;
    }
    .info-chip {
        background: #fff;
        border-bottom: 0.5pt solid #ddd;
        padding: 2pt 6pt;
        font-size: 9pt;
    }

    /* Nährwerte: flach, kein Rahmen */
    .nutrition-grid {
        border: none;
        background: none;
        gap: 0;
    }
    .nutrition-tile {
        background: #fff;
        border-bottom: 0.5pt solid #ddd;
        padding: 2pt 4pt;
    }
    .nutrition-tile dt { color: #333; font-size: 8pt; }
    .nutrition-tile dd { color: #000; font-size: 10pt; }

    /* Zutatenliste: kompakt */
    .ingredients-list li {
        padding: 2pt 0 2pt 16pt;
        font-size: 10pt;
        border-bottom: none;
    }

    /* Zubereitung: kompakt */
    .formatted-text { font-size: 10pt; line-height: 1.4; }

    /* Seitenumbrüche vermeiden wo möglich */
    section { break-inside: avoid-page; }
    .info-chips, .nutrition-grid { break-inside: avoid; }

    /* Keine Leerseiten */
    html, body { height: auto; }

    /* Links nicht als URL drucken */
    a[href]::after { content: none !important; }
}

.recipe {
    max-width: 80%;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: #fff;
    position: relative;
    z-index: 2;  /* Z-Index für Rezept Container */
}

h1.title {
    font-size: 1.3em;
    color: #006633;
    margin-bottom: 16px;
}

section {
    margin-bottom: 20px;
}

h2 {
    font-size: 1em;
    color: #006633;
    border-bottom: 2px solid #e5f5ee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

ul, ol {
    padding-left: 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    padding: 10px 12px;
    text-align: left;
}

table th {
    background: #006633;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table td {
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #f0fdf4; }

.table-container {
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}


.logo {
    position: absolute;
    /* content: ""; */
    display: block;
    top: 10px;
    right: 20px;
    width: 100%;
    max-width: 3cm;
    height: auto;
    aspect-ratio: 5 / 3;
/*
    background-image: url('/files/perfekte-balance-logo.jpg') ;
    background-size: contain; 
    background-repeat: no-repeat;
*/
    z-index: 1;
}

.logo::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-image: url('/files/perfekte-balance-logo.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;  /* Z-Index für Rezept Container */
}


/* ===== Top Navigation Bar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #006633;
    padding: 8px 12px;
    border-radius: 0 0 10px 10px;
    max-width: 80%;
    margin: 0 auto 8px auto;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    position: relative;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.topbar-btn:hover { background: rgba(255,255,255,0.25); }
.topbar-btn:active { background: rgba(255,255,255,0.35); }

/* headmenu-right still works for extra buttons pushed right */
.headmenu-right { margin-left: auto; }

/* Burger button */
.burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.burger-btn:hover { background: rgba(255,255,255,0.25); }

/* Overlay behind drawer */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
}

.menu-overlay.active { display: block; }

/* Slide-in drawer from right */
.menu-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 270px;
    height: 100%;
    background: #fff;
    z-index: 300;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-drawer.active { right: 0; }

.menu-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #006633;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.menu-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li a {
    display: block;
    padding: 13px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.menu-list li a:hover { background: #f0fdf4; color: #006633; }

.menu-list .menu-logout {
    color: #991b1b;
    font-weight: 600;
}

.menu-list .menu-logout:hover { background: #fef2f2; }

.menu-divider {
    height: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 4px 0;
}

.menu-section-label {
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons inside topbar that come from headmenu_extra should match */
.topbar .button, .topbar a.button {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.topbar .button:hover, .topbar a.button:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* Mobile adjustments */
@media (max-width: 767px) {
    .topbar { border-radius: 0; margin-bottom: 0; padding: 6px 8px; }
    .topbar-btn { padding: 6px 8px; font-size: 13px; }
    .topbar .button, .topbar a.button { padding: 6px 8px; font-size: 13px; }
}

.recipe-id {
    color: lightgray; /* Hellgraue Schriftfarbe */
    font-size: 8pt;   /* Schriftgröße 8pt */
}

a {
    color: #006633;
    text-decoration: none;
    transition: color 0.2s;
}

a:visited {
    color: #006633;
}

a:hover {
    color: #004d26;
    text-decoration: underline;
}

a:active {
    color: #00331a;
}

.btnrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    background-color: #fff;
}

.button {
    position: relative;
    display: inline-block;
    margin: 5px 0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background-color: #006633;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

a.button,
a.button:visited,
a.button:hover,
a.button:active {
    color: white;
    text-decoration: none;
}

.button:hover {
    background-color: #004d26;
}

.button-danger {
    background-color: #c0392b;
}

.button-danger:hover {
    background-color: #922b21;
}

.input-field {
    width: 100%;
    max-width: 800px;
    padding: 10px 12px;
    font-size: 15px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.input-field:focus {
    outline: none;
    border-color: #006633;
    box-shadow: 0 0 0 3px rgba(0,102,51,0.12);
}

select.input-field {
    appearance: auto;
    -webkit-appearance: auto;
}

textarea {
    width: 100%;
    max-width: 800px;
    height: auto;
    padding: 10px 12px;
    font-size: 15px;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #006633;
    box-shadow: 0 0 0 3px rgba(0,102,51,0.12);
}

.pw-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

/* ===== Modern Form Layout ===== */
.form-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.form-card h2 {
    font-size: 16px;
    font-weight: 700;
    color: #006633;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0fdf4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 540px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .form-full { grid-column: 1 / -1; }
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.form-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

.gdpr-box {
    padding: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.gdpr-box label {
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
}

.gdpr-box input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.formatted-text {
    line-height: 1.6;
}

.formatted-text h3 {
    margin: 16px 0 8px 0;
    font-size: 16px;
    color: #006633;
}

.formatted-text hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 12px 0;
}

user-info {
    color: darkgray; /* Hellgraue Schriftfarbe */
    font-size: 8pt;   /* Schriftgröße 8pt */
}

/* Flash-Messages */
.flashes {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.flashes li {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
}

.flashes li.warning,
.flashes li.message {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.flashes li.error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.flashes li.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.version {
    font-size: 8pt;
    margin-top: 20px;
    padding: 10px;
    background-color: #e9ecef;
    border: 1px solid #ccc;
    border-radius: 5px;
}
