
    :root { 
        --belfor-red: #E3000F;
        --belfor-dark: #222222; 
        --bg-dark: #121212; 
        --surface: #1e1e1e; 
        --primary: #e50000; 
        --text-light: #ffffff; 
        --text-gray: #aaaaaa; 
    }
    .highlight { color:#e50000; }
    * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 0; user-select: none; -webkit-tap-highlight-color: transparent; }
    
    body { 
    background: #f0f2f5; 
    color: var(--text-light); 
    height: 100dvh; 
    overflow: hidden; 
    display: flex;
    flex-direction: column;
}

main { 
    padding: 20px; 
    background: #fff; 
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto; 
    flex: 1;             /* Füllt den restlichen Platz unter dem Header aus */
    overflow: hidden;   /* Verhindert Überlauf im Container */
    display: flex;
    flex-direction: column;
	  position:relative;
}

.view { 
    display: none; 
	  border-radius: 8px; 
    overflow-y: auto;   /* Scrollt, wenn der Inhalt zu lang ist */
    height: 100%;       /* Wichtig, damit der Scrollbereich greift */
}

.view.active { 
    display: block; 
}

    
    header { 
        user-select: none; 
        background: var(--belfor-dark); 
        color: white; 
        padding-left: 1rem; 
    	  padding-right: 1rem; 
        border-bottom: 4px solid var(--belfor-red); 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        position: sticky; 
        top: 0; 
        z-index: 50;
        width: 100%;
    }
    .header-title-wrapper { cursor: pointer; }
    .header-title-wrapper h2 { margin: 0; font-size: 1.5rem; letter-spacing: 0.5px; }
    .header-title-wrapper .subtitle { font-size: 12px;   opacity: 0.8; }
    .header-title-wrapper .highlight { color: var(--belfor-red); }
    .header-actions { display: flex; gap: 18px; align-items: center; }

   input[type="text"], textarea, .btn { width: 100%; padding: 16px; border: 1px solid #333; background: #2a2a2a; color: white; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
    textarea[disabled] { color:#69696938;}
    
    #toast { position: fixed; top: -200px; left: 50%; transform: translateX(-50%); background: #28a745; color: white; padding: 10px 20px; border-radius: 20px; font-weight: bold; z-index: 9999; transition: top 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
    @keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.shake-animation {
    animation: shake 0.4s ease-in-out;
    /* Optional: Falls das Icon inline ist, auf block oder inline-block setzen, 
       damit transform greift */
    display: inline-block; 
}

    /* Kamera */
    #view-camera {border-radius: 0; position: absolute; left:0; top:0;  padding: 0; background: black; overflow: hidden; }
    #camera-stream { width: 100%; height: 100dvh; object-fit: cover; }
    #flash-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: white; opacity: 0; pointer-events: none; transition: opacity 0.15s; }
    #focus-ring { position: absolute; width: 60px; height: 60px; border: 2px solid #ffd700; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 5; }
    
    .flash-btn { position: absolute; top: 20px; right: 20px; z-index: 20; background: rgba(0,0,0,0.5); color: white; border: 2px solid rgba(255,255,255,0.3); width: 50px; height: 50px; border-radius: 50%; font-size: 1.5rem; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); cursor: pointer; transition: color 0.3s; }
    .camera-controls { position: absolute; bottom: 40px; left: 0; width: 100%; display: flex; justify-content: space-around; align-items: center; padding: 0 20px; z-index: 10; }
    .shutter-btn { width: 85px; height: 85px; background: white; border-radius: 50%; border: 6px solid #ccc; cursor: pointer; }
    .shutter-btn:active { transform: scale(0.9); }
    #cam-preview { width: 60px; height: 60px; border-radius: 8px; border: 2px solid white; object-fit: cover; cursor: pointer; }

    /* Galerie */
    .gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding-bottom: 140px; }
    .gallery-item { position: relative; aspect-ratio: 1; border: 1px solid #ccc; background: #2a2a2a; border-radius: 4px; overflow: hidden; cursor: pointer; }
    .gallery-item.selected { border-color: var(--primary); }
    .gallery-item.selected::after { content: '✔'; position: absolute; top: 4px; right: 4px; background: var(--primary); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 12px; font-weight: bold; }
    .sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; padding: 15px 10px 30px 10px; background: rgba(30,30,30,0.95); display: flex; gap: 8px; border-top: 1px solid #333; z-index: 100; }
    
    .date-header { grid-column: 1 / -1; padding: 20px 10px 10px 10px; color: var(--text-gray); font-size: 0.9rem; text-transform: uppercase; }

    /* Lightbox UI */
    #lightbox { display: none; position: fixed; top:0; left:0; width:100%; height:100dvh; background: black; z-index: 2000; flex-direction: column; }
    .lb-topbar { padding: 20px; display: flex; justify-content: space-between; align-items: center; z-index: 2002; background: linear-gradient(rgba(0,0,0,0.8), transparent); }
    .lb-counter { color: white; font-size: 1.2rem; font-weight: bold; text-shadow: 1px 1px 3px black; }
    .lb-menu-btn { color: white; font-size: 2rem; cursor: pointer; padding: 0 10px; line-height: 1; }
    
    #lb-dropdown { display: none; position: absolute; top: 60px; right: 20px; background: #2a2a2a; border: 1px solid #444; border-radius: 8px; z-index: 2005; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
    #lb-dropdown div { padding: 15px 25px; color: white; font-size: 1.1rem; cursor: pointer; border-bottom: 1px solid #444; display: flex; align-items: center; gap: 8px; }
    #lb-dropdown div:last-child { border-bottom: none; }
    
    .lb-img-container { flex: 1; display: flex; justify-content: center; align-items: center; overflow: hidden; width: 100%; position: relative; }
    #lb-image { max-width: 100%; max-height: 100%; object-fit: contain; }
    .lb-bottombar { padding: 15px; background: #1e1e1e; border-top: 1px solid #333; z-index: 2002; }
    .lb-back-btn { width: 100%; padding: 15px; background: #333; color: white; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: bold; cursor: pointer; }

    /* Overlay & Menü Styles */
    #proj-edit-ov, #share-ov, #pdf-layout-ov { display: none; position: fixed; top:0; left:0; width:100%; height:100dvh; background:rgba(0,0,0,0.85); z-index:6000; align-items:center; justify-content:center; }
    .menu-box { background: var(--surface); width: 90%; padding: 20px; border-radius: 12px; border: 1px solid #444; }
    
    details { text-align: center; cursor: pointer; font-weight: bold; border-radius: 8px; font-size: 1.1rem; }
    .btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; font-weight: bold; transition: opacity 0.2s, transform 0.1s; }
    .btn:hover { opacity: 0.9; }
    .btn-primary { background-color: var(--primary); border: none; }
    .icon-btn { display: block; background: rgba(0,0,0,0.7); color: white; border: none; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; cursor: pointer; backdrop-filter: blur(5px); }
    summary, #proj-title { display: flex; align-items: center; gap: 8px; }
    #set-ov { display:none; position:fixed; top:0; left:0; z-index:3000; background:var(--bg-dark); padding:20px; width:100%; height:100dvh; }

    .lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.3s ease;
		}

		.lb-nav:hover {
    	background: rgba(0, 0, 0, 0.8);
		}

		.lb-prev { left: 20px; }
		.lb-next { right: 20px; }


    @media (hover: none) and (pointer: coarse) {
        .lb-nav {
            display: none;
        }
    }
    @media (min-width: 768px) {
        .sticky-footer {
            width: 80% !important;
            max-width: 1400px !important;
            left: 50% !important;
            transform: translateX(-50%);
            padding: 10px 20px 15px 20px; /* Kompakter */
            border-left: 1px solid #333;
            border-right: 1px solid #333;
        }

        /* ALLES ETWAS KLEINER (Paddings & Fonts) */
        input[type="text"], textarea, .btn {
            padding: 10px 12px; /* Dünnere Felder/Buttons */
            font-size: 0.85rem; /* Etwas kleinere Schrift */
            margin-bottom: 8px;
        }
        
        header { padding-bottom: 10px; margin-bottom: 15px; }
        header h1 { font-size: 1.6rem; }
        details { font-size: 1rem; }
        summary { padding: 12px !important; }
        
        /* Die Kamera-Buttons kompakter machen */
        .icon-btn { width: 45px; height: 45px; font-size: 1.2rem; }
        .shutter-btn { width: 65px; height: 65px; border-width: 4px; }
        #cam-preview { width: 45px; height: 45px; }
        .flash-btn { width: 40px; height: 40px; font-size: 1.2rem; }
        .camera-controls { bottom: 25px; }

        /* GALERIE RASTER: Automatisch an die 80% Breite anpassen (Viele Bilder pro Reihe) */
        .gallery-grid {
            /* Mindestens 120px breit pro Bild, füllt den Rest automatisch auf */
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 8px;
            padding-bottom: 90px; /* Footer ist jetzt schmaler */
        }
        .date-header { font-size: 0.8rem; padding: 15px 5px 5px 5px; }

        /* Menüs / Overlays auf Desktop */
        .menu-box {
            padding: 15px;
            max-width: 700px;
        }
    }