/* AK Chat UI */
#akchat-root.akchat{
position:fixed; right:110px; bottom:200px; z-index:999999;
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif;
}
#akchat-root .akchat-btn{
border:0; border-radius:999px; padding:12px 16px; cursor:pointer;
box-shadow:0 8px 30px rgba(0,0,0,.15);
background:#8fc002; color:#fff; font-weight:700;
}
#akchat-root .akchat-panel{
width:360px; max-width:calc(100vw - 32px);
height:560px;
background:#fff; border-radius:14px;
box-shadow:0 12px 40px rgba(0,0,0,.18);
overflow:hidden; display:none;
}
#akchat-root .akchat-panel.is-open{ display:block; }
#akchat-root .akchat-header{
display:flex; align-items:center; justify-content:space-between;
padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.08);
background:#fff;
}
#akchat-root .akchat-title{ font-weight:800; font-size:14px; }
#akchat-root .akchat-close{ border:0; background:transparent; font-size:18px; cursor:pointer; padding:4px 8px; }
#akchat-root .akchat-tabs{
display:flex; gap:8px; padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.06); background:#fafafa;
}
#akchat-root .akchat-tab{
flex:1; border:1px solid rgba(0,0,0,.08); background:#fff; color:#111;
border-radius:10px; padding:9px 12px; font-size:13px; font-weight:700; cursor:pointer;
}
#akchat-root .akchat-tab.is-active{
background:#8fc002; color:#fff; border-color:#8fc002;
}
#akchat-root .akchat-body{
display:flex; flex-direction:column;
height:calc(560px - 96px);
}
#akchat-root .akchat-pane{ height:100%; }
#akchat-root .akchat-pane-support{ display:flex; flex-direction:column; }
#akchat-root .akchat-lead{ padding:12px; }
#akchat-root .akchat-row{ margin-bottom:10px; }
#akchat-root label{ display:block; font-size:12px; opacity:.8; margin-bottom:4px; }
#akchat-root input, #akchat-root textarea{
width:100%; box-sizing:border-box;
border:1px solid rgba(0,0,0,.15);
border-radius:10px; padding:10px;
font-size:14px; outline:none;
}
#akchat-root .akchat-hint{ font-size:12px; opacity:.75; margin-top:6px; }

#akchat-root .akchat-cid-status-row{
margin:10px 0;
display:none;
}
#akchat-root .akchat-cid-status-row:not(:empty){
display:block;
}
#akchat-root .akchat-cid-reset-row{
margin-top:12px;
}
#akchat-root #akchat-cid-clear{
font-weight:700;
}
#akchat-root #akchat-cid-pick{
display:none !important;
}

#akchat-root .akchat-cid-dropzone{
border:2px dashed #d0d5dd;
border-radius:10px;
padding:14px;
text-align:center;
cursor:pointer;
background:#fafafa;
color:#475467;
transition:border-color .2s ease, background-color .2s ease, color .2s ease;
user-select:none;
}
#akchat-root .akchat-cid-dropzone:hover,
#akchat-root .akchat-cid-dropzone:focus{
border-color:#8fc002;
background:#f8fbe7;
color:#1f2937;
outline:none;
}
#akchat-root .akchat-cid-dropzone.is-dragover{
border-color:#8fc002;
background:#eef8c9;
}
#akchat-root .akchat-cid-dropzone.is-disabled{
opacity:.6;
cursor:not-allowed;
}
#akchat-root .akchat-cid-dropzone.has-preview{
padding:8px;
}
#akchat-root .akchat-cid-dropzone img{
display:block;
max-width:100%;
max-height:180px;
margin:0 auto 8px;
border-radius:8px;
}
#akchat-root .akchat-cid-dropzone-name{
font-size:13px;
color:#667085;
word-break:break-word;
}

#akchat-root #akchat-cid-install-code{
min-height:88px;
height:88px;
max-height:140px;
resize:vertical;
line-height:1.35;
}

#akchat-root .akchat-primary,
#akchat-root .akchat-secondary{
width:100%; border:0; border-radius:10px;
padding:10px 12px; cursor:pointer; font-weight:800;
}
#akchat-root .akchat-primary{ background:#8fc002; color:#fff; }
#akchat-root .akchat-secondary{ background:#eef2f6; color:#111; }
#akchat-root .akchat-messages{
padding:12px; overflow:auto; flex:1;
background:rgba(0,0,0,.02);
}
#akchat-root .akchat-compose{
padding:10px;
padding-bottom: calc(30px + env(safe-area-inset-bottom));
border-top:1px solid rgba(0,0,0,.08);
display:flex;
gap:8px;
align-items:center;
background:#fff;
}
#akchat-root .akchat-compose textarea{
flex:1;
height:44px;
min-height:44px;
max-height:96px;
resize:none;
line-height:1.25;
}
#akchat-root .akchat-compose button{
width:110px;
border-radius:10px;
background:#8fc002; color:#fff; font-weight:800;
}
#akchat-root .akchat-cid-wrap{
height:100%; overflow-y:auto; overflow-x:hidden; padding:12px; padding-bottom:calc(28px + env(safe-area-inset-bottom)); background:rgba(0,0,0,.02); overscroll-behavior:contain;
}
#akchat-root .akchat-cid-status,
#akchat-root .akchat-cid-balance{
border-radius:10px; padding:10px 12px; font-size:13px; line-height:1.45; background:#fff; border:1px solid rgba(0,0,0,.08); overflow-wrap:anywhere; word-break:break-word;
}
#akchat-root .akchat-cid-status.is-loading{ background:#eef5ff; border-color:#c9dafc; }
#akchat-root .akchat-cid-status.is-ok,
#akchat-root .akchat-cid-balance.is-ok{ background:#eef9e8; border-color:#d0e9c1; }
#akchat-root .akchat-cid-status.is-error,
#akchat-root .akchat-cid-balance.is-error{ background:#fff2f2; border-color:#f0c4c4; }
#akchat-root .akchat-cid-result{
margin-top:12px; padding:12px; border-radius:12px; background:#fff; border:1px solid rgba(0,0,0,.08); overflow-x:hidden;
}
#akchat-root .akchat-cid-result:empty{ display:none; }
#akchat-root .akchat-cid-result h4,
#akchat-root .akchat-cid-result h3{ margin:0 0 12px; font-size:15px; }
#akchat-root .akchat-cid-result p{ margin:0 0 10px; }
#akchat-root .akchat-cid-result [id^="confirmation-cid-"]{
display:block; width:100%; box-sizing:border-box; padding:8px 10px; border-radius:8px; background:#eef5ff; overflow-wrap:anywhere; word-break:break-word; white-space:normal; line-height:1.45;
}
#akchat-root .akchat-cid-result .cid-result-table{ width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; table-layout:fixed; }
#akchat-root .akchat-cid-result .cid-result-table th,
#akchat-root .akchat-cid-result .cid-result-table td{ border:1px solid rgba(0,0,0,.12); padding:8px 6px; text-align:center; word-break:break-word; }
#akchat-root .akchat-cid-result .cid-result-table th{ background:#f7f8fa; }
#akchat-root .akchat-cid-wrap > *:last-child{ margin-bottom:0; }
/* Messages */
#akchat-root .m{ margin:0 0 10px; display:flex; }
#akchat-root .m.in{ justify-content:flex-end; }
#akchat-root .m.out{ justify-content:flex-start; }
#akchat-root .b{
max-width:78%;
padding:10px 12px;
border-radius:12px;
font-size:14px;
line-height:1.35;
white-space:pre-wrap;
word-break:break-word;
}
#akchat-root .m.in .b{
background:#8fc002;
color:#fff;
border-bottom-right-radius:6px;
}
#akchat-root .m.out .b{
background:#f1f3f5;
color:#111;
border-bottom-left-radius:6px;
border:1px solid rgba(0,0,0,.06);
}
@media (max-width: 480px){
#akchat-root.akchat{
left:0;
right:0;
bottom:60px;
display:flex;
justify-content:center;
pointer-events:none;
}
#akchat-root .akchat-btn{
pointer-events:auto;
}
#akchat-root .akchat-panel{
position:fixed;
left:50%;
transform:translateX(-50%);
bottom:80px;
width:calc(100vw - 24px);
max-width:380px;
pointer-events:auto;
height:min(560px, calc(100dvh - 120px));
}
#akchat-root .akchat-body{
height:calc(100% - 96px);
}
#akchat-root input,
#akchat-root textarea{
font-size:16px !important;
}
#akchat-root .akchat-cid-result{
padding:10px;
}
#akchat-root .akchat-cid-result h4,
#akchat-root .akchat-cid-result h3{
font-size:14px;
margin-bottom:10px;
}
#akchat-root .akchat-cid-result [id^="confirmation-cid-"]{
padding:8px;
font-size:15px;
}
#akchat-root .akchat-cid-result .cid-result-table{
display:block;
width:100%;
border-collapse:separate;
border-spacing:0;
}
#akchat-root .akchat-cid-result .cid-result-table tr{
display:grid;
grid-template-columns:repeat(4, minmax(0, 1fr));
}
#akchat-root .akchat-cid-result .cid-result-table th,
#akchat-root .akchat-cid-result .cid-result-table td{
padding:7px 4px;
font-size:12px;
line-height:1.2;
}
#akchat-root .akchat-cid-status,
#akchat-root .akchat-cid-balance{
font-size:12.5px;
line-height:1.4;
}

#akchat-root #akchat-cid-install-code{
min-height:72px;
height:72px;
max-height:120px;
}

html{
-webkit-text-size-adjust:100%;
}
}
#akchat-root .akchat-badge{
display:inline-block;
font-size:10px;
font-weight:700;
text-transform:uppercase;
letter-spacing:.3px;
padding:2px 6px;
margin-right:6px;
border-radius:6px;
background:#8fc002;
color:#fff;
vertical-align:middle;
transform:translateY(-1px);
opacity:.9;
}
#akchat-root .is-invalid{
border-color:#d33 !important;
box-shadow:0 0 0 3px rgba(221,51,51,.15);
}

/* Standalone public chat page */
#akchat-root.akchat.akchat-standalone{
position:static;
right:auto;
bottom:auto;
z-index:1;
width:100%;
max-width:none;
margin:0;
}
#akchat-root.akchat.akchat-standalone .akchat-btn{ display:none; }
#akchat-root.akchat.akchat-standalone .akchat-panel{
display:block;
width:100%;
max-width:none;
height:min(82vh, 860px);
min-height:560px;
border-radius:18px;
box-shadow:0 18px 50px rgba(16,24,40,.12);
}
#akchat-root.akchat.akchat-standalone .akchat-body{
height:calc(min(82vh, 860px) - 96px);
min-height:calc(560px - 96px);
}
@media (max-width: 640px){
#akchat-root.akchat.akchat-standalone .akchat-panel{
height:calc(100dvh - 48px);
min-height:420px;
border-radius:14px;
}
#akchat-root.akchat.akchat-standalone .akchat-body{
height:calc(100dvh - 144px);
min-height:276px;
}
}
