:root {
    --primary: #00d2ff; --secondary: #3a7bd5;
    --bg: #0f0f12; --card-bg: #1c1c1e;
    --accent: #0A84FF; --text: #ffffff; --text-dim: #8e8e93;
    --glass: rgba(255, 255, 255, 0.05);
}

body {
    background: radial-gradient(circle at top right, #1a1a2e, #0f0f12);
    color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); box-sizing: border-box; width: 100%; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); margin: 0; background: linear-gradient(to right, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-dim); font-size: clamp(0.95rem, 4vw, 1.1rem); max-width: 500px; margin: 15px 0; line-height: 1.4; }

.features { display: flex; flex-direction: column; gap: 15px; padding: 30px 0; width: 100%; max-width: 500px; box-sizing: border-box; }
@media(min-width: 768px) { .features { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 1000px; } .f-card.full-width { grid-column: 1 / -1; } }

.f-card { background: var(--glass); padding: 20px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(15px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: transform 0.2s, background 0.2s; }
.f-card h3 { margin: 5px 0 10px; font-size: 1.2rem; }
.f-card p { font-size: 0.9rem; line-height: 1.4; color: #ccc; margin: 0; }
.f-card.clickable { cursor: pointer; border-color: rgba(0, 210, 255, 0.3); background: rgba(0, 210, 255, 0.03); }

.btn-start { margin-top: 10px; padding: 16px 20px; border-radius: 50px; background: linear-gradient(45deg, var(--primary), var(--secondary)); color: white; text-decoration: none; font-weight: bold; font-size: 1.1rem; border: none; cursor: pointer; width: 100%; max-width: 300px; display: block; text-align: center; box-sizing: border-box; }
.btn-start:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="number"] { width: 100%; padding: 14px; margin: 8px 0; background: #2c2c2e; border: 1px solid #444; border-radius: 12px; color: white; font-size: 16px; box-sizing: border-box; }

.login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); backdrop-filter: blur(20px); justify-content: center; align-items: center; z-index: 10000; padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom); box-sizing: border-box; }
.login-box { background: var(--card-bg); padding: 25px; border-radius: 25px; width: 100%; max-width: 360px; text-align: center; border: 1px solid #333; }

.app-view { width: 100%; max-width: 500px; box-sizing: border-box; margin: 0 auto; padding: max(40px, env(safe-area-inset-top)) 20px max(40px, env(safe-area-inset-bottom)); }

.doc-item, .pw-item { background: var(--card-bg); border-radius: 16px; padding: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: flex-start; border: 1px solid #333; gap: 10px; color: white; width: 100%; box-sizing: border-box; }
.doc-item span { white-space: normal; word-break: break-word; flex-grow: 1; padding: 5px 0; cursor: pointer; font-size: 1.05rem; font-weight: 500;}
.btn-del { background: #ff453a; border: none; color: white; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; font-weight: bold; flex-shrink: 0; }

#viewer, #edit-layer, #info-layer, #add-pw-layer { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99999; flex-direction: column; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.nav-back { padding: 15px 20px; color: var(--accent); font-size: 1.1rem; cursor: pointer; font-weight: bold; text-align: left; flex-shrink: 0; background: rgba(0,0,0,0.5); z-index: 2; }

.card-wrapper { flex-grow: 1; display: flex; justify-content: center; align-items: center; perspective: 1200px; padding: 10px; overflow: visible; }
.card-inner { width: 95vw; height: 75vh; max-height: 800px; position: relative; transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d; margin: 0 auto; }
.flipped { transform: rotateY(180deg); }
.side { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 12px; object-fit: contain; }
.side-back { transform: rotateY(180deg); }
.flip-hint { text-align: center; color: #555; text-transform: uppercase; font-size: 11px; letter-spacing: 2px; padding-bottom: 20px; flex-shrink: 0; }

.tabs { display: flex; background: rgba(255,255,255,0.05); border-radius: 15px; margin-bottom: 25px; padding: 5px; }
.tab-btn { flex: 1; text-align: center; padding: 12px 0; border-radius: 12px; color: var(--text-dim); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: background 0.3s, color 0.3s; }
.tab-btn.active { background: #2c2c2e; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.pw-details { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }

/* GEÄNDERT: Kein Abschneiden mehr (white-space: normal) */
.pw-title { font-weight: bold; font-size: 1rem; margin-bottom: 4px; white-space: normal; word-break: break-word; line-height: 1.3; }
.pw-sub { font-size: 0.8rem; color: var(--text-dim); white-space: normal; word-break: break-word; line-height: 1.2; }

.btn-copy { background: #333; border: none; color: var(--primary); padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; font-weight: bold; margin-right: 5px; }

.gen-box { background: rgba(0, 210, 255, 0.05); border: 1px solid rgba(0, 210, 255, 0.2); padding: 15px; border-radius: 12px; margin-bottom: 15px; }
.gen-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
