
        :root {
            --bg-color: #fbf9fa;
            --surface: #ffffff;
            --border: #dcd1d6;
            --border-light: #ede6e9;
            --text-main: #21141a;
            --text-muted: #826d77;
            --primary: #b24777;
            --primary-hover: #923f65;
            --danger: #ef4444;
            --danger-bg: #fef2f2;
            --success: #10b981;
            --success-bg: #ecfdf5;
            --warning: #f59e0b;
            --radius-box: 16px;
            --radius-btn: 8px;
        }
        
        * { 
            box-sizing: border-box; 
            margin: 0; 
            padding: 0; 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
            -webkit-tap-highlight-color: transparent; 
        }

        html, body {
            overflow-x: hidden;
            width: 100%;
            position: relative;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }
        
        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            padding: 24px 12px;
        }

        .app-container {
            background: var(--surface);
            width: 100%;
            max-width: 1100px;
            border-radius: var(--radius-box);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            border: 1px solid var(--border-light);
            padding: 28px;
            align-self: flex-start;
            overflow: hidden; /* Verhindert horizontalen Overflow auf Smartphones */
        }

        @keyframes gentleFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-3px); }
        }

        @keyframes bluePulse {
            0%, 100% { opacity: 0.25; transform: scale(0.95); }
            50% { opacity: 0.6; transform: scale(1.15); }
        }

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

        @keyframes pageReveal {
            from { opacity: 0; transform: translateY(14px) scale(0.992); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes loginOrbOne {
            0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
            50% { transform: translate3d(22px, -16px, 0) scale(1.08); }
        }

        @keyframes loginOrbTwo {
            0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
            50% { transform: translate3d(-18px, 20px, 0) scale(0.94); }
        }

        @keyframes progressSweep {
            from { transform: translateX(-100%); }
            to { transform: translateX(300%); }
        }

        .app-container { animation: pageReveal 0.45s cubic-bezier(.2,.75,.3,1) both; }
        /* Auf der angemeldeten Drive-Oberfläche darf kein transformierter Hauptcontainer
           einen position:fixed-Floating-Button an sich binden (insbesondere iOS Safari). */
        body.is-authenticated .app-container { transform: none !important; }

        .header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            border-bottom: 1px solid var(--border-light); 
            padding-bottom: 18px; 
            margin-bottom: 24px; 
            gap: 12px; 
            width: 100%;
        }

        .header-brand-group {
            min-width: 0;
            display: flex;
            align-items: center;
        }
        
        .brand-btn { 
            display: inline-flex; 
            align-items: center; 
            gap: 10px; 
            background: transparent; 
            border: none; 
            padding: 2px 0; 
            text-decoration: none; 
            touch-action: manipulation;
            flex-shrink: 0;
        }

        .logo-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .logo-aura { display: none; }

        .header-logo {
            display: flex;
            align-items: center;
            position: relative;
            z-index: 2;
            filter: drop-shadow(0 5px 10px rgba(178, 71, 119, .16));
            transition: transform .18s ease, filter .18s ease;
        }
        .header-logo svg { display: block; }
        @media (hover: hover) and (pointer: fine) {
            .brand-btn:hover .header-logo { transform: translateY(-1px); filter: drop-shadow(0 7px 13px rgba(178, 71, 119, .20)); }
        }

        .brand-text {
            font-weight: 800; 
            font-size: 1.6rem; 
            letter-spacing: -0.5px;
            color: var(--text-main);
            display: inline-flex;
            align-items: center;
            white-space: nowrap;
        }
        .brand-text span { color: var(--primary); }

        .header-user-nav {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .user-badge {
            background: #f7f3f5;
            border: 1px solid var(--border-light);
            padding: 6px 10px;
            border-radius: 20px;
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 6px;
            max-width: 150px;
        }
        .user-badge span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .header-user-nav { position: relative; }
        .account-menu { position: relative; flex: 0 0 auto; }
        .account-menu > summary { list-style: none; cursor: pointer; user-select: none; }
        .account-menu > summary::-webkit-details-marker { display: none; }
        .account-menu-trigger { min-height: 42px; cursor: pointer; }
        .account-menu-avatar {
            width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; overflow: hidden;
            border-radius: 50%; background: linear-gradient(145deg,#b94d7e,#b74277); color: #fff;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 1px 4px rgba(33,20,26,.12);
        }
        .account-menu-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; border-radius: inherit; }
        .account-menu-avatar svg { width: 16px; height: 16px; }
        .account-menu-trigger .account-menu-chevron { flex: 0 0 auto; opacity: .58; transition: transform .16s ease; }
        .account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
        .account-menu-popover {
            position: absolute; top: calc(100% + 8px); right: 0; z-index: 1400;
            width: min(250px, calc(100vw - 24px)); padding: 7px;
            border: 1px solid #e7dfe3; border-radius: 12px; background: #fff;
            box-shadow: 0 18px 48px rgba(33,20,26,.18);
        }
        .account-menu:not([open]) .account-menu-popover { display: none; }
        .account-menu-heading { padding: 8px 9px 9px; border-bottom: 1px solid #f2eff0; margin-bottom: 4px; }
        .account-menu-heading span { display: block; color: #9e9096; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
        .account-menu-heading strong { display: block; margin-top: 2px; overflow: hidden; color: #3e2c34; font-size: .88rem; white-space: nowrap; text-overflow: ellipsis; }
        .account-menu-item {
            width: 100%; min-height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 10px;
            border: 0; border-radius: 8px; background: transparent; color: #4d3b43;
            font: inherit; font-size: .84rem; font-weight: 620; text-align: left; cursor: pointer;
        }
        .account-menu-item:hover, .account-menu-item:focus-visible { outline: none; background: #f7f3f5; color: #82395a; }
        .account-menu-item svg { flex: 0 0 auto; }
        .account-menu-item[hidden] { display: none !important; }

        .alert { padding: 12px 16px; border-radius: var(--radius-btn); margin-bottom: 20px; font-weight: 500; font-size: 0.9rem; border-left: 4px solid transparent; }
        .alert-error { background: var(--danger-bg); border-left-color: var(--danger); color: #991b1b; }
        .alert-success { background: var(--success-bg); border-left-color: var(--success); color: #065f46; }

        /* Professioneller Login-Bereich */
        @keyframes loginBackdropDrift {
            0%, 100% { transform: translate3d(-2%, -1%, 0) scale(1); }
            50% { transform: translate3d(3%, 2%, 0) scale(1.06); }
        }
        @keyframes loginGridMove {
            from { background-position: 0 0; }
            to { background-position: 48px 48px; }
        }
        @keyframes loginEnterLeft {
            from { opacity: 0; transform: translate3d(-24px, 12px, 0); }
            to { opacity: 1; transform: translate3d(0, 0, 0); }
        }
        @keyframes loginEnterRight {
            from { opacity: 0; transform: translate3d(28px, 10px, 0); }
            to { opacity: 1; transform: translate3d(0, 0, 0); }
        }
        @keyframes loginCardFloat {
            0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--rot, 0deg)); }
            50% { transform: translate3d(0, -9px, 0) rotate(var(--rot, 0deg)); }
        }
        @keyframes loginStatusPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.38); }
            50% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
        }
        @keyframes buttonShine {
            0% { transform: translateX(-160%) skewX(-18deg); }
            45%, 100% { transform: translateX(280%) skewX(-18deg); }
        }
        @keyframes iconBreathe {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-3px) scale(1.04); }
        }
        @keyframes softPulse {
            0%, 100% { opacity: .82; transform: scale(.96); }
            50% { opacity: .95; transform: scale(1.06); }
        }
        @keyframes modalPop {
            from { opacity: 0; transform: translateY(14px) scale(.975); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        .is-login {
            min-height: 100svh;
            align-items: center;
            padding: 26px;
            position: relative;
            isolation: isolate;
            overflow: hidden;
            background: #1a0d13;
        }
        .is-login::before,
        .is-login::after {
            content: '';
            position: fixed;
            pointer-events: none;
            z-index: -2;
        }
        .is-login::before {
            inset: -22%;
            background:
                radial-gradient(circle at 18% 24%, rgba(178,71,119,.38), transparent 27%),
                radial-gradient(circle at 78% 20%, rgba(210,133,156,.22), transparent 24%),
                radial-gradient(circle at 68% 82%, rgba(150,65,122,.30), transparent 27%),
                radial-gradient(circle at 18% 84%, rgba(210,133,156,.16), transparent 22%);
            filter: blur(14px);
            animation: loginBackdropDrift 15s ease-in-out infinite;
        }
        .is-login::after {
            inset: 0;
            z-index: -1;
            opacity: .28;
            background-image:
                linear-gradient(rgba(176,157,165,.08) 1px, transparent 1px),
                linear-gradient(90deg, rgba(176,157,165,.08) 1px, transparent 1px);
            background-size: 48px 48px;
            -webkit-mask-image: radial-gradient(circle at center, #000 22%, transparent 78%);
            mask-image: radial-gradient(circle at center, #000 22%, transparent 78%);
            animation: loginGridMove 18s linear infinite;
        }
        .is-login .app-container {
            width: min(1180px, 100%);
            max-width: 1180px;
            padding: 0;
            border: 0;
            border-radius: 30px;
            background: rgba(27, 14, 20, .54);
            box-shadow: 0 34px 100px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.06);
            overflow: hidden;
            backdrop-filter: blur(22px);
            -webkit-backdrop-filter: blur(22px);
        }
        .is-login .header { display: none; }
        .is-login > .app-container > .alert {
            position: relative;
            z-index: 5;
            margin: 18px 18px -4px;
            border-radius: 14px;
            box-shadow: 0 12px 28px rgba(0,0,0,.12);
            animation: fadeInUp .35s ease both;
        }
        .login-shell {
            display: grid;
            grid-template-columns: minmax(0, 1.16fr) minmax(390px, .84fr);
            min-height: 650px;
            overflow: hidden;
            background: rgba(255,255,255,.985);
        }
        .login-visual {
            position: relative;
            overflow: hidden;
            padding: 42px 46px 38px;
            color: #fff;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            background:
                radial-gradient(circle at 80% 15%, rgba(222,160,179,.20), transparent 30%),
                linear-gradient(148deg, #1f0f16 0%, #3d1b2a 48%, #6c304b 100%);
            isolation: isolate;
        }
        .login-visual::before {
            content: '';
            position: absolute;
            width: 420px;
            height: 420px;
            right: -160px;
            bottom: -180px;
            border-radius: 50%;
            border: 1px solid rgba(230,179,202,.18);
            box-shadow: 0 0 0 46px rgba(200,101,145,.04), 0 0 0 92px rgba(200,101,145,.025);
            z-index: -1;
        }
        .login-visual::after {
            content: '';
            position: absolute;
            inset: 0;
            opacity: .38;
            background-image:
                linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
            background-size: 32px 32px;
            -webkit-mask-image: linear-gradient(to bottom, #000 8%, transparent 94%);
            mask-image: linear-gradient(to bottom, #000 8%, transparent 94%);
            z-index: -2;
        }
        .login-brand-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            animation: loginEnterLeft .6s cubic-bezier(.2,.8,.2,1) .05s both;
        }
        .login-brand {
            display: inline-flex;
            align-items: center;
            gap: 11px;
            font-size: 1.22rem;
            font-weight: 850;
            letter-spacing: -.035em;
        }
        .login-brand-logo {
            width: 40px;
            height: 40px;
            display: grid;
            place-items: center;
            border-radius: 13px;
            background: rgba(255,255,255,.10);
            border: 1px solid rgba(255,255,255,.14);
            box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
            animation: iconBreathe 4s ease-in-out infinite;
        }
        .login-status {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 10px;
            border-radius: 999px;
            border: 1px solid rgba(255,255,255,.12);
            background: rgba(255,255,255,.075);
            color: #f6e4ec;
            font-size: .76rem;
            font-weight: 700;
            backdrop-filter: blur(10px);
        }
        .login-status-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #4ade80;
            animation: loginStatusPulse 2.2s ease-out infinite;
        }
        .login-copy {
            position: relative;
            z-index: 2;
            max-width: 610px;
            margin-top: 42px;
            animation: loginEnterLeft .7s cubic-bezier(.2,.8,.2,1) .14s both;
        }
        .login-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 7px 11px;
            border-radius: 999px;
            border: 1px solid rgba(230,179,202,.18);
            background: rgba(200,101,145,.10);
            color: #f0d0de;
            font-size: .72rem;
            font-weight: 800;
            letter-spacing: .10em;
            text-transform: uppercase;
        }
        .login-visual h1 {
            margin-top: 19px;
            font-size: clamp(2.35rem, 4.4vw, 4rem);
            line-height: .98;
            letter-spacing: -.055em;
            max-width: 620px;
            text-wrap: balance;
        }
        .login-visual h1 span {
            display: inline-block;
            background: linear-gradient(100deg, #fff 12%, #f0d0de 50%, #e9bdca 90%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        .login-visual p {
            margin-top: 20px;
            max-width: 540px;
            color: #e9d3dd;
            line-height: 1.72;
            font-size: .98rem;
        }
        .login-dashboard {
            position: relative;
            height: 185px;
            margin: 34px 0 18px;
            animation: loginEnterLeft .75s cubic-bezier(.2,.8,.2,1) .24s both;
        }
        .login-float-card {
            position: absolute;
            border: 1px solid rgba(255,255,255,.14);
            background: rgba(255,255,255,.10);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            box-shadow: 0 18px 38px rgba(0,0,0,.17);
            border-radius: 18px;
            animation: loginCardFloat var(--dur, 5.5s) ease-in-out var(--delay, 0s) infinite;
        }
        .login-float-card.storage {
            left: 0;
            top: 20px;
            width: min(330px, 62%);
            padding: 18px;
            --rot: -1.4deg;
            --dur: 5.8s;
        }
        .login-float-card.file-one {
            right: 10%;
            top: 0;
            width: 180px;
            padding: 14px;
            --rot: 2.6deg;
            --dur: 6.6s;
            --delay: -.8s;
        }
        .login-float-card.file-two {
            right: 1%;
            bottom: 3px;
            width: 205px;
            padding: 14px;
            --rot: -2deg;
            --dur: 5.2s;
            --delay: -1.7s;
        }
        .login-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
        .login-card-label { color: #f6e4ec; font-size: .75rem; font-weight: 700; }
        .login-card-value { margin-top: 8px; font-size: 1.35rem; font-weight: 850; letter-spacing: -.03em; }
        .login-card-meta { color: #e6b3ca; font-size: .7rem; margin-top: 3px; }
        .login-storage-track { height: 7px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
        .login-storage-fill { width: 58%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #dea0b3, #d78cae); box-shadow: 0 0 18px rgba(222,160,179,.35); }
        .login-file-icon {
            width: 38px;
            height: 38px;
            border-radius: 11px;
            display: grid;
            place-items: center;
            color: #f6e4ec;
            background: rgba(255,255,255,.10);
            border: 1px solid rgba(255,255,255,.10);
            margin-bottom: 13px;
        }
        .login-file-name { font-size: .78rem; font-weight: 750; color: #fbf3f7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .login-file-meta { margin-top: 4px; color: #e6b3ca; font-size: .66rem; }
        .login-visual-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            color: #e6b3ca;
            font-size: .74rem;
            animation: loginEnterLeft .65s ease .35s both;
        }
        .login-footer-secure { display: inline-flex; align-items: center; gap: 6px; }

        .login-panel {
            position: relative;
            padding: 62px 50px;
            display: flex;
            align-items: center;
            background: linear-gradient(180deg, #ffffff 0%, #fdfafb 100%);
            animation: loginEnterRight .65s cubic-bezier(.2,.8,.2,1) .08s both;
        }
        .login-panel::before {
            content: '';
            position: absolute;
            width: 240px;
            height: 240px;
            right: -120px;
            top: -120px;
            border-radius: 50%;
            background: rgba(178,71,119,.055);
            animation: softPulse 7s ease-in-out infinite;
            pointer-events: none;
        }
        .login-form {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 390px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .login-panel-badge {
            width: max-content;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            color: var(--primary);
            background: #fbf3f7;
            border: 1px solid #f6e4ec;
            padding: 6px 10px;
            border-radius: 999px;
            font-size: .72rem;
            font-weight: 800;
        }
        .login-mark {
            width: 58px;
            height: 58px;
            border-radius: 18px;
            display: grid;
            place-items: center;
            color: var(--primary);
            background: linear-gradient(145deg, #fbf3f7, #fff);
            border: 1px solid #f6e4ec;
            box-shadow: 0 14px 34px rgba(178,71,119,.15);
            animation: iconBreathe 4s ease-in-out infinite;
        }
        .login-form h2 {
            font-size: clamp(1.75rem, 3vw, 2.15rem);
            color: var(--text-main);
            font-weight: 850;
            letter-spacing: -.04em;
            margin-top: 4px;
        }
        .login-subtitle { color: var(--text-muted); font-size: .92rem; line-height: 1.6; margin-top: -8px; margin-bottom: 6px; }
        .login-label { display: block; color: #4d3b43; font-size: .78rem; font-weight: 750; margin-bottom: 7px; }
        .login-field { position: relative; }
        .login-field svg {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #b09da5;
            pointer-events: none;
            transition: color .2s ease, transform .2s ease;
        }
        .login-field:focus-within svg { color: var(--primary); transform: translateY(-50%) scale(1.08); }
        .login-field input {
            padding-left: 45px;
            min-height: 52px;
            border-radius: 12px;
            background: #fff;
            border-color: #e7dde1;
            box-shadow: 0 1px 2px rgba(33,20,26,.02);
            transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
        }
        .login-field input:hover { border-color: #d1c1c8; background: #fdfefe; }
        .login-field input:focus { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(178,71,119,.10), 0 8px 22px rgba(178,71,119,.07); }
        .login-button {
            position: relative;
            overflow: hidden;
            min-height: 52px;
            border-radius: 12px;
            margin-top: 4px;
            background: linear-gradient(135deg, #b24777, #923f65 58%, #753652);
            box-shadow: 0 12px 26px rgba(178,71,119,.23);
            transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
        }
        .login-button::before {
            content: '';
            position: absolute;
            top: -30%;
            bottom: -30%;
            width: 42%;
            left: -60%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.30), transparent);
            animation: buttonShine 4.2s ease-in-out 1.2s infinite;
            pointer-events: none;
        }
        .login-button:hover { transform: translateY(-2px); box-shadow: 0 17px 34px rgba(178,71,119,.30); filter: saturate(1.08); }
        .login-button:active { transform: translateY(0) scale(.99); }
        .login-button .login-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
        .login-button.is-loading .login-spinner { display: inline-block; }
        .login-button.is-loading .login-arrow { display: none; }
        .login-button:disabled { cursor: not-allowed; transform: none; opacity: .75; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .login-security-note {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            color: #826d77;
            font-size: .75rem;
            margin-top: 4px;
        }
        .login-security-note svg { color: #16a34a; }
        .login-help {
            margin-top: 2px;
            text-align: center;
            font-size: .72rem;
            color: #b09da5;
        }

        /* Dezente, GPU-freundliche Motion für die angemeldete Oberfläche */
        .is-authenticated .storage-widget,
        .is-authenticated .toolbar,
        .is-authenticated .breadcrumbs,
        .is-authenticated .section-title {
            opacity: 0;
            animation: fadeInUp .42s cubic-bezier(.2,.75,.3,1) forwards;
        }
        .is-authenticated .storage-widget { animation-delay: .06s; }
        .is-authenticated .toolbar { animation-delay: .11s; }
        .is-authenticated .breadcrumbs { animation-delay: .16s; }
        .is-authenticated .section-title { animation-delay: .20s; }
        .folder-row, .file-item, .card {
            animation-delay: calc(min(var(--i, 0), 10) * 35ms);
            will-change: transform, opacity;
        }
        .folder-row:hover .folder-row-icon { transform: translateY(-2px) scale(1.04); }
        .folder-row-icon { transition: transform .22s cubic-bezier(.2,.8,.2,1); }
        .list-thumb, .list-canvas-thumb, .file-icon-box { transition: transform .22s ease, box-shadow .22s ease; }
        .file-item:hover .list-thumb, .file-item:hover .list-canvas-thumb, .file-item:hover .file-icon-box { transform: scale(1.045); box-shadow: 0 7px 18px rgba(33,20,26,.08); }
        .drop-zone svg { transition: transform .25s cubic-bezier(.2,.8,.2,1); }
        .drop-zone:hover:not(.disabled) > svg { transform: translateY(-3px); }
        .drop-zone.dragover:not(.disabled) > svg { transform: translateY(-5px) scale(1.08); }
        .modal[style*="display: flex"] .confirm-modal-box,
        .modal[style*="display:flex"] .confirm-modal-box { animation: modalPop .24s cubic-bezier(.2,.8,.2,1) both; }
        .quick-action-btn svg, .list-action-btn svg, .btn-icon-nav svg { transition: transform .2s ease; }
        .quick-action-btn:hover svg, .list-action-btn:hover svg, .btn-icon-nav:hover svg { transform: scale(1.10); }

        input[type="password"], input[type="text"], select {
            width: 100%; 
            padding: 12px 14px;
            background: #fff; 
            border: 1px solid var(--border); 
            border-radius: var(--radius-btn); 
            font-size: 16px !important; 
            color: var(--text-main);
            outline: none; 
            transition: border-color 0.2s, box-shadow 0.2s;
            min-height: 46px;
        }
        input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(178, 71, 119, 0.15); }

        .btn {
            background: var(--primary); 
            color: #ffffff; 
            border: 1px solid transparent;
            padding: 12px 20px; 
            font-size: 0.95rem; 
            border-radius: var(--radius-btn); 
            cursor: pointer; 
            font-weight: 600; 
            transition: all 0.2s ease; 
            display: inline-flex; 
            align-items: center; 
            justify-content: center; 
            gap: 8px; 
            min-height: 46px;
            touch-action: manipulation;
            user-select: none;
        }
        .btn:active, .btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
        .btn-danger { background: var(--danger); color: #fff; }
        .btn-danger:hover { background: #dc2626; }
        .btn-secondary { background: #ede6e9; color: var(--text-main); }
        .btn-secondary:hover { background: #dcd1d6; }

        .btn-icon-nav { 
            background: #ffffff; 
            color: var(--text-muted); 
            border: 1px solid var(--border); 
            width: 42px;
            height: 42px;
            border-radius: var(--radius-btn); 
            text-decoration: none; 
            transition: all 0.2s; 
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0; /* Verhindert Stauchen auf iOS Safari */
            touch-action: manipulation;
            cursor: pointer;
        }
        .btn-icon-nav:active, .btn-icon-nav:hover { background: #f7f3f5; color: var(--primary); }

        .storage-widget { background: #fbf9fa; padding: 16px; border-radius: var(--radius-box); border: 1px solid var(--border-light); margin-bottom: 24px; }
        .storage-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
        .storage-bar-bg { width: 100%; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
        .storage-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }
        .storage-bar-fill.warning { background: var(--warning); }
        .storage-bar-fill.danger { background: var(--danger); }

        .toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
        .folder-form { display: flex; gap: 10px; flex: 1 1 280px; width: 100%; }
        .folder-form input { flex-grow: 1; }
        .folder-form button { white-space: nowrap; }

        .breadcrumbs { 
            display: flex; 
            align-items: center; 
            gap: 6px; 
            margin-bottom: 24px; 
            overflow-x: auto; 
            padding-bottom: 6px; 
            -webkit-overflow-scrolling: touch; 
            max-width: 100%;
        }
        .breadcrumb-btn {
            background: #fbf9fa;
            border: 1px solid var(--border-light);
            border-radius: 20px;
            padding: 8px 14px;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
            text-decoration: none;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
            touch-action: manipulation;
        }
        .breadcrumb-btn:active, .breadcrumb-btn:hover { background: var(--border-light); color: var(--primary); }
        .breadcrumb-separator { color: var(--border); font-size: 0.8rem; flex-shrink: 0; }

        .upload-section { margin-bottom: 30px; }

        @keyframes uploadIconFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }
        @keyframes uploadHalo {
            0%, 100% { opacity: .25; transform: scale(.86); }
            50% { opacity: .58; transform: scale(1.12); }
        }
        @keyframes uploadPanelIn {
            from { opacity: 0; transform: translateY(10px) scale(.992); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        @keyframes uploadStatusPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(178,71,119,.24); }
            50% { box-shadow: 0 0 0 7px rgba(178,71,119,0); }
        }
        @keyframes uploadSuccessPop {
            0% { transform: scale(.82); opacity: .35; }
            65% { transform: scale(1.08); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }
        @keyframes uploadQueueActive {
            0%, 100% { background-color: #fbf3f7; }
            50% { background-color: #f9edf3; }
        }

        .drop-zone {
            position: relative;
            isolation: isolate;
            min-height: 178px;
            padding: 28px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 1.5px dashed #d1c1c9;
            border-radius: 18px;
            text-align: center;
            background: linear-gradient(180deg, #fefcfd 0%, #fdf9fb 100%);
            cursor: pointer;
            transition: border-color .22s ease, background .22s ease, box-shadow .22s ease, transform .22s ease;
            touch-action: manipulation;
        }
        .drop-zone::before {
            content: '';
            position: absolute;
            z-index: -1;
            width: 190px;
            height: 190px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(178,71,119,.10), transparent 67%);
            opacity: .7;
            transition: transform .25s ease, opacity .25s ease;
        }
        .drop-zone:hover:not(.disabled) {
            border-color: #d194b0;
            background: linear-gradient(180deg, #ffffff 0%, #fbf4f7 100%);
            box-shadow: 0 14px 36px rgba(178,71,119,.08);
            transform: translateY(-1px);
        }
        .drop-zone:hover:not(.disabled)::before { transform: scale(1.12); opacity: 1; }
        .drop-zone.dragover:not(.disabled) {
            border-color: var(--primary);
            background: #fbf3f7;
            box-shadow: 0 0 0 5px rgba(178,71,119,.08), 0 18px 42px rgba(178,71,119,.12);
            transform: scale(1.006);
        }
        .drop-zone.disabled { opacity: .82; cursor: not-allowed; border-color: var(--border-light); background: var(--surface); }
        .drop-zone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
        .drop-zone.disabled input[type="file"] { cursor: not-allowed; }

        .upload-drop-icon {
            position: relative;
            width: 58px;
            height: 58px;
            display: grid;
            place-items: center;
            margin-bottom: 12px;
            border: 1px solid #f6e4ec;
            border-radius: 18px;
            color: var(--primary);
            background: linear-gradient(145deg, #fbf3f7, #ffffff);
            box-shadow: 0 12px 28px rgba(178,71,119,.12);
            animation: uploadIconFloat 3.4s ease-in-out infinite;
        }
        .upload-drop-icon::before {
            content: '';
            position: absolute;
            inset: -9px;
            z-index: -1;
            border-radius: 24px;
            border: 1px solid rgba(178,71,119,.15);
            animation: uploadHalo 2.8s ease-in-out infinite;
        }
        .drop-zone.dragover .upload-drop-icon { animation-duration: 1.2s; }
        .drop-zone-title { color: #21141a; font-size: .98rem; font-weight: 760; letter-spacing: -.01em; }
        .drop-zone-text { color: var(--text-muted); font-size: .82rem; font-weight: 500; margin-top: 6px; }
        .drop-zone-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 13px; }
        .drop-zone-hint {
            padding: 5px 8px;
            border: 1px solid #ede6e9;
            border-radius: 999px;
            background: rgba(255,255,255,.8);
            color: #826d77;
            font-size: .69rem;
            font-weight: 650;
        }

        .progress-wrapper {
            --upload-progress: 0%;
            display: none;
            position: relative;
            overflow: hidden;
            padding: 20px;
            border: 1px solid #ebe0e5;
            border-radius: 18px;
            background: linear-gradient(145deg, #ffffff, #fdfafb);
            box-shadow: 0 12px 34px rgba(33,20,26,.06);
        }
        .progress-wrapper.is-visible { display: block; animation: uploadPanelIn .34s cubic-bezier(.2,.75,.3,1) both; }
        .progress-wrapper.is-complete { border-color: #bbf7d0; background: linear-gradient(145deg, #ffffff, #f0fdf4); }
        .progress-wrapper::after {
            content: '';
            position: absolute;
            width: 240px;
            height: 240px;
            right: -110px;
            top: -130px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(178,71,119,.075), transparent 68%);
            pointer-events: none;
        }

        .upload-progress-top {
            position: relative;
            z-index: 1;
            display: grid;
            grid-template-columns: 76px minmax(0, 1fr);
            gap: 16px;
            align-items: center;
        }
        .upload-progress-ring {
            --upload-progress: 0%;
            position: relative;
            width: 72px;
            height: 72px;
            display: grid;
            place-items: center;
            border-radius: 50%;
            background: conic-gradient(var(--primary) var(--upload-progress), #f3ebef 0);
            box-shadow: inset 0 0 0 1px rgba(176,157,165,.10), 0 8px 22px rgba(178,71,119,.08);
            transition: background .12s linear;
        }
        .upload-progress-ring::after {
            content: '';
            position: absolute;
            inset: 7px;
            border-radius: inherit;
            background: #fff;
            box-shadow: 0 1px 4px rgba(33,20,26,.08);
        }
        .upload-progress-ring-value { position: relative; z-index: 1; color: #21141a; font-size: .86rem; font-weight: 820; }
        .progress-wrapper.is-complete .upload-progress-ring { background: conic-gradient(#10b981 100%, #dcfce7 0); animation: uploadSuccessPop .45s ease both; }

        .upload-progress-copy { min-width: 0; }
        .upload-status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
        .upload-status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--primary); animation: uploadStatusPulse 1.6s ease-in-out infinite; }
        .progress-wrapper.is-complete .upload-status-dot { background: #10b981; animation: none; }
        .upload-status-label { color: #4d3b43; font-size: .75rem; font-weight: 760; text-transform: uppercase; letter-spacing: .055em; }
        .upload-current-name { overflow: hidden; color: #21141a; font-size: 1rem; font-weight: 760; white-space: nowrap; text-overflow: ellipsis; }
        .upload-current-meta { margin-top: 5px; color: #826d77; font-size: .76rem; }

        .upload-progress-block { margin-top: 18px; }
        .upload-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #826d77; font-size: .73rem; font-weight: 650; }
        .upload-progress-row strong { color: #4d3b43; font-weight: 760; }
        .progress-container { width: 100%; height: 9px; overflow: hidden; border-radius: 999px; background: #f3ecef; box-shadow: inset 0 1px 2px rgba(33,20,26,.05); }
        .progress-container.is-secondary { height: 6px; background: #f5f0f2; }
        .progress-bar { position: relative; width: 0%; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(90deg, #b24777, #c86591, #b24777); background-size: 200% 100%; transition: width .12s linear; }
        .progress-bar::after { content: ''; position: absolute; inset: 0; width: 34%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.48), transparent); animation: progressSweep 1.2s linear infinite; }
        .progress-wrapper.is-complete .progress-bar { background: #10b981; }
        .progress-wrapper.is-complete .progress-bar::after { display: none; }

        .upload-stats-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 8px;
            margin-top: 16px;
        }
        .upload-stat {
            min-width: 0;
            padding: 10px 11px;
            border: 1px solid #f0e9ec;
            border-radius: 11px;
            background: rgba(251,249,250,.84);
        }
        .upload-stat-label { display: block; margin-bottom: 3px; color: #b09da5; font-size: .64rem; font-weight: 760; text-transform: uppercase; letter-spacing: .045em; }
        .upload-stat-value { display: block; overflow: hidden; color: #33242b; font-size: .79rem; font-weight: 760; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

        .upload-queue {
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 100%;
            min-width: 0;
            max-height: 170px;
            margin-top: 15px;
            padding-top: 13px;
            overflow-x: hidden;
            overflow-y: auto;
            border-top: 1px solid #f2ecef;
            scrollbar-width: thin;
        }
        .upload-queue-item {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
            display: grid;
            grid-template-columns: 28px minmax(0, 1fr) auto;
            gap: 9px;
            align-items: center;
            padding: 7px 8px;
            border-radius: 9px;
            color: #826d77;
            transition: background .18s ease, color .18s ease, transform .18s ease;
        }
        .upload-queue-item.is-active { background: #fbf3f7; color: #923f65; animation: uploadQueueActive 1.8s ease-in-out infinite; }
        .upload-queue-item.is-done { color: #15803d; background: #f0fdf4; }
        .upload-queue-state { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #ede6e9; border-radius: 8px; background: #fff; font-size: .67rem; font-weight: 800; }
        .upload-queue-item.is-active .upload-queue-state { border-color: #f0d0de; }
        .upload-queue-item.is-done .upload-queue-state { border-color: #bbf7d0; color: #15803d; }
        .upload-queue-file { min-width: 0; }
        .upload-queue-name { overflow: hidden; color: #4d3b43; font-size: .75rem; font-weight: 680; white-space: nowrap; text-overflow: ellipsis; }
        .upload-queue-item.is-active .upload-queue-name { color: #923f65; }
        .upload-queue-item.is-done .upload-queue-name { color: #15803d; }
        .upload-queue-size { margin-top: 2px; color: #b09da5; font-size: .65rem; }
        .upload-queue-status { min-width: 0; max-width: 92px; overflow: hidden; color: currentColor; font-size: .66rem; font-weight: 720; white-space: nowrap; text-overflow: ellipsis; }
        .upload-queue-item.is-cancelled { color: #b45309; background: #fff7ed; }
        .upload-queue-item.is-cancelled .upload-queue-state { border-color: #fed7aa; color: #b45309; }
        .upload-actions { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 11px; border-top: 1px solid #f2ecef; }
        .upload-cancel-button {
            min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
            border: 1px solid #f0b9b9; border-radius: 9px; background: #fff; color: #b42318;
            font: inherit; font-size: .78rem; font-weight: 720; cursor: pointer; transition: background .15s ease, border-color .15s ease, opacity .15s ease;
        }
        .upload-cancel-button:hover { background: #fff1f0; border-color: #e99a95; }
        .upload-cancel-button:disabled { opacity: .48; cursor: default; }

        @media (max-width: 700px) {
            .upload-progress-top { grid-template-columns: 62px minmax(0, 1fr); gap: 12px; }
            .upload-progress-ring { width: 60px; height: 60px; }
            .upload-progress-ring::after { inset: 6px; }
            .upload-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .progress-wrapper { padding: 16px; }
            .drop-zone { min-height: 164px; padding: 24px 14px; }
        }

        .section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--text-main); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
        
        /* ORDNER LISTE */
        .folders-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; width: 100%; }
        .folder-row {
            background: #fbf9fa; border: 1px solid var(--border-light); border-radius: var(--radius-box);
            padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
            transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease; animation: fadeInUp 0.3s ease forwards;
            content-visibility: auto; contain-intrinsic-size: 70px;
        }
        .folder-row:hover { border-color: var(--border); background: #f7f3f5; }
        .folder-main-btn { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text-main); flex-grow: 1; overflow: hidden; touch-action: manipulation; }
        .folder-row-icon { width: 44px; height: 44px; background: transparent; border: none; display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
        .folder-row-title { font-weight: 700; font-size: 1.05rem; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        /* GRID LAYOUT */
        .drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; width: 100%; }
        .card {
            background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-box);
            overflow: hidden; display: flex; flex-direction: column; position: relative; box-shadow: 0 2px 6px rgba(0,0,0,0.03); 
            transition: transform 0.2s ease, box-shadow 0.2s ease; animation: fadeInUp 0.35s ease forwards;
            content-visibility: auto; contain-intrinsic-size: 280px;
        }
        .card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,0.08); }
        .media-preview-box { width: 100%; aspect-ratio: 1 / 1; background-color: #21141a; position: relative; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
        .media-preview-box img, .media-preview-box video, .media-preview-box canvas { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
        .card:hover .media-preview-box img, .card:hover .media-preview-box video, .card:hover .media-preview-box canvas { transform: scale(1.05); }
        .file-icon-box { width: 100%; aspect-ratio: 1 / 1; background: #fbf9fa; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
        .card-footer { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: #fff; border-top: 1px solid var(--border-light); }
        .card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .card-meta { font-size: 0.78rem; color: var(--text-muted); }

        /* LISTEN LAYOUT */
        .file-list { border: 1px solid var(--border-light); border-radius: var(--radius-box); overflow: hidden; width: 100%; }
        .file-item {
            background: var(--surface); border-bottom: 1px solid var(--border-light); padding: 12px 16px;
            display: flex; align-items: center; justify-content: space-between; gap: 12px; transition: background 0.2s;
            animation: fadeInUp 0.25s ease forwards;
            content-visibility: auto; contain-intrinsic-size: 82px;
        }
        .file-item:last-child { border-bottom: none; }
        .file-item:hover { background: #fbf9fa; }
        .list-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); flex-shrink: 0; background-color: #000; cursor: pointer; }
        .pdf-thumb { object-fit: contain !important; object-position: center !important; background: #fbf9fa !important; }
        html[data-theme="dark"] .pdf-thumb { background: #e9e6e8 !important; }
        .drive-main-content.is-dateien-context .list-thumb.pdf-thumb { width: 88px; height: 116px; }
        .list-canvas-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); flex-shrink: 0; background-color: #fff; cursor: pointer; }
        .list-icon-box { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: #fbf9fa; border: 1px solid var(--border-light); border-radius: 8px; color: var(--text-muted); flex-shrink: 0; }
        .list-file-info { overflow: hidden; flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
        .list-file-name { font-weight: 600; font-size: 0.95rem; color: var(--text-main); word-break: break-all; }
        .list-file-meta { font-size: 0.8rem; color: var(--text-muted); }

        /* Actions */
        .floating-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 5; }
        .card-footer { position: relative; display: flex; align-items: center; gap: 10px; }
        .card-footer-copy { min-width: 0; flex: 1; }
        .card-more-menu { position: relative; flex: 0 0 auto; }
        .card-more-menu > summary { list-style: none; padding: 6px 8px; border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: .78rem; font-weight: 700; user-select: none; }
        .card-more-menu > summary::-webkit-details-marker { display: none; }
        .card-more-menu[open] > summary, .card-more-menu > summary:hover { background: #f7f3f5; color: var(--text-main); }
        .card-more-popover { position: absolute; right: 0; bottom: calc(100% + 6px); min-width: 150px; padding: 6px; border: 1px solid var(--border-light); border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(33,20,26,.18); z-index: 20; }
        .card-more-popover a, .card-more-popover button { width: 100%; min-height: 36px; padding: 7px 9px; display: flex; align-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-main); text-decoration: none; font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
        .card-more-popover a:hover, .card-more-popover button:hover { background: #f7f3f5; }
        .card-more-popover button { color: var(--danger); }
        .actions-inline { display: flex; gap: 8px; flex-shrink: 0; }
        .quick-action-btn {
            background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(4px); color: var(--text-main);
            border: 1px solid rgba(0, 0, 0, 0.1); width: 38px; height: 38px; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: all 0.2s; touch-action: manipulation; cursor: pointer;
            flex-shrink: 0;
        }
        .quick-action-btn:active { transform: scale(0.92); }
        .quick-action-delete:active, .quick-action-delete:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

        .list-action-btn {
            color: var(--text-muted); width: 42px; height: 42px; border-radius: var(--radius-btn);
            display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
            border: 1px solid var(--border-light); background: var(--surface); transition: all 0.2s; touch-action: manipulation; cursor: pointer;
            flex-shrink: 0;
        }

        .empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); font-size: 0.95rem; background: #fbf9fa; border-radius: var(--radius-box); border: 1px dashed var(--border); }

        /* FLOATING BACK-TO-TOP BUTTON */
        .back-to-top-btn {
            position: fixed; bottom: 24px; right: 24px; width: 48px; height: 48px; border-radius: 50%;
            background: var(--primary); color: #ffffff; border: none; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.30);
            display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 1; visibility: visible;
            transition: transform .18s ease, box-shadow .18s ease, background .18s ease; z-index: 999; touch-action: manipulation;
        }
        .back-to-top-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0, 0, 0, 0.28); }
        .back-to-top-btn:active { transform: scale(.96); }
        /* Auf allen Drive-Seiten dauerhaft am Viewport; im geöffneten Chat bewusst ausblenden. */
        body.chat-open .back-to-top-btn { display: none !important; }

        /* Modals & Dialogs */
        .modal {
            display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
            background-color: rgba(33, 20, 26, 0.52); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); align-items: center; justify-content: center; padding: 16px;
        }
        .modal[style*="display: flex"] > * { animation: fadeInUp .22s ease both; }
        .modal-content { max-width: 100%; max-height: 85vh; border-radius: var(--radius-box); box-shadow: 0 10px 25px rgba(0,0,0,0.5); outline: none; }
        .pdf-modal-wrapper { width: 92%; height: 85vh; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
        .pdf-external-btn { background: rgba(255, 255, 255, 0.2); color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); padding: 8px 16px; border-radius: var(--radius-btn); text-decoration: none; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
        .modal-pdf-frame { width: 100%; height: 100%; border-radius: var(--radius-box); background: #ffffff; border: none; }

        .modal-nav-btn {
            position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.22);
            backdrop-filter: blur(6px); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.35); width: 48px; height: 48px;
            border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10002;
        }
        .modal-prev { left: 12px; }
        .modal-next { right: 12px; }

        /* Medienviewer: echte feste Viewport-Bühne ohne Seiten-Scrollen. */
        body.media-open {
            position: fixed; left: 0; right: 0; width: 100%; overflow: hidden !important; overscroll-behavior: none;
        }
        /* pageReveal lässt sonst dauerhaft einen transform auf .app-container stehen.
           Dadurch würde position:fixed am Container statt am Browserfenster hängen und vom Container abgeschnitten. */
        body.media-open .app-container {
            animation: none !important; transform: none !important; overflow: visible !important;
        }
        #mediaModal {
            position: fixed; inset: 0; z-index: 14000; width: 100vw; height: 100vh; height: 100dvh;
            padding: 0; overflow: hidden !important; align-items: stretch; justify-content: stretch;
            background: #050505; backdrop-filter: none; -webkit-backdrop-filter: none;
            user-select: none; overscroll-behavior: none;
        }
        #mediaModal[style*="display: flex"] > * { animation: none !important; }
        .media-stage {
            position: absolute; inset: 72px clamp(28px, 4vw, 76px) 28px; min-width: 0; min-height: 0;
            display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none;
        }
        /* Medien werden nur verkleinert, niemals künstlich auf die komplette Bühne gestreckt.
           So bleibt rundherum Luft und das gesamte Bild ist trotzdem immer sichtbar. */
        #mediaModal #modalImg,
        #mediaModal #modalVideo {
            width: auto !important; height: auto !important;
            max-width: min(88vw, 1440px) !important;
            max-height: 80vh !important; max-height: 80dvh !important;
            margin: 0; object-fit: contain !important; object-position: center center;
            border-radius: 4px; box-shadow: 0 8px 32px rgba(0,0,0,.28); background: transparent; pointer-events: auto;
        }
        #mediaModal #modalImg {
            display: block; border: 0; background: #050505 !important; color: transparent; font-size: 0;
        }
        #mediaModal #modalImg.is-awaiting-first-frame { visibility: hidden; }
        #mediaModal .pdf-modal-wrapper {
            width: 100%; height: 100%; min-width: 0; min-height: 0; padding: 0; gap: 8px;
            align-items: stretch; pointer-events: auto;
        }
        #mediaModal .pdf-external-btn { align-self: flex-end; flex: 0 0 auto; }
        #mediaModal .modal-pdf-frame { min-height: 0; flex: 1; border-radius: 6px; }
        #mediaModal .modal-close-btn, #mediaModal .media-modal-download, #mediaModal .modal-nav-btn {
            background: rgba(25,24,25,.94); border: 1px solid rgba(255,255,255,.18); color: #fff; box-shadow: none;
            backdrop-filter: none; -webkit-backdrop-filter: none;
        }
        #mediaModal .modal-close-btn { position: absolute; top: 14px; left: 14px; right: auto; width: 44px; height: 44px; }
        #mediaModal .modal-nav-btn { position: absolute; top: 50%; width: 46px; height: 46px; opacity: .95; touch-action: manipulation; }
        #mediaModal .modal-prev { left: 12px; }
        #mediaModal .modal-next { right: 12px; }
        .media-modal-meta {
            position: absolute; z-index: 10002; top: 14px; left: 70px; right: 70px; height: 44px; min-width: 0;
            display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; pointer-events: none;
        }
        .media-modal-name { max-width: min(66vw, 880px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 650; }
        .media-modal-count { color: rgba(255,255,255,.66); font-size: .78rem; white-space: nowrap; }
        .media-modal-download {
            position: absolute; z-index: 10003; top: 14px; right: 14px; width: 44px; height: 44px; display: grid; place-items: center;
            border-radius: 50%; text-decoration: none; touch-action: manipulation;
        }

        .confirm-modal-box {
            background: #fff; border-radius: 16px; padding: 24px; max-width: 440px; width: 100%;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 16px; animation: fadeInUp 0.25s ease forwards;
        }
        .confirm-icon { width: 56px; height: 56px; background: var(--danger-bg); color: var(--danger); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
        .confirm-title { font-weight: 700; font-size: 1.15rem; color: var(--text-main); text-align: center; }
        .confirm-desc { font-size: 0.9rem; color: var(--text-muted); word-break: break-all; text-align: center; }
        .confirm-buttons { display: flex; gap: 10px; margin-top: 8px; }
        .confirm-buttons button, .confirm-buttons a { flex: 1; text-decoration: none; }

        /* Benutzerverwaltung: eigenständiges Dialog-Layout statt enger Tabellenbox. */
        .admin-modal { padding: clamp(16px, 4vw, 44px); }
        .admin-dialog {
            width: min(760px, 100%); max-height: min(820px, calc(100dvh - 48px)); overflow: hidden;
            display: flex; flex-direction: column; border: 1px solid var(--border-light); border-radius: 20px;
            background: var(--surface); color: var(--text-main); box-shadow: 0 30px 90px rgba(33,20,26,.28);
        }
        .admin-dialog-header { min-height: 82px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border-light); }
        .admin-dialog-title-group { min-width: 0; display: flex; align-items: center; gap: 13px; }
        .admin-dialog-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #faeef4; color: #b24777; }
        .admin-dialog-title-group h2 { margin: 0; font-size: 1.13rem; line-height: 1.25; letter-spacing: -.015em; }
        .admin-dialog-title-group p { margin: 4px 0 0; color: var(--text-muted); font-size: .84rem; line-height: 1.4; }
        .admin-close-button { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--border-light); border-radius: 11px; background: var(--surface); color: var(--text-muted); cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
        .admin-close-button:hover { background: #f7f3f5; border-color: var(--border); color: var(--text-main); }
        .admin-dialog-body { min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; overscroll-behavior: contain; }
        .admin-section-heading { margin-bottom: 10px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
        .admin-section-heading h3, .admin-add-copy h3 { margin: 0; color: var(--text-main); font-size: .96rem; letter-spacing: -.01em; }
        .admin-section-heading p, .admin-add-copy p { margin: 4px 0 0; color: var(--text-muted); font-size: .8rem; line-height: 1.45; }
        .admin-user-list { overflow: hidden; border: 1px solid var(--border-light); border-radius: 14px; background: var(--surface); }
        .admin-user-row { min-height: 66px; padding: 10px 12px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto minmax(104px, auto); align-items: center; gap: 12px; border-bottom: 1px solid var(--border-light); }
        .admin-user-row:last-child { border-bottom: 0; }
        .admin-user-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #c86591, #b24777); color: #fff; font-size: .82rem; font-weight: 800; }
        .admin-user-copy { min-width: 0; }
        .admin-user-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); font-size: .9rem; }
        .admin-user-copy span { display: block; margin-top: 3px; color: var(--text-muted); font-size: .76rem; }
        .admin-role-badge { min-height: 27px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: .72rem; font-weight: 750; }
        .admin-role-badge.is-admin { background: #f9ecf2; color: #8c4364; }
        .admin-role-badge.is-user { background: #f7f3f5; color: #6b5a62; }
        .admin-user-action { min-width: 0; display: flex; justify-content: flex-end; }
        .admin-delete-user { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #dc2626; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
        .admin-delete-user:hover { background: #fef2f2; }
        .admin-current-user { color: var(--text-muted); font-size: .76rem; white-space: nowrap; }
        .admin-add-panel { padding: 17px; border: 1px solid var(--border-light); border-radius: 15px; background: #fbf9fa; }
        .admin-add-copy { margin-bottom: 14px; }
        .admin-add-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px; gap: 10px; align-items: end; }
        .admin-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
        .admin-field > span { color: var(--text-muted); font-size: .74rem; font-weight: 700; }
        .admin-field input, .admin-field select { min-height: 44px; padding: 9px 11px; border-radius: 10px; font-size: 16px !important; }
        .admin-create-user { grid-column: 1 / -1; min-height: 44px; justify-self: flex-start; padding: 0 16px; border-radius: 10px; }
        @media (max-width: 640px) {
            .admin-modal { padding: 8px; align-items: flex-end; }
            .admin-dialog { width: 100%; max-height: calc(100dvh - 8px); border-radius: 18px 18px 0 0; }
            .admin-dialog-header { min-height: 72px; padding: 14px; }
            .admin-dialog-icon { width: 38px; height: 38px; border-radius: 11px; }
            .admin-dialog-title-group p { display: none; }
            .admin-dialog-body { padding: 14px; gap: 18px; }
            .admin-user-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; padding: 10px; }
            .admin-user-avatar { width: 38px; height: 38px; }
            .admin-user-action { grid-column: 2 / -1; justify-content: flex-start; margin-top: -3px; }
            .admin-add-panel { padding: 14px; }
            .admin-add-form { grid-template-columns: 1fr; }
            .admin-role-field { max-width: none; }
            .admin-create-user { width: 100%; justify-self: stretch; }
        }

        .modal-close-btn { 
            position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, 0.2); color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.3); width: 44px; height: 44px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10001;
        }

        /* Integrierter Direkt-Chat */
        .header-chat-slot {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-left: 6px;
            padding-left: 14px;
            border-left: 1px solid var(--border-light);
        }
        .chat-nav-button {
            position: relative;
            min-height: 40px;
            padding: 0 15px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex: 0 0 auto;
            border: 1px solid #923f65;
            border-radius: 13px;
            background: linear-gradient(135deg, #b24777 0%, #9a496d 58%, #96417a 100%);
            color: #fff;
            box-shadow: 0 6px 16px rgba(178, 71, 119, .24), inset 0 1px 0 rgba(255, 255, 255, .18);
            font: inherit;
            font-size: .86rem;
            font-weight: 800;
            letter-spacing: -.01em;
            cursor: pointer;
            touch-action: manipulation;
            transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
        }
        .chat-nav-button svg { flex: 0 0 auto; }
        .chat-nav-button:hover {
            transform: translateY(-1px);
            filter: brightness(1.05);
            box-shadow: 0 9px 20px rgba(178, 71, 119, .30), inset 0 1px 0 rgba(255, 255, 255, .22);
        }
        .chat-nav-button:active { transform: translateY(0) scale(.98); }
        .chat-nav-button:focus-visible {
            outline: 3px solid rgba(215, 140, 174, .38);
            outline-offset: 3px;
        }
        .chat-nav-label { line-height: 1; white-space: nowrap; }
        .chat-unread-badge {
            position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
            border: 2px solid #fff; border-radius: 999px; background: #ef4444; color: #fff;
            display: none; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; line-height: 1;
        }
        .chat-unread-badge.is-visible { display: inline-flex; }
        /* ZENTRALES FUNKTIONSMENÜ */
        body.feature-menu-open { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; }
        body.feature-menu-open .back-to-top-btn { display: none !important; }
        .feature-menu-shell { position: fixed; inset: 0; z-index: 12400; display: none; background: rgba(33,20,26,.54); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
        .feature-menu-shell.is-open { display: block; }
        .feature-menu-drawer { width: min(360px,calc(100vw - 30px)); height: 100%; display: flex; flex-direction: column; background: #fff; box-shadow: 18px 0 60px rgba(33,20,26,.28); animation: featureMenuIn .2s ease both; }
        @keyframes featureMenuIn { from { transform: translateX(-22px); opacity: .82; } to { transform: translateX(0); opacity: 1; } }
        .feature-menu-head { min-height: 74px; padding: 14px 14px 14px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #ede7ea; }
        .feature-menu-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #f9ecf2; color: #9e4d71; }
        .feature-menu-title { min-width: 0; flex: 1; }
        .feature-menu-title strong { display: block; color: #2a1c22; font-size: 1rem; }
        .feature-menu-title span { display: block; margin-top: 2px; color: #9a8b92; font-size: .72rem; }
        .feature-menu-close { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #e9e0e4; border-radius: 12px; background: #fff; color: #6e5b63; cursor: pointer; }
        .feature-menu-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
        .feature-menu-item { width: 100%; min-height: 55px; padding: 9px 12px; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #423038; text-align: left; font: inherit; cursor: pointer; }
        .feature-menu-item:hover { border-color: #eee2e7; background: #faf7f8; }
        .feature-menu-item-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #f7f1f4; color: #785565; }
        .feature-menu-item.is-board .feature-menu-item-icon { background: #faeef4; color: #b24777; }
        .feature-menu-item.is-recipes .feature-menu-item-icon { background: #faeef4; color: #b24777; }
        .feature-menu-item.is-stories .feature-menu-item-icon { background: #faeef4; color: #b24777; }
        .feature-menu-item.is-chat .feature-menu-item-icon { background: #f9ecf2; color: #9e4d71; }
        .feature-menu-item-copy { min-width: 0; flex: 1; }
        .feature-menu-item-copy strong { display: block; font-size: .88rem; }
        .feature-menu-item-copy span { display: block; margin-top: 2px; overflow: hidden; color: #9a8b92; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
        .feature-menu-badge { min-width: 21px; height: 21px; padding: 0 6px; display: none; place-items: center; border-radius: 999px; background: #ef4444; color: #fff; font-size: .66rem; font-weight: 850; }
        .feature-menu-badge.is-visible { display: grid; }
        .feature-menu-foot { margin-top: auto; padding: 12px 18px max(16px,env(safe-area-inset-bottom)); border-top: 1px solid #f2eff0; color: #9f9198; font-size: .68rem; }
        html[data-theme="dark"] .feature-menu-drawer { background: #1c1619; }
        html[data-theme="dark"] .feature-menu-head, html[data-theme="dark"] .feature-menu-foot { border-color: #382e33; }
        html[data-theme="dark"] .feature-menu-title strong, html[data-theme="dark"] .feature-menu-item { color: #f2eaee; }
        html[data-theme="dark"] .feature-menu-close, html[data-theme="dark"] .feature-menu-item-icon { background: #2a2025; border-color: #483b41; color: #c4b5bc; }
        html[data-theme="dark"] .feature-menu-item:hover { border-color: #4b3b42; background: #281f23; }
        /* GEMEINSAME GESCHICHTEN-BIBLIOTHEK */
        body.story-open { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
        body.story-open .app-container { animation: none !important; transform: none !important; }
        body.story-open .back-to-top-btn { display: none !important; }
        .story-shell {
            position: fixed; inset: 0; z-index: 12700; display: none; align-items: center; justify-content: center;
            padding: 16px; overflow: hidden; background: rgba(33,20,26,.62); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
        }
        .story-shell.is-open { display: flex; animation: fadeInUp .2s ease both; }
        .story-window {
            position: relative; width: min(1500px,calc(100vw - 32px)); height: min(960px,calc(100dvh - 32px)); min-height: min(650px,calc(100dvh - 32px));
            display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 16px;
            background: #fdf8fa; box-shadow: 0 28px 90px rgba(0,0,0,.42);
        }
        .story-header { min-height: 68px; padding: 11px 14px 11px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #ede1e6; background: rgba(255,255,255,.94); }
        .story-header-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: #faeef4; color: #b24777; }
        .story-header-copy { min-width: 0; flex: 1; }
        .story-header-copy h2 { margin: 0; color: #21141a; font-size: 1.12rem; }
        .story-header-copy p { margin: 3px 0 0; color: #826d77; font-size: .76rem; }
        .story-close, .story-back {
            width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #eadee3; border-radius: 12px;
            background: #fff; color: #6e5b63; cursor: pointer; -webkit-tap-highlight-color: transparent;
        }
        .story-back { display: none; }
        .story-close:hover, .story-back:hover { background: #fdf8fa; color: #512f3e; }
        .story-close:focus, .story-back:focus, .story-tool-button:focus, .story-list-item:focus, .story-series-summary:focus, .story-series-chapter:focus, .story-reader-action:focus, .story-reader-chapter-link:focus, .story-editor-button:focus { outline: none; }
        .story-close:focus-visible, .story-back:focus-visible, .story-tool-button:focus-visible, .story-list-item:focus-visible, .story-series-summary:focus-visible, .story-series-chapter:focus-visible, .story-reader-action:focus-visible, .story-reader-chapter-link:focus-visible, .story-editor-button:focus-visible { box-shadow: 0 0 0 3px rgba(178,71,119,.22); }
        .story-content { min-width: 0; min-height: 0; flex: 1; display: grid; grid-template-columns: 350px minmax(0,1fr); }
        .story-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #ede1e6; background: #fff; }
        .story-sidebar-tools { padding: 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid #f2ebee; }
        .story-sidebar-tools > .story-search:only-child { grid-column: 1 / -1; }
        .story-search { min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #eadee3; border-radius: 11px; background: #fdf9fb; color: #8d7a82; }
        .story-search:focus-within { border-color: #daa2bb; box-shadow: 0 0 0 3px rgba(178,71,119,.09); }
        .story-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #2a1c22; font: inherit; font-size: .88rem; }
        .story-tool-button { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 11px; background: #b24777; color: #fff; font: inherit; font-size: .78rem; font-weight: 780; cursor: pointer; }
        .story-list { min-height: 0; padding: 8px; flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
        .story-list-item { width: 100%; margin: 0 0 6px; padding: 12px; display: block; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #2a1c22; text-align: left; font: inherit; cursor: pointer; }
        .story-list-item:hover { border-color: #f0e2e9; background: #fdf8fa; }
        .story-list-item.is-active { border-color: #e8cad7; background: #fbf1f5; box-shadow: inset 3px 0 0 #b24777; }
        .story-list-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; line-height: 1.3; }
        .story-list-preview { margin-top: 5px; display: -webkit-box; overflow: hidden; color: #837179; font-size: .74rem; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
        .story-list-meta { margin-top: 7px; display: flex; align-items: center; gap: 6px; color: #a3929a; font-size: .75rem; }
        .story-series { margin: 0 0 8px; overflow: hidden; border: 1px solid #f0e2e9; border-radius: 14px; background: #fff; }
        .story-series-summary { min-height: 72px; padding: 12px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; color: #2a1c22; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
        .story-series-summary::-webkit-details-marker { display: none; }
        .story-series-summary-copy { min-width: 0; }
        .story-series-summary-copy strong { display: block; font-size: .98rem; line-height: 1.28; }
        .story-series-summary-copy span { display: block; margin-top: 5px; color: #837179; font-size: .75rem; line-height: 1.35; }
        .story-series-chevron { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #faeef4; color: #b24777; font-size: 1.15rem; font-weight: 850; transition: transform .18s ease; }
        .story-series[open] .story-series-chevron { transform: rotate(90deg); }
        .story-series-chapters { padding: 5px 6px 8px; border-top: 1px solid #f2ebee; }
        .story-series-act { padding: 5px 0 1px; }
        .story-series-act + .story-series-act { margin-top: 4px; border-top: 1px solid #f6f0f3; }
        .story-series-act-heading { padding: 7px 8px 5px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #745764; }
        .story-series-act-heading strong { font-size: .76rem; letter-spacing: .025em; text-transform: uppercase; }
        .story-series-act-heading span { color: #a3929a; font-size: .7rem; white-space: nowrap; }
        .story-series-chapter { width: 100%; min-height: 58px; padding: 7px 8px; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #423038; text-align: left; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
        .story-series-chapter:hover { background: #fdf8fa; }
        .story-series-chapter.is-active { border-color: #e8cad7; background: #fbf1f5; box-shadow: inset 3px 0 0 #b24777; }
        .story-series-chapter-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #faeef4; color: #b24777; font-size: .76rem; font-weight: 850; }
        .story-series-chapter-copy { min-width: 0; }
        .story-series-chapter-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; line-height: 1.25; }
        .story-series-chapter-copy span { display: block; margin-top: 4px; overflow: hidden; color: #94838b; font-size: .72rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
        .story-list-empty, .story-loading { padding: 34px 18px; color: #96858d; text-align: center; font-size: .82rem; line-height: 1.5; }
        .story-main { --story-font-size: 19px; position: relative; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fefcfd; scroll-behavior: smooth; }
        .story-welcome { min-height: 100%; padding: 40px; display: grid; place-items: center; text-align: center; }
        .story-welcome > div { max-width: 440px; }
        .story-welcome-mark { width: 74px; height: 74px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 24px; background: #faeef4; color: #b24777; font-size: 2rem; }
        .story-welcome strong { display: block; color: #2a1c22; font-family: Georgia,'Times New Roman',serif; font-size: 1.55rem; }
        .story-welcome span { display: block; margin-top: 9px; color: #88777f; font-size: .86rem; line-height: 1.55; }
        .story-reader-toolbar { position: sticky; top: 0; z-index: 3; min-height: 48px; padding: 6px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 7px; border-bottom: 1px solid rgba(237,225,230,.95); background: rgba(254,252,253,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
        .story-reader-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; background: transparent; }
        .story-reader-progress span { width: 0; height: 100%; display: block; background: #b24777; transition: width .1s linear; }
        .story-reader-action { min-width: 44px; height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #eadee3; border-radius: 10px; background: #fff; color: #6e5b63; font: inherit; font-size: .75rem; font-weight: 720; cursor: pointer; }
        .story-reader-action.is-edit { margin-left: 3px; color: #b24777; }
        .story-reader-action:disabled { opacity: .38; cursor: default; }
        .story-reader-sequence { margin-right: auto; display: flex; align-items: center; gap: 7px; }
        .story-reader { width: min(820px,100%); margin: 0 auto; padding: 54px clamp(28px,6vw,76px) 120px; }
        .story-reader-kicker { color: #a05a7a; font-size: .72rem; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
        .story-reader h1 { margin: 13px 0 12px; color: #21141a; font-family: Georgia,'Times New Roman',serif; font-size: clamp(2rem,4.2vw,3.35rem); font-weight: 700; line-height: 1.08; letter-spacing: -.025em; }
        .story-reader-meta { padding-bottom: 25px; border-bottom: 1px solid #eee2e7; color: #9d8c94; font-size: .75rem; }
        .story-reader-text { padding-top: 31px; color: #3d2d34; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Georgia,'Times New Roman',serif; font-size: var(--story-font-size); line-height: 1.82; hyphens: auto; -webkit-hyphens: auto; }
        .story-reader-chapter-nav { margin-top: 58px; padding-top: 22px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; border-top: 1px solid #eee2e7; }
        .story-reader-chapter-link { min-width: 0; min-height: 68px; padding: 11px 13px; display: flex; flex-direction: column; justify-content: center; border: 1px solid #eadee3; border-radius: 12px; background: #fff; color: #512f3e; text-align: left; font: inherit; cursor: pointer; }
        .story-reader-chapter-link.is-next { grid-column: 2; text-align: right; }
        .story-reader-chapter-link span { color: #96858d; font-size: .7rem; font-weight: 720; }
        .story-reader-chapter-link strong { margin-top: 4px; overflow: hidden; font-size: .82rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
        .story-reader-chapter-link:disabled { display: none; }
        .story-editor { width: min(920px,100%); min-height: 100%; margin: 0 auto; padding: 34px clamp(20px,5vw,58px) 80px; }
        .story-editor-card { padding: 24px; border: 1px solid #eee2e7; border-radius: 16px; background: #fff; box-shadow: 0 12px 34px rgba(178,71,119,.07); }
        .story-editor-card h3 { margin: 0 0 5px; color: #2a1c22; font-size: 1.08rem; }
        .story-editor-card > p { margin: 0 0 18px; color: #8e7c84; font-size: .78rem; }
        .story-field { display: block; margin-top: 13px; }
        .story-field > span { display: block; margin-bottom: 6px; color: #6e5b63; font-size: .73rem; font-weight: 760; }
        .story-field input, .story-field textarea { width: 100%; padding: 11px 12px; border: 1px solid #eadee3; border-radius: 11px; outline: 0; background: #fefcfd; color: #2a1c22; font: inherit; font-size: .92rem; }
        .story-field textarea { min-height: 420px; resize: vertical; font-family: Georgia,'Times New Roman',serif; line-height: 1.65; }
        .story-field input:focus, .story-field textarea:focus { border-color: #d79cb6; box-shadow: 0 0 0 3px rgba(178,71,119,.09); background: #fff; }
        .story-editor-count { margin-top: 6px; color: #9d8c94; font-size: .68rem; text-align: right; }
        .story-editor-actions { margin-top: 18px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
        .story-editor-button { min-height: 40px; padding: 0 15px; border: 1px solid #eadee3; border-radius: 10px; background: #fff; color: #6e5b63; font: inherit; font-size: .78rem; font-weight: 760; cursor: pointer; }
        .story-editor-button.is-primary { border-color: #b24777; background: #b24777; color: #fff; }
        .story-editor-button.is-delete { margin-right: auto; border-color: #f1c8c8; color: #a73535; }
        .story-editor-button:disabled { opacity: .82; cursor: wait; }
        .story-toast { position: absolute; left: 50%; bottom: 24px; z-index: 5; display: none; max-width: calc(100% - 30px); padding: 9px 13px; transform: translateX(-50%); border-radius: 999px; background: #2a1c22; color: #fff; font-size: .76rem; box-shadow: 0 9px 25px rgba(33,20,26,.25); }
        .story-toast.is-visible { display: block; animation: fadeInUp .18s ease both; }
        html[data-theme="dark"] .story-window, html[data-theme="dark"] .story-main { background: #131113; }
        html[data-theme="dark"] .story-header, html[data-theme="dark"] .story-sidebar, html[data-theme="dark"] .story-editor-card { border-color: #342f39; background: #1a1719; }
        html[data-theme="dark"] .story-header-copy h2, html[data-theme="dark"] .story-list-item, html[data-theme="dark"] .story-welcome strong, html[data-theme="dark"] .story-reader h1, html[data-theme="dark"] .story-reader-text, html[data-theme="dark"] .story-editor-card h3 { color: #eee9f1; }
        html[data-theme="dark"] .story-search, html[data-theme="dark"] .story-field input, html[data-theme="dark"] .story-field textarea { border-color: #403946; background: #221e21; color: #eee9f1; }
        html[data-theme="dark"] .story-list-item:hover, html[data-theme="dark"] .story-list-item.is-active { border-color: #6a4757; background: #2d1d24; }
        html[data-theme="dark"] .story-reader-toolbar { border-color: #342f39; background: rgba(19,17,19,.91); }
        html[data-theme="dark"] .story-reader-action, html[data-theme="dark"] .story-editor-button, html[data-theme="dark"] .story-close, html[data-theme="dark"] .story-back { border-color: #403946; background: #221e21; color: #d8cfde; }
        html[data-theme="dark"] .story-reader-meta { border-color: #39333d; }
        html[data-theme="dark"] .story-series { border-color: #483b41; background: #1a1719; }
        html[data-theme="dark"] .story-series-summary, html[data-theme="dark"] .story-series-chapter { color: #eee9f1; }
        html[data-theme="dark"] .story-series-chapters, html[data-theme="dark"] .story-series-act + .story-series-act { border-color: #342f39; }
        html[data-theme="dark"] .story-series-chapter:hover, html[data-theme="dark"] .story-series-chapter.is-active { border-color: #6a4757; background: #2d1d24; }
        html[data-theme="dark"] .story-series-chevron, html[data-theme="dark"] .story-series-chapter-number { background: #3d232e; color: #e1a1be; }
        html[data-theme="dark"] .story-reader-chapter-link { border-color: #403946; background: #221e21; color: #d8cfde; }

        @media (max-width: 900px) {
            .story-shell { padding: 0; background: #fefcfd; backdrop-filter: none; -webkit-backdrop-filter: none; }
            .story-window { width: 100%; height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
            .story-header { min-height: 60px; padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left)); }
            .story-header-icon { width: 38px; height: 38px; border-radius: 12px; }
            .story-close, .story-back { width: 44px; height: 44px; }
            .story-header-copy h2 { font-size: 1rem; }
            .story-header-copy p { display: none; }
            .story-content { position: relative; display: block; }
            .story-sidebar, .story-main { position: absolute; inset: 0; border: 0; }
            .story-main { display: none; --story-font-size: 18px; }
            .story-window.has-selection .story-sidebar { display: none; }
            .story-window.has-selection .story-main { display: block; }
            .story-window.has-selection .story-back { display: grid; }
            .story-sidebar-tools { padding: 10px; }
            .story-search input, .story-field input, .story-field textarea { font-size: 16px; }
            .story-list { padding: 7px 9px max(22px,env(safe-area-inset-bottom)); }
            .story-list-item { min-height: 74px; margin-bottom: 5px; padding: 12px 11px; }
            .story-series-summary { min-height: 70px; }
            .story-series-chapter { min-height: 60px; }
            .story-reader-toolbar { min-height: 48px; padding: 6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left)); }
            .story-reader { padding: 32px 20px max(100px,calc(64px + env(safe-area-inset-bottom))); }
            .story-reader h1 { font-size: clamp(1.9rem,10vw,2.7rem); }
            .story-reader-text { padding-top: 25px; line-height: 1.78; }
            .story-editor { padding: 14px 10px max(70px,calc(44px + env(safe-area-inset-bottom))); }
            .story-editor-card { padding: 16px 13px; border-radius: 14px; }
            .story-field textarea { min-height: calc(100dvh - 310px); resize: none; }
            .story-editor-actions { position: sticky; bottom: 0; padding: 9px 0 max(3px,env(safe-area-inset-bottom)); background: linear-gradient(180deg,rgba(255,255,255,0),#fff 24%); }
            html[data-theme="dark"] .story-shell { background: #181215; }
            html[data-theme="dark"] .story-editor-actions { background: linear-gradient(180deg,rgba(26,23,25,0),#1a1719 24%); }
        }
        @media (max-width: 390px) {
            .story-reader-toolbar { gap: 5px; }
            .story-reader-action { min-width: 44px; padding: 0 8px; }
            .story-reader-chapter-nav { grid-template-columns: 1fr; }
            .story-reader-chapter-link.is-next { grid-column: 1; text-align: left; }
        }

        /* GEMEINSAME REZEPTESAMMLUNG */
        body.recipe-open { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
        body.recipe-open .app-container { animation: none !important; transform: none !important; }
        body.recipe-open .back-to-top-btn { display: none !important; }
        .recipe-shell { position: fixed; inset: 0; z-index: 12600; display: none; align-items: center; justify-content: center; padding: 16px; overflow: hidden; background: rgba(16,12,14,.64); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
        .recipe-shell.is-open { display: flex; animation: fadeInUp .2s ease both; }
        .recipe-window { position: relative; width: min(1680px,calc(100vw - 32px)); height: min(980px,calc(100dvh - 32px)); min-height: min(680px,calc(100dvh - 32px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: #fdf8fa; box-shadow: 0 28px 90px rgba(0,0,0,.38); }
        .recipe-header { min-height: 70px; padding: 12px 15px 12px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #ede1e6; background: rgba(255,255,255,.95); }
        .recipe-header-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: #faeef4; color: #b24777; }
        .recipe-header-copy { min-width: 0; flex: 1; }
        .recipe-header-copy h2 { margin: 0; color: #2a1c22; font-size: 1.12rem; }
        .recipe-header-copy p { margin: 3px 0 0; color: #8e7d85; font-size: .76rem; }
        .recipe-close, .recipe-back { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #e9e0e4; border-radius: 12px; background: #fff; color: #6e5b63; cursor: pointer; }
        .recipe-back { display: none; }
        .recipe-content { min-width: 0; min-height: 0; flex: 1; display: grid; grid-template-columns: 370px minmax(0,1fr); }
        .recipe-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #ede1e6; background: #fff; }
        .recipe-sidebar-tools { padding: 14px; display: grid; grid-template-columns: 1fr 44px 44px; gap: 8px; border-bottom: 1px solid #f2ebee; }
        .recipe-search { grid-column: 1/-1; min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #eadee3; border-radius: 11px; background: #fdf9fb; color: #8d7a82; }
        .recipe-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #2a1c22; font: inherit; font-size: .86rem; }
        .recipe-category { min-width: 0; height: 42px; padding: 0 9px; border: 1px solid #eadee3; border-radius: 11px; background: #fff; color: #6e5b63; font: inherit; font-size: .76rem; }
        .recipe-tool-btn { height: 42px; display: grid; place-items: center; border: 0; border-radius: 11px; background: #b24777; color: #fff; cursor: pointer; }
        .recipe-tool-btn.is-random { background: linear-gradient(135deg,#b24777,#96417a); }
        .recipe-az { padding: 10px 12px; display: grid; grid-template-columns: repeat(13,1fr); gap: 3px; border-bottom: 1px solid #f2ebee; }
        .recipe-letter { min-width: 0; height: 25px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #8d7a82; font-size: .64rem; font-weight: 800; cursor: pointer; }
        .recipe-letter:hover, .recipe-letter.is-active { background: #faeef4; color: #b24777; }
        .recipe-list { min-height: 0; flex: 1; padding: 7px; overflow-y: auto; }
        .recipe-list-item { width: 100%; min-height: 66px; padding: 8px; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; font: inherit; cursor: pointer; }
        .recipe-list-item:hover { background: #fcf6f9; }
        .recipe-list-item.is-active { border-color: #e8cad7; background: #fbf1f5; }
        .recipe-list-thumb { width: 49px; height: 49px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 10px; background: #faeef4; color: #a05a7a; font-size: 1.2rem; }
        .recipe-list-thumb img { width: 100%; height: 100%; object-fit: cover; }
        .recipe-list-copy { min-width: 0; flex: 1; }
        .recipe-list-copy strong { display: block; overflow: hidden; color: #423038; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
        .recipe-list-copy span { display: block; margin-top: 3px; overflow: hidden; color: #9d8c94; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
        .recipe-list-empty { padding: 38px 18px; color: #96858d; text-align: center; font-size: .8rem; line-height: 1.5; }
        .recipe-main { min-width: 0; min-height: 0; position: relative; overflow-y: auto; background: #fdf9fb; }
        .recipe-welcome { min-height: 100%; display: grid; place-items: center; padding: 32px; color: #8d7a82; text-align: center; }
        .recipe-welcome-mark { width: 76px; height: 76px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 24px; background: #faeef4; color: #b24777; }
        .recipe-welcome strong { display: block; margin-bottom: 5px; color: #433038; font-size: 1.14rem; }
        .recipe-detail { max-width: 1080px; margin: 0 auto; padding: 24px; }
        .recipe-hero { display: grid; grid-template-columns: minmax(280px,.9fr) minmax(320px,1.1fr); overflow: hidden; border: 1px solid #eee2e7; border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(178,71,119,.07); }
        .recipe-hero-image { min-height: 300px; display: grid; place-items: center; overflow: hidden; border: 0; background: linear-gradient(145deg,#f6e4ec,#fbf1f5); color: #a05a7a; cursor: zoom-in; }
        .recipe-hero-image img { width: 100%; height: 100%; max-height: 430px; object-fit: cover; }
        .recipe-hero-copy { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
        .recipe-kicker { margin-bottom: 8px; color: #b24777; font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
        .recipe-title { margin: 0; color: #2a1c22; font-size: clamp(1.55rem,3vw,2.45rem); line-height: 1.08; }
        .recipe-meta { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
        .recipe-meta span { padding: 7px 10px; border-radius: 999px; background: #fbf1f5; color: #81616f; font-size: .74rem; font-weight: 700; }
        .recipe-detail-actions { margin-top: 21px; display: flex; flex-wrap: wrap; gap: 8px; }
        .recipe-action { min-height: 40px; padding: 0 13px; border: 1px solid #eadee3; border-radius: 10px; background: #fff; color: #6e5b63; font: inherit; font-size: .76rem; font-weight: 760; cursor: pointer; }
        .recipe-action.is-primary { border-color: #b24777; background: #b24777; color: #fff; }
        .recipe-action.is-danger { color: #b4232f; }
        .recipe-sections { margin-top: 18px; display: grid; grid-template-columns: minmax(240px,.8fr) minmax(320px,1.2fr); gap: 18px; }
        .recipe-section { padding: 21px; border: 1px solid #eee2e7; border-radius: 16px; background: #fff; }
        .recipe-section h3 { margin: 0 0 14px; color: #422f37; font-size: 1rem; }
        .recipe-ingredients { margin: 0; padding: 0; list-style: none; }
        .recipe-ingredients li { padding: 8px 0; display: flex; gap: 9px; border-bottom: 1px solid #f2ebee; color: #3f5047; font-size: .86rem; line-height: 1.4; }
        .recipe-ingredients li::before { content: '✓'; color: #b24777; font-weight: 900; }
        .recipe-steps { margin: 0; padding: 0; list-style: none; counter-reset: recipe-step; }
        .recipe-steps li { counter-increment: recipe-step; padding: 0 0 17px; display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: #3f5047; font-size: .88rem; line-height: 1.55; }
        .recipe-steps li::before { content: counter(recipe-step); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: #faeef4; color: #b24777; font-size: .72rem; font-weight: 850; }
        .recipe-notes { margin-top: 16px; padding: 16px 18px; border-left: 4px solid #f59e0b; border-radius: 10px; background: #fffbeb; color: #665329; white-space: pre-wrap; font-size: .84rem; line-height: 1.5; }
        .recipe-editor { max-width: 900px; margin: 0 auto; padding: 24px; }
        .recipe-editor-card { padding: 23px; border: 1px solid #eee2e7; border-radius: 17px; background: #fff; }
        .recipe-editor-card h3 { margin: 0 0 4px; color: #402b35; font-size: 1.15rem; }
        .recipe-editor-card > p { margin: 0 0 19px; color: #8e7c84; font-size: .76rem; }
        .recipe-form-grid { display: grid; grid-template-columns: 1.4fr .8fr .5fr .6fr; gap: 11px; }
        .recipe-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
        .recipe-field.is-wide { grid-column: 1/-1; }
        .recipe-field label { color: #6e5b63; font-size: .7rem; font-weight: 760; }
        .recipe-field input, .recipe-field textarea { width: 100%; border: 1px solid #eadee3; border-radius: 10px; background: #fefcfd; color: #2a1c22; font: inherit; font-size: .86rem; }
        .recipe-field input { min-height: 43px; padding: 0 10px; }
        .recipe-field textarea { min-height: 122px; padding: 10px; resize: vertical; line-height: 1.45; }
        .recipe-image-row { grid-column: 1/-1; display: flex; align-items: center; gap: 10px; }
        .recipe-image-preview { width: 68px; height: 68px; display: none; overflow: hidden; border-radius: 11px; background: #faeef4; }
        .recipe-image-preview.is-visible { display: block; }
        .recipe-image-preview img { width: 100%; height: 100%; object-fit: cover; }
        .recipe-form-actions { margin-top: 17px; display: flex; justify-content: flex-end; gap: 8px; }
        .recipe-toast { position: absolute; left: 50%; bottom: 24px; z-index: 5; display: none; max-width: calc(100% - 30px); padding: 9px 13px; transform: translateX(-50%); border-radius: 999px; background: #2a1c22; color: #fff; font-size: .76rem; box-shadow: 0 9px 25px rgba(33,20,26,.25); }
        .recipe-toast.is-visible { display: block; animation: fadeInUp .18s ease both; }
        html[data-theme="dark"] .recipe-window, html[data-theme="dark"] .recipe-main { background: #191315; }
        html[data-theme="dark"] .recipe-header, html[data-theme="dark"] .recipe-sidebar, html[data-theme="dark"] .recipe-hero, html[data-theme="dark"] .recipe-section, html[data-theme="dark"] .recipe-editor-card { background: #20191c; border-color: #2c3731; }
        html[data-theme="dark"] .recipe-header-copy h2, html[data-theme="dark"] .recipe-title, html[data-theme="dark"] .recipe-section h3, html[data-theme="dark"] .recipe-editor-card h3, html[data-theme="dark"] .recipe-list-copy strong { color: #f4edf0; }
        html[data-theme="dark"] .recipe-search, html[data-theme="dark"] .recipe-category, html[data-theme="dark"] .recipe-field input, html[data-theme="dark"] .recipe-field textarea { background: #271c21; border-color: #513e46; color: #f3eaee; }
        html[data-theme="dark"] .recipe-ingredients li, html[data-theme="dark"] .recipe-steps li { color: #c7d3cc; border-color: #2b3730; }

        @media (max-width: 760px) {
            .feature-menu-drawer { width: min(360px,calc(100vw - 18px)); height: calc(100dvh - 18px); margin: 9px; border-radius: 16px; overflow: hidden; }
            .recipe-shell { padding: 0; background: #fdf9fb; backdrop-filter: none; -webkit-backdrop-filter: none; }
            .recipe-window { width: 100%; height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
            .recipe-header { min-height: 60px; padding: max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left)); }
            .recipe-header-icon { width: 38px; height: 38px; border-radius: 12px; }
            .recipe-header-copy h2 { font-size: 1rem; }
            .recipe-header-copy p { display: none; }
            .recipe-content { display: block; position: relative; }
            .recipe-sidebar, .recipe-main { position: absolute; inset: 0; border: 0; }
            .recipe-main { display: none; }
            .recipe-window.has-selection .recipe-sidebar { display: none; }
            .recipe-window.has-selection .recipe-main { display: block; }
            .recipe-window.has-selection .recipe-back { display: grid; }
            .recipe-sidebar-tools { padding: 10px; }
            .recipe-search input, .recipe-category { font-size: 16px; }
            .recipe-detail, .recipe-editor { padding: 12px 10px max(18px,env(safe-area-inset-bottom)); }
            .recipe-hero { display: block; border-radius: 14px; }
            .recipe-hero-image { min-height: 210px; max-height: 290px; }
            .recipe-hero-copy { padding: 18px; }
            .recipe-title { font-size: 1.55rem; }
            .recipe-sections { grid-template-columns: 1fr; gap: 10px; }
            .recipe-section { padding: 17px; }
            .recipe-form-grid { grid-template-columns: 1fr 1fr; }
            .recipe-field:first-child, .recipe-field.is-wide { grid-column: 1/-1; }
            .recipe-field input, .recipe-field textarea { font-size: 16px; }
            .recipe-editor-card { padding: 16px 13px; }
        }

        /* GEMEINSAME PINNWAND · V2: klar, blau, mobil zuerst */
        body.board-open { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
        body.board-open .app-container { animation: none !important; transform: none !important; }
        body.board-open .back-to-top-btn { display: none !important; }
        .board-shell {
            position: fixed; inset: 0; z-index: 12500; display: none; align-items: center; justify-content: center;
            padding: 16px; overflow: hidden; background: rgba(33,20,26,.60); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
        }
        .board-shell.is-open { display: flex; animation: fadeInUp .2s ease both; }
        .board-window {
            position: relative; width: min(1380px,calc(100vw - 32px)); height: min(920px,calc(100dvh - 32px)); min-height: min(620px,calc(100dvh - 32px));
            display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 18px;
            background: #faf6f8; box-shadow: 0 28px 90px rgba(33,20,26,.38);
        }
        .board-header {
            min-height: 70px; padding: 11px 14px 11px 18px; display: flex; align-items: center; gap: 10px;
            border-bottom: 1px solid #ede1e6; background: rgba(255,255,255,.96);
        }
        .board-header-icon {
            width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 44px; border-radius: 14px;
            background: #faeef4; color: #b24777; box-shadow: inset 0 0 0 1px rgba(178,71,119,.08);
        }
        .board-header-copy { min-width: 0; flex: 1; }
        .board-header-copy h2 { margin: 0; color: #21141a; font-size: 1.18rem; line-height: 1.2; }
        .board-header-copy p { margin: 3px 0 0; overflow: hidden; color: #826d77; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
        .board-refresh, .board-close, .board-compose-toggle {
            min-height: 42px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
            border: 1px solid #eadee3; border-radius: 12px; background: #fff; color: #6e5b63; font: inherit; cursor: pointer;
            -webkit-tap-highlight-color: transparent;
        }
        .board-refresh, .board-close { width: 42px; }
        .board-refresh.is-loading svg { animation: boardSpin .8s linear infinite; }
        @keyframes boardSpin { to { transform: rotate(360deg); } }
        .board-compose-toggle { display: none; padding: 0 13px; gap: 6px; color: #fff; border-color: #b24777; background: #b24777; font-size: .84rem; font-weight: 800; }
        .board-compose-toggle svg { transition: transform .18s ease; }
        .board-window.is-compose-open .board-compose-toggle svg { transform: rotate(45deg); }
        .board-refresh:hover, .board-close:hover { border-color: #dcb8c8; background: #fcf6f9; color: #923f65; }
        .board-content { min-width: 0; min-height: 0; position: relative; flex: 1; display: grid; grid-template-columns: 350px minmax(0,1fr); }
        .board-compose-panel {
            min-width: 0; padding: 20px; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid #ede1e6;
            background: #fff;
        }
        .board-compose-title { margin: 0 0 4px; color: #2a1c22; font-size: 1rem; font-weight: 820; }
        .board-compose-copy { margin: 0 0 15px; color: #8d7a82; font-size: .8rem; line-height: 1.45; }
        .board-form { display: flex; flex-direction: column; gap: 10px; }
        .board-textarea, .board-link-input {
            width: 100%; border: 1px solid #eadee3; border-radius: 13px; background: #fdfafb; color: #2a1c22;
            font: inherit; font-size: 16px;
        }
        .board-textarea { min-height: 150px; max-height: 280px; padding: 12px 13px; resize: vertical; line-height: 1.48; }
        .board-link-input { min-height: 46px; padding: 0 13px; }
        .board-textarea:focus, .board-link-input:focus { outline: 0; border-color: #d397b2; background: #fff; box-shadow: 0 0 0 3px rgba(178,71,119,.11); }
        .board-image-picker {
            min-height: 46px; padding: 0 13px; display: flex; align-items: center; justify-content: center; gap: 8px;
            border: 1px dashed #cdb5c0; border-radius: 13px; background: #fdfafb; color: #785565; cursor: pointer;
            font-size: .84rem; font-weight: 760;
        }
        .board-image-picker:hover { border-color: #cb8ba8; background: #fbf2f6; color: #9c456c; }
        .board-file-preview { display: none; align-items: center; gap: 10px; padding: 9px; border: 1px solid #f0e2e9; border-radius: 12px; background: #fbf2f6; color: #71495b; font-size: .78rem; }
        .board-file-preview.is-visible { display: flex; }
        .board-file-preview img { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; object-fit: cover; background: #f1e3e9; }
        .board-file-preview span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .board-file-remove { width: 32px; height: 32px; flex: 0 0 32px; border: 0; border-radius: 10px; background: #f1e3e9; color: #755865; cursor: pointer; }
        .board-submit {
            min-height: 48px; border: 0; border-radius: 13px; background: linear-gradient(135deg,#b24777,#9a496d 60%,#96417a);
            color: #fff; font: inherit; font-size: .92rem; font-weight: 820; cursor: pointer; box-shadow: 0 8px 20px rgba(178,71,119,.20);
        }
        .board-submit:active { transform: scale(.99); }
        .board-submit:disabled { opacity: .82; cursor: wait; box-shadow: none; }
        .board-compose-meta { margin-top: -2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #a3929a; font-size: .72rem; }
        .board-limit { margin: 0; color: inherit; font-size: inherit; text-align: left; }
        .board-text-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
        .board-feed {
            min-width: 0; min-height: 0; padding: 20px; display: grid; grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
            align-content: start; gap: 14px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
            background: #faf6f8;
        }
        .board-loading, .board-empty { grid-column: 1/-1; min-height: 260px; display: grid; place-items: center; padding: 30px; color: #8d7a82; text-align: center; }
        .board-empty > div { max-width: 360px; }
        .board-empty strong { display: block; margin-bottom: 6px; color: #433038; font-size: 1.05rem; }
        .board-card {
            position: relative; min-width: 0; align-self: start; overflow: hidden; border: 1px solid #eee2e7; border-radius: 17px;
            background: #fff; box-shadow: 0 6px 20px rgba(33,20,26,.055);
        }
        .board-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg,#b24777,#d78cae); }
        .board-card-head { padding: 15px 14px 0; display: flex; align-items: center; gap: 10px; }
        .board-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; overflow: hidden; border-radius: 50%; background: #faeef4; color: #b24777; font-size: .75rem; font-weight: 850; }
        .board-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
        .board-author { min-width: 0; flex: 1; color: #433038; font-size: .84rem; font-weight: 820; }
        .board-time { display: block; margin-top: 2px; color: #a3929a; font-size: .7rem; font-weight: 550; }
        .board-delete { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; border: 0; border-radius: 11px; background: transparent; color: #b09da5; cursor: pointer; }
        .board-delete:hover { background: #fff1f2; color: #dc2626; }
        .board-delete:disabled { opacity: .45; cursor: wait; }
        .board-image { width: calc(100% - 28px); margin: 12px 14px 0; padding: 0; display: block; overflow: hidden; border: 0; border-radius: 13px; background: #f8f1f4; cursor: zoom-in; }
        .board-image img { width: 100%; max-height: 430px; display: block; object-fit: contain; background: #f8f1f4; }
        .board-card-text { padding: 13px 15px 6px; color: #3d2d34; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.52; }
        .board-card-text:last-child { padding-bottom: 16px; }
        .board-link { margin: 9px 14px 15px; padding: 11px 12px; display: flex; align-items: center; gap: 9px; overflow: hidden; border: 1px solid #f0dfe7; border-radius: 12px; background: #fcf5f8; color: #9c456c; text-decoration: none; font-size: .8rem; font-weight: 760; }
        .board-link::before { content: '↗'; width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border-radius: 8px; background: #f7e5ed; }
        .board-link span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .board-close:focus-visible, .board-refresh:focus-visible, .board-compose-toggle:focus-visible, .board-image-picker:focus-visible, .board-file-remove:focus-visible, .board-submit:focus-visible, .board-delete:focus-visible, .board-image:focus-visible, .board-link:focus-visible { outline: 3px solid rgba(178,71,119,.22); outline-offset: 2px; }
        .board-toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); display: none; padding: 10px 14px; border-radius: 999px; background: #2a1c22; color: #fff; box-shadow: 0 9px 26px rgba(33,20,26,.26); font-size: .8rem; z-index: 8; }
        .board-toast.is-visible { display: block; animation: fadeInUp .18s ease both; }
        @media (max-width: 900px) {
            .board-shell { padding: 0; background: #faf6f8; backdrop-filter: none; -webkit-backdrop-filter: none; }
            .board-window { width: 100%; height: 100vh; height: 100dvh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
            .board-header { min-height: calc(60px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(10px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left)); gap: 7px; }
            .board-header-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
            .board-header-copy h2 { font-size: 1.02rem; }
            .board-header-copy p { font-size: .76rem; }
            .board-refresh, .board-close { width: 44px; height: 44px; min-height: 44px; border-radius: 12px; }
            .board-compose-toggle { min-height: 44px; display: inline-flex; padding: 0 11px; border-radius: 12px; }
            .board-content { display: block; position: relative; overflow: hidden; }
            .board-compose-panel {
                position: absolute; inset: 0; z-index: 5; display: none; padding: 14px max(12px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
                border: 0; background: #fdf9fb; overflow-y: auto; -webkit-overflow-scrolling: touch;
            }
            .board-window.is-compose-open .board-compose-panel { display: block; }
            .board-compose-title { font-size: 1.02rem; }
            .board-compose-copy { margin-bottom: 12px; font-size: .8rem; }
            .board-textarea { min-height: 145px; max-height: 42dvh; resize: none; }
            .board-link-input, .board-image-picker, .board-submit { min-height: 48px; }
            .board-feed { height: 100%; padding: 12px max(10px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); grid-template-columns: 1fr; gap: 11px; }
            .board-card { border-radius: 15px; }
            .board-card-head { padding: 14px 13px 0; }
            .board-card-text { padding: 12px 14px 6px; font-size: 16px; line-height: 1.5; }
            .board-image { width: calc(100% - 26px); margin: 11px 13px 0; }
            .board-image img { max-height: 52dvh; }
            .board-link { margin: 9px 13px 14px; }
        }
        @media (max-width: 430px) {
            .board-header-copy p { display: none; }
            .board-header-copy { min-width: 80px; }
            .board-compose-toggle span { display: none; }
            .board-compose-toggle { width: 44px; padding: 0; }
        }
        html[data-theme="dark"] .board-shell { background: rgba(13,8,11,.72); }
        html[data-theme="dark"] .board-window, html[data-theme="dark"] .board-feed { background: #1a1316; border-color: #42343b; }
        html[data-theme="dark"] .board-header, html[data-theme="dark"] .board-compose-panel { background: #231a1e; border-color: #42343b; }
        html[data-theme="dark"] .board-header-copy h2, html[data-theme="dark"] .board-compose-title, html[data-theme="dark"] .board-author, html[data-theme="dark"] .board-card-text { color: #f7f1f4; }
        html[data-theme="dark"] .board-header-copy p, html[data-theme="dark"] .board-compose-copy { color: #a6969d; }
        html[data-theme="dark"] .board-refresh, html[data-theme="dark"] .board-close { background: #2d2126; border-color: #513e46; color: #d2c1c9; }
        html[data-theme="dark"] .board-textarea, html[data-theme="dark"] .board-link-input, html[data-theme="dark"] .board-image-picker { background: #2a1e24; border-color: #513e46; color: #f7f1f4; }
        html[data-theme="dark"] .board-card { background: #231a1e; border-color: #513843; }
        html[data-theme="dark"] .board-link, html[data-theme="dark"] .board-file-preview { background: #322028; border-color: #623e4e; color: #e6b0c8; }
        html[data-theme="dark"] .board-image, html[data-theme="dark"] .board-image img { background: #1e1519; }

        body.chat-open { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
        body.chat-open .app-container { animation: none !important; transform: none !important; }
        .chat-shell {
            position: fixed; inset: 0; z-index: 12000; display: none; align-items: center; justify-content: center;
            padding: 24px; overflow: hidden; overscroll-behavior: none; background: rgba(33, 20, 26, .58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        }
        .chat-shell.is-open { display: flex; animation: fadeInUp .2s ease both; }
        .chat-window {
            width: min(1040px, calc(100vw - 48px)); height: min(720px, calc(100vh - 48px)); height: min(720px, calc(100dvh - 48px));
            min-height: min(560px, calc(100dvh - 48px)); display: grid; grid-template-columns: 316px minmax(0, 1fr); overflow: hidden; overscroll-behavior: none;
            border: 1px solid rgba(176, 157, 165, .38); border-radius: 20px; background: #fff;
            box-shadow: 0 28px 80px rgba(33, 20, 26, .30), 0 4px 16px rgba(33, 20, 26, .10);
        }
        .chat-sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid #ede6e9; background: #fbf9fa; }
        .chat-sidebar-header { padding: 18px 16px 14px; background: #fff; border-bottom: 1px solid #ede6e9; }
        .chat-sidebar-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
        .chat-sidebar-title { display: flex; align-items: center; gap: 10px; font-size: 1.16rem; font-weight: 800; letter-spacing: -.025em; }
        .chat-secure-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #f9edf3; color: #923f65; }
        .chat-close-button, .chat-back-button, .chat-thread-close-button {
            width: 40px; height: 40px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
            border: 1px solid #e9e0e4; border-radius: 12px; background: #fff; color: #614f57; cursor: pointer;
            transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
        }
        @media (hover: hover) and (pointer: fine) {
            .chat-close-button:hover, .chat-back-button:hover, .chat-thread-close-button:hover { color: #923f65; border-color: #f0d0de; background: #fbf3f7; }
        }
        .chat-close-button:active, .chat-back-button:active, .chat-thread-close-button:active { transform: scale(.95); }
        .chat-thread-close-button { display: none; }
        .chat-search { position: relative; }
        .chat-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #b09da5; pointer-events: none; }
        .chat-search input { width: 100%; min-height: 42px; padding: 0 12px 0 38px; border: 1px solid transparent; border-radius: 12px; background: #f7f3f5; color: #21141a; font-size: .9rem; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
        .chat-search input:focus { outline: none; border-color: #e6b3ca; background: #fff; box-shadow: 0 0 0 3px rgba(178,71,119,.10); }
        .chat-contact-list { min-width: 0; min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; padding: 8px; overscroll-behavior: contain; scrollbar-gutter: stable; }
        .chat-contact-empty { padding: 44px 24px; color: #826d77; text-align: center; font-size: .88rem; line-height: 1.55; }
        .chat-contact {
            width: 100%; max-width: 100%; min-width: 0; min-height: 68px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center;
            gap: 11px; padding: 9px 10px; overflow: hidden; border: 1px solid transparent; border-radius: 13px; background: transparent; color: #21141a; text-align: left; cursor: pointer;
            transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
        }
        .chat-contact:hover { background: #f5f0f2; }
        .chat-contact.is-active { border-color: #f0d9e3; background: #faeef4; box-shadow: inset 3px 0 0 #b24777; }
        .chat-avatar {
            position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto;
            overflow: visible; border-radius: 50%; background: linear-gradient(145deg, #b24777, #96417a); color: #fff; font-weight: 800; text-transform: uppercase;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
        }
        .chat-avatar-image { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; object-position: center; }
        .chat-presence-dot { position: absolute; right: -1px; bottom: 1px; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: #b09da5; }
        .chat-presence-dot.is-online { background: #22c55e; }
        .chat-contact-copy { display: block; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
        .chat-contact-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
        .chat-contact-name { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .94rem; font-weight: 750; }
        .chat-contact-time { display: block; max-width: 72px; overflow: hidden; text-overflow: ellipsis; color: #b09da5; font-size: .71rem; white-space: nowrap; }
        .chat-contact-preview { display: block; width: 100%; max-width: 100%; min-width: 0; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #826d77; font-size: .8rem; }
        .chat-contact-unread { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: #b24777; color: #fff; font-size: .7rem; font-weight: 800; }
        .chat-contact-list.is-search-mode { padding: 12px; background: #f9f6f7; }
        .chat-search-summary { padding: 1px 2px 11px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
        .chat-search-summary-copy { min-width: 0; }
        .chat-search-summary-title { display: block; color: #21141a; font-size: .88rem; font-weight: 820; letter-spacing: -.01em; }
        .chat-search-summary-context { display: block; margin-top: 2px; color: #8d7a82; font-size: .69rem; }
        .chat-search-summary-limit { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: #fff7ed; color: #9a4b0c; font-size: .65rem; font-weight: 750; }
        .chat-search-group { margin-bottom: 11px; overflow: hidden; border: 1px solid #ece1e6; border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(33,20,26,.055); }
        .chat-search-group:last-child { margin-bottom: 0; }
        .chat-search-group-header { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #f2ecef; background: linear-gradient(180deg, #fff, #fefcfd); }
        .chat-search-group-header .chat-avatar { width: 40px; height: 40px; font-size: .82rem; }
        .chat-search-group-copy { min-width: 0; }
        .chat-search-group-name { display: block; overflow: hidden; color: #21141a; font-size: .91rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
        .chat-search-group-status { display: block; margin-top: 2px; color: #8d7a82; font-size: .68rem; }
        .chat-search-group-count { min-width: 27px; height: 27px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: #f9edf3; color: #923f65; font-size: .7rem; font-weight: 850; }
        .chat-search-hits { padding: 5px; }
        .chat-search-hit {
            width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 8px; padding: 9px 8px 9px 10px;
            border: 0; border-bottom: 1px solid #f4eff1; border-radius: 9px; background: transparent; color: #21141a; font: inherit; text-align: left; cursor: pointer;
            transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
        }
        .chat-search-hit:last-child { border-bottom-color: transparent; }
        .chat-search-hit:hover, .chat-search-hit:focus-visible { outline: none; background: #fbf2f6; box-shadow: inset 3px 0 0 #c86591; }
        .chat-search-hit:active { transform: scale(.992); }
        .chat-search-hit-copy { min-width: 0; }
        .chat-search-hit-meta { display: flex; align-items: center; gap: 6px; color: #b24777; font-size: .68rem; font-weight: 780; }
        .chat-search-hit-meta::before { content: ''; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #c86591; box-shadow: 0 0 0 3px #f6e4ec; }
        .chat-search-hit-time { margin-left: auto; color: #b09da5; font-weight: 600; white-space: nowrap; }
        .chat-search-hit-snippet {
            margin-top: 6px; overflow: hidden; color: #614f57; font-size: .76rem; line-height: 1.42;
            display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
        }
        .chat-search-highlight { padding: 0 2px; border-radius: 3px; background: #fde68a; color: #713f12; font: inherit; font-weight: 800; }
        .chat-search-chevron { width: 20px; align-self: center; display: grid; place-items: center; color: #b9a8b0; font-size: 1.15rem; line-height: 1; transition: color .15s ease, transform .15s ease; }
        .chat-search-hit:hover .chat-search-chevron, .chat-search-hit:focus-visible .chat-search-chevron { color: #b24777; transform: translateX(2px); }
        .chat-search-hit.is-contact-result .chat-search-hit-meta { color: #826d77; }
        .chat-search-hit.is-contact-result .chat-search-hit-meta::before { background: #b09da5; box-shadow: 0 0 0 3px #ede6e9; }
        .chat-search-empty-state { padding: 52px 22px; }
        .chat-search-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 15px; background: #faeef4; color: #b24777; }
        .chat-search-empty-title { display: block; margin-bottom: 4px; color: #4d3b43; font-weight: 800; }
        .chat-message-row.is-search-target .chat-message-bubble { animation: chatSearchTargetPulse 1.5s ease both; }
        @keyframes chatSearchTargetPulse {
            0%, 100% { box-shadow: none; }
            22%, 70% { box-shadow: 0 0 0 4px rgba(245,158,11,.28), 0 8px 24px rgba(33,20,26,.13); }
        }
        .chat-main { min-width: 0; min-height: 0; position: relative; display: flex; overflow: hidden; background: #f4f0f2; }
        .chat-welcome { margin: auto; max-width: 390px; padding: 36px; color: #826d77; text-align: center; }
        .chat-welcome-icon { width: 72px; height: 72px; margin: 0 auto 18px; display: grid; place-items: center; border: 1px solid #f0d9e3; border-radius: 24px; background: #f9ecf2; color: #b24777; box-shadow: 0 12px 30px rgba(178,71,119,.10); }
        .chat-welcome h2 { margin-bottom: 8px; color: #21141a; font-size: 1.35rem; }
        .chat-welcome p { font-size: .9rem; line-height: 1.6; }
        .chat-conversation { width: 100%; min-width: 0; min-height: 0; display: none; flex-direction: column; overflow: hidden; }
        .chat-conversation.is-active { display: flex; }
        .chat-thread-header {
            min-height: 68px; padding: 10px 16px; display: flex; align-items: center; gap: 11px;
            border-bottom: 1px solid #ede6e9; background: rgba(255,255,255,.97); box-shadow: 0 1px 0 rgba(33,20,26,.025); z-index: 5;
        }
        .chat-back-button { display: none; }
        .chat-thread-identity { min-width: 0; flex: 1; }
        .chat-thread-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
        .chat-thread-status { min-height: 18px; margin-top: 2px; color: #826d77; font-size: .78rem; }
        .chat-thread-status.is-online, .chat-thread-status.is-typing { color: #16a34a; }
        .chat-thread-note { display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: #f7f3f5; color: #826d77; font-size: .71rem; white-space: nowrap; }
        .chat-thread-search-button { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #e9e0e4; border-radius: 12px; background: #fff; color: #614f57; cursor: pointer; }
        .chat-thread-search-button:hover, .chat-thread-search-button[aria-expanded="true"] { color: #923f65; border-color: #f0d0de; background: #fbf3f7; }
        .chat-thread-search-bar { display: none; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid #ede6e9; background: #fff; z-index: 4; }
        .chat-thread-search-bar.is-open { display: flex; }
        .chat-thread-search-bar input { min-width: 0; flex: 1; min-height: 38px; padding: 0 12px; border: 1px solid #e3dbdf; border-radius: 10px; background: #fbf9fa; font: inherit; font-size: .9rem; }
        .chat-thread-search-bar input:focus { outline: 2px solid rgba(185,77,126,.22); border-color: #e1a0bd; background: #fff; }
        .chat-thread-search-count { min-width: 74px; color: #826d77; font-size: .78rem; text-align: right; white-space: nowrap; }
        .chat-thread-search-close { width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #f5f0f2; color: #614f57; cursor: pointer; }
        .chat-message-flow.is-search-results { justify-content: flex-start; }
        .chat-search-empty { margin: 30px auto; max-width: 360px; color: #826d77; text-align: center; font-size: .9rem; }
        .chat-messages {
            min-width: 0; min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; padding: 18px clamp(16px, 3vw, 30px);
            background: linear-gradient(180deg, #f4f0f2 0%, #f2ecef 100%); overscroll-behavior: contain; scroll-behavior: auto;
            scrollbar-gutter: stable; overflow-anchor: none; -webkit-overflow-scrolling: touch; touch-action: pan-y;
            scrollbar-color: rgba(130, 109, 119, .38) transparent; scrollbar-width: thin;
        }
        .chat-messages::-webkit-scrollbar { width: 9px; }
        .chat-messages::-webkit-scrollbar-track { background: transparent; }
        .chat-messages::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: rgba(130, 109, 119, .34); background-clip: padding-box; }

        .chat-message-flow { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
        .chat-loading { min-height: 180px; flex: 1; display: grid; place-items: center; color: #826d77; font-size: .86rem; }
        .chat-thread-empty { margin: auto; max-width: 300px; padding: 28px 18px; color: #826d77; text-align: center; }
        .chat-thread-empty-icon { width: 50px; height: 50px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 17px; background: rgba(255,255,255,.82); color: #b24777; box-shadow: 0 8px 22px rgba(33,20,26,.08); font-size: 1.35rem; }
        .chat-thread-empty strong { display: block; margin-bottom: 5px; color: #4d3b43; font-size: .92rem; }
        .chat-thread-empty span { display: block; font-size: .8rem; line-height: 1.5; }
        .chat-load-older { display: block; margin: 0 auto 14px; padding: 7px 12px; border: 1px solid #e9e0e4; border-radius: 999px; background: rgba(255,255,255,.9); color: #614f57; box-shadow: 0 1px 4px rgba(33,20,26,.08); cursor: pointer; font-size: .73rem; font-weight: 700; }
        .chat-load-older:disabled { opacity: .58; cursor: default; }
        .chat-day { width: max-content; flex: 0 0 auto; margin: 8px auto 16px; padding: 5px 10px; border: 1px solid rgba(220,209,214,.72); border-radius: 999px; background: rgba(255,255,255,.82); color: #826d77; box-shadow: 0 1px 3px rgba(33,20,26,.05); font-size: .69rem; font-weight: 700; }
        .chat-message-row { display: flex; flex: 0 0 auto; margin: 3px 0; }
        .chat-message-row.is-mine { justify-content: flex-end; }
        .chat-message-wrap { position: relative; max-width: min(72%, 560px); }
        .chat-message-bubble { position: relative; padding: 9px 11px 7px; border: 1px solid rgba(237,230,233,.88); border-radius: 17px 17px 17px 6px; background: #fff; color: #21141a; box-shadow: 0 2px 6px rgba(33,20,26,.07); }
        .chat-message-row.is-mine .chat-message-bubble { border-color: #b24777; border-radius: 17px 17px 6px 17px; background: linear-gradient(145deg, #b85280, #b24777); color: #fff; box-shadow: 0 3px 10px rgba(178,71,119,.16); }
        .chat-message-bubble.is-deleted { background: rgba(255,255,255,.7); color: #826d77; font-style: italic; }
        .chat-message-row.is-mine .chat-message-bubble.is-deleted { border-color: #f0d0de; background: #f6e4ec; color: #614f57; box-shadow: none; }
        .chat-message-sender { margin: 0 0 4px; color: #a54184; font-size: .69rem; font-weight: 850; letter-spacing: .01em; }
        .chat-reply-quote { margin: -2px -2px 7px; padding: 7px 9px; border-left: 3px solid #b94d7e; border-radius: 7px; background: rgba(185,77,126,.08); color: #614f57; }
        .chat-message-row.is-mine .chat-reply-quote { border-left-color: rgba(255,255,255,.88); background: rgba(255,255,255,.14); color: rgba(255,255,255,.9); }
        .chat-reply-author { display: block; margin-bottom: 2px; font-size: .72rem; font-weight: 800; }
        .chat-reply-copy { display: block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; opacity: .88; }
        .chat-message-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.42; }
        .chat-rich-heading { margin: 11px 0 5px; color: #20151a; font-size: 1.02em; font-weight: 850; line-height: 1.3; }
        .chat-rich-paragraph { margin: 0 0 8px; }
        .chat-rich-list { margin: 4px 0 9px; padding-left: 21px; }
        .chat-rich-list li { margin: 3px 0; padding-left: 2px; }
        .chat-rich-quote { margin: 7px 0; padding: 7px 10px; border-left: 3px solid #e6b3ca; border-radius: 6px; background: #fbf9fa; color: #614f57; }
        .chat-rich-code { margin: 7px 0; padding: 9px 10px; overflow-x: auto; border-radius: 9px; background: #21141a; color: #ede6e9; font: .82em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
        .chat-rich-inline-code { padding: 1px 5px; border-radius: 5px; background: #f5f0f2; color: #4d3b43; font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
        .chat-rich-link { color: #923f65; font-weight: 650; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
        .chat-rich-table-wrap { max-width: 100%; margin: 7px 0 10px; overflow-x: auto; border: 1px solid #e9e0e4; border-radius: 10px; background: #fff; -webkit-overflow-scrolling: touch; }
        .chat-rich-table { width: 100%; min-width: 430px; border-collapse: collapse; font-size: .86em; line-height: 1.4; }
        .chat-rich-table th, .chat-rich-table td { padding: 8px 9px; border-right: 1px solid #ede6e9; border-bottom: 1px solid #ede6e9; text-align: left; vertical-align: top; }
        .chat-rich-table th { background: #f7f3f5; color: #4d3b43; font-weight: 800; }
        .chat-rich-table tr:last-child td { border-bottom: 0; }
        .chat-rich-table th:last-child, .chat-rich-table td:last-child { border-right: 0; }
        .chat-rich-divider { height: 1px; margin: 9px 0; border: 0; background: #e9e0e4; }
        .chat-message-meta { min-height: 18px; margin-top: 3px; display: flex; justify-content: flex-end; align-items: center; gap: 5px; color: #b09da5; font-size: .65rem; }
        .chat-edited-mark { opacity: .78; font-style: italic; }
        .chat-message-row.is-mine .chat-message-meta { color: rgba(255,255,255,.78); }
        .chat-read-mark { font-weight: 900; letter-spacing: -3px; padding-right: 3px; }
        .chat-read-mark.is-read { color: #a7f3d0; }
        .chat-attachment { min-width: min(290px, 60vw); margin-bottom: 7px; overflow: hidden; border-radius: 11px; background: rgba(33,20,26,.07); }
        .chat-message-row.is-mine .chat-attachment { background: rgba(255,255,255,.13); }
        .chat-attachment img { width: 100%; max-height: 290px; display: block; object-fit: cover; background: #21141a; }
        .chat-voice-message { min-width: min(330px, 68vw); padding: 8px 9px; }
        .chat-voice-message audio { width: 100%; height: 38px; display: block; }
        .chat-voice-download { display: block; margin-top: 5px; color: inherit; opacity: .72; font-size: .7rem; text-align: right; text-decoration: none; }
        .chat-file-card { padding: 10px; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
        .chat-file-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: rgba(255,255,255,.72); color: #b24777; }
        .chat-file-copy { min-width: 0; flex: 1; }
        .chat-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; font-weight: 750; }
        .chat-file-size { margin-top: 2px; opacity: .72; font-size: .69rem; }
        .chat-message-more { position: relative; width: 28px; height: 24px; margin: -4px -5px -4px 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #826d77; cursor: pointer; font-size: 1.12rem; font-weight: 800; line-height: 1; opacity: .68; touch-action: manipulation; }
        .chat-message-more::before { content: ''; position: absolute; inset: -8px; }
        .chat-message-row.is-mine .chat-message-more { color: rgba(255,255,255,.9); }
        .chat-message-more:hover, .chat-message-more:focus-visible, .chat-message-more[aria-expanded="true"] { outline: none; background: rgba(176,157,165,.16); opacity: 1; }
        .chat-message-row.is-mine .chat-message-more:hover, .chat-message-row.is-mine .chat-message-more:focus-visible, .chat-message-row.is-mine .chat-message-more[aria-expanded="true"] { background: rgba(255,255,255,.16); }
        .chat-action-menu { position: absolute; top: calc(100% + 7px); right: 0; width: max-content; max-width: min(320px, calc(100vw - 36px)); display: none; padding: 7px; border: 1px solid #e9e0e4; border-radius: 15px; background: #fff; color: #21141a; box-shadow: 0 14px 38px rgba(33,20,26,.20); z-index: 12; }
        .chat-message-row:not(.is-mine) .chat-action-menu { right: auto; left: 0; }
        .chat-action-menu.is-open { display: block; }
        .chat-action-menu.opens-up { top: auto; bottom: calc(100% + 7px); }
        .chat-action-reactions { display: flex; align-items: center; gap: 2px; }
        .chat-action-reaction { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; cursor: pointer; font-size: 1.42rem; line-height: 1; transition: background .14s ease, transform .14s ease; }
        .chat-action-reaction:hover, .chat-action-reaction:focus-visible { outline: none; background: #f7f3f5; transform: translateY(-1px); }
        .chat-action-divider { height: 1px; margin: 6px 3px; background: #ede6e9; }
        .chat-action-item, .chat-action-delete { width: 100%; min-height: 38px; padding: 7px 9px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 10px; background: transparent; color: #4d3b43; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; text-align: left; white-space: nowrap; }
        .chat-action-item:hover, .chat-action-item:focus-visible { outline: none; background: #f7f3f5; }
        .chat-action-delete { color: #dc2626; }
        .chat-action-delete:hover, .chat-action-delete:focus-visible { outline: none; background: #fef2f2; }
        .chat-reactions { position: absolute; right: 7px; bottom: -17px; display: flex; gap: 3px; }
        .chat-message-row:not(.is-mine) .chat-reactions { right: auto; left: 7px; }
        .chat-reaction-chip { min-height: 23px; padding: 1px 6px; display: flex; align-items: center; gap: 3px; border: 1px solid #e9e0e4; border-radius: 999px; background: #fff; color: #4d3b43; box-shadow: 0 1px 3px rgba(33,20,26,.10); font-size: .72rem; cursor: pointer; }
        .chat-reaction-chip.is-mine { border-color: #e6b3ca; background: #fbf3f7; }
        .chat-message-row.has-reactions { margin-bottom: 20px; }
        .chat-typing-indicator { display: none; align-items: center; gap: 4px; width: max-content; margin: 6px 0; padding: 10px 13px; border-radius: 16px 16px 16px 5px; background: #fff; box-shadow: 0 1px 2px rgba(33,20,26,.10); }
        .chat-typing-indicator.is-visible { display: flex; }
        .chat-typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: #b09da5; animation: softPulse 1s ease-in-out infinite; }
        .chat-typing-indicator span:nth-child(2) { animation-delay: .14s; }
        .chat-typing-indicator span:nth-child(3) { animation-delay: .28s; }
        .chat-composer-area { padding: 11px 14px 10px; border-top: 1px solid #ede6e9; background: #fff; box-shadow: 0 -4px 14px rgba(33,20,26,.035); z-index: 4; }
        .chat-composer-context { display: none; align-items: center; gap: 10px; margin: 0 4px 8px; padding: 8px 10px; border-left: 3px solid #b94d7e; border-radius: 9px; background: #fcf6f9; color: #4d3b43; }
        .chat-composer-context.is-visible { display: flex; }
        .chat-composer-context-copy { min-width: 0; flex: 1; }
        .chat-composer-context-title { display: block; margin-bottom: 2px; color: #b94d7e; font-size: .75rem; font-weight: 800; }
        .chat-composer-context-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
        .chat-composer-context-close { width: 28px; height: 28px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #ede6e9; color: #614f57; cursor: pointer; }
        .chat-voice-status { display: none; align-items: center; gap: 8px; margin: 0 4px 8px; padding: 8px 10px; border-radius: 10px; background: #fff1f2; color: #be123c; font-size: .8rem; font-weight: 700; }
        .chat-voice-status.is-visible { display: flex; }
        .chat-voice-dot { width: 9px; height: 9px; border-radius: 50%; background: #e11d48; animation: softPulse .9s ease-in-out infinite; }
        .chat-attachment-preview { display: none; align-items: center; gap: 9px; margin: 0 4px 8px; padding: 8px 10px; border: 1px solid #e9e0e4; border-radius: 11px; background: #fbf9fa; color: #614f57; font-size: .8rem; }
        .chat-attachment-preview.is-visible { display: flex; }
        .chat-attachment-preview-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-attachment-remove { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #ede6e9; color: #614f57; cursor: pointer; }
        .chat-composer { position: relative; min-height: 48px; padding: 3px; display: flex; align-items: flex-end; gap: 4px; border: 1px solid #e9e0e4; border-radius: 25px; background: #fbf9fa; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
        .chat-composer:focus-within { border-color: #e6b3ca; background: #fff; box-shadow: 0 0 0 3px rgba(178,71,119,.09); }
        .chat-attach-button, .chat-voice-button, .chat-emoji-button, .chat-send-button { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; cursor: pointer; transition: background .16s ease, transform .16s ease, opacity .16s ease; }
        .chat-attach-button, .chat-voice-button, .chat-emoji-button { background: transparent; color: #826d77; }
        .chat-attach-button:hover, .chat-voice-button:hover, .chat-emoji-button:hover, .chat-emoji-button[aria-expanded="true"] { background: #ede6e9; color: #4d3b43; }
        .chat-voice-button.is-recording { background: #ffe4e6; color: #e11d48; animation: softPulse 1s ease-in-out infinite; }
        .chat-send-button { background: #b24777; color: #fff; box-shadow: 0 4px 12px rgba(178,71,119,.26); }
        .chat-send-button:hover { background: #923f65; }
        .chat-attach-button:active, .chat-voice-button:active, .chat-emoji-button:active, .chat-send-button:active { transform: scale(.94); }
        .chat-send-button:disabled { opacity: .48; cursor: default; box-shadow: none; }
        .chat-emoji-button svg { width: 20px; height: 20px; display: block; stroke-width: 2; }
        .chat-emoji-picker { position: absolute; left: 4px; bottom: calc(100% + 9px); width: min(520px, calc(100vw - 48px)); max-height: 500px; display: none; flex-direction: column; overflow: hidden; border: 1px solid #e0dadd; border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgba(33,20,26,.22); z-index: 30; }
        .chat-emoji-picker.is-open { display: flex; }
        .chat-emoji-picker-header { padding: 10px; border-bottom: 1px solid #e9e6e8; }
        .chat-emoji-search { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid #e3dbdf; border-radius: 11px; background: #fbf9fa; font: inherit; font-size: .92rem; }
        .chat-emoji-search:focus { outline: 2px solid rgba(185,77,126,.25); border-color: #e1a0bd; }
        .chat-emoji-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 12px; overflow-y: auto; overscroll-behavior: contain; }
        .chat-emoji-choice { min-width: 0; height: 70px; display: grid; place-items: center; border: 0; border-radius: 14px; background: transparent; cursor: pointer; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 2.85rem; line-height: 1; }
        .chat-emoji-choice:hover, .chat-emoji-choice:focus-visible { outline: none; background: #f5f0f2; transform: scale(1.06); }
        .chat-emoji-empty { grid-column: 1 / -1; padding: 28px 14px; color: #826d77; text-align: center; font-size: .9rem; }
        .chat-action-more-emoji { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 11px; background: #faeff4; color: #b94d7e; cursor: pointer; font-size: 1.18rem; font-weight: 800; }
        .chat-message-input { min-height: 40px; max-height: 132px; flex: 1; resize: none; overflow-y: auto; padding: 10px 8px; border: 0; border-radius: 18px; background: transparent; color: #21141a; font: inherit; font-size: .92rem; line-height: 1.35; }
        .chat-message-input:focus { outline: none; }
        .chat-composer-hint { margin: 6px 54px 0; color: #b09da5; text-align: center; font-size: .66rem; }
        .chat-toast { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: calc(100% - 30px); display: none; padding: 9px 13px; border-radius: 999px; background: #21141a; color: #fff; box-shadow: 0 8px 24px rgba(33,20,26,.25); font-size: .79rem; z-index: 8; }
        .chat-toast.is-visible { display: block; animation: fadeInUp .2s ease both; }

        /* Auf iPhone/Touch-Mobilgeräten kommt die Emoji-Auswahl über die Systemtastatur. */
        @media (hover: none) and (pointer: coarse) {
            .chat-composer > 
        }

        /* IPHONE & MOBILE SPECIFIC OVERRIDES */
        @media (max-width: 900px) and (min-width: 601px) {
            .is-login { padding: 20px; }
            .is-login .app-container { max-width: 820px; }
            .login-shell { grid-template-columns: minmax(0, 1fr) minmax(340px, .88fr); min-height: 610px; }
            .login-visual { padding: 36px 32px; }
            .login-panel { padding: 48px 32px; }
            .login-visual h1 { font-size: 3rem; }
            .login-float-card.storage { width: 64%; }
            .login-float-card.file-one { right: 2%; }
            .login-float-card.file-two { right: -4%; }
        }

        @media (max-width: 600px) {
            body {
                padding-top: max(8px, env(safe-area-inset-top));
                padding-right: max(6px, env(safe-area-inset-right));
                padding-bottom: max(8px, env(safe-area-inset-bottom));
                padding-left: max(6px, env(safe-area-inset-left));
            }
            .app-container { padding: 14px 12px; border-radius: 12px; }
            .header { min-width: 0; padding-bottom: 14px; margin-bottom: 18px; gap: 6px; }
            .header-brand-group { min-width: 0; }
            .brand-btn { min-width: 0; gap: 7px; }
            .brand-text { font-size: 1.14rem; }
            .header-logo svg { width: 31px; height: 31px; }
            .header-chat-slot { margin-left: 1px; padding-left: 8px; }
            .chat-nav-button { min-height: 34px; padding: 0 10px; gap: 6px; border-radius: 11px; font-size: .78rem; }
            .chat-nav-button svg { width: 18px; height: 18px; }
            .header-user-nav { min-width: 0; gap: 4px; }
            .header-user-nav form { display: flex !important; flex: 0 0 auto; }
            .account-menu-trigger {
                width: 34px; height: 34px; min-height: 34px; padding: 0; display: inline-flex;
                align-items: center; justify-content: center; border-radius: 11px; background: #fff;
            }
            .account-menu-trigger .account-menu-username, .account-menu-trigger .account-menu-chevron { display: none; }
            .account-menu-popover { position: absolute; top: calc(100% + 8px); right: 0; bottom: auto; width: min(270px, calc(100vw - 16px)); }
            .btn-icon-nav { width: 34px; height: 34px; flex: 0 0 34px; }
            .chat-unread-badge { top: -6px; right: -6px; }
            .drive-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
            .card-footer { padding: 8px 10px; }
            .card-title { font-size: 0.82rem; }
            .card-meta { font-size: 0.72rem; }
            .quick-action-btn { width: 44px; height: 44px; }
            .folder-row { padding: 10px 12px; }
            .folder-row-icon { width: 36px; height: 36px; }
            .folder-row-title { font-size: 0.95rem; }
            .modal-nav-btn { width: 44px; height: 44px; }
            .modal-prev { left: 6px; }
            .modal-next { right: 6px; }
            #mediaModal { height: 100vh; height: 100dvh; }
            #mediaModal .media-stage { inset: 58px 10px 12px; }
            #mediaModal #modalImg, #mediaModal #modalVideo {
                width: auto !important; height: auto !important;
                max-width: 94vw !important; max-height: 82dvh !important;
            }
            #mediaModal .pdf-modal-wrapper { width: 100%; height: 100%; padding: 0 6px 6px; }
            #mediaModal .modal-close-btn { top: 8px; left: 8px; width: 44px; height: 44px; }
            #mediaModal .media-modal-download { top: 8px; right: 8px; width: 44px; height: 44px; }
            #mediaModal .modal-nav-btn { top: 50%; width: 44px; height: 44px; }
            #mediaModal .modal-prev { left: 6px; }
            #mediaModal .modal-next { right: 6px; }
            .media-modal-meta { top: 8px; left: 56px; right: 56px; height: 42px; }
            .media-modal-name { max-width: 46vw; font-size: .75rem; }
            .media-modal-count { font-size: .68rem; }
            .back-to-top-btn { bottom: 16px; right: 16px; width: 44px; height: 44px; }
            .pdf-modal-wrapper { width: 100%; height: 80vh; }
            
            /* Formular im Admin-Modal auf Handys zweispaltig formatieren */
            .admin-add-form {
                grid-template-columns: 1fr 1fr !important;
            }
            .admin-add-form button {
                grid-column: span 2;
            }
            .is-login { padding: 10px; align-items: flex-start; overflow-y: auto; }
            .is-login .app-container { padding: 0; border-radius: 22px; margin: auto 0; }
            .login-shell { grid-template-columns: 1fr; min-height: 0; border-radius: 22px; }
            .login-visual { padding: 26px 22px 24px; min-height: 315px; }
            .login-brand-row { align-items: flex-start; }
            .login-status { font-size: .67rem; padding: 6px 8px; }
            .login-copy { margin-top: 34px; }
            .login-visual h1 { font-size: clamp(2.15rem, 11vw, 3rem); }
            .login-visual p { font-size: .88rem; line-height: 1.6; margin-top: 15px; }
            .login-dashboard { display: none; }
            .login-visual-footer { margin-top: 26px; font-size: .67rem; }
            .login-visual-footer > span:first-child { display: none; }
            .login-panel { padding: 32px 22px 30px; }
            .login-form { max-width: none; }
            .login-mark { width: 52px; height: 52px; border-radius: 16px; }
            .login-form h2 { font-size: 1.75rem; }

            .chat-shell { padding: 0; background: #fff; }
            .chat-window { width: 100%; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; }
            .chat-sidebar { width: 100%; border-right: 0; padding-top: env(safe-area-inset-top); }
            .chat-sidebar-header { padding: 14px 14px 12px; }
            .chat-contact-list { padding: 6px 8px max(10px, env(safe-area-inset-bottom)); }
            .chat-contact { min-height: 70px; }
            .chat-main { display: none; width: 100%; }
            .chat-window.has-conversation .chat-sidebar { display: none; }
            .chat-window.has-conversation .chat-main { display: flex; }
            .chat-back-button { display: inline-flex; }
            .chat-thread-header { min-height: calc(64px + env(safe-area-inset-top)); padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
            .chat-thread-note { display: none; }
            .chat-thread-header .chat-avatar { width: 41px; height: 41px; flex-basis: 41px; }
            .chat-messages { padding: 15px 10px; }
            .chat-message-wrap { max-width: 86%; }
            .chat-message-bubble { padding: 8px 10px 6px; }
            .chat-attachment { min-width: min(260px, 68vw); }
            .chat-composer-area { padding: 9px 8px max(9px, env(safe-area-inset-bottom)); }
            .chat-composer { gap: 6px; }
            .chat-attach-button, .chat-voice-button, .chat-emoji-button, .chat-send-button { width: 42px; height: 42px; }
            .chat-message-input { min-height: 42px; }
            .chat-composer-hint { display: none; }
            .chat-message-input, .chat-search input { font-size: 16px; }
        }

        /* Der Chat wechselt auch auf kleinen Tablets und im iPhone-Querformat in eine klare Einspalten-Navigation. */
        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            body.chat-open { background: #fff; }
            body.chat-open::after {
                content: ''; position: fixed; inset: 0; z-index: 11999; pointer-events: none; background: #fff;
            }
            body.chat-open .header,
            body.chat-open .drive-main-content,
            body.chat-open .mobile-app-nav,
            body.chat-open .mobile-bottom-storage { visibility: hidden !important; pointer-events: none !important; }
            body.chat-open #chatShell { visibility: visible !important; }
            html[data-theme="dark"] body.chat-open,
            html[data-theme="dark"] body.chat-open::after { background: #161114; }
            .chat-shell { padding: 0; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
            .chat-shell.is-open { animation: none !important; isolation: isolate; contain: layout paint; }
            .chat-window {
                width: 100%; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: minmax(0, 1fr);
                border: 0; border-radius: 0; box-shadow: none; overflow: hidden;
            }
            .chat-sidebar { width: 100%; border-right: 0; padding-top: env(safe-area-inset-top); overflow: hidden; }
            .chat-sidebar-header {
                padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
                box-shadow: 0 1px 0 rgba(33,20,26,.025);
            }
            .chat-sidebar-title-row { margin-bottom: 8px; }
            .chat-sidebar-title { gap: 8px; font-size: 1.05rem; }
            .chat-secure-mark { width: 28px; height: 28px; border-radius: 9px; }
            .chat-search input { min-height: 38px; border-radius: 11px; }
            .chat-window.has-few-contacts .chat-search { display: none; }
            .chat-window.has-few-contacts .chat-sidebar-title-row { margin-bottom: 0; }
            .chat-contact-list {
                padding: 4px max(6px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
                overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
            }
            .chat-contact { min-height: 60px; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; padding: 7px 8px; border-radius: 11px; }
            .chat-contact .chat-avatar { width: 40px; height: 40px; font-size: .84rem; }
            .chat-contact-name { font-size: .87rem; }
            .chat-contact-preview { margin-top: 2px; font-size: .73rem; }
            .chat-contact-time { font-size: .68rem; }
            .chat-search input, .chat-message-input { font-size: 16px; }
            .chat-main { display: none; width: 100%; height: 100%; min-height: 0; overflow: hidden; background: #f4f0f2; }
            .chat-window.has-conversation .chat-sidebar { display: none; }
            .chat-window.has-conversation .chat-main { display: flex; }
            .chat-back-button, .chat-thread-close-button { display: inline-flex; }
            .chat-back-button, .chat-thread-close-button, .chat-close-button { width: 44px; height: 44px; }
            .chat-thread-header {
                min-height: calc(52px + env(safe-area-inset-top));
                padding: calc(4px + env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) 4px max(7px, env(safe-area-inset-left));
                gap: 7px;
            }
            .chat-thread-header .chat-avatar { width: 36px; height: 36px; flex-basis: 36px; }
            .chat-thread-header .chat-avatar { font-size: .78rem; }
            .chat-thread-name { font-size: .91rem; }
            .chat-thread-status { min-height: 15px; margin-top: 0; font-size: .68rem; }
            .chat-thread-note { display: none; }
            .chat-conversation { height: 100%; min-height: 0; overflow: hidden; background: #f4f0f2; }
            .chat-messages {
                padding: 7px max(8px, env(safe-area-inset-right)) 10px max(8px, env(safe-area-inset-left));
                scrollbar-gutter: auto; scrollbar-width: none; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
            }
            .chat-messages::-webkit-scrollbar, .chat-contact-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
            .chat-contact-list { scrollbar-width: none; }

            .chat-day { margin: 4px auto 8px; padding: 4px 8px; font-size: .65rem; }
            .chat-message-row { margin: 1px 0; }
            .chat-message-wrap { max-width: 88%; }
            .chat-message-bubble { padding: 6px 8px 5px; border-radius: 14px 14px 14px 5px; }
            .chat-message-row.is-mine .chat-message-bubble { border-radius: 14px 14px 5px 14px; }
            .chat-message-bubble::after { content: ''; display: block; clear: both; }
            .chat-message-text { display: inline; font-size: .88rem; line-height: 1.3; }
            .chat-message-meta { min-height: 0; float: right; margin: 5px 0 -1px 8px; gap: 3px; font-size: .59rem; line-height: 1; }
            .chat-message-more { width: 22px; height: 18px; margin: -4px -4px -4px 0; font-size: .98rem; opacity: .5; }
            .chat-read-mark { padding-right: 2px; }
            .chat-attachment { min-width: min(240px, 70vw); margin-bottom: 4px; border-radius: 9px; }
            .chat-attachment img { max-height: 220px; }
            .chat-file-card { padding: 8px; gap: 8px; }
            .chat-file-icon { width: 34px; height: 34px; border-radius: 9px; }
            .chat-message-row.has-reactions { margin-bottom: 16px; }
            .chat-reaction-chip { min-height: 21px; padding: 0 5px; font-size: .68rem; }
            .chat-typing-indicator { margin: 3px 0; padding: 8px 11px; }
            .chat-action-menu { max-width: calc(100vw - 28px); }
            .chat-action-reaction { width: 35px; height: 44px; }
            .chat-action-delete { min-height: 44px; }
            .chat-composer-area {
                position: relative; flex: 0 0 auto;
                padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
                background: #fff;
            }
            .chat-composer { min-height: 44px; padding: 2px; gap: 2px; border-radius: 22px; }
            .chat-attach-button, .chat-voice-button, .chat-emoji-button, .chat-send-button { width: 38px; height: 38px; }
            .chat-message-input { min-height: 38px; max-height: 84px; padding: 8px 6px; line-height: 1.24; }
            .chat-attachment-preview { margin: 0 2px 5px; padding: 6px 8px; }
            .chat-composer-hint { display: none; }
            .chat-toast { bottom: calc(58px + env(safe-area-inset-bottom)); }
        }

        @media (max-width: 900px) {
            .mobile-bottom-storage {
                margin: 34px 0 max(18px, env(safe-area-inset-bottom));
            }
            .back-to-top-btn {
                right: max(14px, env(safe-area-inset-right));
                bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
            }
        }

        @media (max-width: 390px) {
            .brand-text { display: none; }
            .chat-message-wrap { max-width: 90%; }
            .chat-action-reaction { width: 33px; }
        }


        /* Privater, bewusst unauffälliger Zugang. */
        @keyframes privateLoginIn {
            from { opacity: 0; transform: translateY(7px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .is-login {
            min-height: 100vh;
            padding: 20px;
            align-items: center;
            justify-content: center;
            background: #f4f0f2;
        }

        .is-login::before,
        .is-login::after {
            display: none !important;
        }

        .is-login .app-container {
            width: 100%;
            max-width: 420px;
            padding: 0;
            margin: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            overflow: visible;
            animation: none;
        }

        .is-login .header {
            display: none;
        }

        .is-login > .app-container > .alert {
            position: static;
            z-index: auto;
            margin: 0 0 12px;
            padding: 11px 13px;
            border: 1px solid #fecaca;
            border-left: 3px solid #dc2626;
            border-radius: 10px;
            background: #fff;
            box-shadow: none;
            color: #7f1d1d;
            font-size: .82rem;
            animation: privateLoginIn .2s ease both;
        }

        .private-login.login-shell {
            display: block;
            min-height: 0;
            overflow: visible;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }

        .private-login .login-panel {
            display: block;
            padding: 34px 32px 30px;
            border: 1px solid #e6dee2;
            border-radius: 14px;
            background: #fff;
            box-shadow: 0 10px 30px rgba(33, 20, 26, .07);
            animation: privateLoginIn .28s ease both;
        }

        .private-login .login-panel::before {
            display: none;
        }

        .private-login .login-form {
            width: 100%;
            max-width: none;
            margin: 0;
            gap: 15px;
        }

        .private-lock {
            width: 42px;
            height: 42px;
            display: grid;
            place-items: center;
            margin-bottom: 3px;
            border: 1px solid #e7dfe3;
            border-radius: 10px;
            background: #fbf9fa;
            color: #614f57;
        }

        .private-login-heading {
            margin-bottom: 4px;
        }

        .private-login-heading h1 {
            margin: 0;
            color: #20151a;
            font-size: 1.45rem;
            line-height: 1.2;
            font-weight: 720;
            letter-spacing: -.02em;
        }

        .private-login-heading p {
            margin: 7px 0 0;
            color: #918289;
            font-size: .84rem;
            line-height: 1.45;
        }

        .private-login .login-label {
            margin-bottom: 6px;
            color: #614f57;
            font-size: .76rem;
            font-weight: 650;
        }

        .private-login .login-field svg {
            left: 14px;
            color: #b09da5;
            transition: color .15s ease;
        }

        .private-login .login-field:focus-within svg {
            color: #614f57;
            transform: translateY(-50%);
        }

        .private-login .login-field input {
            min-height: 48px;
            padding-left: 42px;
            border: 1px solid #dfd4d9;
            border-radius: 9px;
            background: #fff;
            box-shadow: none;
            transition: border-color .15s ease, box-shadow .15s ease;
        }

        .private-login .login-field input:hover {
            border-color: #cbbfc4;
            background: #fff;
        }

        .private-login .login-field input:focus {
            transform: none;
            border-color: #826d77;
            box-shadow: 0 0 0 3px rgba(130, 109, 119, .11);
        }

        .private-login .login-button {
            min-height: 48px;
            margin-top: 3px;
            border-radius: 9px;
            background: linear-gradient(135deg, #b24777, #923f65 62%, #753652);
            border-color: #b24777;
            box-shadow: 0 10px 22px rgba(178, 71, 119, .20);
            transition: background .15s ease, transform .15s ease, box-shadow .15s ease, filter .15s ease;
        }

        .private-login .login-button::before {
            display: block;
            content: '';
            position: absolute;
            top: -35%;
            bottom: -35%;
            width: 38%;
            left: -55%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
            animation: buttonShine 4.8s ease-in-out 1.2s infinite;
            pointer-events: none;
        }

        .private-login .login-button:hover {
            background: linear-gradient(135deg, #b24777, #923f65 58%, #613046);
            box-shadow: 0 14px 28px rgba(178, 71, 119, .28);
            filter: saturate(1.05);
            transform: translateY(-1px);
        }

        .private-login .login-button:active {
            transform: translateY(0);
        }

        .private-login .login-button:disabled {
            background: #b09da5;
            border-color: #b09da5;
            box-shadow: none;
        }

        .login-honeypot {
            position: absolute !important;
            left: -10000px !important;
            width: 1px !important;
            height: 1px !important;
            overflow: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        @media (max-width: 600px) {
            .is-login {
                padding: 14px;
                align-items: center;
                overflow-y: auto;
            }

            .is-login .app-container {
                max-width: 420px;
                margin: auto 0;
            }

            .private-login.login-shell {
                display: block;
                min-height: 0;
                border-radius: 0;
            }

            .private-login .login-panel {
                padding: 28px 22px 25px;
                border-radius: 12px;
            }

            .private-login .login-form {
                max-width: none;
            }
        }

        /* Lesbarkeit: wenige, klar abgestufte Schriftgrößen statt vieler Mini-Größen. */
        body.is-authenticated { font-size: 16px; }
        .is-authenticated button,
        .is-authenticated input,
        .is-authenticated select,
        .is-authenticated textarea { font-size: 1rem; }
        /* Muss nach der allgemeinen Formularregel stehen, sonst werden Picker-Emojis wieder auf 1rem verkleinert. */
        .is-authenticated .chat-emoji-choice { font-size: 3rem; }
        .is-authenticated .user-badge,
        .is-authenticated .storage-header,
        .is-authenticated .breadcrumb-btn,
        .is-authenticated .drop-zone-badge,
        .is-authenticated .drop-zone-text,
        .is-authenticated .upload-status-label,
        .is-authenticated .upload-current-meta,
        .is-authenticated .upload-progress-row,
        .is-authenticated .upload-stat-label,
        .is-authenticated .upload-stat-value,
        .is-authenticated .upload-queue-state,
        .is-authenticated .upload-queue-name,
        .is-authenticated .upload-queue-size,
        .is-authenticated .upload-queue-status,
        .is-authenticated .card-meta,
        .is-authenticated .list-file-meta { font-size: .92rem; }
        .is-authenticated .section-title { font-size: 1.18rem; }
        .is-authenticated .card-title,
        .is-authenticated .list-file-name { font-size: 1rem; }
        .is-authenticated .folder-row-title { font-size: 1.06rem; }

        .js-open-media:focus-visible { outline: 3px solid rgba(178, 71, 119, .55); outline-offset: 2px; }
        .chat-sidebar-title { font-size: 1.15rem; }
        .chat-contact-name { font-size: 1rem; }
        .chat-contact-preview { font-size: .92rem; }
        .chat-contact-time { font-size: .86rem; }
        .chat-contact-unread { font-size: .84rem; }
        .chat-welcome p { font-size: 1rem; }
        .chat-thread-name { font-size: 1.02rem; }
        .chat-thread-status { font-size: .9rem; }
        .chat-thread-note { font-size: .88rem; }
        .chat-loading { font-size: .96rem; }
        .chat-thread-empty strong { font-size: 1.02rem; }
        .chat-thread-empty span { font-size: .94rem; }
        .chat-load-older { font-size: .88rem; }
        .chat-day { font-size: .86rem; }
        .chat-message-text { font-size: 1rem; line-height: 1.5; }
        .chat-message-meta { font-size: .84rem; }
        .chat-file-name { font-size: .96rem; }
        .chat-file-size { font-size: .86rem; }
        .chat-action-delete { font-size: .92rem; }
        .chat-reaction-chip { font-size: .88rem; }
        .chat-attachment-preview { font-size: .94rem; }
        .chat-message-input { font-size: 1rem; line-height: 1.45; }
        .chat-composer-hint { font-size: .86rem; }
        .chat-toast { font-size: .96rem; }

        .private-login .login-label { font-size: .9rem; }
        .private-login .private-login-heading p { font-size: .95rem; }
        .private-login .login-field input { font-size: 16px; }

        @media (max-width: 760px) {
            .is-authenticated .app-container { font-size: 16px; }
            .is-authenticated .chat-nav-button { font-size: .95rem; }
            .is-authenticated .card-title { font-size: 1rem; }
            .is-authenticated .card-meta { font-size: .92rem; line-height: 1.4; }
            .is-authenticated .folder-row-title { font-size: 1.04rem; }
            .is-authenticated .storage-header,
            .is-authenticated .breadcrumb-btn,
            .is-authenticated .drop-zone-text,
            .is-authenticated .list-file-meta { font-size: .95rem; }
            .is-authenticated .list-file-name { font-size: 1.02rem; }

            .chat-shell {
                /* iOS Safari besitzt bei geöffneter Tastatur zwei Viewports:
                   den Layout-Viewport und den tatsächlich sichtbaren visualViewport.
                   Der Chat folgt dem sichtbaren Ausschnitt exakt in X/Y/Breite/Höhe. */
                inset: auto;
                top: var(--chat-viewport-top, 0px);
                left: var(--chat-viewport-left, 0px);
                width: var(--chat-viewport-width, 100vw);
                height: var(--chat-viewport-height, 100dvh);
                min-width: 0;
                min-height: 0;
                transform: translateZ(0);
                -webkit-transform: translateZ(0);
            }
            .chat-window { width: 100%; height: 100%; min-height: 0; }

            /* Tastatur offen: nur der Nachrichtenbereich soll Platz abgeben.
               Der Composer wird bewusst kompakter, damit beim Zeilenumbruch nicht
               ein Viertel des sichtbaren Chats verschwindet. */
            .chat-shell.is-keyboard-open .chat-composer-area {
                padding-top: 4px;
                padding-bottom: 4px;
            }
            .chat-shell.is-keyboard-open .chat-composer {
                min-height: 42px;
                padding: 2px;
                border-radius: 22px;
            }
            .chat-shell.is-keyboard-open .chat-attach-button,
            .chat-shell.is-keyboard-open .chat-voice-button,
            .chat-shell.is-keyboard-open .chat-send-button {
                width: 38px;
                height: 38px;
            }
            .chat-shell.is-keyboard-open .chat-message-input {
                min-height: 38px;
                max-height: 66px;
                padding-top: 7px;
                padding-bottom: 7px;
                line-height: 1.22;
            }
            .chat-shell.is-keyboard-open .chat-messages {
                padding-bottom: 6px;
            }
            .chat-sidebar-title { font-size: 1.01rem; }
            .chat-contact-name { font-size: .92rem; }
            .chat-contact-preview { font-size: .81rem; }
            .chat-contact-time { font-size: .73rem; }
            .chat-contact .chat-avatar { font-size: .87rem; }
            .chat-thread-header .chat-avatar { font-size: .85rem; }
            .chat-thread-name { font-size: .92rem; }
            .chat-thread-status { font-size: .75rem; }
            .chat-day { font-size: .72rem; }
            .chat-message-text { font-size: .90rem; line-height: 1.36; }
            .chat-message-meta { font-size: .67rem; line-height: 1.05; }
            .chat-reaction-chip { font-size: .76rem; }
            .chat-file-name { font-size: .88rem; }
            .chat-file-size { font-size: .74rem; }
            .chat-attachment-preview { font-size: .84rem; }
            .chat-action-delete { font-size: .84rem; }
            .chat-toast { font-size: .84rem; }
            .chat-message-input, .chat-search input { font-size: 16px; }
            .chat-message-input { line-height: 1.28; }
        }

        @media (max-width: 360px) {
            .header { flex-wrap: wrap; row-gap: 8px; }
            .header-brand-group { flex-shrink: 0; }
            .header-user-nav { margin-left: auto; }
            .brand-btn { gap: 5px; }
            .brand-text { font-size: 1.06rem; }
            .header-logo svg { width: 29px; height: 29px; }
            .header-chat-slot { padding-left: 6px; }
            .chat-nav-button { width: 34px; padding: 0; }
            .chat-nav-label { display: none; }
        }

        /* Desktop-Chat näher an Signal: großflächig, ruhig, flache Chat-Bubbles und kompakter Composer. */
        @media (min-width: 761px) and (min-height: 541px) {
            .chat-shell { padding: 16px; background: rgba(16, 12, 14, .64); }
            .chat-window {
                width: min(1680px, calc(100vw - 32px)); height: min(980px, calc(100dvh - 32px));
                min-height: min(680px, calc(100dvh - 32px)); grid-template-columns: 370px minmax(0, 1fr);
                border: 1px solid rgba(255,255,255,.13); border-radius: 14px;
                box-shadow: 0 28px 90px rgba(0,0,0,.38);
            }
            .chat-sidebar { background: #fff; border-right-color: #e1dee0; }
            .chat-sidebar-header { padding: 18px 14px 13px; border-bottom-color: #e5e5e7; }
            .chat-secure-mark { background: #f9ecf2; color: #b94d7e; border-radius: 50%; }
            .chat-search input { min-height: 40px; border-radius: 10px; background: #f1f1f3; }
            .chat-contact-list { padding: 6px; overflow-x: hidden; }
            .chat-contact { min-height: 70px; padding: 10px; border-radius: 10px; overflow: hidden; }
            .chat-contact:hover { background: #f3f3f4; }
            .chat-contact.is-active { border-color: transparent; background: #e7e7e9; box-shadow: none; }
            .chat-avatar { background: linear-gradient(145deg, #b94d7e, #b74277); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
            .chat-presence-dot.is-online { background: #34c759; }
            .chat-contact-unread { background: #b94d7e; }
            .chat-main { background: #f6f6f7; }
            .chat-thread-header { min-height: 66px; padding: 9px 18px; border-bottom-color: #e1dee0; background: #fff; box-shadow: none; }
            .chat-thread-note { display: none; }
            .chat-messages {
                padding: 24px clamp(30px, 4vw, 68px); background: #f6f6f7; scrollbar-gutter: stable;
            }
            .chat-day { margin: 6px auto 14px; border: 0; background: transparent; box-shadow: none; color: #807c7e; font-weight: 600; }
            .chat-message-row { margin: 2px 0; }
            .chat-message-wrap { max-width: min(68%, 660px); }
            .chat-message-bubble {
                padding: 8px 11px 6px; border: 0; border-radius: 18px 18px 18px 6px; background: #e6e6e8; color: #111; box-shadow: none;
            }
            .chat-message-row.is-mine .chat-message-bubble {
                border: 0; border-radius: 18px 18px 6px 18px; background: #b94d7e; color: #fff; box-shadow: none;
            }
            .chat-message-bubble::after { content: ''; display: block; clear: both; }
            .chat-message-text { display: inline; line-height: 1.4; }
            .chat-message-meta { min-height: 0; float: right; margin: 6px 0 -1px 9px; gap: 4px; font-size: .72rem; line-height: 1; color: #807c7e; }
            .chat-message-row.is-mine .chat-message-meta { color: rgba(255,255,255,.72); }
            .chat-read-mark.is-read { color: rgba(255,255,255,.92); }
            .chat-message-more { opacity: 0; }
            .chat-message-bubble:hover .chat-message-more, .chat-message-more:focus-visible, .chat-message-more[aria-expanded="true"] { opacity: .72; }
            .chat-attachment { border-radius: 13px; }
            .chat-attachment img { max-height: 420px; object-fit: cover; }
            .chat-typing-indicator { background: #e6e6e8; box-shadow: none; border-radius: 18px 18px 18px 6px; }
            .chat-composer-area { padding: 11px 18px 13px; border-top-color: #e1dee0; background: #fff; box-shadow: none; }
            .chat-composer { min-height: 48px; padding: 3px; border: 0; border-radius: 24px; background: #f0f0f2; }
            .chat-composer:focus-within { border-color: transparent; background: #f0f0f2; box-shadow: inset 0 0 0 2px rgba(185,77,126,.24); }
            .chat-send-button { background: #b94d7e; box-shadow: none; }
            .chat-send-button:hover { background: #9f4970; }
            .chat-composer-hint { display: none; }
        }


        /* iPhone / Touch: kein dauerhaft blau markierter Safari-Fokus auf Zurück/Schließen. */
        @media (pointer: coarse) {
            .chat-close-button, .chat-back-button, .chat-thread-close-button {
                -webkit-tap-highlight-color: transparent;
            }
            .chat-close-button:focus, .chat-back-button:focus, .chat-thread-close-button:focus:focus,
            .chat-close-button:focus-visible, .chat-back-button:focus-visible, .chat-thread-close-button:focus-visible:focus-visible {
                outline: none;
                border-color: #e9e0e4;
                background: #fff;
                color: #614f57;
                box-shadow: none;
            }
        }

        /* iPhone / Touch: etwas mehr Luft und gut sichtbare Signal-artige Nachrichtenaktionen. */
        @media (max-width: 760px) and (pointer: coarse) {
            .chat-contact-list { gap: 4px; }
            .chat-contact { margin-bottom: 4px; }
            .chat-contact:last-child { margin-bottom: 0; }

            .chat-message-row { margin: 4px 0; }
            .chat-message-row.has-reactions { margin-bottom: 20px; }
            .chat-message-wrap { max-width: calc(100% - 44px); }

            .chat-message-more {
                position: absolute;
                top: 50%;
                width: 30px;
                height: 30px;
                margin: 0;
                display: grid;
                place-items: center;
                border: 1px solid rgba(33, 20, 26, .10);
                border-radius: 50%;
                background: rgba(255,255,255,.96);
                color: #706067;
                box-shadow: 0 1px 3px rgba(33,20,26,.10);
                opacity: .88;
                transform: translateY(-50%);
                z-index: 3;
                -webkit-tap-highlight-color: transparent;
            }
            .chat-message-row:not(.is-mine) .chat-message-more { left: calc(100% + 7px); right: auto; }
            .chat-message-row.is-mine .chat-message-more {
                right: calc(100% + 7px);
                left: auto;
                border-color: rgba(185,77,126,.14);
                background: rgba(255,255,255,.97);
                color: #b94d7e;
            }
            .chat-message-more::before { inset: -7px; }
            .chat-message-more-icon { width: 18px; height: 18px; display: block; }
            .chat-message-more:active,
            .chat-message-more:focus-visible,
            .chat-message-more[aria-expanded="true"] {
                opacity: 1;
                background: #fff;
                box-shadow: 0 0 0 3px rgba(185,77,126,.14), 0 2px 5px rgba(33,20,26,.12);
            }
            .chat-message-row.is-mine .chat-message-more:active,
            .chat-message-row.is-mine .chat-message-more:focus-visible,
            .chat-message-row.is-mine .chat-message-more[aria-expanded="true"] { background: #fff; }
        }

        /* Umschaltbarer Darkmode. Die Einstellung wird pro Benutzer im Browser gespeichert. */
        .theme-icon-sun { display: none; }
        html[data-theme="dark"] {
            color-scheme: dark;
            --bg-color: #100d0e;
            --surface: #1b1518;
            --border: #483c41;
            --border-light: #332a2e;
            --text-main: #f7f4f5;
            --text-muted: #b0a2a8;
            --primary: #d579a2;
            --primary-hover: #dc90b2;
            --danger: #fb6262;
            --danger-bg: #32191c;
            --success: #36d399;
            --success-bg: #10251d;
            --warning: #fbbf24;
        }
        html[data-theme="dark"] .theme-icon-moon { display: none; }
        html[data-theme="dark"] .theme-icon-sun { display: block; }
        html[data-theme="dark"] body { background: #100d0e; color: var(--text-main); }
        html[data-theme="dark"] .app-container { background: #1a1417; border-color: #31282c; box-shadow: 0 10px 38px rgba(0,0,0,.22); }
        html[data-theme="dark"] .header { border-bottom-color: #332a2e; }
        html[data-theme="dark"] .brand-text { color: #fbf8f9; }
        html[data-theme="dark"] .user-badge { background: #221c1f; border-color: #3c3136; color: #f2ebee; }
        html[data-theme="dark"] .account-menu-popover { background: #211b1e; border-color: #41353a; box-shadow: 0 18px 50px rgba(0,0,0,.46); }
        html[data-theme="dark"] .account-menu-heading { border-bottom-color: #382e33; }
        html[data-theme="dark"] .account-menu-heading span { color: #93868c; }
        html[data-theme="dark"] .account-menu-heading strong { color: #f5f0f2; }
        html[data-theme="dark"] .account-menu-item { color: #d6cbd0; }
        html[data-theme="dark"] .account-menu-item:hover, html[data-theme="dark"] .account-menu-item:focus-visible { background: #30272b; color: #e2a4c0; }
        html[data-theme="dark"] .btn-icon-nav,
        html[data-theme="dark"] .list-action-btn { background: #1f191c; border-color: #41353a; color: #b4a6ac; }
        html[data-theme="dark"] .btn-icon-nav:hover,
        html[data-theme="dark"] .list-action-btn:hover { background: #2e2529; color: #dd93b4; }
        html[data-theme="dark"] input[type="password"],
        html[data-theme="dark"] input[type="text"],
        html[data-theme="dark"] input[type="search"],
        html[data-theme="dark"] input[type="url"],
        html[data-theme="dark"] select,
        html[data-theme="dark"] textarea { background: #1f191c; border-color: #43373c; color: #f7f4f5; }
        html[data-theme="dark"] input::placeholder,
        html[data-theme="dark"] textarea::placeholder { color: #8c7d84; }
        html[data-theme="dark"] .btn-secondary { background: #3a2f34; color: #f5f0f2; }
        html[data-theme="dark"] .btn-secondary:hover { background: #483c41; }
        html[data-theme="dark"] .storage-widget,
        html[data-theme="dark"] .folder-row,
        html[data-theme="dark"] .empty-state,
        html[data-theme="dark"] .file-icon-box,
        html[data-theme="dark"] .list-icon-box { background: #1f191c; }
        html[data-theme="dark"] .folder-row:hover,
        html[data-theme="dark"] .file-item:hover { background: #261e22; }
        html[data-theme="dark"] .alert-error { background: #32191c; color: #ffb3b3; border-left-color: #fb6262; }
        html[data-theme="dark"] .alert-success { background: #10251d; color: #8ee7c0; border-left-color: #36d399; }
        html[data-theme="dark"] .drop-zone-title { color: #f7f4f5; }
        html[data-theme="dark"] .drop-zone-hint { background: rgba(42,33,37,.9); border-color: #41363b; color: #bbb0b5; }
        html[data-theme="dark"] .upload-drop-icon { background: linear-gradient(145deg, #301f27, #1f191c); border-color: #5d3949; box-shadow: 0 12px 28px rgba(0,0,0,.2); }
        html[data-theme="dark"] .drop-zone { background: linear-gradient(180deg, #1f191c 0%, #1d1619 100%); border-color: #41353a; }
        html[data-theme="dark"] .drop-zone:hover:not(.disabled),
        html[data-theme="dark"] .drop-zone.dragover:not(.disabled) { background: #261d21; border-color: #d579a2; }
        html[data-theme="dark"] .progress-wrapper { background: linear-gradient(145deg, #1f191c, #1d1619); border-color: #41353a; }
        html[data-theme="dark"] .progress-wrapper.is-complete { background: linear-gradient(145deg, #1f191c, #10251d); border-color: #245f46; }
        html[data-theme="dark"] .upload-progress-ring { background: conic-gradient(var(--primary) var(--upload-progress), #372c31 0); }
        html[data-theme="dark"] .upload-progress-ring::after { background: #1e181b; box-shadow: none; }
        html[data-theme="dark"] .upload-progress-ring-value,
        html[data-theme="dark"] .upload-current-name,
        html[data-theme="dark"] .upload-stat-value { color: #f6f1f3; }
        html[data-theme="dark"] .upload-status-label,
        html[data-theme="dark"] .upload-progress-row strong { color: #d4cacf; }
        html[data-theme="dark"] .upload-progress-row,
        html[data-theme="dark"] .upload-current-meta,
        html[data-theme="dark"] .upload-stat-label { color: #a6979e; }
        html[data-theme="dark"] .progress-container,
        html[data-theme="dark"] .progress-container.is-secondary { background: #392e33; }
        html[data-theme="dark"] .upload-stat { background: rgba(37,29,33,.9); border-color: #3f3338; }
        html[data-theme="dark"] .upload-queue { border-top-color: #382e33; }
        html[data-theme="dark"] .upload-queue-item { color: #afa1a7; }
        html[data-theme="dark"] .upload-queue-item.is-active { background: #3e232f; color: #e6b0c8; }
        html[data-theme="dark"] .upload-queue-item.is-cancelled { background: #2d2115; color: #f6b76c; }
        html[data-theme="dark"] .upload-actions { border-top-color: #382e33; }
        html[data-theme="dark"] .upload-cancel-button { background: #251e21; border-color: #6b3a3a; color: #ff9b95; }
        html[data-theme="dark"] .upload-cancel-button:hover { background: #2c2022; border-color: #8b4b4b; }
        html[data-theme="dark"] .upload-queue-item,
        html[data-theme="dark"] .upload-queue-state { background: #231b1f; border-color: #3f3338; }
        html[data-theme="dark"] .card { background: #1b1518; border-color: #332a2e; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
        html[data-theme="dark"] .card-footer { background: #1b1518; border-top-color: #332a2e; }
        html[data-theme="dark"] .file-list { border-color: #332a2e; }
        html[data-theme="dark"] .file-item { background: #1b1518; border-bottom-color: #332a2e; }
        html[data-theme="dark"] .card-more-menu[open] > summary,
        html[data-theme="dark"] .card-more-menu > summary:hover { background: #2e2529; }
        html[data-theme="dark"] .card-more-popover { background: #211b1e; border-color: #43373c; box-shadow: 0 16px 36px rgba(0,0,0,.36); }
        html[data-theme="dark"] .card-more-popover a:hover,
        html[data-theme="dark"] .card-more-popover button:hover { background: #30272b; }
        html[data-theme="dark"] .breadcrumbs { color: var(--text-muted); }
        html[data-theme="dark"] .breadcrumb-btn { color: #b0a2a8; }
        html[data-theme="dark"] .modal:not(#mediaModal) { background-color: rgba(8, 5, 6, .68); }
        html[data-theme="dark"] .confirm-modal-box { background: #1f191c; border: 1px solid #41353a; box-shadow: 0 28px 80px rgba(0,0,0,.48); }

        html[data-theme="dark"] .admin-dialog { background: #1b1518; border-color: #3b3035; box-shadow: 0 32px 96px rgba(0,0,0,.52); }
        html[data-theme="dark"] .admin-dialog-header { border-bottom-color: #382e33; }
        html[data-theme="dark"] .admin-dialog-icon { background: #3e232f; color: #dc91b3; }
        html[data-theme="dark"] .admin-close-button { background: #211b1e; border-color: #41353a; color: #baacb2; }
        html[data-theme="dark"] .admin-close-button:hover { background: #30272b; color: #f7f4f5; }
        html[data-theme="dark"] .admin-user-list { background: #1e181b; border-color: #3a2f34; }
        html[data-theme="dark"] .admin-user-row { border-bottom-color: #382e33; }
        html[data-theme="dark"] .admin-role-badge.is-admin { background: #3e232f; color: #e6b0c8; }
        html[data-theme="dark"] .admin-role-badge.is-user { background: #32292d; color: #c4b9be; }
        html[data-theme="dark"] .admin-current-user { color: #9b8c93; }
        html[data-theme="dark"] .admin-delete-user:hover { background: #32191c; }
        html[data-theme="dark"] .admin-add-panel { background: #1f191c; border-color: #3f3338; }

        html[data-theme="dark"] .chat-shell { background: rgba(7,4,5,.78); }
        html[data-theme="dark"] .chat-window { background: #171215; border-color: #44393e; }
        html[data-theme="dark"] .chat-sidebar,
        html[data-theme="dark"] .chat-sidebar-header,
        html[data-theme="dark"] .chat-thread-header,
        html[data-theme="dark"] .chat-thread-search-bar,
        html[data-theme="dark"] .chat-composer-area { background: #1b1518; border-color: #382e33; }
        html[data-theme="dark"] .chat-contact:hover { background: #282024; }
        html[data-theme="dark"] .chat-contact.is-active { background: #31282c; border-color: transparent; }
        html[data-theme="dark"] .chat-search input,
        html[data-theme="dark"] .chat-thread-search-bar input,
        html[data-theme="dark"] .chat-composer { background: #271f23; border-color: #41363b; color: #f7f4f5; }
        html[data-theme="dark"] .chat-search input:focus,
        html[data-theme="dark"] .chat-thread-search-bar input:focus,
        html[data-theme="dark"] .chat-composer:focus-within { background: #271f23; border-color: #b7688b; box-shadow: inset 0 0 0 2px rgba(213,121,162,.22); }
        html[data-theme="dark"] .chat-main,
        html[data-theme="dark"] .chat-messages { background: #161114; }
        html[data-theme="dark"] .chat-welcome h2,
        html[data-theme="dark"] .chat-thread-name,
        html[data-theme="dark"] .chat-contact-name { color: #f7f4f5; }
        html[data-theme="dark"] .chat-secure-mark { background: #3e232f; color: #e2a2bf; }
        html[data-theme="dark"] .chat-contact-preview,
        html[data-theme="dark"] .chat-contact-time,
        html[data-theme="dark"] .chat-thread-status,
        html[data-theme="dark"] .chat-welcome,
        html[data-theme="dark"] .chat-composer-hint { color: #a6979e; }
        html[data-theme="dark"] .chat-contact-list.is-search-mode { background: #1b1518; }
        html[data-theme="dark"] .chat-search-summary-title,
        html[data-theme="dark"] .chat-search-group-name { color: #f7f1f3; }
        html[data-theme="dark"] .chat-search-summary-context,
        html[data-theme="dark"] .chat-search-group-status { color: #a6979e; }
        html[data-theme="dark"] .chat-search-summary-limit { background: #3a2715; color: #fdba74; }
        html[data-theme="dark"] .chat-search-group { background: #211b1e; border-color: #3e3338; box-shadow: none; }
        html[data-theme="dark"] .chat-search-group-header { background: #211b1e; border-bottom-color: #392f34; }
        html[data-theme="dark"] .chat-search-group-count { background: #3e232f; color: #e2a2bf; }
        html[data-theme="dark"] .chat-search-hit { border-bottom-color: #382d32; color: #f7f1f3; }
        html[data-theme="dark"] .chat-search-hit:last-child { border-bottom-color: transparent; }
        html[data-theme="dark"] .chat-search-hit:hover,
        html[data-theme="dark"] .chat-search-hit:focus-visible { background: #36242c; }
        html[data-theme="dark"] .chat-search-hit-snippet { color: #c7bac0; }
        html[data-theme="dark"] .chat-search-highlight { background: #854d0e; color: #fef3c7; }
        html[data-theme="dark"] .chat-search-empty-icon { background: #3e232f; color: #e2a2bf; }
        html[data-theme="dark"] .chat-search-empty-title { color: #ece4e8; }
        html[data-theme="dark"] .chat-message-bubble { background: #31292d; color: #f6f3f4; border-color: transparent; }
        html[data-theme="dark"] .chat-message-row.is-mine .chat-message-bubble { background: #b94d7e; color: #fff; }
        html[data-theme="dark"] .chat-message-bubble.is-deleted { background: #271f23; color: #a2949a; }
        html[data-theme="dark"] .chat-day { color: #9b8c93; background: transparent; border-color: transparent; }
        html[data-theme="dark"] .chat-typing-indicator { background: #31292d; box-shadow: none; }
        html[data-theme="dark"] .chat-reply-quote { background: rgba(213,121,162,.10); color: #cdbfc5; }
        html[data-theme="dark"] .chat-voice-status { background: #32191c; color: #ff9aaa; }
        html[data-theme="dark"] .chat-attach-button,
        html[data-theme="dark"] .chat-voice-button,
        html[data-theme="dark"] .chat-emoji-button { color: #b0a2a8; }
        html[data-theme="dark"] .chat-attach-button:hover,
        html[data-theme="dark"] .chat-voice-button:hover,
        html[data-theme="dark"] .chat-emoji-button:hover,
        html[data-theme="dark"] .chat-emoji-button[aria-expanded="true"] { background: #372e32; color: #ebe1e6; }
        html[data-theme="dark"] .chat-emoji-picker-header { border-bottom-color: #41353a; }
        html[data-theme="dark"] .chat-emoji-choice:hover,
        html[data-theme="dark"] .chat-emoji-choice:focus-visible { background: #372e32; }
        html[data-theme="dark"] .chat-emoji-empty { color: #b0a2a8; }
        html[data-theme="dark"] .chat-action-menu,
        html[data-theme="dark"] .chat-emoji-picker { background: #251e21; border-color: #463a3f; color: #f7f4f5; box-shadow: 0 18px 50px rgba(0,0,0,.48); }
        html[data-theme="dark"] .chat-action-reaction:hover,
        html[data-theme="dark"] .chat-action-item:hover,
        html[data-theme="dark"] .chat-action-reaction:focus-visible,
        html[data-theme="dark"] .chat-action-item:focus-visible { background: #372e32; }
        html[data-theme="dark"] .chat-reaction-chip { background: #271f23; border-color: #4c4045; color: #e6dfe2; }
        html[data-theme="dark"] .chat-reaction-chip.is-mine { background: #4b2737; border-color: #854d66; }
        html[data-theme="dark"] .chat-attachment-preview { background: #251e21; border-color: #45393e; color: #d3cace; }
        html[data-theme="dark"] .chat-file-icon { background: #32292d; color: #dd92b4; }
        html[data-theme="dark"] .chat-thread-search-button,
        html[data-theme="dark"] .chat-close-button,
        html[data-theme="dark"] .chat-back-button,
        html[data-theme="dark"] .chat-thread-close-button { background: #211b1e; border-color: #41353a; color: #b9adb2; }
        html[data-theme="dark"] .chat-message-sender { color: #e4afd2; }
        html[data-theme="dark"] .chat-message-more { background: rgba(39,32,35,.97); border-color: #4d4146; color: #c8bdc2; }
        html[data-theme="dark"] .chat-message-row.is-mine .chat-message-more { background: rgba(39,32,35,.97); color: #e2a4c0; border-color: #4d4146; }
        @media (pointer: coarse) {
            html[data-theme="dark"] .chat-close-button:focus,
            html[data-theme="dark"] .chat-back-button:focus,
            html[data-theme="dark"] .chat-thread-close-button:focus,
            html[data-theme="dark"] .chat-close-button:focus-visible,
            html[data-theme="dark"] .chat-back-button:focus-visible,
            html[data-theme="dark"] .chat-thread-close-button:focus-visible,
            html[data-theme="dark"] .chat-message-more:active,
            html[data-theme="dark"] .chat-message-more:focus-visible,
            html[data-theme="dark"] .chat-message-more[aria-expanded="true"],
            html[data-theme="dark"] .chat-message-row.is-mine .chat-message-more:active,
            html[data-theme="dark"] .chat-message-row.is-mine .chat-message-more:focus-visible,
            html[data-theme="dark"] .chat-message-row.is-mine .chat-message-more[aria-expanded="true"] { background: #32292d; box-shadow: 0 0 0 3px rgba(213,121,162,.16); }
        }


        /* Desktop-Dateioberfläche: bewusst an der Informationsarchitektur moderner Cloud-Drives orientiert.
           Der Chat behält seine bestehende Darstellung und seine eigenen Breakpoints. */
        .mobile-feature-menu-launcher {
            width: 100%; min-height: 56px; margin: 0 0 16px; padding: 9px 12px;
            display: flex; align-items: center; gap: 11px; border: 1px solid #eadfe4; border-radius: 12px;
            background: linear-gradient(135deg,#fdf9fb,#f8f2f5); color: #433038; text-align: left; font: inherit;
            box-shadow: 0 4px 14px rgba(33,20,26,.05); cursor: pointer;
        }
        .mobile-feature-menu-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: #523240; color: #fff; }
        .mobile-feature-menu-copy { min-width: 0; flex: 1; }
        .mobile-feature-menu-copy strong { display: block; font-size: .86rem; }
        .mobile-feature-menu-copy span { display: block; margin-top: 2px; overflow: hidden; color: #8d7a82; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
        .mobile-feature-menu-arrow { color: #9b8a92; }
        .mobile-feature-menu-launcher:focus-visible { outline: 3px solid rgba(200,101,145,.22); outline-offset: 2px; }
        .drive-desktop-sidebar { display: none; }
        .drive-main-content { min-width: 0; }
        .drive-main-content .folder-create-icon { display: none; }

        @media (min-width: 901px) {
            .mobile-feature-menu-launcher { display: none; }
            body.is-authenticated {
                display: block;
                min-height: 100vh;
                padding: 0;
                background: #f5f6f8;
            }
            .is-authenticated .app-container {
                width: 100%; max-width: none; min-height: 100vh; margin: 0; padding: 0;
                overflow: visible; border: 0; border-radius: 0; background: #f5f6f8; box-shadow: none; animation: none;
            }
            .is-authenticated .header {
                position: sticky; top: 0; z-index: 950;
                min-height: 64px; margin: 0; padding: 0 22px;
                border-bottom: 1px solid #e8e5e6;
                background: rgba(255,255,255,.96);
                box-shadow: 0 1px 2px rgba(33,20,26,.035);
                backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
            }
            .is-authenticated .brand-btn { gap: 9px; }
            .is-authenticated .header-logo { filter: none; }
            .is-authenticated .brand-text { font-size: 1.33rem; letter-spacing: -.035em; }
            .is-authenticated .header-chat-slot { margin-left: 22px; padding-left: 0; border-left: 0; }
            .is-authenticated .chat-nav-button {
                min-height: 38px; padding: 0 14px; border-radius: 8px;
                box-shadow: none;
            }
            .is-authenticated .header-user-nav { gap: 6px; }
            .is-authenticated .user-badge {
                min-height: 38px; padding: 0 11px; border-radius: 8px;
                background: transparent; border-color: transparent;
            }
            .is-authenticated .btn-icon-nav {
                width: 38px; height: 38px; flex: 0 0 38px;
                border-radius: 8px; border-color: transparent; background: transparent; color: #725e67;
                box-shadow: none;
            }
            .is-authenticated .btn-icon-nav:hover { background: #f4f0f2; color: #82395a; }
            .is-authenticated .btn-icon-nav svg { transform: none !important; }

            .is-authenticated .app-container > .alert {
                position: relative; z-index: 2;
                margin: 16px 28px 0 264px;
                max-width: calc(100vw - 292px);
            }

            .drive-desktop-sidebar {
                position: fixed; z-index: 700; left: 0; top: 64px; bottom: 0;
                width: 236px; padding: 18px 12px 14px;
                display: flex; flex-direction: column; gap: 18px;
                overflow-y: auto; overflow-x: hidden;
                border-right: 1px solid #e8e5e6; background: #f8f9fb;
            }
            .drive-sidebar-label {
                padding: 0 10px 6px; color: #8d7e85; font-size: .7rem; font-weight: 760;
                letter-spacing: .055em; text-transform: uppercase;
            }
            .drive-sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
            .drive-sidebar-link {
                min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 11px;
                border-radius: 8px; color: #433038; text-decoration: none;
                font-size: .91rem; font-weight: 620; transition: background .15s ease, color .15s ease;
            }
            .drive-sidebar-link svg { width: 19px; height: 19px; flex: 0 0 auto; color: #836c76; }
            .drive-sidebar-link:hover { background: #f3eff1; }
            .drive-sidebar-link.is-active { background: #f9ecf2; color: #a53e6c; font-weight: 720; }
            .drive-sidebar-link.is-active svg { color: #af4474; }
            .drive-sidebar-menu-button { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; }
            .drive-sidebar-menu-button.is-menu-primary { background: #f9ecf2; color: #a53e6c; font-weight: 720; }
            .drive-sidebar-menu-button.is-menu-primary svg { color: #af4474; }
            .drive-sidebar-divider { height: 1px; margin: 2px 8px; background: #e9e4e6; }
            .drive-sidebar-storage {
                margin-top: auto; padding: 13px 11px 10px;
                border-top: 1px solid #e9e4e6; color: #736169;
            }
            .drive-sidebar-storage strong { display: block; margin-bottom: 4px; color: #3e2c34; font-size: .82rem; }
            .drive-sidebar-storage-copy { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: .72rem; }
            .drive-sidebar-storage .storage-bar-bg { height: 5px; background: #e9e3e5; }

            .drive-main-content {
                width: auto; min-height: calc(100vh - 64px); margin-left: 236px;
                padding: 24px 30px 52px; background: #fff;
            }
            .drive-main-content > .storage-widget { display: none; }
            .drive-main-content .toolbar { margin: 0 0 14px; }
            .drive-main-content .folder-form {
                width: auto; max-width: 760px; flex: 0 1 760px; gap: 8px;
                padding: 0; border: 0; background: transparent;
            }
            .drive-main-content .folder-form input {
                min-height: 40px; padding: 0 12px; border-color: #dbd3d7; border-radius: 7px; background: #fff;
            }
            .drive-main-content .folder-form .btn { min-height: 40px; padding: 0 15px; border-radius: 7px; box-shadow: none; }

            .drive-main-content .breadcrumbs {
                gap: 1px; margin: 0 0 18px; padding: 0; overflow: visible;
            }
            .drive-main-content .breadcrumb-btn {
                min-height: 32px; padding: 0 7px; border: 0; border-radius: 6px;
                background: transparent; color: #725e67; font-size: .83rem; font-weight: 570;
            }
            .drive-main-content .breadcrumb-btn:hover { background: #f4f1f2; color: #a53e6c; }
            .drive-main-content .breadcrumb-separator { color: #aea2a7; }

            .drive-main-content .upload-section { margin-bottom: 22px; }
            .drive-main-content .drop-zone {
                min-height: 82px; padding: 13px 16px;
                flex-direction: row; align-items: center; justify-content: flex-start;
                border: 1px dashed #d2c9cd; border-radius: 9px;
                background: #fafbfc; text-align: left;
                box-shadow: none; transform: none;
            }
            .drive-main-content .drop-zone::before,
            .drive-main-content .upload-drop-icon::before { display: none; }
            .drive-main-content .drop-zone:hover:not(.disabled) { background: #fbf8f9; border-color: #c795ac; box-shadow: none; transform: none; }
            .drive-main-content .upload-drop-icon {
                width: 42px; height: 42px; margin: 0 13px 0 0;
                border: 0; border-radius: 9px; background: #faeef3; box-shadow: none; animation: none;
            }
            .drive-main-content .upload-drop-icon svg { width: 22px; height: 22px; }
            .drive-main-content .drop-zone-title { flex: 0 0 auto; font-size: .91rem; }
            .drive-main-content .drop-zone-text {
                flex: 0 1 auto; min-width: 0; margin: 0 0 0 12px; padding-left: 12px;
                border-left: 1px solid #e6dee2; color: #87757d; font-size: .76rem; line-height: 1.35;
            }
            .drive-main-content .drop-zone-hints { margin: 0 0 0 auto; justify-content: flex-end; }
            .drive-main-content .drop-zone-hint { padding: 4px 7px; background: #fff; font-size: .64rem; }

            .drive-main-content .section-title {
                margin: 24px 0 10px; padding: 0 0 8px;
                border-bottom: 1px solid #eae7e8; color: #37282f;
                font-size: 1rem; font-weight: 680;
            }
            .drive-main-content .section-title svg { width: 17px; height: 17px; color: #836c76; }

            .drive-main-content .folders-container {
                gap: 0; margin-bottom: 20px; overflow: hidden;
                border: 1px solid #ebe6e8; border-radius: 9px; background: #fff;
            }
            .drive-main-content .folder-row {
                min-height: 56px; padding: 7px 12px;
                border: 0; border-bottom: 1px solid #f2eff0; border-radius: 0;
                background: #fff; animation: none; transform: none;
            }
            .drive-main-content .folder-row:last-child { border-bottom: 0; }
            .drive-main-content .folder-row:hover { background: #faf8f9; border-color: #f2eff0; }
            .drive-main-content .folder-row-icon { width: 36px; height: 36px; }
            .drive-main-content .folder-row-title { font-size: .92rem; font-weight: 620; }

            .drive-main-content .file-list { border-color: #ebe6e8; border-radius: 9px; background: #fff; }
            .drive-main-content .file-item {
                min-height: 64px; padding: 7px 12px; gap: 11px; animation: none; background: #fff;
            }
            .drive-main-content .file-item:hover { background: #faf8f9; }
            .drive-main-content .list-thumb,
            .drive-main-content .list-canvas-thumb,
            .drive-main-content .list-icon-box { width: 46px; height: 46px; border-radius: 6px; }
            .drive-main-content.is-dateien-context .list-thumb.pdf-thumb { width: 112px; height: 148px; border-radius: 8px; }
            .drive-main-content .list-file-info { gap: 2px; }
            .drive-main-content .list-file-name { font-size: .9rem; font-weight: 600; word-break: normal; overflow-wrap: anywhere; }
            .drive-main-content .list-file-meta { font-size: .75rem; }
            .drive-main-content .list-action-btn { width: 34px; height: 34px; border-radius: 7px; background: transparent; border-color: transparent; }
            .drive-main-content .list-action-btn:hover { background: #f3eff1; }

            .drive-main-content .drive-grid {
                grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px;
            }
            .drive-main-content .card {
                border-color: #eae5e7; border-radius: 9px; box-shadow: none; animation: none;
            }
            .drive-main-content .card:hover { transform: none; border-color: #dbd1d6; box-shadow: 0 2px 9px rgba(33,20,26,.07); }
            .drive-main-content .card-footer { padding: 9px 10px; border-top-color: #edeaeb; }
            .drive-main-content .card-title { font-size: .84rem; font-weight: 620; }
            .drive-main-content .card-meta { font-size: .72rem; }
            .drive-main-content .card-more-menu > summary { border-radius: 6px; }

            .is-authenticated .back-to-top-btn { right: 24px; bottom: 24px; }
        }

        html[data-theme="dark"] .drive-desktop-sidebar { background: #1b1518; border-right-color: #32292d; }
        html[data-theme="dark"] .drive-sidebar-label { color: #8e8086; }
        html[data-theme="dark"] .drive-sidebar-link { color: #d6ccd1; }
        html[data-theme="dark"] .drive-sidebar-link svg { color: #a4959c; }
        html[data-theme="dark"] .drive-sidebar-link:hover { background: #282024; }
        html[data-theme="dark"] .drive-sidebar-link.is-active { background: #3d202d; color: #e6afc8; }
        html[data-theme="dark"] .drive-sidebar-link.is-active svg { color: #e09bba; }
        html[data-theme="dark"] .drive-sidebar-menu-button.is-menu-primary { background: #3d202d; color: #e6afc8; }
        html[data-theme="dark"] .drive-sidebar-menu-button.is-menu-primary svg { color: #e09bba; }
        html[data-theme="dark"] .mobile-feature-menu-launcher { background: #21191d; border-color: #43373c; color: #f2eaee; }
        html[data-theme="dark"] .mobile-feature-menu-copy span { color: #aa9aa1; }
        html[data-theme="dark"] .drive-sidebar-divider,
        html[data-theme="dark"] .drive-sidebar-storage { border-color: #32292d; }
        html[data-theme="dark"] .drive-sidebar-storage { color: #a6989e; }
        html[data-theme="dark"] .drive-sidebar-storage strong { color: #e7e0e3; }
        html[data-theme="dark"] .drive-sidebar-storage .storage-bar-bg { background: #3a3035; }

        @media (min-width: 901px) {
            html[data-theme="dark"] body.is-authenticated,
            html[data-theme="dark"] .is-authenticated .app-container { background: #161114; }
            html[data-theme="dark"] .is-authenticated .header { background: rgba(26,20,23,.96); border-bottom-color: #332a2e; box-shadow: none; }
            html[data-theme="dark"] .is-authenticated .btn-icon-nav { color: #bcafb5; }
            html[data-theme="dark"] .is-authenticated .btn-icon-nav:hover { background: #2e2529; color: #e19fbc; }
            html[data-theme="dark"] .is-authenticated .user-badge { color: #e7e0e3; }
            html[data-theme="dark"] .drive-main-content { background: #191316; }
            html[data-theme="dark"] .drive-page-kicker { color: #93868c; }
            html[data-theme="dark"] .drive-page-title { color: #f6f1f3; }
            html[data-theme="dark"] .drive-main-content .breadcrumb-btn { color: #b0a3a9; }
            html[data-theme="dark"] .drive-main-content .breadcrumb-btn:hover { background: #271f23; color: #e6afc8; }
            html[data-theme="dark"] .drive-main-content .drop-zone { background: #1e181b; border-color: #41363b; }
            html[data-theme="dark"] .drive-main-content .drop-zone:hover:not(.disabled) { background: #271c21; border-color: #9b657d; }
            html[data-theme="dark"] .drive-main-content .upload-drop-icon { background: #3b212d; }
            html[data-theme="dark"] .drive-main-content .drop-zone-text { border-left-color: #483b41; color: #b0a2a8; }
            html[data-theme="dark"] .drive-main-content .drop-zone-hint { background: #211b1e; border-color: #41353a; }
            html[data-theme="dark"] .drive-main-content .section-title { color: #eae3e6; border-bottom-color: #332a2e; }
            html[data-theme="dark"] .drive-main-content .folders-container,
            html[data-theme="dark"] .drive-main-content .file-list,
            html[data-theme="dark"] .drive-main-content .card { background: #1e181b; border-color: #362c31; }
            html[data-theme="dark"] .drive-main-content .folder-row,
            html[data-theme="dark"] .drive-main-content .file-item { background: #1e181b; border-color: #33292e; }
            html[data-theme="dark"] .drive-main-content .folder-row:hover,
            html[data-theme="dark"] .drive-main-content .file-item:hover { background: #261d21; }
            html[data-theme="dark"] .drive-main-content .card-footer { background: #1e181b; border-top-color: #362c31; }
            html[data-theme="dark"] .drive-main-content .folder-form input { background: #1f191c; border-color: #41353a; color: #f6f1f3; }
        }

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


        /* Lady_Carmi: gemischte Cloud-Galerie – Bilder/Videos als Vorschau, sonstige Dateien als Dateikacheln. */
        .lady-gallery-toolbar {
            margin: -2px 0 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
            border: 1px solid #ede6e9; border-radius: 12px; background: #fbf9fa;
        }
        .lady-gallery-toolbar-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .lady-gallery-toolbar-copy strong { color: #2a1c22; font-size: .9rem; font-weight: 760; }
        .lady-gallery-toolbar-copy span { color: #8d7a82; font-size: .75rem; line-height: 1.35; }
        .lady-gallery-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
        .lady-gallery-tool-btn {
            min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
            border: 1px solid #e3dade; border-radius: 9px; background: #fff; color: #614b55; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
        }
        .lady-gallery-tool-btn:hover { border-color: #cec0c6; background: #fbf9fa; }
        .lady-gallery-tool-btn.is-primary { border-color: #b24777; background: #b24777; color: #fff; }
        .lady-gallery-tool-btn.is-primary:hover { background: #923f65; }
        .lady-gallery-tool-btn.is-saving { opacity: .65; cursor: wait; }
        .lady-gallery-tool-btn.is-surprise { border-color: transparent; background: linear-gradient(135deg,#a54184,#db2777); color: #fff; box-shadow: 0 6px 16px rgba(165,65,132,.20); }
        .lady-gallery-tool-btn.is-surprise:hover { border-color: transparent; background: linear-gradient(135deg,#873f6f,#be185d); }
        .lady-gallery-tool-btn.is-surprise:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
        .lady-gallery-tool-btn.is-surprise.is-shuffling svg { animation: boardSparkle .5s ease both; }
        @keyframes boardSparkle { 50% { transform: rotate(24deg) scale(1.3); } }

        .lady-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); align-items: stretch; gap: 12px; width: 100%; }
        .lady-gallery-tile {
            position: relative; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #20151a;
            transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
        }
        .lady-gallery-media,
        .lady-gallery-file-main {
            width: 100%; height: 100%; min-width: 0; display: grid; place-items: center; overflow: hidden;
            border: 1px solid #ede6e9; border-radius: 12px; background: #f7f4f5; color: #614b55; text-decoration: none;
            box-shadow: 0 1px 2px rgba(33,20,26,.035); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
        }
        button.lady-gallery-media, button.lady-gallery-file-main { font: inherit; cursor: pointer; }
        .lady-gallery-media { position: relative; isolation: isolate; padding: 0; cursor: zoom-in; background: #20151a; contain: paint; }
        .lady-gallery-media.is-cover,
        .lady-gallery-video { border-color: rgba(33,20,26,.16); }
        .lady-gallery-media:hover, .lady-gallery-file-main:hover { border-color: #d6cbd0; box-shadow: 0 5px 16px rgba(33,20,26,.075); }
        /* Bildkacheln werden bewusst vollständig ausgefüllt: keine weißen Balken,
           keine künstlichen Randflächen und kein zusätzlicher Hintergrund-Layer. */
        .lady-gallery-media > .lady-gallery-foreground,
        .lady-gallery-media > video,
        .lady-gallery-media > .pdf-thumb {
            width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important;
            max-width: 100% !important; max-height: 100% !important; display: block !important;
            object-fit: contain !important; object-position: 50% 50% !important; transform: none !important;
            border-radius: 10px;
        }
        .lady-gallery-media.is-cover > .lady-gallery-foreground {
            position: relative; z-index: 1; object-fit: cover !important; background: transparent !important; border-radius: 11px;
        }
        .lady-gallery-video { position: relative; background: radial-gradient(circle at 50% 42%, #402e36 0, #20151a 64%, #150d11 100%); }
        .lady-gallery-video > video { position: relative; z-index: 1; background: transparent !important; }
        .lady-gallery-media.is-document-preview { padding: 8px; background: #f2ecef; }
        .lady-gallery-media.is-document-preview > .pdf-thumb { background: #fff !important; border-radius: 6px; }
        .lady-gallery-play {
            position: absolute; left: 50%; top: 50%; z-index: 3; width: 48px; height: 48px; transform: translate(-50%, -50%); display: grid; place-items: center;
            border-radius: 50%; background: rgba(33,20,26,.72); color: #fff; box-shadow: 0 5px 18px rgba(33,20,26,.24); pointer-events: none;
        }
        .lady-gallery-file-main { padding: 18px; grid-template-rows: 1fr auto; gap: 11px; text-align: center; }
        .lady-gallery-file-icon { align-self: end; color: #88747d; }
        .lady-gallery-file-name {
            width: 100%; min-width: 0; align-self: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            color: #423038; font-size: .82rem; font-weight: 680;
        }
        .lady-gallery-edit-overlay { position: absolute; inset: 8px; display: none; align-items: flex-start; justify-content: space-between; pointer-events: none; z-index: 3; }
        .lady-gallery.is-editing .lady-gallery-edit-overlay { display: flex; }
        .lady-gallery.is-editing .lady-gallery-media,
        .lady-gallery.is-editing .lady-gallery-file-main { pointer-events: none; border-color: #dda4be; box-shadow: 0 0 0 2px rgba(178,71,119,.10); }
        .lady-gallery-toolbar.is-editing { border-color: #dda4be; background: #fbf3f7; box-shadow: 0 0 0 2px rgba(178,71,119,.06); }
        .lady-gallery.is-editing .lady-gallery-tile { box-shadow: 0 0 0 2px rgba(178,71,119,.11); }
        .lady-gallery.is-editing .lady-gallery-tile:hover { box-shadow: 0 0 0 3px rgba(178,71,119,.18); }
        .lady-gallery-drag-handle, .lady-gallery-delete {
            width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.58); border-radius: 10px;
            background: rgba(32,21,26,.82); color: #fff; box-shadow: 0 3px 12px rgba(33,20,26,.20); pointer-events: auto; touch-action: none;
        }
        .lady-gallery-drag-handle { cursor: grab; }
        .lady-gallery-drag-handle:active { cursor: grabbing; }
        .lady-gallery-delete { background: rgba(153,27,27,.88); cursor: pointer; }
        .lady-gallery-tile.is-dragging { opacity: .58; transform: scale(.985); z-index: 5; }
        .lady-gallery-tile.is-drop-target > .lady-gallery-media,
        .lady-gallery-tile.is-drop-target > .lady-gallery-file-main { box-shadow: 0 0 0 3px rgba(178,71,119,.22); border-color: #b24777; }
        .lady-gallery-save-state { color: #b24777 !important; }
        body.lady-gallery-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }

        html[data-theme="dark"] .lady-gallery-toolbar { border-color: #3c3035; background: #1b1518; }
        html[data-theme="dark"] .lady-gallery-toolbar.is-editing { border-color: #c86591; background: #26171e; }
        html[data-theme="dark"] .lady-gallery-toolbar-copy strong { color: #f8f2f5; }
        html[data-theme="dark"] .lady-gallery-toolbar-copy span { color: #a6969d; }
        html[data-theme="dark"] .lady-gallery-tool-btn { border-color: #493b41; background: #221a1e; color: #e5dbdf; }
        html[data-theme="dark"] .lady-gallery-tool-btn:hover { background: #2d2227; }
        html[data-theme="dark"] .lady-gallery-tool-btn.is-primary { border-color: #c86591; background: #b24777; color: #fff; }
        html[data-theme="dark"] .lady-gallery-tool-btn.is-surprise { border-color: transparent; background: linear-gradient(135deg,#a54184,#db2777); color: #fff; }
        html[data-theme="dark"] .lady-gallery-media,
        html[data-theme="dark"] .lady-gallery-file-main { border-color: #392e33; background: #151012; }
        html[data-theme="dark"] .lady-gallery-media.is-cover { background: #100b0d; }
        html[data-theme="dark"] .lady-gallery-media.is-document-preview { background: #231a1e; }
        html[data-theme="dark"] .lady-gallery-file-name { color: #e5dbdf; }
        html[data-theme="dark"] .lady-gallery-file-icon { color: #9d8a92; }

        @media (max-width: 760px) {
            .lady-gallery-toolbar { align-items: stretch; flex-direction: column; gap: 9px; padding: 10px; }
            .lady-gallery-toolbar-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
            .lady-gallery-tool-btn { width: 100%; padding: 0 8px; font-size: .73rem; }
            .lady-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
            .lady-gallery-media, .lady-gallery-file-main { border-radius: 10px; }
            .lady-gallery-media { padding: 0; }
            .lady-gallery-media.is-document-preview { padding: 6px; }
            .lady-gallery-file-main { padding: 12px 8px; }
            .lady-gallery-file-name { font-size: .72rem; }
            .lady-gallery-play { width: 42px; height: 42px; }
            .lady-gallery-edit-overlay { inset: 5px; }
            .lady-gallery-drag-handle, .lady-gallery-delete { width: 36px; height: 36px; border-radius: 9px; }
        }

        /* PRODUKTIONS-UX-PASS: eine ruhige, konsistente App-Navigation für iPhone und Tablet. */
        .mobile-app-nav { display: none; }
        .account-menu-logout-form { margin: 0; }
        .account-menu-item.is-logout { color: #b4232f; }

        @media (max-width: 900px) {
            body.is-authenticated {
                display: block; min-height: 100vh; min-height: 100dvh; padding: 0;
                background: #f7f5f6; color: var(--text-main);
            }
            .is-authenticated .app-container {
                width: 100%; max-width: none; min-height: 100vh; min-height: 100dvh; margin: 0; padding: 0;
                overflow: visible; border: 0; border-radius: 0; background: #f7f5f6; box-shadow: none; animation: none;
            }
            .is-authenticated .header {
                position: sticky; top: 0; z-index: 1180;
                min-height: calc(58px + env(safe-area-inset-top)); margin: 0;
                padding: env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));
                gap: 7px; border-bottom: 1px solid #eae4e7; background: rgba(255,255,255,.94);
                box-shadow: 0 1px 8px rgba(33,20,26,.045); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
            }
            .is-authenticated .header-brand-group { min-width: 0; flex: 1; }
            .is-authenticated .brand-btn { min-width: 44px; min-height: 44px; gap: 7px; }
            .is-authenticated .brand-text { font-size: 1.13rem; letter-spacing: -.035em; }
            .is-authenticated .header-logo { filter: none; }
            .is-authenticated .header-logo svg { width: 32px; height: 32px; }
            .is-authenticated .header-chat-slot { margin-left: auto; padding-left: 6px; border-left: 0; }
            .is-authenticated .chat-nav-button {
                min-height: 42px; padding: 0 12px; gap: 6px; border-radius: 11px; box-shadow: none; font-size: .9rem;
            }
            .is-authenticated .header-user-nav { gap: 5px; }
            .is-authenticated .theme-toggle,
            .is-authenticated .account-menu-trigger { width: 42px; height: 42px; min-height: 42px; flex: 0 0 42px; border-radius: 11px; }
            .is-authenticated .account-menu-trigger { padding: 0; }
            .is-authenticated .account-menu-trigger .account-menu-avatar { width: 32px; height: 32px; flex-basis: 32px; }
            .is-authenticated .header-logout-form { display: none !important; }
            .is-authenticated .account-menu-popover {
                position: fixed; top: calc(58px + env(safe-area-inset-top)); right: max(8px,env(safe-area-inset-right));
                width: min(292px,calc(100vw - 16px)); border-radius: 14px;
            }

            .drive-main-content {
                width: 100%; min-height: calc(100dvh - 58px); margin: 0;
                padding: 15px max(12px,env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
                background: #f7f5f6;
            }
            .mobile-feature-menu-launcher { display: none !important; }
            .drive-main-content .toolbar { margin: 0 0 12px; }
            .drive-main-content .folder-form {
                width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px;
                padding: 0; border: 0; background: transparent;
            }
            .drive-main-content .folder-form input { min-width: 0; min-height: 46px; border-radius: 11px; background: #fff; }
            .drive-main-content .folder-form .btn { min-height: 46px; padding: 0 14px; border-radius: 11px; white-space: nowrap; box-shadow: none; }
            .drive-main-content .breadcrumbs {
                min-height: 42px; margin: 0 0 13px; padding: 0 0 2px; gap: 4px; scrollbar-width: none;
            }
            .drive-main-content .breadcrumbs::-webkit-scrollbar { display: none; }
            .drive-main-content .breadcrumb-btn {
                min-height: 42px; padding: 0 11px; border: 1px solid #e7e1e4; border-radius: 11px;
                background: #fff; color: #6b565f; font-size: .84rem; font-weight: 650;
            }
            .drive-main-content .upload-section { margin-bottom: 18px; }
            .drive-main-content .drop-zone {
                min-height: 76px; padding: 11px 12px; flex-direction: row; align-items: center; justify-content: flex-start;
                border: 1px solid #ded3d8; border-radius: 13px; background: #fff; text-align: left; box-shadow: none; transform: none;
            }
            .drive-main-content .drop-zone::before,
            .drive-main-content .upload-drop-icon::before { display: none; }
            .drive-main-content .upload-drop-icon {
                width: 44px; height: 44px; margin: 0 11px 0 0; flex: 0 0 44px;
                border: 0; border-radius: 12px; background: #f9edf3; box-shadow: none; animation: none;
            }
            .drive-main-content .upload-drop-icon svg { width: 23px; height: 23px; }
            .drive-main-content .drop-zone-title { font-size: .92rem; font-weight: 760; }
            .drive-main-content .drop-zone-text { margin: 3px 0 0; color: #8d7b83; font-size: .77rem; line-height: 1.3; }
            .drive-main-content .drop-zone-hints { display: none; }
            .drive-main-content .section-title {
                margin: 22px 0 9px; padding: 0 2px 8px; border-bottom: 1px solid #e8e2e5; font-size: 1.04rem;
            }
            .drive-main-content .folders-container { gap: 7px; margin-bottom: 20px; }
            .drive-main-content .folder-row {
                min-height: 60px; padding: 8px 10px; border-radius: 12px; background: #fff; box-shadow: none;
            }
            .drive-main-content .folder-row-icon { width: 40px; height: 40px; }
            .drive-main-content .file-list { overflow: hidden; border-color: #e9e3e6; border-radius: 12px; background: #fff; }
            .drive-main-content .file-item { min-height: 70px; padding: 8px 10px; gap: 9px; background: #fff; }
            .drive-main-content .list-thumb,
            .drive-main-content .list-canvas-thumb,
            .drive-main-content .list-icon-box { width: 52px; height: 52px; border-radius: 9px; }
            .drive-main-content.is-dateien-context .list-thumb.pdf-thumb { width: 88px; height: 116px; border-radius: 9px; }
            .drive-main-content .list-file-info { min-width: 0; gap: 3px; }
            .drive-main-content .list-file-name { word-break: normal; overflow-wrap: anywhere; line-height: 1.3; }
            .drive-main-content .list-action-btn { width: 42px; height: 42px; border-radius: 11px; }
            .drive-main-content .drive-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px; }
            .drive-main-content .card { border-radius: 12px; box-shadow: none; }
            .drive-main-content .card-footer { padding: 9px 10px; }
            .drive-main-content .mobile-bottom-storage { margin: 28px 0 4px; }
            .drive-main-content .storage-widget { padding: 13px; border-radius: 12px; background: #fff; }

            .is-authenticated .storage-widget,
            .is-authenticated .toolbar,
            .is-authenticated .breadcrumbs,
            .is-authenticated .section-title,
            .is-authenticated .folder-row,
            .is-authenticated .file-item,
            .is-authenticated .card { opacity: 1; animation: none !important; will-change: auto; }

            .mobile-app-nav {
                position: fixed; left: 0; right: 0; bottom: 0; z-index: 1190;
                min-height: calc(64px + env(safe-area-inset-bottom)); padding: 5px max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left));
                display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: stretch;
                border-top: 1px solid #e6e0e3; background: rgba(255,255,255,.96);
                box-shadow: 0 -6px 24px rgba(33,20,26,.07); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
            }
            .mobile-app-nav-item {
                min-width: 0; min-height: 54px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
                border: 0; border-radius: 11px; background: transparent; color: #837179; text-decoration: none;
                font: inherit; font-size: .68rem; font-weight: 720; line-height: 1; cursor: pointer; touch-action: manipulation;
            }
            .mobile-app-nav-item svg { flex: 0 0 auto; }
            .mobile-app-nav-item.is-active { color: #b24777; background: #fbf1f5; }
            .mobile-app-nav-item:active { background: #f1ebee; }
            body.chat-open .mobile-app-nav,
            body.board-open .mobile-app-nav,
            body.recipe-open .mobile-app-nav,
            body.feature-menu-open .mobile-app-nav { visibility: hidden; }
            .back-to-top-btn {
                right: max(14px,env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom));
                width: 44px; height: 44px; z-index: 1100; box-shadow: 0 6px 18px rgba(33,20,26,.22);
            }

            .feature-menu-shell.is-open { display: flex; align-items: flex-end; justify-content: stretch; }
            .feature-menu-drawer {
                width: 100%; height: auto; max-height: min(82dvh,680px); margin: 0; overflow: hidden;
                border-radius: 22px 22px 0 0; box-shadow: 0 -24px 70px rgba(33,20,26,.28); animation: featureMenuSheetIn .22s ease both;
            }
            .feature-menu-drawer::before {
                content: ''; width: 38px; height: 4px; margin: 8px auto 0; flex: 0 0 auto;
                border-radius: 999px; background: #d9d0d4;
            }
            @keyframes featureMenuSheetIn { from { transform: translateY(28px); opacity: .72; } to { transform: translateY(0); opacity: 1; } }
            .feature-menu-head { min-height: 62px; padding: 8px 12px 10px 16px; }
            .feature-menu-mark { width: 38px; height: 38px; border-radius: 12px; }
            .feature-menu-close { width: 44px; height: 44px; border-radius: 12px; }
            .feature-menu-nav { padding: 8px 10px 14px; gap: 4px; }
            .feature-menu-item { min-height: 62px; padding: 8px 10px; border-radius: 13px; }
            .feature-menu-item-icon { width: 42px; height: 42px; border-radius: 12px; }
            .feature-menu-item-copy strong { font-size: .91rem; }
            .feature-menu-item-copy span { font-size: .76rem; }
            .feature-menu-foot { padding-bottom: max(14px,env(safe-area-inset-bottom)); }


            .recipe-sidebar-tools { grid-template-columns: minmax(0,1fr) 46px 46px; gap: 8px; }
            .recipe-search, .recipe-category, .recipe-tool-btn { min-height: 46px; }
            .recipe-az {
                padding: 8px 10px; display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 4px;
                overflow: visible;
            }
            .recipe-letter { width: auto; min-width: 0; height: 34px; border-radius: 9px; font-size: .72rem; }
            .recipe-list { padding: 7px 8px max(10px,env(safe-area-inset-bottom)); }
            .recipe-list-item { min-height: 72px; padding: 8px; border-radius: 12px; }
            .recipe-list-thumb { width: 54px; height: 54px; border-radius: 11px; }
            .recipe-form-actions {
                position: sticky; bottom: 0; z-index: 2; margin: 18px -13px -16px; padding: 12px 13px max(12px,env(safe-area-inset-bottom));
                background: rgba(255,255,255,.96); border-top: 1px solid #e1e7e3; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
            }
            .recipe-form-actions .recipe-action { min-height: 44px; }

            .chat-window.has-few-contacts .chat-search { display: flex !important; }
            .chat-close-button, .chat-back-button, .chat-thread-close-button, .chat-thread-search-button { width: 44px; height: 44px; }
            .chat-attach-button, .chat-voice-button, .chat-emoji-button, .chat-send-button { width: 44px; height: 44px; }
            .chat-composer { min-height: 50px; padding: 3px; gap: 2px; border-radius: 25px; }
            .chat-message-input { min-height: 44px; max-height: 112px; padding: 10px 7px; }

            html[data-theme="dark"] body.is-authenticated,
            html[data-theme="dark"] .is-authenticated .app-container,
            html[data-theme="dark"] .drive-main-content { background: #181215; }
            html[data-theme="dark"] .is-authenticated .header,
            html[data-theme="dark"] .mobile-app-nav { background: rgba(27,21,24,.96); border-color: #382e33; }
            html[data-theme="dark"] .mobile-app-nav { box-shadow: 0 -6px 24px rgba(0,0,0,.28); }
            html[data-theme="dark"] .mobile-app-nav-item { color: #a99ba1; }
            html[data-theme="dark"] .mobile-app-nav-item.is-active { color: #e2a4c0; background: #3e232f; }
            html[data-theme="dark"] .drive-main-content .folder-form input,
            html[data-theme="dark"] .drive-main-content .breadcrumb-btn,
            html[data-theme="dark"] .drive-main-content .drop-zone,
            html[data-theme="dark"] .drive-main-content .folder-row,
            html[data-theme="dark"] .drive-main-content .file-list,
            html[data-theme="dark"] .drive-main-content .file-item,
            html[data-theme="dark"] .drive-main-content .storage-widget { background: #1e181b; border-color: #382e33; }
            html[data-theme="dark"] .recipe-form-actions { background: rgba(27,21,24,.96); border-color: #382e33; }
            html[data-theme="dark"] .feature-menu-drawer::before { background: #594d52; }
        }

        @media (max-width: 460px) {
            .is-authenticated .brand-text { display: inline-flex; }
            .is-authenticated .header-brand-group { flex: 1; }
            .is-authenticated .header-chat-slot { padding-left: 5px; }
            .is-authenticated .chat-nav-button { padding: 0 11px; }
            .drive-main-content .folder-form { grid-template-columns: minmax(0,1fr) 48px; }
            .drive-main-content .folder-form .folder-create-btn {
                width: 48px;
                height: 48px;
                min-height: 48px;
                padding: 0;
                display: grid;
                place-items: center;
                overflow: hidden;
                line-height: 0;
            }
            .drive-main-content .folder-form .folder-create-btn:hover,
            .drive-main-content .folder-form .folder-create-btn:active { transform: none; }
            .drive-main-content .folder-create-icon {
                width: 24px;
                height: 24px;
                display: grid;
                place-items: center;
                line-height: 0;
            }
            .drive-main-content .folder-create-icon svg { display: block; width: 24px; height: 24px; }
            .drive-main-content .folder-create-label { display: none; }
            .board-header-copy p { display: none; }
            .recipe-form-grid { grid-template-columns: 1fr; }
            .recipe-field:first-child, .recipe-field.is-wide { grid-column: 1; }
        }

        @media (max-width: 360px) {
            .is-authenticated .brand-text { display: none; }
        }

        /* iPhone/Touch: Safari darf an angetippten Schließen- und Aktionsflächen
           keinen dauerhaft blauen Tastatur-Fokusrahmen stehen lassen. Eingabefelder
           behalten ihren sichtbaren Fokus; Desktop-Tastaturbedienung bleibt unverändert. */
        @media (hover: none) and (pointer: coarse) {
            button, a, summary, [role="button"] { -webkit-tap-highlight-color: transparent; }
            button:focus, button:focus-visible,
            a:focus, a:focus-visible,
            summary:focus, summary:focus-visible,
            [role="button"]:focus, [role="button"]:focus-visible {
                outline: none !important;
                outline-offset: 0 !important;
            }
        }
        [data-programmatic-focus="quiet"]:focus,
        [data-programmatic-focus="quiet"]:focus-visible {
            outline: none !important;
            outline-offset: 0 !important;
        }


        /* Chatkopf: Das Profilbild des Chatpartners bekommt hier eine eindeutige
           Endgröße. Die finalen Regeln stehen am Ende des Stylesheets, damit ältere
           .chat-avatar-Regeln die sichtbare Größe nicht mehr verändern. */
        .chat-thread-header .chat-header-avatar {
            --chat-head-avatar-size: 44px;
            width: var(--chat-head-avatar-size) !important;
            height: var(--chat-head-avatar-size) !important;
            min-width: var(--chat-head-avatar-size) !important;
            min-height: var(--chat-head-avatar-size) !important;
            max-width: var(--chat-head-avatar-size) !important;
            max-height: var(--chat-head-avatar-size) !important;
            flex: 0 0 var(--chat-head-avatar-size) !important;
            flex-basis: var(--chat-head-avatar-size) !important;
            aspect-ratio: 1 / 1 !important;
            box-sizing: border-box !important;
            margin: 0 !important;
            padding: 0 !important;
            border: 1px solid #e9e0e4 !important;
            border-radius: 50% !important;
            overflow: hidden !important;
            display: grid !important;
            place-items: center !important;
            background: #fff !important;
            box-shadow: 0 1px 3px rgba(33,20,26,.10) !important;
            line-height: 1 !important;
        }
        .chat-thread-header .chat-header-avatar > img,
        .chat-thread-header .chat-header-avatar > .chat-avatar-image {
            width: 100% !important;
            height: 100% !important;
            min-width: 100% !important;
            min-height: 100% !important;
            max-width: none !important;
            max-height: none !important;
            margin: 0 !important;
            padding: 0 !important;
            display: block !important;
            object-fit: cover !important;
            object-position: 50% 50% !important;
            border: 0 !important;
            border-radius: 50% !important;
            transform: none !important;
        }
        .chat-thread-header .chat-header-avatar .chat-presence-dot { display: none !important; }

        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            .chat-thread-header .chat-header-avatar { --chat-head-avatar-size: 40px; }
        }

        /* Kontomenü mit Profilfoto: Das Foto füllt auf Tablet/Mobil den gesamten
           abgerundeten Button aus. Kein kleiner Kreis in einem zweiten Rahmen. */
        @media (max-width: 900px) {
            .is-authenticated .account-menu-trigger {
                padding: 0 !important;
                overflow: hidden !important;
            }
            .is-authenticated .account-menu-trigger .account-menu-avatar {
                width: 100% !important;
                height: 100% !important;
                min-width: 100% !important;
                min-height: 100% !important;
                flex: 1 1 100% !important;
                border-radius: inherit !important;
                overflow: hidden !important;
                background: transparent !important;
                box-shadow: none !important;
            }
            .is-authenticated .account-menu-trigger .account-menu-avatar img {
                width: 100% !important;
                height: 100% !important;
                min-width: 100% !important;
                min-height: 100% !important;
                display: block !important;
                object-fit: cover !important;
                object-position: 50% 50% !important;
                border: 0 !important;
                border-radius: inherit !important;
                box-shadow: none !important;
            }
        }



        /* ================================================================
           USABILITY-PASS: konsistente Typografie, groessere Chat-Lesbarkeit
           und belastbare Touch-Ziele. Diese Regeln stehen bewusst zuletzt,
           damit fruehere Detailregeln die visuelle Hierarchie nicht wieder
           auseinanderziehen.
           ================================================================ */
        body.is-authenticated {
            --ux-font-xs: .8125rem;   /* 13px */
            --ux-font-sm: .875rem;    /* 14px */
            --ux-font-ui: .9375rem;   /* 15px */
            --ux-font-base: 1rem;     /* 16px */
            --ux-font-chat: 1.0625rem;/* 17px */
            --ux-font-lg: 1.125rem;   /* 18px */
            --ux-font-title: 1.25rem; /* 20px */
            font-size: var(--ux-font-base);
            line-height: 1.45;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        /* Hauptnavigation / Drive: nur wenige klar erkennbare Schriftstufen. */
        .is-authenticated .brand-text { font-size: var(--ux-font-title); line-height: 1.1; }
        .is-authenticated .chat-nav-button,
        .is-authenticated .btn,
        .is-authenticated .account-menu-item { font-size: var(--ux-font-ui); }
        .is-authenticated .account-menu-heading span { font-size: var(--ux-font-xs); }
        .is-authenticated .account-menu-heading strong { font-size: var(--ux-font-ui); }
        .is-authenticated .section-title { font-size: var(--ux-font-lg); line-height: 1.3; }
        .is-authenticated .folder-row-title { font-size: var(--ux-font-chat); line-height: 1.3; }
        .is-authenticated .card-title,
        .is-authenticated .list-file-name,
        .is-authenticated .upload-current-name,
        .is-authenticated .drop-zone-title { font-size: var(--ux-font-base); line-height: 1.35; }
        .is-authenticated .storage-header,
        .is-authenticated .breadcrumb-btn,
        .is-authenticated .drop-zone-text,
        .is-authenticated .card-meta,
        .is-authenticated .list-file-meta,
        .is-authenticated .upload-current-meta,
        .is-authenticated .upload-progress-row,
        .is-authenticated .upload-queue-name { font-size: var(--ux-font-sm); }
        .is-authenticated .drop-zone-badge,
        .is-authenticated .upload-status-label,
        .is-authenticated .upload-stat-label,
        .is-authenticated .upload-stat-value,
        .is-authenticated .upload-queue-state,
        .is-authenticated .upload-queue-size,
        .is-authenticated .upload-queue-status { font-size: var(--ux-font-xs); }
        .is-authenticated .folder-form input { font-size: var(--ux-font-base); }

        /* Mobile Hauptnavigation war vorher mit ~11px deutlich zu klein. */
        .is-authenticated .mobile-app-nav-item { font-size: var(--ux-font-xs); line-height: 1.15; }

        /* Funktionsmenue, Pinnwand und Rezepte verwenden dieselbe Hierarchie. */
        .feature-menu-title strong,
        .feature-menu-item-copy strong { font-size: var(--ux-font-base); }
        .feature-menu-title span,
        .feature-menu-item-copy span { font-size: var(--ux-font-sm); line-height: 1.35; }
        .feature-menu-foot { font-size: var(--ux-font-xs); }
        .board-header-copy h2,
        .recipe-header-copy h2 { font-size: var(--ux-font-lg); }
        .board-header-copy p,
        .recipe-header-copy p { font-size: var(--ux-font-sm); }
        .board-card-text { font-size: var(--ux-font-base); line-height: 1.5; }
        .recipe-list-copy strong { font-size: var(--ux-font-base); }
        .recipe-list-copy span,
        .recipe-list-empty { font-size: var(--ux-font-sm); }
        .recipe-field label { font-size: var(--ux-font-sm); }
        .recipe-field input,
        .recipe-field textarea,
        .recipe-search input,
        .recipe-category { font-size: var(--ux-font-base); }

        /* Nach-oben: unsichtbar, solange kein sinnvoller Rueckweg nach oben
           existiert. Sobald JS .is-visible setzt, bleibt er am Viewport und
           geht beim Scrollen mit, statt irgendwo im Dokument stehenzubleiben. */
        .back-to-top-btn {
            position: fixed !important;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(8px) scale(.96);
            transition: opacity .18s ease, visibility .18s ease, transform .18s ease, box-shadow .18s ease, background .18s ease;
        }
        .back-to-top-btn.is-visible {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translateY(0) scale(1);
        }
        @media (hover: hover) and (pointer: fine) {
            .back-to-top-btn.is-visible:hover { transform: translateY(-2px) scale(1); }
        }
        .back-to-top-btn.is-visible:active { transform: scale(.96); }

        /* Chat: groessere, WhatsApp-naehere Lesbarkeit ohne den Composer
           unnoetig hoch werden zu lassen. */
        .chat-thread-name { font-size: var(--ux-font-lg); line-height: 1.2; }
        .chat-thread-status { font-size: var(--ux-font-sm); line-height: 1.25; }
        .chat-thread-note { font-size: var(--ux-font-xs); }
        .chat-day { font-size: var(--ux-font-xs); line-height: 1.1; }
        .chat-message-text { font-size: var(--ux-font-base); line-height: 1.46; }
        .chat-message-meta { font-size: var(--ux-font-xs); line-height: 1.1; }
        .chat-message-sender,
        .chat-reply-author { font-size: var(--ux-font-xs); }
        .chat-reply-copy { font-size: var(--ux-font-sm); }
        .chat-file-name { font-size: var(--ux-font-base); }
        .chat-file-size { font-size: var(--ux-font-sm); }
        .chat-reaction-chip { font-size: var(--ux-font-sm); }
        .chat-action-item,
        .chat-action-delete { font-size: var(--ux-font-sm); }
        .chat-attachment-preview,
        .chat-voice-status { font-size: var(--ux-font-sm); }
        .chat-message-input { font-size: var(--ux-font-base); line-height: 1.4; }
        .chat-toast { font-size: var(--ux-font-sm); }

        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            /* Kontaktliste: vorher waren Preview und Uhrzeit auf iPhone teils
               nur 11-12px gross. */
            .chat-contact { min-height: 66px; grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; padding: 8px; }
            .chat-contact .chat-avatar { width: 44px; height: 44px; flex-basis: 44px; }
            .chat-contact-name { font-size: var(--ux-font-base); line-height: 1.25; }
            .chat-contact-preview { font-size: var(--ux-font-sm); line-height: 1.3; }
            .chat-contact-time { font-size: .75rem; }
            .chat-contact-unread { font-size: var(--ux-font-xs); }

            /* Chatkopf: Partnerbild und Name sollen optisch dieselbe Praesenz
               haben wie in gaengigen Messenger-Apps. */
            .chat-thread-header { gap: 9px; }
            .chat-thread-header .chat-header-avatar { --chat-head-avatar-size: 44px; }
            .chat-thread-name { font-size: var(--ux-font-lg); }
            .chat-thread-status { min-height: 17px; margin-top: 1px; font-size: var(--ux-font-sm); }
            .chat-back-button,
            .chat-thread-close-button,
            .chat-thread-search-button { width: 44px; height: 44px; flex-basis: 44px; }

            /* Nachrichtentext 17px statt der bisherigen ~14.4px; Metadaten
               bleiben bewusst kleiner, aber nicht mehr winzig. */
            .chat-messages { padding: 10px max(9px, env(safe-area-inset-right)) 12px max(9px, env(safe-area-inset-left)); }
            .chat-day { margin: 5px auto 10px; padding: 5px 10px; font-size: var(--ux-font-xs); }
            .chat-message-row { margin: 2px 0; }
            .chat-message-wrap { max-width: 88%; }
            .chat-message-bubble { padding: 8px 10px 7px; border-radius: 16px 16px 16px 6px; }
            .chat-message-row.is-mine .chat-message-bubble { border-radius: 16px 16px 6px 16px; }
            .chat-message-text { font-size: var(--ux-font-chat); line-height: 1.36; }
            .chat-message-meta { margin: 6px 0 -1px 9px; gap: 4px; font-size: .75rem; line-height: 1.05; }
            .chat-message-more { width: 26px; height: 22px; margin: -4px -4px -4px 0; }
            .chat-reaction-chip { min-height: 24px; padding: 1px 7px; font-size: var(--ux-font-xs); }
            .chat-reply-author { font-size: var(--ux-font-xs); }
            .chat-reply-copy { font-size: var(--ux-font-sm); }
            .chat-file-name { font-size: var(--ux-font-ui); }
            .chat-file-size { font-size: var(--ux-font-xs); }
            .chat-attachment { min-width: min(260px, 74vw); border-radius: 11px; }
            .chat-attachment img { max-height: 340px; }

            /* Composer: 44px-Touchziele, 17px Text, aber kontrolliertes Wachstum. */
            .chat-composer-area {
                padding: 7px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
            }
            .chat-composer { min-height: 50px; padding: 3px; gap: 3px; border-radius: 25px; }
            .chat-attach-button,
            .chat-voice-button,
            .chat-emoji-button,
            .chat-send-button { width: 44px; height: 44px; flex-basis: 44px; }
            .chat-message-input { min-height: 44px; max-height: 100px; padding: 10px 7px; font-size: var(--ux-font-chat); line-height: 1.34; }
            .chat-attachment-preview,
            .chat-voice-status { font-size: var(--ux-font-sm); }
            .chat-toast { font-size: var(--ux-font-sm); }

            /* Bei offener iPhone-Tastatur bleibt die Eingabe kompakt genug,
               um den Verlauf nicht wieder stark nach oben zu druecken. */
            .chat-shell.is-keyboard-open .chat-composer-area { padding-top: 5px; padding-bottom: 5px; }
            .chat-shell.is-keyboard-open .chat-composer { min-height: 48px; }
            .chat-shell.is-keyboard-open .chat-attach-button,
            .chat-shell.is-keyboard-open .chat-voice-button,
            .chat-shell.is-keyboard-open .chat-send-button { width: 42px; height: 42px; flex-basis: 42px; }
            .chat-shell.is-keyboard-open .chat-message-input { min-height: 42px; max-height: 74px; padding-top: 8px; padding-bottom: 8px; font-size: var(--ux-font-chat); line-height: 1.28; }
        }

        @media (max-width: 460px) {
            .is-authenticated .brand-text { font-size: var(--ux-font-lg); }
            .is-authenticated .chat-nav-button { font-size: var(--ux-font-sm); }
            .is-authenticated .mobile-app-nav-item { font-size: var(--ux-font-xs); }
        }


        /* Chat-Upgrade: Gesten und gemeinsame Medien */
        .chat-thread-identity { flex:1; min-width:0; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:2px 4px; color:inherit; text-align:left; }
        .chat-thread-status.is-recording { color:#e11d48; font-weight:650; }
        .chat-forwarded-mark { margin:0 0 4px; font-size:12px; line-height:1.15; opacity:.68; font-style:italic; }
        .chat-message-bubble { transition:transform .16s ease; touch-action:pan-y; will-change:transform; }
        .chat-swipe-reply-cue { position:absolute; left:-34px; top:50%; width:28px; height:28px; margin-top:-14px; display:grid; place-items:center; border-radius:50%; background:rgba(178,71,119,.12); color:#b24777; font-size:17px; font-weight:800; opacity:0; transform:scale(.7); pointer-events:none; transition:opacity .08s linear,transform .08s linear; }
        .chat-message-row.is-mine .chat-swipe-reply-cue { left:auto; right:calc(100% + 6px); }
        .chat-forward-sheet { position:fixed; inset:0; z-index:10050; display:flex; align-items:flex-end; justify-content:center; padding:18px; background:rgba(33,20,26,.30); backdrop-filter:blur(4px); }
        .chat-forward-sheet-card { width:min(430px,100%); max-height:min(72vh,560px); overflow:hidden; border:1px solid var(--border); border-radius:24px; background:var(--card-bg,#fff); box-shadow:0 24px 70px rgba(33,20,26,.28); }
        .chat-forward-sheet-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 16px 10px; }.chat-forward-sheet-head strong,.chat-forward-sheet-head span{display:block}.chat-forward-sheet-head strong{font-size:18px}.chat-forward-sheet-head span{font-size:13px;color:var(--text-muted);margin-top:2px}
        .chat-forward-sheet-close { width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--border);border-radius:13px;background:transparent;color:var(--text-muted);font-size:18px;cursor:pointer; }
        .chat-forward-contact-list { padding:4px 10px 14px; overflow:auto; max-height:430px; }
        .chat-forward-contact { width:100%;display:flex;align-items:center;gap:12px;padding:10px;border:0;border-radius:15px;background:transparent;color:var(--text-main);text-align:left;cursor:pointer; }.chat-forward-contact:hover{background:rgba(178,71,119,.07)}
        .chat-forward-avatar { width:44px;height:44px;flex:0 0 44px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#f3ebef;font-weight:700; }.chat-forward-avatar img{width:100%;height:100%;object-fit:cover}.chat-forward-copy strong,.chat-forward-copy small{display:block}.chat-forward-copy strong{font-size:16px}.chat-forward-copy small{font-size:13px;color:var(--text-muted);margin-top:2px}

        html[data-theme="dark"] .chat-forward-sheet-card{background:#1e181b;border-color:#3a2f34}
        @media (max-width:760px){.chat-forward-sheet{padding:10px env(safe-area-inset-right) calc(10px + env(safe-area-inset-bottom)) env(safe-area-inset-left)}.chat-forward-sheet-card{border-radius:22px 22px 18px 18px}.chat-action-item,.chat-action-delete{min-height:42px;font-size:15px}}

        /* Header: logo is more present and all right-hand controls share one baseline. */
        .is-authenticated .brand-btn {
            gap: 10px;
        }
        .is-authenticated .header-logo svg {
            width: 38px;
            height: 38px;
        }
        .is-authenticated .brand-text {
            display: inline-flex !important;
            align-items: center;
            font-size: 1.42rem;
            line-height: 1;
            letter-spacing: -.04em;
        }
        .is-authenticated .header-user-nav {
            display: flex;
            align-items: center;
            justify-content: flex-end;
        }
        .is-authenticated .account-menu {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 42px;
            margin: 0;
            padding: 0;
            line-height: 0;
            flex: 0 0 42px;
        }
        .is-authenticated .theme-toggle,
        .is-authenticated .account-menu-trigger {
            box-sizing: border-box;
            width: 42px;
            height: 42px;
            min-width: 42px;
            min-height: 42px;
            max-width: 42px;
            max-height: 42px;
            flex: 0 0 42px;
            margin: 0 !important;
            border-radius: 11px;
            vertical-align: top;
        }
        .is-authenticated .account-menu-trigger {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            padding: 0 !important;
            overflow: hidden !important;
            line-height: 0 !important;
        }
        .is-authenticated .account-menu-trigger .account-menu-avatar {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            min-width: 100% !important;
            min-height: 100% !important;
            flex: 0 0 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            border-radius: inherit !important;
            overflow: hidden !important;
            background: transparent !important;
            box-shadow: none !important;
            line-height: 0 !important;
        }
        .is-authenticated .account-menu-trigger .account-menu-avatar img {
            display: block !important;
            width: 100% !important;
            height: 100% !important;
            min-width: 100% !important;
            min-height: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            border: 0 !important;
            border-radius: inherit !important;
            object-fit: cover !important;
            object-position: center !important;
        }

        @media (min-width: 901px) {
            .is-authenticated .account-menu {
                width: 38px;
                height: 38px;
                flex-basis: 38px;
            }
            .is-authenticated .theme-toggle,
            .is-authenticated .account-menu-trigger {
                width: 38px;
                height: 38px;
                min-width: 38px;
                min-height: 38px;
                max-width: 38px;
                max-height: 38px;
                flex-basis: 38px;
                border-radius: 8px;
            }
        }
        @media (max-width: 760px) {
            .is-authenticated .header-logo svg {
                width: 36px;
                height: 36px;
            }
            .is-authenticated .brand-text {
                font-size: 1.25rem;
            }
        }
        @media (max-width: 420px) {
            .is-authenticated .header-logo svg {
                width: 34px;
                height: 34px;
            }
            .is-authenticated .brand-text {
                font-size: 1.18rem;
            }
        }



        /* ============================================================
           Chat 2026: Signal-inspirierte Ruhe, mit Hogdrive-Blau.
           Funktion bleibt Hogdrive; nur Hierarchie und Bedienung werden
           messenger-typischer und auf Touch deutlich aufgeraeumter.
           ============================================================ */
        .chat-conversation {
            background: #fff;
        }
        .chat-thread-header {
            min-height: 68px;
            padding: 10px 12px;
            gap: 10px;
            border-bottom: 1px solid #f3f0f1;
            background: rgba(255,255,255,.97);
            box-shadow: none;
        }
        .chat-thread-name {
            color: #20151a;
            font-size: 18px;
            font-weight: 780;
            letter-spacing: -.018em;
        }
        .chat-thread-status {
            margin-top: 1px;
            color: #8c8086;
            font-size: 14px;
        }
        .chat-back-button,
        .chat-thread-close-button,
        .chat-thread-search-button {
            width: 44px;
            height: 44px;
            flex: 0 0 44px;
            border: 0;
            border-radius: 50%;
            background: transparent;
            color: #504449;
            box-shadow: none;
        }
        @media (hover:hover) and (pointer:fine) {
            .chat-back-button:hover,
            .chat-thread-close-button:hover,
            .chat-thread-search-button:hover,
            .chat-thread-search-button[aria-expanded="true"] {
                border: 0;
                background: #f5f2f3;
                color: #31252b;
            }
        }
        .chat-messages {
            padding: 18px clamp(12px, 2.4vw, 24px) 14px;
            background: #fff;
        }
        .chat-day {
            margin: 8px auto 14px;
            padding: 5px 11px;
            border: 0;
            background: #f4f1f2;
            color: #85797e;
            box-shadow: none;
            font-size: 12px;
            font-weight: 700;
        }
        .chat-message-row {
            margin: 4px 0;
        }
        .chat-message-row.is-grouped-before {
            margin-top: 1px;
        }
        .chat-message-row.is-grouped-after {
            margin-bottom: 1px;
        }
        .chat-message-wrap {
            max-width: min(76%, 610px);
        }
        .chat-message-row.is-mine .chat-message-wrap {
            max-width: min(72%, 590px);
        }
        .chat-message-bubble {
            padding: 10px 13px 7px;
            border: 0;
            border-radius: 22px 22px 22px 7px;
            background: #f3f0f1;
            color: #1f191c;
            box-shadow: none;
        }
        .chat-message-row.is-mine .chat-message-bubble {
            border: 0;
            border-radius: 22px 22px 7px 22px;
            background: #b94d7e;
            color: #fff;
            box-shadow: none;
        }
        .chat-message-row:not(.is-mine).is-grouped-before .chat-message-bubble { border-top-left-radius: 9px; }
        .chat-message-row:not(.is-mine).is-grouped-after .chat-message-bubble { border-bottom-left-radius: 9px; }
        .chat-message-row.is-mine.is-grouped-before .chat-message-bubble { border-top-right-radius: 9px; }
        .chat-message-row.is-mine.is-grouped-after .chat-message-bubble { border-bottom-right-radius: 9px; }
        .chat-message-row.has-reactions,
        .chat-message-row.is-grouped-after.has-reactions {
            margin-bottom: 22px;
        }
        .chat-message-text {
            font-size: 17px;
            line-height: 1.38;
            letter-spacing: -.006em;
        }
        .chat-message-meta {
            min-height: 16px;
            margin: 5px 0 -1px 10px;
            gap: 5px;
            color: #9b8f94;
            font-size: 12px;
            line-height: 1;
        }
        .chat-message-row.is-mine .chat-message-meta {
            color: rgba(255,255,255,.78);
        }
        .chat-read-mark {
            padding-right: 2px;
            letter-spacing: -2.5px;
        }
        .chat-read-mark.is-read { color: #f6e1ea; }
        .chat-reply-quote {
            margin: -2px -3px 8px;
            padding: 8px 10px;
            border-left: 3px solid #b94d7e;
            border-radius: 10px;
            background: rgba(255,255,255,.7);
        }
        .chat-message-row.is-mine .chat-reply-quote {
            border-left-color: rgba(255,255,255,.9);
            background: rgba(255,255,255,.14);
        }
        .chat-attachment {
            margin: -4px -7px 8px;
            border-radius: 17px;
        }
        .chat-attachment img {
            max-height: 390px;
            border-radius: 17px;
        }
        .chat-message-bubble:has(.chat-attachment:first-child) {
            padding-top: 11px;
        }
        .chat-reactions {
            right: 9px;
            bottom: -11px;
            gap: 2px;
            z-index: 2;
        }
        .chat-message-row:not(.is-mine) .chat-reactions {
            left: 9px;
            right: auto;
        }
        .chat-reaction-chip {
            min-height: 20px;
            padding: 0 5px;
            border-radius: 999px;
            font-size: 13px;
            line-height: 1;
            box-shadow: 0 1px 4px rgba(33,20,26,.10);
        }

        /* Signal-aehnlicher Composer: Plus separat, Eingabe als eigener Pill. */
        .chat-composer-area {
            padding: 10px 12px max(10px, env(safe-area-inset-bottom));
            border-top: 1px solid #f4f1f2;
            background: #fff;
            box-shadow: none;
        }
        .chat-composer {
            position: relative;
            min-height: 52px;
            display: flex;
            align-items: center;
            gap: 9px;
            padding: 0;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }
        .chat-composer:focus-within {
            border: 0;
            background: transparent;
            box-shadow: none;
        }
        .chat-attach-button {
            width: 50px;
            height: 50px;
            flex: 0 0 50px;
            display: grid;
            place-items: center;
            border: 0;
            border-radius: 50%;
            background: #f4f5f7;
            color: #1d191b;
            box-shadow: 0 4px 14px rgba(33,20,26,.06);
        }
        .chat-input-shell {
            min-width: 0;
            min-height: 50px;
            flex: 1;
            display: flex;
            align-items: center;
            gap: 1px;
            padding: 3px 4px 3px 12px;
            border: 0;
            border-radius: 27px;
            background: #f4f2f3;
            transition: background .16s ease, box-shadow .16s ease;
        }
        .chat-input-shell:focus-within {
            background: #f3f0f1;
            box-shadow: inset 0 0 0 1px rgba(185,77,126,.12);
        }
        .chat-message-input {
            min-width: 0;
            min-height: 44px;
            max-height: 118px;
            padding: 10px 4px 9px 1px;
            border: 0;
            border-radius: 0;
            background: transparent;
            color: #1d191b;
            font-size: 17px;
            line-height: 1.36;
        }
        .chat-message-input::placeholder {
            color: #938a8e;
            opacity: 1;
        }
        .chat-emoji-button,
        .chat-voice-button,
        .chat-send-button {
            width: 44px;
            height: 44px;
            flex: 0 0 44px;
            display: grid;
            place-items: center;
            border: 0;
            border-radius: 50%;
            background: transparent;
            color: #161314;
            box-shadow: none;
            cursor: pointer;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            transition: background .14s ease, transform .14s ease, opacity .14s ease;
        }
        .chat-send-button {
            background: #b94d7e;
            color: #fff;
            box-shadow: 0 4px 12px rgba(185,77,126,.22);
        }
        .chat-composer:not(.has-content) .chat-send-button { display: none; }
        .chat-composer.has-content .chat-voice-button { display: none; }
        .chat-send-button:disabled { display: none; }
        .chat-voice-button {
            position: relative;
            top: -1px;
        }
        .chat-voice-button.is-recording,
        .chat-composer.is-recording .chat-voice-button {
            display: grid;
            background: #fee2e2;
            color: #d92d20;
            animation: none;
        }
        .chat-composer.is-recording .chat-send-button { display: none; }
        .chat-emoji-button:hover,
        .chat-voice-button:hover {
            background: rgba(33,20,26,.06);
            color: #161314;
        }
        .chat-attach-button:active,
        .chat-emoji-button:active,
        .chat-voice-button:active,
        .chat-send-button:active { transform: scale(.94); }
        .chat-emoji-picker {
            left: auto;
            right: 0;
            bottom: calc(100% + 8px);
            width: min(360px, calc(100% - 59px));
            max-height: min(360px, 45dvh);
            border-radius: 18px;
            overflow: hidden;
        }
        .chat-emoji-picker-header { padding: 8px; }
        .chat-emoji-search {
            min-height: 40px;
            padding: 0 11px;
            border-radius: 11px;
            font-size: 16px;
            line-height: 1.2;
        }
        .chat-emoji-grid {
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 3px;
            padding: 7px;
        }
        .chat-emoji-choice {
            height: 46px;
            border-radius: 10px;
            font-size: 30px;
        }
        .chat-attachment-preview,
        .chat-composer-context,
        .chat-voice-status {
            margin-left: 59px;
            margin-right: 2px;
            border-radius: 14px;
        }
        .chat-composer-hint { display: none; }

        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            .chat-thread-header {
                min-height: calc(66px + env(safe-area-inset-top));
                padding: calc(8px + env(safe-area-inset-top)) 9px 8px;
                gap: 7px;
            }
            .chat-thread-header .chat-header-avatar { --chat-head-avatar-size: 44px; }
            .chat-thread-name { font-size: 18px; }
            .chat-thread-status { font-size: 14px; }
            .chat-messages {
                padding: 12px max(8px, env(safe-area-inset-right)) 12px max(8px, env(safe-area-inset-left));
            }
            .chat-message-wrap { max-width: 86%; }
            .chat-message-row.is-mine .chat-message-wrap { max-width: 82%; }
            .chat-message-row { margin: 3px 0; }
            .chat-message-row.is-grouped-before { margin-top: 1px; }
            .chat-message-row.is-grouped-after { margin-bottom: 1px; }
            .chat-message-bubble { padding: 10px 13px 7px; }
            .chat-message-text { font-size: 17px; line-height: 1.37; }
            .chat-message-meta { margin-top: 5px; font-size: 12px; }
            .chat-message-more { display: none !important; }
            .chat-composer-area {
                padding: 9px max(10px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
            }
            .chat-composer { min-height: 50px; gap: 8px; }
            .chat-attach-button { width: 50px; height: 50px; flex-basis: 50px; }
            .chat-input-shell { min-height: 50px; border-radius: 26px; padding-left: 12px; }
            .chat-message-input {
                min-height: 44px;
                max-height: 94px;
                padding: 10px 3px 9px 0;
                font-size: 17px;
                line-height: 1.32;
            }
            
            .chat-emoji-picker { display: none !important; }
            .chat-voice-button,
            .chat-send-button {
                width: 44px;
                height: 44px;
                flex-basis: 44px;
            }
            .chat-message-row.has-reactions,
            .chat-message-row.is-grouped-after.has-reactions { margin-bottom: 18px; }
            .chat-reactions { bottom: -11px; }
            .chat-reaction-chip { min-height: 19px; padding: 0 4px; font-size: 13px; }
            .chat-emoji-picker {
                width: calc(100% - 58px);
                max-height: min(240px, 34dvh);
                border-radius: 17px;
            }
            .chat-emoji-picker-header { display: none; }
            .chat-emoji-grid {
                grid-template-columns: repeat(7, minmax(0, 1fr));
                gap: 2px;
                padding: 6px;
            }
            .chat-emoji-choice { height: 40px; font-size: 26px; }
            .chat-attachment-preview,
            .chat-composer-context,
            .chat-voice-status { margin-left: 58px; }
            .chat-shell.is-keyboard-open .chat-composer-area {
                padding-top: 7px;
                padding-bottom: 7px;
            }
            .chat-shell.is-keyboard-open .chat-composer { min-height: 48px; }
            .chat-shell.is-keyboard-open .chat-input-shell { min-height: 48px; }
            .chat-shell.is-keyboard-open .chat-attach-button { width: 48px; height: 48px; flex-basis: 48px; }
            .chat-shell.is-keyboard-open .chat-message-input {
                min-height: 42px;
                max-height: 72px;
                padding-top: 8px;
                padding-bottom: 8px;
                font-size: 17px;
                line-height: 1.28;
            }
            .chat-shell.is-keyboard-open .chat-voice-button,
            .chat-shell.is-keyboard-open .chat-send-button {
                width: 42px;
                height: 42px;
                flex-basis: 42px;
            }
        }
        @media (max-width: 390px) {
            .chat-composer { gap: 7px; }
            .chat-attach-button { width: 48px; height: 48px; flex-basis: 48px; }
            .chat-input-shell { padding-left: 10px; }
            .chat-voice-button,
            .chat-send-button { width: 42px; flex-basis: 42px; }
        }
        html[data-theme="dark"] .chat-conversation,
        html[data-theme="dark"] .chat-messages,
        html[data-theme="dark"] .chat-thread-header,
        html[data-theme="dark"] .chat-composer-area { background: #171215; border-color: #30272b; }
        html[data-theme="dark"] .chat-thread-name,
        html[data-theme="dark"] .chat-message-input { color: #f9f6f7; }
        html[data-theme="dark"] .chat-message-bubble { background: #30292c; color: #f6f4f5; }
        html[data-theme="dark"] .chat-message-row.is-mine .chat-message-bubble { background: #b94d7e; color: #fff; }
        html[data-theme="dark"] .chat-day { background: #2b2427; color: #afa3a8; }
        html[data-theme="dark"] .chat-attach-button,
        html[data-theme="dark"] .chat-input-shell { background: #272023; color: #f9f6f7; box-shadow: none; }
        html[data-theme="dark"] .chat-input-shell:focus-within { background: #2d2428; box-shadow: inset 0 0 0 1px rgba(217,135,172,.20); }
        html[data-theme="dark"] .chat-emoji-button,
        html[data-theme="dark"] .chat-voice-button { color: #f7f4f5; }


        /* Signal im Vordergrund, Glass nur dezent als Veredelung */
        .chat-conversation {
            background:
                radial-gradient(900px 300px at 50% -120px, rgba(200,101,145,.075), transparent 62%),
                #ffffff;
        }
        .chat-messages { background: transparent; }

        .chat-thread-header {
            background: rgba(255,255,255,.88);
            border-bottom: 1px solid rgba(237,230,233,.72);
            box-shadow: 0 7px 22px rgba(33,20,26,.045);
            -webkit-backdrop-filter: blur(16px) saturate(135%);
            backdrop-filter: blur(16px) saturate(135%);
        }
        .chat-back-button,
        .chat-thread-close-button,
        .chat-thread-search-button {
            background: transparent;
            border: 0;
            box-shadow: none;
        }
        @media (hover:hover) and (pointer:fine) {
            .chat-back-button:hover,
            .chat-thread-close-button:hover,
            .chat-thread-search-button:hover,
            .chat-thread-search-button[aria-expanded="true"] {
                background: rgba(247,243,245,.78);
            }
        }

        /* Nachrichten bleiben Signal-klar statt stark durchsichtig. */
        .chat-message-bubble {
            background: #f3f0f1;
            border: 0;
            box-shadow: 0 2px 8px rgba(33,20,26,.025);
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
        }
        .chat-message-row.is-mine .chat-message-bubble {
            background: linear-gradient(180deg, #bd5785 0%, #b94d7e 100%);
            border: 0;
            box-shadow: 0 5px 14px rgba(185,77,126,.11);
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
        }

        .chat-day {
            background: rgba(251,249,250,.76);
            border: 1px solid rgba(237,230,233,.7);
            box-shadow: 0 4px 12px rgba(33,20,26,.035);
            -webkit-backdrop-filter: blur(10px) saturate(125%);
            backdrop-filter: blur(10px) saturate(125%);
        }
        .chat-reaction-chip {
            background: rgba(255,255,255,.92);
            border: 1px solid rgba(237,230,233,.82);
            box-shadow: 0 4px 10px rgba(33,20,26,.08);
            -webkit-backdrop-filter: blur(8px) saturate(120%);
            backdrop-filter: blur(8px) saturate(120%);
        }

        .chat-composer-area {
            background: rgba(255,255,255,.90);
            border-top: 1px solid rgba(237,230,233,.72);
            box-shadow: 0 -7px 22px rgba(33,20,26,.04);
            -webkit-backdrop-filter: blur(18px) saturate(140%);
            backdrop-filter: blur(18px) saturate(140%);
        }
        .chat-attach-button {
            background: rgba(247,248,250,.90);
            border: 1px solid rgba(237,230,233,.58);
            box-shadow: 0 4px 12px rgba(33,20,26,.04);
            -webkit-backdrop-filter: blur(10px) saturate(125%);
            backdrop-filter: blur(10px) saturate(125%);
        }
        .chat-input-shell {
            background: rgba(244,242,243,.86);
            border: 1px solid rgba(237,230,233,.45);
            box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
            -webkit-backdrop-filter: blur(12px) saturate(125%);
            backdrop-filter: blur(12px) saturate(125%);
        }
        .chat-input-shell:focus-within {
            background: rgba(248,246,247,.94);
            box-shadow: inset 0 0 0 1px rgba(185,77,126,.13), inset 0 1px 0 rgba(255,255,255,.8);
        }
        .chat-send-button {
            background: linear-gradient(180deg, #bd5785 0%, #b94d7e 100%);
            box-shadow: 0 5px 14px rgba(185,77,126,.18);
        }
        .chat-attachment-preview,
        .chat-composer-context,
        .chat-voice-status {
            background: rgba(251,249,250,.90);
            border: 1px solid rgba(237,230,233,.68);
            box-shadow: 0 4px 12px rgba(33,20,26,.035);
            -webkit-backdrop-filter: blur(10px) saturate(125%);
            backdrop-filter: blur(10px) saturate(125%);
        }

        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            .chat-thread-header { background: rgba(255,255,255,.91); }
            .chat-composer-area { background: rgba(255,255,255,.93); }
            .chat-message-bubble { box-shadow: 0 2px 7px rgba(33,20,26,.022); }
            .chat-message-row.is-mine .chat-message-bubble { box-shadow: 0 4px 11px rgba(185,77,126,.10); }
        }

        html[data-theme="dark"] .chat-conversation {
            background:
                radial-gradient(900px 300px at 50% -120px, rgba(200,101,145,.065), transparent 62%),
                #171215;
        }
        html[data-theme="dark"] .chat-thread-header,
        html[data-theme="dark"] .chat-composer-area {
            background: rgba(23,18,21,.88);
            border-color: rgba(255,255,255,.06);
            box-shadow: 0 7px 22px rgba(0,0,0,.12);
            -webkit-backdrop-filter: blur(16px) saturate(125%);
            backdrop-filter: blur(16px) saturate(125%);
        }
        html[data-theme="dark"] .chat-message-bubble {
            background: #30292c;
            border: 0;
            box-shadow: 0 2px 8px rgba(0,0,0,.10);
        }
        html[data-theme="dark"] .chat-message-row.is-mine .chat-message-bubble {
            background: linear-gradient(180deg, #bd5785 0%, #b94d7e 100%);
            box-shadow: 0 5px 14px rgba(0,0,0,.14);
        }
        html[data-theme="dark"] .chat-day,
        html[data-theme="dark"] .chat-reaction-chip,
        html[data-theme="dark"] .chat-attach-button,
        html[data-theme="dark"] .chat-input-shell,
        html[data-theme="dark"] .chat-attachment-preview,
        html[data-theme="dark"] .chat-composer-context,
        html[data-theme="dark"] .chat-voice-status {
            background: rgba(45,38,41,.88);
            border-color: rgba(255,255,255,.06);
            box-shadow: none;
            -webkit-backdrop-filter: blur(10px) saturate(120%);
            backdrop-filter: blur(10px) saturate(120%);
        }


        /* Direktchat fuer genau zwei Personen + Live-Vorschau auf der Startseite. */
        .home-chat-preview {
            width: 100%;
            margin: 0 0 18px;
            padding: 14px 16px;
            display: grid;
            grid-template-columns: 50px minmax(0, 1fr) auto;
            align-items: center;
            gap: 13px;
            border: 1px solid rgba(178,71,119,.16);
            border-radius: 20px;
            background:
                linear-gradient(135deg, rgba(251,243,247,.96), rgba(255,255,255,.96));
            color: var(--text-main);
            text-align: left;
            box-shadow: 0 10px 28px rgba(178,71,119,.08);
            cursor: pointer;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
        }
        .home-chat-preview:hover {
            border-color: rgba(178,71,119,.28);
            box-shadow: 0 14px 34px rgba(178,71,119,.12);
            transform: translateY(-1px);
        }
        .home-chat-preview:active { transform: scale(.992); }
        .home-chat-avatar {
            position: relative;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            overflow: visible;
            background: #f3ebef;
            box-shadow: 0 5px 16px rgba(33,20,26,.10);
        }
        .home-chat-avatar img {
            width: 100%;
            height: 100%;
            display: block;
            border-radius: inherit;
            object-fit: cover;
        }
        .home-chat-presence {
            position: absolute;
            right: -1px;
            bottom: 1px;
            width: 13px;
            height: 13px;
            border: 2px solid #fff;
            border-radius: 50%;
            background: #b09da5;
        }
        .home-chat-presence.is-online { background: #22c55e; }
        .home-chat-copy { min-width: 0; display: block; }
        .home-chat-eyebrow {
            display: block;
            margin-bottom: 2px;
            color: #b24777;
            font-size: 12px;
            font-weight: 800;
            letter-spacing: .02em;
            text-transform: uppercase;
        }
        .home-chat-name-row {
            min-width: 0;
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
        }
        .home-chat-name {
            min-width: 0;
            overflow: hidden;
            color: #21141a;
            font-size: 17px;
            font-weight: 800;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .home-chat-time {
            flex: 0 0 auto;
            color: #93848b;
            font-size: 12px;
            font-weight: 650;
            white-space: nowrap;
        }
        .home-chat-message {
            display: block;
            margin-top: 3px;
            overflow: hidden;
            color: #78676f;
            font-size: 14px;
            line-height: 1.35;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .home-chat-side {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #b24777;
        }
        .home-chat-unread {
            min-width: 24px;
            height: 24px;
            padding: 0 7px;
            display: grid;
            place-items: center;
            border-radius: 999px;
            background: #b24777;
            color: #fff;
            font-size: 12px;
            font-weight: 850;
        }
        .home-chat-unread[hidden] { display: none !important; }
        .home-chat-arrow { width: 20px; height: 20px; display: block; }

        /* Keine Chat-Uebersicht mehr: der einzige Direktchat ist sofort die Hauptansicht. */
        .chat-window.chat-direct-only { grid-template-columns: minmax(0, 1fr) !important; }
        .chat-window.chat-direct-only .chat-sidebar,
        .chat-window.chat-direct-only .chat-back-button { display: none !important; }
        .chat-window.chat-direct-only .chat-thread-close-button { display: inline-flex !important; }
        .chat-window.chat-direct-only .chat-main { display: flex !important; width: 100%; }
        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            .home-chat-preview {
                margin-bottom: 14px;
                padding: 12px 13px;
                grid-template-columns: 46px minmax(0, 1fr) auto;
                gap: 11px;
                border-radius: 18px;
            }
            .home-chat-avatar { width: 46px; height: 46px; }
            .home-chat-name { font-size: 16px; }
            .home-chat-message { font-size: 14px; }
            .home-chat-arrow { width: 18px; height: 18px; }
            .chat-window.chat-direct-only .chat-main { height: 100%; min-height: 0; }
        }
        html[data-theme="dark"] .home-chat-preview {
            border-color: rgba(215,140,174,.18);
            background: linear-gradient(135deg, rgba(61,39,49,.92), rgba(35,26,30,.96));
            box-shadow: 0 10px 28px rgba(0,0,0,.18);
        }
        html[data-theme="dark"] .home-chat-name { color: #f8f5f6; }
        html[data-theme="dark"] .home-chat-message,
        html[data-theme="dark"] .home-chat-time { color: #b5a6ad; }
        html[data-theme="dark"] .home-chat-presence { border-color: #271c21; }


        /* Hauptseite: groesseres Branding + gut sichtbare goldene Funkelsterne. */
        .is-authenticated .brand-btn {
            position: relative;
            overflow: visible;
            gap: 12px;
            isolation: isolate;
        }
        .is-authenticated .header-logo svg {
            width: 42px;
            height: 42px;
        }
        .is-authenticated .brand-text {
            display: inline-flex !important;
            align-items: center;
            position: relative;
            font-size: 1.56rem;
            letter-spacing: -.045em;
        }
        .brand-sparkle {
            position: absolute;
            z-index: 8;
            display: block;
            color: #ffc400;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", sans-serif;
            font-weight: 900;
            line-height: 1;
            pointer-events: none;
            user-select: none;
            opacity: .72;
            text-shadow:
                0 0 1px rgba(146, 64, 14, .90),
                0 0 7px rgba(250, 204, 21, .95),
                0 0 15px rgba(245, 158, 11, .68),
                0 0 24px rgba(251, 191, 36, .38);
            filter: drop-shadow(0 1px 1px rgba(120, 53, 15, .28));
            will-change: transform, opacity, filter;
            animation: hogBrandSparkle 2.8s ease-in-out infinite;
        }
        .brand-sparkle.s1 {
            top: -8px;
            left: 31px;
            font-size: 18px;
            animation-delay: 0s;
        }
        .brand-sparkle.s2 {
            left: -10px;
            bottom: -3px;
            font-size: 14px;
            color: #ffe04b;
            animation-delay: .72s;
        }
        .brand-sparkle.s3 {
            top: -9px;
            right: -17px;
            font-size: 16px;
            color: #ffd21f;
            animation-delay: 1.38s;
        }
        .brand-sparkle.s4 {
            right: 33px;
            bottom: -9px;
            font-size: 12px;
            color: #ffb800;
            animation-delay: 2.02s;
        }
        @keyframes hogBrandSparkle {
            0%, 100% {
                opacity: .58;
                transform: scale(.82) rotate(-5deg);
                filter: brightness(1) drop-shadow(0 1px 1px rgba(120,53,15,.25));
            }
            30% {
                opacity: .82;
                transform: scale(1.02) rotate(2deg);
            }
            43% {
                opacity: 1;
                transform: scale(1.48) rotate(12deg);
                filter: brightness(1.45) drop-shadow(0 0 7px rgba(255,196,0,.92));
            }
            54% {
                opacity: .78;
                transform: scale(.96) rotate(-3deg);
            }
        }
        @media (max-width: 820px) {
            .is-authenticated .header-logo svg {
                width: 40px;
                height: 40px;
            }
            .is-authenticated .brand-text {
                font-size: 1.48rem;
            }
            .brand-sparkle.s1 { left: 29px; font-size: 17px; }
            .brand-sparkle.s3 { right: -15px; font-size: 15px; }
        }
        @media (max-width: 560px) {
            .is-authenticated .brand-btn { gap: 10px; }
            .is-authenticated .header-logo svg {
                width: 38px;
                height: 38px;
            }
            .is-authenticated .brand-text {
                font-size: 1.36rem;
            }
            .brand-sparkle.s1 { top: -7px; left: 27px; font-size: 16px; }
            .brand-sparkle.s2 { left: -8px; bottom: -2px; font-size: 13px; }
            .brand-sparkle.s3 { top: -7px; right: -13px; font-size: 14px; }
            .brand-sparkle.s4 { right: 28px; bottom: -7px; font-size: 11px; }
        }
        @media (prefers-reduced-motion: reduce) {
            .brand-sparkle {
                animation: none;
                opacity: .85;
                filter: none;
            }
        }


        /* Header der Start-/Drive-Seite bleibt fest stehen */
        html { scroll-padding-top: 92px; }
        .is-authenticated .header {
            position: fixed !important;
            top: 0;
            left: 0;
            right: 0;
            width: 100%;
            margin: 0 !important;
            z-index: 1800;
        }
        .is-authenticated .app-container {
            padding-top: 78px !important;
        }
        .is-authenticated .drive-main-content,
        .is-authenticated .drive-sidebar {
            scroll-margin-top: 92px;
        }
        @media (max-width: 760px) {
            html { scroll-padding-top: 86px; }
            .is-authenticated .app-container {
                padding-top: calc(62px + env(safe-area-inset-top)) !important;
            }
            .is-authenticated .drive-main-content,
            .is-authenticated .drive-sidebar {
                scroll-margin-top: 86px;
            }
        }


        /* Dark-Mode-Redesign: ruhiger, wertiger, einheitlicher */
        html[data-theme="dark"] {
            --bg-color: #140e11;
            --surface: #1f161a;
            --border: #3b2d34;
            --border-light: #3b2c33;
            --text-main: #f6f0f2;
            --text-muted: #b2a2a9;
            --primary: #d476a0;
            --primary-hover: #dd92b4;
            --danger-bg: #34181d;
            --success-bg: #12241d;
            color-scheme: dark;
        }
        html[data-theme="dark"] body {
            background:
                radial-gradient(1200px 560px at 50% -220px, rgba(200,101,145,.10), transparent 60%),
                linear-gradient(180deg, #130d10 0%, #150f12 100%);
            color: var(--text-main);
        }
        html[data-theme="dark"] .app-container,
        html[data-theme="dark"] .is-authenticated .app-container {
            background: #1a1316;
            border-color: #32262b;
            box-shadow: 0 18px 46px rgba(0,0,0,.30);
        }
        html[data-theme="dark"] .header,
        html[data-theme="dark"] .is-authenticated .header {
            background: rgba(26,19,22,.92);
            border-bottom-color: #32262b;
            box-shadow: 0 10px 28px rgba(0,0,0,.22);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
        }
        html[data-theme="dark"] .brand-text,
        html[data-theme="dark"] .drive-page-title,
        html[data-theme="dark"] .section-title,
        html[data-theme="dark"] .board-header-copy h2,
        html[data-theme="dark"] .recipe-header-copy h2,
        html[data-theme="dark"] .story-header-copy h2 {
            color: #f9f5f7;
        }
        html[data-theme="dark"] .drive-page-kicker,
        html[data-theme="dark"] .section-subtitle,
        html[data-theme="dark"] .board-header-copy p,
        html[data-theme="dark"] .recipe-header-copy p,
        html[data-theme="dark"] .story-reader-meta,
        html[data-theme="dark"] .story-welcome p,
        html[data-theme="dark"] .recipe-meta,
        html[data-theme="dark"] .list-file-meta,
        html[data-theme="dark"] .card-meta {
            color: #aa9aa1;
        }
        html[data-theme="dark"] .btn-icon-nav,
        html[data-theme="dark"] .list-action-btn,
        html[data-theme="dark"] .theme-toggle,
        html[data-theme="dark"] .account-menu-trigger,
        html[data-theme="dark"] .chat-nav-button,
        html[data-theme="dark"] .board-refresh,
        html[data-theme="dark"] .board-close,
        html[data-theme="dark"] .recipe-close,
        html[data-theme="dark"] .story-close,
        html[data-theme="dark"] .story-back,
        html[data-theme="dark"] .story-reader-action,
        html[data-theme="dark"] .recipe-action,
        html[data-theme="dark"] .chat-back-button,
        html[data-theme="dark"] .chat-thread-close-button,
        html[data-theme="dark"] .chat-thread-search-button {
            background: #231a1e;
            border-color: #3d2d34;
            color: #d8cbd1;
            box-shadow: none;
        }
        html[data-theme="dark"] .btn-icon-nav:hover,
        html[data-theme="dark"] .list-action-btn:hover,
        html[data-theme="dark"] .theme-toggle:hover,
        html[data-theme="dark"] .account-menu-trigger:hover,
        html[data-theme="dark"] .chat-nav-button:hover,
        html[data-theme="dark"] .board-refresh:hover,
        html[data-theme="dark"] .board-close:hover,
        html[data-theme="dark"] .recipe-close:hover,
        html[data-theme="dark"] .story-close:hover,
        html[data-theme="dark"] .story-back:hover,
        html[data-theme="dark"] .story-reader-action:hover,
        html[data-theme="dark"] .recipe-action:hover,
        html[data-theme="dark"] .chat-back-button:hover,
        html[data-theme="dark"] .chat-thread-close-button:hover,
        html[data-theme="dark"] .chat-thread-search-button:hover {
            background: #2d2126;
            color: #f3ecef;
            border-color: #4c3a42;
        }
        html[data-theme="dark"] .drive-desktop-sidebar,
        html[data-theme="dark"] .drive-main-content,
        html[data-theme="dark"] .feature-menu-drawer,
        html[data-theme="dark"] .board-window,
        html[data-theme="dark"] .board-feed,
        html[data-theme="dark"] .recipe-window,
        html[data-theme="dark"] .recipe-main,
        html[data-theme="dark"] .story-window,
        html[data-theme="dark"] .story-main {
            background: #1a1316;
        }
        html[data-theme="dark"] .drive-desktop-sidebar,
        html[data-theme="dark"] .feature-menu-head,
        html[data-theme="dark"] .feature-menu-foot,
        html[data-theme="dark"] .drive-sidebar-divider,
        html[data-theme="dark"] .drive-sidebar-storage,
        html[data-theme="dark"] .board-header,
        html[data-theme="dark"] .board-compose-panel,
        html[data-theme="dark"] .recipe-header,
        html[data-theme="dark"] .recipe-sidebar,
        html[data-theme="dark"] .recipe-hero,
        html[data-theme="dark"] .recipe-section,
        html[data-theme="dark"] .recipe-editor-card,
        html[data-theme="dark"] .story-header,
        html[data-theme="dark"] .story-sidebar,
        html[data-theme="dark"] .story-editor-card,
        html[data-theme="dark"] .story-reader-toolbar {
            border-color: #32262b;
            background: #22171c;
        }
        html[data-theme="dark"] .storage-widget,
        html[data-theme="dark"] .folders-container,
        html[data-theme="dark"] .file-list,
        html[data-theme="dark"] .file-item,
        html[data-theme="dark"] .folder-row,
        html[data-theme="dark"] .card,
        html[data-theme="dark"] .card-footer,
        html[data-theme="dark"] .empty-state,
        html[data-theme="dark"] .account-menu-popover,
        html[data-theme="dark"] .upload-stat,
        html[data-theme="dark"] .progress-wrapper,
        html[data-theme="dark"] .board-card,
        html[data-theme="dark"] .board-link,
        html[data-theme="dark"] .board-file-preview,
        html[data-theme="dark"] .recipe-list-item,
        html[data-theme="dark"] .story-list-item,
        html[data-theme="dark"] .story-welcome,
        html[data-theme="dark"] .story-reader,
        html[data-theme="dark"] .lady-gallery-toolbar {
            background: #22171c;
            border-color: #3a2a32;
            box-shadow: none;
        }
        html[data-theme="dark"] .folder-row:hover,
        html[data-theme="dark"] .file-item:hover,
        html[data-theme="dark"] .card:hover,
        html[data-theme="dark"] .recipe-list-item:hover,
        html[data-theme="dark"] .story-list-item:hover,
        html[data-theme="dark"] .story-list-item.is-active,
        html[data-theme="dark"] .drive-sidebar-link:hover,
        html[data-theme="dark"] .feature-menu-item:hover {
            background: #291e23;
            border-color: #45343c;
        }
        html[data-theme="dark"] .drive-sidebar-link,
        html[data-theme="dark"] .feature-menu-item,
        html[data-theme="dark"] .story-list-item,
        html[data-theme="dark"] .recipe-list-copy strong,
        html[data-theme="dark"] .folder-row-title,
        html[data-theme="dark"] .list-file-name,
        html[data-theme="dark"] .card-title,
        html[data-theme="dark"] .board-author,
        html[data-theme="dark"] .board-card-text,
        html[data-theme="dark"] .recipe-title,
        html[data-theme="dark"] .recipe-section h3,
        html[data-theme="dark"] .story-reader h1,
        html[data-theme="dark"] .story-reader-text,
        html[data-theme="dark"] .story-editor-card h3,
        html[data-theme="dark"] .recipe-editor-card h3 {
            color: #f4eef1;
        }
        html[data-theme="dark"] .drive-sidebar-label,
        html[data-theme="dark"] .drive-sidebar-storage,
        html[data-theme="dark"] .mobile-feature-menu-copy span,
        html[data-theme="dark"] .story-search-meta,
        html[data-theme="dark"] .story-field-hint,
        html[data-theme="dark"] .recipe-ingredients li,
        html[data-theme="dark"] .recipe-steps li,
        html[data-theme="dark"] .board-compose-copy,
        html[data-theme="dark"] .board-char-count,
        html[data-theme="dark"] .home-chat-eyebrow,
        html[data-theme="dark"] .home-chat-time {
            color: #a99ba1;
        }
        html[data-theme="dark"] input[type="password"],
        html[data-theme="dark"] input[type="text"],
        html[data-theme="dark"] input[type="search"],
        html[data-theme="dark"] input[type="url"],
        html[data-theme="dark"] select,
        html[data-theme="dark"] textarea,
        html[data-theme="dark"] .board-textarea,
        html[data-theme="dark"] .board-link-input,
        html[data-theme="dark"] .board-image-picker,
        html[data-theme="dark"] .recipe-search,
        html[data-theme="dark"] .recipe-category,
        html[data-theme="dark"] .recipe-field input,
        html[data-theme="dark"] .recipe-field textarea,
        html[data-theme="dark"] .story-search,
        html[data-theme="dark"] .story-field input,
        html[data-theme="dark"] .story-field textarea {
            background: #1c1317;
            border-color: #3e2d35;
            color: #f8f2f4;
            box-shadow: none;
        }
        html[data-theme="dark"] input::placeholder,
        html[data-theme="dark"] textarea::placeholder {
            color: #8d7c84;
        }
        html[data-theme="dark"] .drop-zone,
        html[data-theme="dark"] .upload-drop-icon,
        html[data-theme="dark"] .upload-drop-icon::before,
        html[data-theme="dark"] .upload-progress-ring::after,
        html[data-theme="dark"] .list-icon-box,
        html[data-theme="dark"] .file-icon-box,
        html[data-theme="dark"] .folder-row-icon,
        html[data-theme="dark"] .chat-file-icon {
            background: #281d22;
            border-color: #3d2c34;
        }
        html[data-theme="dark"] .drop-zone:hover:not(.disabled),
        html[data-theme="dark"] .drop-zone.dragover:not(.disabled) {
            background: #2b1c23;
            border-color: #cf6896;
        }
        html[data-theme="dark"] .drop-zone-title,
        html[data-theme="dark"] .upload-current-name,
        html[data-theme="dark"] .upload-progress-ring-value,
        html[data-theme="dark"] .upload-stat-value,
        html[data-theme="dark"] .upload-progress-row strong {
            color: #f6f1f3;
        }
        html[data-theme="dark"] .drive-sidebar-link.is-active,
        html[data-theme="dark"] .drive-sidebar-menu-button.is-menu-primary,
        html[data-theme="dark"] .feature-menu-item.is-active,
        html[data-theme="dark"] .chat-search-group-count,
        html[data-theme="dark"] .chat-search-empty-icon {
            background: rgba(212, 118, 160, .14);
            border-color: rgba(212, 118, 160, .18);
            color: #e1a0bd;
        }
        html[data-theme="dark"] .board-link,
        html[data-theme="dark"] .board-file-preview,
        html[data-theme="dark"] .chat-search-hit:hover,
        html[data-theme="dark"] .chat-search-hit:focus-visible,
        html[data-theme="dark"] .chat-global-search-entry:hover,
        html[data-theme="dark"] .chat-global-search-entry:focus-visible {
            background: #2e1c24;
            border-color: #593a48;
            color: #e9bacf;
        }
        html[data-theme="dark"] .chat-conversation,
        html[data-theme="dark"] .chat-messages,
        html[data-theme="dark"] .chat-thread-header,
        html[data-theme="dark"] .chat-composer-area {
            background: #1a1316;
            border-color: #32262b;
        }
        html[data-theme="dark"] .chat-thread-name,
        html[data-theme="dark"] .chat-message-input,
        html[data-theme="dark"] .chat-search-input,
        html[data-theme="dark"] .chat-thread-search-input,
        html[data-theme="dark"] .chat-contact-name,
        html[data-theme="dark"] .chat-message-text,
        html[data-theme="dark"] .chat-action-item,
        html[data-theme="dark"] .chat-search-summary-title,
        html[data-theme="dark"] .chat-search-group-name {
            color: #f7f1f3;
        }
        html[data-theme="dark"] .chat-thread-status,
        html[data-theme="dark"] .chat-thread-note,
        html[data-theme="dark"] .chat-contact-preview,
        html[data-theme="dark"] .chat-search-summary-context,
        html[data-theme="dark"] .chat-search-group-status,
        html[data-theme="dark"] .chat-search-hit-snippet,
        html[data-theme="dark"] .chat-message-meta,
        html[data-theme="dark"] .chat-day {
            color: #ab9aa1;
        }
        html[data-theme="dark"] .chat-message-bubble {
            background: #291e23;
            color: #f7f1f3;
            border: 1px solid #3b2a32;
            box-shadow: none;
        }
        html[data-theme="dark"] .chat-message-row.is-mine .chat-message-bubble {
            background: linear-gradient(180deg, #d3759f 0%, #ca6693 100%);
            color: #fff;
            border-color: transparent;
        }
        html[data-theme="dark"] .chat-day {
            background: #24191e;
            border: 1px solid #3b2a32;
        }
        html[data-theme="dark"] .chat-reply-quote {
            background: #24191e;
            color: #cebfc6;
        }
        html[data-theme="dark"] .chat-reaction-chip {
            background: #24191e;
            border-color: #402e36;
            color: #ece4e8;
            box-shadow: none;
        }
        html[data-theme="dark"] .chat-reaction-chip.is-mine {
            background: #4b2737;
            border-color: #7e455f;
        }
        html[data-theme="dark"] .chat-input-shell,
        html[data-theme="dark"] .chat-attachment-preview,
        html[data-theme="dark"] .chat-composer-context,
        html[data-theme="dark"] .chat-voice-status,
        html[data-theme="dark"] .chat-action-menu,
        html[data-theme="dark"] .chat-emoji-picker,
        html[data-theme="dark"] .chat-search-panel,
        html[data-theme="dark"] .chat-search-group,
        html[data-theme="dark"] .chat-forward-sheet-card {
            background: #22171c;
            border-color: #3b2a32;
            color: #f4eef1;
            box-shadow: 0 18px 44px rgba(0,0,0,.28);
        }
        html[data-theme="dark"] .chat-input-shell:focus-within,
        html[data-theme="dark"] .chat-search-input:focus,
        html[data-theme="dark"] .chat-thread-search-input:focus,
        html[data-theme="dark"] .story-search:focus,
        html[data-theme="dark"] .recipe-search:focus,
        html[data-theme="dark"] .board-textarea:focus,
        html[data-theme="dark"] .board-link-input:focus {
            border-color: #ca6793;
            box-shadow: 0 0 0 3px rgba(212, 118, 160, .12);
            outline: none;
        }
        html[data-theme="dark"] .chat-attach-button,
        html[data-theme="dark"] .chat-voice-button,
        html[data-theme="dark"] .chat-emoji-button {
            color: #d8cad0;
            background: transparent;
        }
        html[data-theme="dark"] .chat-send-button {
            background: linear-gradient(180deg, #d3759f 0%, #ca6693 100%);
            color: #fff;
            box-shadow: none;
        }
        html[data-theme="dark"] .chat-typing-indicator {
            background: #291e23;
            box-shadow: none;
        }
        html[data-theme="dark"] .board-card,
        html[data-theme="dark"] .recipe-section,
        html[data-theme="dark"] .recipe-editor-card,
        html[data-theme="dark"] .story-reader,
        html[data-theme="dark"] .story-editor-card {
            border-radius: 18px;
        }


        /* ============================================================
           HOGDRIVE – iOS CLEAN GLASS 2026
           Reinweisser Grund, keine grauen Konturen, dezentes Glas.
           Bestehende Funktionen/Markup bleiben unveraendert.
           ============================================================ */

        html:not([data-theme="dark"]) {
            --bg-color: #ffffff;
            --surface: #ffffff;
            --border: transparent;
            --border-light: transparent;
            --text-main: #21151a;
            --text-muted: #8d7c83;
            --primary: #b95280;
            --primary-hover: #9e496f;
            color-scheme: light;
        }

        html:not([data-theme="dark"]) body.is-authenticated {
            background: #ffffff !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .app-container {
            width: 100%;
            max-width: none;
            background: #ffffff !important;
            border: 0 !important;
            border-radius: 0 !important;
            box-shadow: none !important;
        }

        /* Kein dekoratives Funkeln mehr. */
        .brand-sparkle,
        .logo-aura {
            display: none !important;
        }

        /* ---------------- Header / Navigation: echtes, ruhiges Glas ---------------- */

        html:not([data-theme="dark"]) body.is-authenticated .header {
            background: rgba(255,255,255,.78) !important;
            border: 0 !important;
            border-bottom: 0 !important;
            box-shadow:
                0 12px 34px rgba(33,20,26,.055),
                inset 0 -1px 0 rgba(255,255,255,.72) !important;
            -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
            backdrop-filter: blur(30px) saturate(180%) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .header-logo {
            filter: drop-shadow(0 5px 12px rgba(185,82,128,.14));
        }

        html:not([data-theme="dark"]) body.is-authenticated .btn-icon-nav,
        html:not([data-theme="dark"]) body.is-authenticated .user-badge,
        html:not([data-theme="dark"]) body.is-authenticated .theme-toggle {
            background: rgba(255,255,255,.72) !important;
            border: 0 !important;
            color: #6e5b63;
            box-shadow:
                0 7px 22px rgba(33,20,26,.065),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(18px) saturate(170%);
            backdrop-filter: blur(18px) saturate(170%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .btn-icon-nav:hover,
        html:not([data-theme="dark"]) body.is-authenticated .user-badge:hover,
        html:not([data-theme="dark"]) body.is-authenticated .theme-toggle:hover {
            background: rgba(255,255,255,.94) !important;
            color: var(--primary) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .chat-nav-button {
            border: 0 !important;
            background: linear-gradient(180deg, #bf5d89 0%, #ae4e79 100%) !important;
            color: #ffffff !important;
            box-shadow:
                0 9px 24px rgba(174,78,121,.22),
                inset 0 1px 0 rgba(255,255,255,.26) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .account-menu-popover {
            background: rgba(255,255,255,.86) !important;
            border: 0 !important;
            box-shadow:
                0 24px 70px rgba(33,20,26,.16),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(30px) saturate(180%);
            backdrop-filter: blur(30px) saturate(180%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .account-menu-heading {
            border-bottom: 0 !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .account-menu-item:hover,
        html:not([data-theme="dark"]) body.is-authenticated .account-menu-item:focus-visible {
            background: rgba(185,82,128,.075) !important;
        }

        /* ---------------- Drive: alles auf weissem Grund ---------------- */

        html:not([data-theme="dark"]) body.is-authenticated .drive-main-content,
        html:not([data-theme="dark"]) body.is-authenticated .drive-desktop-sidebar {
            background: #ffffff !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-desktop-sidebar {
            border: 0 !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-divider {
            background: transparent !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-link,
        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-menu-button {
            border: 0 !important;
            border-radius: 14px;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-link:hover,
        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-menu-button:hover {
            background: rgba(185,82,128,.055) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-link.is-active,
        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-menu-button.is-menu-primary {
            background: rgba(185,82,128,.09) !important;
            color: #9e496f !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .drive-sidebar-storage,
        html:not([data-theme="dark"]) body.is-authenticated .storage-widget {
            background: rgba(255,255,255,.76) !important;
            border: 0 !important;
            box-shadow:
                0 10px 30px rgba(33,20,26,.045),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(18px) saturate(160%);
            backdrop-filter: blur(18px) saturate(160%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .storage-bar-bg {
            background: rgba(185,82,128,.09) !important;
        }

        /* Neuer-Ordner-Feld ohne graue Kontur */
        html:not([data-theme="dark"]) body.is-authenticated .folder-form input {
            background: rgba(255,255,255,.84) !important;
            border: 0 !important;
            color: #20151a !important;
            box-shadow:
                0 8px 26px rgba(33,20,26,.055),
                inset 0 1px 0 rgba(255,255,255,1) !important;
            -webkit-backdrop-filter: blur(18px) saturate(155%);
            backdrop-filter: blur(18px) saturate(155%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .folder-form input:focus {
            outline: none !important;
            background: #ffffff !important;
            box-shadow:
                0 0 0 4px rgba(185,82,128,.09),
                0 10px 28px rgba(185,82,128,.08),
                inset 0 1px 0 rgba(255,255,255,1) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .folder-form .btn {
            border: 0 !important;
            background: linear-gradient(180deg, #c56490 0%, #b95280 100%) !important;
            color: #ffffff !important;
            box-shadow:
                0 10px 24px rgba(185,82,128,.22),
                inset 0 1px 0 rgba(255,255,255,.27) !important;
        }

        /* Breadcrumbs: iOS-Chip statt grauer Rahmen */
        html:not([data-theme="dark"]) body.is-authenticated .breadcrumbs {
            border: 0 !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .breadcrumb-btn {
            background: rgba(255,255,255,.82) !important;
            border: 0 !important;
            border-radius: 15px !important;
            box-shadow:
                0 7px 22px rgba(33,20,26,.045),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(16px) saturate(150%);
            backdrop-filter: blur(16px) saturate(150%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .breadcrumb-btn:hover {
            background: #ffffff !important;
            color: var(--primary) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .breadcrumb-separator {
            color: #cdc4c8 !important;
        }

        /* Upload: keine Umrandung – nur schwebendes Glas */
        html:not([data-theme="dark"]) body.is-authenticated .drop-zone {
            background:
                linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,255,255,.70)) !important;
            border: 0 !important;
            border-radius: 24px !important;
            box-shadow:
                0 12px 34px rgba(33,20,26,.055),
                inset 0 1px 0 rgba(255,255,255,1) !important;
            -webkit-backdrop-filter: blur(24px) saturate(170%);
            backdrop-filter: blur(24px) saturate(170%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .drop-zone:hover:not(.disabled),
        html:not([data-theme="dark"]) body.is-authenticated .drop-zone.dragover:not(.disabled) {
            background:
                linear-gradient(145deg, rgba(255,255,255,1), rgba(252,246,249,.88)) !important;
            border: 0 !important;
            box-shadow:
                0 14px 38px rgba(185,82,128,.10),
                0 0 0 4px rgba(185,82,128,.055),
                inset 0 1px 0 rgba(255,255,255,1) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .upload-drop-icon {
            background: rgba(185,82,128,.085) !important;
            border: 0 !important;
            color: #b95280 !important;
            box-shadow: inset 0 1px 0 rgba(255,255,255,.94);
        }

        html:not([data-theme="dark"]) body.is-authenticated .drop-zone-hint {
            background: rgba(255,255,255,.76) !important;
            border: 0 !important;
            box-shadow: 0 4px 14px rgba(33,20,26,.035);
        }

        html:not([data-theme="dark"]) body.is-authenticated .progress-wrapper,
        html:not([data-theme="dark"]) body.is-authenticated .upload-stat,
        html:not([data-theme="dark"]) body.is-authenticated .upload-queue-item {
            border: 0 !important;
            background: rgba(255,255,255,.82) !important;
            box-shadow: 0 8px 24px rgba(33,20,26,.045);
        }

        /* Abschnittstitel ohne graue Trennlinie */
        html:not([data-theme="dark"]) body.is-authenticated .section-title {
            border: 0 !important;
            border-bottom: 0 !important;
            color: #21151a !important;
        }

        /* Ordner als weisse, schwebende iOS-Karten */
        html:not([data-theme="dark"]) body.is-authenticated .folders-container {
            border: 0 !important;
            background: transparent !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .folder-row {
            background: rgba(255,255,255,.84) !important;
            border: 0 !important;
            border-bottom: 0 !important;
            border-radius: 20px !important;
            box-shadow:
                0 8px 26px rgba(33,20,26,.052),
                inset 0 1px 0 rgba(255,255,255,1) !important;
            -webkit-backdrop-filter: blur(18px) saturate(155%);
            backdrop-filter: blur(18px) saturate(155%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .folder-row:hover {
            background: #ffffff !important;
            border: 0 !important;
            box-shadow:
                0 12px 30px rgba(33,20,26,.07),
                inset 0 1px 0 rgba(255,255,255,1) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .folder-row-icon {
            border: 0 !important;
            background: transparent !important;
        }

        /* Dateien: keine graue Sammelbox und keine Trennlinien */
        html:not([data-theme="dark"]) body.is-authenticated .file-list {
            background: transparent !important;
            border: 0 !important;
            border-radius: 0 !important;
            overflow: visible !important;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        html:not([data-theme="dark"]) body.is-authenticated .file-item {
            background: rgba(255,255,255,.86) !important;
            border: 0 !important;
            border-bottom: 0 !important;
            border-radius: 18px !important;
            box-shadow:
                0 7px 24px rgba(33,20,26,.048),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(18px) saturate(155%);
            backdrop-filter: blur(18px) saturate(155%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .file-item:hover {
            background: #ffffff !important;
            border: 0 !important;
            box-shadow: 0 11px 28px rgba(33,20,26,.065) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .list-icon-box,
        html:not([data-theme="dark"]) body.is-authenticated .file-icon-box,
        html:not([data-theme="dark"]) body.is-authenticated .list-thumb,
        html:not([data-theme="dark"]) body.is-authenticated .list-canvas-thumb {
            border: 0 !important;
            box-shadow: none;
        }

        html:not([data-theme="dark"]) body.is-authenticated .list-action-btn,
        html:not([data-theme="dark"]) body.is-authenticated .quick-action-btn {
            border: 0 !important;
            background: rgba(255,255,255,.74) !important;
            box-shadow:
                0 6px 18px rgba(33,20,26,.075),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
            -webkit-backdrop-filter: blur(14px) saturate(150%);
            backdrop-filter: blur(14px) saturate(150%);
        }

        html:not([data-theme="dark"]) body.is-authenticated .list-action-btn:hover,
        html:not([data-theme="dark"]) body.is-authenticated .quick-action-btn:hover {
            background: #ffffff !important;
        }

        /* Grid-/Medienkarten ebenfalls ohne graue Linien */
        html:not([data-theme="dark"]) body.is-authenticated .card,
        html:not([data-theme="dark"]) body.is-authenticated .card-footer,
        html:not([data-theme="dark"]) body.is-authenticated .empty-state {
            border: 0 !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .card,
        html:not([data-theme="dark"]) body.is-authenticated .empty-state {
            background: rgba(255,255,255,.86) !important;
            box-shadow:
                0 8px 28px rgba(33,20,26,.052),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
        }

        html:not([data-theme="dark"]) body.is-authenticated .card-footer {
            background: rgba(255,255,255,.88) !important;
            border-top: 0 !important;
        }

        /* ---------------- Mobile iOS Tab Bar ---------------- */

        @media (max-width: 760px) {
            html:not([data-theme="dark"]) body.is-authenticated {
                padding-left: 0 !important;
                padding-right: 0 !important;
                padding-bottom: 0 !important;
                background: #ffffff !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .app-container {
                padding-left: max(14px, env(safe-area-inset-left)) !important;
                padding-right: max(14px, env(safe-area-inset-right)) !important;
                padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .header {
                padding-left: max(14px, env(safe-area-inset-left)) !important;
                padding-right: max(14px, env(safe-area-inset-right)) !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .mobile-app-nav {
                left: 0;
                right: 0;
                border: 0 !important;
                border-top: 0 !important;
                background: rgba(255,255,255,.78) !important;
                box-shadow:
                    0 -14px 36px rgba(33,20,26,.065),
                    inset 0 1px 0 rgba(255,255,255,.86) !important;
                -webkit-backdrop-filter: blur(30px) saturate(185%) !important;
                backdrop-filter: blur(30px) saturate(185%) !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .mobile-app-nav-item {
                border: 0 !important;
                background: transparent !important;
                color: #918289;
                border-radius: 16px;
            }

            html:not([data-theme="dark"]) body.is-authenticated .mobile-app-nav-item.is-active {
                color: #b95280 !important;
                background: rgba(185,82,128,.085) !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .mobile-app-nav-item:active {
                background: rgba(185,82,128,.06) !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .drive-main-content .folder-row {
                border-radius: 18px !important;
                padding: 11px 12px !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .drive-main-content .file-item {
                border-radius: 17px !important;
            }

            html:not([data-theme="dark"]) body.is-authenticated .drive-main-content .drop-zone {
                border-radius: 22px !important;
            }
        }

        /* ---------------- Chat: iOS / Glass, ohne graue Konturen ---------------- */

        html:not([data-theme="dark"]) .chat-conversation,
        html:not([data-theme="dark"]) .chat-messages {
            background: #ffffff !important;
        }

        html:not([data-theme="dark"]) .chat-thread-header {
            background: rgba(255,255,255,.78) !important;
            border: 0 !important;
            border-bottom: 0 !important;
            box-shadow:
                0 10px 30px rgba(33,20,26,.055),
                inset 0 -1px 0 rgba(255,255,255,.74) !important;
            -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
            backdrop-filter: blur(30px) saturate(180%) !important;
        }

        html:not([data-theme="dark"]) .chat-back-button,
        html:not([data-theme="dark"]) .chat-thread-close-button,
        html:not([data-theme="dark"]) .chat-thread-search-button {
            border: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
        }

        html:not([data-theme="dark"]) .chat-message-bubble {
            border: 0 !important;
            background: rgba(246,243,244,.90) !important;
            box-shadow: none !important;
        }

        html:not([data-theme="dark"]) .chat-message-row.is-mine .chat-message-bubble {
            border: 0 !important;
            background: linear-gradient(180deg, #c56490 0%, #b5517e 100%) !important;
            box-shadow: 0 7px 20px rgba(181,81,126,.13) !important;
        }

        html:not([data-theme="dark"]) .chat-day {
            border: 0 !important;
            background: rgba(255,255,255,.76) !important;
            box-shadow: 0 5px 18px rgba(33,20,26,.04) !important;
            -webkit-backdrop-filter: blur(14px) saturate(150%);
            backdrop-filter: blur(14px) saturate(150%);
        }

        html:not([data-theme="dark"]) .chat-reaction-chip {
            border: 0 !important;
            background: rgba(255,255,255,.90) !important;
            box-shadow: 0 5px 16px rgba(33,20,26,.09) !important;
            -webkit-backdrop-filter: blur(16px) saturate(160%);
            backdrop-filter: blur(16px) saturate(160%);
        }

        html:not([data-theme="dark"]) .chat-composer-area {
            background: rgba(255,255,255,.80) !important;
            border: 0 !important;
            border-top: 0 !important;
            box-shadow: 0 -12px 34px rgba(33,20,26,.055) !important;
            -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
            backdrop-filter: blur(30px) saturate(180%) !important;
        }

        html:not([data-theme="dark"]) .chat-composer {
            border: 0 !important;
            background: transparent !important;
            box-shadow: none !important;
        }

        html:not([data-theme="dark"]) .chat-input-shell {
            border: 0 !important;
            background: rgba(247,248,250,.88) !important;
            box-shadow:
                inset 0 1px 0 rgba(255,255,255,.98),
                0 5px 18px rgba(33,20,26,.035) !important;
        }

        html:not([data-theme="dark"]) .chat-input-shell:focus-within {
            border: 0 !important;
            background: #ffffff !important;
            box-shadow:
                0 0 0 4px rgba(185,82,128,.07),
                0 7px 22px rgba(185,82,128,.055) !important;
        }

        html:not([data-theme="dark"]) .chat-attach-button {
            border: 0 !important;
            background: rgba(255,255,255,.82) !important;
            box-shadow:
                0 6px 20px rgba(33,20,26,.06),
                inset 0 1px 0 rgba(255,255,255,.98) !important;
        }

        html:not([data-theme="dark"]) .chat-attachment-preview,
        html:not([data-theme="dark"]) .chat-composer-context,
        html:not([data-theme="dark"]) .chat-voice-status,
        html:not([data-theme="dark"]) .chat-action-menu,
        html:not([data-theme="dark"]) .chat-emoji-picker,
        html:not([data-theme="dark"]) .chat-search-panel,
        html:not([data-theme="dark"]) .chat-search-group,
        html:not([data-theme="dark"]) .chat-forward-sheet-card {
            border: 0 !important;
            background: rgba(255,255,255,.88) !important;
            box-shadow: 0 18px 52px rgba(33,20,26,.13) !important;
            -webkit-backdrop-filter: blur(28px) saturate(175%);
            backdrop-filter: blur(28px) saturate(175%);
        }

        /* ---------------- Pinnwand / Rezepte / Geschichten: gleiche Designsprache ---------------- */

        html:not([data-theme="dark"]) .board-window,
        html:not([data-theme="dark"]) .recipe-window,
        html:not([data-theme="dark"]) .story-window,
        html:not([data-theme="dark"]) .feature-menu-drawer {
            border: 0 !important;
            background: rgba(255,255,255,.88) !important;
            box-shadow: 0 28px 80px rgba(33,20,26,.16) !important;
            -webkit-backdrop-filter: blur(30px) saturate(180%);
            backdrop-filter: blur(30px) saturate(180%);
        }

        html:not([data-theme="dark"]) .board-header,
        html:not([data-theme="dark"]) .board-compose-panel,
        html:not([data-theme="dark"]) .recipe-header,
        html:not([data-theme="dark"]) .recipe-sidebar,
        html:not([data-theme="dark"]) .recipe-hero,
        html:not([data-theme="dark"]) .recipe-section,
        html:not([data-theme="dark"]) .recipe-editor-card,
        html:not([data-theme="dark"]) .story-header,
        html:not([data-theme="dark"]) .story-sidebar,
        html:not([data-theme="dark"]) .story-editor-card,
        html:not([data-theme="dark"]) .story-reader-toolbar,
        html:not([data-theme="dark"]) .feature-menu-head,
        html:not([data-theme="dark"]) .feature-menu-foot {
            border-color: transparent !important;
        }

        html:not([data-theme="dark"]) .board-card,
        html:not([data-theme="dark"]) .recipe-list-item,
        html:not([data-theme="dark"]) .story-list-item,
        html:not([data-theme="dark"]) .story-welcome,
        html:not([data-theme="dark"]) .story-reader,
        html:not([data-theme="dark"]) .recipe-section,
        html:not([data-theme="dark"]) .recipe-editor-card,
        html:not([data-theme="dark"]) .story-editor-card {
            border: 0 !important;
            box-shadow: 0 8px 26px rgba(33,20,26,.045);
        }

        /* PDF auf iPhone/kleinen Geräten: Hogdrive-Bedienung bleibt sichtbar.
           Der Leser nutzt fast die ganze Fläche; Schließen, Download, Ausgabewechsel
           und das optionale externe Öffnen liegen in sicheren Bedienleisten. */
        @media (max-width: 760px), (max-height: 540px) and (pointer: coarse) {
            #mediaModal[data-mode="pdf"]::after {
                content: ""; position: absolute; z-index: 10001; left: 0; right: 0; bottom: 0;
                height: calc(64px + env(safe-area-inset-bottom, 0px));
                background: #050505; pointer-events: none;
            }
            #mediaModal[data-mode="pdf"] .media-stage {
                inset: calc(60px + env(safe-area-inset-top, 0px))
                       env(safe-area-inset-right, 0px)
                       calc(64px + env(safe-area-inset-bottom, 0px))
                       env(safe-area-inset-left, 0px);
            }
            #mediaModal[data-mode="pdf"] .pdf-modal-wrapper { width: 100%; height: 100%; padding: 0; gap: 0; }
            #mediaModal[data-mode="pdf"] .modal-pdf-frame { width: 100%; height: 100%; border-radius: 0; }
            #mediaModal[data-mode="pdf"] .modal-close-btn {
                top: calc(8px + env(safe-area-inset-top, 0px));
                left: calc(8px + env(safe-area-inset-left, 0px));
            }
            #mediaModal[data-mode="pdf"] .media-modal-download {
                top: calc(8px + env(safe-area-inset-top, 0px));
                right: calc(8px + env(safe-area-inset-right, 0px));
            }
            #mediaModal[data-mode="pdf"] .media-modal-meta {
                top: calc(8px + env(safe-area-inset-top, 0px));
                left: calc(58px + env(safe-area-inset-left, 0px));
                right: calc(58px + env(safe-area-inset-right, 0px));
                height: 44px;
            }
            #mediaModal[data-mode="pdf"] .media-modal-name { max-width: 52vw; font-size: .82rem; }
            #mediaModal[data-mode="pdf"] .media-modal-count { font-size: .72rem; }
            #mediaModal[data-mode="pdf"] .modal-nav-btn {
                top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
                width: 44px; height: 44px; transform: none; z-index: 10004;
            }
            #mediaModal[data-mode="pdf"] .modal-prev { left: calc(10px + env(safe-area-inset-left, 0px)); }
            #mediaModal[data-mode="pdf"] .modal-next { right: calc(10px + env(safe-area-inset-right, 0px)); }
            #mediaModal[data-mode="pdf"] .pdf-external-btn {
                position: fixed; z-index: 10004; left: 50%;
                bottom: calc(10px + env(safe-area-inset-bottom, 0px));
                transform: translateX(-50%); width: auto; max-width: calc(100vw - 132px);
                height: 44px; padding: 0 13px; justify-content: center; white-space: nowrap;
                overflow: hidden; text-overflow: ellipsis; border-radius: 12px;
                background: rgba(25,24,25,.96);
            }
        }

        /* Wenn Reduce Motion aktiv ist: Glas bleibt, Bewegungen nicht. */
        @media (prefers-reduced-motion: reduce) {
            .brand-sparkle { display: none !important; animation: none !important; }
        }
/* Farben für Bedienelemente, die ihre Standardfarben vom Browser bekommen. */
:root {
    --hd-orchid-link: #7a4164;
    --hd-orchid-focus: #955579;
    --hd-orchid-selection: #efcfe1;
    --hd-orchid-selection-text: #321d2b;
    accent-color: var(--hd-orchid-link);
}
html[data-theme="dark"] {
    --hd-orchid-link: #efadd5;
    --hd-orchid-focus: #d88fb7;
    --hd-orchid-selection: #744563;
    --hd-orchid-selection-text: #fff7fb;
}
:where(a:any-link) { color: var(--hd-orchid-link); }
:where(a, button, input, textarea, select, summary):focus-visible { outline-color: var(--hd-orchid-focus); }
::selection { background-color: var(--hd-orchid-selection); color: var(--hd-orchid-selection-text); }
