:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:#24304b;background:#f5f7fb;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.hidden{display:none!important}.muted{color:#8290a9}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;color:#7f93bf;text-transform:uppercase}.brand-mark{display:grid;place-items:center;width:47px;height:47px;border-radius:14px;color:white;background:linear-gradient(135deg,#5d79ed,#9a72eb);font-size:23px;font-weight:800;box-shadow:0 8px 22px #536eda40}.brand-mark.small{width:38px;height:38px;border-radius:11px;font-size:19px}.login-screen{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,#e0e9ff 0,transparent 35%),radial-gradient(circle at 80% 80%,#eee4ff 0,transparent 32%),#f6f8fd;padding:20px}.login-card{width:min(420px,100%);padding:42px;background:#fff;border:1px solid #e6eaf5;border-radius:24px;box-shadow:0 28px 65px #354b7b16}.login-card h1{font-size:30px;letter-spacing:-.03em;margin:10px 0 8px}.login-card p{color:#8a96ac;margin-bottom:30px}.login-card .eyebrow{margin-top:25px}.login-card label,.modal label,.profile-content label,.refine label{display:block;color:#63718e;font-size:12px;font-weight:700;margin-bottom:15px}.login-card input,.modal input,.modal select,.modal textarea,.profile-content input,.profile-content select,.profile-content textarea,.refine textarea,.refine select,.composer textarea,.suggestion textarea{display:block;width:100%;margin-top:7px;border:1px solid #dfe5ef;background:#fff;color:#263452;border-radius:10px;outline:none;padding:11px 12px;resize:vertical}.login-card input:focus,.modal input:focus,.modal textarea:focus,.profile-content input:focus,.profile-content textarea:focus,.composer textarea:focus,.suggestion textarea:focus,.refine textarea:focus{border-color:#8a9cef;box-shadow:0 0 0 3px #788df025}.primary,.secondary{border-radius:10px;border:1px solid transparent;padding:10px 15px;font-weight:700;white-space:nowrap}.primary{background:#6076e8;color:white;box-shadow:0 5px 12px #5d73e82d}.primary:hover{background:#5268d8}.secondary{background:#fff;border-color:#dfe5ef;color:#53637d}.secondary:hover{background:#f6f8fc}.wide{width:100%}.text-btn{border:0;background:none;color:#5d73d8;font-weight:700;padding:5px}.icon-btn{border:0;border-radius:9px;width:29px;height:29px;background:#eff2ff;color:#657ce7;font-size:20px;line-height:1}.app{display:flex;min-height:100vh}.sidebar{width:255px;min-width:255px;display:flex;flex-direction:column;background:#fff;border-right:1px solid #e9edf5;height:100vh;position:sticky;top:0}.sidebar-brand{height:94px;padding:25px 22px;display:flex;align-items:center;gap:11px;border-bottom:1px solid #f0f2f7}.sidebar-brand strong,.sidebar-brand small{display:block}.sidebar-brand strong{font-size:16px;letter-spacing:.01em}.sidebar-brand small{font-size:11px;color:#9aa6bb;margin-top:2px}.sidebar-heading{padding:24px 20px 12px;display:flex;justify-content:space-between;align-items:center;color:#7585a0;font-size:12px;font-weight:800}.search{margin:0 17px 12px;width:calc(100% - 34px);background:#f5f7fb;border:1px solid #edf0f6;border-radius:9px;padding:10px 12px;outline:none}.customer-list{flex:1;overflow:auto;padding:0 9px}.customer-item{display:flex;align-items:center;gap:10px;text-align:left;width:100%;border:0;background:transparent;border-radius:10px;padding:10px;margin-bottom:2px;color:#34415e}.customer-item:hover,.customer-item.active{background:#eef2ff}.avatar{width:33px;height:33px;border-radius:10px;background:#e8edff;color:#6b7edb;display:grid;place-items:center;font-weight:800;flex:none}.customer-item strong,.customer-item small{display:block}.customer-item strong{font-size:13px}.customer-item small{font-size:11px;color:#94a0b4;margin-top:2px}.sidebar-footer{border-top:1px solid #eff1f6;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#66758f}.main{flex:1;min-width:0}.topbar{min-height:94px;padding:21px 27px;background:white;border-bottom:1px solid #e9edf5;display:flex;align-items:center;justify-content:space-between;gap:15px}.topbar h2{font-size:21px;margin:4px 0 3px}.topbar .muted{font-size:12px}.top-actions{display:flex;align-items:center;gap:8px}.mode-badge{font-size:11px;border-radius:99px;padding:5px 9px;background:#e9f8ef;color:#31875a;white-space:nowrap}.mode-badge.demo{background:#fff2da;color:#a06d19}.empty-state{min-height:calc(100vh - 94px);display:flex;align-items:center;justify-content:center;flex-direction:column;color:#8d9ab0}.empty-state h3{color:#4d5a72;font-size:20px;margin:12px 0 1px}.empty-icon{display:grid;place-items:center;width:72px;height:72px;border-radius:24px;background:#eaefff;color:#7d8eed;font-size:34px}.work-area{height:calc(100vh - 94px);min-height:560px;display:grid;grid-template-columns:minmax(360px,1.25fr) minmax(330px,1fr) 255px;gap:13px;padding:14px}.pane{background:#fff;border:1px solid #e8edf5;border-radius:15px;min-width:0;display:flex;flex-direction:column;overflow:hidden}.pane-title{height:60px;min-height:60px;border-bottom:1px solid #eef0f6;display:flex;align-items:center;justify-content:space-between;padding:0 18px}.pane-title strong{display:block;font-size:14px}.pane-title small{display:block;color:#9aa6ba;margin-top:2px;font-size:11px}.messages{flex:1;overflow:auto;padding:18px}.message{margin:0 0 15px;max-width:85%;display:flex;flex-direction:column;gap:4px}.message.agent{margin-left:auto;align-items:flex-end}.message .who{font-size:10px;color:#9aa8ba;padding:0 3px}.bubble{padding:10px 12px;border-radius:13px;background:#f1f4fa;white-space:pre-wrap;line-height:1.55;overflow-wrap:anywhere}.agent .bubble{background:#e9edff}.message.selected .bubble{outline:2px solid #8a9cf4}.message.customer{cursor:pointer}.message .source{font-size:10px;color:#b0bbca;padding:0 3px}.composer{padding:14px 16px 16px;border-top:1px solid #edf0f6}.composer label{font-size:12px;font-weight:800;color:#63728c}.composer textarea{min-height:85px;margin-top:8px}.composer-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}.hint{font-size:10px;color:#a1acc0}.assistant-pane{overflow:auto}.assist-empty{margin:auto;padding:22px;text-align:center;color:#98a4b9;max-width:270px}.assist-empty h3{color:#5a6780;font-size:17px}.sparkle{font-size:35px;color:#8094f0}.suggestion{padding:21px}.field-label{font-size:11px;font-weight:800;letter-spacing:.03em;color:#7d8ca5}.field-label.with-space{margin-top:20px}.translation{white-space:pre-wrap;line-height:1.6;color:#40506d;background:#f7f9fd;border:1px solid #eef1f7;padding:12px;border-radius:10px;margin-top:8px}.suggestion textarea{line-height:1.55;min-height:95px}.note{margin-top:15px;padding:10px;border-radius:9px;color:#8b6a22;background:#fff8e8;font-size:12px}.response-actions{display:flex;gap:8px;margin-top:15px}.response-actions button{flex:1}.refine{border-top:1px solid #eef0f6;margin-top:auto;padding:17px}.refine label{margin-bottom:10px}.refine textarea{min-height:55px}.profile-content{padding:17px;overflow:auto}.profile-content label{margin-bottom:16px}.stat-card{background:#f0f3ff;color:#6177d0;border-radius:10px;padding:13px;font-weight:800;margin:5px 0 18px}.owner-info{font-size:11px;color:#99a6b9;margin-top:5px}dialog{border:0;border-radius:17px;padding:0;box-shadow:0 30px 80px #182d5a3b;width:min(520px,calc(100vw - 30px));max-height:calc(100vh - 40px)}dialog::backdrop{background:#17213d7a}.modal{padding:23px;overflow:auto;max-height:calc(100vh - 40px)}.modal h3{margin:0;font-size:20px}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.close-btn{border:0;background:none;color:#8a98ae;font-size:26px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.import-modal{width:100%}#import-dialog{width:min(700px,calc(100vw - 30px))}.tab-row{display:flex;gap:15px;border-bottom:1px solid #e7ebf3;margin:15px 0}.tab{background:none;border:0;border-bottom:2px solid transparent;padding:9px 2px;color:#8b98ac}.tab.active{border-color:#6c80e8;color:#5267d1;font-weight:800}#import-dialog textarea{min-height:130px}.preview{margin-top:20px;border-top:1px solid #edf0f6;padding-top:15px}.preview-head{font-weight:800;margin-bottom:10px}.preview-head small{font-weight:400;color:#9eabc0;margin-left:8px}.preview-row{display:grid;grid-template-columns:110px 1fr;gap:8px;margin-bottom:8px}.preview-row select,.preview-row input{margin:0}.preview #preview-rows{max-height:300px;overflow:auto;margin-bottom:15px}#users-list{margin-bottom:18px}.user-row{padding:9px 0;border-bottom:1px solid #eef0f6;display:flex;justify-content:space-between}.user-row small{color:#9da9bb}#export-dialog .wide+button{margin-top:10px}#toast{position:fixed;left:50%;transform:translateX(-50%);bottom:22px;background:#263451;color:#fff;padding:10px 18px;border-radius:10px;box-shadow:0 10px 30px #13274645;z-index:100;opacity:0;pointer-events:none;transition:opacity .2s;max-width:min(550px,90vw)}#toast.show{opacity:1}@media(max-width:1220px){.work-area{grid-template-columns:minmax(340px,1fr) minmax(330px,1fr);height:auto;min-height:calc(100vh - 94px)}.profile-pane{grid-column:1/-1}.profile-content{display:grid;grid-template-columns:repeat(3,1fr);gap:0 15px}.profile-content label{margin-bottom:10px}.profile-content label:last-of-type{grid-column:1/-1}.stat-card{align-self:center;margin:0}.conversation,.assistant-pane{min-height:620px}}@media(max-width:760px){.app{display:block}.sidebar{width:100%;height:auto;position:relative}.sidebar-brand{height:65px;padding:12px 18px}.sidebar-heading{padding:10px 18px}.customer-list{display:flex;overflow:auto;padding:0 10px}.customer-item{min-width:130px}.sidebar-footer{padding:7px 17px}.topbar{padding:13px 15px;display:block}.top-actions{margin-top:12px;flex-wrap:wrap}.work-area{display:block;padding:10px}.pane{margin-bottom:10px}.conversation,.assistant-pane{min-height:500px}.profile-content{grid-template-columns:1fr 1fr}.hint{display:none}}
:root{--ai-banner-height:0px}.ai-connection-banner{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:74px;padding:13px 27px;background:#fff7e8;border-bottom:1px solid #f1dfbd;color:#8a6427}.ai-connection-banner strong{font-size:13px}.ai-connection-banner p{font-size:12px;line-height:1.5;margin:4px 0 0}.main.ai-unavailable{--ai-banner-height:74px}.main .work-area{height:calc(100vh - 94px - var(--ai-banner-height))}.main .empty-state{min-height:calc(100vh - 94px - var(--ai-banner-height))}.ai-provider{display:flex;align-items:center;justify-content:space-between;padding:11px 13px;background:#f5f7fc;border:1px solid #e9edf5;border-radius:10px;color:#6d7d99}.ai-provider strong{color:#3b4c6d}#ai-settings-summary{font-size:13px;line-height:1.6}.ai-help{font-size:12px;color:#8491a7;line-height:1.65;margin:8px 0 16px}.ai-help a{color:#5d73d8;text-decoration:none}#ai-key-help{margin-top:-6px}.ai-feedback{padding:12px;border:1px solid #efd2cd;background:#fff3f0;border-radius:10px;color:#a24739;line-height:1.6;font-size:13px;overflow-wrap:anywhere}.ai-feedback.success{border-color:#c8e8d3;background:#effaf3;color:#2d7950}.ai-feedback.pending{border-color:#dce4f5;background:#f3f6fd;color:#596e9b}@media(max-width:1220px){.main .work-area{height:auto}}@media(max-width:760px){.ai-connection-banner{padding:13px 15px;align-items:flex-start;flex-wrap:wrap}.ai-connection-banner .secondary{margin-top:3px}.main .empty-state{min-height:350px}}
.composer-modes{display:flex;gap:6px;padding:4px;background:#f1f4fc;border-radius:10px;margin-bottom:13px}.composer-mode{flex:1;min-width:0;padding:9px 6px;border:0;border-radius:7px;background:transparent;color:#7b89a3;font-size:11px;font-weight:700;line-height:1.5}.composer-mode.active{background:#fff;color:#5269d2;box-shadow:0 2px 7px #354b7b12}.composer-instruction{font-size:11px;line-height:1.6;color:#8e9bb0;margin:8px 0 0}.composer-actions{justify-content:flex-end}.composer-actions .primary{max-width:100%;white-space:normal}
.composer .composer-actions{justify-content:flex-end}
.relationship-stage{flex:none;padding:15px 18px 13px;border-bottom:1px solid #e9edf7;background:#fafbff}.relationship-stage-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.relationship-stage-heading strong{font-size:12px;color:#586987}.relationship-stage-heading span{font-size:11px;color:#8490a7}.relationship-stage-options{display:flex;gap:7px;margin-top:10px}.stage-option{flex:1;padding:8px 12px;border:1px solid #e0e6f1;background:#fff;border-radius:9px;color:#8995ab;font-size:12px;font-weight:700}.stage-option.active{border-color:#7e93e9;background:#edf1ff;color:#526ad0}#stage-girlfriend.active{border-color:#d29bc5;background:#fcf0f8;color:#a05c8e}.relationship-stage p{font-size:11px;line-height:1.6;color:#7988a1;margin:9px 0 2px}.relationship-stage small{display:block;font-size:10px;color:#a3adc0;line-height:1.5}.relationship-stage .relationship-translation-note{color:#667dad;background:#f0f4ff;border-radius:7px;padding:7px 9px;margin-top:8px}.relationship-stage-feedback{font-size:11px;line-height:1.6;border-radius:7px;padding:7px 9px;margin-top:9px;overflow-wrap:anywhere}.relationship-stage-feedback.pending{background:#edf2ff;color:#677eb5}.relationship-stage-feedback.success{background:#edf8f1;color:#3a855b}.relationship-stage-feedback.error{background:#fff1ee;color:#a65b4d}.suggestion-stage{display:inline-block;margin-bottom:14px;padding:4px 8px;border-radius:6px;font-size:10px;color:#7b8aa3;background:#f1f4fa}

.customer-memory{grid-column:1/-1;padding:15px 0 0;margin-top:7px;border-top:1px solid #e9edf5;min-width:0}.memory-heading{display:flex;justify-content:space-between;align-items:center;gap:6px}.memory-heading strong{font-size:13px;color:#4b5e80}.memory-heading .text-btn{font-size:11px;padding:3px 0}.memory-help{font-size:11px;line-height:1.65;color:#8896ad;margin:8px 0 12px}.memory-label{font-size:11px;color:#7183a0;font-weight:700;margin:0 0 6px}.memory-summary{max-height:250px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:12px;color:#536680;background:#f6f8fd;border:1px solid #e9eef8;border-radius:10px;padding:11px 12px}.memory-progress{font-size:11px;color:#7689a8;line-height:1.6;margin-top:9px}.memory-updated{font-size:10px;color:#9aa7bc;line-height:1.6;margin-top:3px}.memory-refresh-actions{display:flex;margin-top:10px}.memory-refresh-actions .secondary{flex:1;white-space:normal;font-size:11px;padding:8px 7px}.customer-memory label{margin-bottom:6px}.customer-memory textarea{font-weight:400;line-height:1.6;min-height:110px}.memory-draft-state{font-size:10px;line-height:1.6;color:#96a2b6;margin:7px 0 10px}.memory-draft-state.dirty{color:#a3762f}.customer-memory>.secondary{font-size:12px;padding:9px 10px}.memory-feedback{font-size:11px;line-height:1.65;border-radius:8px;padding:9px 10px;margin-top:10px;white-space:pre-wrap;overflow-wrap:anywhere}.memory-feedback.pending{background:#edf2ff;color:#667fb5}.memory-feedback.success{background:#edf8f1;color:#3a855b}.memory-feedback.warning{background:#fff7e7;color:#946e29}.memory-feedback.error{background:#fff1ee;color:#a65b4d}

.memory-auto-setting{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 0 0}.memory-auto-setting .memory-label{margin-bottom:3px}.memory-auto-status{font-size:10px;color:#8896ad;line-height:1.6}.memory-auto-setting .secondary{flex-shrink:0;font-size:11px;padding:8px}.memory-auto-setting .secondary[aria-checked="true"]{background:#edf8f1;border-color:#c9e7d3;color:#3a855b}

/* Keep the working controls in place while long conversations and results scroll. */
.app{height:100vh;height:100dvh;min-height:0;overflow:hidden}
.sidebar{height:100%;min-height:0}
.main{display:flex;flex-direction:column;min-height:0}
.topbar{flex:none;flex-wrap:wrap}
.topbar>div:first-child{min-width:0;overflow-wrap:anywhere}
.top-actions{flex-wrap:wrap}
.ai-connection-banner{flex:none}
.main .work-area{flex:1;min-height:0;height:auto;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(220px,.75fr);grid-template-rows:minmax(0,1fr);overflow:hidden}
.main .empty-state{flex:1;min-height:0}
.pane,.conversation,.assistant-pane{min-height:0}
.messages{flex:1 1 0;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable}
.messages:focus-visible,.assistant-results:focus-visible{outline:2px solid #8a9cf4;outline-offset:-3px}
.composer{flex:none;padding:12px 14px}
.composer textarea{min-height:60px;max-height:120px}
.composer-modes{margin-bottom:10px}
.ai-instructions{margin-top:10px}
.ai-instructions summary{cursor:pointer;color:#63728c;font-size:12px;font-weight:800;line-height:1.5}
.ai-instructions textarea{min-height:52px;max-height:100px;margin-top:7px;font-weight:400}
.ai-instructions .composer-instruction{font-size:10px;margin-top:6px}
.assistant-pane{overflow:hidden}
.assistant-results{flex:1 1 0;min-height:75px;overflow:auto;display:flex;flex-direction:column;overscroll-behavior:contain;scrollbar-gutter:stable}
.assist-empty{flex:none}
.suggestion{flex:none;padding:16px}
.suggestion textarea{max-height:220px}
.relationship-stage{flex:0 1 auto;min-height:0;max-height:30%;overflow:auto;padding:12px 15px}
.response-actions{flex:none;margin:0;padding:12px 14px;border-top:1px solid #eef0f6;background:#fff;z-index:1}
.response-actions button{min-width:0;padding:10px 9px;font-size:12px}
.refine{flex:0 1 auto;min-height:0;max-height:35%;overflow:auto;margin-top:0;padding:12px 14px}
.refine label{margin-bottom:6px}
.refine label:not(:first-child){margin-top:10px}
.refine textarea{min-height:52px;max-height:100px;margin-bottom:10px}
.profile-content{min-height:0;overscroll-behavior:contain}

@media(min-width:761px) and (max-height:760px){
  .assistant-results{min-height:120px}
  .relationship-stage{padding:10px 13px}
  .relationship-stage-options{margin-top:7px}
  .relationship-stage p{margin-top:6px}
  .response-actions{padding:10px 12px}
  .refine{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 10px;flex:none;max-height:none;padding:10px 12px}
  .refine label,.refine label:not(:first-child){margin:0;align-self:center;font-size:11px}
  .refine select{margin:0;padding:7px 10px;font-size:12px}
  .refine #draft-label,.refine textarea,.refine button{grid-column:1/-1}
  .refine textarea{height:48px;min-height:48px;max-height:72px;margin:0;padding:7px 10px;font-size:12px}
  .refine button{padding:8px 10px;font-size:12px}
}

@media(min-width:761px) and (max-width:1220px){
  .app{height:auto;min-height:100vh;min-height:100dvh;overflow:visible}
  .sidebar{height:100vh;height:100dvh;flex:none}
  .main{min-height:100vh;min-height:100dvh}
  .main .work-area{flex:none;overflow:visible;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:var(--workspace-pane-height,calc(100dvh - 122px)) auto;align-content:start}
  .conversation,.assistant-pane{height:100%;min-height:0}
  .profile-pane{grid-column:1/-1;max-height:none}
  .profile-content{overflow:visible}
  .pane-title{padding:0 13px}
  .pane-title strong{font-size:13px}
  .pane-title .text-btn{font-size:11px}
}

@media(max-width:760px){
  .app{display:block;height:auto;min-height:100vh;overflow:visible}
  .sidebar{height:auto;min-height:0}
  .main{display:block;min-height:0}
  .main .work-area{display:block;height:auto;overflow:visible;padding:10px}
  .conversation{height:660px;height:min(780px,max(600px,85dvh));min-height:0}
  .assistant-pane{height:760px;min-height:0}
  .profile-pane{height:auto}
  .profile-content{overflow:visible}
  .main .empty-state{min-height:350px}
  .composer{padding:12px}
  .relationship-stage{max-height:28%}
  .refine{max-height:34%}
  .response-actions{padding:12px}
}
