:root{--ink:#262328;--muted:#77717a;--paper:#fbfaf8;--panel:#fff;--rose:#a95568;--rose2:#7e3346;--soft:#f4e9ec;--line:#e8e1e3;--ok:#36765b;--shadow:0 12px 34px rgba(65,42,49,.08)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;background:var(--paper);color:var(--ink)}button,input,textarea,select{font:inherit}.app-shell{min-height:100vh;display:grid;grid-template-columns:250px 1fr}.sidebar{position:sticky;top:0;height:100vh;padding:26px 18px;background:#2e2529;color:#fff;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;margin:0 5px 28px}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#dca8b4;color:#482c34;font-family:Georgia,serif;font-size:25px}.brand h1{font:600 22px Georgia,serif;margin:0}.brand p{margin:3px 0 0;color:#cbbfc3;font-size:12px}.primary,.ghost{border:0;border-radius:10px;padding:11px 15px;cursor:pointer;transition:.18s}.primary{background:var(--rose);color:white}.primary:hover{background:var(--rose2)}.ghost{background:#f3eef0;color:#4b4044}.sidebar .ghost{background:#44383d;color:#eee}.full{width:100%}.bottom{margin-top:auto}.customer-list{margin-top:18px;display:flex;flex-direction:column;gap:7px;overflow:auto}.customer-item{width:100%;text-align:left;border:0;border-radius:10px;background:transparent;color:#ddd;padding:11px;cursor:pointer}.customer-item:hover,.customer-item.active{background:#4b3d43;color:#fff}.customer-item strong,.customer-item small{display:block}.customer-item small{color:#bdaeb4;margin-top:4px}.workspace{width:min(1050px,calc(100vw - 250px));padding:30px 38px 50px;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.topbar h2{font:600 28px Georgia,serif;margin:0}.topbar p{color:var(--muted);margin:6px 0 0}.top-actions{display:flex;gap:8px}.top-actions select{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px}.stage-card,.composer,.result-card{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:15px;padding:18px}.stage-head,.result-head{display:flex;justify-content:space-between;color:#5f565b;font-weight:600}.status-pill{font-size:12px;color:var(--rose2);background:var(--soft);padding:4px 9px;border-radius:20px}.steps{display:flex;align-items:center;margin-top:18px}.step{display:flex;align-items:center;gap:8px;min-width:125px}.step b{display:grid;place-items:center;border:1px solid #ccbfc3;color:#8c7c82;border-radius:50%;width:28px;height:28px}.step span{font-size:13px}.step small{display:block;color:var(--muted);margin-top:2px;max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.step.done b{background:var(--ok);border-color:var(--ok);color:#fff}.step.current b{background:var(--rose);border-color:var(--rose);color:#fff}.line{height:1px;flex:1;background:var(--line);margin:0 7px}.history{min-height:230px;max-height:390px;overflow:auto;padding:22px 4px;margin:17px 0}.history.empty{display:grid;place-items:center;color:#aaa}.bubble-row{display:flex;margin:10px 0}.bubble-row.customer{justify-content:flex-start}.bubble-row.olivia{justify-content:flex-end}.bubble{max-width:72%;padding:11px 14px;border-radius:14px;background:#ebe7e8;white-space:pre-wrap;line-height:1.5}.olivia .bubble{background:var(--soft);color:#4c3038}.bubble small{display:block;margin-top:6px;color:#9a8e92;font-size:10px}.composer label{display:block;font-weight:600;margin-bottom:9px}.composer textarea,.result-card textarea{width:100%;resize:vertical;border:1px solid var(--line);border-radius:10px;padding:12px;outline:none;line-height:1.55}.composer textarea:focus,.result-card textarea:focus,input:focus{border-color:#c58292;box-shadow:0 0 0 3px #f7e9ed}.composer-actions,.result-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.shortcut{font-size:12px;color:#aaa;margin-right:auto}.result-card{margin-top:16px;border-color:#dcbac3}.result-head{margin-bottom:10px}.result-head #elapsed{font-size:12px;color:var(--muted)}.stop-notice{padding:13px;background:#fff1f1;color:#983f4d;border-radius:9px}.hidden{display:none!important}dialog{border:0;border-radius:16px;padding:0;box-shadow:0 20px 70px #2c202688}dialog::backdrop{background:#241b1f88}.dialog-body{width:min(440px,85vw);padding:25px}.dialog-body h3{font:600 24px Georgia,serif;margin:0 0 8px}.dialog-body p{color:var(--muted);font-size:13px;line-height:1.5}.dialog-body label{display:block;margin:15px 0;font-size:13px}.dialog-body input{width:100%;margin-top:6px;padding:11px;border:1px solid var(--line);border-radius:9px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:760px){.app-shell{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.customer-list{max-height:150px}.bottom{margin-top:15px}.workspace{width:100%;padding:20px 14px}.topbar{align-items:flex-start;gap:10px}.steps{overflow-x:auto;padding-bottom:8px}.line{min-width:20px}.shortcut{display:none}}

/* Conversation pin/delete controls */
.customer-item{padding:0;display:flex;align-items:center;cursor:default;transition:.18s}
.customer-item.pinned{box-shadow:inset 3px 0 #dca8b4}
.customer-main{min-width:0;flex:1;text-align:left;border:0;background:transparent;color:inherit;padding:11px;cursor:pointer}
.customer-main strong,.customer-main small{display:block}
.pin-badge{display:inline;color:#e6b7c2}
.customer-tools{display:flex;gap:1px;padding-right:6px;opacity:.62;transition:.18s}
.customer-item:hover .customer-tools,.customer-item.active .customer-tools,.customer-item.pinned .customer-tools{opacity:1}
.customer-tools button{width:28px;height:28px;padding:0;border:0;border-radius:7px;background:transparent;color:#d3c4c9;cursor:pointer;font-size:17px}
.customer-tools button:hover{background:#665159;color:#fff}
.customer-tools .delete-btn:hover{background:#874453}
.user-panel{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 2px 8px;padding:9px 10px;border-top:1px solid #4b3d43;color:#d8ccd0;font-size:12px}
.user-panel button{border:0;background:transparent;color:#dca8b4;cursor:pointer;padding:4px}
.admin-users{margin-top:20px;padding-top:16px;border-top:1px solid var(--line)}
.admin-users h4{margin:0}.admin-users .ghost{width:100%}.user-list{margin-top:10px;max-height:100px;overflow:auto;color:var(--muted);font-size:12px}.user-list div{display:flex;justify-content:space-between;padding:5px 2px;border-bottom:1px solid var(--line)}
.auth-dialog .dialog-body{width:min(390px,88vw)}.auth-dialog::backdrop{background:#241b1fee}
.auth-brand{display:flex;align-items:center;gap:12px;margin-bottom:20px}.auth-brand h3{margin:0}.auth-brand p{margin:3px 0 0}.auth-hint{min-height:20px;color:#a14b5d!important}

.dialog-body select{width:100%;margin-top:6px;padding:10px;border:1px solid var(--line);border-radius:9px;background:#fff}
.user-list div{align-items:center;gap:8px}.user-list select{width:auto;min-width:90px;margin:0;padding:5px}
.review-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
.bubble-row.system{justify-content:center}.system .bubble{background:#fff1f1;color:#983f4d;max-width:90%}
