
/* Grundregeln, Farben und Komponenten aus vorlage_swarm/chat.css. */
*{box-sizing:border-box}
:root{--ink:#252735;--muted:#85868b;--line:#e9e9e7;--side:#f6f6f3;--hover:#ecece8;--mint:#e7eee8}
html{background:#E9F0EB}
body{margin:0;background:transparent;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}
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary: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:rgba(246,246,243,.84);padding:26px 12px 12px;display:flex;flex-direction:column;z-index:10;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.brand-row{padding:0 12px;display:flex;align-items:center;justify-content:space-between;margin-bottom:31px}
.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)}
.side-heading{padding:0 12px;color:#797b7e;font-size:11px;font-weight:600;height:32px}
.side-scroll{overflow-y:auto;overflow-x:hidden;margin-top:26px;scrollbar-width:thin;flex:1}
.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{background:var(--hover)}
.sidebar-bottom{padding-top:15px}
.workspace{margin-left:250px;height:100dvh;display:flex;flex-direction:column;min-width:0}
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:15px;letter-spacing:.04em;font-weight:600;color:#4e5357}
.brand{font-size:16px;letter-spacing:.04em;font-weight:600}
#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;text-align:center}
#welcome h1{font-size:32px;font-weight:500;letter-spacing:-.035em;line-height:1.3;margin:18px 0 28px}
#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;flex-direction:column;align-items: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-actions{display:flex;gap:2px;align-items:center;flex-wrap:wrap;margin-top:10px}
.message-actions button{display:inline-flex;align-items:center;justify-content:center;height:30px;min-width:30px;padding:0 7px;border-radius:8px;color:#7a837d;font-size:12px}
.message-actions button:hover{background:#eef1ef;color:#2b3a33}
#composer-area{width:min(790px,100%);margin:0 auto;padding:0 24px 10px;position:sticky;bottom:0;z-index:2;background:linear-gradient(rgba(233,240,235,0),rgba(233,240,235,.9) 16px)}
#composer{box-shadow:0 3px 13px #00000006;border:1px solid #e3e3df;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{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#222629;color:white}
#send svg{stroke-width:2;width:19px;height:19px}
#send:disabled{background:#c3c7c3}
button:disabled{opacity:.55;cursor:default}
input,select,textarea{width:100%;padding:12px 13px;border:1px solid #e0e2dc;border-radius:9px;background:white;font-size:13px}
textarea{min-height:96px}
p{margin:0 0 12px}
h2,h3{font-weight:500}
h2{font-size:22px;line-height:1.25;letter-spacing:-.035em;margin:0}
h3{font-size:14px;margin:22px 0 8px;color:#60656a}
h3:first-child{margin-top:0}
.meta{font-size:12px;color:#60656a;margin:3px 0}
.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;text-align:left}
.source-row strong{font-weight:500;font-size:12px;display:block}
.source-row small{font-size:10px;color:#858988}
.source-row:hover{background:#fafbf9}
.folge{display:flex;flex-direction:column;margin-top:16px;border-top:1px solid var(--line);max-width:560px}
.folge button{display:flex;align-items:center;width:100%;text-align:left;padding:11px 4px;border-bottom:1px solid var(--line);color:#2b3a33;font-size:13px}
.folge button:hover{color:#2E6E4B}
#suggestions{display:flex;justify-content:center;flex-wrap:wrap;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}
body.menu-open #sidebar{transform:translateX(0)}
#overlay{position:fixed;inset:0;background:#0003;z-index:9}
.side-scroll input{margin:0 12px 12px;width:calc(100% - 24px)}
details{border-top:1px solid var(--line)}
summary{display:flex;align-items:center;cursor:pointer;min-height:62px;padding:16px 0;gap:10px;list-style:none;font-size:15px}
summary::-webkit-details-marker{display:none}
summary svg{margin-left:auto;width:16px;height:16px}
details[open]>summary .plus{display:none}
#side-list summary{min-height:42px;padding:0 8px 0 16px;font-size:14px}
.entry{display:block;width:100%;text-align:left;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}
.entry:hover{background:var(--side)}
.row{padding:12px 0;border-bottom:1px solid var(--line)}
.fact{display:flex;justify-content:space-between;gap:18px;padding:9px 0;border-bottom:1px solid var(--line)}
.fact span{color:#60656a}
.fact strong{font-weight:500;text-align:right}
.primary{background:#282d2c;color:white;border:1px solid #282d2c;border-radius:9px;padding:9px 15px;font-size:12px;width:100%;margin-top:12px}
.primary:hover{background:#414942}
.secondary{border:1px solid #dfe2db;border-radius:9px;padding:9px 15px;background:white;font-size:12px;width:100%;margin-top:8px}
.secondary:hover{background:#f5f5f1}
[aria-pressed=true]{background:var(--mint)}
.controls{display:flex;flex-wrap:wrap;gap:8px}
.controls button{width:auto;padding:6px 12px;border:0;border-radius:20px;font-size:11px;color:#848984}
.controls button[aria-pressed=true]{background:#eaf0e7;color:#49634b}
.field{display:block;margin:15px 0 7px;font-size:12px}
#attachments,#form-files{display:flex;flex-wrap:wrap;gap:6px}
#attachments:not(:empty),#form-files:not(:empty){margin:0 0 8px}
.attach-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 10px;border:1px solid var(--line);border-radius:16px;font-size:12px;background:rgba(255,255,255,.7);max-width:100%;overflow-wrap:anywhere}
.attach-chip button{flex-shrink:0;width:20px;height:20px;border-radius:50%;font-size:14px;line-height:1;color:#6b726c;padding:0}
.status{font-size:12px;margin-top:12px;color:#506c59}
.status:empty{display:none}

/* Kontext: Griff, Blatt, aufklappbare Abschnitte, Faktenzeilen und fixer Abschluss aus vorlage_kontext. */
#context{position:fixed;inset:auto 0 0;z-index:20;background:white;border:1px solid var(--line);border-radius:24px 24px 0 0;height:54dvh;display:flex;flex-direction:column;max-height:100dvh}
#context.full{height:94dvh}
#drag-handle{height:44px;min-height:44px;display:flex;justify-content:center;align-items:center;touch-action:none;width:100%}
#drag-handle span{width:36px;height:4px;border-radius:5px;background:var(--line)}
.sheet-heading{padding:0 22px;display:flex;align-items:center;gap:8px}
.sheet-heading>div{flex:1;min-width:0}
.sheet-heading h2{overflow-wrap:anywhere}
#context-body{padding:0 22px 20px;overflow:auto;overscroll-behavior:contain;flex:1;min-height:0}
.sheet-bottom{padding:10px 22px max(14px,env(safe-area-inset-bottom));background:white;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:8px}
.sheet-bottom button{padding:10px 14px;min-height:44px;border-radius:9px;width:100%;background:var(--side)}
.drawing{border:1px solid var(--line);border-radius:14px;display:block;width:100%;height:auto;min-height:180px;max-height:420px;margin:14px 0;background:var(--side);stroke:var(--ink);stroke-width:2}
.drawing text{fill:var(--ink);stroke:none;font:12px -apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif}
.drawing .fill{fill:var(--mint)}
.drawing .wall{stroke-width:5}
.bar{height:8px;border-radius:5px;background:#e9ebe7;margin:8px 0}
#sidebar nav{flex-shrink:0}
#context-back{font-size:12px}


.nav-button{line-height:18px}
.side-item{line-height:15px;position:relative}

#home{padding:0;display:inline-flex;align-items:center;gap:12px}

#composer{position:relative}
#composer .icon{width:40px;height:40px;padding:0}


#chat-main.empty{justify-content:center;padding-bottom:100px}

#chat-main.empty #composer-area{background:none}

#open-sidebar,#close-sidebar{display:none}
.header-actions{display:flex;align-items:center;gap:6px}
.header-actions button{position:relative;display:inline-flex;align-items:center;justify-content:center;height:30px;padding:0 11px;border:1px solid var(--line);border-radius:15px;font-size:13px;line-height:18px;color:var(--ink);opacity:.82}
.header-actions button:hover{opacity:1;background:var(--hover)}
#welcome h1 button{font:inherit;letter-spacing:inherit}

@media(min-width:1550px){#chat-main.empty{padding-bottom:150px}
#welcome h1{font-size:35px}
}

@media(min-width:701px){#overlay{display:none!important}
#sidebar{padding-bottom:4px}
}

@media(min-width:951px){header{padding-right:22px}
}

@media(min-width:701px) and (max-width:950px){#sidebar{width:220px}
.workspace{margin-left:220px}
header{padding:0 20px}
#welcome h1{font-size:29px}
}

@media(max-width:700px){
#sidebar{transform:translateX(-100%);width:260px;transition:transform .15s}
.workspace{margin-left:0}

#open-sidebar,#close-sidebar{display:inline-flex}
#open-sidebar{width:44px;height:44px;padding:0;border-radius:10px}

header{height:56px;padding:0 6px}
.header-title{gap:4px}
#home{gap:8px;font-size:14px}

#welcome h1{font-size:24px;margin:10px 0 18px}
#chat-main.empty{padding-bottom:70px}

#composer-area{padding:0 13px calc(8px + env(safe-area-inset-bottom))}
#composer{border-radius:22px;padding:12px 12px 8px}
#question{font-size:16px}

#composer .icon,#send{width:48px;height:48px}

#messages{padding:10px 18px 20px}
.message{margin:0 0 22px}

.user .bubble{font-size:16px;line-height:1.65;padding:11px 18px;max-width:78%}
.assistant .bubble{font-size:16px;line-height:1.65}

}

@media(min-width:900px){
body:has(#context:not([hidden])) .workspace{margin-right:340px}

#context,#context.full{inset:0 0 0 auto;width:340px;height:100dvh;max-height:none;border-radius:0;border-width:0 0 0 1px;z-index:1}

#drag-handle{display:none}
.sheet-heading{min-height:68px}

}

@media(min-width:1200px){body:has(#context:not([hidden])) .workspace{margin-right:400px}
#context,#context.full{width:400px}
}

html,body{overscroll-behavior:none}
button,input,select,textarea,summary{touch-action:manipulation}

@media (pointer:coarse),(max-width:700px){
.nav-button,.side-item,.entry,.primary,.secondary,.folge button,input,select{min-height:44px}
.message-actions button{min-width:44px;height:44px}
.message-actions{margin-top:3px;margin-bottom:-7px;margin-left:-6px}
.icon,.controls button,#home,.header-actions button,.attach-chip button{position:relative}
.icon::after,.controls button::after,#home::after,.header-actions button::after,.attach-chip button::after{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}
}

#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}
#welcome .welcome-mark.mit-wolke{display:flex;align-items:flex-end;justify-content:flex-start}
.welcome-mark.mit-wolke #hello-kugel{flex-shrink:0}
.wolke-weg{display:flex;align-items:flex-end;position:relative;min-width:0}
.wolke-weg .puff{position:absolute;border-radius:50%;background:radial-gradient(circle at 40% 35%,#fff 0,rgba(255,255,255,.92) 45%,rgba(240,246,242,.75) 100%);box-shadow:0 2px 10px rgba(80,120,95,.10);opacity:0;animation:puffAuf .5s ease-out forwards,schweb 5s ease-in-out infinite}
.wolke-weg .p1{width:9px;height:9px;left:-2px;bottom:24px;animation-delay:.05s,0s}
.wolke-weg .p2{width:15px;height:15px;left:8px;bottom:38px;animation-delay:.2s,.4s}
.wolke{position:relative;isolation:isolate;margin:34px 0 46px 26px;max-width:430px;min-width:170px;text-align:left;padding:20px 28px 22px;color:#2b3a33;font-size:15px;line-height:1.55;overflow-wrap:anywhere;animation:wolkeAuf .9s cubic-bezier(.2,.8,.2,1) both,schweb 6s ease-in-out .9s infinite}
.wolke .form{position:absolute;inset:0;z-index:-1;filter:drop-shadow(0 10px 22px rgba(70,110,85,.16)) drop-shadow(0 1px 1px rgba(70,110,85,.06))}
.wolke .form b{position:absolute;background:linear-gradient(180deg,#fff 0,#f8fbf9 100%);border-radius:50%}
.wolke .form .k{inset:0;border-radius:42px}
.wolke .form .b1{width:118px;height:84px;top:-30px;left:14%}
.wolke .form .b2{width:92px;height:70px;top:-20px;left:calc(14% + 88px)}
.wolke .form .b3{width:64px;height:50px;bottom:-14px;right:18%}
.wolke .dunst{position:absolute;inset:-26px;border-radius:70px;background:radial-gradient(closest-side,rgba(255,255,255,.7),transparent);filter:blur(16px);z-index:-2;animation:atmen 4s ease-in-out infinite}
.wolke small{display:block;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:#7c9a87;margin-bottom:4px;font-weight:500}
.wolke .wort{display:inline-block;opacity:0;filter:blur(6px);transform:translateY(4px);animation:wortEin .7s ease-out forwards}
.wolke .punkte{display:inline-flex;gap:8px;padding:8px 2px 2px}
.wolke .punkte i{width:9px;height:9px;border-radius:50%;background:radial-gradient(circle,#8fb39b 0,rgba(143,179,155,.25) 70%,transparent 72%);animation:hauch 1.8s ease-in-out infinite}
.wolke .punkte i:nth-child(2){animation-delay:.3s}.wolke .punkte i:nth-child(3){animation-delay:.6s}
.wolke-weg.weg .wolke{animation:wolkeWeg .9s ease-in forwards}.wolke-weg.weg .puff{transition:opacity .4s;opacity:0!important}
#welcome h1{transition:opacity .6s,max-height .6s,margin .6s}
@keyframes wolkeAuf{0%{opacity:0;transform:translate(-30px,18px) scale(.55);filter:blur(12px)}60%{opacity:1;filter:blur(1px)}100%{opacity:1;transform:none;filter:none}}
@keyframes wolkeWeg{to{opacity:0;transform:translate(10px,-40px) scale(1.08);filter:blur(14px)}}
@keyframes schweb{0%,100%{translate:0 0}50%{translate:0 -6px}}
@keyframes puffAuf{from{opacity:0;transform:scale(.3)}to{opacity:1;transform:none}}
@keyframes atmen{0%,100%{opacity:.6;transform:scale(1)}50%{opacity:1;transform:scale(1.04)}}
@keyframes hauch{0%,100%{opacity:.35;transform:scale(.8)}50%{opacity:1;transform:scale(1.15)}}
@keyframes wortEin{to{opacity:1;filter:none;transform:none}}
@media(max-width:700px){.welcome-mark.mit-wolke #hello-kugel{width:80px;height:80px}.wolke{font-size:14px;margin:30px 0 34px 18px;padding:16px 22px 18px;min-width:0}.wolke .form .b1{width:96px;height:70px;top:-24px}.wolke .form .b2{width:74px;height:56px;top:-15px;left:calc(14% + 70px)}}
.ablage-link{display:inline-flex;align-items:center;gap:8px;margin:0 auto 18px;padding:7px 14px;border:1px solid var(--line);border-radius:20px;font-size:12px;color:#5f6b63;background:rgba(255,255,255,.7)}
.ablage-link svg{width:16px;height:16px}
.ablage-link:hover{background:var(--hover)}#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)}
/* Room entry, retaining the source cloud and chat components. */
#header-project{color:var(--muted);font-size:13px;line-height:18px;min-width:0}
#header-project:before{content:'/';margin-right:8px}
#project-options{border:0;padding:0;width:40px;flex-shrink:0}
#chat-main.empty{justify-content:flex-start;padding-bottom:0}
#welcome{padding-top:24px;max-width:660px;flex:1;min-height:0;display:flex;flex-direction:column}
#welcome .welcome-mark{flex-shrink:0}
#welcome h1{font-weight:600;flex-shrink:0;margin:14px 0 18px}
#project-chats{width:100%;max-height:none;overflow:auto;min-height:56px;flex:1;margin-bottom:22px;flex-shrink:1}
#project-chats button{min-height:56px;font-size:14px}
#composer-area{flex-shrink:0}
#hello-kugel .kugel-mark{width:100%;height:100%}
#home .kugel-mark{width:28px;height:28px}
#photo{display:none!important}
#network-status:empty{display:none}
#network-status{font-size:11px;color:var(--muted);text-align:center}
.sheet-heading{flex-wrap:wrap;padding-top:10px;padding-bottom:10px}
.sheet-heading .meta{margin:5px 0 0}
#context-back{width:auto;font-size:12px}
#context-body input{min-height:56px}
#context-body .entry,#context-body .primary,#context-body .secondary,.side-item,.nav-button,summary{min-height:56px}
#context-body .controls button,.message-actions button,.sheet-bottom button{min-height:56px}
#side-list summary{min-height:56px}
#tabs{display:grid;grid-template-columns:1fr 1fr}
.sidebar-bottom .nav-button{min-height:44px}
#context-search-results .entry{min-height:56px}
#send{background:#222629}#send:disabled{background:#222629;opacity:.5}
#microphone[aria-pressed=true]{background:var(--mint)}
@media(min-width:701px){#welcome{max-height:760px;margin:auto}#composer-area{margin-bottom:24px}#chat-main.empty{padding-top:20px;padding-bottom:20px}}
@media(max-width:700px){
 header{height:64px;padding:0 6px}.header-title{gap:3px;flex:1}#home{font-size:13px;gap:5px}#home .kugel-logo{width:26px;height:26px}
 #header-project{font-size:12px;padding-left:4px}#header-project:before{margin-right:5px}
 .header-actions{gap:0}.header-actions button{padding:0 9px}#project-options{width:30px;padding:0}
 #welcome{padding:24px 18px 0}#welcome h1{font-size:24px;margin:10px 0 18px}
 #welcome .welcome-mark.mit-wolke{margin-bottom:8px}
 #composer-area{padding-bottom:max(12px,env(safe-area-inset-bottom))}
 #project-chats{margin-bottom:18px;max-height:336px}
 #context{height:66dvh}#context.full{height:94dvh}
 .wolke{font-weight:300}
 #tabs .nav-button{font-size:13px}
}
@media(prefers-reduced-motion:reduce){.wolke,.wolke *,.puff{animation:none!important}.puff{opacity:1!important}}


.message .answer-mark{display:flex;align-items:center;gap:8px;min-height:30px;margin:0 0 6px -8px;color:#809988;font-size:12px}
@media(max-width:700px){#composer .icon{width:56px;height:56px}#send{width:56px;height:56px}#question{min-height:56px}.attach-chip button{width:56px;height:56px}#context-close,#context-back{min-width:56px;min-height:56px}}

/* Grosse, voneinander getrennte Tippflächen. */
button, .icon, #composer .icon, #send, .header-actions button, #open-sidebar, #close-sidebar,
.attach-chip button, .sidebar-bottom .nav-button {min-width:56px;min-height:56px;height:auto}
.icon::after,.controls button::after,#home::after,.header-actions button::after,.attach-chip button::after{display:none}
#project-chats{flex:none;overflow:visible;max-height:none;margin:0 0 8px;border-radius:12px}
#project-chats button{display:flex;gap:14px;align-items:center;font-size:18px;line-height:1.2;padding:6px 12px;height:56px}
#project-chats svg{width:24px;height:24px}#project-chats button span{min-width:0;overflow-wrap:anywhere}
#context, #context button,#context input,#context select,#context textarea,#context .meta,#context h3,#context .field {font-size:18px}
#context .sheet-heading{gap:8px;display:grid;grid-template-columns:1fr 1fr}
#context-back,#context-close{font-size:20px;font-weight:600;border:1px solid var(--line);border-radius:9px;width:100%;padding:8px}
#context-back{grid-column:1;grid-row:1}#context-close{grid-column:2;grid-row:1}
.sheet-heading>div{grid-column:1 / -1;grid-row:2}
#context-body .controls button{font-size:18px}
#context-body .fact{flex-wrap:wrap}
#visible-language{font-size:18px;border:1px solid #cbd6ce;border-radius:12px;padding:8px 14px;float:right;margin:0 0 4px 8px}
#question{font-size:18px;min-height:56px;clear:both}
.read-button{display:inline-flex;align-items:center;gap:8px;font-size:18px;padding:0 8px;color:#384f40}
.read-button svg{width:22px;height:22px}
.wolke{animation:none;font-size:18px;padding:12px 20px;margin:16px 0 12px 16px}
.wolke small{display:none}.wolke .read-button{display:flex}
#welcome{padding-top:8px;flex:none}#welcome h1{margin:4px 0;font-size:24px}
.ablage-link{font-size:18px;margin:0 auto 4px;padding:4px 14px}
#chat-main.empty{padding:0;justify-content:space-between}#composer-area{margin-bottom:0;padding-bottom:8px}
#hello-kugel{height:90px;width:90px;margin:0} .kugel-mark{background:var(--kugel-bild) center/contain no-repeat}
#language-dialog{position:fixed;inset:0;border:0;margin:0;max-width:none;max-height:none;width:100%;height:100dvh;background:#f3f7f3;color:var(--ink);padding:20px;z-index:100;overflow:auto}
#language-dialog::backdrop{background:#f3f7f3}
.language-wrap{max-width:640px;margin:auto}#language-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#language-list button{font-size:20px;text-align:left;border:1px solid #cbd6ce;background:white;border-radius:10px;padding:12px;min-height:64px}
#language-list button[aria-pressed=true]{background:var(--mint);border-color:#64876b}
#language-dismiss{font-size:20px;border:1px solid #cbd6ce;border-radius:10px;margin-bottom:16px;padding:8px 16px}
#language-dialog h2{font-size:24px;margin-bottom:18px}
@media(max-width:700px){
#header-project{display:none}header{height:56px}#home{font-size:14px}#project-options{width:56px}
#welcome{padding:0 12px}#welcome .welcome-mark.mit-wolke{margin:0;height:116px;align-items:center}
.welcome-mark.mit-wolke #hello-kugel{width:56px;height:56px}
.wolke{font-size:16px;line-height:1.25;margin:4px 0 4px 10px;padding:4px 12px}.wolke .form .b1,.wolke .form .b2{height:30px;top:-8px}.wolke .form .b3{height:25px;bottom:-4px}
.wolke .read-button{font-size:16px}.wolke .dunst{display:none}
#welcome h1{font-size:20px;margin:0;line-height:1}#welcome h1 button{min-height:56px}
#composer-area{padding:0 12px 4px}#composer{padding:4px 8px;border-radius:16px;display:grid;grid-template-columns:1fr 1fr}
#visible-language{float:none;margin:0;grid-column:1;grid-row:2;font-size:16px;padding:4px}
#question{grid-column:1 / -1;grid-row:1;padding:10px 6px;min-height:56px;height:56px}
.composer-bottom{grid-column:2;grid-row:2;justify-content:flex-end;gap:0}.composer-bottom>div{gap:0}
#composer .icon,#send{width:56px}.composer-bottom #attach{min-width:56px}
#attachments{grid-column:1 / -1}#attachments:empty{display:none}
#context{height:88dvh}#language-dialog{padding:12px}#language-list{gap:6px}#language-list button{font-size:18px;padding:10px}
}
@media(max-width:700px) and (max-height:800px){#welcome .welcome-mark.mit-wolke{height:76px}.wolke{font-size:14px;line-height:1.15}.wolke .read-button{font-size:16px}#welcome h1{display:none}}
@media(max-width:370px){#composer{grid-template-columns:1fr}#visible-language{font-size:14px;padding:2px}#composer .icon,#send{width:56px}#language-list{grid-template-columns:1fr}}
/* Prototyp 4: identische Typografie auf Handy und PC. */
body{font-size:16px;line-height:24px}
button{min-width:48px;min-height:48px}
header{height:auto;min-height:72px;gap:8px;padding:8px}
.header-title{gap:8px;flex:1;flex-wrap:wrap}
#open-sidebar{display:inline-flex;width:48px;height:48px}
#home,#header-project{font-size:16px;line-height:22px;font-weight:600;letter-spacing:0}
#header-project{display:block;flex-basis:100%;padding-left:56px;color:#59655d;margin-top:-8px}
.header-actions{gap:8px;align-self:flex-start}
.header-actions button,#visible-language{float:none;margin:0;gap:6px;height:48px;padding:0 8px;font-size:16px;line-height:22px;border-radius:10px;opacity:1}
.flag{width:24px;height:16px;flex:none;outline:1px solid #77807866;outline-offset:0}
#welcome{padding:24px 16px 0;max-height:none}
#welcome .welcome-mark.mit-wolke{height:auto;min-height:164px;align-items:center;margin:0}
.welcome-mark.mit-wolke #hello-kugel{width:64px;height:64px;margin:0;--fg:#355b42;--primary:#2e8455}
.wolke{font-size:16px;line-height:23px;padding:18px;margin:24px 0 24px 10px;min-width:0}
.wolke .form .b1{height:70px;width:96px;top:-24px}.wolke .form .b2{height:56px;width:74px;top:-15px;left:calc(14% + 70px)}.wolke .form .b3{height:50px;bottom:-14px}
.wolke .read-button{font-size:16px;line-height:23px;margin-top:8px}
#welcome h1{display:block;font-size:20px;line-height:26px;font-weight:600;margin:0 0 8px}
#welcome h1 button{min-height:52px}
#project-chats{display:grid;gap:8px;border:0;overflow:visible;margin:0 0 16px;flex:none}
#project-chats button{font-size:16px;line-height:22px;min-height:52px;height:auto;border:1px solid #dce4dc;border-radius:10px;padding:12px;background:#ffffff70}
#composer{display:block;padding:12px 14px 10px;border-radius:24px}
#question{font-size:16px;line-height:24px;min-height:56px;padding:8px 6px}
.composer-bottom{display:flex;justify-content:space-between;gap:8px}.composer-bottom>div{gap:8px}
#composer .icon,#composer #attach,#send{width:48px;min-width:48px;height:48px}
#composer-area{padding:0 12px 12px}
#context,#context button,#context input,#context select,#context textarea,#context h3,#context .field{font-size:16px;line-height:24px}
#context h2{font-size:18px;line-height:24px;font-weight:600}
#context .meta,#context small{font-size:14px;line-height:20px}
#context-back,#context-close{height:48px;min-height:48px;min-width:48px}
#context-body .entry,.side-item,.nav-button,summary{min-height:52px}
#context-body .entry{margin-bottom:8px}
#sidebar button,#sidebar summary,#sidebar #network{font-size:15px;line-height:20px}
#sidebar nav,.sidebar-bottom{display:grid;gap:8px}
#language-list{grid-template-columns:1fr 1fr;gap:8px}
#language-list button{display:flex;align-items:center;gap:8px;height:56px;min-height:56px;padding:8px;font-size:16px;line-height:22px}
#language-dismiss{font-size:16px;line-height:24px}
.scan-frame{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;padding:16px;border:1px solid var(--line);border-radius:16px;background:#f3f7f3}
.scan-frame svg{width:100%;height:180px;stroke-width:2}
input,textarea,select{font-size:16px;line-height:24px}
#nebel{display:none}
@media(min-width:701px){#sidebar{transform:translateX(-100%)}.workspace{margin-left:0}#close-sidebar{display:flex}#overlay{display:block!important}#overlay[hidden]{display:none!important}#welcome{width:min(660px,100%)}#header-project{flex-basis:auto;margin:0;padding:0}}
@media(max-width:700px){#context{height:92dvh}#chat-main.empty{justify-content:flex-start}#welcome{flex:1}#composer-area{position:static}#language-dialog{padding:12px}}


.header-actions button,#open-sidebar,#close-sidebar,#composer .icon,#send{min-height:48px;min-width:48px}
#tabs .nav-button{font-size:15px;line-height:20px}

#welcome{flex:none}.user .bubble,.assistant .bubble{font-size:16px;line-height:24px}
.source-row strong{font-size:16px;line-height:24px}.source-row small{font-size:14px;line-height:20px}

.wolke{font-weight:400}.header-actions button{font-weight:600}
/* Nachprüfung P4: einheitliche Masse und flexible Inhalte. */
#context-body .controls button {font-size:16px;line-height:24px}
.status, .drawing text {font-size:14px;line-height:20px}
.side-heading {font-size:15px;line-height:20px;height:auto;min-height:52px}
#side-list, .folge {display:flex;flex-direction:column;gap:8px}
#plan-folders .side-item + .side-item {margin-top:8px}
.message-actions {gap:8px}
#logo-kugel {--fg:#355b42;--primary:#2e8455}
#question {height:auto;min-height:56px;overflow-y:auto}
#language-list button {height:auto;min-height:56px}
@media(max-width:700px){#header-project:before {content:none}}

/* Raumname nur einmal: im Kopf erst, wenn das Gespräch läuft und der grosse Titel weg ist */body:has(#chat-main.empty) #header-project{display:none}.plan-folder{margin:8px 0}.plan-folder>summary{cursor:pointer;padding:12px;border:1px solid var(--line);border-radius:10px;font-size:16px;line-height:24px}.plan-folder>.plan-folder,.plan-folder>.entry{margin-left:12px;width:calc(100% - 12px)}.plan-entry{display:flex;flex-direction:column;align-items:flex-start;text-align:left;min-height:52px;width:100%;font-size:16px;line-height:24px;padding:12px}.plan-entry small,.plan-change small{font-size:14px;line-height:20px}.plan-new{color:#24623a;font-weight:600}.plan-search{width:100%;min-height:48px}.plan-change{padding:8px}#sidebar .plan-folder summary{font-size:16px;line-height:24px}

/* Explizite Auftragsmasse: zwölf Sprachzeilen und Tippflächen ab 52 px. */
#language-list{grid-template-columns:1fr;gap:8px}
#language-list button{min-height:56px;padding:8px 12px}
#language-dialog[data-first=true] .language-wrap{max-width:640px}
button,.icon,#composer .icon,#composer #attach,#send,.header-actions button,#open-sidebar,#close-sidebar,#context-back,#context-close{min-width:52px;min-height:52px}
#home{min-width:0}#home .kugel-logo{width:28px;height:28px}
#project-chats button:last-child{border-color:transparent}
#context-body{padding-top:16px}#context-body .entry{display:flex;align-items:center;gap:12px;width:100%;text-align:left}
#context-ask{min-height:52px}.sheet-heading{padding:8px 16px}.sheet-heading>div{padding:8px 0}
.b-record{overflow-wrap:anywhere}#b-form input[type=checkbox]{width:24px;min-height:24px;height:24px}
#c-video{height:180px;object-fit:cover;border-radius:14px;background:#f3f7f3}
.scan-frame{position:relative;margin-bottom:16px}.scan-frame>svg{position:absolute;inset:16px;width:calc(100% - 32px);height:180px;pointer-events:none}
#context-body a{color:inherit}.kugel-zeichnung{width:100%;height:100%;stroke-width:.65}
@media(min-width:900px){#context,#context.full{height:100dvh}#context .sheet-heading{min-height:136px}}

#b-form .controls .primary{color:white;border-radius:9px}#context-body h3{font-size:14px;line-height:20px;color:#60656a;margin:24px 0 8px}.scan-frame>svg{position:static;width:100%;height:180px}.scan-frame #c-video{display:none}.scan-frame.live #c-video{display:block}.scan-frame.live>svg{display:none}
#context-body .plan-entry{align-items:flex-start}#context-body a.entry{text-decoration:none;font:inherit}

/* UI2: kompakte Oberfläche; Navigation bleibt ausserhalb aller Scrollflächen. */
:root{--ui-height:100dvh;--ui-top:0px;--head-height:calc(52px + env(safe-area-inset-top));--nav-height:44px;--chrome-height:calc(var(--head-height) + var(--nav-height));--composer-height:126px}
html,body{height:100%;overflow:hidden}
.workspace{position:fixed;top:var(--ui-top);left:0;right:0;height:var(--ui-height);margin:0!important;padding-top:var(--chrome-height)}
.workspace>header{position:fixed;top:var(--ui-top);left:0;right:0;height:var(--head-height);min-height:0;padding:env(safe-area-inset-top) max(6px,env(safe-area-inset-right)) 0 max(6px,env(safe-area-inset-left));z-index:50;background:#e9f0eb;gap:4px}
.header-title{flex-wrap:nowrap;gap:4px;overflow:hidden}
#home{font-size:15px;white-space:nowrap;overflow:hidden;flex-shrink:1;gap:5px}
#header-project{flex:1;flex-basis:auto;margin:0;padding:0;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#header-project:before{content:none}
.header-actions{align-self:center;gap:2px;flex:none}
button,.icon,#composer .icon,#composer #attach,#send,.header-actions button,#open-sidebar,#close-sidebar,#context-back,#context-close{min-width:44px;min-height:44px}
#open-sidebar,.header-actions button,#visible-language{height:44px;font-size:15px;padding:0 6px}
#home .kugel-logo{width:22px;height:22px}
#quick-actions{position:fixed;top:calc(var(--ui-top) + var(--head-height));left:0;right:0;z-index:50;display:flex;align-items:center;gap:0;height:44px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;background:#f6f8f5;border:0;box-shadow:inset 0 -1px #dce4dc;padding:0 max(4px,env(safe-area-inset-left));scrollbar-width:none}
#quick-actions button{display:flex;align-items:center;justify-content:center;gap:3px;flex:1 0 auto;height:44px;padding:0 4px;font-size:15px;line-height:20px}
#quick-actions svg{width:18px;height:18px}
#chat-main{overflow:hidden;padding:0!important}
#welcome{flex:1;min-height:0;overflow:auto;padding:8px 12px 0;margin:0 auto}
#welcome .welcome-mark.mit-wolke{height:132px;min-height:0;max-height:20dvh;margin:0;align-items:center;overflow:hidden}
.welcome-mark.mit-wolke #hello-kugel{width:44px;height:44px;margin:0}
.wolke-weg{max-height:100%;overflow:auto;scrollbar-width:thin}
.wolke{font-size:15px;line-height:20px;padding:8px 12px;margin:12px 0 12px 8px}
.wolke .form .b1,.wolke .form .b2{height:32px;top:-10px}.wolke .form .b3{height:24px;bottom:-6px}
.wolke .read-button{font-size:15px;line-height:20px;margin:0;padding:0;display:flex;align-items:center;gap:6px}
#welcome h1{font-size:20px;line-height:24px;margin:0 0 4px}#welcome h1 button{min-height:44px;max-width:100%;overflow-wrap:anywhere}
#project-chats{display:grid;gap:3px;margin:0 0 8px;min-height:0}
#project-chats button{display:flex;align-items:center;gap:10px;font-size:15px;line-height:20px;min-height:44px;height:46px;padding:0 10px;margin:0;overflow:hidden}
#project-chats button span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
#messages{overflow:auto;overscroll-behavior:contain;padding:10px 14px;min-height:0}
.message{margin:0 0 16px}.user .bubble,.assistant .bubble{font-size:16px;line-height:24px}.user .bubble{padding:8px 12px}
#composer-area{position:relative;bottom:auto;padding:4px 10px max(6px,env(safe-area-inset-bottom));margin:0 auto;background:#e9f0eb}
#attachments{max-height:72px;overflow:auto}
#composer{padding:4px 8px;border-radius:16px}#question{min-height:44px;max-height:96px;padding:8px 4px;line-height:24px;font-size:16px}
#composer .icon,#composer #attach,#send{width:44px;height:44px}.composer-bottom,.composer-bottom>div{gap:4px}
#sidebar{top:calc(var(--ui-top) + var(--chrome-height));bottom:auto;height:calc(var(--ui-height) - var(--chrome-height));z-index:40;padding-top:12px}
#overlay{top:calc(var(--ui-top) + var(--chrome-height));z-index:35}
#context,#context.full{inset:auto 0 auto;top:auto;bottom:calc(100% - var(--ui-top) - var(--ui-height) + var(--composer-height));width:auto;z-index:30;height:min(54dvh,calc(var(--ui-height) - var(--chrome-height) - var(--composer-height)));max-height:calc(var(--ui-height) - var(--chrome-height) - var(--composer-height));border-radius:14px 14px 0 0}
#context.full{height:calc(var(--ui-height) - var(--chrome-height) - var(--composer-height))}
#drag-handle{display:flex;position:absolute;top:0;left:calc(50% - 22px);width:44px;height:44px;min-height:44px;z-index:1;opacity:.5}
#drag-handle span{width:20px;height:3px;align-self:flex-start;margin-top:3px}
#context .sheet-heading{display:flex;flex-wrap:nowrap;height:44px;min-height:44px;padding:0 6px;gap:4px;border:0;box-shadow:inset 0 -1px var(--line)}
.sheet-heading>div{padding:0;pointer-events:none}.sheet-heading .meta{display:none}
#context h2{font-size:18px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#context-back,#context-close{width:auto;border:0;border-radius:6px;font-weight:400;height:44px;min-height:44px;padding:0 6px;font-size:15px;flex:none;z-index:2}
#context-body{padding:6px 12px 12px}#context,#context button,#context input,#context select,#context textarea,#context .field{font-size:15px;line-height:21px}
#context-body .entry,#context-body .primary,#context-body .secondary,#context-body input,#context-body .controls button,.side-item,.nav-button,summary,#side-list summary,#context-search-results .entry{min-height:44px}
#context-body .entry{padding:6px 8px;margin-bottom:0;gap:6px}.plan-folder{margin:4px 0}.plan-folder>summary{padding:8px;font-size:15px;line-height:21px;min-height:44px}
#context-body .plan-entry{gap:0}.plan-entry small,.plan-change small{font-size:13px;line-height:18px}.fact,.row{padding:6px 0;overflow-wrap:anywhere}.fact>*{min-width:0}
.sheet-bottom{padding:4px 12px}.sheet-bottom button,#context-ask{min-height:44px;padding:6px}
#side-list,.folge{gap:2px}#language-list{gap:3px}#language-list button{min-height:44px;padding:6px 10px;font-size:16px}#language-dialog{max-height:calc(var(--ui-height) - 16px);overflow:auto}
@media(max-width:700px){body{font-size:16px;line-height:24px}#home{max-width:140px}#header-project{display:none}#welcome .welcome-mark.mit-wolke{height:132px}}
/* Langer Bereichstext: Wolke wächst höchstens auf drei Zeilen, der Text läuft innen; nichts ragt unter die Leiste. */
.wolke-weg{align-items:center}.wolke .satz{display:block;max-height:60px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:2px}
@media(min-width:900px){#context,#context.full{left:auto;width:360px;top:calc(var(--ui-top) + var(--chrome-height));bottom:auto;height:calc(var(--ui-height) - var(--chrome-height));max-height:none;border-radius:0}body:has(#context:not([hidden])) .workspace{right:360px}.workspace>header,#quick-actions{right:0}}


.ansicht-canvas{display:block;width:100%;height:clamp(220px,36dvh,480px);touch-action:none;background:#e9ecef;border-radius:8px}
.ansicht-tools{display:flex;flex-wrap:wrap;gap:4px}.ansicht-tools button{border:1px solid var(--line);border-radius:6px;padding:4px 10px}
.ansicht-image{display:block;width:100%;min-height:100px;object-fit:contain}.ansicht-foto{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;background:var(--side);cursor:zoom-in}
.ansicht-gross{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:8px;background:#fff}.ansicht-gross>button{display:block;margin-left:auto}.ansicht-gross>div{height:calc(100% - 52px);overflow:auto;touch-action:pan-x pan-y pinch-zoom}.ansicht-gross img{display:block;width:100%;height:auto}.ansicht-gross img.zoom{width:200%;max-width:none}


#context:has(.b-record,.b-document,.b-filter,.b-contact-group,.b-empty),#context-body .b-record,#context-body .b-record p,#context-body .b-record h3,#context-body .b-record h4,#context-body .b-document,#context-body .b-filter,#context-body .b-filter input,#context-body .b-filter select,#context-body #b-contact-search{font-size:16px;line-height:1.45}
#context-body .b-record{padding:12px 0;overflow-wrap:anywhere}
#context-body .b-record h3{font-size:16px;line-height:1.4;color:inherit;margin:0 0 6px;font-weight:700}
#context-body .b-record h4{font-size:16px;line-height:1.4;color:inherit;margin:16px 0 4px;font-weight:700}
#context-body .b-record p{margin:6px 0;white-space:pre-wrap}
#context-body .b-record ul,#context-body .b-record ol{padding-left:24px;margin:6px 0}
#context-body .b-record li{margin:4px 0}
#context-body .b-meta{color:#60656a}
#context-body .b-record a.entry{padding:8px 0;min-height:44px}
#context-body .b-group-title{font-size:16px;color:inherit;margin:16px 0 0}
#context-body .b-document{padding:12px 0;min-height:44px;border-bottom:1px solid var(--line)}
#context-body .b-filter{margin-bottom:8px}
#context-body .b-filter summary{padding:8px 0;min-height:44px}
#context-body .b-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0 0}
#context-body .b-photos .ansicht-foto{width:100%;height:auto;min-height:80px;aspect-ratio:4/3;object-fit:cover;border-radius:6px}
#context-body .b-photos:has(>:only-child){grid-template-columns:minmax(0,240px)}
#context-body .b-filter .field,#context-body .field:has(#b-contact-search,#b-search){font-size:16px;line-height:1.45}
#context-body .b-empty{font-size:16px;line-height:1.45;padding:12px 0}
#context-body [hidden]{display:none!important}

.b-leiste{grid-column:1/-1;display:flex;gap:8px;overflow-x:auto;max-height:60px}.b-leiste>.entry{min-width:150px;min-height:52px;flex-shrink:0;white-space:nowrap}.b-record{padding:12px;border-bottom:1px solid var(--line)}#b-form input:not([type=checkbox]),#b-form select,#b-form textarea,#b-start,#b-ziel{width:100%;min-height:48px}#b-form textarea{min-height:100px}
/* Plan-Ablage: Navigation bleibt ausserhalb des scrollenden Fensterinhalts. */
#plan-navigation{flex:none;min-width:0;background:#fff;border-bottom:1px solid var(--line)}
.plan-top-folders,.plan-breadcrumbs{display:flex;align-items:center;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;white-space:nowrap;scrollbar-width:none;gap:4px;padding:0 8px}
.plan-top-folders{height:44px}
#context .plan-top-folders button{height:44px;min-height:44px;max-width:164px;flex:none;padding:0 10px;border:0;border-radius:0;font-size:15px;background:transparent}
.plan-top-folders button span,.plan-subfolder span:first-child{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#context .plan-top-folders button[aria-pressed=true]{color:#205437;background:#e4f0e7;box-shadow:inset 0 -3px #287448;font-weight:600}
.plan-breadcrumbs{min-height:44px;border-top:1px solid var(--line)}
#context .plan-breadcrumbs button{flex:none;min-height:44px;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:0 4px;border:0;background:transparent}
#context-body .plan-subfolder{display:flex;justify-content:space-between;font-weight:600}
#context.plan-window,#context.plan-window.full{height:calc(var(--ui-height) - var(--chrome-height) - var(--composer-height));border-radius:0}
#context.plan-window #drag-handle{display:none}
#context.plan-window .sheet-bottom:has(button[hidden]){display:none}
body:has(#context.plan-window:not([hidden])) #welcome .welcome-mark.mit-wolke{display:none}
#context.plan-window #file-view{display:block;border:0;height:55dvh}
@media(min-width:900px){#context.plan-window,#context.plan-window.full{height:calc(var(--ui-height) - var(--chrome-height))}}

.k3d{position:fixed;inset:0;z-index:4000;background:#e9ecef;touch-action:none;user-select:none;-webkit-user-select:none;overscroll-behavior:none;}
.k3d [hidden]{display:none !important;}
.k3d canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;}
.k3dtop{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:10px;padding:calc(10px + env(safe-area-inset-top)) 12px 10px;background:linear-gradient(#ffffffee,#ffffff00);pointer-events:none;}
.k3dt{flex:1;font-weight:800;font-size:16px;color:#0f172a;text-shadow:0 1px 0 #fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.k3dzu{pointer-events:auto;width:42px;height:42px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-size:24px;line-height:1;}
.k3dbot{position:absolute;left:0;right:0;bottom:0;padding:10px 12px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(#ffffff00,#ffffffee 45%);pointer-events:none;}
.k3dbot button{pointer-events:auto;font:inherit;}
.k3dmodi{display:flex;gap:6px;justify-content:center;margin-bottom:8px;}
.k3dmodi button{flex:1;max-width:170px;padding:11px 8px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-weight:700;font-size:14.5px;}
.k3dmodi button.an{background:#1f7a4d;border-color:#1f7a4d;color:#fff;}
.k3dakt{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin-bottom:6px;}
.k3dakt button{padding:7px 11px;border-radius:999px;border:1px solid #cbd5e1;background:#fff;color:#334155;font-size:12.5px;font-weight:600;}
.k3dhinw{font-size:12px;color:#334155;text-align:center;margin-bottom:2px;}
.k3dleg{font-size:11.5px;color:#475569;text-align:center;line-height:1.35;}
.k3dlab{position:absolute;inset:0;pointer-events:none;overflow:hidden;}
.k3dlab button{position:absolute;transform:translate(-50%,-50%);padding:2px 6px;border-radius:7px;background:#ffffffd9;border:1px solid #cbd5e1;color:#0f172a;font-size:11px;font-weight:700;white-space:nowrap;pointer-events:auto;}
.k3dlab button.ich{background:#1f7a4d;border-color:#1f7a4d;color:#fff;}
.k3dhier{position:absolute;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;background:#e11d48;border:3px solid #fff;box-shadow:0 0 0 0 #e11d4888;animation:k3dpuls 1.6s infinite;pointer-events:none;}
@keyframes k3dpuls{70%{box-shadow:0 0 0 14px #e11d4800;}100%{box-shadow:0 0 0 0 #e11d4800;}}
.k3dlade{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#e9ecef;color:#334155;font-size:14.5px;font-weight:600;text-align:center;padding:24px;}
.k3dlade svg{width:54px;height:54px;animation:plpuls 1.1s ease-in-out infinite;}
.k3dpano{position:absolute;inset:0;pointer-events:none;overflow:hidden;}
.k3dpano button{position:absolute;transform:translate(-50%,-50%);min-width:44px;padding:8px 10px;border-radius:999px;background:#ffffffe6;border:2px solid #1f7a4d;color:#0f172a;font-size:12px;font-weight:800;text-align:center;white-space:nowrap;pointer-events:auto;box-shadow:0 2px 8px #0f172a33;}
.k3dpano button.hinter{opacity:.55;border-style:dashed;}
.k3dpano button::after{content:"";position:absolute;left:50%;top:100%;width:2px;height:14px;margin-left:-1px;background:#1f7a4d;}
.k3dpad{position:absolute;right:12px;bottom:170px;display:flex;flex-direction:column;gap:10px;}
.k3dpad button{width:64px;height:64px;padding:0;border-radius:50%;border:1px solid #cbd5e1;background:#ffffffe6;color:#0f172a;display:flex;align-items:center;justify-content:center;touch-action:none;-webkit-touch-callout:none;box-shadow:0 2px 8px #0f172a22;}
.k3dpad button.an{background:#1f7a4d;border-color:#1f7a4d;color:#fff;}
.k3dpad svg{width:30px;height:30px;pointer-events:none;}
.k3d canvas.k3dmini{inset:auto;left:12px;top:calc(62px + env(safe-area-inset-top));width:auto;height:auto;border-radius:10px;border:1px solid #cbd5e1;background:#ffffffe6;box-shadow:0 2px 8px #0f172a22;}
.k3dtipp{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%);width:max-content;max-width:84%;padding:12px 16px;border-radius:14px;background:#0f172ae6;color:#fff;font-size:15px;font-weight:600;text-align:center;line-height:1.5;pointer-events:none;}

/* Kompakter Nur-Lese-Rundgang; Modaltop und Bedienung bleiben beim Fehler erreichbar. */
dialog.rundgang-view{max-width:none;max-height:none;width:100%;height:100%;height:100dvh;margin:0;padding:0;border:0;color:#243028;font-family:inherit;}
.rundgang-view button,.rundgang-view select{min-height:44px;min-width:44px;font:inherit;border-radius:8px;}
.rundgang-view .k3dtop,.rundgang-view .k3dbot,.rundgang-view .k3dpad{z-index:3;}
.rundgang-view .k3dbot{background:#f8faf7ed;border-top:1px solid #d9dfd8;padding-top:10px;}
.rundgang-view .k3dmodi button{font-size:13px;padding:8px 4px;}
.rundgang-view .k3dleg{pointer-events:auto;font-size:11px;}
.rundgang-view .k3dleg summary{cursor:pointer;min-height:28px;display:flex;align-items:center;justify-content:center;}
.rundgang-view .k3dleg p{margin:4px 0;}
.rundgang-view .k3dhinw{font-size:11px;}
.rundgang-view .k3dlade{pointer-events:none;z-index:2;background:#e9ecefee;}
.rundgang-view .k3dpad button{width:56px;height:56px;font-size:28px;}
.rundgang-view .k3dlab button{max-width:130px;overflow:hidden;}
.rundgang-stationen{display:flex;gap:6px;margin:6px 0;pointer-events:auto;}
.rundgang-stationen select{min-width:0;flex:1;background:#fff;border:1px solid #cbd5e1;padding:4px;}
.rundgang-stationen button{background:white;border:1px solid #cbd5e1;}
@media(prefers-reduced-motion:reduce){.rundgang-view .k3dhier{animation:none;}}
.rundgang-view .k3dakt button{font-size:13px;padding:6px 10px;}
.rundgang-view .k3dleg summary{font-size:11px;line-height:1.35;}

/* Planfenster einfach (Güven 16.11.2026): Ordnerbaum wie im Plancenter, Anzahl rechts; am PC Fenster in der Mitte statt Randspalte */
.planbaum .plan-folder>summary{display:flex;align-items:center;justify-content:space-between;gap:12px}
.planbaum .folder-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.planbaum .folder-count{flex:none;color:var(--muted,#667);font-variant-numeric:tabular-nums}
.planbaum{overflow-x:hidden}
.planbaum .plan-folder>*:not(summary){margin-left:16px;margin-right:0;width:calc(100% - 16px);max-width:calc(100% - 16px);box-sizing:border-box}
.planbaum .plan-folder .folder-name{font-weight:500}
.planbaum>.plan-folder>summary .folder-name{font-weight:600}
@media(min-width:900px){
 #context,#context.full,#context.plan-window,#context.plan-window.full{left:50%;right:auto;transform:translateX(-50%);width:min(800px,calc(100vw - 48px));top:calc(var(--ui-top) + var(--chrome-height) + 12px);bottom:12px;height:auto;max-height:none;border:1px solid var(--line);border-radius:16px;z-index:20;box-shadow:0 12px 40px rgba(20,40,30,.14)}
 body:has(#context:not([hidden])) .workspace{right:0;margin-right:0}
}

/* Aussehen wie das Hauptprogramm (Güven 16.11.2026): Kugel und Wolke mit den Massen des Vorbilds (chat.css), kein Kasten, kein Rollbalken */
#welcome .welcome-mark.mit-wolke{display:flex;align-items:flex-end;justify-content:flex-start;height:auto;min-height:0;max-height:none;overflow:visible;margin:0 0 18px;background:none}
.welcome-mark.mit-wolke #hello-kugel{position:relative;width:120px;height:120px;margin:0 0 -14px -18px;flex-shrink:0}
.orikugelbox canvas{display:block;width:100%;height:100%}
.wolke-weg{display:flex;align-items:flex-end;position:relative;min-width:0;max-height:none;overflow:visible;background:none}
.wolke{position:relative;margin:34px 0 46px 26px;max-width:430px;min-width:170px;padding:20px 28px 22px;font-size:15px;line-height:1.55;overflow-wrap:anywhere}
.wolke .form .b1{width:118px;height:84px;top:-30px;left:14%}
.wolke .form .b2{width:92px;height:70px;top:-20px;left:calc(14% + 88px)}
.wolke .form .b3{width:64px;height:50px;bottom:-14px;right:18%}
.wolke .satz{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;max-height:none;overflow:hidden;padding-right:0}
.wolke .read-button{margin-top:6px}
#welcome{overflow:visible}
@media(max-width:700px){
 .welcome-mark.mit-wolke #hello-kugel{width:80px;height:80px;margin:0 0 -10px -8px}
 #welcome .welcome-mark.mit-wolke{height:auto;margin-bottom:8px}
 .wolke{font-size:14px;margin:30px 0 34px 18px;padding:16px 22px 18px;min-width:0}
 .wolke .form .b1{width:96px;height:70px;top:-24px}
 .wolke .form .b2{width:74px;height:56px;top:-15px;left:calc(14% + 70px)}
}
/* Die Kugel zeichnet nur, wenn sie sichtbar ist: bei offenem Fenster und im 3D-Rundgang ruht sie (schont schwache Handys) */
body:has(#context:not([hidden])) #welcome .welcome-mark.mit-wolke{display:none}
body:has(.k3d:not([hidden])) .orikugelbox{display:none}

/* Seitenleiste einfach (Güven 16.11.2026): wenige grosse Knöpfe, keine langen Listen, kein Kleintext */
#tabs{display:flex;flex-direction:column;gap:8px;padding:8px 12px}
#tabs .nav-button{width:100%;min-height:52px;justify-content:flex-start;text-align:left;padding:0 16px;font-size:16px;line-height:22px;font-weight:600;border:1px solid var(--line);border-radius:12px;background:#fff}
#tabs .nav-button.current{background:#fff}
#tabs .nav-room{margin-top:12px;font-weight:500}
#side-list{display:none}
#entry-button{display:none}
.sidebar-bottom{padding:8px 12px}
.sidebar-bottom #language-button{width:100%;min-height:52px;font-size:16px;border:1px solid var(--line);border-radius:12px;background:#fff;padding:0 16px;text-align:left}
#context-body>.entry{min-height:52px;font-size:16px}

/* Antwort des Assistenten: passende Pläne als antippbare Karten statt Textzeilen */
.message .plan-card{margin:6px 0 0}
.message .plan-card .plan-entry{width:100%;min-height:52px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;text-align:left;font-size:16px;line-height:22px}
.message .plan-card .plan-entry small{font-size:13px;line-height:18px;color:var(--muted,#667)}

/* PDF-Anzeige wie im Hauptprogramm: Seiten als Canvas, Zoom, waagrecht und senkrecht schiebbar */
#context.plan-window #file-view.pdf-ansicht,.pdf-ansicht{display:flex;flex-direction:column;height:auto;min-height:0;border:0}
.pdf-leiste{display:flex;align-items:center;gap:8px;padding:6px 0;position:sticky;top:0;background:#fff;z-index:1}
.pdf-leiste button{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:20px;line-height:1}
.pdf-info{margin-left:auto;color:var(--muted,#667);font-size:13px}
.pdf-seiten{touch-action:pan-x pan-y;overflow:auto;max-height:72dvh;background:#eef0ee;border-radius:8px;padding:6px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.pdf-seite{display:block;margin:0 0 8px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.message .plan-card .plan-entry{flex-direction:row;align-items:center;gap:12px;flex-wrap:nowrap}
.message .plan-card .plan-entry>span,.message .plan-card .plan-entry>small{display:block}
.message .plan-card .plan-entry{display:grid;grid-template-columns:auto 1fr;column-gap:12px}
.message .plan-card .plan-mini{grid-row:1 / span 3;width:88px;max-height:88px;object-fit:contain;border:1px solid var(--line);border-radius:6px;background:#fff}
.message .plan-card .plan-entry>:not(canvas){grid-column:2}

/* Planzeilen überall gleich (Güven 16.11.2026): Vorschaubild, Titel, eine kurze Zeile – kein Pfad, keine Zeitstempel */
.plan-entry{display:grid!important;grid-template-columns:72px 1fr;column-gap:12px;row-gap:2px;align-items:center;text-align:left;min-height:64px}
.plan-entry>canvas.plan-mini{grid-row:1 / span 2;grid-column:1;width:72px;height:auto;max-height:64px;object-fit:contain;border:1px solid var(--line);border-radius:6px;background:#fff}
.plan-entry>canvas.plan-mini.leer{visibility:hidden}
.plan-entry>span{grid-column:2;font-size:16px;line-height:21px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.plan-entry>small{grid-column:2;font-size:13px;line-height:18px;color:var(--muted,#667)}
.plan-entry>small+small{display:none}
.plan-change{margin:0}.plan-change>.plan-change-date{display:block;margin:0 0 8px 84px;font-size:13px;color:var(--muted,#667)}
.plan-change>.plan-change-date:before{content:"↻ "}
.plan-change>p{display:none}
.message .plan-card .plan-mini{width:72px;max-height:64px}
.plan-entry{column-gap:12px!important;padding:8px 10px!important}
.plan-change>.plan-change-date{display:none}

/* Termine ruhig (Güven 16.11.2026): Name, Zeitraum, Balken */
.termin-row{display:grid!important;grid-template-columns:1fr auto;column-gap:12px;row-gap:6px;align-items:baseline;text-align:left;width:100%;padding:10px 12px!important;min-height:56px;border:1px solid var(--line);border-radius:12px;background:#fff;margin:0 0 6px!important}
.termin-name{font-size:16px;line-height:21px;font-weight:600;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.termin-zeit{font-size:13px;line-height:18px;color:var(--muted,#667);white-space:nowrap;font-variant-numeric:tabular-nums}
.termin-balken{grid-column:1 / -1;height:6px;border-radius:3px;background:#e6ebe7;overflow:hidden}
.termin-balken>i{display:block;height:100%;background:#2e8455;border-radius:3px}
.termin-row.kommend .termin-balken>i{width:0!important}
.termin-row.vergangen{opacity:.65}.termin-row.vergangen .termin-balken>i{background:#9aa5a0}
.termin-row.laufend{border-color:#2e8455}
.termin-alle,.termin-vergangen{margin:10px 0 0}
.termin-alle>summary,.termin-vergangen>summary{min-height:48px;display:flex;align-items:center;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:600;margin-bottom:8px}
#context-body section[data-room-dates]>h3{margin:4px 0 8px;font-size:15px}
/* Fortschritt: Fotos zuerst als kleine Vorschauen, Text kurz (antippen klappt auf) */
#context-body .b-photos{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:8px 0}
#context-body .b-photos .ansicht-foto{aspect-ratio:1/1;min-height:0;object-fit:cover}
.ansicht-gross>div{touch-action:none}
.b-kurz:not(.b-offen)>h3+p,.b-kurz:not(.b-offen)>h3+.b-photos+p{display:none}
.b-kurz:not(.b-offen)>h4:nth-of-type(n+2),.b-kurz:not(.b-offen)>h4:nth-of-type(n+2)+p{display:none}
.b-kurz>h4{margin:8px 0 2px;font-size:14px;color:var(--muted,#667);font-weight:600}
.b-kurz>p{margin:0 0 6px;font-size:16px;line-height:22px}
.b-kurz>.b-mehr{min-width:56px;min-height:40px;border:1px solid var(--line);border-radius:10px;background:#fff;font-size:18px;line-height:1;margin:4px 0 12px}
.b-record.b-kurz{border-bottom:1px solid var(--line);padding-bottom:6px;margin-bottom:10px}
#context-body .b-photos:has(>:only-child){grid-template-columns:minmax(0,160px)}

/* Näher am Chat-Vorbild (Güven 16.11.2026): heller ruhiger Grund, Inhalt in einer Spalte, weiche Flächen, klare Knöpfe */
:root{--grund:#ffffff;--flaeche:#f4f5f3;--flaeche-hover:#eceeeb}
html,body{background:var(--grund)}
.workspace,#chat-main,.workspace>header,#quick-actions{background:var(--grund)}
.workspace>header{border-bottom:0}
#quick-actions{border-bottom:1px solid var(--line);display:flex;justify-content:center;gap:6px;padding:6px 10px}
#quick-actions button{flex:0 1 auto;min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:15px;font-weight:500;gap:6px;white-space:nowrap}
#quick-actions button:hover{background:var(--flaeche)}
#project-chats button,#project-chats .entry{background:var(--flaeche);border:0;border-radius:14px;min-height:52px}
#project-chats button:hover{background:var(--flaeche-hover)}
#composer{background:#fff;border:1px solid var(--line);border-radius:26px;box-shadow:0 2px 12px rgba(0,0,0,.06)}
#context{box-shadow:0 12px 40px rgba(0,0,0,.12)}
.user .bubble{background:var(--flaeche);border-radius:20px}
.assistant .bubble{background:none}
#welcome h1{font-weight:600}
@media(max-width:700px){#quick-actions{justify-content:flex-start;overflow-x:auto;scrollbar-width:none}#quick-actions::-webkit-scrollbar{display:none}#quick-actions button{min-height:40px;padding:0 12px}}
/* Kugel oben links: grösser und klarer */
#logo-kugel.kugel-logo{width:36px;height:36px;--fg:#2b5a40;--primary:#2e8455}
#home{gap:8px;font-size:17px;font-weight:600;letter-spacing:.01em}
/* Kontakte: Karte mit Name, Rolle · Firma und zwei klaren Knöpfen (Anrufen, Mail) */
#context-body .b-contact{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin:0 0 8px}
#context-body .b-contact>h3{margin:0;font-size:16px;line-height:22px;font-weight:600}
#context-body .b-contact>.b-meta{margin:2px 0 10px;font-size:13px;line-height:18px;color:var(--muted,#667)}
#context-body .b-contact-actions{display:flex;gap:8px;flex-wrap:wrap}
#context-body .b-contact-actions .entry{flex:1 1 140px;min-width:0;min-height:44px;display:flex;align-items:center;gap:8px;padding:0 14px;margin:0;border:1px solid var(--line);border-radius:999px;background:var(--flaeche);font-size:15px;text-decoration:none;color:inherit;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#context-body .b-contact-actions .entry:before{content:"";flex:none;width:18px;height:18px;background:center/contain no-repeat}
#context-body .b-contact-actions .entry.b-contact-tel:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e8455' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E")}
#context-body .b-contact-actions .entry.b-contact-mail:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e8455' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E")}
#context-body .b-contact-group>.b-group-title{margin:14px 0 8px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#667);font-weight:600}
#context-body .field:has(#b-contact-search){margin:0 0 4px}#context-body #b-contact-search{min-height:44px;border-radius:999px;padding:0 16px;background:var(--flaeche);border:1px solid var(--line)}
#logo-kugel.kugel-logo{width:34px;height:34px}#logo-kugel svg{display:block;width:100%;height:100%}
@media(max-width:700px){#quick-actions{gap:4px;padding:6px 8px}#quick-actions button{padding:0 10px;font-size:15px;gap:5px}#quick-actions button svg{width:18px;height:18px}}

@media(max-width:700px){#context-body .b-contact-actions .entry{flex:1 1 100%}#quick-actions button{padding:0 9px;font-size:14px;border:0;background:none}#quick-actions{gap:2px;justify-content:space-between}}
.pdf-blatt{position:relative;display:inline-block;margin:0 0 8px;line-height:0}.pdf-blatt>.pdf-seite{margin:0}
.pdf-blatt>#plan-marker{position:absolute;width:18px;height:18px;border:3px solid #b22;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}

/* Ohne Seitenleiste (Güven 16.11.2026: «vieles doppelt»): oben nur Zeichen, Raumname (antippen = Bereich wechseln), QR, Sprache; darunter die Knöpfe */
#open-sidebar,#sidebar,#overlay{display:none!important}
#home{font-size:0;gap:0;padding:0 4px;max-width:none}
#header-project,body:has(#chat-main.empty) #header-project{display:block!important;flex:0 1 auto;max-width:60vw;font-size:16px;font-weight:600;line-height:22px;padding:8px 12px;border-radius:999px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#header-project:after{content:" ▾";font-weight:400;color:var(--muted,#667)}
#header-project:hover{background:var(--flaeche)}
.workspace>header .header-title{gap:4px;min-width:0}
@media(max-width:700px){#quick-actions button{padding:0 7px;font-size:13.5px}#quick-actions button svg{width:17px;height:17px}#header-project{max-width:46vw;font-size:15px;padding:8px 8px}}
@media(max-width:700px){#quick-actions{overflow-x:auto;justify-content:flex-start;gap:0}#quick-actions button{padding:0 8px;flex:none}}

/* Hell / Dunkel */
#theme-button{width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:12px;background:#fff;padding:0}
#theme-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="dark"]{--grund:#0f1512;--flaeche:#1b2520;--flaeche-hover:#24322b;--ink:#e7efe9;--line:#2c3a33;--muted:#9fb0a6;--side:#141c18;color-scheme:dark}
html[data-theme="dark"] body,html[data-theme="dark"] .workspace,html[data-theme="dark"] #chat-main,html[data-theme="dark"] .workspace>header,html[data-theme="dark"] #quick-actions{background:var(--grund);color:var(--ink)}
html[data-theme="dark"] :is(#context,#composer,#quick-actions button,#theme-button,#qr-button,#visible-language,.b-contact,.termin-row,.pdf-leiste,.pdf-leiste button,.plan-folder>summary,.termin-alle>summary,.termin-vergangen>summary,#language-dialog,#language-list button,.plan-entry,.message .plan-card .plan-entry,#context-body .entry,#context-body .b-contact-actions .entry,#b-contact-search,textarea,input,select,.sheet-heading,.sheet-bottom,#context-ask,.b-mehr,.ansicht-gross){background:var(--flaeche);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(#project-chats button,.user .bubble){background:var(--flaeche);color:var(--ink)}
html[data-theme="dark"] :is(h1,h2,h3,h4,p,span,small,button,a,summary,label,#header-project,#welcome h1 button,.folder-name,.termin-name,.bubble){color:var(--ink)}
html[data-theme="dark"] :is(.plan-entry>small,.termin-zeit,.b-meta,.folder-count,.pdf-info,.meta,#context .meta){color:var(--muted)}
html[data-theme="dark"] #context{box-shadow:0 12px 40px rgba(0,0,0,.5)}
html[data-theme="dark"] .pdf-seiten{background:#0b100d}
html[data-theme="dark"] .termin-balken{background:#2a3830}
html[data-theme="dark"] .wolke{color:#E7EFE9}
html[data-theme="dark"] .wolke .form b{background:linear-gradient(180deg,#183026 0,#12261C 100%)}
html[data-theme="dark"] .wolke .form{filter:drop-shadow(0 10px 24px rgba(0,0,0,.35))}
html[data-theme="dark"] .wolke-weg .puff{background:radial-gradient(circle at 40% 35%,#24402F 0,#183026 70%)}
html[data-theme="dark"] #logo-kugel svg circle{fill:#183026}
html[data-theme="dark"] svg{stroke:currentColor}
@media(max-width:700px){#quick-actions button svg{display:none}#quick-actions{justify-content:space-between;overflow-x:visible}#quick-actions button{padding:0 6px;font-size:14px}#theme-button{width:40px}}
.header-actions #network{min-height:36px;display:inline-flex;align-items:center;padding:0 10px;border-radius:999px;background:#fdecec;color:#8a1f1f;font-size:13px;font-weight:600;border:0;white-space:nowrap}
.header-actions #network[hidden]{display:none}
.pdf-leiste .pdf-laden{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:10px;background:#fff;color:inherit;text-decoration:none;font-size:15px;font-weight:600}
.pdf-leiste .pdf-laden svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="dark"] .pdf-leiste .pdf-laden{background:var(--flaeche);border-color:var(--line)}

/* Plan herunterladen: immer sichtbar über dem Plan */
#context-body .plan-download{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;margin:4px 0 6px;border:1px solid var(--line);border-radius:999px;background:var(--flaeche);color:inherit;text-decoration:none;font-size:15px;font-weight:600}
#context-body .plan-download[hidden]{display:none}
#context-body .plan-download svg{width:20px;height:20px;fill:none;stroke:#2e8455;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
html[data-theme="dark"] #context-body .plan-download{background:var(--flaeche);border-color:var(--line)}
/* 3D und Bilder: Karten mit Bild oder bewegtem Zeichen */
#context-body .bild-karte{display:grid!important;grid-template-columns:96px 1fr;align-items:center;column-gap:14px;width:100%;min-height:84px;padding:8px 12px!important;margin:0 0 8px!important;border:1px solid var(--line);border-radius:14px;background:#fff;text-align:left}
#context-body .bild-karte .k-bild{width:96px;height:68px;border-radius:10px;overflow:hidden;background:var(--flaeche);display:flex;align-items:center;justify-content:center}
#context-body .bild-karte .k-bild canvas{width:100%;height:100%;object-fit:cover}
#context-body .bild-karte .k-text{font-size:16px;line-height:22px;font-weight:600}
.k-zeichen{width:46px;height:46px;fill:none;stroke:#2e8455;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round}
.k-wuerfel g{transform-origin:24px 24px;animation:kDreh 6s linear infinite}
@keyframes kDreh{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(.86)}100%{transform:rotate(360deg) scale(1)}}
.k-gehen .k-puls{stroke:#2e8455;opacity:.5;transform-origin:24px 20px;animation:kPuls 2.2s ease-out infinite}
@keyframes kPuls{0%{transform:scale(.6);opacity:.7}100%{transform:scale(1.5);opacity:0}}
.k-bild.k-schwenk canvas{width:190%;max-width:none;animation:kSchwenk 9s ease-in-out infinite alternate}
@keyframes kSchwenk{from{transform:translateX(0)}to{transform:translateX(-45%)}}
html[data-theme="dark"] #context-body .bild-karte{background:var(--flaeche);border-color:var(--line)}
@media(prefers-reduced-motion:reduce){.k-wuerfel g,.k-gehen .k-puls,.k-bild.k-schwenk canvas{animation:none}}
.k-rundum .k-blick{fill:rgba(46,132,85,.18);transform-origin:24px 24px;animation:kBlick 5s linear infinite}
@keyframes kBlick{from{transform:rotate(0)}to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.k-rundum .k-blick{animation:none}}

/* Vollbild der Plananzeige */
.pdf-ansicht.pdf-voll{position:fixed!important;inset:0;z-index:5000;background:#fff;padding:8px 8px 0;margin:0;height:100dvh!important;min-height:0;display:flex;flex-direction:column}
.pdf-ansicht.pdf-voll .pdf-seiten{flex:1;max-height:none;border-radius:0}
.pdf-ansicht.pdf-voll .pdf-leiste{padding:0 0 8px}
html.pdf-voll-an{overflow:hidden}
html.pdf-voll-an #context{transform:none!important}
html[data-theme="dark"] .pdf-ansicht.pdf-voll{background:var(--grund)}
/* Karten mit echtem Bild: kleines Schild statt gezeichneter Animation */
#context-body .bild-karte .k-bild{position:relative}
#context-body .bild-karte .k-schild{position:absolute;left:6px;bottom:6px;padding:2px 8px;border-radius:999px;background:rgba(20,30,25,.78);color:#fff;font-size:12px;font-weight:700;letter-spacing:.02em}

/* Unten kein farbiger Kasten mehr; das Fenster endet über der Eingabe und wird nicht abgeschnitten (Güven 16.11.2026) */
#composer-area{background:var(--grund)!important;border:0!important;box-shadow:none!important}
#composer-area:before,#composer-area:after{display:none!important}
@media(min-width:900px){#context,#context.full,#context.plan-window,#context.plan-window.full{bottom:calc(var(--eingabe-hoehe,112px) + 12px)}}
html[data-theme="dark"] #composer-area{background:var(--grund)!important}
/* Auswahl zum Herunterladen im Plänefenster */
#context .plan-entry{grid-template-columns:72px 1fr 40px}
#context .plan-entry>.plan-wahl{grid-column:3;grid-row:1 / span 2;justify-self:end}
.plan-wahl,.folder-wahl{display:inline-block;width:26px;height:26px;border:2px solid var(--line,#c9cdd2);border-radius:7px;background:var(--flaeche,#fff);flex:none;position:relative;cursor:pointer;box-sizing:border-box}
.folder-wahl{margin-left:12px;width:22px;height:22px;vertical-align:middle}
.folder-wahl[hidden]{display:none}
:is(.plan-wahl,.folder-wahl)[aria-checked="true"]{background:#1f6f4a;border-color:#1f6f4a}
:is(.plan-wahl,.folder-wahl)[aria-checked="true"]::after{content:"";position:absolute;left:28%;top:10%;width:30%;height:58%;border:solid #fff;border-width:0 3px 3px 0;transform:rotate(45deg)}
.folder-wahl[aria-checked="mixed"]::after{content:"";position:absolute;left:20%;right:20%;top:calc(50% - 1.5px);height:3px;background:#1f6f4a;border-radius:2px}
#plan-wahl-leiste{position:sticky;bottom:0;display:flex;gap:8px;padding:10px 0 4px;background:linear-gradient(transparent,var(--flaeche,#fff) 30%);z-index:3}
#plan-wahl-laden{flex:1;display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;border:0;border-radius:24px;background:#1f6f4a;color:#fff;font-size:16px;font-weight:600}
#plan-wahl-laden svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#plan-wahl-leer{width:48px;min-height:48px;border:1px solid var(--line,#c9cdd2);border-radius:24px;background:var(--flaeche,#fff);color:inherit;font-size:16px}
/* Vorlauf: Seitenbild bis die erste PDF-Seite gezeichnet ist */
.pdf-seiten{position:relative}
.pdf-vorlauf{display:block;width:100%;height:auto;background:#fff;border-radius:2px}
.pdf-seiten:has(> img.pdf-vorlauf)>:not(img.pdf-vorlauf){position:absolute;left:6px;top:6px;visibility:hidden}
/* Chat-Knöpfe (04.12.): Einstieg über dem Eingabefeld, Karten in Antworten, Folgeknöpfe wie im Haupt-SWARM */
#chat-knoepfe{display:flex;gap:8px;overflow-x:auto;padding:4px 2px 10px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#chat-knoepfe::-webkit-scrollbar{display:none}
#chat-knoepfe[hidden]{display:none}
.chat-knopf{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--line);border-radius:22px;background:#fff;color:#2b3a33;font-size:14px;white-space:nowrap}
.chat-knopf svg{width:18px;height:18px;fill:none;stroke:#2e8455;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.chat-knopf:hover{background:var(--mint)}
.message .folge .chat-knopf{border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;width:100%;padding:0 4px;white-space:normal;text-align:left}
.chat-karten{display:grid;gap:8px;margin-top:10px;max-width:560px}
.chat-karten .karten-titel{margin:8px 0 0;font-size:13px;color:var(--muted)}
.chat-karten .plan-card{margin:0}
.chat-karten .plan-card .plan-entry{width:100%;min-height:52px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.chat-karten .termin-zeile,.chat-karten>.entry{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:48px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.chat-karten .termin-zeile small{color:var(--muted);white-space:nowrap}
.kontakt-karte{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.kontakt-karte div{display:flex;flex-direction:column;min-width:0}
.kontakt-karte small{color:var(--muted);font-size:13px}
.karte-anruf{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border-radius:22px;background:#2e8455;color:#fff;text-decoration:none;font-size:14px}
.karte-mail{flex-basis:100%;font-size:13px;color:#2e6e4b;overflow-wrap:anywhere}
.raum-karte{padding:4px 14px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.raum-karte .entry{min-height:48px;display:flex;justify-content:space-between;align-items:center}
.raum-karte ul{margin:4px 0 0;padding-left:18px}
.raum-karte li,.raum-karte p{font-size:14px;line-height:1.5}
html[data-theme="dark"] :is(.chat-knopf,.chat-karten .plan-card .plan-entry,.chat-karten .termin-zeile,.chat-karten>.entry,.kontakt-karte,.raum-karte){background:var(--flaeche,#1b2520);color:var(--ink)}
html[data-theme="dark"] .message .folge .chat-knopf{background:none}
/* App installieren (04.12.) */
#app-angebot{display:flex;align-items:center;gap:4px;padding:0 2px 6px}
#app-angebot .app-installieren{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 6px;color:#2e6e4b;font-size:14px}
#app-angebot svg,#app-anleitung svg{width:20px;height:20px;fill:none;stroke:#2e8455;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#app-angebot .app-weg{min-width:44px;min-height:44px;color:var(--muted);font-size:20px}
#app-anleitung{border:1px solid var(--line);border-radius:16px;padding:20px;max-width:340px;width:calc(100% - 40px)}
#app-anleitung::backdrop{background:rgba(20,30,25,.35)}
.app-schritte{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:14px}
.app-schritte li{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:15px;line-height:1.4}
.app-code{flex-basis:100%;font-size:28px;letter-spacing:3px;font-variant-numeric:tabular-nums}
.app-schritte small{color:var(--muted)}
.app-anleitung-zu{width:100%;min-height:44px;border:1px solid var(--line);border-radius:22px}
#app-kopplung{display:grid;gap:8px;margin-top:18px;max-width:320px}
#app-kopplung input{min-height:44px;border:1px solid var(--line);border-radius:12px;padding:0 14px;font-size:20px;letter-spacing:3px}
#app-kopplung button{min-height:44px;border-radius:22px;background:#2e8455;color:#fff}
html[data-theme="dark"] #app-anleitung{background:var(--flaeche,#1b2520);color:var(--ink)}
/* Hintergrund wie im Haupt-SWARM (Güven 04.12.): Nebel-Shader aus portal-hintergrund.js (unverändert, hier als kugel-hintergrund.js),
   Farben und Lage wie im SWARM (chat.css/portal.css). Flächen der Oberfläche bleiben, nur der Grund wird durchsichtig. */
#nebel{--bg:#E9F0EB;--bg-2:#FFFFFF;--ink:#13241B;--accent:#2E8455;--fg:var(--ink);--primary:var(--accent);--info:#0369a1;display:block;position:fixed;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none;background:var(--bg);color:var(--accent)}
html[data-theme="dark"] #nebel{--bg:#04120C;--bg-2:#0A2417;--ink:#EAF4ED;--accent:#4FBE7E;--fg:#EAF4ED;--primary:#4FBE7E;--info:#38bdf8}
html{background:#E9F0EB linear-gradient(160deg,#F1F6F2 0%,#E9F0EB 45%,#DDE9E1 100%) fixed}
html[data-theme="dark"]{background:#04120C linear-gradient(160deg,#0A2417 0%,#04120C 60%) fixed} /* Rückfall ohne WebGL: ruhiger Farbverlauf */
html body,html .workspace,html #chat-main,html[data-theme="dark"] body,html[data-theme="dark"] .workspace,html[data-theme="dark"] #chat-main{background:transparent}
html .workspace>header,html #quick-actions{background:rgba(233,240,235,.72);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
html[data-theme="dark"] .workspace>header,html[data-theme="dark"] #quick-actions{background:rgba(4,18,12,.72)}
#context{background:#fff}
html[data-theme="dark"] #context{background:var(--grund)}
@media(prefers-reduced-motion:reduce){#nebel{transition:none}}
html #composer-area,html #chat-main.empty #composer-area{background:linear-gradient(rgba(233,240,235,0),rgba(233,240,235,.86) 18px)!important}
html[data-theme="dark"] #composer-area,html[data-theme="dark"] #chat-main.empty #composer-area{background:linear-gradient(rgba(4,18,12,0),rgba(4,18,12,.86) 18px)!important}
/* Durchspiel 04.12.: bei offenem Fenster keine Einstiegsknöpfe (sonst wird das Planfenster am Handy klein); Trennlinie dunkel */
body:has(#context:not([hidden])) #chat-knoepfe,body:has(#context:not([hidden])) #app-angebot{display:none!important}
html[data-theme="dark"] #quick-actions{box-shadow:inset 0 -1px var(--line)}
