/* Customer-service workspace: conversation history stays secondary to the active chat. */
.chat-view{padding-top:24px}
.sidebar .nav{justify-content:flex-start;padding-left:14px}.sidebar .nav b{font-weight:650}
.chat-view .chat-shell{height:calc(100vh - 190px);min-height:600px;display:grid;grid-template-columns:264px minmax(0,1fr);border:1px solid #e1e5e9;border-radius:12px;background:#fff;box-shadow:0 18px 42px rgba(28,43,62,.06);overflow:hidden}
.chat-view .chat-context{padding:14px 10px 15px;background:#f7f7f8;border-right:1px solid #e5e7eb}
.chat-new-button{width:100%;height:40px;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid #d7dce3;border-radius:8px;background:#fff;color:#273342;font:inherit;font-size:12px;font-weight:650;text-align:left;transition:border-color .16s ease,background .16s ease}
.chat-new-button span{font-size:19px;font-weight:400;line-height:1}
.chat-new-button:hover{border-color:#aebcd3;background:#f9fbff;color:#2d63d6}
.chat-new-button:focus-visible,.chat-session:focus-visible{outline:2px solid #82a6ee;outline-offset:2px}
.chat-history-label{display:flex;align-items:center;justify-content:space-between;margin:22px 7px 8px;color:#89929d;font-size:10px;font-weight:650;letter-spacing:.06em}
.chat-history-label:after{content:"";height:1px;flex:1;margin-left:9px;background:#e0e3e7}
.chat-view .chat-session-list{max-height:none;flex:1;margin:0 -2px;padding:0 2px 8px;display:grid;align-content:start;gap:3px}
.chat-view .chat-session{padding:9px 10px;border:1px solid transparent;border-radius:7px;background:transparent;color:#56616e}
.chat-view .chat-session:hover{background:#eceff3;color:#263240}
.chat-view .chat-session.active{border-color:#d6e1f6;background:#eaf0fb;color:#234fba}
.chat-view .chat-session strong{font-size:11px;font-weight:650}
.chat-view .chat-session span{margin-top:4px;color:#8b94a0;font-size:9px}
.chat-view .chat-session.active span{color:#7183a5}
.chat-view .chat-session-empty{margin:14px 8px;color:#949ca6;font-size:11px}
.chat-view .chat-meta{margin:10px 7px 0!important;border-top:1px solid #e2e4e7}
.chat-view .chat-meta div{padding:10px 0 0;border:0}
.chat-view .chat-context>p{margin:13px 7px 0;color:#929aa4;font-size:10px;line-height:1.55}
.chat-workspace{min-height:0;background:#fff}
.chat-workspace-head{height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 25px;border-bottom:1px solid #edf0f2;background:rgba(255,255,255,.92)}
.chat-workspace-head strong,.chat-workspace-head small{display:block;max-width:min(480px,50vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-workspace-head strong{color:#263240;font-size:13px}
.chat-workspace-head small{margin-top:3px;color:#929aa4;font-size:10px}
.chat-workspace-head .state-pill{border:1px solid #dce6d7;background:#f5f9ed;color:#617b2a;font-size:10px}
.chat-view .messages{min-height:0;max-height:none;padding:30px clamp(28px,7vw,130px);background:#fff}
.chat-view .chat-empty{margin:calc(min(24vh,180px)) auto 0}
.chat-view .chat-empty>span{width:40px;height:40px;border-radius:11px;background:#e2f65a;color:#23321f;font-size:17px}
.chat-view .chat-empty h3{font-size:20px;color:#24303b}
.chat-view .chat-empty p{max-width:420px;color:#7f8994}
.chat-view .message{margin-bottom:18px}
.chat-view .bubble{max-width:min(74%,720px);padding:11px 13px;border-color:#e4e8ed;border-radius:10px;background:#f7f8fa;color:#313d49;font-size:13px;line-height:1.7}
.chat-view .message.user .bubble{border-color:#2d63d6;background:#2d63d6;color:#fff;border-bottom-right-radius:3px}
.chat-view .message.assistant .bubble{border-bottom-left-radius:3px}
.chat-view .message.assistant .bubble>p{margin:0;white-space:pre-wrap}
.chat-view .message.assistant .bubble>p+p{margin-top:12px}
.chat-view .message.assistant .bubble>h1,.chat-view .message.assistant .bubble>h2,.chat-view .message.assistant .bubble>h3,.chat-view .message.assistant .bubble>h4,.chat-view .message.assistant .bubble>h5,.chat-view .message.assistant .bubble>h6{margin:16px 0 8px;color:#1f2e3e;line-height:1.35}.chat-view .message.assistant .bubble>h1:first-child,.chat-view .message.assistant .bubble>h2:first-child,.chat-view .message.assistant .bubble>h3:first-child{margin-top:0}.chat-view .message.assistant .bubble>h1{font-size:1.36em}.chat-view .message.assistant .bubble>h2{font-size:1.24em}.chat-view .message.assistant .bubble>h3{font-size:1.12em}
.chat-view .message.assistant .bubble>ul,.chat-view .message.assistant .bubble>ol{margin:8px 0 12px;padding-left:1.55em}.chat-view .message.assistant .bubble li{margin:3px 0}.chat-view .message.assistant .bubble blockquote{margin:11px 0;padding:8px 12px;border-left:4px solid #3b6ee8;border-radius:0 7px 7px 0;background:#eaf0fc;white-space:pre-wrap}.chat-view .message.assistant .bubble pre{max-width:100%;margin:11px 0;padding:11px 13px;overflow:auto;border-radius:7px;background:#172033;color:#f2f5fb}.chat-view .message.assistant .bubble code{padding:.08em .3em;border-radius:4px;background:#e3e7ee;font-family:Consolas,monospace}.chat-view .message.assistant .bubble pre code{padding:0;background:transparent;color:inherit}.chat-view .message.assistant .bubble a{color:#245fd6;text-decoration:underline;text-underline-offset:2px}.chat-view .message.assistant .bubble hr{margin:15px 0;border:0;border-top:1px solid #d8dee9}
.chat-view .knowledge-figure{margin:14px 0}
.chat-view .knowledge-figure img{display:block;width:min(100%,920px);max-height:70vh;object-fit:contain;border:1px solid #dce3e8;border-radius:8px;background:#fff}
.chat-view .knowledge-figure figcaption{margin-top:7px;color:#687583;font-size:11px}
.chat-view .knowledge-table-wrap{max-width:100%;margin:14px 0;overflow-x:auto;border:1px solid #dce3e8;border-radius:8px;background:#fff}
.chat-view .knowledge-table-wrap table{width:100%;border-collapse:collapse;font-size:12px;white-space:normal}
.chat-view .knowledge-table-wrap th,.chat-view .knowledge-table-wrap td{min-width:110px;height:auto;padding:8px 10px;border-right:1px solid #e5e9ee;border-bottom:1px solid #e5e9ee;text-align:left;vertical-align:top;white-space:pre-wrap}
.chat-view .knowledge-table-wrap th{background:#f2f5f9;color:#344252;font-weight:700}
.chat-view .knowledge-table-wrap tbody tr{cursor:default}
.chat-view .knowledge-table-wrap tr:last-child td{border-bottom:0}
.chat-view .knowledge-table-wrap th:last-child,.chat-view .knowledge-table-wrap td:last-child{border-right:0}
.chat-view .message.assistant .bubble.ticket-result{width:min(100%,640px);max-width:min(84%,640px);padding:0;overflow:hidden;border-color:#d9e4d5;background:#fff;box-shadow:0 8px 24px rgba(40,57,46,.07)}
.ticket-result-head{display:flex;align-items:center;gap:9px;padding:13px 16px;border-bottom:1px solid #e5ece2;background:#f6faf4;color:#304333}
.ticket-result-head strong{font-size:14px;font-weight:700}
.ticket-result-mark{width:18px;height:18px;position:relative;flex:0 0 18px;border-radius:50%;background:#4f7b42}
.ticket-result-mark::after{content:'';width:7px;height:4px;position:absolute;left:5px;top:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg)}
.ticket-result-fields{margin:0;padding:4px 16px 7px}
.ticket-result-fields>div{display:grid;grid-template-columns:86px minmax(0,1fr);gap:14px;padding:9px 0;border-bottom:1px solid #edf1ec}
.ticket-result-fields>div:last-child{border-bottom:0}
.ticket-result-fields dt{color:#7a867d;font-size:12px}
.ticket-result-fields dd{min-width:0;margin:0;color:#2e3931;font-size:13px;overflow-wrap:anywhere}
.chat-view .chat-notice{margin:0 28px 8px;border-radius:7px}
.chat-view .composer{position:relative;margin:0 22px;padding:12px 0 8px;border-top:1px solid #edf0f2;background:#fff}
.chat-view .composer textarea{min-height:46px;padding:12px 48px 12px 14px;border-color:#d9dfe6;border-radius:10px;background:#fff;color:#2c3743;font-size:13px;line-height:1.5;box-shadow:0 4px 14px rgba(37,51,68,.04)}
.chat-view .composer textarea:focus{border-color:#8eade8;box-shadow:0 0 0 3px rgba(45,99,214,.11)}
.chat-view .composer .primary-button{width:34px;min-height:34px;position:absolute;right:9px;bottom:14px;padding:0;border-radius:8px;font-size:19px;line-height:1}
.chat-view .composer .primary-button:disabled{background:#cfd6df;color:#fff}
.chat-disclaimer{margin:0;padding:0 23px 14px;color:#98a1aa;font-size:10px;line-height:1.45;text-align:center}
.chat-view .state-pill{white-space:nowrap}
.compact-panel-heading{min-height:56px;padding:14px 20px;display:flex;align-items:center}.compact-panel-heading #resultSummary{margin:0;color:#7f8994;font-size:12px}.action-only-heading{min-height:48px;justify-content:flex-end;align-items:center}
@media(max-width:820px){.chat-view .chat-shell{height:calc(100vh - 142px);min-height:520px;grid-template-columns:1fr}.chat-view .chat-context{display:none}.chat-view .messages{padding:24px 18px}.chat-workspace-head{padding:0 18px}.chat-view .composer{margin:0 14px}.chat-disclaimer{padding:0 16px 12px}.chat-view .bubble{max-width:88%}}
@media(max-width:480px){.chat-view{padding-top:14px}.chat-view .chat-shell{height:calc(100vh - 124px);border-radius:9px}.chat-workspace-head{height:57px}.chat-view .chat-empty{margin:110px auto 0}.chat-workspace-head strong{max-width:230px}.chat-view .messages{padding:18px 13px}.chat-view .composer{margin:0 10px}.chat-disclaimer{font-size:9px}.chat-view .message.assistant .bubble.ticket-result{max-width:96%}.ticket-result-fields>div{grid-template-columns:72px minmax(0,1fr);gap:9px}}
