:root { color-scheme: light; --navy:#102b50; --blue:#1968bd; --muted:#64738a; --border:#dce4ee; --bg:#eef2f7; --panel:#fff; --accent:#f2a73e; --good:#189368; --bad:#c44b53; }
*{box-sizing:border-box} html,body{height:100%;margin:0;min-height:0} body{font-family:system-ui,-apple-system,Segoe UI,sans-serif;background:var(--bg);color:#253447;display:flex;flex-direction:column;overflow:hidden} [hidden]{display:none!important}
button,textarea,select,input{font:inherit}button{cursor:pointer;border:1px solid #cfdbe8;background:var(--blue);border-radius:8px;color:#fff;padding:7px 11px;font-weight:600}button:hover:not(:disabled){filter:brightness(.96)}button:disabled{opacity:.45;cursor:default}button.secondary,button.icon-button{background:#fff;color:var(--navy);box-shadow:none}button:focus-visible,textarea:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #2d86dc;outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.site-header{display:flex;flex:0 0 auto;justify-content:space-between;align-items:center;gap:20px;padding:12px clamp(12px,2vw,28px);background:linear-gradient(110deg,#0b376f,#155eb0);color:#fff;box-shadow:0 2px 12px #12345618}
.brand{display:flex;align-items:center;gap:12px}.brand-icon{display:grid;place-items:center;width:43px;height:43px;font-size:25px;font-weight:750;background:#ffffff17;border:1px solid #ffffff57;border-radius:12px}.brand h1{margin:0;font-size:1.18rem;letter-spacing:.01em}.brand h1 span{font-weight:400;opacity:.9}.brand p{font-size:.76rem;opacity:.85;margin:2px 0 0}.connection{white-space:nowrap;font-size:.8rem;background:#ffffff22;border:1px solid #ffffff38;padding:7px 10px;border-radius:18px}.connection.problem{background:#9c2228}
.chat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;padding:12px;flex:1;min-height:0;overflow:hidden}
.chat-tile{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0;background:var(--panel);border:1px solid #d3dce8;border-radius:12px;overflow:hidden;box-shadow:0 2px 14px #102b5010}
.tile-head{min-width:0;min-height:0;background:#fafcff;border-bottom:1px solid var(--border)}.title-row{display:flex;justify-content:space-between;align-items:center;padding:6px 10px 0 13px}.tile-title{font-size:.94rem;color:var(--navy);margin:0}.search-toggle{font-size:22px;line-height:1;width:32px;height:30px;padding:0 4px}
.control-panel{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 10px;padding:5px 12px 9px}.status-line{display:flex;align-items:center;gap:6px;min-width:0;font-size:.79rem}.status-dot{width:9px;height:9px;flex:none;background:var(--good);border-radius:50%}.chat-tile.reserved .status-dot{background:var(--accent)}.chat-tile.busy .status-dot{background:var(--blue);animation:pulse 1.3s infinite}.remaining{color:var(--muted);white-space:nowrap}.control-row{display:flex;align-items:center;gap:7px;min-width:0;flex-wrap:wrap}.control-row button{padding:5px 9px;font-size:.78rem}.reasoning-label{display:flex;align-items:center;gap:5px;font-size:.75rem;color:#4d607a}.reasoning-select{background:#fff;border:1px solid #cbd5e2;padding:5px;border-radius:7px;color:var(--navy);font-size:.78rem}.search-panel{display:flex;align-items:center;gap:5px;border-top:1px solid #e4eaf2;padding:7px 10px}.search-input{flex:1;width:10px;min-width:0;padding:5px 8px;border:1px solid #cbd5e2;border-radius:7px;font-size:.8rem}.search-count{font-size:.73rem;color:var(--muted);min-width:42px;text-align:center;white-space:nowrap}.search-prev,.search-next{padding:4px 8px;font-size:1rem}
.message-list{min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:12px 13px;scrollbar-gutter:stable}.chat-placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#789;line-height:1.7;font-size:.9rem}.chat-placeholder small{font-size:.75rem}
.message{max-width:92%;padding:9px 12px;margin:0 0 12px;border-radius:11px;background:#f1f5fa;border:1px solid #e2eaf4;overflow-wrap:anywhere}.message.user{margin-left:auto;background:#e4f0ff;border-color:#c7dcf5}.message.assistant{margin-right:auto;background:#fff;border-color:#e4e9ef;box-shadow:0 1px 5px #1234560a}.message-heading{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#6d8098;margin-bottom:4px}.message-error{margin-top:7px;padding:5px 8px;border-left:3px solid var(--bad);background:#fff2f2;font-size:.75rem;color:#9c3540}.streaming-label{color:#678;display:block;font-size:.72rem;margin-top:5px}.thinking{border:1px solid #d7dce3;border-radius:8px;color:#657281;background:#f6f7f9;margin:5px 0 8px;padding:5px 8px;font-size:.77rem}.thinking summary{cursor:pointer}.thinking pre{font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 2px;max-height:260px;overflow:auto}
.md{font-size:.84rem;line-height:1.42;overflow-wrap:anywhere}.md p{margin:.45em 0}.md p:first-child{margin-top:0}.md p:last-child{margin-bottom:0}.md h1,.md h2,.md h3,.md h4{line-height:1.3;margin:.85em 0 .4em;color:#1d3552}.md h1{font-size:1.15rem}.md h2{font-size:1.04rem}.md h3{font-size:.94rem}.md ul,.md ol{margin:.4em 0;padding-left:1.45em;line-height:1.10}.md li{margin:0 0 .2em}.md blockquote{border-left:3px solid #aabbd0;padding-left:10px;margin:8px 0;color:#566476}.md a{color:#0d60b8}.md code.inline-code{background:#eef3f8;padding:1px 3px;border-radius:3px;font-size:.82em}.code-wrap{margin:8px 0;background:#182538;color:#e7efff;border-radius:8px;overflow:hidden}.code-top{display:flex;justify-content:space-between;align-items:center;background:#26394f;font-size:.67rem;padding:4px 7px;color:#d5e4f6}.code-top button{font-size:.66rem;padding:3px 7px;color:#1e344a;background:#f3f6fa}.code-wrap pre{padding:10px 12px;overflow-x:auto;margin:0;font-size:.77rem;line-height:1.4;white-space:pre}.code-wrap code{color:inherit}.md table{border-collapse:collapse;margin:7px 0;width:100%;display:block;overflow-x:auto;font-size:.78rem}.md th,.md td{border:1px solid #ccd8e4;padding:5px 7px;text-align:left}.md th{background:#eaf2fa}.md hr{border:0;border-top:1px solid #dae1eb;margin:11px 0}.md mark.chat-hit{background:#fbe58b;border-radius:2px;color:#242b30}.md mark.chat-hit.active{background:#eda83c;box-shadow:0 0 0 2px #b57517}
.composer{border-top:1px solid var(--border);padding:9px 11px;background:#fcfdff;min-width:0}.send-form{display:flex;align-items:stretch;gap:7px;min-width:0}.prompt{min-width:0;flex:1;resize:vertical;min-height:38px;max-height:130px;padding:8px;border-radius:8px;border:1px solid #cdd9e7;font-size:.83rem;line-height:1.3}.send-button,.stop-button{align-self:flex-end;padding:9px 11px;font-size:.78rem}.composer-hint{font-size:.68rem;color:var(--muted);margin-top:4px}.notice{background:#fff2e7;color:#965221;padding:6px 9px;border-radius:5px;margin-bottom:6px;font-size:.76rem}
@keyframes pulse { 50% {opacity:.5} }
@media(max-width:1000px){.control-panel{display:block}.control-row{margin-top:7px}.chat-grid{gap:8px;padding:8px}}
@media(max-width:730px){html,body{height:auto;min-height:100%;overflow:auto}.site-header{position:sticky;top:0;z-index:2;padding:8px 12px}.brand-icon{width:33px;height:33px}.brand h1{font-size:1rem}.brand p{font-size:.67rem}.connection{font-size:.7rem}.chat-grid{display:flex;flex-direction:column;overflow:visible;padding:9px;gap:12px}.chat-tile{height:min(76svh,650px);min-height:360px;flex:none}.control-panel{display:flex}.control-row{margin:0}.message{max-width:96%}}

/* Ressourcenarme Textvorschau während sehr langer Streams; nach Abschluss wieder Markdown. */
.md.streaming-plain { white-space:pre-wrap;overflow-wrap:anywhere; }

/* Live-Markdown: Codeblöcke werden bereits beim Öffnen des Fences dargestellt. */
.md.streaming-live .live-text {white-space:pre-wrap;overflow-wrap:anywhere}
.code-wrap .syn-keyword {color:#c7a0ff;font-weight:600}
.code-wrap .syn-string {color:#b1e1a2}
.code-wrap .syn-comment {color:#92a4b6;font-style:italic}
.code-wrap .syn-number {color:#ffcb8b}
