/* ═══════════════════════════════════════════════════════════════
   VIGALITY — Minimal Strength Log
   Design: Cream/Anthrazit, Dark-Only, Serif-Headlines
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ─── FARBEN ─── */
    --bg: #1a1815;
    --bg-alt: #211e1a;
    --bg-deep: #14120f;
    --surface: #24211d;
    --surface-2: #2b2823;
    --surface-3: #322e28;
    --surface-hover: #383430;

    --border: #38332d;
    --border-strong: #4a443b;
    --border-soft: #2e2a25;
    --border-dashed: #4a443b;

    /* Text-Farben Cream-Ton */
    --ink: #e8dcc4;           /* Haupt-Text/Headlines */
    --ink-2: #f0e6d0;         /* Hervorgehoben */
    --text: #d4c8b0;          /* Body */
    --text-sec: #a8a094;      /* Sekundär */
    --text-mute: #6b6558;     /* Placeholder / Muted */
    --text-faint: #4a4438;    /* Sehr dezent */

    /* Akzente */
    --accent: #d4c088;        /* Cream-Gold Akzent */
    --accent-soft: rgba(212, 192, 136, 0.15);
    --accent-warm: #c9a878;   /* Warmer Kupfer-Ton */

    /* Zustände */
    --danger: #d97756;
    --danger-soft: rgba(217, 119, 86, 0.12);
    --success: #a8b878;
    --success-soft: rgba(168, 184, 120, 0.12);
    --warning: #d4a068;

    /* Icon-Farben (Bulletproof) */
    --icon-on-dark: #e8dcc4;
    --icon-on-light: #1a1815;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
    --shadow-lg: 0 18px 42px rgba(0,0,0,0.45);
    --shadow-fab: 0 12px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(212, 192, 136, 0.08);

    /* Radien */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-2xl: 28px;

    /* Fonts */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', 'Fraunces', Georgia, serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;

    /* Layout */
    --header-h: 76px;
    --footer-h: 72px;

    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    /* Sanfter Gradient-Hintergrund für Cream-Feeling */
    background:
        radial-gradient(ellipse at top left, rgba(212, 192, 136, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(201, 168, 120, 0.03) 0%, transparent 50%),
        var(--bg);
    background-attachment: fixed;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 10px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.screen { display: none; height: 100vh; width: 100vw; }
.screen.active { display: flex; flex-direction: column; }

/* Utility */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════════════ */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    position: relative;
    background:
        radial-gradient(circle at 25% 20%, rgba(212, 192, 136, 0.06), transparent 45%),
        radial-gradient(circle at 75% 80%, rgba(201, 168, 120, 0.05), transparent 45%);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.brand-icon-box {
    width: 44px;
    height: 44px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.brand-icon-box.sm { width: 38px; height: 38px; border-radius: 10px; }
.brand-icon-box.lg { width: 52px; height: 52px; border-radius: 14px; }

.brand-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.brand-tag {
    font-size: 13px;
    color: var(--text-sec);
    margin-top: 3px;
    letter-spacing: -0.005em;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 18px;
    animation: fade 0.4s ease;
}
.auth-form.active { display: flex; }

@keyframes fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.badge-pill {
    display: inline-block;
    padding: 5px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    letter-spacing: -0.01em;
    align-self: flex-start;
}

.badge-pill.sm { padding: 3px 10px; font-size: 11px; }
.badge-pill.center-badge { align-self: center; }

.auth-title {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.6;
    margin-top: -6px;
    margin-bottom: 4px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

@media (min-width: 601px) {
    .field input,
    .field select,
    .field textarea { font-size: 14px; }
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-mute);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(212, 192, 136, 0.08);
}

.field textarea { resize: vertical; min-height: 60px; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.01em;
    min-height: 46px;
}

.btn-dark:hover {
    background: var(--ink-2);
    border-color: var(--ink-2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 220, 196, 0.15);
}
.btn-dark:active { transform: translateY(0); }
.btn-dark:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-dark.full { width: 100%; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    min-height: 42px;
}

.btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--ink);
    color: var(--ink-2);
}

.btn-outline.full { width: 100%; }

.btn-add-square {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-add-square:hover {
    background: var(--ink-2);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 220, 196, 0.15);
}

.btn-add-square.sm { width: 36px; height: 36px; border-radius: 9px; }
.btn-add-square.lg { width: 54px; height: 54px; border-radius: 14px; }

.btn-icon-plain {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-sec);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-icon-plain:hover {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--border-strong);
}

.btn-icon-xs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(232, 220, 196, 0.1);
    color: var(--ink);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-xs:hover { background: rgba(232, 220, 196, 0.2); }

.switch-line {
    text-align: center;
    color: var(--text-sec);
    font-size: 13px;
    margin-top: 6px;
}

.switch-line a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 1px;
    transition: var(--transition);
}
.switch-line a:hover { border-color: var(--ink); color: var(--ink-2); }

/* ─── Code Input ────────────────────────────────────────────── */
.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}

.code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: var(--mono);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--ink);
    outline: none;
    transition: var(--transition);
}

.code-input:focus {
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(212, 192, 136, 0.08);
}

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    padding: 13px 24px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }

.toast.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(168, 184, 120, 0.3);
}
.toast.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(217, 119, 86, 0.3);
}
.toast.info {
    background: var(--surface-2);
    color: var(--ink);
    border-color: var(--border-strong);
}

.app-toast { z-index: 10001; }

/* ═══════════════════════════════════════════════════════════════
   APP HEADER
   ═══════════════════════════════════════════════════════════════ */
.app-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.app-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-brand .brand-name {
    font-size: 20px;
    font-family: var(--font-serif);
    font-weight: 400;
}
.header-brand .brand-tag { font-size: 12.5px; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-btn {
    padding: 9px 16px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: var(--text-sec);
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.01em;
    min-height: 40px;
}

.nav-btn:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.nav-btn.active {
    background: var(--ink);
    color: var(--bg);
}

/* Text-Link-Nav (wie "Übungen entdecken") */
.nav-textlink {
    padding: 9px 12px;
    background: transparent;
    border: none;
    color: var(--text-sec);
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.01em;
    min-height: 40px;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
}

.nav-textlink:hover {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.nav-textlink.active {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

/* Upgrade-Button — Outline mit gefülltem Inner */
.nav-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--ink);
    color: var(--bg);
    border: 1.5px solid var(--ink);
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.nav-upgrade svg {
    color: var(--bg);
    stroke: var(--bg);
    fill: none;
}

.nav-upgrade::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(26, 24, 21, 0.15) 50%, transparent 100%);
    transform: translateX(-130%);
    transition: transform 0.6s ease;
}
.nav-upgrade:hover::before { transform: translateX(130%); }

.nav-upgrade:hover {
    background: var(--ink-2);
    border-color: var(--ink-2);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 220, 196, 0.18);
}

.nav-upgrade.is-pro {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}
.nav-upgrade.is-pro svg { color: var(--success); stroke: var(--success); }

/* ─── User Menu ─── */
.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    position: relative;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-sec);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu-btn:hover { background: var(--surface-2); color: var(--ink); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 240px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: var(--transition);
    z-index: 100;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-email {
    padding: 10px 12px 12px;
    font-size: 12px;
    color: var(--text-mute);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    word-break: break-all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    min-height: 40px;
    text-decoration: none;
}

.dropdown-item:hover { background: var(--surface-3); color: var(--ink); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-soft); }

/* ═══════════════════════════════════════════════════════════════
   MAIN + VIEWS
   ═══════════════════════════════════════════════════════════════ */
#main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.view {
    display: none;
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 32px 80px;
    animation: viewIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.view.active { display: block; }

@keyframes viewIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 56px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.02;
}

.hero-sub {
    font-size: 16px;
    color: var(--text-sec);
    max-width: 640px;
    line-height: 1.6;
}

/* ─── Panel Cards ─── */
.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 22px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.panel-card:hover {
    border-color: var(--border-strong);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
}

/* ─── Stats Row ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-alt);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
    transition: var(--transition);
    min-width: 0;
}

.stat-item:hover {
    background: var(--surface-2);
    border-left-color: var(--ink);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.stat-icon-box {
    width: 42px;
    height: 42px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
}

.stat-label {
    font-size: 11.5px;
    color: var(--text-sec);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value em {
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sec);
    margin-left: 3px;
    font-family: var(--font);
}

/* ─── Search + Add Row ─── */
.quick-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 16px;
    transition: var(--transition);
    min-height: 46px;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(212, 192, 136, 0.06);
}

.search-input-wrapper svg { color: var(--text-mute); flex-shrink: 0; }

.search-input-wrapper input {
    flex: 1;
    padding: 12px 0;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    letter-spacing: -0.01em;
    min-width: 0;
}

@media (min-width: 601px) {
    .search-input-wrapper input { font-size: 14px; }
}

.search-input-wrapper input::placeholder { color: var(--text-mute); }

.add-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
    min-width: 0;
}

@media (min-width: 601px) {
    .add-input-wrapper input { font-size: 14px; }
}

.add-input-wrapper input:focus {
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 3px rgba(212, 192, 136, 0.06);
}

.add-input-wrapper input::placeholder { color: var(--text-mute); }

/* ═══════════════════════════════════════════════════════════════
   MUSKELGRUPPEN — ACCORDION / KATEGORIEN
   ═══════════════════════════════════════════════════════════════ */

.muscle-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.muscle-category {
    background: var(--bg-alt);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    animation: cardIn 0.3s ease;
}

.muscle-category:hover {
    border-color: var(--border);
}

.muscle-category.open {
    background: var(--surface-2);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.muscle-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.muscle-category-head:hover {
    background: var(--surface-2);
}

.muscle-category.open .muscle-category-head {
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
}

.muscle-cat-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.muscle-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(212, 192, 136, 0.4);
}

.muscle-cat-name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.muscle-cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    background: var(--bg-deep);
    color: var(--text-sec);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
}

.muscle-cat-chev {
    color: var(--text-mute);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.muscle-category.open .muscle-cat-chev {
    transform: rotate(180deg);
    color: var(--ink);
}

.muscle-category-body {
    display: none;
    padding: 12px;
    gap: 8px;
    flex-direction: column;
}

.muscle-category.open .muscle-category-body {
    display: flex;
    animation: catBodyIn 0.28s ease;
}

@keyframes catBodyIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── EXERCISE ROW (kompakt, im Accordion) ─── */
.ex-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.ex-row:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.ex-row.open {
    background: var(--surface-2);
    border-color: var(--border-strong);
}

.ex-row-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
    min-width: 0;
    word-break: break-word;
}

.ex-row-chev {
    color: var(--text-mute);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ex-row.open .ex-row-chev {
    transform: rotate(180deg);
    color: var(--ink);
}

.ex-row-details {
    display: none;
    padding: 14px 16px 4px;
    animation: catBodyIn 0.25s ease;
    flex-direction: column;
    gap: 10px;
}

.ex-row.open + .ex-row-details {
    display: flex;
}

/* Alt-Migration Meldung (rot, klickbar) */
.migration-warn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(217, 119, 86, 0.3);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 6px;
}

.migration-warn:hover {
    background: rgba(217, 119, 86, 0.2);
    border-color: var(--danger);
}

.migration-warn svg { flex-shrink: 0; }

/* Muskel-Tag (klein, in Details) */
.muscle-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    background: var(--surface-3);
    color: var(--text-sec);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.005em;
}

.exercise-btns {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.exercise-btns .btn-dark.sm,
.exercise-btns .btn-outline.sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 8px;
    min-height: 36px;
    flex: 1;
    min-width: 130px;
}

.exercise-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.exercise-actions button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.exercise-actions button:hover { background: var(--surface-3); color: var(--ink); }
.exercise-actions .delete-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* ─── Empty Box ─── */
.empty-box {
    grid-column: 1 / -1;
    border: 1.5px dashed var(--border-dashed);
    border-radius: var(--radius-lg);
    padding: 52px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    background: transparent;
}

.empty-plus {
    width: 48px;
    height: 48px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sec);
    margin-bottom: 6px;
    box-shadow: var(--shadow-xs);
}

.empty-box h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.empty-box p {
    font-size: 13.5px;
    color: var(--text-mute);
    max-width: 400px;
    line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   SETS / LOGS / HISTORY
   ═══════════════════════════════════════════════════════════════ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 14px;
    margin-bottom: 16px;
}

.sets-block {
    margin-top: 20px;
    margin-bottom: 20px;
}

.sets-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sets-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#sets-container,
#edit-sets-container,
#ll-sets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    animation: cardIn 0.2s ease;
}

.set-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--mono);
    flex-shrink: 0;
}

.set-row input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

@media (min-width: 601px) {
    .set-row input { font-size: 13px; }
}

.set-row input:focus {
    border-color: var(--accent);
    background: var(--surface-3);
}

.set-row input[type="number"] { max-width: 110px; }
.set-row input.notes-inp { flex: 2; max-width: none; }

.set-row-remove {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border: none;
    border-radius: 7px;
    background: var(--danger-soft);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.set-row-remove:hover { background: rgba(217, 119, 86, 0.25); }

/* ─── History ─── */
.history-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.history-day {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: cardIn 0.3s ease;
}

.history-day-head {
    padding: 12px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-day-head h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.history-day-head .day-count {
    font-size: 11px;
    color: var(--text-mute);
    font-weight: 500;
    font-family: var(--mono);
}

.history-entry {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    transition: var(--transition);
}

.history-entry:last-child { border-bottom: none; }
.history-entry:hover { background: var(--surface-2); }

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-head h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
    flex-wrap: wrap;
}

.entry-actions { display: flex; gap: 4px; }

.entry-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.entry-actions button:hover { background: var(--surface-3); color: var(--ink); }

.sets-table {
    width: 100%;
    font-size: 13px;
    color: var(--text-sec);
    border-collapse: collapse;
}

.sets-table td { padding: 4px 0; }
.sets-table td:first-child {
    width: 80px;
    font-family: var(--mono);
    font-weight: 600;
    color: var(--ink);
    font-size: 12px;
}

.entry-notes {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-mute);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Charts ─── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

.chart-wrap {
    position: relative;
    height: 260px;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.app-footer {
    height: var(--footer-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 16px;
    position: relative;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.footer-name {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.footer-tag {
    font-size: 11px;
    color: var(--text-sec);
    line-height: 1.3;
}

.footer-email {
    font-size: 11px;
    color: var(--text-mute);
    line-height: 1.3;
    word-break: break-all;
    font-family: var(--mono);
}

.footer-right { display: flex; align-items: center; gap: 20px; }

.footer-link {
    color: var(--text-sec);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.footer-link:hover { color: var(--ink); }

.footer-right .footer-link + .footer-link {
    position: relative;
    padding-left: 20px;
}

.footer-right .footer-link + .footer-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    background: var(--border-strong);
    border-radius: 50%;
}

/* Connection Toast */
.conn-toast {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    opacity: 1;
    transition: var(--transition);
    max-width: calc(100vw - 40px);
    z-index: 10;
}

.conn-toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 8px));
}

.conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 8px rgba(217, 119, 86, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.conn-dot.green {
    background: var(--success);
    box-shadow: 0 0 8px rgba(168, 184, 120, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Footer Socials */
.footer-socials {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-sec);
    text-decoration: none;
    transition: var(--transition);
    background: var(--surface);
}

.social-btn:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 220, 196, 0.15);
}

.social-btn svg {
    display: block;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING CHAT
   ═══════════════════════════════════════════════════════════════ */
.chat-fab {
    position: fixed;
    bottom: calc(var(--footer-h) + 20px);
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--ink);
    color: var(--bg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-fab);
    transition: var(--transition);
    z-index: 90;
}

.chat-fab:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--ink-2);
    box-shadow: 0 14px 34px rgba(232, 220, 196, 0.2);
}

.chat-modal {
    position: fixed;
    bottom: calc(var(--footer-h) + 20px);
    right: 24px;
    width: 440px;
    max-width: calc(100vw - 48px);
    height: 640px;
    max-height: calc(100vh - var(--footer-h) - var(--header-h) - 40px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    background: var(--surface);
}

.chat-modal-header h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.chat-head-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-usage-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-sec);
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--mono);
    letter-spacing: -0.01em;
}
.chat-usage-badge.pro {
    background: var(--success-soft);
    border-color: rgba(168, 184, 120, 0.3);
    color: var(--success);
}
.chat-usage-badge.hidden { display: none; }

.chat-modal-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chat-modal-actions select {
    padding: 7px 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    outline: none;
    cursor: pointer;
}

.chat-modal-actions select:focus { border-color: var(--accent); }

.chat-modal-actions select option {
    background: var(--surface-2);
    color: var(--text);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}

.chat-welcome {
    text-align: center;
    padding: 34px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.chat-welcome h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    margin-top: 8px;
    letter-spacing: -0.02em;
}

.chat-welcome p {
    font-size: 13px;
    color: var(--text-mute);
    max-width: 320px;
    line-height: 1.6;
}

.bubble {
    max-width: 82%;
    padding: 11px 15px;
    font-size: 13.5px;
    line-height: 1.55;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: bubbleIn 0.25s ease;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bubble.user {
    align-self: flex-end;
    background: var(--ink);
    color: var(--bg);
    border-bottom-right-radius: 4px;
}

.bubble.ai {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.bubble.ai pre {
    background: var(--bg-deep);
    color: var(--ink);
    padding: 12px 14px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: var(--mono);
    font-size: 12px;
    border: 1px solid var(--border);
}

.bubble.ai code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg-deep);
    color: var(--ink);
    padding: 1px 5px;
    border-radius: 4px;
}

.bubble.ai pre code { background: none; padding: 0; }

.bubble.ai table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

.typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-mute);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.image-preview-bar { padding: 8px 18px; }
.image-preview-bar.hidden { display: none; }

.image-preview-content {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.image-preview-content img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.btn-icon-plain.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn-icon-plain.recording {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(217, 119, 86, 0.4);
    animation: recPulse 1.5s ease-in-out infinite;
}

@keyframes recPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 86, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(217, 119, 86, 0); }
}

#chat-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
}

@media (min-width: 601px) {
    #chat-input { font-size: 13.5px; }
}

#chat-input:focus {
    border-color: var(--accent);
    background: var(--surface-2);
}

.btn-send-dark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--ink);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-send-dark:hover { background: var(--ink-2); transform: scale(1.05); }

/* Chat Offline Lock */
.chat-offline-lock {
    position: absolute;
    inset: 0;
    background: rgba(26, 24, 21, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: inherit;
    animation: fade 0.3s ease;
}

.chat-lock-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.chat-lock-close:hover {
    background: var(--surface-3);
    transform: rotate(90deg);
}

.chat-lock-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 320px;
}

.chat-lock-icon {
    width: 72px;
    height: 72px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    margin-bottom: 4px;
}

.chat-lock-inner h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.chat-lock-inner p {
    font-size: 13px;
    color: var(--text-sec);
    line-height: 1.6;
}

.chat-lock-back {
    margin-top: 12px;
    padding: 10px 18px;
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    animation: fade 0.2s ease;
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}

.modal.wide { max-width: 780px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 5;
}

.modal-header h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.modal-body { padding: 22px 24px 24px; }
.modal-body .field { margin-bottom: 14px; }
.modal-body .btn-dark { width: 100%; margin-top: 6px; }

/* Select im Modal */
.modal-body select {
    padding: 13px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: var(--transition);
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a094' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.modal-body select:focus {
    border-color: var(--accent);
    background-color: var(--surface-2);
}

.modal-body select option {
    background: var(--surface-2);
    color: var(--text);
}

.multi-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 8px;
    animation: cardIn 0.2s ease;
}

.multi-row input {
    padding: 10px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.multi-row input:focus { border-color: var(--accent); }

.add-row-btn {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1.5px dashed var(--border-dashed);
    border-radius: var(--radius-sm);
    color: var(--text-sec);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin: 6px 0 12px;
    font-family: var(--font);
}

.add-row-btn:hover {
    border-color: var(--ink);
    color: var(--ink);
    background: var(--surface-2);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 24, 21, 0.25);
    border-top-color: var(--bg);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Brand Logo */
.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.brand-logo-img.sm { width: 38px; height: 38px; border-radius: 10px; }
.brand-logo-img.xs { width: 34px; height: 34px; border-radius: 9px; }

/* Sync Badge */
.sync-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(212, 160, 104, 0.15);
    color: var(--warning);
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: syncSpin 2s linear infinite;
}

@keyframes syncSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   OFFLINE BANNER
   ═══════════════════════════════════════════════════════════════ */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface-2);
    color: var(--ink);
    padding: 10px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.offline-banner.hidden { display: none; }

.offline-banner.offline {
    background: var(--danger-soft);
    color: var(--danger);
    border-bottom-color: rgba(217, 119, 86, 0.3);
}

.offline-banner.syncing {
    background: rgba(212, 160, 104, 0.15);
    color: var(--warning);
    border-bottom-color: rgba(212, 160, 104, 0.3);
}

.offline-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

.offline-icon { display: inline-flex; align-items: center; }
.offline-text { letter-spacing: -0.01em; }

.offline-sync {
    font-size: 11px;
    padding: 3px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    font-weight: 500;
    font-family: var(--mono);
}
.offline-sync:empty { display: none; }

.offline-sync-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: currentColor;
    cursor: pointer;
    transition: var(--transition);
}

.offline-sync-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(180deg);
}

.offline-sync-btn.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   AMBIENT BACKGROUND
   ═══════════════════════════════════════════════════════════════ */
.auth-wrapper,
#view-dashboard {
    position: relative;
    overflow: hidden;
}

.auth-wrapper > .ambient-scene,
#view-dashboard > .ambient-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-card,
#view-dashboard > *:not(.ambient-scene) {
    position: relative;
    z-index: 1;
}

.ambient-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(212, 192, 136, 0.08) 1px, transparent 1.6px);
    background-size: 32px 32px;
    opacity: 0.4;
}

.ambient-watermark { display: none !important; }

.ambient-dumbbell {
    position: absolute;
    right: 7%;
    top: 14%;
    width: 260px;
    height: 120px;
    opacity: 0.55;
    animation: dumbbellFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 20px 24px rgba(0,0,0,0.4));
}
.dashboard-float { top: 12%; right: 4%; }

.ambient-dumbbell .handle {
    position: absolute;
    left: 58px;
    right: 58px;
    top: 49px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #d4c088 0%, #a8956b 48%, #6b5c40 100%);
    transform: skewX(-18deg);
    box-shadow: inset 0 2px 2px rgba(255,255,255,0.15), inset 0 -2px 4px rgba(0,0,0,0.3);
}

.ambient-dumbbell .plate {
    position: absolute;
    top: 28px;
    border-radius: 12px;
    background: linear-gradient(145deg, #38332d 0%, #4a443b 50%, #6b6558 100%);
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.08), inset 0 -6px 10px rgba(0,0,0,0.4);
}

.plate-a { left: 14px; width: 18px; height: 48px; top: 34px; }
.plate-b { left: 32px; width: 24px; height: 56px; top: 30px; }
.plate-c { left: 56px; width: 18px; height: 64px; top: 26px; }
.plate-d { right: 56px; width: 18px; height: 64px; top: 26px; }
.plate-e { right: 32px; width: 24px; height: 56px; top: 30px; }
.plate-f { right: 14px; width: 18px; height: 48px; top: 34px; }

.ambient-dumbbell .shadow {
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: -4px;
    height: 20px;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
    filter: blur(2px);
}

@keyframes dumbbellFloat {
    0%, 100% { transform: translateY(0px) rotate(-8deg); }
    50% { transform: translateY(14px) rotate(-6deg); }
}

/* ═══════════════════════════════════════════════════════════════
   COMMUNITY / ÜBUNGEN ENTDECKEN — BODYVIEW
   ═══════════════════════════════════════════════════════════════ */
.discover-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 24px;
    margin-top: 8px;
}

.body-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
    align-self: start;
}

.body-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.body-panel-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.body-view-toggle {
    display: flex;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.body-view-toggle button {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--text-sec);
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.body-view-toggle button.active {
    background: var(--ink);
    color: var(--bg);
}

.body-svg-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 460px;
}

.body-svg {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
}

.body-svg .muscle-region {
    fill: var(--surface-3);
    stroke: var(--border-strong);
    stroke-width: 0.6;
    cursor: pointer;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.body-svg .muscle-region:hover {
    fill: var(--accent-warm);
    stroke: var(--accent);
}

.body-svg .muscle-region.active {
    fill: var(--accent);
    stroke: var(--ink);
    filter: drop-shadow(0 0 8px rgba(212, 192, 136, 0.4));
}

/* Sub-Regionen (Farbabstufungen) */
.body-svg .muscle-region.sub-light  { fill: var(--surface-3); }
.body-svg .muscle-region.sub-mid    { fill: #453f37; }
.body-svg .muscle-region.sub-dark   { fill: #524a40; }

.body-svg .muscle-region.sub-light:hover,
.body-svg .muscle-region.sub-mid:hover,
.body-svg .muscle-region.sub-dark:hover { fill: var(--accent-warm); }

.body-svg .body-outline {
    fill: none;
    stroke: var(--border-strong);
    stroke-width: 1.2;
    pointer-events: none;
}

.body-selected-label {
    text-align: center;
    padding: 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-sec);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.body-selected-label strong {
    color: var(--ink);
    font-weight: 600;
}

/* ─── Community Exercise-Panel (rechts) ─── */
.community-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 500px;
}

.community-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.category-toggle {
    display: flex;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.category-toggle button {
    padding: 8px 18px;
    background: transparent;
    border: none;
    color: var(--text-sec);
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-toggle button.active {
    background: var(--ink);
    color: var(--bg);
}

.category-toggle button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.category-toggle button.disabled::after {
    content: "Im Aufbau";
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    background: var(--surface-3);
    color: var(--text-sec);
    font-size: 9px;
    border-radius: 999px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.community-add-btn {
    padding: 10px 18px;
    background: var(--ink);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-family: var(--font);
}

.community-add-btn:hover {
    background: var(--ink-2);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(232, 220, 196, 0.15);
}

.community-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.community-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
    animation: cardIn 0.3s ease;
    cursor: pointer;
}

.community-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.community-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.community-card-head h4 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.community-card-mgs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.community-card-mgs .muscle-tag { font-size: 10.5px; padding: 2px 8px; }

.community-card-desc {
    font-size: 12.5px;
    color: var(--text-sec);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-mute);
    padding-top: 8px;
    border-top: 1px solid var(--border-soft);
}

.community-card-video-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
}

.community-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-mute);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.community-empty svg { color: var(--text-faint); }

.community-empty h4 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-sec);
    letter-spacing: -0.02em;
}

.community-empty p {
    font-size: 13px;
    max-width: 380px;
    line-height: 1.55;
}

/* Community Detail Modal */
.community-detail-video {
    width: 100%;
    max-height: 400px;
    background: var(--bg-deep);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    display: block;
}

.community-detail-mgs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.community-detail-desc {
    background: var(--bg-alt);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
}

.community-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-mute);
    font-family: var(--mono);
}

/* Multi-Select Muskelgruppen (Chips) */
.mg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 60px;
}

.mg-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--surface-3);
    color: var(--text-sec);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.mg-chip:hover {
    background: var(--surface-hover);
    color: var(--ink);
    border-color: var(--border-strong);
}

.mg-chip.selected {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* Video Drop-Zone */
.video-drop-zone {
    padding: 24px;
    border: 1.5px dashed var(--border-dashed);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-mute);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-alt);
}

.video-drop-zone:hover {
    border-color: var(--accent);
    color: var(--ink);
    background: var(--surface-2);
}

.video-drop-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    color: var(--success);
    background: var(--success-soft);
}

.video-drop-zone h4 {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 4px;
    color: var(--ink);
}

.video-drop-zone p {
    font-size: 12px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL — REDESIGN
   ═══════════════════════════════════════════════════════════════ */
.admin-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 4px;
}

.admin-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-sec);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.admin-tab:hover { color: var(--ink); }

.admin-tab.active {
    background: var(--ink);
    color: var(--bg);
}

.admin-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 7px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
}

.admin-tab.active .admin-tab-badge {
    background: var(--bg);
    color: var(--ink);
}

/* Stats-Cards oben */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}

.admin-stat {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.admin-stat-label {
    font-size: 10.5px;
    color: var(--text-sec);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.admin-stat-value {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* User-Cards */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 540px;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-user-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    transition: var(--transition);
}

.admin-user-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-user-email {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
    letter-spacing: -0.01em;
}

.admin-user-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 11px;
    color: var(--text-mute);
}

.admin-role-badge,
.admin-sub-badge {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.admin-role-badge.owner { background: rgba(212, 192, 136, 0.15); color: var(--accent); border: 1px solid rgba(212, 192, 136, 0.3); }
.admin-role-badge.admin { background: rgba(217, 119, 86, 0.15); color: var(--warning); border: 1px solid rgba(217, 119, 86, 0.3); }
.admin-role-badge.user  { background: var(--surface-3); color: var(--text-sec); border: 1px solid var(--border); }

.admin-sub-badge.pro  { background: var(--success-soft); color: var(--success); border: 1px solid rgba(168, 184, 120, 0.3); }
.admin-sub-badge.free { background: var(--surface-3); color: var(--text-sec); border: 1px solid var(--border); }

.admin-user-stats {
    display: flex;
    gap: 10px;
    font-family: var(--mono);
    color: var(--text-mute);
}

.admin-user-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.admin-user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.admin-user-actions select {
    padding: 6px 8px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 11.5px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
}

.admin-user-actions select:focus { border-color: var(--accent); }

.admin-user-actions .icon-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-sec);
    cursor: pointer;
    transition: var(--transition);
}

.admin-user-actions .icon-action:hover {
    background: var(--surface-3);
    color: var(--ink);
    border-color: var(--border-strong);
}

.admin-user-actions .icon-action.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(217, 119, 86, 0.3);
}

/* Community Moderation Cards */
.admin-mod-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-mod-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-mod-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.admin-mod-author {
    font-size: 11px;
    color: var(--text-mute);
    font-family: var(--mono);
    margin-top: 3px;
}

.admin-mod-desc {
    font-size: 13px;
    color: var(--text-sec);
    line-height: 1.55;
    max-height: 120px;
    overflow-y: auto;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    white-space: pre-wrap;
}

.admin-mod-video {
    width: 100%;
    max-height: 300px;
    background: var(--bg-deep);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-mod-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.admin-mod-actions .btn-approve {
    padding: 9px 18px;
    background: var(--success);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.admin-mod-actions .btn-approve:hover { opacity: 0.85; }

.admin-mod-actions .btn-reject {
    padding: 9px 18px;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(217, 119, 86, 0.3);
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.admin-mod-actions .btn-reject:hover {
    background: rgba(217, 119, 86, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING TUTORIAL
   ═══════════════════════════════════════════════════════════════ */

/* Vollflächiges Overlay — wird NUR für Center-Steps (ohne Target) genutzt */
.onb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 15, 0.72);
    z-index: 9500;
    animation: fade 0.3s ease;
    pointer-events: auto;
}

.onb-overlay.hidden { display: none; }

/* Wenn Spotlight aktiv ist: Overlay komplett ausblenden — Spotlight übernimmt */
.onb-overlay.spotlight-active {
    display: none;
}

/* Spotlight = klarer Bereich + Abdunkelung außenrum via box-shadow */
.onb-spotlight {
    position: fixed;
    z-index: 9600;
    border-radius: var(--radius-md);
    background: transparent;
    box-shadow:
        0 0 0 3px rgba(212, 192, 136, 0.95),
        0 0 0 7px rgba(212, 192, 136, 0.28),
        0 0 0 9999px rgba(15, 13, 10, 0.72);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: spotlightPulse 2.2s ease-in-out infinite;
}

.onb-spotlight.hidden { display: none; }

@keyframes spotlightPulse {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(212, 192, 136, 0.95),
            0 0 0 7px rgba(212, 192, 136, 0.28),
            0 0 0 9999px rgba(15, 13, 10, 0.72);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(212, 192, 136, 1),
            0 0 0 10px rgba(212, 192, 136, 0.4),
            0 0 0 9999px rgba(15, 13, 10, 0.72);
    }
}

.onb-tooltip {
    position: fixed;
    z-index: 9700;
    max-width: 340px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-lg);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    animation: tooltipIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tooltipIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.onb-tooltip::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-left: 1px solid var(--border-strong);
    border-top: 1px solid var(--border-strong);
    transform: rotate(45deg);
}

.onb-tooltip.arrow-top::before    { top: -7px; left: 24px; }
.onb-tooltip.arrow-bottom::before { bottom: -7px; left: 24px; transform: rotate(-135deg); }
.onb-tooltip.arrow-left::before   { left: -7px; top: 24px; transform: rotate(-45deg); }
.onb-tooltip.arrow-right::before  { right: -7px; top: 24px; transform: rotate(135deg); }

.onb-step-num {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-family: var(--mono);
}

.onb-tooltip h4 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.onb-tooltip p {
    font-size: 13.5px;
    color: var(--text-sec);
    line-height: 1.6;
    margin-bottom: 16px;
}

.onb-tooltip .onb-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px dashed rgba(212, 192, 136, 0.3);
}

.onb-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.onb-progress {
    font-size: 11px;
    color: var(--text-mute);
    font-family: var(--mono);
    font-weight: 600;
}

.onb-btns {
    display: flex;
    gap: 6px;
}

.onb-btn {
    padding: 8px 14px;
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
}

.onb-btn:hover {
    color: var(--ink);
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.onb-btn.primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.onb-btn.primary:hover {
    background: var(--ink-2);
    border-color: var(--ink-2);
}

.onb-btn.skip {
    color: var(--text-mute);
    border: none;
    padding: 8px 10px;
}
.onb-btn.skip:hover {
    color: var(--text-sec);
    background: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   UPGRADE MODAL
   ═══════════════════════════════════════════════════════════════ */
.upgrade-lock {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.upgrade-lock-visual {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--accent-warm) 0%, var(--accent) 55%, var(--ink) 100%);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 34px rgba(212, 192, 136, 0.25);
}

.upgrade-lock h3 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.upgrade-lock p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-sec);
    max-width: 420px;
}

.upgrade-lock .hint {
    font-size: 12px;
    color: var(--text-mute);
}

.upgrade-lock .actions {
    width: 100%;
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.upgrade-lock .actions .btn-dark,
.upgrade-lock .actions .btn-outline {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (< 900px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    :root { --header-h: 64px; --footer-h: 64px; }

    .app-header-inner { padding: 0 16px; gap: 10px; }
    .header-brand .brand-tag { display: none; }
    .header-brand .brand-name { font-size: 17px; }
    .brand-logo-img.sm { width: 34px; height: 34px; }
    .header-nav { gap: 2px; }
    .nav-btn { padding: 8px 10px; font-size: 12.5px; }
    .nav-upgrade { padding: 8px 14px; font-size: 12.5px; }
    .header-user { margin-left: 6px; padding-left: 10px; }

    .view { padding: 24px 16px 40px; }
    .view-hero { margin-bottom: 28px; gap: 12px; }
    .hero-title { font-size: 36px; }
    .hero-sub { font-size: 14px; }

    .panel-card { padding: 20px 18px; border-radius: 18px; }
    .panel-header { margin-bottom: 16px; }
    .panel-title { font-size: 19px; }

    .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-item { padding: 12px; gap: 10px; }
    .stat-icon-box { width: 36px; height: 36px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 11px; }

    .form-grid { grid-template-columns: 1fr; }
    .quick-row { grid-template-columns: 1fr; gap: 10px; }
    .charts-grid { grid-template-columns: 1fr; }

    .discover-layout { grid-template-columns: 1fr; gap: 16px; }
    .body-panel { position: static; }
    .community-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

    .app-footer { padding: 0 14px; gap: 10px; }
    .footer-tag, .footer-email { display: none; }
    .footer-name { font-size: 14px; }
    .footer-right { gap: 12px; }
    .footer-right .footer-link + .footer-link { padding-left: 12px; }
    .footer-link { font-size: 12px; }
    .footer-socials { gap: 6px; }
    .social-btn { width: 32px; height: 32px; }
    .conn-toast { font-size: 11px; padding: 8px 14px; }

    .chat-modal {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: calc(var(--footer-h) + 10px);
        max-height: calc(100vh - var(--footer-h) - var(--header-h) - 20px);
        border-radius: 16px;
    }
    .chat-fab { right: 14px; bottom: calc(var(--footer-h) + 14px); }

    .admin-user-card { grid-template-columns: 1fr; }
    .admin-user-actions { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (< 600px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .app-header-inner { padding: 0 12px; gap: 8px; }
    .header-brand { gap: 8px; }
    .header-brand .brand-name { font-size: 15px; }
    .brand-logo-img.sm { width: 32px; height: 32px; border-radius: 8px; }
    .header-nav .nav-btn { padding: 6px 8px; font-size: 12px; }
    .nav-btn { display: none; }
    .nav-btn.active, .nav-textlink, .nav-upgrade {
        display: inline-flex; align-items: center;
    }
    .nav-upgrade { padding: 7px 12px; font-size: 12px; }
    .nav-textlink { padding: 7px 8px; font-size: 12px; }
    .header-user { margin-left: 4px; padding-left: 8px; }
    .user-avatar-img { width: 30px; height: 30px; }

    .user-dropdown { min-width: 220px; right: -8px; }
    .user-dropdown-email { font-size: 11px; }

    .view { padding: 20px 12px 30px; }
    .view-hero { margin-bottom: 24px; gap: 10px; }
    .hero-title { font-size: 28px; line-height: 1.1; }
    .hero-sub { font-size: 13.5px; padding: 0 4px; }
    .badge-pill { font-size: 11px; padding: 4px 12px; }

    .panel-card { padding: 16px 14px; border-radius: 16px; margin-bottom: 16px; }
    .panel-header { margin-bottom: 14px; }
    .panel-title { font-size: 17px; }

    .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
    .stat-item { padding: 11px; gap: 9px; border-radius: 12px; }
    .stat-icon-box { width: 32px; height: 32px; border-radius: 8px; }
    .stat-icon-box svg { width: 14px; height: 14px; }
    .stat-label { font-size: 10px; }
    .stat-value { font-size: 20px; }
    .stat-value em { font-size: 10px; }

    .quick-row { gap: 8px; }
    .search-input-wrapper { padding: 0 12px; }
    .search-input-wrapper input { padding: 11px 0; }
    .add-input-wrapper input { padding: 11px 12px; }
    .btn-add-square { width: 42px; height: 42px; border-radius: 10px; }

    .muscle-category-head { padding: 14px 16px; }
    .muscle-cat-name { font-size: 16px; }
    .ex-row { padding: 11px 12px; }
    .ex-row-name { font-size: 13.5px; }
    .exercise-btns { flex-direction: column; }
    .exercise-btns .btn-dark.sm, .exercise-btns .btn-outline.sm {
        width: 100%; flex: none;
    }

    .empty-box { padding: 36px 16px; }
    .empty-box h3 { font-size: 17px; }
    .empty-box p { font-size: 12.5px; }
    .empty-plus { width: 42px; height: 42px; }

    .set-row { padding: 9px 10px; gap: 6px; }
    .set-num { width: 24px; height: 24px; min-width: 24px; font-size: 10px; }
    .set-row input { padding: 8px 10px; }
    .set-row input[type="number"] { max-width: 80px; }
    .set-row-remove { width: 28px; height: 28px; min-width: 28px; }

    .modal-overlay { padding: 0; }
    .modal {
        max-width: 100%; width: 100%;
        max-height: 100vh; height: 100vh;
        border-radius: 0; border: none;
    }
    .modal-header { padding: 16px 18px; }
    .modal-header h3 { font-size: 17px; }
    .modal-body { padding: 18px 18px 24px; }

    .chat-modal {
        width: 100vw; max-width: 100vw;
        right: 0; left: 0; bottom: 0; top: 0;
        height: 100vh; max-height: 100vh;
        border-radius: 0; border: none;
    }
    .chat-modal-header { padding: 14px 16px; }
    .chat-modal-header h3 { font-size: 16px; }
    .chat-modal-actions select { font-size: 11px; padding: 6px 8px; }
    .chat-messages { padding: 14px; gap: 10px; }
    .bubble { max-width: 88%; font-size: 13px; padding: 10px 13px; }
    .chat-input-row { padding: 12px 14px; gap: 5px; }
    .btn-icon-plain { width: 38px; height: 38px; }
    .btn-send-dark { width: 42px; height: 42px; }

    .chat-fab {
        width: 52px; height: 52px;
        right: 12px; bottom: calc(var(--footer-h) + 12px);
    }

    .app-footer { padding: 0 12px; gap: 8px; }
    .footer-brand .brand-logo-img { width: 28px; height: 28px; border-radius: 7px; }
    .footer-name { font-size: 13px; }
    .footer-socials { gap: 4px; }
    .social-btn { width: 30px; height: 30px; }
    .footer-link { font-size: 11px; }
    .footer-right { gap: 8px; }
    .footer-right .footer-link + .footer-link { padding-left: 10px; }

    .code-input { width: 40px; height: 48px; font-size: 20px; }
    .code-inputs { gap: 6px; }

    .auth-wrapper { padding: 14px; }
    .auth-card { padding: 26px 22px; border-radius: 22px; }
    .auth-title { font-size: 26px; }
    .auth-sub { font-size: 13px; }

    .toast { font-size: 12.5px; padding: 11px 20px; bottom: 20px; }

    .community-list { grid-template-columns: 1fr; }
    .body-panel { padding: 18px 14px; }
    .body-svg-wrap { min-height: 380px; padding: 4px; }

    .admin-tabs { flex-wrap: wrap; }
    .admin-tab { flex: 1 1 45%; font-size: 12px; padding: 9px 10px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-stat-value { font-size: 22px; }
    .admin-user-card { padding: 12px; }
    .admin-user-actions { gap: 4px; }

    .onb-tooltip {
        max-width: calc(100vw - 32px);
        padding: 18px 18px;
    }
    .onb-tooltip h4 { font-size: 18px; }
    .onb-tooltip p { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (< 380px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .hero-title { font-size: 24px; }
    .stats-row { grid-template-columns: 1fr; }
    .stat-value { font-size: 20px; }
    .header-brand .brand-name { display: none; }
    .footer-right { gap: 6px; }
    .footer-right .footer-link + .footer-link { padding-left: 8px; }
    .footer-link { font-size: 10.5px; }
}

/* Landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-wrapper { padding: 10px; }
    .auth-card { padding: 22px; }
    .auth-brand { margin-bottom: 16px; padding-bottom: 16px; }
    .code-input { height: 42px; font-size: 18px; }
    .chat-modal { top: 0; height: 100vh; max-height: 100vh; }
}

/* Touch: keine Hover-Effekte */
@media (hover: none) {
    .btn-dark:hover,
    .btn-outline:hover,
    .btn-add-square:hover,
    .exercise-card:hover,
    .stat-item:hover,
    .chat-fab:hover,
    .social-btn:hover,
    .community-card:hover {
        transform: none;
        box-shadow: inherit;
    }
}

/* Print */
@media print {
    .app-header, .app-footer, .chat-fab, .chat-modal, .onb-overlay, .onb-tooltip { display: none !important; }
    body { background: white; color: black; }
    .panel-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* SVG-Icon-Colors Bulletproof */
.btn-dark,
.btn-add-square,
.btn-send-dark,
.chat-fab,
.nav-btn.active,
.stat-icon-box,
.brand-icon-box,
.set-num,
.user-avatar,
.community-add-btn {
    color: var(--icon-on-dark);
}

.btn-dark svg,
.btn-add-square svg,
.btn-send-dark svg,
.chat-fab svg,
.nav-btn.active svg,
.stat-icon-box svg,
.brand-icon-box svg,
.community-add-btn svg {
    color: var(--icon-on-light) !important;
    stroke: var(--icon-on-light) !important;
}

.btn-dark svg[fill]:not([fill="none"]),
.btn-add-square svg[fill]:not([fill="none"]),
.btn-send-dark svg[fill]:not([fill="none"]),
.chat-fab svg[fill]:not([fill="none"]),
.stat-icon-box svg[fill]:not([fill="none"]),
.brand-icon-box svg[fill]:not([fill="none"]),
.community-add-btn svg[fill]:not([fill="none"]) {
    fill: var(--icon-on-light) !important;
}