#apbd-cht-container {
    position: fixed;
    z-index: 999999;
    bottom: 0px;
    right: 0px
}

#apbd-cht-container .apc-alert-msg {
    bottom: 100px;
    position: absolute;
    z-index: 999;
    right: -500px;
    display: block !important;
    width: calc(100% - 20px) !important;
    color: #fff;
    font-size: 23px;
    border-radius: 5px;
    background: #127f0c;
    -webkit-box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.45);
    -moz-box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.45);
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.45);
    -webkit-transition: all 1000ms;
    -moz-transition: all 1000ms;
    -ms-transition: all 1000ms;
    -o-transition: all 1000ms;
    transition: all 1000ms
}

#apbd-cht-container .apc-alert-msg.apc-success-msg {
    right: 10px
}

#apbd-cht-container .apc-alert-msg.apc-error-msg {
    background: #7f0909;
    right: 10px
}

#apbd-cht-container .apc-header-close-window {
    border-style: none;
    display: inline-block;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    padding: 0px 8px;
    margin: 0;
    height: 30px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    z-index: 15
}

#apbd-cht-container .apc-header-close-window:hover {
    background: rgba(0, 0, 0, 0.19);
    border: 1px solid rgba(0, 0, 0, 0.2)
}

#apbd-cht-container .apc-header-sound {
    border-style: none;
    display: inline-block;
    position: absolute;
    top: 10px;
    right: 40px;
    width: 30px;
    padding: 0px 7px;
    margin: 0;
    height: 30px;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    z-index: 15
}

#apbd-cht-container .apc-header-sound.apc-enable>i {
    color: #ffffff
}

#apbd-cht-container .apc-header-sound.apc-disable {
    background: rgba(0, 0, 0, 0.19);
    border: 1px solid rgba(0, 0, 0, 0.2)
}

#apbd-cht-container .apc-header-sound.apc-disable>i {
    color: #b52b2b
}

#apbd-cht-container .apc-header-sound:hover {
    background: rgba(0, 0, 0, 0.19);
    border: 1px solid rgba(0, 0, 0, 0.2)
}

#apbd-cht-container>.apc-msg-window {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    background: url("https://support.fenisaas-com-417906.hostingersite.com/plugins/apsbd-chat/img/chat-bg5.png") #fff;
    text-align: left;
    position: absolute;
    bottom: 163px;
    width: 370px;
    right: 45px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 14px -1px rgba(0, 0, 0, 0.19);
    z-index: 999
}

#apbd-cht-container>.apc-msg-window .apc-start {
    padding-top: 25px
}

#apbd-cht-container>.apc-msg-window.apc-not-started .apc-msgs {
    display: none
}

#apbd-cht-container>.apc-msg-window.apc-not-started .apc-type-container {
    display: none
}

#apbd-cht-container>.apc-msg-window.apc-not-started .apc-start {
    height: 100%
}

#apbd-cht-container>.apc-msg-window.apc-started .apc-start {
    display: none
}

#apbd-cht-container>.apc-msg-window.apc-ct-not-ready {
    display: none !important
}

#apbd-cht-container>.apc-msg-window>div {
    width: 100%;
    padding: 0px 10px
}

#apbd-cht-container>.apc-msg-window>.apc-header {
    z-index: 10;
    height: auto;
    background: #cf1632;
    background: -moz-linear-gradient(top, #cf1632 0%, #b8142c 100%);
    background: -webkit-linear-gradient(top, #cf1632 0%, #b8142c 100%);
    background: linear-gradient(to bottom, #cf1632 0%, #b8142c 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cf1632', endColorstr='#b8142c', GradientType=0);
    box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.19)
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row {
    -ms-box-orient: horizontal;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -moz-flex;
    display: -webkit-flex;
    display: flex
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row>div {
    display: inline
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row>.apc-company-img {
    border-radius: 50%;
    overflow: hidden;
    width: 57px;
    height: 50px;
    border: 4px solid #a11127;
    margin-top: 7px;
    background: #ffffff
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row>.apc-company-img img {
    height: 42px
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row>.apc-header-info {
    width: 100%;
    padding: 10px 5px;
    color: #ffffff
}

#apbd-cht-container>.apc-msg-window>.apc-header .apc-header-row>.apc-header-info .apc-header-info-title {
    font-size: 16px;
    font-weight: bold
}

#apbd-cht-container>.apc-msg-window .apc-chat-img-dl {
    display: block;
    text-align: center
}

#apbd-cht-container>.apc-msg-window .apc-chat-img {
    text-align: center;
    display: block
}

#apbd-cht-container>.apc-msg-window .apc-chat-img img {
    max-height: 100%;
    max-width: 100%;
    border: 2px solid rgba(204, 204, 204, 0.31);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px
}

#apbd-cht-container>.apc-msg-window .apc-chat-img img:hover {
    border: 2px solid rgba(175, 34, 38, 0.44)
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg {
    background: rgba(243, 139, 155, 0.3);
    padding: 0px !important;
    border-bottom: 2px solid rgba(100, 100, 100, 0.04);
    z-index: 8
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg .apc-msg {
    -webkit-transition: all 1000ms;
    -moz-transition: all 1000ms;
    -ms-transition: all 1000ms;
    -o-transition: all 1000ms;
    transition: all 1000ms;
    overflow: hidden;
    margin: 0;
    margin-top: -500px
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg .apc-msg>i.apc-msg-icon {
    font-size: 26px
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg.apc-show {
    display: block
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg.apc-show .apc-msg {
    padding: 5px;
    margin-top: 0px
}

#apbd-cht-container>.apc-msg-window .apc-system-single-msg.apc-show.apc-show-error {
    background: rgba(255, 18, 7, 0.3)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs {
    height: 100%;
    overflow: auto;
    position: relative;
    background: rgba(207, 22, 50, 0.1);
    background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 50%, rgba(207, 22, 50, 0.1) 100%);
    background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 50%, rgba(207, 22, 50, 0.1) 100%);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(207, 22, 50, 0.1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='rgba(0,0,0,0)', endColorstr='rgba(207,22,50,0.1)', GradientType=0)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs .apc-load-move {
    padding-top: 10px
}

#apbd-cht-container>.apc-msg-window>.apc-msgs .apc-msg-time {
    display: table;
    clear: both;
    width: 83%;
    text-align: right;
    font-size: 10px;
    font-style: italic;
    font-weight: bold;
    letter-spacing: 1px;
    color: #595e5f
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-sys-item .apc-msg {
    float: none;
    width: 90%;
    background: rgba(243, 139, 155, 0.3);
    margin-left: 11px;
    border-radius: 16px 16px 16px 16px;
    padding: 7px;
    box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.72);
    margin: 5px auto
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-sys-item .apc-msg>.apc-msg-item-header {
    border-bottom: 1px solid rgba(100, 100, 100, 0.04);
    text-align: center;
    margin-top: -2px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    font-size: 10px;
    font-style: italic;
    font-weight: bold;
    letter-spacing: 1px;
    color: rgba(89, 94, 95, 0.5)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-sys-item .apc-msg>.apc-msg-item-footer {
    border-top: 1px solid rgba(100, 100, 100, 0.04);
    text-align: center;
    margin-top: 5px;
    padding-top: 5px;
    font-size: 10px;
    font-style: italic;
    font-weight: bold;
    letter-spacing: 1px;
    color: rgba(89, 94, 95, 0.5)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-sys-item .apc-msg-time {
    width: 90%
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item {
    margin: 10px 0;
    overflow-wrap: break-word
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item>.apc-umg {
    border-radius: 50%;
    background: #fff;
    width: 40px;
    height: 40px;
    float: left;
    overflow: hidden;
    box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.72)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item>.apc-umg img {
    width: 40px;
    height: 40px
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item>.apc-msg {
    margin-top: 5px;
    float: left;
    width: 70%;
    width: calc(100% - 103px);
    background: rgba(255, 255, 255, 0.8);
    margin-left: 11px;
    border-radius: 4px 16px 16px 16px;
    padding: 7px;
    box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.72)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item.apc-me>.apc-umg {
    float: right
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item.apc-me>.apc-msg {
    float: right;
    border-radius: 16px 4px 16px 16px;
    margin-right: 11px;
    margin-left: 0px;
    background: rgba(207, 22, 50, 0.3)
}

#apbd-cht-container>.apc-msg-window>.apc-msgs>.apc-msg-item:after {
    content: "";
    display: table;
    clear: both
}

#apbd-cht-container>.apc-msg-window>.apc-msgs:after {
    content: "";
    display: table;
    clear: both
}

#apbd-cht-container>.apc-msg-window>.apc-type-container {
    border-top: 1px solid rgba(0, 0, 0, 0.09);
    position: relative;
    background: #fff;
    padding: 0;
    height: 85px;
    -ms-box-orient: horizontal;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -moz-flex;
    display: -webkit-flex;
    display: flex
}

#apbd-cht-container>.apc-msg-window>.apc-type-container.is-disabled {
    background: #f7f7f7
}

#apbd-cht-container>.apc-msg-window>.apc-type-container.is-disabled>.apc-send-ctrl i {
    display: none !important
}

#apbd-cht-container>.apc-msg-window>.apc-type-container .apc-msg-typing {
    position: absolute;
    top: -23px;
    left: 10px;
    background: rgba(0, 0, 0, 0.09);
    padding: 2px 10px;
    border-radius: 9px;
    font-size: 10px;
    color: #616564;
    display: none
}

#apbd-cht-container>.apc-msg-window>.apc-type-container ::placeholder {
    color: #cccccc;
    opacity: 0.5
}

#apbd-cht-container>.apc-msg-window>.apc-type-container .apc-file-up-status {
    position: absolute;
    top: -32px;
    right: 0px;
    display: none;
    background: rgba(0, 0, 0, 0.66);
    padding: 5px;
    color: #ffffff;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px
}

#apbd-cht-container>.apc-msg-window>.apc-type-container>textarea {
    border: none;
    border-style: none;
    background: transparent;
    padding: 15px 10px 10px 10px;
    width: 100%;
    resize: none;
    height: 50px
}

#apbd-cht-container>.apc-msg-window>.apc-type-container>textarea:disabled {
    background: #f7f7f7
}

#apbd-cht-container>.apc-msg-window>.apc-type-container>.apc-send-ctrl {
    text-align: center;
    padding: 10px 5px;
    white-space: nowrap;
    margin-right: 5px
}

#apbd-cht-container>.apc-msg-window>.apc-type-container>.apc-send-ctrl>i {
    padding: 5px;
    font-size: 20px;
    color: #cccccc
}

#apbd-cht-container>.apc-msg-window>.apc-type-container>.apc-send-ctrl>i:hover {
    color: #4d4d4d
}

#apbd-cht-container>.apc-main-icon {
    position: absolute;
    background: #cf1632;
    height: 60px;
    width: 60px;
    bottom: 85px;
    right: 45px;
    border-radius: 50%;
    overflow: hidden;
    text-align: center;
    line-height: 50px;
    box-shadow: 0 0 14px -1px rgba(0, 0, 0, 0.19);
    z-index: 888
}

#apbd-cht-container>.apc-main-icon>i {
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin-top: -15px;
    color: #fff
}

#apbd-cht-container .apc-btn-send {
    background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiID8+PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHdpZHRoPSI5NnB0IiBoZWlnaHQ9Ijk2cHQiIHZpZXdCb3g9IjAgMCA5NiA5NiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGlkPSIjZmZmZmZmZmYiPjxwYXRoIGZpbGw9IiNmZmZmZmYiIG9wYWNpdHk9IjEuMDAiIGQ9IiBNIDguMDMgMTIuMDAgQyAzNi4wMSAyMy45OSA2NC4wMCAzNS45OSA5MS45OCA0OC4wMCBDIDY0LjAwIDYwLjAxIDM2LjAyIDcyLjAxIDguMDMgODMuOTkgQyA4LjAyIDc0LjY2IDguMDAgNjUuMzMgOC4wMCA1Ni4wMCBDIDI3Ljk3IDUzLjMyIDQ3Ljk0IDUwLjY5IDY3LjkxIDQ4LjAwIEMgNDcuOTQgNDUuMzEgMjcuOTcgNDIuNjcgOC4wMCA0MC4wMCBDIDguMDAgMzAuNjcgOC4wMiAyMS4zNCA4LjAzIDEyLjAwIFoiIC8+PC9nPjwvc3ZnPg==)
}

#apbd-cht-container .apc-spinner {
    display: inline;
    margin-right: 10px
}

#apbd-cht-container .apc-spinner>div {
    width: 8px;
    height: 8px;
    background-color: #730c1c;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both
}

#apbd-cht-container .apc-spinner .apc-bounce1 {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s
}

#apbd-cht-container .apc-spinner .apc-bounce2 {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s
}

@-webkit-keyframes sk-bouncedelay {

    0%,
    80%,
    100% {
        -webkit-transform: scale(0)
    }

    40% {
        -webkit-transform: scale(1)
    }
}

@keyframes sk-bouncedelay {

    0%,
    80%,
    100% {
        -webkit-transform: scale(0);
        transform: scale(0)
    }

    40% {
        -webkit-transform: scale(1);
        transform: scale(1)
    }
}

#apbd-cht-container.aps-chat-other-site .apc-item {
    padding-right: 20px !important
}

#apbd-cht-container.aps-chat-other-site #apbd-cht-input:focus {
    outline: none !important
}

#apbd-cht-container.aps-chat-other-site .btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out
}

#apbd-cht-container.aps-chat-other-site .btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745
}

#apbd-cht-container.aps-chat-other-site .text-center {
    text-align: center !important
}

#apbd-cht-container.aps-chat-other-site>.apc-msg-window>.apc-header .apc-header-row>.apc-company-img img {
    height: 48px;
    margin-left: 0px
}

/* ─── Premium Panel Overrides ─────────────────────────────────────────────── */

#apbd-cht-container {
    right: 0;
    bottom: 0;
    z-index: 999999;
    font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif
}

/* ── Floating launcher ──────────────────────────────────────────────────── */

#apbd-cht-container > .apc-main-icon {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #0563da 100%);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.42);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    z-index: 888
}
#apbd-cht-container > .apc-main-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.52)
}
#apbd-cht-container > .apc-main-icon i {
    color: #fff;
    font-size: 26px;
    line-height: 1
}

/* ── Drawer panel ───────────────────────────────────────────────────────── */

#apbd-cht-container > .apc-msg-window {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(480px, 100vw);
    height: 100dvh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-left: 1px solid #e8edf5;
    border-radius: 0;
    background: #fff;
    box-shadow: -20px 0 56px rgba(15, 23, 42, 0.14);
    transform: translateX(24px);
    opacity: 0;
    transition: transform 240ms cubic-bezier(.22,.68,0,1.2), opacity 200ms ease;
    z-index: 999999
}
#apbd-cht-container > .apc-msg-window.apc-ct-open {
    transform: translateX(0);
    opacity: 1
}
#apbd-cht-container > .apc-msg-window > div {
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px
}

/* ── Top bar ────────────────────────────────────────────────────────────── */

#apbd-cht-container > .apc-msg-window > .apc-ai-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 66px;
    padding-top: 14px;
    padding-bottom: 14px;
    background: #fff;
    border-bottom: 1px solid #f0f4f8;
    order: 1
}
#apbd-cht-container .apc-ai-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: #f1f5f9
}
#apbd-cht-container .apc-ai-tab,
#apbd-cht-container .apc-ai-personalize-btn,
#apbd-cht-container .apc-ai-collapse-btn {
    border: 0;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    font: inherit;
    transition: background 140ms ease, color 140ms ease
}
#apbd-cht-container .apc-ai-tab {
    min-height: 34px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em
}
#apbd-cht-container .apc-ai-tab.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.1)
}
#apbd-cht-container .apc-ai-tab:hover:not(.is-active) {
    color: #111827
}
#apbd-cht-container .apc-ai-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center
}
#apbd-cht-container .apc-ai-personalize-btn,
#apbd-cht-container .apc-ai-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    line-height: 1; /* prevent inherited line-height from offsetting icon characters */
    font-size: 17px
}
#apbd-cht-container .apc-ai-personalize-btn {
    background: #f5f3ff;
    color: #7c3aed
}
#apbd-cht-container .apc-ai-personalize-btn:hover {
    background: #ede9fe
}
/* Collapse button — hide the →| text; draw a right-pointing chevron with
   CSS borders instead of an SVG data URL (more reliable in WebViews) */
#apbd-cht-container .apc-ai-collapse-btn {
    background: #f8fafc;
    color: #374151;
    font-size: 0;
}
#apbd-cht-container .apc-ai-collapse-btn::after {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-top: 2px solid #374151;
    border-right: 2px solid #374151;
    border-radius: 1px;
    transform: rotate(45deg);
    margin-right: 3px; /* optical shift to visually center the open angle */
}
#apbd-cht-container .apc-ai-collapse-btn:hover {
    background: #f1f5f9
}
#apbd-cht-container .apc-ai-collapse-btn:hover::after {
    border-color: #111827
}

/* ── Legacy header: hidden in panel mode ────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-header { display: none }
#apbd-cht-container .apc-header-sound,
#apbd-cht-container .apc-header-close-window { display: none }

/* ── System message bar ─────────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window .apc-system-single-msg {
    order: 2;
    flex-shrink: 0;
    padding: 8px 20px !important;
    border-bottom: 0;
    background: #fff
}
#apbd-cht-container > .apc-msg-window .apc-system-single-msg.apc-show .apc-msg {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #374151;
    font-size: 12.5px;
    line-height: 1.5;
    box-shadow: none;
    margin-top: 0
}
#apbd-cht-container > .apc-msg-window .apc-system-single-msg.apc-show.apc-show-error .apc-msg {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b
}

/* ── Message feed ───────────────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-msgs {
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 20px 12px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent
}
#apbd-cht-container > .apc-msg-window > .apc-msgs::-webkit-scrollbar { width: 5px }
#apbd-cht-container > .apc-msg-window > .apc-msgs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px
}

#apbd-cht-container > .apc-msg-window.apc-not-started > .apc-msgs,
#apbd-cht-container > .apc-msg-window.apc-not-started > .apc-type-container { display: none }
#apbd-cht-container > .apc-msg-window.apc-not-started > .apc-start { display: flex }
#apbd-cht-container > .apc-msg-window.apc-started > .apc-start { display: none }

/* ── Load More button ───────────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-msgs .apc-load-move {
    text-align: center;
    padding: 8px 0 4px
}
#apbd-cht-container > .apc-msg-window > .apc-msgs .apc-load-move .btn {
    background: transparent !important;
    color: #7c3aed !important;
    border: 1px solid #e0d4fa !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 5px 16px !important;
    box-shadow: none !important
}
#apbd-cht-container > .apc-msg-window > .apc-msgs .apc-load-move .btn:hover {
    background: #f5f3ff !important
}

/* ── Message items ──────────────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0;
    margin: 16px 0
}
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item.apc-me {
    justify-content: flex-end
}
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item > .apc-umg { display: none }

/* AI message bubble */
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item > .apc-msg {
    width: auto;
    max-width: 94%;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #e8edf5;
    border-radius: 4px 18px 18px 18px;
    background: #f9fafb;
    color: #1a2032;
    font-size: 13.5px;
    line-height: 1.65;
    box-shadow: none
}

/* Structured AI responses always fill available width */
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item:not(.apc-me) > .apc-msg:has(.apc-ai-answer) {
    width: 94%
}

/* User message bubble */
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item.apc-me > .apc-msg {
    width: auto !important;
    max-width: 80%;
    margin: 0 !important;
    padding: 11px 15px;
    border: 0;
    border-radius: 18px 18px 4px 18px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
    color: #fff !important;
    float: none !important;
    font-size: 13.5px;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.24)
}

#apbd-cht-container > .apc-msg-window > .apc-msgs .apc-msg-time {
    flex-basis: 100%;
    width: 100%;
    margin: 4px 0 0;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 500;
    text-align: left;
    padding-left: 4px;
    letter-spacing: 0
}
#apbd-cht-container > .apc-msg-window > .apc-msgs > .apc-msg-item.apc-me .apc-msg-time {
    text-align: right;
    padding-left: 0;
    padding-right: 4px
}

/* ── AI name label ──────────────────────────────────────────────────────── */
#apbd-cht-container .apc-ai-name {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124,58,237,0.1) 0%, rgba(5,99,218,0.08) 100%);
    color: #6d28d9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em
}

/* ── AI answer structure ────────────────────────────────────────────────── */
#apbd-cht-container .apc-ai-answer {
    display: flex !important;
    flex-direction: column;
    gap: 12px
}

/* Markdown-rendered answer text */
#apbd-cht-container .apc-ai-answer-text {
    color: #1a2032;
    font-size: 13.5px;
    line-height: 1.7
}
#apbd-cht-container .apc-ai-answer-text h3,
#apbd-cht-container .apc-ai-answer-text h4,
#apbd-cht-container .apc-ai-answer-text h5 {
    margin: 14px 0 6px;
    color: #111827;
    font-weight: 800;
    line-height: 1.3
}
#apbd-cht-container .apc-ai-answer-text h3 { font-size: 15px }
#apbd-cht-container .apc-ai-answer-text h4 { font-size: 14px }
#apbd-cht-container .apc-ai-answer-text h5 { font-size: 13px }
#apbd-cht-container .apc-ai-answer-text h3:first-child,
#apbd-cht-container .apc-ai-answer-text h4:first-child,
#apbd-cht-container .apc-ai-answer-text h5:first-child { margin-top: 0 }

#apbd-cht-container .apc-ai-answer-text ol,
#apbd-cht-container .apc-ai-answer-text ul {
    margin: 8px 0;
    padding-left: 22px
}
#apbd-cht-container .apc-ai-answer-text ol { list-style: decimal }
#apbd-cht-container .apc-ai-answer-text ul { list-style: disc }
#apbd-cht-container .apc-ai-answer-text li {
    margin-bottom: 5px;
    line-height: 1.6
}
#apbd-cht-container .apc-ai-answer-text li:last-child { margin-bottom: 0 }

#apbd-cht-container .apc-ai-answer-text strong { font-weight: 700; color: #111827 }
#apbd-cht-container .apc-ai-answer-text em { font-style: italic; color: #374151 }

#apbd-cht-container .apc-ai-answer-text code {
    padding: 1px 5px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #7c3aed;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 12px
}
#apbd-cht-container .apc-ai-answer-text pre {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    overflow-x: auto
}
#apbd-cht-container .apc-ai-answer-text pre code {
    padding: 0;
    background: none;
    color: #1e293b;
    font-size: 12px
}
#apbd-cht-container .apc-ai-answer-text .apc-md-spacer {
    margin: 0;
    height: 6px;
    display: block
}

/* ── Confidence / AI provenance badges ──────────────────────────────────── */
#apbd-cht-container .apc-ai-meta-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center
}
#apbd-cht-container .apc-ai-confidence,
#apbd-cht-container .apc-ai-live {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em
}
#apbd-cht-container .apc-ai-confidence {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #dbeafe !important
}
#apbd-cht-container .apc-ai-live {
    background: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important
}

/* ── Citation cards ─────────────────────────────────────────────────────── */
#apbd-cht-container .apc-ai-citations {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px
}
#apbd-cht-container .apc-ai-citations-title {
    display: block !important;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px
}
#apbd-cht-container .apc-ai-citation-card {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    background: #fff !important;
    color: #1a2032 !important;
    text-decoration: none !important;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease
}
#apbd-cht-container .apc-ai-citation-card:hover {
    border-color: #7c3aed !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
    transform: translateY(-1px)
}
#apbd-cht-container .apc-ai-citation-index {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800
}
#apbd-cht-container .apc-ai-citation-title {
    flex: 1 1 0;
    min-width: 0;
    color: #1a2032 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}
#apbd-cht-container .apc-ai-citation-score {
    flex-shrink: 0;
    color: #15803d !important;
    font-size: 10px;
    font-weight: 800
}

/* ── Handoff / lead cards ───────────────────────────────────────────────── */
#apbd-cht-container .apc-ai-handoff,
#apbd-cht-container .apc-ai-lead-card {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid #e8edf5
}
#apbd-cht-container .apc-ai-handoff {
    border-color: #ddd6fe !important;
    background: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%) !important
}
#apbd-cht-container .apc-ai-lead-card {
    border-color: #bbf7d0 !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important
}
#apbd-cht-container .apc-ai-handoff strong,
#apbd-cht-container .apc-ai-lead-card strong {
    display: block !important;
    font-size: 12.5px;
    font-weight: 800
}
#apbd-cht-container .apc-ai-handoff strong { color: #6d28d9 !important }
#apbd-cht-container .apc-ai-lead-card strong { color: #15803d !important }
#apbd-cht-container .apc-ai-handoff span,
#apbd-cht-container .apc-ai-lead-card span {
    display: block !important;
    color: #4b5563 !important;
    font-size: 12px;
    line-height: 1.5
}
#apbd-cht-container .apc-ai-agent-summary { display: none !important }

/* ── Inline ticket form (agent offline) ────────────────────────────────── */
#apbd-cht-container .apc-ticket-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px
}
#apbd-cht-container .apc-ticket-form-row { display: flex }
#apbd-cht-container .apc-ticket-form input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 13px;
    color: #1a2032;
    background: #fff;
    outline: none;
    transition: border-color 150ms
}
#apbd-cht-container .apc-ticket-form input:focus { border-color: #7c3aed }
#apbd-cht-container .apc-ticket-submit-btn {
    align-self: flex-start;
    padding: 9px 18px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 150ms
}
#apbd-cht-container .apc-ticket-submit-btn:disabled { opacity: 0.6; cursor: not-allowed }
#apbd-cht-container .apc-ticket-form-msg { font-size: 12px; margin-top: 2px }
#apbd-cht-container .apc-ticket-form-error { color: #dc2626 }
#apbd-cht-container .apc-ticket-form-success {
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #15803d;
    font-size: 13px;
    line-height: 1.5
}
/* ── Connecting state indicator ─────────────────────────────────────────── */
#apbd-cht-container .apc-ai-connecting .apc-ai-answer-text p::before {
    content: "⟳ ";
    color: #7c3aed
}

/* ── Typing indicator ───────────────────────────────────────────────────── */
/* Lives inside .apc-type-container, surfaces above chips via negative top + z-index */
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips {
    position: relative;
    z-index: 5
}
/* Default: hidden (jQuery .hide() sets display:none inline) */
#apbd-cht-container > .apc-msg-window > .apc-type-container .apc-msg-typing {
    position: absolute;
    left: 20px;
    top: -46px;
    z-index: 20;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e8edf5;
    border-radius: 999px;
    background: #fff !important;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
    white-space: nowrap
}
/* When jQuery .show() sets display:block, upgrade to flex so dots align */
#apbd-cht-container .apc-msg-typing[style*="display: block"],
#apbd-cht-container .apc-msg-typing[style*="display:block"] {
    display: flex !important
}
#apbd-cht-container .apc-spinner {
    display: flex;
    gap: 3px;
    align-items: center
}
#apbd-cht-container .apc-spinner > div {
    width: 6px;
    height: 6px;
    background: #7c3aed;
    border-radius: 50%
}

/* ── Welcome / start screen ─────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-start {
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    background: #fff;
    overflow-y: auto
}
#apbd-cht-container > .apc-msg-window > .apc-start .apc-ai-start-logo {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
    border: 1px solid #e8edf5;
    margin: 0 auto 14px
}
#apbd-cht-container > .apc-msg-window > .apc-start .apc-ai-start-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain
}
#apbd-cht-container > .apc-msg-window > .apc-start h3 {
    margin: 0 0 8px;
    padding: 0 20px;
    color: #111827;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center
}
#apbd-cht-container > .apc-msg-window > .apc-start p {
    max-width: 340px;
    margin: 0 auto 24px;
    padding: 0 20px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    text-align: center
}

/* Logo + heading area — auto margin distributes whitespace above the logo
   and above the input equally, so content is vertically centered instead
   of hugging the top with a dead gap below when there are no suggestions */
#apbd-cht-container > .apc-msg-window > .apc-start > .apc-ai-start-logo {
    margin-top: auto
}

/* Suggestion list — extends edge-to-edge */
#apbd-cht-container .apc-ai-suggestions {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid #f0f4f8;
    margin-top: auto
}
#apbd-cht-container .apc-ai-suggestions button {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-bottom: 1px solid #f0f4f8;
    background: #fff;
    color: #1a2032;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    transition: background 120ms ease
}
#apbd-cht-container .apc-ai-suggestions button:hover { background: #fafafa }
#apbd-cht-container .apc-ai-suggestions button:before {
    content: "↗";
    flex-shrink: 0;
    margin-right: 14px;
    color: #7c3aed;
    font-size: 18px;
    font-weight: 400;
    line-height: 1
}
#apbd-cht-container > .apc-msg-window > .apc-start #apc-start-chat-btn { display: none }

/* ── Start-screen: keep suggestions from overflowing; pin input to bottom ─ */
#apbd-cht-container > .apc-msg-window > .apc-start .apc-ai-suggestions { margin-top: 0; flex-shrink: 0; }
/* ── Start-screen direct input ─────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-input-row {
    display: flex;
    align-items: center; /* center-align so button and textarea sit on the same axis */
    gap: 8px;
    /* 20px side margins align the send button's right edge with the close
       button in the top bar, which has 20px padding from .apc-msg-window > div */
    margin-top: auto;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    background: #f3f4f6;
    border-radius: 12px;
    padding: 8px 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    color: #1f2937;
    min-height: 22px;
    max-height: 80px;
    line-height: 1.5;
    font-family: inherit;
    overflow-y: hidden; /* hide native scrollbar that shows as a stray line on mobile */
    scrollbar-width: none;
}
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-input::-webkit-scrollbar { display: none }
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-input::placeholder { color: #9ca3af; }
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-send-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg,#7c3aed,#5b21b6);
    border: none;
    border-radius: 10px;
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0; /* hide the Font Awesome <i> — icon rendered via ::after instead */
    transition: opacity .2s;
}
/* SVG paper-plane icon — works without Font Awesome */
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-send-btn > i { display: none }
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-send-btn::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E") center/contain no-repeat
}
#apbd-cht-container > .apc-msg-window > .apc-start .apc-start-send-btn:hover { opacity: .85; }

/* ── Topic chip strip ───────────────────────────────────────────────────── */
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips {
    order: 4;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-shrink: 0;
    padding: 8px 20px 10px;
    background: #fff;
    border-top: 1px solid #f0f4f8;
    scrollbar-width: none
}
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips::-webkit-scrollbar { display: none }
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips button {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease
}
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips button:hover {
    border-color: #7c3aed;
    background: #faf5ff;
    color: #6d28d9
}
#apbd-cht-container > .apc-msg-window > .apc-ai-topic-chips button:first-child {
    border-color: #ddd6fe;
    background: #faf5ff;
    color: #6d28d9
}

/* ── Input area ─────────────────────────────────────────────────────────── */
/* Flex-row layout: the container IS the visible input box; textarea and
   send button are siblings so the button is always inside the box. */
#apbd-cht-container > .apc-msg-window > .apc-type-container {
    order: 5;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
    min-height: unset;
    /* Split into separate properties — a 3-value shorthand containing max()/env()
       is treated as entirely invalid in older WebViews, zeroing all margins */
    margin-top: 8px;
    margin-right: 20px;
    margin-left: 20px;
    margin-bottom: 16px;
    padding: 8px 8px 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    background: #fafbfc;
    overflow: hidden; /* safety net — nothing can overflow the rounded box */
    transition: border-color 160ms ease, box-shadow 160ms ease
}
#apbd-cht-container > .apc-msg-window > .apc-type-container:focus-within {
    border-color: #7c3aed;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1)
}
#apbd-cht-container > .apc-msg-window > .apc-type-container.is-disabled {
    background: #f3f4f6;
    border-color: #e5e7eb
}
#apbd-cht-container > .apc-msg-window > .apc-type-container.is-disabled > .apc-send-ctrl i {
    opacity: 0.4;
    pointer-events: none
}
/* Textarea: no own border/background — the container provides those */
#apbd-cht-container > .apc-msg-window > .apc-type-container > textarea {
    flex: 1;
    min-width: 0; /* prevent textarea's implicit min-width from overflowing the flex row */
    width: 0;     /* let flex: 1 control the actual width, not the textarea's intrinsic size */
    min-height: 44px;
    max-height: 120px;
    height: auto;
    padding: 8px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #1a2032;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.55;
    resize: none;
    outline: 0;
    box-shadow: none;
    transition: none;
    overflow-y: auto;
    scrollbar-width: none
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > textarea::-webkit-scrollbar { display: none }
#apbd-cht-container > .apc-msg-window > .apc-type-container > textarea:focus {
    border-color: unset;
    background: transparent;
    box-shadow: none
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > textarea:disabled {
    background: transparent;
    color: #9ca3af;
    cursor: not-allowed
}
#apbd-cht-container > .apc-msg-window > .apc-type-container ::placeholder {
    color: #9ca3af;
    opacity: 1
}
/* Send ctrl: static flex item — button is always inside the visible box */
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl {
    position: static;
    flex-shrink: 0;
    align-self: flex-end;
    padding: 0;
    display: flex;
    gap: 6px
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl > i {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background 140ms ease, transform 100ms ease
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl > i.apc-send-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
    font-size: 0
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl > i.apc-send-btn::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E") center/contain no-repeat
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl > i.apc-send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4)
}
#apbd-cht-container > .apc-msg-window > .apc-type-container > .apc-send-ctrl > i.apc-attach-btn { display: none }
/* Desktop keyboard hint — hide on mobile (no keyboard shortcuts) */
#apbd-cht-container > .apc-msg-window > .apc-type-container::after { content: none }

/* ── Memory / personalization panel ────────────────────────────────────── */
#apbd-cht-container .apc-ai-memory-panel {
    display: none;
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 56px 28px 32px;
    background: #fff
}
#apbd-cht-container .apc-ai-memory-open .apc-ai-memory-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}
#apbd-cht-container .apc-ai-memory-open > .apc-start,
#apbd-cht-container .apc-ai-memory-open > .apc-msgs,
#apbd-cht-container .apc-ai-memory-open > .apc-system-single-msg,
#apbd-cht-container .apc-ai-memory-open > .apc-type-container,
#apbd-cht-container .apc-ai-memory-open > .apc-ai-topic-chips { display: none !important }

#apbd-cht-container .apc-ai-memory-inner {
    width: 100%;
    max-width: 360px;
    text-align: center
}
#apbd-cht-container .apc-ai-memory-inner h3 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 20px;
    font-weight: 900
}
#apbd-cht-container .apc-ai-memory-inner p {
    margin: 0 auto 28px;
    max-width: 300px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55
}
#apbd-cht-container .apc-ai-memory-inner ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 0 36px;
    padding: 0;
    list-style: none;
    text-align: left
}
#apbd-cht-container .apc-ai-memory-inner li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start
}
#apbd-cht-container .apc-ai-memory-inner li:before {
    content: "✦";
    color: #7c3aed;
    font-size: 14px;
    margin-top: 1px
}
#apbd-cht-container .apc-ai-memory-inner strong {
    grid-column: 2;
    display: block;
    color: #111827;
    font-size: 13px;
    font-weight: 700
}
#apbd-cht-container .apc-ai-memory-inner span {
    grid-column: 2;
    display: block;
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.45
}
#apbd-cht-container .apc-ai-memory-enable,
#apbd-cht-container .apc-ai-memory-later {
    display: block;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: background 140ms ease
}
#apbd-cht-container .apc-ai-memory-enable {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28)
}
#apbd-cht-container .apc-ai-memory-enable:hover { background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%) }
#apbd-cht-container .apc-ai-memory-later {
    margin-top: 10px;
    background: transparent;
    color: #7c3aed
}
#apbd-cht-container .apc-ai-memory-later:hover { background: #faf5ff }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    body.apc-has-cht { overflow: hidden }
    body.apc-has-cht #apbd-cht-container {
        position: fixed;
        inset: 0;
        height: auto !important
    }
    body.apc-has-cht #apbd-cht-container > .apc-msg-window {
        width: 100vw !important;
        height: 100dvh !important;
        border-radius: 0;
        border-left: 0
    }
}

/* ── Widget disclaimer footer ───────────────────────────────────────────── */
#apbd-cht-container .apc-widget-disclaimer {
    order: 6; /* push below the input bar (order 5); default 0 put it at the top */
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    padding-top: 6px;
    padding-right: 12px;
    padding-left: 12px;
    padding-bottom: 8px;
    border-top: 1px solid rgba(0,0,0,.06);
    line-height: 1.4;
    flex-shrink: 0;
}
