/* css/style.css — y-a App · Mobile First, Dark, Glassmorphism, Violett */

:root {
    color-scheme: dark;

    /* Farben */
    --bg: #0f0f12;
    --bg-2: #1a1a2e;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-2: rgba(255, 255, 255, 0.08);
    --surface-3: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --text-soft: #e2e8f0;
    --text-muted: #9aa5b8;
    --primary: #a855f7;
    --primary-strong: #7e22ce;
    --primary-soft: rgba(168, 85, 247, 0.16);
    --primary-glow: rgba(168, 85, 247, 0.40);
    --accent-text: #e9d5ff;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.16);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --gold: #fbbf24;

    /* Masse */
    --gutter: 16px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;
    --tap: 44px;                       /* minimale Touch-Fläche (Apple HIG) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --nav-h: 64px;
    --nav-gap: max(12px, var(--safe-bottom));
    --nav-space: calc(var(--nav-h) + var(--nav-gap) + 16px);   /* Platz unter dem Inhalt */
    --header-h: calc(var(--safe-top) + 68px);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    background-color: var(--bg);
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
    color: var(--text);
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;          /* kein Doppeltipp-Zoom, trotzdem Pinch-Zoom möglich */
    -webkit-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Texte in Eingaben & Inhalten bleiben markierbar (iOS braucht das zum Tippen) */
input, textarea, .memory-caption, .wish-text, .quiz-question { -webkit-user-select: text; user-select: text; }

[v-cloak], [hidden] { display: none !important; }

/* Stitch-Hintergrund, dezent */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: url('../assets/stitch.png') center / cover no-repeat;
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

/* position: fixed + inset: 0 füllt auf iOS (Standalone, viewport-fit=cover) zuverlässig den ganzen
   Bildschirm inkl. Statusleiste und Home-Indikator – height:100% lässt dort teils Streifen stehen. */
#app { position: fixed; inset: 0; z-index: 1; overflow: hidden; }

h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Hilfsklassen ---------- */
.muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }
.center { text-align: center; }
.d-block { display: block; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-text); }
.text-gold { color: var(--gold); }

/* ---------- Seiten-Layout ---------- */
.page {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding-bottom: var(--nav-space);
}
.sheet-open .page { overflow: hidden; }

/* Memory-Feed rastet Bild für Bild ein */
.page-snap {
    scroll-snap-type: y proximity;
    scroll-padding-top: var(--header-h);
}

.content {
    padding: var(--gutter);
    margin: 0 auto;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* Einblenden – ohne Blur-Sprung:
   - Nie den Container mit opacity animieren: Ein Eltern-Element mit opacity < 1 isoliert
     seine Kinder, der backdrop-filter der Karten greift dann erst nach der Animation.
   - WebKit (iPhone) rendert backdrop-filter auch nicht, solange das Element SELBST
     opacity < 1 hat. Glas-Karten bleiben deshalb voll deckend: Der Blur wächst weich
     von 0 auf den Endwert, der Glas-Hintergrund blendet mit, nur der Inhalt faded.
   - Alles ohne Glas (Listen, Titel, Buttons) blendet normal mit opacity ein. */
@keyframes glassIn {
    from {
        transform: translateY(12px);
        background-color: rgba(255, 255, 255, 0);
        border-color: rgba(255, 255, 255, 0);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0);
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
    }
}
@keyframes contentIn { from { opacity: 0; } }

.content > *,
.login-container > *,
.install-gate > * {
    animation: fadeInUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--enter-delay, 0s);
}
.content > .card,
.login-container > .card,
.install-gate > .card {
    animation-name: glassIn;
}
.content > .card > *,
.login-container > .card > *,
.install-gate > .card > * {
    animation: contentIn 0.45s ease-out both;
    animation-delay: var(--enter-delay, 0s);
}
.content > :nth-child(2), .login-container > :nth-child(2), .install-gate > :nth-child(2) { --enter-delay: 0.04s; }
.content > :nth-child(3), .login-container > :nth-child(3), .install-gate > :nth-child(3) { --enter-delay: 0.08s; }
.content > :nth-child(4), .login-container > :nth-child(4), .install-gate > :nth-child(4) { --enter-delay: 0.12s; }
.content > :nth-child(n+5) { --enter-delay: 0.16s; }

/* ---------- Sticky Header ---------- */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: var(--header-h);
    padding: calc(var(--safe-top) + 12px) var(--gutter) 12px;
    background: rgba(15, 15, 18, 0.82);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sticky-header h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.header-actions { display: flex; gap: 8px; }

.sticky-header-stacked { display: block; }
.sticky-header-stacked h1 { margin-bottom: 12px; }

/* ---------- Segmented Control (Games) ---------- */
.segmented {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.segmented button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 50px;
    padding: 6px 2px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}
.segmented button i { font-size: 1rem; }
.segmented button.active {
    background: var(--primary-soft);
    border-color: rgba(168, 85, 247, 0.55);
    color: var(--accent-text);
}

/* ---------- Karten ---------- */
.card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.card-compact { padding: 16px; }
.card > h2, .card-head h2 { font-size: 1.1rem; color: var(--accent-text); margin-bottom: 12px; }
.card > p.muted { font-size: 0.9rem; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h2 { margin-bottom: 12px; }

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 20px 4px 10px;
}
.section-title:first-child { margin-top: 4px; }

.eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.eyebrow-title {
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted) !important;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip:empty { display: none; }
.chip-accent  { background: var(--primary-soft); color: var(--accent-text); }
.chip-warning { background: var(--warning-soft); color: #fcd34d; }
.chip-danger  { background: var(--danger-soft); color: var(--danger); }

/* ---------- Formulare ---------- */
.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 2px 6px;
}

input, textarea {
    display: block;
    width: 100%;
    min-height: 50px;
    margin: 0 0 14px;
    padding: 13px 14px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 16px;                 /* < 16px → iOS zoomt beim Fokus rein */
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: #6b7385; }
input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.22);
}
/* iOS: Datumsfeld sonst schmal/linksbündig */
input[type="date"] { text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }

.form-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

/* ---------- Buttons ---------- */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    border: none;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.2s, background 0.2s;
}
button:active:not(:disabled), .btn:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
}
.btn-ghost-danger {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: var(--danger);
}
.btn-link {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    min-height: var(--tap);
    margin-top: 6px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.btn-inline { width: auto; padding-left: 22px; padding-right: 22px; }

.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* Runde Icon-Buttons */
.icon-btn {
    flex-shrink: 0;
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
    padding: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: 17px;
}
.icon-btn-sm { font-size: 14px; }
.icon-btn-primary { background: var(--primary-soft); color: var(--accent-text); border: 1px solid rgba(168, 85, 247, 0.45); }
.icon-btn-accent  { background: var(--primary-soft); color: var(--accent-text); }
.icon-btn-ghost   { background: transparent; color: var(--text-muted); }
.icon-btn-ghost-danger { background: transparent; color: var(--danger); }
.icon-btn.is-active { background: var(--primary-soft); color: var(--accent-text); }

/* ---------- Leer-/Ladezustände ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 56px 24px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state > i { font-size: 2.6rem; opacity: 0.45; }
.empty-state-inline { padding: 28px 8px; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.spinner-lg { width: 52px; height: 52px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.splash {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
}
.splash-logo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 40px var(--primary-glow); }

/* ---------- Login ---------- */
.login-container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: calc(var(--safe-top) + 24px) var(--gutter) calc(var(--safe-bottom) + 24px);
    overflow-y: auto;
}
.login-logo { width: 76px; height: 76px; border-radius: 20px; margin-bottom: 18px; box-shadow: 0 10px 40px var(--primary-glow); }
.login-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 24px;
    background: linear-gradient(to right, #e879f9, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-card { width: 100%; }

/* ---------- Nur als App ---------- */
.install-gate {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--safe-top) + 24px) var(--gutter) calc(var(--safe-bottom) + 24px);
    overflow-y: auto;
    text-align: center;
}
.install-gate .login-title { margin-bottom: 10px; }
.install-lead { color: var(--text-muted); max-width: 340px; margin-bottom: 24px; }
.install-card { width: 100%; text-align: left; }
.install-card > h2 { margin-bottom: 16px; }
.install-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.install-steps li { display: flex; align-items: center; gap: 12px; color: var(--text-soft); line-height: 1.4; }
.install-steps i { color: var(--primary); margin-left: 2px; }
.step-num {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--accent-text);
    font-weight: 800;
    font-size: 0.9rem;
}

/* ---------- MEMORY ---------- */
.memory-card {
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100dvh - var(--header-h) - var(--nav-space));
    min-height: 360px;
    margin: 0 auto;
    padding: 14px var(--gutter) 6px;
}
.memory-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}
.memory-author { color: var(--accent-text); font-weight: 600; }
.memory-image {
    flex: 1;
    min-height: 0;
    border-radius: 28px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.memory-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.memory-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.memory-caption {
    flex: 1;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.92);
    padding-top: 10px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Upload-Fläche */
.upload-drop {
    height: 200px;
    margin-bottom: 14px;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}
.upload-drop.has-image { border-style: solid; }
.upload-drop img { width: 100%; height: 100%; object-fit: contain; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 500; }
.upload-placeholder i { font-size: 1.8rem; }

/* ---------- REMINDERS ---------- */
.list-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 14px 16px;
    margin-bottom: 10px;
    background: var(--surface-2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}
.reminder-card { cursor: pointer; transition: background 0.2s, transform 0.15s; }
.reminder-card:active { transform: scale(0.985); background: var(--surface-3); }
.reminder-main { flex: 1; min-width: 0; }
.reminder-title { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.reminder-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.78rem; }

.counter-title { flex: 1; min-width: 0; font-weight: 700; font-size: 1.05rem; overflow-wrap: break-word; hyphens: auto; }
/* Schmale Handys (iPhone SE): Titel oben, Bedienung darunter */
@media (max-width: 374px) {
    .counter-card { flex-wrap: wrap; row-gap: 8px; }
    .counter-title { flex-basis: 100%; }
    .counter-card .stepper { margin-right: auto; }
}
.stepper { display: flex; align-items: center; gap: 6px; }
.step-btn {
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
    padding: 0;
    border-radius: 12px;
    background: var(--surface-3);
    font-size: 14px;
}
.step-btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); }
.counter-value {
    min-width: 40px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-text);
    font-variant-numeric: tabular-nums;
}

/* ---------- Listen (Quiz, Wünsche, Fakten) ---------- */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.list-row:last-child { border-bottom: none; padding-bottom: 0; }
.list-row-icon { flex-shrink: 0; width: 24px; text-align: center; }
.list-row-text { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text-soft); }
.list-row-text small { font-size: 0.82rem; }
.card > .btn-ghost { margin-bottom: 8px; }

/* ---------- QUIZ ---------- */
.lock-card { min-height: 280px; }
.quiz-question { font-size: 1.25rem; margin-bottom: 16px; overflow-wrap: anywhere; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.quiz-option {
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-align: left;
    font-weight: 500;
    font-size: 0.98rem;
    transition: background 0.2s, border-color 0.2s;
}
.quiz-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
}
.quiz-answer { overflow-wrap: anywhere; }
.quiz-option.selected { background: var(--primary-soft); border-color: var(--primary); }
.quiz-option.selected .quiz-letter { background: var(--primary); color: #fff; }

.result-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    animation: fadeInUp 0.3s ease-out;
}
.result-good { background: var(--success-soft); border: 1px solid rgba(34, 197, 94, 0.35); }
.result-bad  { background: var(--danger-soft);  border: 1px solid rgba(248, 113, 113, 0.35); }
.result-emoji { font-size: 1.8rem; }
.result-text { flex: 1; display: flex; flex-direction: column; font-size: 0.9rem; color: var(--text-soft); }

/* Sperr-Mechanik (Quiz & Wünsche) */
.locked-content {
    filter: blur(9px);
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}
.unlock-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.55);
}
.unlock-overlay p { color: var(--text-soft); font-weight: 600; }
.unlock-overlay button { width: min(100%, 280px); }
.timer-text {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 18px var(--primary-glow);
    font-variant-numeric: tabular-nums;
}

/* ---------- WÜNSCHE ---------- */
.wish-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.wish-text { font-size: 1.15rem; font-weight: 600; color: #fff; overflow-wrap: anywhere; padding-top: 8px; }

/* ---------- GRÜSSE ---------- */
.greet-card { text-align: center; }
.greet-card .eyebrow { text-align: left; }
.greet-card-new { border-color: rgba(168, 85, 247, 0.55); box-shadow: 0 0 30px rgba(168, 85, 247, 0.25); }
.greet-envelope { font-size: clamp(3rem, 16vw, 4.5rem); margin: 6px 0 4px; animation: floatEnvelope 2.4s ease-in-out infinite; }
@keyframes floatEnvelope { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.greet-lead { font-weight: 600; color: var(--text-soft); margin-bottom: 18px; }
.greet-body {
    margin: 4px 0 12px;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--primary-soft);
    border: 1px solid rgba(168, 85, 247, 0.35);
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}
.greet-waiting {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--warning-soft);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.greet-waiting > i { font-size: 1.4rem; color: var(--warning); margin-top: 2px; }
.greet-waiting p { font-size: 0.88rem; color: var(--text-muted); margin-top: 4px; }
.greet-quote { font-style: italic; color: var(--text-soft) !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.greet-send-row { display: flex; justify-content: flex-end; margin: -8px 2px 12px; }
.greet-seen { margin-top: 12px; text-align: center; }
.greet-seen i { color: var(--success); }
.notify-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.notify-row:last-of-type { border-bottom: none; }
.notify-row i { width: 20px; color: var(--text-muted); }
.notify-btn { margin-top: 10px; }
.notify-hint { margin-top: 10px; }
.chip-success { background: var(--success-soft); color: #4ade80; }
.greet-history { padding: 12px 0; border-bottom: 1px solid var(--border); }
.greet-history:last-child { border-bottom: none; padding-bottom: 0; }
.greet-history-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.greet-history-body { color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.greet-history.mine .greet-history-body { color: var(--accent-text); }

/* Punkt für "neuer Gruss" */
.badge-dot {
    position: absolute;
    top: -2px;
    right: -6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f43f5e;
    box-shadow: 0 0 0 2px #0f0f12;
}
.segmented button { position: relative; }
.segmented .badge-dot { top: 6px; right: calc(50% - 20px); }
.nav-icon-wrap { position: relative; display: inline-flex; }

/* ---------- MANAGE ---------- */
.fact-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

/* ---------- EINSTELLUNGEN ---------- */
.settings-card > h2 i { margin-right: 6px; color: var(--primary); }
.settings-sub { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 18px 2px 4px; }
.settings-foot { margin-top: 14px; }
.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 10px 2px;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-weight: 400;
}
.switch-row:last-of-type { border-bottom: none; }
.switch-row:active:not(:disabled) { transform: none; background: rgba(255, 255, 255, 0.03); }
.switch-row-main { padding: 12px 14px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.switch-row.dimmed { opacity: 0.55; }
.switch-icon { width: 22px; text-align: center; color: var(--primary); font-size: 1rem; }
.switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { font-size: 0.98rem; font-weight: 600; color: var(--text); }
.switch-text small { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }
.switch {
    flex-shrink: 0;
    position: relative;
    width: 51px;
    height: 31px;
    border-radius: 999px;
    background: rgba(120, 120, 128, 0.32);
    transition: background 0.25s ease;
}
.switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1.3);
}
.switch.on { background: var(--success); }
.switch.on .switch-knob { transform: translateX(20px); }

/* Herz-Popup */
.notif-prompt { text-align: center; gap: 10px; padding-top: 18px; }
.notif-prompt h2 { font-size: 1.35rem; margin-top: 4px; }
.notif-prompt p { margin: 2px 4px 12px; font-size: 0.93rem; line-height: 1.5; }
.heart-stage { position: relative; height: 130px; display: flex; align-items: center; justify-content: center; }
.heart-main { font-size: 72px; line-height: 1; animation: heartbeat 1.3s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(168, 85, 247, 0.55)); }
.heart-ring {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 2px solid rgba(168, 85, 247, 0.6);
    animation: heartRing 1.3s ease-out infinite;
}
.heart-float { position: absolute; bottom: 20px; font-size: 22px; opacity: 0; animation: heartFloat 3s ease-in infinite; }
.heart-float.h1 { left: calc(50% - 70px); animation-delay: 0.2s; }
.heart-float.h2 { left: calc(50% + 48px); animation-delay: 1.1s; }
.heart-float.h3 { left: calc(50% - 20px); animation-delay: 2s; font-size: 18px; }
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.18); }
    30% { transform: scale(0.96); }
    45% { transform: scale(1.12); }
    60% { transform: scale(1); }
}
@keyframes heartRing {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}
@keyframes heartFloat {
    0% { transform: translateY(0) scale(0.6) rotate(0); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-110px) scale(1.1) rotate(-15deg); opacity: 0; }
}

/* ---------- Profil ---------- */
.avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    font-size: 2rem;
    font-weight: 800;
    box-shadow: 0 8px 30px var(--primary-glow);
}
.admin-badge {
    display: inline-block;
    align-self: center;
    margin: 14px 0 4px;
    padding: 6px 14px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: var(--gold);
    font-size: 0.85rem;
}
.profile-card { text-align: center; padding: 32px 20px 28px; }
.profile-name { font-size: 1.5rem; color: var(--text) !important; margin-bottom: 6px !important; }
.profile-mail { color: var(--text-muted); overflow-wrap: anywhere; }
.profile-mail i { margin-right: 4px; }
.profile-card > .btn-ghost-danger { margin-top: 18px; }

/* ---------- BOTTOM NAV (schwebend) ---------- */
.bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: var(--nav-gap);
    z-index: 100;
    height: var(--nav-h);
    margin: 0 auto;
    padding: 6px;
    display: flex;
    gap: 2px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.nav-item {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--text-muted);
    font-size: clamp(0.6rem, 2.9vw, 0.68rem);
    font-weight: 600;
    transition: color 0.2s, background 0.2s;
}
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { font-size: 1.2rem; }
.nav-item.active { color: var(--accent-text); background: var(--primary-soft); }
.nav-item.active .nav-icon { color: var(--primary); }

/* ---------- SHEETS (Bottom Sheets statt Vollbild-Modals) ---------- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: calc(var(--safe-top) + 24px);
    background: rgba(5, 5, 8, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.sheet-backdrop-top { z-index: 300; }

.sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px var(--gutter) calc(var(--safe-bottom) + 20px);
    background: #17171f;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
/* Griff-Andeutung oben */
.sheet::before {
    content: "";
    align-self: center;
    flex-shrink: 0;
    width: 40px;
    height: 5px;
    margin-bottom: 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
}
.sheet > .btn-primary, .sheet > .btn-ghost, .sheet > .btn-ghost-danger, .sheet > .btn-danger { flex-shrink: 0; }
.sheet > * + .btn-ghost-danger, .sheet > * + .btn-ghost { margin-top: 10px; }
.sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.sheet-head h2 { font-size: 1.2rem; padding-top: 10px; }
.sheet-head-end { justify-content: flex-end; margin-bottom: 0; }
.sheet-confirm { gap: 10px; }
.sheet-confirm > * + .btn-ghost { margin-top: 0; }
.confirm-message { font-size: 1.1rem; font-weight: 600; text-align: center; padding: 10px 8px 14px; overflow-wrap: anywhere; }

/* Tablet / Desktop: Sheets werden zu zentrierten Dialogen */
@media (min-width: 640px) {
    .sheet-backdrop { align-items: center; padding: 24px; }
    .sheet { border-radius: 26px; border-bottom: 1px solid var(--border); padding-bottom: 22px; max-width: 460px; }
    .sheet::before { display: none; }
}

/* Sheet-Animation */
.sheet-enter-active, .sheet-leave-active {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}
.sheet-enter-active .sheet, .sheet-leave-active .sheet { transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease; }
.sheet-enter-from, .sheet-leave-to {
    background-color: rgba(5, 5, 8, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}
.sheet-enter-from .sheet, .sheet-leave-to .sheet { transform: translateY(100%); }
@media (min-width: 640px) {
    .sheet-enter-from .sheet, .sheet-leave-to .sheet { transform: translateY(24px) scale(0.98); opacity: 0; }
}

.overlay-enter-active, .overlay-leave-active {
    transition: background-color 0.25s ease, backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
}
.overlay-enter-active > *, .overlay-leave-active > * { transition: opacity 0.25s ease; }
.overlay-enter-from, .overlay-leave-to {
    background-color: rgba(10, 10, 14, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}
.overlay-enter-from > *, .overlay-leave-to > * { opacity: 0; }

/* KI-Lade-Overlay */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 10, 14, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.loader-overlay h2 { text-shadow: 0 0 12px var(--primary); }

/* ---------- TOASTS ---------- */
.toast-stack {
    position: fixed;
    top: calc(var(--safe-top) + 10px);
    left: 12px;
    right: 12px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 480px;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(30, 30, 40, 0.98);
    border: 1px solid var(--border-strong);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.92rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.toast i { color: var(--primary); }
.toast-success i { color: var(--success); }
.toast-error { border-color: rgba(248, 113, 113, 0.45); }
.toast-error i { color: var(--danger); }
.toast-enter-active, .toast-leave-active { transition: all 0.25s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateY(-12px); }

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ---------- Ab Tablet-Breite: Inhalte zentriert begrenzen ---------- */
@media (min-width: 700px) {
    .content, .memory-card { max-width: 640px; }
    .login-card, .install-card { max-width: 440px; }
    .bottom-nav { max-width: 560px; }
}
