[hidden]{display:none!important}
:root{--navy:#0b1220;--navy2:#111a2b;--line:#e5e9f2;--muted:#7b8496;--text:#172033;--blue:#2c91d3;--blue2:#65c2fd;--panel:#fff;--soft:#f5f7fb;--green:#16a34a;--danger:#dc2626}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--soft);color:var(--text)}button,input,select{font:inherit}button{cursor:pointer}
.login{min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 20%,#dbeafe 0,transparent 34%),radial-gradient(circle at 80% 80%,#e9d5ff 0,transparent 30%),#f4f7fb}.login-card{width:min(430px,94vw);background:#fff;padding:34px;border:1px solid #e7ebf3;border-radius:24px;box-shadow:0 30px 80px rgba(15,23,42,.13)}.brand-lockup{display:flex;align-items:center;gap:14px;margin-bottom:28px}.brand-mark,.rail-logo{display:grid;place-items:center;color:white;background:linear-gradient(145deg,var(--blue),var(--blue2));font-weight:800}.brand-mark{width:48px;height:48px;border-radius:14px;font-size:22px}.brand-lockup h1{font-size:27px;margin:0}.brand-lockup p{margin:3px 0 0;color:var(--muted)}.login-card label{display:block;font-weight:650;font-size:14px;margin:14px 0}.login-card input,.user-form input,.user-form select{width:100%;margin-top:7px;padding:13px 14px;border:1px solid #d8deea;border-radius:12px;outline:none;background:#fbfcfe}.login-card input:focus,.user-form input:focus,.user-form select:focus,.composer input:focus,.search-wrap input:focus{border-color:#8ab4ff;box-shadow:0 0 0 4px #2563eb15}.primary-btn{width:100%;border:0;border-radius:12px;padding:13px 16px;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;font-weight:750}.form-error{color:#b91c1c;min-height:18px;font-size:13px}
.app-shell{min-height:100dvh;display:flex;background:#eef2f7}.rail{width:72px;flex:0 0 72px;background:#0b1220;padding:15px 10px;display:flex;flex-direction:column;align-items:center;gap:10px}.rail-logo{width:42px;height:42px;border-radius:13px;margin-bottom:16px}.rail-btn{width:44px;height:44px;border:0;border-radius:13px;background:transparent;color:#9eacc0;font-size:18px}.rail-btn:hover,.rail-btn.active{background:#1d2a40;color:#fff}.rail-spacer{flex:1}.workspace{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 22px;justify-content:space-between}.topbar-title{display:flex;align-items:center;gap:14px}.topbar h1{font-size:23px;margin:0}.status-pill{display:inline-flex;align-items:center;gap:7px;padding:6px 10px;background:#ecfdf3;color:#15803d;border-radius:999px;font-size:12px;font-weight:700}.status-pill i{width:7px;height:7px;border-radius:50%;background:#22c55e}.topbar-actions{display:flex;align-items:center;gap:10px}.agent-chip{padding:9px 12px;border-radius:10px;background:#f3f6fa;font-size:13px;font-weight:650}.ghost-btn{border:1px solid #dde3ed;background:#fff;border-radius:10px;padding:9px 13px;color:#334155}
.layout{height:calc(100dvh - 72px);display:grid;grid-template-columns:minmax(280px,330px) minmax(380px,1fr) minmax(260px,320px);min-height:0}.inbox-panel,.chat-panel,.detail-panel{background:#fff;min-width:0;min-height:0}.inbox-panel{border-right:1px solid var(--line);display:flex;flex-direction:column}.inbox-head{padding:20px 18px 12px;display:flex;justify-content:space-between;align-items:center}.inbox-head h2{margin:0;font-size:18px}.inbox-head p{margin:4px 0 0;color:var(--muted);font-size:12px}.icon-btn{width:36px;height:36px;border:1px solid #e1e6ef;background:#fff;border-radius:10px;color:#536075}.search-wrap{margin:0 16px 12px;height:42px;border:1px solid #e2e7ef;border-radius:12px;background:#f8fafc;display:flex;align-items:center;padding:0 11px;gap:8px;color:#97a0b0}.search-wrap input{border:0;outline:0;background:transparent;width:100%;min-width:0}.status-tabs{display:flex;gap:7px;padding:0 16px 12px;border-bottom:1px solid var(--line)}.tab{border:0;background:transparent;color:#758095;padding:8px 11px;border-radius:9px;font-size:13px;font-weight:700}.tab.active,.tab:hover{background:#eaf1ff;color:var(--blue)}.conversation-list{flex:1;overflow:auto;padding:8px}.conv{width:100%;border:0;background:#fff;text-align:left;padding:13px;border-radius:13px;display:block;margin-bottom:4px}.conv:hover,.conv.selected{background:#f1f5ff}.conv b{display:block;font-size:14px}.conv small{display:block;margin-top:5px;color:#7d8798;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv:before{content:'V';float:left;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;margin-right:10px;background:linear-gradient(145deg,#dbeafe,#ede9fe);color:#4338ca;font-weight:800}
.chat-panel{display:flex;flex-direction:column;border-right:1px solid var(--line)}.chat-head{height:72px;flex:0 0 72px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 18px;gap:11px}.visitor-avatar,.profile-avatar{display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#7c3aed,#2563eb);color:#fff;font-weight:800}.visitor-avatar{width:42px;height:42px}.chat-title-wrap{min-width:0;display:flex;flex-direction:column}.chat-title-wrap strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-title-wrap span{font-size:12px;color:var(--muted);margin-top:3px}.chat-head-actions{margin-left:auto;display:flex;gap:7px}.message-stream{flex:1;min-height:0;overflow:auto;padding:24px;background:linear-gradient(#fbfcff,#f7f9fc)}.empty-chat{height:100%;display:grid;place-content:center;text-align:center;color:#8993a5}.empty-icon{font-size:40px}.empty-chat h3{margin:12px 0 4px;color:#364152}.empty-chat p{margin:0;max-width:280px;font-size:13px}.msg{position:relative;max-width:min(76%,620px);width:max-content;padding:11px 13px;margin:10px 0;border-radius:15px;background:#fff;border:1px solid #e7ebf2;box-shadow:0 3px 12px #0f172a0a;overflow-wrap:anywhere}.msg.agent{margin-left:auto;background:var(--blue);color:white;border-color:var(--blue);border-bottom-right-radius:5px}.msg.visitor{border-bottom-left-radius:5px}.msg img,.msg video{max-width:100%;max-height:320px;border-radius:10px}.msg audio{max-width:100%}.actions{display:block;margin-top:6px;opacity:.75}.actions button{border:0;background:transparent;color:inherit;padding:2px 4px}.composer{height:76px;flex:0 0 76px;display:flex;align-items:center;gap:9px;padding:13px 16px;border-top:1px solid var(--line);background:#fff}.composer input{flex:1;min-width:0;border:1px solid #dfe5ee;border-radius:13px;padding:12px 14px;outline:none;background:#f9fafc}.composer-icon{width:40px;height:40px;border-radius:12px;border:1px solid #e1e6ef;background:#fff;font-size:20px;color:#6b7280}.send-btn{width:42px;height:42px;border:0;border-radius:12px;background:var(--blue);color:#fff;font-size:17px}
.detail-panel{padding:22px;overflow:auto}.detail-profile{text-align:center;padding-bottom:22px;border-bottom:1px solid var(--line)}.profile-avatar{width:72px;height:72px;margin:0 auto 12px;font-size:24px}.detail-profile h3{margin:0}.detail-profile p{font-size:12px;color:var(--muted);margin:5px 0 0}.detail-content{padding:18px 0;line-height:1.8;color:#4b5563;font-size:14px}.detail-card{border-top:1px solid var(--line);padding-top:17px}.detail-card h4{margin:0 0 11px}.danger-outline{width:100%;padding:10px 12px;border:1px solid #fecaca;background:#fff5f5;color:#b91c1c;border-radius:10px;font-weight:700}
.modal{position:fixed;inset:0;background:#0f172aa8;display:grid;place-items:center;padding:18px;z-index:50}.modalBox{width:min(720px,96vw);max-height:92dvh;overflow:auto;background:#fff;border-radius:20px;padding:22px;box-shadow:0 30px 80px #0004}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:16px}.modal-head h2{margin:0}.modal-head p{margin:5px 0 0;color:var(--muted);font-size:13px}.users-list{display:grid;gap:8px;margin-bottom:18px}.users-list>div{padding:12px;border:1px solid var(--line);border-radius:11px;background:#f9fafc}.user-form{display:grid;grid-template-columns:1fr 1fr;gap:10px}.user-form input,.user-form select{margin:0}.user-form .check-row{display:flex;align-items:center;gap:8px;font-size:14px}.user-form .check-row input{width:auto}.user-form .primary-btn{grid-column:1/-1}
@media(max-width:1100px){.layout{grid-template-columns:300px 1fr}.detail-panel{display:none}}
@media(max-width:760px){.rail{width:58px;flex-basis:58px;padding-inline:7px}.rail-btn{width:40px;height:40px}.topbar{height:64px;padding:0 12px}.topbar-title h1{font-size:19px}.agent-chip{display:none}.layout{height:calc(100dvh - 64px);grid-template-columns:260px 1fr}.chat-head-actions{display:none}}
@media(max-width:620px){.app-shell{display:block}.rail{display:none}.workspace{height:100dvh}.layout{grid-template-columns:1fr}.inbox-panel{display:flex}.chat-panel{display:none}.layout.chat-open .inbox-panel{display:none}.layout.chat-open .chat-panel{display:flex}.topbar{position:sticky;top:0;z-index:4}.message-stream{padding:14px}.msg{max-width:86%}.user-form{grid-template-columns:1fr}.modalBox{padding:16px}}
.modal-wide{width:min(880px,94vw);max-height:88vh;overflow:auto}.panel-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px}.metric-card,.setting-card,.traffic-row{border:1px solid #e5eaf2;border-radius:14px;padding:16px;background:#fff}.metric-card strong{display:block;font-size:28px;margin-top:8px}.traffic-list{display:grid;gap:10px}.traffic-row{display:grid;grid-template-columns:1.2fr 1fr 1fr auto;gap:12px;align-items:center}.setting-form{display:grid;gap:16px}.setting-card label{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:10px 0}.setting-card input[type=range]{width:180px}.setting-card select{min-width:180px}.readonly-note{padding:12px;border-radius:10px;background:#fff7ed;color:#9a3412}.toast-stack{position:fixed;right:20px;top:82px;z-index:10000;display:grid;gap:10px}.toast{background:#0f172a;color:white;padding:12px 16px;border-radius:12px;box-shadow:0 12px 36px #0f172a33;max-width:340px}.badge-count{display:inline-flex;min-width:20px;height:20px;border-radius:10px;align-items:center;justify-content:center;background:#ef4444;color:white;font-size:11px;padding:0 6px;margin-left:6px}.upload-progress{font-size:12px;color:#64748b;padding:0 12px}.rail-btn[disabled]{opacity:.45;cursor:not-allowed}@media(max-width:760px){.traffic-row{grid-template-columns:1fr}.modal-wide{width:96vw}}

.settings-sections{display:grid;gap:16px}.integration-card h3,.setting-card h3{margin:0 0 6px}.integration-card p{margin:0 0 14px;color:#64748b;font-size:13px}.code-box{width:100%;min-height:210px;resize:vertical;border:1px solid #dbe2ec;border-radius:12px;padding:14px;background:#0f172a;color:#e2e8f0;font:13px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre}.compact-btn{width:auto;display:inline-flex;margin-top:12px}.copy-row{display:flex;gap:8px;align-items:center}.copy-row input{flex:1;min-width:0;border:1px solid #dbe2ec;border-radius:11px;padding:12px;background:#f8fafc}.link-btn{text-decoration:none;display:inline-flex;align-items:center}.setting-card code{color:#2563eb}@media(max-width:620px){.copy-row{flex-direction:column;align-items:stretch}.compact-btn{width:100%}}
/* v3.1 stability + visual polish */
.sender-name{display:block;font-size:12px;font-weight:800;line-height:1.2;margin:0 0 6px;color:#64748b;white-space:normal}.msg.agent .sender-name{color:#475569}.msg.visitor .sender-name{color:rgba(255,255,255,.86)}.message-body{display:block;white-space:pre-wrap;overflow-wrap:anywhere}.edited-label{opacity:.68;font-size:10px}.send-btn:disabled,.send-button:disabled{opacity:.55;cursor:not-allowed}.rail-btn svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.rail-btn{transition:background .18s ease,color .18s ease,transform .18s ease}.rail-btn:hover{transform:translateY(-1px)}
.setting-form textarea{width:100%;min-height:130px;border:1px solid var(--line);border-radius:12px;padding:12px;resize:vertical;background:#fff;color:var(--text)}
@media(max-width:1100px){.detail-panel{position:fixed;right:0;top:74px;bottom:0;width:min(360px,92vw);z-index:20;box-shadow:-18px 0 45px #0f172a20;transform:translateX(100%);transition:.2s}.layout.detail-open .detail-panel{transform:translateX(0)}}
@media(max-width:760px){.app-shell{display:block}.rail{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;height:68px;z-index:50;flex-direction:row;padding:8px 12px;padding-bottom:calc(8px + env(safe-area-inset-bottom));border-right:0;border-top:1px solid #1f2937}.rail-logo,.rail-spacer{display:none}.rail-btn{flex:1;height:46px}.workspace{margin-left:0;padding-bottom:68px}.topbar{height:64px;padding:0 14px}.layout{grid-template-columns:1fr;height:calc(100dvh - 132px)}.inbox-panel{display:block}.chat-panel,.detail-panel{display:none}.layout.chat-open .inbox-panel{display:none}.layout.chat-open .chat-panel{display:flex}.chat-head{padding:10px 12px}.composer{padding-bottom:calc(10px + env(safe-area-inset-bottom))}.message-stream{padding:14px}.msg{max-width:88%}.topbar-actions .agent-chip{display:none}}
.tab-total{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;margin-left:5px;border-radius:10px;background:#ef4444;color:#fff;font-size:11px}.agent-chip{border:0;cursor:pointer}.canned-toolbar{display:flex;gap:10px;margin-bottom:12px}.canned-toolbar input{flex:1;padding:10px}.canned-list{display:grid;gap:8px}.canned-row{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:8px}.canned-use{border:0;background:none;text-align:left;display:grid;gap:4px;cursor:pointer}.canned-use span{color:#64748b}.experience-grid{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:20px}.experience-preview{width:100%;height:680px;border:1px solid #dbe2ec;border-radius:18px;background:#fff}@media(max-width:900px){.experience-grid{grid-template-columns:1fr}.experience-preview{height:600px}}
/* v4.2 requested UI refinements: upload controls, custom-link editor, smoother panels */
.modalBox,.setting-card,.integration-card,.profile-editor{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
.modalBox{animation:modalIn .18s ease-out;overflow-x:hidden}
@keyframes modalIn{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
.setting-card{box-shadow:0 8px 24px rgba(15,23,42,.035);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.setting-card:hover{border-color:#d8e0ec;box-shadow:0 12px 30px rgba(15,23,42,.055)}
.primary-btn,.ghost-btn,.icon-btn,.send-btn,.composer-icon,.tab,.agent-chip{transition:transform .15s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease}
.primary-btn:hover,.ghost-btn:hover,.icon-btn:hover,.composer-icon:hover{transform:translateY(-1px)}
.upload-stack{display:grid;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.setting-card .upload-field{display:grid;grid-template-columns:180px minmax(0,1fr);align-items:center;gap:12px;margin:0}
.upload-control{position:relative;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px;min-width:0;border:1px dashed #b9c7da;border-radius:12px;padding:8px;background:#f8fafc;cursor:pointer;overflow:hidden}
.native-file{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;cursor:pointer!important}
.upload-button{flex:0 0 auto;background:#fff;border:1px solid #d7deea;border-radius:9px;padding:8px 12px;font-weight:750;color:#1e293b;box-shadow:0 2px 7px rgba(15,23,42,.05)}
.upload-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b;font-size:13px}
.file-state{grid-column:2;color:#15803d;font-size:12px}.file-state.muted{color:#94a3b8}
.avatar-upload,.welcome-logo-editor{display:flex;align-items:center;gap:18px;padding:4px 0 18px}
.avatar-preview{width:84px;height:84px;border-radius:24px;background:linear-gradient(145deg,var(--blue),var(--blue2));color:#fff;display:grid;place-items:center;font-size:30px;font-weight:850;overflow:hidden;box-shadow:0 12px 28px rgba(37,99,235,.2);flex:0 0 auto}
.avatar-preview.large{width:96px;height:96px;border-radius:28px}.avatar-preview img{width:100%;height:100%;object-fit:cover}
.profile-upload{max-width:430px;margin-bottom:7px}.profile-editor>label{display:grid;grid-template-columns:180px minmax(0,1fr);align-items:center}.profile-editor input:not([type=file]){width:100%}
.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.section-title-row p{margin:4px 0 0;color:#64748b;font-size:13px}
.link-editor{display:grid;gap:10px}.empty-links{padding:28px;border:1px dashed #cbd5e1;border-radius:14px;text-align:center;color:#94a3b8;background:#f8fafc}
.link-editor-row{display:grid;grid-template-columns:34px minmax(0,1fr) 38px;gap:10px;align-items:start;border:1px solid #e2e8f0;border-radius:15px;padding:12px;background:#f8fafc;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.link-editor-row:hover{border-color:#bfdbfe;box-shadow:0 8px 22px rgba(37,99,235,.08);transform:translateY(-1px)}
.drag-handle{border:0;background:transparent;color:#94a3b8;font-size:20px;padding:8px 0;cursor:grab}.link-fields{display:grid;grid-template-columns:1.05fr 1.55fr 90px;gap:9px}.link-fields label{display:grid!important;gap:5px!important;align-items:stretch!important;justify-content:stretch!important;margin:0!important;font-size:12px;color:#64748b}.link-fields input{width:100%;margin:0!important;padding:10px 11px;border:1px solid #d7deea;border-radius:10px;background:#fff}.link-actions{display:grid;gap:5px}.link-actions button{width:34px;height:30px;border:1px solid #dbe2ec;border-radius:8px;background:#fff;cursor:pointer}.link-actions button:hover{background:#eef4ff}
.experience-grid{align-items:start}.experience-preview{position:sticky;top:0;box-shadow:0 18px 45px rgba(15,23,42,.12);transition:box-shadow .2s ease}
@media(max-width:760px){.setting-card .upload-field,.profile-editor>label{grid-template-columns:1fr}.file-state{grid-column:1}.avatar-upload,.welcome-logo-editor{align-items:flex-start}.link-fields{grid-template-columns:1fr}.section-title-row{flex-direction:column}.link-editor-row{grid-template-columns:26px minmax(0,1fr) 38px}}

/* v4.3 targeted visitor geolocation card */
.geo-card{margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}.geo-card h4{margin:0 0 10px}.geo-card p{margin:8px 0;line-height:1.45}.geo-card small{color:var(--muted)}.geo-map{display:block;width:100%;height:190px;border:0;border-radius:11px;background:#e5e7eb}.geo-loading{color:var(--muted)}

/* v4.4 targeted pre-chat editor redesign */
.livechat-settings-form{gap:18px}.stack-field{display:grid!important;gap:7px!important;align-items:stretch!important;justify-content:stretch!important;margin:12px 0!important;font-weight:650;color:#1e293b}.stack-field input,.stack-field textarea{width:100%;border:1px solid #d9e0ea;border-radius:10px;padding:11px 12px;background:#fff;color:#0f172a;font:inherit}.stack-field input:focus,.stack-field textarea:focus{outline:0;border-color:#7aa2ff;box-shadow:0 0 0 4px rgba(37,99,235,.08)}.stack-field input:disabled{background:#f8fafc;color:#94a3b8}.switch-line{display:flex!important;align-items:center!important;gap:10px!important;margin:0!important;white-space:nowrap}.prechat-builder{border:1px solid #e2e8f0;border-radius:16px;background:#f8fafc;padding:16px;display:grid;gap:10px}.prechat-builder-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:2px 2px 10px}.prechat-builder-head h3{margin:0 0 4px}.prechat-builder-head p{margin:0;color:#64748b;font-size:13px}.prechat-block{border:1px solid #dfe5ee;border-radius:12px;background:#fff;overflow:hidden;box-shadow:0 2px 8px rgba(15,23,42,.025)}.prechat-block[open]{box-shadow:0 8px 22px rgba(15,23,42,.05)}.prechat-block summary{list-style:none;display:flex;align-items:center;gap:10px;padding:15px 16px;cursor:pointer;user-select:none}.prechat-block summary::-webkit-details-marker{display:none}.block-grip{color:#64748b;letter-spacing:-3px;font-weight:900;cursor:grab}.block-chevron{font-size:18px;transition:transform .18s ease}.prechat-block[open] .block-chevron{transform:rotate(180deg)}.block-spacer{flex:1}.inline-toggle{display:flex!important;align-items:center!important;gap:6px!important;margin:0!important;font-size:12px;font-weight:650;color:#475569}.required-chip{font-size:12px;font-weight:700;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:5px 9px}.block-body{border-top:1px solid #edf0f5;padding:16px 18px 18px}.field-note{margin:8px 0 0;color:#64748b;font-size:12px}.prechat-choice-editor{display:grid;gap:4px;margin-top:18px}.prechat-choice-row{display:grid;grid-template-columns:26px minmax(0,1fr) 34px;align-items:center;gap:8px;position:relative}.choice-branch{height:100%;min-height:56px;border-left:2px solid #d7e0ec;border-bottom:2px solid #d7e0ec;border-bottom-left-radius:8px;margin-left:8px;transform:translateY(-14px)}.prechat-choice-row label{display:grid!important;gap:6px!important;margin:0!important}.prechat-choice-row small{color:#64748b;font-size:12px}.prechat-choice-row input{width:100%;border:1px solid #d7deea;border-radius:9px;padding:10px 11px;background:#fff}.prechat-choice-row button{width:32px;height:32px;border:0;background:transparent;border-radius:8px;font-size:20px;color:#64748b;cursor:pointer}.prechat-choice-row button:hover{background:#fee2e2;color:#b91c1c}.add-choice-btn{margin:10px 0 0 34px;border:1px dashed #b8c6da;background:#f8fafc;border-radius:10px;padding:10px 14px;color:#2563eb;font-weight:750;cursor:pointer}.add-choice-btn:hover{background:#eff6ff;border-color:#93b5ff}.empty-choices{margin:10px 0;padding:16px;border:1px dashed #cbd5e1;border-radius:10px;text-align:center;color:#94a3b8}.publish-btn{position:sticky;bottom:0;z-index:3;box-shadow:0 -8px 24px rgba(255,255,255,.9),0 8px 24px rgba(37,99,235,.2)}
@media(max-width:720px){.prechat-builder-head{flex-direction:column}.prechat-block summary{flex-wrap:wrap}.block-spacer{display:none}.inline-toggle{margin-left:auto!important}.prechat-choice-row{grid-template-columns:18px minmax(0,1fr) 32px}.block-body{padding:14px}.add-choice-btn{margin-left:26px}}

/* v5 focused conversation context, receipts and typing */
.prechat-event{display:flex;align-items:flex-start;gap:10px;margin:14px 0 24px;max-width:520px}.prechat-avatar{width:34px;height:34px;border-radius:50%;background:#8b5cf6;color:#fff;display:grid;place-items:center;font-weight:800;flex:0 0 34px}.prechat-event-card{background:#f3f4f6;border-radius:16px;padding:18px 20px;min-width:300px}.prechat-event-card>strong{display:block;margin-bottom:14px}.prechat-event-card p{margin:0 0 13px}.prechat-event-card p:last-child{margin-bottom:0}.prechat-event-card span{display:block;color:#64748b;margin-bottom:4px}.prechat-event-card b{font-weight:500;color:#111827}.receipt{display:block;text-align:right;font-size:11px;color:#64748b;margin-top:4px}.admin-typing{position:sticky;bottom:4px;width:max-content;border-radius:18px;background:#f3f4f6!important;margin:8px 0;color:#64748b}.prechat-summary-side p span{display:block;color:#64748b;font-size:12px}.prechat-summary-side p b{display:block;margin-top:2px}.typing-indicator{padding:7px 12px;display:flex;align-items:center;gap:4px;font-size:12px}.typing-indicator[hidden]{display:none!important}.typing-indicator span{width:5px;height:5px;border-radius:50%;background:#94a3b8;animation:typingDot 1.1s infinite}.typing-indicator span:nth-child(2){animation-delay:.15s}.typing-indicator span:nth-child(3){animation-delay:.3s;margin-right:5px}@keyframes typingDot{0%,70%,100%{transform:translateY(0);opacity:.45}35%{transform:translateY(-4px);opacity:1}}

/* v5.1 targeted professional workspace polish */
body{background:#eef1f5}
.app-shell{background:#eef1f5}
.rail{background:#0e1117;border-right:1px solid rgba(255,255,255,.06);box-shadow:8px 0 30px rgba(15,23,42,.08)}
.rail-btn{transition:background .16s ease,color .16s ease,transform .16s ease}
.rail-btn:hover{transform:translateY(-1px);background:#202838}
.workspace{background:#f5f6f8}
.topbar{background:rgba(255,255,255,.9);backdrop-filter:blur(16px);border-bottom:1px solid #e7e9ee}
.layout{gap:1px;background:#e5e7eb}
.inbox-panel,.chat-panel,.detail-panel{background:#fff}
.inbox-panel{box-shadow:8px 0 24px rgba(15,23,42,.025)}
.search-wrap{background:#f7f8fa;border-color:#e4e7ec;transition:border-color .15s ease,box-shadow .15s ease}
.search-wrap:focus-within{border-color:#9db8ff;box-shadow:0 0 0 4px rgba(37,99,235,.08)}
.status-tabs{padding:4px;background:#f3f4f6;border-radius:12px}
.status-tabs .tab{border-radius:9px;transition:all .15s ease}
.status-tabs .tab.active{background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.08)}
.conv{border:1px solid transparent;border-radius:14px;transition:background .15s ease,border-color .15s ease,transform .15s ease}
.conv:hover{transform:translateY(-1px);background:#f7f9fc;border-color:#e7ebf2}
.conv.selected{background:#edf3ff;border-color:#d8e5ff;box-shadow:0 8px 22px rgba(37,99,235,.08)}
.chat-head{background:rgba(255,255,255,.94);backdrop-filter:blur(14px)}
.message-stream{background:linear-gradient(180deg,#fbfcfe,#f6f8fb)}
.message{box-shadow:0 4px 14px rgba(15,23,42,.045)}
.composer{margin:12px;border:1px solid #dfe3ea;border-radius:16px;box-shadow:0 12px 30px rgba(15,23,42,.07);background:#fff}
.detail-card{border-radius:14px;border:1px solid #e9ebef;background:#fff}
.modal{backdrop-filter:blur(5px)}
.modalBox{border:1px solid rgba(255,255,255,.7);box-shadow:0 28px 90px rgba(15,23,42,.24)}
.responses-workspace{position:relative;min-height:520px}.responses-toolbar{display:grid;grid-template-columns:auto 1fr minmax(220px,320px);gap:14px;align-items:center;margin-bottom:14px}.response-tabs{display:flex;gap:4px}.response-tabs button{border:0;background:transparent;padding:9px 13px;border-radius:9px;cursor:pointer}.response-tabs button.active{background:#eef3ff;color:#1d4ed8;font-weight:750}.response-search{display:flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid #dfe3ea;border-radius:10px;background:#fff}.response-search input{width:100%;border:0;outline:0}.response-count{padding:10px 12px;border-radius:9px;background:#f1f3f6;color:#475569;font-size:13px;margin-bottom:10px}.responses-list{display:grid;gap:10px}.response-card{padding:16px;border:1px solid #e4e7ec;border-radius:14px;background:#fff;transition:box-shadow .15s ease,transform .15s ease}.response-card:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(15,23,42,.07)}.response-card-head{display:flex;align-items:center;gap:8px}.shortcut-chip{border:1px solid #dbe4ff;background:#f4f7ff;color:#1d4ed8;border-radius:8px;padding:6px 9px;font-weight:750;cursor:pointer}.response-scope{font-size:11px;color:#64748b}.response-actions{margin-left:auto;display:flex;gap:5px}.response-actions button,.editor-head button{border:0;background:#f3f4f6;border-radius:8px;width:32px;height:32px;cursor:pointer}.response-card h4{margin:12px 0 6px}.response-card p{white-space:pre-wrap;margin:0;color:#334155;line-height:1.55}.response-card small{display:block;margin-top:12px;color:#94a3b8}.response-empty{display:grid;gap:5px;text-align:center;padding:70px 20px;color:#64748b}.response-editor-card{position:fixed;right:34px;top:96px;width:min(420px,calc(100vw - 68px));padding:20px;background:#fff;border:1px solid #e4e7ec;border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.2);z-index:5}.editor-head{display:flex;align-items:center;justify-content:space-between}.response-editor-card form{display:grid;gap:13px}.response-editor-card label{display:grid;gap:6px;font-size:13px;font-weight:650}.response-editor-card input,.response-editor-card textarea{width:100%;border:1px solid #dfe3ea;border-radius:10px;padding:11px;outline:0}.response-editor-card input:focus,.response-editor-card textarea:focus{border-color:#8eb0ff;box-shadow:0 0 0 4px rgba(37,99,235,.08)}.shortcut-input{display:flex;align-items:center;border:1px solid #dfe3ea;border-radius:10px;padding-left:11px}.shortcut-input input{border:0;box-shadow:none!important}.responses-workspace .compact-btn{width:auto}.rail-btn svg{stroke-width:1.8}
@media(max-width:900px){.responses-toolbar{grid-template-columns:1fr}.response-editor-card{right:14px;left:14px;width:auto}}

/* v5.2 full visual template refresh — presentation only */
:root{--lc-bg:#f7f8fa;--lc-border:#e6e8ec;--lc-shadow:0 12px 36px rgba(16,24,40,.08);--lc-radius:14px}
html,body{height:100%;overflow:hidden}.app-shell{height:100dvh;min-height:0;background:#fff}.workspace{height:100dvh;min-height:0;background:#fff}.topbar{height:64px;flex:0 0 64px;padding:0 18px;box-shadow:0 1px 0 var(--lc-border);z-index:10}.topbar h1{font-size:20px;letter-spacing:-.02em}.layout{height:calc(100dvh - 64px);min-height:0;display:grid;grid-template-columns:330px minmax(460px,1fr) 320px;background:var(--lc-border);gap:1px}.rail{width:60px;flex-basis:60px;padding:12px 8px;background:#111317}.rail-logo{width:38px;height:38px;border-radius:11px;margin-bottom:10px}.rail-btn{width:40px;height:40px;border-radius:10px}.inbox-panel,.chat-panel,.detail-panel{min-height:0}.inbox-panel{display:flex;flex-direction:column;padding:0}.inbox-head{padding:20px 18px 12px}.inbox-head h2{font-size:18px;letter-spacing:-.02em}.search-wrap{margin:0 14px 12px;height:42px;border-radius:10px}.status-tabs{margin:0 14px 10px}.conversation-list{padding:2px 8px 16px;overflow:auto}.conv{padding:12px 11px;margin:3px 0;border-radius:10px}.conv.selected{background:#f0f2f5;border-color:transparent;box-shadow:none}.chat-panel{display:flex;flex-direction:column;background:#fff}.chat-head{height:64px;flex:0 0 64px;padding:0 16px;border-bottom:1px solid var(--lc-border);box-shadow:none}.visitor-avatar,.profile-avatar{background:#8b5cf6}.message-stream{flex:1;min-height:0;overflow:auto;padding:26px 34px 18px;background:#fff}.message{border-radius:16px;box-shadow:none;border:0;line-height:1.45}.message.visitor{background:#f2f3f5;color:#17191c}.message.agent{background:#0b63e5;color:#fff}.prechat-event{margin:12px 0 28px}.prechat-event-card{background:#f3f4f6;border-radius:16px;padding:18px 20px;box-shadow:none}.composer{flex:0 0 auto;margin:12px 16px 16px;padding:8px;border-radius:14px;border:1px solid #d8dce3;box-shadow:0 4px 18px rgba(16,24,40,.07)}.composer input{height:42px}.composer-icon,.send-btn{width:40px;height:40px;border-radius:10px}.detail-panel{overflow:auto;background:#fff}.detail-profile{padding:24px 18px 18px;border-bottom:1px solid var(--lc-border)}.detail-content{padding:0}.detail-card,.geo-card{margin:0;padding:20px 18px;border:0;border-bottom:1px solid var(--lc-border);border-radius:0;box-shadow:none}.geo-map{height:180px;border-radius:0}.modalBox{border-radius:18px;box-shadow:0 24px 80px rgba(16,24,40,.22)}
@media(max-width:1180px){.layout{grid-template-columns:300px minmax(420px,1fr)}.detail-panel{display:none}}
@media(max-width:760px){.rail{display:none}.layout{grid-template-columns:1fr}.inbox-panel{display:none}.message-stream{padding:18px 14px}.topbar{display:none}.layout{height:100dvh}}


/* v5.3 composer canned-response picker */
.composer-input-wrap{position:relative;flex:1;min-width:0;display:flex}
.composer-input-wrap>#messageInput{width:100%}
.quick-response-menu{position:absolute;left:0;right:0;bottom:calc(100% + 10px);max-height:300px;overflow:auto;background:#fff;border:1px solid #dfe4ec;border-radius:14px;box-shadow:0 18px 50px rgba(15,23,42,.18);padding:6px;z-index:40}
.quick-response-item{width:100%;display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;border:0;background:transparent;text-align:left;padding:10px 11px;border-radius:10px;cursor:pointer;color:#111827}
.quick-response-item:hover,.quick-response-item.active{background:#f1f5f9}
.quick-response-item .qr-shortcut{font-weight:800;color:#2563eb;white-space:nowrap}
.quick-response-item .qr-copy{min-width:0;display:grid;gap:3px}
.quick-response-item .qr-title{font-weight:750;font-size:13px}
.quick-response-item .qr-body{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quick-response-empty{padding:18px;text-align:center;color:#64748b;font-size:13px}
.composer{overflow:visible}

/* v5.6 unread counters */
.status-tabs .tab{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.tab-badge{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#ef4444;color:#fff;font-size:11px;line-height:20px;text-align:center;font-weight:800;box-shadow:0 2px 8px rgba(239,68,68,.25)}
.tab-badge[hidden]{display:none!important}

/* v5.7 live visitor draft preview */
.admin-typing{max-width:min(680px,85%);align-items:flex-start!important;flex-wrap:wrap;white-space:normal;line-height:1.4;padding:10px 14px!important}.admin-typing b{font-size:12px;color:#475569;margin-left:4px}.admin-typing em{display:block;width:100%;font-style:normal;color:#111827;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:8px 10px;margin-top:5px;overflow-wrap:anywhere;box-shadow:0 2px 8px rgba(15,23,42,.06)}

.user-form-error{grid-column:1/-1;margin:0;min-height:20px}.user-form .primary-btn:disabled{opacity:.68;cursor:wait;transform:none}


/* v6.1 chat actions */
.chat-action-menu{position:fixed;z-index:5000;min-width:230px;padding:8px;background:#fff;border:1px solid #dfe5ef;border-radius:14px;box-shadow:0 18px 48px rgba(15,23,42,.22);animation:menuIn .14s ease-out}
.chat-action-menu button{width:100%;border:0;background:transparent;border-radius:9px;padding:11px 12px;display:flex;gap:10px;align-items:center;text-align:left;font:inherit;color:#172033;cursor:pointer}
.chat-action-menu button:hover{background:#f2f5fa}.chat-action-menu button.danger{color:#b42318}.chat-action-menu button.danger:hover{background:#fff1f1}
@keyframes menuIn{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
.transfer-form{display:grid;gap:18px}.agent-transfer-list{display:grid;gap:8px;max-height:420px;overflow:auto}.transfer-agent{display:grid;grid-template-columns:auto 44px 1fr;align-items:center;gap:12px;padding:12px;border:1px solid #dde4ef;border-radius:13px;cursor:pointer}.transfer-agent:hover{background:#f7f9fc}.transfer-agent:has(input:checked){border-color:#2563eb;background:#eff6ff}.transfer-agent input{width:18px;height:18px}.transfer-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#6d4aff;color:#fff;font-weight:800}.transfer-agent span:last-child{display:grid;gap:2px}.transfer-agent small{color:#738096}

/* v6.2 ban duration and unban manager */
.ban-form{display:grid;gap:16px}.ban-form label{display:grid;gap:7px;font-weight:700;color:#172033}.ban-form select,.ban-form textarea{width:100%;border:1px solid #dbe2ec;border-radius:11px;padding:12px;font:inherit;outline:0;background:#fff}.ban-form select:focus,.ban-form textarea:focus{border-color:#86a9ff;box-shadow:0 0 0 4px rgba(37,99,235,.09)}.modal-actions{display:flex;justify-content:flex-end;gap:10px}.danger-btn{border:0;border-radius:11px;background:#d92d20;color:#fff;padding:11px 16px;font-weight:800;cursor:pointer}.danger-btn:hover{background:#b42318}.danger-btn:disabled{opacity:.6;cursor:wait}.banned-toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:14px}.banned-toolbar .response-search{flex:1}.banned-list{display:grid;gap:10px;max-height:58vh;overflow:auto;padding-right:3px}.banned-row{display:grid;grid-template-columns:44px minmax(0,1.2fr) minmax(180px,.8fr) auto;align-items:center;gap:12px;padding:14px;border:1px solid #e3e8f0;border-radius:14px;background:#fff}.banned-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#ede9fe;color:#6d28d9;font-weight:850}.banned-main,.banned-meta{display:grid;gap:3px;min-width:0}.banned-main span,.banned-main small,.banned-meta span,.banned-meta small{color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.banned-main small{color:#334155}.unban-btn{border:1px solid #b7cdfc;background:#eef4ff;color:#1d4ed8;border-radius:10px;padding:9px 13px;font-weight:800;cursor:pointer}.unban-btn:hover{background:#dfeaff}.unban-btn:disabled{opacity:.5}@media(max-width:760px){.banned-toolbar{flex-direction:column}.banned-row{grid-template-columns:42px 1fr}.banned-meta,.unban-btn{grid-column:2}.unban-btn{justify-self:start}}


/* Click-to-preview chat images */
.chat-image-button{display:block;padding:0;border:0;background:transparent;cursor:zoom-in;max-width:100%;border-radius:11px;overflow:hidden}.chat-image-button img{display:block}.image-lightbox-open{overflow:hidden}.chat-image-lightbox{position:fixed;inset:0;z-index:100000;background:rgba(5,10,20,.88);display:flex;flex-direction:column;opacity:0;transition:opacity .16s ease;backdrop-filter:blur(7px)}.chat-image-lightbox.open{opacity:1}.chat-image-lightbox-toolbar{height:60px;flex:0 0 60px;display:flex;align-items:center;justify-content:center;gap:8px;color:#fff;padding:8px 14px;background:rgba(8,15,29,.78);border-bottom:1px solid rgba(255,255,255,.12)}.chat-image-lightbox-toolbar span{font-weight:700;margin-right:8px}.chat-image-lightbox-toolbar button,.chat-image-lightbox-toolbar a{width:38px;height:38px;border-radius:10px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.1);color:#fff;display:grid;place-items:center;text-decoration:none;font-size:20px;cursor:pointer}.chat-image-lightbox-toolbar [data-reset]{width:auto;min-width:58px;padding:0 10px;font-size:13px}.chat-image-lightbox-stage{flex:1;min-height:0;overflow:auto;display:grid;place-items:center;padding:28px;cursor:zoom-out}.chat-image-lightbox-stage img{max-width:min(94vw,1400px);max-height:calc(100vh - 116px);object-fit:contain;transform-origin:center;transition:transform .12s ease;box-shadow:0 22px 70px rgba(0,0,0,.45);border-radius:8px;cursor:default}@media(max-width:640px){.chat-image-lightbox-toolbar{justify-content:flex-start;overflow-x:auto}.chat-image-lightbox-toolbar span{display:none}.chat-image-lightbox-stage{padding:12px}.chat-image-lightbox-stage img{max-width:96vw;max-height:calc(100dvh - 84px)}}

/* v6.8 — rich text editor khusus pesan pre-chat */
.rich-editor-shell{position:relative;border:1px solid #d9e0ea;border-radius:11px;background:#fff;overflow:visible}.rich-editor{min-height:126px;max-height:260px;overflow:auto;padding:13px 14px;color:#0f172a;line-height:1.5;font-weight:400;outline:0}.rich-editor:focus{box-shadow:inset 0 0 0 2px #7aa2ff}.rich-editor p{margin:0 0 8px}.rich-editor ul,.rich-editor ol{margin:6px 0;padding-left:24px}.rich-editor a{color:#2563eb;text-decoration:underline}.rich-toolbar{display:flex;align-items:center;gap:3px;padding:7px 9px;border-top:1px solid #e5e7eb;background:#fff;border-radius:0 0 11px 11px}.rich-toolbar button{width:34px;height:30px;border:0;border-radius:7px;background:transparent;color:#111827;font:inherit;cursor:pointer}.rich-toolbar button:hover{background:#eef2f7}.rich-separator{width:1px;height:22px;background:#e2e8f0;margin:0 4px}.rich-link-popover{position:absolute;left:46%;bottom:42px;z-index:20;width:315px;padding:14px;background:#fff;border:1px solid #d9e0ea;border-radius:11px;box-shadow:0 18px 45px rgba(15,23,42,.2)}.rich-link-popover[hidden]{display:none!important}.rich-link-popover label{display:grid!important;gap:5px!important;margin:0 0 10px!important;font-size:12px;font-weight:600}.rich-link-popover input{width:100%;padding:9px 10px;border:1px solid #ccd5e1;border-radius:8px}.rich-link-popover .primary-btn{margin-left:auto;display:block}.experience-preview{background:#f8fafc}@media(max-width:720px){.rich-link-popover{left:8px;right:8px;width:auto}}

/* v7.4: preserve canned-response line breaks in composer and chat bubbles */
.composer textarea#messageInput{flex:1;min-width:0;width:100%;min-height:42px;max-height:180px;resize:none;overflow-y:auto;border:1px solid #dfe5ee;border-radius:13px;padding:11px 14px;outline:none;background:#f9fafc;font:inherit;line-height:1.45;white-space:pre-wrap}
.composer textarea#messageInput:focus{border-color:#8ab4ff;box-shadow:0 0 0 4px #2563eb15}
.message-body{white-space:pre-wrap;overflow-wrap:anywhere}
.quick-response-item .qr-body,.response-card p{white-space:pre-wrap}
.rail-emoji{font-size:20px}.rail-badge{position:absolute;right:3px;top:3px;min-width:18px;height:18px;padding:0 4px;border-radius:9px;background:#ef4444;color:#fff;font-size:11px;line-height:18px}.rail-btn{position:relative}.tenant-list{display:grid;gap:12px}.tenant-row{display:grid;grid-template-columns:minmax(220px,1fr) auto auto auto;align-items:center;gap:14px;padding:16px;border:1px solid #e4e7ec;border-radius:14px;background:#fff}.tenant-row>div:first-child{display:grid;gap:3px}.tenant-row span,.tenant-row small{color:#667085}.tenant-row code{background:#f2f4f7;padding:6px 9px;border-radius:7px}.tenant-status{font-weight:800;text-transform:uppercase;font-size:11px;padding:6px 9px;border-radius:999px}.tenant-status.pending{background:#fff4cc;color:#8a6200}.tenant-status.approved{background:#dcfae6;color:#087443}.tenant-status.failed,.tenant-status.rejected{background:#fee4e2;color:#b42318}.tenant-status.missing{background:#fff1f0;color:#b42318;border:1px solid #fecdca}.tenant-actions{display:flex;gap:8px;align-items:center}.tenant-actions a{text-decoration:none;font-weight:700}.tenant-open-btn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 14px;border-radius:12px;background:#f4f0ff;color:#6d3df5}.tenant-delete-btn{min-height:40px;padding:0 14px;border:1px solid #fecdca;border-radius:12px;background:#fff;color:#b42318;font:inherit;font-weight:700;cursor:pointer;transition:.18s ease}.tenant-delete-btn:hover{background:#fff1f0;border-color:#fda29b;transform:translateY(-1px)}.tenant-delete-btn:disabled{opacity:.6;cursor:wait;transform:none}.tenant-error{grid-column:1/-1;margin:0;color:#b42318;background:#fff1f0;padding:10px;border-radius:8px}@media(max-width:800px){.tenant-row{grid-template-columns:1fr}.tenant-error{grid-column:auto}}

/* v7.5 — LiveChatKu smooth lavender dashboard refresh (visual only) */
:root{
  --brand:#7657f6;--brand-2:#8f72ff;--brand-soft:#f0edff;--brand-faint:#faf9ff;
  --ink:#18213a;--muted-2:#7c8499;--surface:#ffffff;--surface-soft:#f8f9fd;
  --stroke:#e8e8f2;--shadow:0 18px 50px rgba(71,52,145,.09)
}
html,body{font-family:Inter,"Segoe UI",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-weight:400;letter-spacing:-.01em;background:#f7f7fb;color:var(--ink)}
button,input,select,textarea{font-family:inherit}
.app-shell{min-height:100dvh;background:linear-gradient(135deg,#fbfaff 0%,#f7f8fc 55%,#f4f1ff 100%)}
.rail{width:82px;flex-basis:82px;padding:18px 13px;background:#fff;border-right:1px solid var(--stroke);box-shadow:12px 0 40px rgba(60,47,117,.035);gap:9px}
.rail-logo{width:48px;height:48px;margin-bottom:18px;border-radius:15px;background:linear-gradient(145deg,var(--brand),#9b7cff);box-shadow:0 10px 24px rgba(118,87,246,.25);font-size:0}
.rail-logo:before{content:'💬';font-size:21px;filter:grayscale(1) brightness(0) invert(1)}
.rail-btn{width:46px;height:46px;border-radius:13px;color:#9299ad;background:transparent;transition:.18s ease}
.rail-btn svg{width:21px;height:21px;stroke:currentColor;stroke-width:1.8;fill:none}
.rail-btn:hover{transform:translateY(-1px);background:#f4f1ff;color:var(--brand)}
.rail-btn.active{background:linear-gradient(145deg,var(--brand),var(--brand-2));color:#fff;box-shadow:0 9px 20px rgba(118,87,246,.23)}
.workspace{background:transparent}
.topbar{height:78px;padding:0 26px;background:rgba(255,255,255,.9);border-bottom:1px solid var(--stroke);backdrop-filter:blur(18px)}
.topbar h1{font-size:22px;font-weight:700;letter-spacing:-.025em}
.status-pill{background:#ecfbf4;color:#14845a;font-weight:600;padding:7px 11px}
.agent-chip{border:1px solid #eceaf5;background:#faf9ff;color:#322d4e;font-weight:600;border-radius:12px}
.ghost-btn{border:1px solid #e7e5ef;color:#605a73;border-radius:12px;background:#fff}
.layout{height:calc(100dvh - 78px);grid-template-columns:minmax(300px,340px) minmax(410px,1fr) minmax(275px,320px);gap:14px;padding:14px;background:transparent}
.inbox-panel,.chat-panel,.detail-panel{border:1px solid var(--stroke);border-radius:20px;background:rgba(255,255,255,.96);box-shadow:var(--shadow);overflow:hidden}
.inbox-panel{border-right:1px solid var(--stroke)}
.inbox-head{padding:21px 20px 13px}.inbox-head h2{font-size:18px;font-weight:700;letter-spacing:-.02em}.inbox-head p{font-size:12.5px;color:var(--muted-2)}
.icon-btn{border:1px solid #e9e7f1;background:#fbfaff;color:#777088;border-radius:11px;transition:.16s ease}.icon-btn:hover{border-color:#dcd5ff;background:#f3f0ff;color:var(--brand)}
.search-wrap{height:44px;margin:0 17px 13px;border:1px solid #e7e6ef;border-radius:13px;background:#fafafe;color:#a09aaf}.search-wrap:focus-within{border-color:#bfb1ff;box-shadow:0 0 0 4px rgba(118,87,246,.08);background:#fff}
.status-tabs{gap:5px;padding:0 16px 13px;border-bottom:1px solid #eeedf4}.tab{font-size:12.5px;font-weight:600;border-radius:10px;padding:8px 10px}.tab.active,.tab:hover{background:#f0edff;color:var(--brand)}
.conversation-list{padding:9px 10px 14px}.conv{padding:14px 12px;border:1px solid transparent;border-radius:15px;margin-bottom:6px;transition:.16s ease}.conv:hover{background:#faf9ff;border-color:#ece8ff}.conv.selected{background:linear-gradient(135deg,#f1edff,#faf9ff);border-color:#dcd3ff;box-shadow:0 8px 20px rgba(118,87,246,.08)}.conv b{font-size:13.5px;font-weight:650}.conv small{font-size:12px;color:#8a91a4}.conv:before{width:42px;height:42px;background:linear-gradient(145deg,#ede8ff,#dfeaff);color:var(--brand);font-weight:700}
.chat-panel{border-right:1px solid var(--stroke)}
.chat-head{height:76px;flex-basis:76px;padding:0 20px;border-bottom:1px solid #ecebf3;background:#fff}.visitor-avatar{width:44px;height:44px;background:linear-gradient(145deg,var(--brand),#9c82ff);box-shadow:0 7px 18px rgba(118,87,246,.19)}.chat-title-wrap strong{font-size:14.5px;font-weight:700}.chat-title-wrap span{color:#8b92a5}
.message-stream{padding:26px;background:radial-gradient(circle at 92% 8%,rgba(139,111,255,.08),transparent 24%),linear-gradient(180deg,#fbfaff,#f8f9fd)}
.empty-chat{color:#8e95a8}.empty-icon{width:64px;height:64px;margin:auto;display:grid;place-items:center;border-radius:22px;background:#eeeaff;font-size:28px}.empty-chat h3{font-weight:700;color:#302b47}.empty-chat p{line-height:1.6}
.msg{max-width:min(76%,620px);padding:12px 14px;margin:11px 0;border:1px solid #eceaf3;border-radius:17px;background:#fff;box-shadow:0 7px 20px rgba(54,42,109,.055);font-size:13.5px;line-height:1.55}.msg.agent{background:linear-gradient(145deg,var(--brand),#8d6cfb);border-color:transparent;color:#fff;border-bottom-right-radius:6px;box-shadow:0 10px 24px rgba(118,87,246,.2)}.msg.visitor{border-bottom-left-radius:6px}
.composer{height:auto;min-height:78px;flex-basis:auto;margin:0;padding:14px 17px;border:0;border-top:1px solid #ecebf3;border-radius:0;box-shadow:none;background:#fff}.composer textarea#messageInput{min-height:44px;border:1px solid #e3e2ec;border-radius:14px;background:#fafafe;padding:12px 14px}.composer textarea#messageInput:focus{border-color:#b9aaff;box-shadow:0 0 0 4px rgba(118,87,246,.08);background:#fff}.composer-icon{border:1px solid #e7e5ef;background:#faf9ff;color:#7e7694;border-radius:12px}.composer-icon:hover{color:var(--brand);background:#f1edff}.send-btn{width:44px;height:44px;border-radius:13px;background:linear-gradient(145deg,var(--brand),#8f70ff);box-shadow:0 8px 18px rgba(118,87,246,.24);transition:.16s ease}.send-btn:hover{transform:translateY(-1px);box-shadow:0 11px 24px rgba(118,87,246,.3)}
.detail-panel{padding:0;overflow:auto}.detail-profile{padding:28px 22px 22px;background:linear-gradient(180deg,#fbfaff,#fff);border-bottom:1px solid #ecebf3}.profile-avatar{width:74px;height:74px;background:linear-gradient(145deg,var(--brand),#9c82ff);box-shadow:0 12px 28px rgba(118,87,246,.2);font-weight:700}.detail-profile h3{font-size:16px;font-weight:700}.detail-profile p{color:#9298aa;line-height:1.5}.detail-content{padding:20px 22px;color:#5f6678}.detail-card{margin:0 22px 22px;padding-top:18px;border-top:1px solid #ecebf3}.detail-card h4{font-size:13px;font-weight:700}.danger-outline{border-color:#ffd5dc;background:#fff7f8;color:#c4475a;border-radius:12px;font-weight:650}
.modal{backdrop-filter:blur(7px);background:rgba(25,20,48,.34)}.modalBox{border:1px solid rgba(255,255,255,.8);border-radius:22px;box-shadow:0 30px 90px rgba(31,24,67,.22)}.primary-btn{background:linear-gradient(145deg,var(--brand),#8f70ff);border-radius:12px;box-shadow:0 9px 20px rgba(118,87,246,.2)}
.login{background:radial-gradient(circle at 12% 15%,#eee9ff 0,transparent 32%),radial-gradient(circle at 88% 82%,#e9e6ff 0,transparent 30%),#f8f7fc}.login-card{border-radius:24px;border-color:#eae7f4;box-shadow:0 28px 80px rgba(57,43,121,.14)}.brand-mark{background:linear-gradient(145deg,var(--brand),#9b7cff);box-shadow:0 10px 24px rgba(118,87,246,.22)}
@media(max-width:1180px){.layout{grid-template-columns:minmax(280px,330px) 1fr}.detail-panel{display:none}}
@media(max-width:780px){.rail{width:66px;flex-basis:66px;padding-inline:9px}.rail-logo{width:44px;height:44px}.layout{grid-template-columns:1fr;padding:8px;gap:8px}.inbox-panel{position:absolute;z-index:20;left:74px;top:86px;bottom:8px;width:min(330px,calc(100vw - 84px))}.chat-panel{grid-column:1}.topbar{padding:0 14px}.topbar-title .status-pill{display:none}}

/* v9 exact LiveChatKu chat-square brand icon */
.rail-logo:before{content:none!important}.rail-logo svg,.brand-mark svg{width:24px;height:24px;stroke:#fff;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}.brand-mark svg{width:25px;height:25px}.rail-logo circle,.brand-mark circle{fill:#fff;stroke:none}


/* v10 polish: login, tabs, and settings only. Core layout/logic unchanged. */
.login{padding:32px 18px;background:#f5f6f8}
.login-card{width:min(600px,94vw);padding:52px 54px 44px;border-radius:22px;border:1px solid #e3e6ec;box-shadow:0 22px 60px rgba(24,31,48,.09)}
.login-brand{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:44px;color:var(--brand)}
.login-brand .brand-mark{width:34px;height:34px;border-radius:8px;box-shadow:none}
.login-brand strong{font-size:30px;letter-spacing:-.035em}
.login-heading{text-align:center;margin-bottom:28px}
.login-heading h1{margin:0;font-size:30px;letter-spacing:-.035em;color:#151c2f}
.login-heading p{max-width:460px;margin:10px auto 0;color:#6d7485;line-height:1.55}
.login-card label{font-size:15px;color:#1d2639;margin:17px 0}
.login-card input{height:54px;margin-top:8px;border-radius:11px;background:#fff;border-color:#d7dce5;font-size:15px;padding:0 16px}
.login-password-wrap{position:relative}
.login-password-wrap input{padding-right:52px}
.password-toggle{position:absolute;right:8px;top:16px;width:38px;height:38px;border:0;background:transparent;color:#8a93a5;font-size:18px;border-radius:9px}
.password-toggle:hover{background:#f2efff;color:var(--brand)}
.login-submit{height:56px;margin-top:12px;font-size:16px;border-radius:11px}
.login-signup{text-align:center;margin:28px 0 0;color:#6d7485}
.login-signup a{color:var(--brand);font-weight:700;text-decoration:none}

.status-tabs{display:grid!important;grid-template-columns:repeat(3,1fr);gap:4px!important;margin:0 14px 12px!important;padding:4px!important;border:1px solid #e8e9ef!important;border-radius:11px!important;background:#f5f6f8!important}
.status-tabs .tab{width:100%;min-height:36px;padding:7px 8px!important;border-radius:8px!important;color:#697386!important;font-size:12px!important;font-weight:650!important;box-shadow:none!important}
.status-tabs .tab:hover{background:#fff!important;color:var(--brand)!important}
.status-tabs .tab.active{background:#fff!important;color:var(--brand)!important;box-shadow:0 1px 5px rgba(28,35,52,.09)!important}
.tab-badge{min-width:18px;height:18px;font-size:10px;border-radius:9px}

.modal-wide{width:min(1040px,96vw);max-height:92dvh}
.settings-sections{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:18px}
.settings-sections>.integration-card{min-height:100%}
.settings-sections>.setting-form{grid-column:1/-1}
.setting-card,.integration-card{border-color:#e4e7ee;border-radius:16px;padding:20px;box-shadow:none}
.setting-card:hover{transform:none;box-shadow:none;border-color:#dcdfea}
.integration-card h3,.setting-card h3{font-size:17px;letter-spacing:-.015em;color:#182136}
.integration-card p{line-height:1.5}
.code-box{min-height:178px;max-height:230px;resize:vertical;border-radius:11px;padding:16px;font-size:12.5px;line-height:1.55}
.compact-btn{height:44px;padding-inline:18px}
.copy-row input{height:44px;background:#fff}
.setting-form>.setting-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 28px}
.setting-form>.setting-card>h3{grid-column:1/-1;margin-bottom:4px}
.setting-card label{min-height:42px;margin:0;padding:9px 0;border-bottom:1px solid #f0f1f5;font-weight:550;color:#273147}
.setting-card input:not([type=checkbox]):not([type=range]),.setting-card select{border:1px solid #dce0e8;border-radius:9px;padding:9px 10px;max-width:260px}
.setting-card input[type=checkbox]{width:18px;height:18px;accent-color:var(--brand)}
.setting-card input[type=range]{accent-color:var(--brand)}
.upload-stack{grid-column:1/-1;display:grid;gap:10px;margin-top:4px}
.setting-card .upload-field{border:1px solid #eceef3;border-radius:11px;padding:12px 14px;background:#fafbfc}
.setting-form>.primary-btn,.setting-form>#allowNotif{width:auto;min-width:210px;justify-self:start}
@media(max-width:800px){.settings-sections{grid-template-columns:1fr}.setting-form>.setting-card{grid-template-columns:1fr}.login-card{padding:38px 24px}.login-brand{margin-bottom:32px}}


/* v13: wider, stable experience editor */
.modalBox:has(.experience-grid){width:min(1320px,97vw);max-height:94dvh;padding:24px 26px;overflow-y:auto;overflow-x:hidden}
.modalBox:has(.experience-grid) .modal-head{position:sticky;top:-24px;z-index:12;background:rgba(255,255,255,.97);backdrop-filter:blur(12px);padding-top:20px}
.experience-grid{grid-template-columns:minmax(620px,1fr) 390px;gap:24px;align-items:start}
.livechat-settings-form{min-width:0;gap:18px;padding-bottom:4px}
.livechat-settings-form>.setting-card{padding:22px;border-radius:18px}
.link-editor{gap:14px}
.link-editor-row{grid-template-columns:36px minmax(0,1fr) 42px;gap:12px;padding:16px;border-radius:16px;background:#fff;box-shadow:0 5px 18px rgba(15,23,42,.045)}
.link-fields{grid-template-columns:minmax(180px,.95fr) minmax(260px,1.65fr) minmax(90px,.45fr);gap:12px}
.link-fields label{font-size:12px;font-weight:650;color:#475569}
.link-fields input{min-width:0;height:44px;padding:11px 12px;border-radius:11px;font-size:14px}
.drag-handle{align-self:center;width:34px;height:44px;border-radius:10px;background:#f8fafc}
.link-actions{align-self:center;gap:7px}
.link-actions button{width:38px;height:36px;border-radius:10px;transition:.16s ease}
.link-actions button:hover{transform:translateY(-1px);border-color:#c4b5fd;background:#f5f3ff;color:#6d28d9}
.publish-btn{position:static!important;bottom:auto!important;z-index:auto!important;width:100%;min-height:50px;margin-top:2px;border-radius:14px;box-shadow:0 10px 24px rgba(118,87,246,.20)!important}
.experience-preview{width:390px;height:720px;top:8px;border-radius:22px}
@media(max-width:1080px){.modalBox:has(.experience-grid){width:min(960px,97vw)}.experience-grid{grid-template-columns:1fr}.experience-preview{position:relative;top:auto;width:100%;max-width:430px;height:720px;margin:0 auto}.link-fields{grid-template-columns:1fr 1.4fr 100px}}
@media(max-width:700px){.modalBox:has(.experience-grid){padding:16px}.modalBox:has(.experience-grid) .modal-head{top:-16px}.link-editor-row{grid-template-columns:28px minmax(0,1fr) 40px;padding:12px}.link-fields{grid-template-columns:1fr}.experience-preview{height:640px}.publish-btn{min-height:48px}}

/* v14.2 — stable scrollable experience editor + tenant-safe layout */
.modalBox:has(.experience-grid){
  width:min(1440px,98vw);
  max-height:94dvh;
  padding:0;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
}
.modalBox:has(.experience-grid) .modal-head{
  position:sticky;
  top:0;
  z-index:30;
  margin:0;
  padding:22px 28px 18px;
  background:rgba(255,255,255,.98);
  backdrop-filter:blur(12px);
  border-bottom:1px solid #e7ebf1;
}
.modalBox:has(.experience-grid) .experience-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,410px);
  gap:26px;
  align-items:start;
  min-width:0;
  padding:20px 28px 28px;
}
.livechat-settings-form{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  min-width:0;
  overflow:visible;
  padding:0;
}
.livechat-settings-form>.setting-card{
  display:block!important;
  width:100%;
  min-width:0;
  padding:22px;
  border:1px solid #e3e8f0;
  border-radius:18px;
  background:#fff;
  box-sizing:border-box;
}
.livechat-settings-form>.setting-card>.section-title-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.livechat-settings-form>.setting-card>.section-title-row h3{margin:0 0 5px;font-size:18px;line-height:1.3;color:#172036}
.livechat-settings-form>.setting-card>.section-title-row p{margin:0;color:#64748b;line-height:1.5}
.livechat-settings-form .setting-card input:not([type=checkbox]):not([type=range]),
.livechat-settings-form .setting-card select,
.livechat-settings-form .setting-card textarea{width:100%;max-width:none!important;min-width:0;box-sizing:border-box}
.livechat-settings-form .setting-card label{min-height:0;border-bottom:0}

/* Eye-catcher controls stay on one clean row when space permits. */
.eye-catcher-settings .welcome-logo-editor{
  display:grid;
  grid-template-columns:minmax(180px,.8fr) minmax(280px,1.2fr);
  gap:18px;
  align-items:center;
  margin:0 0 16px;
  padding:0;
}
.eye-catcher-settings .eye-catcher-preview{min-height:62px;display:flex;align-items:center;color:#64748b}
.eye-catcher-settings .upload-control{width:100%;min-width:0}

/* Custom-link rows: fields may shrink; action buttons never escape the card. */
.livechat-settings-form .link-editor{display:grid;gap:14px;width:100%;min-width:0}
.livechat-settings-form .empty-links{width:100%;min-height:76px;display:grid;place-items:center;border:1px dashed #cbd5e1;border-radius:14px;color:#94a3b8;background:#fbfcfe;box-sizing:border-box}
.livechat-settings-form .link-editor-row{
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 42px;
  gap:12px;
  align-items:center;
  width:100%;
  min-width:0;
  padding:14px;
  border:1px solid #e1e7ef;
  border-radius:16px;
  background:#fbfcfe;
  box-shadow:none;
  box-sizing:border-box;
  overflow:hidden;
}
.livechat-settings-form .drag-handle{display:grid;place-items:center;width:32px;height:44px;padding:0;border:0;border-radius:9px;background:#f1f5f9;color:#94a3b8;cursor:grab}
.livechat-settings-form .drag-handle:active{cursor:grabbing}
.livechat-settings-form .link-fields{
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.45fr) minmax(72px,.36fr);
  gap:12px;
  width:100%;
  min-width:0;
}
.livechat-settings-form .link-fields label{display:grid!important;grid-template-columns:minmax(0,1fr);gap:7px!important;margin:0!important;padding:0!important;min-width:0;font-size:12px;font-weight:700;color:#475569}
.livechat-settings-form .link-fields input{width:100%;min-width:0;height:46px;padding:11px 12px;border:1px solid #d8e0ea;border-radius:11px;background:#fff;font-size:14px;outline:none;box-sizing:border-box;transition:border-color .16s ease,box-shadow .16s ease}
.livechat-settings-form .link-fields input:focus{border-color:#8b7cf6;box-shadow:0 0 0 4px rgba(124,92,255,.09)}
.livechat-settings-form .link-actions{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:42px;min-width:42px}
.livechat-settings-form .link-actions button{display:grid;place-items:center;width:38px;height:36px;padding:0;border:1px solid #dce3ec;border-radius:10px;background:#fff;color:#475569;font-size:15px;line-height:1;cursor:pointer;transition:transform .16s ease,border-color .16s ease,background .16s ease,color .16s ease}
.livechat-settings-form .link-actions button:hover{transform:translateY(-1px);border-color:#c7bdfc;background:#f5f3ff;color:#6d28d9}
.livechat-settings-form .link-actions button[data-remove]:hover{border-color:#fecaca;background:#fff1f2;color:#dc2626}

/* Preview follows scrolling, but the modal itself remains the only scroll container. */
.experience-preview{position:sticky;top:92px;width:100%;height:744px;min-width:0;border:1px solid #dce3ec;border-radius:24px;background:#f8fafc;box-shadow:0 18px 48px rgba(15,23,42,.12)}

/* Save button belongs to document flow. It never overlays editor controls. */
.livechat-settings-form .publish-btn{position:static!important;inset:auto!important;z-index:auto!important;width:100%;min-height:54px;margin:0;border-radius:14px;background:linear-gradient(135deg,#7357f6,#9257f6);box-shadow:0 10px 26px rgba(118,87,246,.22)!important}

@media(max-width:1180px){
  .modalBox:has(.experience-grid){width:min(1040px,98vw)}
  .modalBox:has(.experience-grid) .experience-grid{grid-template-columns:1fr;padding:18px 22px 26px}
  .experience-preview{position:relative;top:auto;width:min(430px,100%);height:720px;margin:4px auto 0}
}
@media(max-width:820px){
  .modalBox:has(.experience-grid) .modal-head{padding:18px}
  .modalBox:has(.experience-grid) .experience-grid{padding:16px 18px 22px}
  .livechat-settings-form>.setting-card{padding:18px}
  .eye-catcher-settings .welcome-logo-editor{grid-template-columns:1fr}
  .livechat-settings-form .link-fields{grid-template-columns:1fr}
  .livechat-settings-form .link-editor-row{grid-template-columns:30px minmax(0,1fr) 40px;padding:12px}
  .livechat-settings-form .link-actions{width:40px;min-width:40px}
  .livechat-settings-form .link-actions button{width:36px;height:34px}
}
@media(max-width:560px){
  .livechat-settings-form>.setting-card>.section-title-row{flex-direction:column;align-items:stretch}
  .livechat-settings-form>.setting-card>.section-title-row .ghost-btn{width:100%}
  .livechat-settings-form .link-editor-row{grid-template-columns:1fr;gap:10px;overflow:visible}
  .livechat-settings-form .drag-handle{width:100%;height:30px}
  .livechat-settings-form .link-actions{width:100%;min-width:0;flex-direction:row;justify-content:flex-end}
  .experience-preview{height:640px}
}

/* v14.3 — member identity, reliable refresh and conversation list polish */
.conv{display:grid!important;grid-template-columns:42px minmax(0,1fr);align-items:center;column-gap:11px;text-align:left;width:100%}
.conv:before{display:none!important}
.conv-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:750;font-size:14px;box-shadow:0 5px 14px rgba(15,23,42,.08);flex:0 0 42px}
.conv-copy{display:grid;min-width:0;gap:3px}.conv-copy b,.conv-copy small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conv-copy b{color:#172033}.conv-copy .badge-count{margin-left:7px;vertical-align:middle}
.icon-btn.is-refreshing{animation:lckRefreshSpin .7s linear infinite;pointer-events:none}@keyframes lckRefreshSpin{to{transform:rotate(360deg)}}
.visitor-avatar,.profile-avatar,.prechat-avatar{transition:background .18s ease}


/* v14.4 dashboard conversation lifecycle */
#closeChat.reopen-chat-action{border-color:#d8ceff!important;background:#f3efff!important;color:#6d4aff!important;font-weight:750}.icon-btn.is-refreshing{animation:lckRefreshSpin .65s linear infinite}@keyframes lckRefreshSpin{to{transform:rotate(360deg)}}

/* v14.5 — conversation close events + widget appearance editor */
.conversation-closed-event.admin-close-event{width:100%;max-width:680px;margin:24px auto 10px;padding:12px 18px;text-align:center;color:#64748b;font-size:13px;border-top:1px solid #e5e7eb;border-bottom:1px solid #eef2f7;background:linear-gradient(90deg,transparent,#f8fafc,transparent)}
.appearance-settings{overflow:hidden}.appearance-groups{display:grid;gap:24px}.appearance-label{display:block;margin-bottom:10px;color:#64748b;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.appearance-options{display:flex;gap:12px;flex-wrap:wrap}.appearance-choice{position:relative;display:grid;place-items:center;gap:5px;width:92px;min-height:98px;padding:12px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;cursor:pointer;transition:.18s ease}.appearance-choice:hover{border-color:#8b5cf6;box-shadow:0 8px 20px rgba(124,92,255,.08)}.appearance-choice input{position:absolute;opacity:0;pointer-events:none}.appearance-choice:has(input:checked){border:2px solid #5b8cff;background:#f8fbff;box-shadow:0 0 0 3px #5b8cff12}.appearance-choice:has(input:checked):after{content:'✓';position:absolute;right:-7px;top:-7px;width:23px;height:23px;border-radius:50%;display:grid;place-items:center;background:#5b8cff;color:#fff;font-size:12px;font-weight:900}.appearance-icon{font-size:31px;line-height:1;color:#525866}.appearance-choice b{font-size:13px;color:#64748b}.appearance-color-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.appearance-color-grid label{display:grid;grid-template-columns:auto 52px 90px;gap:12px;align-items:center;padding:12px 14px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;font-weight:650}.appearance-color-grid input[type=color]{width:46px;height:38px;padding:2px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;cursor:pointer}.appearance-color-grid span{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#64748b;font-size:12px}@media(max-width:700px){.appearance-color-grid{grid-template-columns:1fr}.appearance-color-grid label{grid-template-columns:1fr 52px 86px}}

/* v14.6 — appearance editor polish */
.appearance-color-grid-single{grid-template-columns:minmax(320px,560px)!important}
.appearance-help{margin:10px 0 0;max-width:680px;color:#64748b;font-size:12px;line-height:1.55}
.appearance-settings .appearance-groups{gap:20px}.appearance-settings .appearance-choice{width:100px;min-height:104px;border-radius:14px}.appearance-settings .appearance-icon{font-size:29px}.appearance-settings .appearance-color-grid label{grid-template-columns:minmax(120px,1fr) 52px 92px;max-width:560px}
@media(max-width:700px){.appearance-color-grid-single{grid-template-columns:1fr!important}.appearance-settings .appearance-color-grid label{grid-template-columns:1fr 52px 86px}}
/* dashboard visual refinement only */
.chat-panel,.conversation-list,.conversation-view,.visitor-detail{border-color:#e5e9f2!important;box-shadow:0 10px 32px rgba(15,23,42,.045)}
.message-bubble,.chat-bubble{border-radius:16px}.conversation-item{border-radius:14px;transition:background .16s ease,border-color .16s ease,transform .16s ease}.conversation-item:hover{transform:translateY(-1px)}

/* v14.11 eye-catcher position controls */
.eye-position-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px;padding:12px 14px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fafc;color:#64748b}.eye-position-tools b{color:#334155;font-size:12px}.eye-position-tools .ghost-btn{margin-left:auto}

/* v14.16 — visible close/archive state inside dashboard chat */
.conversation-closed-event.admin-close-event{max-width:620px!important;margin:28px auto 16px!important;padding:22px 24px!important;border:1px solid #e5e7eb!important;border-radius:18px!important;background:#fff!important;box-shadow:0 10px 30px rgba(15,23,42,.06)!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:14px!important;text-align:center!important;color:#475569!important}
.admin-close-copy{display:flex;flex-direction:column;gap:5px}.admin-close-copy strong{font-size:14px;color:#0f172a}.admin-close-copy span{font-size:12px;color:#64748b}.admin-inline-reopen{border:0;border-radius:10px;background:#6d4aff;color:#fff;font-weight:750;padding:10px 18px;cursor:pointer;box-shadow:0 8px 20px rgba(109,74,255,.22)}.admin-inline-reopen:hover{filter:brightness(.97);transform:translateY(-1px)}


/* v14.21 — archive audit timestamps */
.chat-session-start{display:flex;justify-content:center;align-items:center;margin:8px 0 16px;color:#667085;font-size:12px}
.chat-session-start span{background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:5px 10px;box-shadow:0 2px 8px rgba(15,23,42,.06)}
#messages .msg[data-time]{position:relative}
/* v14.23 — audit time tooltip is positioned by JS so it never escapes the chat panel. */
.message-audit-tooltip{position:fixed;z-index:100000;display:none;max-width:min(260px,calc(100vw - 24px));padding:7px 10px;border-radius:8px;background:#111827;color:#fff;font-size:11px;font-weight:650;line-height:1.15;white-space:nowrap;box-shadow:0 8px 24px rgba(15,23,42,.28);pointer-events:none;transform:translateX(-50%)}
.message-audit-tooltip.is-visible{display:block}
.message-audit-tooltip::after{content:"";position:absolute;left:50%;transform:translateX(-50%);border:6px solid transparent}
.message-audit-tooltip.place-above::after{top:100%;border-top-color:#111827}
.message-audit-tooltip.place-below::after{bottom:100%;border-bottom-color:#111827}

.conv-copy .conv-time{display:block;margin-top:3px;font-style:normal;font-size:10px;color:#98a2b3;letter-spacing:.01em}


/* v14.22: tenant theme sync + clean bubble metadata + right-click actions */
.msg.agent{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;overflow:visible!important}
.msg.visitor{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;overflow:visible!important}
.msg .message-body{display:block;padding:11px 14px;border-radius:16px;background:#fff;border:1px solid #eceaf3;box-shadow:0 5px 16px rgba(20,26,40,.05)}
.msg.agent .message-body{background:var(--chat-brand,var(--brand))!important;border-color:var(--chat-brand,var(--brand))!important;color:#fff!important;border-bottom-right-radius:6px}
.msg.visitor .message-body{border-bottom-left-radius:6px}
.msg .sender-name{margin:0 0 5px 7px}
.msg .receipt{position:static!important;display:block!important;margin:5px 4px 0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;font-size:11px!important;line-height:1.2!important;color:#7b8495!important}
.msg.agent .receipt{text-align:right!important;color:#7b8495!important}
.msg.visitor .receipt{text-align:left!important}
.msg .actions{display:none!important}
.message-context-menu{position:fixed;z-index:99999;min-width:160px;padding:6px;background:#fff;border:1px solid #e5e7eb;border-radius:11px;box-shadow:0 16px 42px rgba(15,23,42,.18)}
.message-context-menu button{display:block;width:100%;padding:9px 11px;border:0;border-radius:8px;background:transparent;text-align:left;font:inherit;color:#273244;cursor:pointer}
.message-context-menu button:hover{background:#f4f6f8}.message-context-menu button.danger{color:#c93737}.message-context-menu button.danger:hover{background:#fff1f1}
.send-btn{background:var(--chat-brand,var(--brand))!important;background-image:none!important}
.msg.agent{color:inherit!important}

/* v14.24 master global brand */
.rail-logo,.rail-btn.active,.rail-btn:hover{background:linear-gradient(145deg,var(--blue),var(--blue2));color:#fff}.visitor-avatar,.profile-avatar{background:linear-gradient(145deg,var(--blue),var(--blue2))}.tab.active,.tab:hover{color:var(--blue);background:color-mix(in srgb,var(--blue2) 14%,white)}.conv:hover,.conv.selected{background:color-mix(in srgb,var(--blue2) 10%,white)}.master-branding-card{border:2px solid color-mix(in srgb,var(--blue) 25%,#e5eaf2)}.branding-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.branding-grid input[type=color]{width:100%;height:46px;padding:4px;border:1px solid #d8deea;border-radius:10px;background:#fff}

/* v14.25 global brand image: preserve uploaded PNG proportions, no tile/background */
.global-brand-icon{display:block;width:100%;height:100%;object-fit:contain;object-position:center;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.rail-logo:has(.global-brand-icon),.login-brand .brand-mark:has(.global-brand-icon){background:transparent!important;box-shadow:none!important;border:0!important}
.rail-logo:has(.global-brand-icon){width:48px;height:48px;padding:3px;border-radius:0!important}
.login-brand .brand-mark:has(.global-brand-icon){width:40px;height:40px;padding:2px;border-radius:0!important}


/* v14.27 — global blue branding: remove remaining purple UI */
:root{--brand:var(--blue)!important;--brand-2:var(--blue2)!important;--brand-soft:color-mix(in srgb,var(--blue2) 14%,white)!important;--brand-faint:color-mix(in srgb,var(--blue2) 7%,white)!important}
.primary-btn,.compact-btn.primary-btn{background:linear-gradient(135deg,var(--blue),var(--blue2))!important;box-shadow:0 9px 20px color-mix(in srgb,var(--blue) 20%,transparent)!important}
.rail-logo,.rail-btn.active,.rail-btn:hover,.visitor-avatar,.profile-avatar,.prechat-avatar,.transfer-avatar{background:linear-gradient(145deg,var(--blue),var(--blue2))!important}
.message.agent,.msg.agent,.send-btn,.admin-inline-reopen{background:var(--blue)!important;border-color:var(--blue)!important}
.appearance-choice:hover{border-color:var(--blue)!important;box-shadow:0 8px 20px color-mix(in srgb,var(--blue) 8%,transparent)!important}
.appearance-choice:has(input:checked){border-color:var(--blue)!important;background:color-mix(in srgb,var(--blue2) 8%,white)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 8%,transparent)!important}
.appearance-choice:has(input:checked):after{background:var(--blue)!important}
.banned-avatar{background:color-mix(in srgb,var(--blue2) 15%,white)!important;color:var(--blue)!important}

/* v14.28 — compact professional chat bubbles */
#messages .msg.agent,
#messages .msg.visitor{
  width:fit-content!important;
  min-width:0!important;
  max-width:min(68%,520px)!important;
  margin-top:12px!important;
  margin-bottom:12px!important;
}
#messages .msg.agent{margin-left:auto!important;margin-right:2px!important}
#messages .msg.visitor{margin-left:2px!important;margin-right:auto!important}
#messages .msg .sender-name{
  display:block!important;
  width:max-content!important;
  max-width:100%!important;
  margin:0 7px 5px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  font-size:11px!important;
  line-height:1.2!important;
  font-weight:750!important;
  color:#667085!important;
}
#messages .msg.agent .sender-name{text-align:right!important;margin-left:auto!important;color:#667085!important}
#messages .msg .message-body{
  display:block!important;
  width:fit-content!important;
  min-width:0!important;
  max-width:100%!important;
  padding:10px 13px!important;
  border-radius:14px!important;
  line-height:1.45!important;
}
#messages .msg.agent .message-body{
  margin-left:auto!important;
  background:var(--chat-brand,var(--blue))!important;
  border-color:var(--chat-brand,var(--blue))!important;
  border-bottom-right-radius:5px!important;
}
#messages .msg.visitor .message-body{border-bottom-left-radius:5px!important}
#messages .msg .receipt{
  width:auto!important;
  margin:5px 5px 0!important;
  padding:0!important;
  font-size:10.5px!important;
  line-height:1.15!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
#messages .msg.agent .receipt{text-align:right!important;color:#7b8495!important}
#messages .msg.visitor .receipt{text-align:left!important;color:#7b8495!important}
@media(max-width:760px){
  #messages .msg.agent,#messages .msg.visitor{max-width:82%!important}
}


/* v14.29 — clean LiveChatKu empty-state icon */
.empty-chat .empty-icon{
  width:82px!important;height:82px!important;margin:0 auto 8px!important;
  display:grid!important;place-items:center!important;
  background:transparent!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;padding:0!important;overflow:visible!important;
}
.empty-chat .empty-icon img{
  display:block!important;width:72px!important;height:72px!important;
  object-fit:contain!important;background:transparent!important;border:0!important;box-shadow:none!important;
}
\n\n/* v14.30 — dashboard history scroll + detached message metadata */
#messages.message-stream{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
}
#messages .msg.agent,
#messages .msg.visitor{
  display:flex!important;
  flex-direction:column!important;
  width:min(68%,520px)!important;
  max-width:min(68%,520px)!important;
  min-width:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  overflow:visible!important;
  gap:0!important;
}
#messages .msg.agent{
  align-items:flex-end!important;
  margin-left:auto!important;
  margin-right:2px!important;
}
#messages .msg.visitor{
  align-items:flex-start!important;
  margin-left:2px!important;
  margin-right:auto!important;
}
#messages .msg .sender-name{
  display:block!important;
  width:auto!important;
  max-width:100%!important;
  margin:0 7px 5px!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#667085!important;
  font-size:11px!important;
  line-height:1.2!important;
  font-weight:750!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#messages .msg.agent .sender-name{
  align-self:flex-end!important;
  text-align:right!important;
}
#messages .msg.visitor .sender-name{
  align-self:flex-start!important;
  text-align:left!important;
}
#messages .msg .message-body{
  display:block!important;
  flex:0 0 auto!important;
  width:fit-content!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:9px 13px!important;
  border-radius:14px!important;
  line-height:1.4!important;
  overflow-wrap:anywhere!important;
}
#messages .msg.agent .message-body{
  align-self:flex-end!important;
  margin-left:auto!important;
  border-bottom-right-radius:5px!important;
}
#messages .msg.visitor .message-body{
  align-self:flex-start!important;
  margin-right:auto!important;
  border-bottom-left-radius:5px!important;
}
#messages .msg .receipt{
  display:block!important;
  align-self:auto!important;
  width:auto!important;
  max-width:100%!important;
  margin:5px 6px 0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:#7b8495!important;
  font-size:10px!important;
  line-height:1.15!important;
  font-weight:500!important;
}
#messages .msg.agent .receipt{
  align-self:flex-end!important;
  text-align:right!important;
}
#messages .msg.visitor .receipt{
  align-self:flex-start!important;
  text-align:left!important;
}
@media(max-width:760px){
  #messages .msg.agent,#messages .msg.visitor{
    width:min(84%,460px)!important;
    max-width:min(84%,460px)!important;
  }
}


/* v14.42 — consistent member avatar identity + borderless chat images */
.msg.image-message{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  overflow:visible!important;
}
.msg.image-message .message-body{
  padding:0!important;
  margin:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  overflow:visible!important;
}
.msg.image-message .chat-image-button{
  display:block!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  border-radius:0!important;
  overflow:visible!important;
  box-shadow:none!important;
}
.msg.image-message .chat-image-button img{
  display:block!important;
  width:auto!important;
  max-width:min(520px,65vw)!important;
  height:auto!important;
  max-height:420px!important;
  object-fit:contain!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
.msg.image-message .sender-name{margin:0 0 5px 0!important}
.msg.image-message .receipt{margin-top:5px!important}

/* v14.43 — image attachment must be a clean media block, never a colored chat bubble */
#messages .msg.image-message,
#messages .msg.agent.image-message,
#messages .msg.visitor.image-message{
  width:auto!important;
  max-width:min(72%,440px)!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  overflow:visible!important;
}
#messages .msg.image-message .message-body,
#messages .msg.agent.image-message .message-body,
#messages .msg.visitor.image-message .message-body{
  display:block!important;
  width:auto!important;
  max-width:100%!important;
  padding:0!important;
  margin:0!important;
  background:transparent!important;
  color:inherit!important;
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
  overflow:visible!important;
}
#messages .msg.image-message .chat-image-button{
  display:block!important;
  width:auto!important;
  max-width:100%!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  border-radius:0!important;
  box-shadow:none!important;
  overflow:visible!important;
  line-height:0!important;
}
#messages .msg.image-message .chat-image-button img,
#messages .msg.image-message .message-body>img{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:min(100%,420px)!important;
  max-height:300px!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:transparent!important;
}
#messages .msg.agent.image-message{align-items:flex-end!important}
#messages .msg.visitor.image-message{align-items:flex-start!important}
#messages .msg.image-message .sender-name{margin:0 0 5px!important}
#messages .msg.image-message .receipt{margin:5px 2px 0!important}
@media(max-width:760px){
  #messages .msg.image-message,
  #messages .msg.agent.image-message,
  #messages .msg.visitor.image-message{max-width:78%!important}
  #messages .msg.image-message .chat-image-button img,
  #messages .msg.image-message .message-body>img{max-width:100%!important;max-height:240px!important}
}
/* FIX LINK CHAT BISA DIKLIK */
.message-body a {
    color: inherit !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.msg {
    pointer-events: auto !important;
}

.msg .message-body {
    pointer-events: auto !important;
}

.msg .message-body a {
    pointer-events: auto !important;
}