:root {
    --bg-app: #F2F2F7;
    --bg-card: #FFFFFF;
    --text-primary: #000000;
    --text-secondary: #8E8E93;
    --accent-blue: #007AFF;
    --accent-green: #34C759;
    --accent-red: #FF3B30;
    --border-radius: 22px;
    --side-padding: 24px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { font-family: var(--font-family); background: var(--bg-app); color: var(--text-primary); -webkit-font-smoothing: antialiased; }

.mobile-wrapper {
    padding: 40px var(--side-padding) 100px;
    display: flex; flex-direction: column; gap: 24px;
    min-height: 100vh;
}

/* Header */
.app-header { display: flex; flex-direction: column; gap: 5px; }
.nav-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.back-link { font-size: 17px; color: var(--accent-blue); text-decoration: none; font-weight: 500; }
.icon-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--accent-blue); }
.page-title { font-size: 32px; font-weight: 700; color: #000; line-height: 1.1; }

/* Cards */
.glass-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: transform 0.2s;
}

.card-header-row { display: flex; align-items: center; margin-bottom: 16px; }
.icon-title-wrap { display: flex; align-items: center; gap: 12px; }
.card-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 18px; border-radius: 8px; color: #fff; }
.gradient-green { background: linear-gradient(135deg, #34C759 0%, #30B0C7 100%); }
.card-title-text { font-size: 16px; font-weight: 600; }

/* Filter */
.filter-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; }
.filter-label { font-size: 16px; font-weight: 500; }
.filter-select { border: none; background: transparent; font-size: 16px; color: var(--accent-blue); font-weight: 500; outline: none; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.summary-item { background: #fff; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; }
.summary-val { font-size: 20px; font-weight: 700; }
.summary-lbl { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; margin-top: 4px; }

/* List */
.list { display: flex; flex-direction: column; gap: 16px; }
.entry { background: var(--bg-card); border-radius: var(--border-radius); overflow: hidden; }

.entry-head {
    width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px;
    background: transparent; border: none; text-align: left; cursor: pointer;
}
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #E5E5EA; }
.meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.date { font-size: 16px; font-weight: 600; }
.sub { font-size: 13px; color: var(--text-secondary); }
.chev { color: #C7C7CC; font-size: 12px; transition: transform 0.2s; }
.entry.open .chev { transform: rotate(180deg); }

.entry-body { display: none; padding: 0 16px 20px; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.entry.open .entry-body { display: block; }

/* Photos */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.tile { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: none; position: relative; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(0,0,0,0.5); color: #fff; border-radius: 50%; font-size: 14px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.tile-cloud { position: absolute; bottom: 4px; right: 4px; font-size: 12px; }

.actions { display: flex; gap: 10px; margin-top: 20px; }
.upload-btn { flex: 1; background: #fff; padding: 12px; border-radius: 12px; text-align: center; font-weight: 600; font-size: 14px; position: relative; color: var(--accent-blue); }
.file-input { position: absolute; inset: 0; opacity: 0; width: 100%; }
.danger-btn { flex: 1; background: rgba(255, 59, 48, 0.1); color: var(--accent-red); padding: 12px; border-radius: 12px; border: none; font-weight: 600; font-size: 14px; }

.empty-state { text-align: center; padding: 40px; color: var(--text-secondary); }

/* Fullscreen Viewer mit Zoom-Support */
/* Verbesserter Fullscreen Viewer */
.viewer { 
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.9); /* Dunkler Hintergrund für Fokus */
    z-index: 999; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(8px); 
    touch-action: none; /* Wichtig für flüssigen Zoom auf Mobile */
}

.viewer.open { display: flex; }

.viewer-inner { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative;
    overflow: hidden;
}

.viewer-img { 
    max-width: 95%; 
    max-height: 90vh; 
    object-fit: contain; 
    border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.05s linear;
    will-change: transform;
}

.viewer-img:active {
    cursor: grabbing;
}

.viewer-close { 
    position: absolute; 
    top: 40px; 
    right: 20px; 
    font-size: 32px; 
    background: none; 
    border: none; 
    cursor: pointer; 
    color: #fff; 
    z-index: 1000;
}