*{box-sizing:border-box}:root{--ink:#252735;--muted:#85868b;--line:#e9e9e7;--side:#f6f6f3;--hover:#ecece8;--mint:#e7eee8}body{margin:0;background:white;color:var(--ink);font:14px/1.55 -apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none}a{color:inherit;text-underline-offset:3px}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #7c9685;outline-offset:3px}[hidden]{display:none!important}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon{width:34px;height:34px;padding:7px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;font-size:22px;line-height:1;flex-shrink:0}.icon:hover{background:var(--hover)}#sidebar{position:fixed;inset:0 auto 0 0;width:250px;background:var(--side);padding:26px 12px 12px;display:flex;flex-direction:column;z-index:10}.brand-row{padding:0 12px;display:flex;align-items:center;justify-content:space-between;margin-bottom:31px}.brand-row img{width:198px;max-width:100%;height:auto;display:block}.nav-button{display:flex;align-items:center;gap:12px;width:100%;padding:10px 13px;text-align:left;border-radius:8px;font-size:13px}.nav-button:hover,.nav-button.current{background:var(--hover)}.nav-button svg{width:18px;height:18px}.side-scroll{overflow-y:auto;overflow-x:hidden;margin-top:26px;scrollbar-width:thin;flex:1}.side-heading{padding:0 12px;display:flex;align-items:center;justify-content:space-between;color:#797b7e;font-size:11px;font-weight:600;height:32px}.side-heading .icon{font-size:21px}.chats-heading{margin-top:28px}.new-project-link{font-size:12px;color:#777b7b;margin:3px 0;padding:8px 12px;text-align:left;width:100%;border-radius:7px}.new-project-link:hover{background:var(--hover)}.side-item{display:flex;align-items:center;gap:9px;width:100%;border-radius:8px;padding:9px 12px;text-align:left;font-size:12px}.side-item:hover,.side-item.current{background:var(--hover)}.side-item span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.side-item svg{width:16px;height:16px;color:#747b76}.side-empty{padding:0 12px;font-size:11px;color:#999b98}.sidebar-bottom{padding-top:15px}.profile{width:100%;display:flex;align-items:center;gap:10px;text-align:left;border-radius:8px;padding:12px 10px;margin-top:12px;font-size:12px}.profile:hover{background:var(--hover)}.avatar,.profile img{width:33px;height:33px;border-radius:50%;background:#dce7dd;object-fit:cover;display:grid;place-items:center;font-size:13px;flex-shrink:0}.profile .chevron{margin-left:auto;color:#777}.workspace{margin-left:250px;height:100dvh;display:flex;flex-direction:column}header{height:68px;flex-shrink:0;padding:0 29px;display:flex;align-items:center;justify-content:space-between}.header-title{display:flex;align-items:center;gap:12px;min-width:0}#home{font-size:16px;letter-spacing:.04em;font-weight:600;padding:0;color:#4e5357}#header-project{font-size:13px;color:#888;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#header-project:not(:empty):before{content:'/';margin-right:14px;color:#c4c4c0}.header-actions{display:flex;gap:6px}.header-actions .icon{color:#888}.header-actions svg{width:17px;height:17px}#chat-main{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;overflow:auto}#welcome{width:min(750px,100%);margin:0 auto;padding:0 24px}#welcome h1{font-size:32px;font-weight:500;letter-spacing:-.035em;line-height:1.3;margin:18px 0 28px}.welcome-mark{font-size:36px;color:#819c89;height:44px;font-weight:300}#project-description{font-size:14px;color:var(--muted);white-space:pre-wrap;max-height:100px;overflow:auto}#chat-main.empty{justify-content:center;padding-bottom:100px}#chat-main.empty #welcome{text-align:center}#chat-main:not(.empty) #welcome{display:none}#messages{width:min(790px,100%);margin:0 auto;padding:20px 24px 30px;flex:1}#chat-main.empty #messages{display:none}.message{margin:12px 0 32px}.message.user{display:flex;justify-content:flex-end}.user .bubble{background:#f1f1ef;border-radius:22px;padding:12px 20px;max-width:85%;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}.assistant .bubble{font-size:14px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere}.message.error .bubble{color:#975746}.message .answer-mark{font-size:24px;color:#809988;margin-bottom:8px}.message-actions{display:flex;gap:8px;align-items:center;margin-top:12px}.message-actions button{font-size:11px;color:#85898a;padding:3px 5px;border-radius:4px}.message-actions button:hover{background:var(--side)}.sources-toggle{display:inline-flex;align-items:center;gap:6px;font-size:11px;border:1px solid var(--line);padding:6px 10px;border-radius:16px;margin-top:14px}.sources-toggle:hover{background:var(--side)}.sources-list{display:grid;gap:8px;margin-top:10px}.source-row{border:1px solid var(--line);border-radius:10px;padding:12px 14px;display:flex;align-items:center;gap:12px}.source-row .source-info{flex:1;min-width:0;text-align:left;padding:0}.source-row strong{font-weight:500;font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-row small{font-size:10px;color:#858988}.source-row .icon{font-size:20px;color:#8d978e}.source-row:hover{background:#fafbf9}#composer-area{width:min(790px,100%);margin:0 auto;padding:0 24px 10px;position:sticky;bottom:0;background:linear-gradient(transparent,#fff 13px);z-index:2}#composer{border:1px solid #e3e3df;box-shadow:0 3px 13px #00000006;background:#fff;border-radius:24px;padding:15px 14px 10px}#question{display:block;width:100%;resize:none;border:0;outline:none;line-height:1.6;min-height:45px;max-height:180px;background:transparent;padding:1px 6px 9px;font-size:14px}#question::placeholder{color:#939591}.composer-bottom{display:flex;justify-content:space-between;align-items:center}.composer-bottom>div{display:flex;align-items:center;gap:6px}.composer-bottom .icon{color:#686e6b}.send-actions{display:flex;align-items:center;gap:6px}#send{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#222629;color:white}#send svg{stroke-width:2;width:19px;height:19px}#send:disabled{background:#c3c7c3;cursor:wait}#project-chip{font-size:10px;background:#eff3ee;color:#718276;border-radius:12px;padding:4px 9px;max-width:220px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#activity{font-size:11px;color:#80867f;text-align:center;margin:7px 0 0;min-height:0}#activity:empty{display:none}.composer-hint{text-align:center;font-size:10px;color:#999d98;margin:9px 0 0}#chat-main.empty .composer-hint{display:none}#suggestions{display:flex;justify-content:center;gap:9px;margin-top:22px}#suggestions button{border:1px solid var(--line);border-radius:20px;padding:7px 15px;font-size:11px;color:#7a8079}#suggestions button:hover{background:#f5f7f2}#chat-main:not(.empty) #suggestions{display:none}#microphone.recording{background:#fae7e5;color:#af4c42;animation:pulse 1s infinite}.secondary-view{padding:40px 32px 70px;margin:0 auto;width:min(980px,100%);overflow:auto}.secondary-view h1{font-size:29px;font-weight:500;letter-spacing:-.03em;margin:0 0 24px}.view-heading{display:flex;justify-content:space-between;align-items:baseline;gap:20px}.button{display:inline-flex;align-items:center;justify-content:center;padding:9px 15px;border:1px solid #dfe2db;border-radius:9px;background:white;cursor:pointer;font-size:12px}.button:hover{background:#f5f5f1}.button.dark{background:#282d2c;color:white;border-color:#282d2c}.button.dark:hover{background:#414942}button:disabled{opacity:.55;cursor:wait}input,select,dialog textarea{width:100%;padding:12px 13px;border:1px solid #e0e2dc;border-radius:9px;background:white;font-size:13px}.subtle{font-size:11px;color:#8b918b;line-height:1.65}.tabs{display:flex;gap:8px;margin-top:20px}.tabs button{padding:6px 12px;border-radius:20px;font-size:11px;color:#848984}.tabs .selected{background:#eaf0e7;color:#49634b}.doc-row{padding:16px 0;border-top:1px solid var(--line);display:flex;gap:16px;align-items:center}.doc-row>div{flex:1;min-width:0}.doc-row h3{font-size:12px;font-weight:500;margin:0 0 4px;overflow-wrap:anywhere}.doc-row p{font-size:10px;color:#899087;margin:0}.doc-row button{font-size:11px;white-space:nowrap}.doc-row .unreadable{color:#aa976c}.saved-empty{font-size:13px;color:#92968f}.mobile-only{display:none}dialog{border:1px solid #e0e2db;border-radius:17px;background:white;color:var(--ink);padding:26px;width:min(490px,94vw);max-height:88dvh;box-shadow:0 22px 90px #0002}dialog::backdrop{background:#222d2940;backdrop-filter:blur(3px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.dialog-heading h2{font-size:20px;line-height:1.3;font-weight:500;margin:0;letter-spacing:-.02em}.dialog-heading .icon{font-size:25px}.dialog-footer{display:flex;justify-content:flex-end;gap:9px;margin-top:22px}dialog label{display:block;font-size:12px;margin:15px 0 7px}.optional{font-size:10px;color:#999;margin-left:4px}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}#people-dialog{width:min(760px,95vw)}.people-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:18px}.people-grid button{padding:0;text-align:left;font-size:10px;border-radius:6px}.people-grid img{display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:7px;margin-bottom:5px}.people-grid .selected img{outline:3px solid #819986}.people-grid button:hover img{filter:brightness(.92)}.settings-row{display:flex;align-items:center;justify-content:space-between;padding:16px 0;border-top:1px solid var(--line);gap:15px}.settings-row strong{font-weight:500;font-size:13px}.settings-row p{margin:4px 0 0}#connection-form-wrap{padding-bottom:22px}#key-status{font-size:12px}details{font-size:11px;color:#7c837c;margin-top:20px}summary{cursor:pointer}details a{font-size:11px}#source-dialog{width:min(1150px,96vw);height:92dvh;display:flex;flex-direction:column;padding:20px}#source-dialog:not([open]){display:none}#source-dialog .dialog-heading{margin-bottom:10px;align-items:flex-start}#source-dialog h2{font-size:14px;overflow-wrap:anywhere}#source-dialog .subtle{margin:5px 0}#source-frame{flex:1;min-height:200px;width:100%;border:1px solid var(--line);border-radius:5px}#source-external{font-size:10px;margin-top:10px;align-self:flex-start}#chat-search-results{margin-top:15px;max-height:50vh;overflow:auto}#chat-search-results button{display:block;width:100%;text-align:left;padding:12px;border-radius:8px;font-size:13px}#chat-search-results button:hover{background:var(--side)}#project-chats{margin-bottom:20px;max-height:170px;overflow:auto;text-align:left;border:1px solid var(--line);border-radius:12px}#project-chats button{display:block;width:100%;text-align:left;padding:12px 16px;border-bottom:1px solid var(--line);font-size:12px}#project-chats button:last-child{border:0}#project-chats button:hover{background:var(--side)}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);z-index:30;color:white;background:#303b32;padding:12px 20px;border-radius:10px;max-width:90vw;font-size:12px;box-shadow:0 5px 25px #0002}@keyframes pulse{50%{opacity:.55}}@media(min-width:1550px){#chat-main.empty{padding-bottom:150px}#welcome h1{font-size:35px}}@media(max-width:950px){#sidebar{width:220px}.brand-row img{width:168px}.workspace{margin-left:220px}header{padding:0 20px}#welcome h1{font-size:29px}.people-grid{grid-template-columns:repeat(4,1fr)}}@media(max-width:700px){#sidebar{transform:translateX(-100%);width:260px;transition:transform .15s}body.menu-open #sidebar{transform:translateX(0)}#overlay:not([hidden]){position:fixed;inset:0;background:#0003;z-index:9}.mobile-only{display:inline-flex}.workspace{margin-left:0}header{height:60px;padding:0 12px}.header-title{gap:8px}#home{font-size:14px}#header-project{font-size:11px;max-width:150px}#header-project:not(:empty):before{margin-right:8px}#welcome h1{font-size:27px}#chat-main.empty{padding-bottom:70px}#composer-area{padding:0 13px 10px}#messages{padding:12px 18px 20px}.user .bubble{max-width:90%;font-size:13px}.assistant .bubble{font-size:13px}#question{font-size:14px}#composer{border-radius:22px}.secondary-view{padding:30px 20px 50px}.people-grid{grid-template-columns:repeat(3,1fr);gap:14px}dialog{padding:22px}.brand-row img{width:190px}#project-chip{max-width:160px}#source-dialog{padding:12px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.source-item{display:grid}
.source-item.open>.source-row{border-radius:10px 10px 0 0;background:#fafbf9}
.source-embed{border:1px solid var(--line);border-top:0;border-radius:0 0 10px 10px;padding:10px 12px 12px;display:grid;gap:8px;background:#fff}
.embed-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.embed-bar button,.embed-bar a{font-size:11px;color:#5f6b63;padding:3px 6px;border-radius:4px;text-decoration:none}
.embed-bar button:hover,.embed-bar a:hover{background:var(--side)}
.embed-label{font-size:11px;color:var(--muted);margin-right:auto}
.embed-frame{width:100%;height:min(560px,70dvh);border:1px solid var(--line);border-radius:6px;background:#dce0da}
.embed-text{position:relative;max-height:280px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;border:1px solid var(--line);border-radius:6px;padding:10px 12px;background:var(--side)}
.embed-text mark{background:#dfeacf;color:inherit;border-radius:3px;box-shadow:0 0 0 2px #dfeacf}
.embed-text.empty{color:var(--muted)}
@media(max-width:700px){.source-embed{padding:8px}.embed-frame{height:62dvh}}

/* Portal-Look: Nebel bleibt als Hintergrund, Startbild verdeckt die App, Kugel-Knopf rechts, KI-Gespräch */
html{background:#E9F0EB}
body{background:transparent}
body:has(.intro:not(.weg)) :is(#sidebar,.workspace,#overlay){visibility:hidden}
#sidebar{background:rgba(246,246,243,.84);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
#composer-area{background:linear-gradient(rgba(233,240,235,0),rgba(233,240,235,.9) 16px)}

/* Kugel als KI: Logo neben S.W.A.R.M., über der Begrüssung, als Denk-Anzeige und als Zeichen jeder Antwort */
#home{display:inline-flex;align-items:center;gap:9px}
.kugel-logo{position:relative;display:block;width:28px;height:28px;flex-shrink:0}
.orikugelbox canvas{display:block;width:100%;height:100%}
.welcome-mark{display:block;height:auto}
#chat-main.empty #composer-area{background:none}
#hello-kugel{position:relative;width:120px;height:120px;margin:0 0 -14px -18px}
#think-kugel{position:relative;width:46px;height:46px}
.message .answer-mark{display:flex;align-items:center;gap:8px;min-height:30px;margin:0 0 6px -8px;color:#809988;font-size:12px}
.kugel-mark{display:block;width:30px;height:30px;background:var(--kugel-bild,radial-gradient(circle,#2E8455 0 2px,transparent 3px)) center/contain no-repeat}
.message.pending .answer-mark{animation:denkt 1.6s ease-in-out infinite}
@keyframes denkt{0%,100%{opacity:.75}50%{opacity:1}}
@media(max-width:700px){#hello-kugel{width:120px;height:120px}}

/* Admin-Anmeldung in den Einstellungen */
.admin-form{display:grid;gap:8px;margin:4px 0 14px}
.admin-form input{width:100%;padding:11px 12px;border:1px solid #e0e2dc;border-radius:9px;font:inherit;background:white}
.admin-form .dialog-footer{margin-top:4px}
#admin-status,#pw-status{font-size:12px;color:#975746;margin:0;min-height:1em}
#admin-status.ok,#pw-status.ok{color:#2E8455}
#connection-toggle:disabled{opacity:.45;cursor:not-allowed}

/* ===== Konten, Einstellungen, Sprach-Chat (05.11.) ===== */
.settings-tabs{display:flex;gap:6px;margin:0 0 6px;border-bottom:1px solid var(--line)}
.settings-tabs button{padding:9px 14px;font-size:13px;color:#7c837c;border-bottom:2px solid transparent;margin-bottom:-1px}
.settings-tabs button.selected{color:var(--ink);border-bottom-color:#2E8455;font-weight:600}
.settings-tab h3{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#7c837c;margin:22px 0 6px;font-weight:600}
.row-buttons{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.row-buttons select{width:auto;min-width:190px;padding:9px 10px}
.check{display:flex!important;align-items:center;gap:9px;font-size:13px!important;margin:10px 0!important;cursor:pointer}
.check input{width:auto;margin:0}
.segmented{display:inline-flex;padding:3px;border:1px solid #dfe2db;border-radius:11px;gap:2px;background:rgba(255,255,255,.6)}
.segmented button{padding:8px 14px;border-radius:8px;font-size:13px;color:#5d655f}
.segmented button.selected{background:#282d2c;color:#fff}
.button.danger{color:#a3473c;border-color:#efd3cf}
.button.danger:hover{background:#fbefed}
.profile-info{display:flex;align-items:center;gap:12px;min-width:0}
.profile-info img{width:44px;height:44px;border-radius:50%;object-fit:cover}
.role-badge{display:inline-block;font-size:10px;padding:2px 8px;border-radius:20px;background:#e3efe6;color:#2E8455;margin-left:6px;vertical-align:middle}
.people-sub{margin:-6px 0 14px}
.people-grid button{position:relative}
.people-grid .lock{position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.92);display:grid;place-items:center;font-size:11px;box-shadow:0 1px 4px #0002}
.people-grid .guest-tile{display:grid;place-items:center;aspect-ratio:1/1.15;border:1px dashed #cfd5cd;border-radius:8px;font-size:12px;color:#5d655f;text-align:center;padding:10px}
.login-pane{display:grid;gap:12px}
.login-person{display:flex;align-items:center;gap:14px}
.login-person img{width:64px;height:64px;border-radius:50%;object-fit:cover}
.login-person strong{font-size:17px}
.login-choice{display:flex;gap:10px;flex-wrap:wrap}
#login-status{font-size:12px;color:#975746;margin:0;min-height:1em}
#login-status.ok{color:#2E8455}
.user-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line);flex-wrap:wrap}
.user-row .who{display:flex;align-items:center;gap:10px;min-width:0}
.user-row img{width:34px;height:34px;border-radius:50%;object-fit:cover}
.user-row small{display:block;color:#7c837c;font-size:11px}
.user-row select{width:auto;padding:7px 9px;font-size:12px}
.user-row .button{padding:7px 11px;font-size:12px}
/* Chat-Menü in der Seitenleiste */
.side-item{position:relative}
.side-item .item-menu{margin-left:auto;opacity:0;font-size:15px;line-height:1;padding:2px 6px;border-radius:6px;color:#6b726c}
.side-item:hover .item-menu,.side-item.current .item-menu,.side-item .item-menu:focus{opacity:1}
.side-item .item-menu:hover{background:rgba(0,0,0,.06)}
.side-item>span:first-of-type{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#float-menu{position:fixed;z-index:950;background:#fff;border:1px solid #e0e2db;border-radius:10px;box-shadow:0 12px 34px #0002;padding:5px;min-width:160px}
#float-menu button{display:block;width:100%;text-align:left;padding:9px 12px;border-radius:7px;font-size:13px}
#float-menu button:hover{background:#f2f4f1}
#float-menu button.danger{color:#a3473c}
/* Sprach-Chat */
#microphone.voice-wait{background:#e3efe6;color:#2E8455}
#microphone.speaking{background:#e3efe6;color:#2E8455;animation:pulse 1.6s infinite}
.voice-note{font-size:11px;color:#2E8455}

/* ===== Dunkelmodus ===== */
html[data-theme="dark"]{--ink:#E7EFE9;--muted:#93A79A;--line:rgba(231,239,233,.12);--side:#0E1D15;--hover:#16291F;background:#04120C;color-scheme:dark}
html[data-theme="dark"] #nebel,html[data-theme="dark"] .intro,html[data-theme="dark"] .orikugelbox{--bg:#04120C;--bg-2:#0A2417;--ink:#EAF4ED;--muted:#8AA595;--line:rgba(234,244,237,.12);--accent:#4FBE7E;--accent-2:#2E8455;--fg:#EAF4ED;--primary:#4FBE7E;--info:#38bdf8}
html[data-theme="dark"] body{color:var(--ink)}
html[data-theme="dark"] #sidebar{background:rgba(10,24,17,.86)}
html[data-theme="dark"] #home,html[data-theme="dark"] .nav-button,html[data-theme="dark"] .side-item,html[data-theme="dark"] .profile,html[data-theme="dark"] #welcome h1,html[data-theme="dark"] .assistant .bubble{color:var(--ink)}
html[data-theme="dark"] .side-item.current,html[data-theme="dark"] .side-item:hover,html[data-theme="dark"] .nav-button:hover,html[data-theme="dark"] .nav-button.current{background:rgba(255,255,255,.07)}
html[data-theme="dark"] .user .bubble{background:#17271E;color:var(--ink)}
html[data-theme="dark"] #composer{background:#0D1C14;border-color:#1F3328;box-shadow:none}
html[data-theme="dark"] #question{background:transparent;color:var(--ink)}
html[data-theme="dark"] #composer-area{background:linear-gradient(rgba(4,18,12,0),rgba(4,18,12,.9) 16px)}
html[data-theme="dark"] #chat-main.empty #composer-area{background:none}
html[data-theme="dark"] #send{background:#E7EFE9;color:#0B1A12}
html[data-theme="dark"] dialog,html[data-theme="dark"] #float-menu{background:#0D1C14;border-color:#1F3328;color:var(--ink)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] dialog textarea,html[data-theme="dark"] .admin-form input{background:#08150F;border-color:#24392D;color:var(--ink)}
html[data-theme="dark"] .button{background:#12231A;border-color:#24392D;color:var(--ink)}
html[data-theme="dark"] .button.dark,html[data-theme="dark"] .segmented button.selected{background:#E7EFE9;color:#0B1A12;border-color:#E7EFE9}
html[data-theme="dark"] .segmented{background:rgba(255,255,255,.04);border-color:#24392D}
html[data-theme="dark"] .segmented button,html[data-theme="dark"] .settings-tabs button{color:#a9b9ae}
html[data-theme="dark"] .settings-tabs button.selected{color:var(--ink)}
html[data-theme="dark"] .source-row:hover,html[data-theme="dark"] .source-item.open>.source-row{background:#0F2018}
html[data-theme="dark"] .source-embed{background:#0B1912}
html[data-theme="dark"] .embed-text{background:#08150F;color:var(--ink)}
html[data-theme="dark"] .embed-text mark{background:#24452f;box-shadow:0 0 0 2px #24452f}
html[data-theme="dark"] #float-menu button:hover{background:#16291F}
html[data-theme="dark"] .people-grid .guest-tile{border-color:#2a4034;color:#a9b9ae}
html[data-theme="dark"] #toast{background:#E7EFE9;color:#0B1A12}
html[data-theme="dark"] .role-badge{background:#17331f;color:#7fd3a1}
html[data-theme="dark"] .secondary-view,html[data-theme="dark"] .doc-row h3{color:var(--ink)}

/* Nachrichten */
.nav-button{position:relative}
.badge{margin-left:auto;min-width:19px;height:19px;padding:0 6px;border-radius:10px;background:#2E8455;color:#fff;font-size:11px;font-weight:600;display:inline-grid;place-items:center}
.compose{display:grid;gap:4px;margin:4px 0 18px;padding:16px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.55)}
.compose textarea{width:100%;padding:12px 13px;border:1px solid #e0e2dc;border-radius:9px;font:inherit;resize:vertical}
#compose-status{font-size:12px;margin:0;min-height:1em;color:#2E8455}
.inbox-h{font-size:14px;margin:8px 0 4px}
.msg-row{display:flex;gap:12px;padding:14px 0;border-top:1px solid var(--line);align-items:flex-start}
.msg-row img{width:38px;height:38px;border-radius:50%;object-fit:cover;flex-shrink:0}
.msg-row .msg-body{flex:1;min-width:0}
.msg-row .msg-head{display:flex;gap:8px;align-items:baseline;font-size:12px;color:#7c837c}
.msg-row .msg-head strong{color:var(--ink);font-size:13px}
.msg-row .msg-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:4px 0 6px;font-size:14px;line-height:1.55}
.msg-row.unread .msg-head strong:after{content:'neu';margin-left:6px;font-size:10px;padding:1px 6px;border-radius:9px;background:#2E8455;color:#fff;vertical-align:middle}
.msg-row .msg-actions{display:flex;gap:6px}
.msg-row .msg-actions button{font-size:11px;color:#6b726c;padding:3px 7px;border-radius:5px}
.msg-row .msg-actions button:hover{background:var(--side)}
html[data-theme="dark"] .compose{background:rgba(255,255,255,.03)}
html[data-theme="dark"] .compose textarea{background:#08150F;border-color:#24392D;color:var(--ink)}

/* Anhänge im Chat */
.attach-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.attach-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:5px 6px 5px 10px;border:1px solid var(--line);border-radius:16px;font-size:12px;background:rgba(255,255,255,.7)}
.attach-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.attach-chip img{width:22px;height:22px;border-radius:4px;object-fit:cover}
.attach-chip button{width:20px;height:20px;border-radius:50%;font-size:14px;line-height:1;color:#6b726c}
.attach-chip.loading{opacity:.6}
.message.user .user-attach{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end;margin-top:6px}
.message.user{flex-direction:column;align-items:flex-end}
.doc-row .doc-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
html[data-theme="dark"] .attach-chip{background:#0D1C14}
/* Smartphone */
@media(max-width:700px){
 header{padding:0 12px;height:56px}
 #welcome h1{font-size:24px;margin:10px 0 18px}
 #hello-kugel{width:96px;height:96px}
 #composer-area{padding:0 10px calc(8px + env(safe-area-inset-bottom))}
 #composer{padding:12px 12px 8px}
 #question{font-size:16px}
 dialog{padding:18px;width:96vw;max-height:92dvh}
 .people-grid{grid-template-columns:repeat(3,1fr)!important;gap:8px}
 .settings-row{flex-wrap:wrap}
 .row-buttons{justify-content:flex-start}
 .row-buttons select{min-width:0;width:100%}
 .secondary-view{padding:16px 14px!important}
 .doc-row{flex-wrap:wrap}
 .user-row .row-buttons{width:100%}
 .attach-chip span{max-width:150px}
 #toast{left:12px;right:12px;transform:none;text-align:center}
}
.doc-actions .danger-text{color:#a3473c}

.link-box{display:grid;gap:8px;margin:0 0 14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:rgba(46,132,85,.06)}
.link-box input{font-size:12px;font-family:ui-monospace,Consolas,monospace}
.login-note{font-size:13px;line-height:1.55;padding:10px 12px;border-radius:10px;background:rgba(46,132,85,.08);margin:0}
