:root {
  --bg: #0b080a; --bg2: #120e11; --bg3: #1a1418; --line: #2a2227;
  --text: #ece6e9; --muted: #9a8f94; --brand: #a88194; --brand-ink: #24121b;
  --ok: #35c177; --warn: #f9ad26; --bad: #e5534b;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); }
h1, h2, h3 { margin: 0; font-weight: 600; } h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }

.btn { background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--bg3); }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #c79ab0, #7d5568); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 28px; margin: 0 auto 8px; }

.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card input, .composer textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; }
.login-card input:focus, .composer textarea:focus { border-color: var(--brand); }
.err { color: var(--bad); min-height: 1.2em; margin: 0; font-size: 13px; }

.app { display: grid; grid-template-columns: 260px 1fr; height: 100dvh; }
.app.with-stand { grid-template-columns: 260px 1fr 320px; }
.sidebar { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px; gap: 10px; min-height: 0; }
.side-head { display: flex; gap: 10px; align-items: center; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-item { text-align: left; background: none; border: 0; color: var(--text); padding: 9px 10px; border-radius: 10px; cursor: pointer; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item:hover { background: var(--bg3); } .chat-item.active { background: var(--bg3); box-shadow: inset 2px 0 var(--brand); }
.chat-item .dot { color: var(--ok); }
.side-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { flex: 1 1 40%; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--brand); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.top-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menu { display: none; }
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.messages { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: min(760px, 92%); padding: 10px 14px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.msg.mira { align-self: flex-start; background: var(--bg3); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.mira.err { border-color: var(--bad); }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg code { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 5px; }
.msg.user code { background: rgba(0,0,0,.15); }
.msg pre { background: #070506; border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; margin: 6px 0; }
.msg pre code { background: none; padding: 0; }
.msg blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--brand); color: var(--muted); }
.msg a { color: var(--brand); } .msg.user a { color: var(--brand-ink); }
.msg h4 { margin: 8px 0 4px; font-size: 15px; }
.meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.files-in-msg { font-size: 12px; margin-top: 6px; opacity: .85; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.opts .btn { font-size: 14px; }
.opts.done .btn { opacity: .45; pointer-events: none; }
.live { align-self: flex-start; background: var(--bg2); border: 1px dashed var(--line); border-radius: 14px; padding: 8px 12px; color: var(--muted); font-size: 13px; max-width: min(760px, 92%); }
.live .tools { font-family: var(--mono); font-size: 12px; display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.live .status { color: var(--text); }
.approval { align-self: flex-start; background: var(--bg3); border: 1px solid var(--warn); border-radius: 14px; padding: 10px 14px; max-width: min(760px, 92%); }
.approval pre { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; margin: 6px 0; }
.approval .row { display: flex; gap: 8px; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg2); }
.composer textarea { flex: 1; resize: none; max-height: 200px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; background: var(--bg2); }
.chip { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; margin-top: 8px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.dropzone { position: absolute; inset: 0; background: rgba(168,129,148,.15); border: 2px dashed var(--brand); display: grid; place-items: center; font-size: 20px; z-index: 5; pointer-events: none; }

.files-head { display: flex; justify-content: space-between; align-items: center; padding: 14px; }
.files { flex: 1; overflow-y: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.file .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; color: var(--muted); }
.file a, .file button { color: var(--brand); background: none; border: 0; cursor: pointer; font: inherit; text-decoration: none; }
.preview { position: absolute; inset: 0; background: rgba(5,5,5,.94); z-index: 10; padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.preview img, .preview video { max-width: 100%; max-height: 80dvh; border-radius: 10px; }
.preview pre { width: 100%; background: #070506; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

.stand { background: var(--bg2); border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; min-height: 0; }
.stand-head { display: flex; justify-content: space-between; }
.stand pre { font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 0; max-height: 40vh; overflow: auto; }

@media (max-width: 860px) {
  .app, .app.with-stand { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 82%; max-width: 300px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
  .stand { position: fixed; inset: 0 0 0 auto; width: 88%; max-width: 360px; z-index: 20; }
  #menu { display: block; }
}

.vtools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.vinput { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 13px; outline: none; }
.vinput:focus { border-color: var(--brand); }
.vcount { padding: 0 14px 8px; }
.vgrid { flex: 1; overflow-y: auto; padding: 0 14px 14px; }
.vg { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; grid-auto-rows: max-content; }
.vcard { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; display: block; min-height: 140px; }
.vcard:hover { border-color: var(--brand); }
.vthumb { height: 0; padding-top: 177.78%; background: #070506 center/cover no-repeat; position: relative; }
.vthumb.wide { padding-top: 56.25%; }
.vthumb .play { position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; display: grid; place-items: center; font-size: 12px; color: #fff; background: rgba(0,0,0,.6); border-radius: 50%; padding-left: 2px; box-sizing: border-box; }
@media (hover: hover) { .vthumb .play { opacity: 0; transition: opacity .15s; } .vcard:hover .play { opacity: 1; } }
.vthumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.vthumb .star { position: absolute; left: 6px; top: 6px; font-size: 16px; }
.vinfo { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.vinfo strong { font-size: 13px; line-height: 1.3; }
.vplay { width: min(960px, 100%); display: flex; flex-direction: column; gap: 10px; }
.vplay video { width: 100%; max-height: 70dvh; background: #000; border-radius: 10px; }
.vbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vplay textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; min-height: 60px; }
.vplay .cap { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.stars button { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 2px; }
.stars button.on { color: var(--warn); }
.settings { flex: 1; overflow-y: auto; padding: 0 14px 20px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.srow label { flex: 1; }
.srow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }
body.light { --bg:#f6f2f4; --bg2:#fff; --bg3:#ede6ea; --line:#d8cdd3; --text:#1f1519; --muted:#6f6269; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.navbtn { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; color: var(--muted); padding: 9px 10px; border-radius: 10px; font: inherit; cursor: pointer; }
.navbtn span { width: 22px; text-align: center; }
.navbtn:hover { background: var(--bg3); color: var(--text); }
.navbtn.active { background: var(--bg3); color: var(--text); box-shadow: inset 2px 0 var(--brand); }
.badge-n { margin-left: auto; background: var(--ok); color: #04170d; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.side-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-top: 1px solid var(--line); padding-top: 8px; }
.agent-sel { max-width: 120px; }
.tasks { flex: 1; overflow-y: auto; padding: 0 14px 20px; display: flex; flex-direction: column; gap: 8px; max-width: 980px; }
.tarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; resize: vertical; outline: none; }
.tlist { display: flex; flex-direction: column; gap: 8px; }
.task { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.task.run { border-color: var(--ok); }
.task.wait { border-color: var(--warn); }
.task .trow { display: flex; gap: 10px; align-items: center; }
.task .trow strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .tstat { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pl 1.2s infinite; flex: none; }
@keyframes pl { 50% { opacity: .25; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip2 { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; background: var(--bg3); }
.chip2.run { border-color: var(--ok); color: var(--ok); }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.agcard { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.agcard p { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1; }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* Erweiterung: Übersicht, Gedächtnis, Palette */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: linear-gradient(160deg, var(--bg2), var(--bg3)); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: default; }
.kpi.link { cursor: pointer; } .kpi.link:hover { border-color: var(--brand); }
.kpi .v { font-size: 26px; font-weight: 600; line-height: 1.1; } .kpi .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bar { height: 6px; background: var(--bg); border-radius: 4px; margin-top: 8px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--brand); } .bar i.hot { background: var(--bad); } .bar i.warm { background: var(--warn); }
.svcs { display: flex; flex-wrap: wrap; gap: 8px; }
.svc { display: flex; gap: 8px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.svc .d { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); } .svc.off .d { background: var(--bad); } .svc.off { border-color: var(--bad); }
.svc button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0 8px; font-size: 12px; cursor: pointer; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.bcard { background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.bcard.done { border-left-color: var(--ok); opacity: .75; }
.bcard strong { font-size: 13.5px; } .bcard .bt { color: var(--muted); max-height: 7.5em; overflow: hidden; overflow-wrap: anywhere; }
.pre-box { white-space: pre-wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 12px; margin: 0; }
.mem-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr; gap: 12px; padding: 0 14px 14px; }
.mem-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.mem-item { text-align: left; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; color: var(--text); cursor: pointer; font: inherit; }
.mem-item:hover, .mem-item.active { border-color: var(--brand); } .mem-item small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-view { overflow-y: auto; max-width: none; align-self: stretch; }
.palette { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; justify-content: center; padding-top: 12vh; }
.pal-box { width: min(620px, 94%); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-self: flex-start; max-height: 70vh; }
.pal-box input { width: 100%; font-size: 16px; }
.pal-res { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pal-item { text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; display: flex; gap: 10px; }
.pal-item:hover, .pal-item.sel { background: var(--bg3); } .pal-item small { color: var(--muted); display: block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--brand); border-radius: 12px; padding: 10px 16px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90%; }
.msg .copy { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; margin-top: 6px; opacity: 0; } .msg:hover .copy { opacity: 1; }
@media (max-width: 860px) { .mem-wrap { grid-template-columns: 1fr; grid-template-rows: 200px 1fr; } .msg .copy { opacity: .7; } }

.msg.qmsg { opacity: .65; border: 1px dashed var(--brand-ink); }
body.light { color-scheme: light; }

.opts .btn.chosen { opacity: 1 !important; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.opts .btn.chosen::before { content: "✓ "; }
.opts.done .btn:not(.chosen) { opacity: .35; }
.opts .btn.ghost { background: transparent; border-style: dashed; color: var(--muted); }
.opts.done .btn.ghost { display: none; }
.opts.fb .btn { border-style: dashed; }
.opts kbd { font: 11px var(--mono); background: rgba(0,0,0,.35); border-radius: 4px; padding: 0 5px; margin-right: 6px; color: var(--muted); }
.optsel { max-width: 100%; font-size: 14px; }
@media (max-width: 860px) { .opts kbd { display: none; } }

.grow { flex: 1; min-width: 160px; }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 14px 0; background: var(--bg2); scrollbar-width: none; }
.quick button { flex: none; background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.quick button:hover { border-color: var(--brand); }
#chat-filter { width: 100%; }
.chat-item .pin { float: right; opacity: 0; color: var(--muted); } .chat-item:hover .pin { opacity: 1; } .chat-item .pin.on { opacity: 1; color: var(--warn); }
#mic.rec { color: var(--bad); animation: pl 1s infinite; }
.svc .rs { color: var(--warn); }
.tarea.big { min-height: 120px; font-family: var(--mono); font-size: 12.5px; }

#model-sel { max-width: 150px; }

/* Mobil (2026-11-10) */
html, body { overflow-x: hidden; overscroll-behavior: none; }
body { -webkit-text-size-adjust: 100%; }
.msg table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.msg td, .msg th { border: 1px solid var(--line); padding: 4px 8px; }
.msg img, .msg video { max-width: 100%; height: auto; }
@media (max-width: 860px) {
  .top { padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left)); gap: 6px; }
  .top .icon-btn, .composer .icon-btn, #menu { min-width: 44px; min-height: 44px; font-size: 20px; display: inline-grid; place-items: center; }
  #export, #rename { display: none; }
  .sidebar { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); width: 86%; }
  .stand { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
  .stand:not(.hidden)::before { content: "✕"; position: sticky; top: 0; float: right; z-index: 2; }
  .navbtn, .chat-item, .tab, .mem-item, .pal-item { min-height: 44px; }
  .btn, .vinput, .quick button { min-height: 44px; }
  .btn.small { min-height: 36px; }
  input, select, textarea, .vinput, .tarea, .composer textarea, .login-card input { font-size: 16px !important; }
  .messages { padding: 12px calc(10px + env(safe-area-inset-right)) 12px calc(10px + env(safe-area-inset-left)); }
  .msg, .live, .approval { max-width: 94%; }
  .msg pre, .approval pre { max-width: 100%; overflow-x: auto; }
  .opts { gap: 8px; }
  .opts .btn { flex: 1 1 calc(50% - 8px); min-height: 48px; white-space: normal; text-align: center; font-size: 15px; }
  .optsel { width: 100%; min-height: 48px; }
  .composer { flex-wrap: wrap; padding: 8px calc(10px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); gap: 6px; }
  .composer textarea { flex: 1 1 100%; order: -1; min-height: 44px; max-height: 38dvh; }
  #model-sel, #agent-sel { flex: 1 1 0; min-width: 0; }
  #send { min-height: 44px; min-width: 96px; margin-left: auto; font-size: 16px; }
  #stop { min-height: 44px; }
  .attach-list, .quick { padding-left: calc(10px + env(safe-area-inset-left)); }
  .files-head { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .vtools { justify-content: flex-start; width: 100%; }
  .vtools .vinput { flex: 1 1 120px; }
  .vgrid { padding: 0 10px 14px; } .vg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tasks, .files, .settings { padding-left: 10px; padding-right: 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board, .agrid { grid-template-columns: 1fr; }
  .file { flex-wrap: wrap; }
  .file a, .file button { min-height: 40px; padding: 0 6px; }
  .srow { min-height: 48px; }
  .srow input[type=checkbox] { width: 26px; height: 26px; }
  /* Vollbild-Sheets */
  .preview { position: fixed; inset: 0; z-index: 40; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
  .pal-box { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; align-self: stretch; padding-top: calc(10px + env(safe-area-inset-top)); }
  .palette { padding-top: 0; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .login-card { padding: 22px; }
}

/* Dokument-Ansicht (Markdown/CSV/JSON) */
.doc { overflow-wrap: anywhere; line-height: 1.5; }
.doc h2, .doc h3, .doc h4, .doc h5 { margin: 1.1em 0 .4em; }
.doc ul { padding-left: 1.2em; }
.doc code { background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.doc pre { overflow-x: auto; background: var(--bg2); padding: 10px; border-radius: 8px; white-space: pre-wrap; }
.doc .tablewrap { overflow-x: auto; margin: .6em 0; }
.doc table { border-collapse: collapse; font-size: .92em; min-width: 100%; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg2); position: sticky; top: 0; }
.doc th, .doc td { min-width: 84px; } .doc th { white-space: nowrap; }

/* Upload: Eingabe unsichtbar aber vorhanden (Label öffnet sie nativ, auch am Handy) */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
#attach { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.composer .icon-btn.hidden { display: none; }

/* Live-Anzeige: verständliche Schritte statt roher Befehle */
.live { border-style: solid; border-color: var(--brand); background: var(--bg2); padding: 12px 14px; font-size: 14px; }
.live-head { display: flex; align-items: center; gap: 10px; }
.live .status { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.live-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: miraspin .9s linear infinite; flex: none; }
@keyframes miraspin { to { transform: rotate(360deg); } }
.live-note { margin-top: 8px; padding: 6px 10px; border-left: 3px solid var(--brand); color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.live .tools { font-family: inherit; font-size: 13px; gap: 4px; margin-top: 10px; }
.live .step { display: flex; align-items: baseline; gap: 8px; color: var(--text); padding: 2px 0; }
.live .step.done { color: var(--muted); }
.live .step.done .ic::after { content: " ✓"; color: #4caf7d; font-size: 11px; }
.live .step.sub { padding-left: 22px; font-size: 12px; }
.live .step .de { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.live .step .tx { flex: none; max-width: 70%; overflow-wrap: anywhere; }
@media (max-width: 860px) { .live .step { flex-wrap: wrap; } .live .step .de { white-space: normal; flex-basis: 100%; padding-left: 26px; } }

/* Verbrauch */
.ulimits { display: grid; gap: 12px; }
.ulimit { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ulimit-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ubar { height: 12px; background: var(--bg3); border-radius: 8px; overflow: hidden; }
.ufill { height: 100%; background: var(--brand); border-radius: 8px; transition: width .4s; }
.ufill.warn { background: #d9a441; } .ufill.crit { background: #d65a5a; }
.udays { display: flex; align-items: flex-end; gap: 6px; height: 150px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px 8px; }
.uday { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.uday-bar { width: 100%; max-width: 26px; background: var(--brand); border-radius: 5px 5px 0 0; min-height: 2px; }
.uday-v { font-size: 10px; color: var(--muted); } .uday-l { font-size: 10px; color: var(--muted); }
.ulist { display: grid; gap: 6px; }
.urow { display: flex; justify-content: space-between; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.urow span { min-width: 0; overflow-wrap: anywhere; }

.warnbox{background:#3a2a10;border:1px solid #e0a030;color:#ffd48a;border-radius:10px;padding:10px 14px;margin-bottom:12px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.warnbox.hidden{display:none}

.vbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.vbadge { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.vbadge.type { background: rgba(168,129,148,.18); border-color: var(--brand); color: #e9d3df; }
.vbadge.ok { border-color: #3d8f5f; color: #7fd1a1; }
.vbadge.bad { border-color: #b04a4a; color: #e58a8a; }
.vlabel { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--brand); }
.vhook { font-size: 12px; color: var(--text); opacity: .8; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .vgrid { padding: 0 8px 14px; } .vg { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* Videos: Tagesgruppen, Einschätzung, Werkzeugleiste */
.vday { margin-bottom: 10px; }
.vday-h { display: flex; align-items: baseline; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text); font: inherit; padding: 8px 2px; cursor: pointer; text-align: left; position: sticky; top: 0; z-index: 2; background: var(--bg); }
.vday-h:hover strong { color: var(--brand); }
.vday-h .ar { color: var(--brand); width: 14px; }
.vday .vg { margin-top: 10px; }
.vday.closed .vg { display: none; }
.vbadge.as-stark { border-color: #3d8f5f; color: #7fd1a1; background: rgba(53,193,119,.12); }
.vbadge.as-solide { border-color: #b8862b; color: #f0c46a; background: rgba(249,173,38,.10); }
.vbadge.as-schwach { border-color: #8a4a4a; color: #d09494; background: rgba(229,83,75,.08); }
.vassess { display: flex; flex-direction: column; gap: 6px; white-space: normal !important; }
.vass-h { display: flex; align-items: center; gap: 10px; }
.vassess p { margin: 0; }
.vassess ul { margin: 0; padding-left: 18px; }
.vass-t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.vass-t.plus { color: #7fd1a1; } .vass-t.minus { color: #d09494; }
.vgroup { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.vgroup input { accent-color: var(--brand); }
@media (max-width: 860px) {
  .files-head h2 { flex: 1 1 auto; }
  .vtools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; order: 3; width: 100%; }
  .vtools .vs, .vtools .vt { min-width: 0; width: 100%; }
  .vtools #v-filter, .vtools #v-sort { min-width: 0; width: 100%; }
  .vtools .vgroup { grid-column: 1 / 2; min-height: 36px; font-size: 12px; }
  .vtools .vnew { grid-column: 2 / 3; min-height: 36px; padding: 4px 10px; font-size: 13px; }
  .vtools .vinput { min-height: 40px; }
}

/* ===== Handy-Umbau 2026-11-11: Tab-Leiste, Sheet, Composer, Stand/Freigaben/Berichte ===== */
.side-close { display: none; margin-left: auto; }
.badge-n.warn, .tbadge.warn { background: var(--warn); color: #2a1a02; }
.tabbar { display: none; }
.sheet { position: fixed; inset: 0; z-index: 45; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg2); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; animation: sheetin .18s ease-out; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
@keyframes sheetin { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--bg3); border: 1px solid var(--line); border-radius: 14px; color: var(--text); font: inherit; font-size: 12px; padding: 10px 4px 8px; min-height: 68px; cursor: pointer; }
.sheet-item span { font-size: 22px; line-height: 1; }
.sheet-item:hover { border-color: var(--brand); }
.sheet-item .tbadge { position: absolute; top: 6px; right: 8px; }
.tbadge { background: var(--ok); color: #04170d; border-radius: 999px; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 5px; font-weight: 700; text-align: center; font-style: normal; }

/* Composer: Textfeld oben, Werkzeuge darunter (auch Desktop) */
.composer { flex-direction: column; align-items: stretch; gap: 6px; }
.composer textarea { width: 100%; min-height: 44px; max-height: 40dvh; font-size: 15px; }
.ctools { display: flex; align-items: center; gap: 6px; }
.ctools .agent-sel { max-width: 130px; }
.ctools #send { margin-left: auto; min-width: 92px; }
.scroll-down { position: absolute; right: 14px; bottom: 150px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg3); color: var(--text); font-size: 18px; cursor: pointer; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.scroll-down:hover { border-color: var(--brand); }
.quick button.qa { border-color: rgba(168,129,148,.55); background: rgba(168,129,148,.12); }

/* Feedback-Knöpfe an Mira-Antworten */
.mtools { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.msg .copy { margin-top: 0; }
.fb { display: inline-flex; gap: 2px; opacity: .55; }
.msg:hover .fb { opacity: 1; }
.fb button { background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 14px; padding: 2px 6px; color: var(--muted); filter: grayscale(1); }
.fb button:hover, .fb button.on { filter: none; border-color: var(--line); background: var(--bg2); }
.fb button.on { border-color: var(--brand); }

/* Stand / Freigaben / Berichte */
.task.ok { border-color: var(--line); }
.task.bad { border-color: var(--bad); }
.task.warn { border-color: var(--warn); }
.task.auf { border-left: 3px solid var(--warn); }
.task.auf.ok { border-left-color: var(--ok); opacity: .7; }
.task .trow.wrap { flex-wrap: wrap; }
.task .tnext { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.task details summary { cursor: pointer; }
.task .pre-box { margin-top: 6px; max-height: 160px; overflow: auto; }
.btn.ghost { background: transparent; border-style: dashed; color: var(--muted); }
.details summary { cursor: pointer; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 14px; text-align: center; color: var(--text); }
.empty .big { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.file.report { cursor: pointer; }
.file.report:hover { border-color: var(--brand); }
.file.report .name strong { display: block; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.file.report a { font-size: 18px; }
.badge.k-md { border-color: var(--brand); color: #e9d3df; }
.badge.k-csv, .badge.k-json { border-color: #3d8f5f; color: #7fd1a1; }
.badge.k-image, .badge.k-video { border-color: #b8862b; color: #f0c46a; }
.ok-line { color: #7fd1a1; }
#rp-search { max-width: 220px; }
.files-head .btn { min-width: 44px; }

/* Desktop: Tab-Leiste und Sheet nur am Handy */
@media (min-width: 861px) { .sheet { display: none !important; } }

@media (max-width: 860px) {
  .side-close { display: inline-grid; }
  .app { height: 100dvh; }
  .main { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .top { padding: calc(6px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right)) 6px calc(6px + env(safe-area-inset-left)); gap: 4px; min-height: 52px; }
  .top .avatar { width: 30px; height: 30px; font-size: 13px; }
  .top-title strong { font-size: 15px; }
  #stand-toggle, #export, #rename { display: none; }
  body:not(.in-chat) #delete, body:not(.in-chat) #menu { display: none; }
  body:not(.in-chat) .top .avatar { display: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(18,14,17,.96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 4px 0 env(safe-area-inset-bottom); }
  .tabbtn { position: relative; background: none; border: 0; color: var(--muted); font: inherit; font-size: 10.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 4px; min-height: 50px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbtn .ti { font-size: 21px; line-height: 1; filter: grayscale(1) brightness(1.1); }
  .tabbtn.active { color: var(--text); } .tabbtn.active .ti { filter: none; }
  .tabbtn.active::after { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 2px; background: var(--brand); }
  .tabbtn .tbadge { position: absolute; top: 2px; left: calc(50% + 6px); }
  body.light .tabbar { background: rgba(255,255,255,.94); }
  .sidebar { padding-top: calc(12px + env(safe-area-inset-top)); }
  .sidebar.open { box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
  /* Chat-Composer über der Tab-Leiste */
  .composer { padding: 6px calc(8px + env(safe-area-inset-right)) 8px calc(8px + env(safe-area-inset-left)); gap: 6px; }
  .composer textarea { order: 0; flex: none; min-height: 44px; max-height: 40dvh; font-size: 16px !important; }
  .ctools { gap: 4px; }
  .ctools .icon-btn { min-width: 44px; min-height: 44px; }
  .ctools .agent-sel { flex: 1 1 0; min-width: 0; max-width: 120px; font-size: 14px !important; padding: 6px 6px; min-height: 44px; }
  #send { min-width: 84px; min-height: 44px; margin-left: auto; font-size: 15px; padding: 8px 12px; }
  .quick { padding: 6px calc(8px + env(safe-area-inset-left)) 0; gap: 6px; }
  .quick button { min-height: 38px; font-size: 13px; padding: 4px 12px; }
  .scroll-down { bottom: 12px; right: 12px; position: fixed; bottom: calc(170px + env(safe-area-inset-bottom)); }
  .messages { padding-bottom: 8px; }
  .fb { opacity: .85; }
  /* Listen-Ansichten: Platz nach unten für die Tab-Leiste */
  .tasks, .files, .settings, .vgrid, .mem-wrap { padding-bottom: 20px; }
  .files-head { padding: 8px 10px; gap: 6px; }
  .files-head h2 { font-size: 17px; }
  #rp-search { max-width: none; flex: 1 1 120px; min-width: 0; }
  /* Videos: Suche + Typ in einer Zeile, Rest kompakt */
  .vtools { grid-template-columns: 1fr 1fr; gap: 6px; }
  .vtools .vs { grid-column: 1 / 2; } .vtools .vt { grid-column: 2 / 3; }
  .vtools .vinput { min-height: 40px; font-size: 14px !important; padding: 4px 8px; }
  .vtools .vgroup { min-height: 32px; }
  .vtools .vnew { min-height: 34px; }
  .vcount { padding: 0 10px 6px; }
  .vthumb .play { display: none; }
  .vinfo { padding: 6px 8px; }
  .vinfo strong { font-size: 12.5px; }
  .vbadge { font-size: 10px; }
  .preview { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .vplay .vbar .btn { min-height: 40px; padding: 6px 10px; font-size: 13px; }
  .stars button { font-size: 24px; min-width: 32px; }
  .sheet-grid { grid-template-columns: repeat(4, 1fr); }
  body.sheet-open .tabbar { z-index: 46; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .dropzone { display: none; }
  .msg { max-width: 92%; padding: 9px 12px; }
  .login-card input { font-size: 16px !important; }
}
@media (max-width: 400px) { .sheet-grid { grid-template-columns: repeat(4, 1fr); } .sheet-item { font-size: 11px; } .tabbtn { font-size: 10px; } }
@media (max-width: 860px) {
  .ctools .agent-sel { flex: 1 1 56px; max-width: 110px; font-size: 13px !important; padding: 6px 4px; }
  #send { min-width: 72px; padding: 8px 10px; font-size: 14px; }
  #stop { padding: 8px 10px; font-size: 14px; min-width: 0; }
  .file .name { flex: 1 1 60%; min-width: 55%; }
  .sidebar.open ~ .main .scroll-down { display: none; }
}
/* Composer-Werkzeugzeile darf nie breiter als das Eingabefeld werden */
.ctools { width: 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; }
.ctools #model-sel, .ctools #agent-sel { flex: 1 1 0; width: 0; min-width: 0; }
@media (max-width: 860px) {
  .ctools #model-sel, .ctools #agent-sel { max-width: 104px; }
  .ctools #send { min-width: 68px; }
}

/* Seitenleiste (2026-11-11): Unterhaltungen wurden gequetscht/abgeschnitten */
.sidebar { overflow: hidden; }
.side-head, .side-nav, .side-label, #chat-filter, .side-foot { flex: none; }
.side-nav { gap: 1px; }
.navbtn { padding: 6px 10px; min-height: 34px; font-size: 14px; }
.navbtn span { font-size: 15px; }
.chat-list { flex: 1 1 160px; min-height: 160px; gap: 1px; padding-right: 2px; }
.chat-item { flex: none; min-height: 34px; line-height: 1.3; display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.chat-item .pin { margin-left: auto; float: none; }
.side-nav-more-sep { height: 1px; background: var(--line); margin: 4px 6px; }
@media (max-height: 800px) { .side-head { display: none; } .navbtn { min-height: 32px; padding: 5px 10px; } }
@media (max-width: 860px) { .navbtn { min-height: 44px; } .chat-item { min-height: 44px; } }

/* Menü einklappbar */
.navtoggle { flex: none; display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; cursor: pointer; border-radius: 8px; }
.navtoggle:hover { background: var(--bg3); color: var(--text); }
.side-nav.collapsed { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.side-nav.collapsed .navbtn { font-size: 0; justify-content: center; padding: 0; min-height: 40px; position: relative; gap: 0; }
.side-nav.collapsed .navbtn span:first-child { font-size: 18px; width: auto; }
.side-nav.collapsed .navbtn .badge-n { position: absolute; top: 2px; right: 2px; font-size: 10px; margin: 0; }
.side-nav.collapsed .navbtn.active { box-shadow: inset 0 -2px var(--brand); }

/* ---------- 360-Studio ---------- */
.s3 .ok { color: var(--ok); } .s3 .warn { color: var(--warn); } .s3 .err { min-height: 0; }
.badge.k-bad { border-color: var(--bad); color: var(--bad); }
.s3clip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.s3clip.active { border-color: var(--brand); }
.s3clip .name { flex: 1 1 220px; min-width: 0; word-break: break-word; }
.s3act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.s3fov { width: 74px; }
.s3bar { width: 140px; margin-top: 0; }
.s3uplist { display: flex; flex-direction: column; gap: 8px; }
.s3up { padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.s3player { display: grid; grid-template-columns: minmax(220px, 420px) 1fr; gap: 14px; align-items: start; }
.s3stage { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none; cursor: grab; width: 100%; aspect-ratio: 9 / 16; max-height: 72vh; user-select: none; }
.s3stage[data-ar="16:9"] { aspect-ratio: 16 / 9; } .s3stage[data-ar="1:1"] { aspect-ratio: 1 / 1; }
.s3stage.drag { cursor: grabbing; }
.s3stage img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.s3msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; background: rgba(11, 8, 10, .75); }
.s3msg:empty { display: none; }
.s3ctl { display: flex; flex-direction: column; gap: 8px; }
.s3f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.s3f.wide { grid-column: 1 / -1; }
.s3f input[type=range] { width: 100%; accent-color: var(--brand); }
.s3f b { color: var(--text); font-weight: 500; font-family: var(--mono); }
.s3grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; align-items: end; }
.s3kf { grid-template-columns: auto repeat(3, minmax(70px, 1fr)); }
.s3kl { align-self: center; }
.s3scenes { display: flex; flex-direction: column; gap: 10px; }
.s3scene { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.s3scene.active { border-color: var(--brand); }
.s3head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.s3tools { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.s3tools .btn { padding: 4px 8px; font-size: 12px; }
.s3plan { display: flex; flex-direction: column; gap: 4px; }
.s3n { width: 70px; }
.s3job { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.s3job.error { border-color: var(--bad); } .s3job.done { border-color: #3d8f5f; }
.s3video { width: 100%; max-width: 420px; max-height: 60vh; border-radius: 10px; background: #000; }
.s3path { font-weight: 500; word-break: break-word; font-family: var(--mono); font-size: 12px; }
.s3q { flex: 1 1 200px; max-width: 360px; }
.s3browse { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.s3dirs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 240px; overflow: auto; }
.s3grp { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.s3grp > summary { cursor: pointer; padding: 10px; font-weight: 500; list-style-position: inside; }
.s3grp .s3rows { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.s3clip.done { opacity: .6; }
.s3clip.tiny .name strong { color: var(--muted); }
@media (max-width: 860px) {
  .s3player { grid-template-columns: 1fr; }
  .s3stage { max-height: 60vh; margin: 0 auto; }
  .s3kf { grid-template-columns: repeat(3, 1fr); } .s3kl { grid-column: 1 / -1; }
  .s3bar { width: 100px; }
}

/* Dateien im Chat */
.fgrid { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; }
.fcard { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 100%; }
.fcard img, .fcard video { display: block; max-width: 100%; max-height: 460px; margin: 0 auto; background: #000; }
.fcard audio { width: 100%; display: block; padding: 6px; box-sizing: border-box; }
.fbar { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13px; background: var(--bg2); }
.fbar .fname { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.fbar a.fdl, .fbar button.fcopy { color: var(--brand); background: none; border: 0; font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.fcard .fbody { padding: 8px 12px; overflow-x: auto; font-size: 13px; }
.fcard .fbody pre { margin: 0; white-space: pre; font-family: var(--mono); font-size: 12.5px; }
.fcard .fbody.collapsed { max-height: 300px; overflow-y: hidden; position: relative; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.fcard .fmore { display: block; width: 100%; background: var(--bg2); border: 0; border-top: 1px solid var(--line); color: var(--brand); padding: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.msg.user .fgrid { align-items: flex-end; }
.msg.user .fcard { max-width: min(420px, 100%); }
@media (max-width: 860px) { .fbar { flex-wrap: wrap; } .fcard img, .fcard video { max-height: 60dvh; } }

/* KI-Auto-Schnitt */
.s3asel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.s3achip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 12px; max-width: 100%; }
.s3achip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.s3achip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 6px; }
.s3achip button:hover { color: var(--text); }
.s3aprog { display: flex; flex-direction: column; gap: 8px; }
.s3aprog:empty { display: none; }
.s3phases { display: flex; flex-wrap: wrap; gap: 6px; }
.s3ph { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--bg); }
.s3ph.on { border-color: var(--brand); color: var(--text); }
.s3ph.done { border-color: #3d8f5f; color: var(--ok); }
.s3ph.bad { border-color: var(--bad); color: var(--bad); }
.s3ares { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.s3ares.error { border-color: var(--bad); } .s3ares.done { border-color: #3d8f5f; }
.s3ares details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.s3ares .why { margin: 6px 0 0; white-space: pre-wrap; font-size: 13px; }
@media (max-width: 720px) { .s3achip span { max-width: 150px; } .s3ares .vbar .btn { flex: 1 1 140px; text-align: center; } }

.s3chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s3chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit; }
.s3chip:hover { border-color: var(--brand, #a88194); }
.s3chip.on { background: var(--brand, #a88194); border-color: var(--brand, #a88194); color: #fff; }
.s3proto { font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.s3proto h4 { margin: 8px 0 2px; font-size: 13px; }
.s3proto table { border-collapse: collapse; width: 100%; }
.s3proto td, .s3proto th { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; }
.s3proto .mono { font-family: "JetBrains Mono", monospace; }
@media (max-width: 720px) { .s3chip { flex: 1 1 calc(50% - 6px); text-align: center; } .s3proto td, .s3proto th { padding: 3px 3px; } }
