:root{--bg:#f5f1ea;--ink:#2b2420;--muted:#7a6f64;--line:#e3d9ca;--wine:#7a2e3a;--wine2:#9c3b4a;--gold:#b08400;--green:#2f7d4f;--card:#fff;--blue:#2f5e8a}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:system-ui,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink);height:100vh;overflow:hidden}
.muted{color:var(--muted)} .small{font-size:.82rem}
.btn{display:inline-block;background:var(--wine);color:#fff;border:0;border-radius:8px;padding:.45rem .8rem;font-size:.85rem;font-weight:600;cursor:pointer;text-decoration:none}
.btn:hover{background:var(--wine2)} .btn.ghost{background:transparent;color:var(--wine);border:1px solid var(--wine)}
.btn.sm{padding:.3rem .6rem;font-size:.8rem}
.err{background:#fdecea;color:#c0392b;border:1px solid #f5c6c2;border-radius:8px;padding:.5rem .7rem;margin-bottom:.6rem;font-size:.85rem}
/* login */
.loginbg{display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#5e2230,#7a2e3a)}
.logincard{background:#fff;border-radius:16px;padding:2rem;width:340px;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.logincard h1{font-size:1.3rem;color:var(--wine)} .logincard label{display:block;font-weight:600;font-size:.85rem;margin:.7rem 0 0}
.logincard input{width:100%;margin-top:.25rem;padding:.6rem;border:1px solid var(--line);border-radius:8px;font-size:1rem}
.logincard button{width:100%;margin-top:1rem;padding:.7rem;border:0;border-radius:8px;background:var(--wine);color:#fff;font-weight:700;cursor:pointer}
.ro-note{margin-top:1rem;font-size:.78rem;color:var(--green);text-align:center}
/* topbar */
.topbar{display:flex;align-items:center;gap:1rem;height:52px;padding:0 1rem;background:#fff;border-bottom:1px solid var(--line)}
.brand{font-weight:800;color:var(--wine)}
.robanner{background:#eef7f0;color:var(--green);border:1px solid #bfe3cd;border-radius:999px;padding:.2rem .8rem;font-size:.78rem;font-weight:700}
.topright{margin-left:auto;display:flex;align-items:center;gap:.7rem;font-size:.85rem}
/* cockpit 3 spalten */
.cockpit{display:grid;grid-template-columns:210px 360px 1fr;height:calc(100vh - 52px)}
.col{overflow-y:auto;border-right:1px solid var(--line)}
.views{padding:.6rem;background:#faf6ef}
.vhead{font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:.3rem .4rem}
.vitem{display:flex;align-items:center;gap:.4rem;padding:.5rem .6rem;border-radius:8px;cursor:pointer;font-size:.92rem;font-weight:600}
.vitem:hover{background:#fff} .vitem.active{background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.06);color:var(--wine)}
.vitem .cnt{color:var(--muted);font-weight:400;font-size:.8rem}
.badge{background:var(--wine);color:#fff;border-radius:999px;font-size:.72rem;padding:0 .45rem;font-weight:800;margin-left:auto}
.vhint{margin:1rem .4rem}
/* liste */
.list{background:#fff}
.msg{padding:.6rem .8rem;border-bottom:1px solid var(--line);cursor:pointer}
.msg:hover{background:#faf6ef} .msg.sel{background:#fbeef0;border-left:3px solid var(--wine)}
.msgtop{display:flex;justify-content:space-between;font-size:.8rem}
.msgfrom{font-weight:700} .msgdate{color:var(--muted)}
.msgsubj{font-size:.9rem;font-weight:600;margin:.1rem 0;color:var(--wine)}
.msgprev{font-size:.8rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ntag{color:var(--blue);font-weight:700}
/* detail */
.detail{background:#faf8f4;padding:1rem 1.2rem}
.dhead{border-bottom:1px solid var(--line);padding-bottom:.6rem;margin-bottom:.6rem}
.dsubj{font-size:1.2rem;font-weight:800;color:var(--wine)}
.dfrom{font-size:.85rem;margin-top:.2rem}
.dbody{white-space:pre-wrap;font-size:.9rem;line-height:1.5;max-height:32vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:10px;padding:.8rem}
.panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:.8rem;margin-top:.8rem}
.ptitle{font-weight:700;font-size:.9rem;margin-bottom:.5rem;display:flex;align-items:center;gap:.5rem}
.aibox{font-size:.88rem}
.chips{display:flex;gap:.4rem;flex-wrap:wrap;margin-bottom:.4rem}
.chip{background:#eaf0f7;color:var(--blue);border-radius:999px;padding:.15rem .6rem;font-size:.78rem;font-weight:700}
.aisum{margin:.3rem 0} .ailbl{margin-top:.4rem}
.aidraft{white-space:pre-wrap;background:#faf6ef;border:1px solid var(--line);border-radius:8px;padding:.6rem;margin-top:.3rem;font-size:.86rem;line-height:1.4}
.assignrow{display:flex;gap:.5rem} .assignrow select{flex:1;padding:.4rem;border:1px solid var(--line);border-radius:8px}
#assignList{margin-top:.4rem}
.notes{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.6rem;max-height:26vh;overflow:auto}
.note{background:#faf6ef;border:1px solid var(--line);border-radius:10px;padding:.5rem .7rem}
.note.mine{background:#eef7f0;border-color:#bfe3cd}
.nmeta{font-size:.78rem;color:var(--muted)} .ntext{font-size:.9rem;margin-top:.15rem;white-space:pre-wrap}
.noterow{display:flex;gap:.5rem} .noterow input{flex:1;padding:.5rem;border:1px solid var(--line);border-radius:8px;font-size:.9rem}
.toast{position:fixed;left:50%;bottom:1.5rem;transform:translateX(-50%) translateY(10px);background:#2b2420;color:#fff;padding:.6rem 1.1rem;border-radius:10px;font-size:.9rem;opacity:0;pointer-events:none;transition:.2s;z-index:50}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:900px){.cockpit{grid-template-columns:1fr;grid-template-rows:auto auto 1fr}.col{max-height:none}.robanner{display:none}}
.search{flex:1;max-width:420px;padding:.45rem .8rem;border:1px solid var(--line);border-radius:8px;font-size:.9rem}
.tcount{background:var(--wine);color:#fff;border-radius:999px;font-size:.7rem;padding:0 .45rem;font-weight:800;vertical-align:middle}
.fold{background:#eee6da;color:#6b5d4d;border-radius:6px;padding:0 .4rem;font-size:.72rem;font-weight:600}
.badge.red{background:#b23b3b}
.thread{display:flex;flex-direction:column;gap:.5rem;max-height:38vh;overflow:auto;padding:.2rem;margin-bottom:.4rem}
.tmsg{border:1px solid var(--line);border-radius:10px;padding:.55rem .7rem;background:#fff}
.tmsg.out{background:#eef7f0;border-color:#bfe3cd;margin-left:1.4rem}
.tmsg.in{margin-right:1.4rem}
.tmeta{font-size:.76rem;color:var(--muted);margin-bottom:.25rem;font-weight:600}
.tbody{white-space:pre-wrap;font-size:.85rem;line-height:1.4;max-height:15vh;overflow:auto}
