
/* QChat R65.3 hotfix */
#q653-filters{padding:7px 8px 6px;border-bottom:1px solid #2f3955;display:flex;flex-direction:column;gap:6px}
.q653-kind-tabs,.q653-app-tabs{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;overflow:auto;padding-bottom:1px}
.q653-kind-tabs button{border:1px solid #475271;background:#161f39;color:#e9ecff;padding:7px 10px;font-size:12px;line-height:1;border-radius:6px;white-space:nowrap}
.q653-kind-tabs button.active{background:#7950ea;border-color:#8d6af2;color:#fff}
.q653-app-tabs{padding-top:1px}
.q653-app-btn{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;border:1px solid #3f4a68;background:#131a2f;padding:0;flex:0 0 auto}
.q653-app-btn.active{background:#201f40;border-color:#8760f0;box-shadow:0 0 0 1px #8760f0 inset, 0 0 14px #6d4dd34a}
.q653-app-btn.inactive{background:#12182b;border-color:#303a58}
.q653-app-btn.inactive img{filter:grayscale(1) brightness(.78);opacity:.5}
.q653-brand{width:20px;height:20px;object-fit:contain;display:block}
.q653-brand-text{font-size:11px;color:#fff}
.q653-row-head-main{display:flex;align-items:center;gap:7px;min-width:0}
.q653-row-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;flex:0 0 22px}
.q653-row-icon img{width:18px;height:18px;object-fit:contain}
.q653-pill{font-size:10px;border-radius:999px;padding:3px 7px;border:1px solid #525f84;background:#1f2740;color:#edf0ff}
.q653-pill.warn{background:#4a3821;border-color:#9d7b3a;color:#f8e6aa}
.q653-pill.human{background:#243445;border-color:#536f95;color:#dfeaff}
.q653-pill.auto{background:#203628;border-color:#2d8a55;color:#b7efcf}
.q653-unread{display:inline-grid;place-items:center;min-width:18px;height:18px;border-radius:999px;background:#7d55ee;color:#fff;font-size:10px;padding:0 4px}
.q65-search{padding:8px}
.q65-search select,.q65-search input{height:38px}
.q65-search{display:grid;grid-template-columns:116px 1fr;gap:6px}
.q65-conversations{min-height:0;overflow:auto}
.q65-conversations .conversation-row{display:flex;flex-direction:column;gap:6px;text-align:right;padding:10px 12px;border:0;border-bottom:1px solid #2e3754;background:transparent;color:#eef1ff}
.q65-conversations .conversation-row.active{background:linear-gradient(90deg,#392d74,#23294d)}
.q65-conversations .row-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.q65-conversations .row-head b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.q65-conversations .preview{font-size:12px;color:#d6dcf4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.q65-conversations .meta{display:flex;align-items:center;gap:5px;font-size:10px;color:#a8b2cf}
.q65-chat-pane .composer,.chat .composer{margin-top:auto}
.q65-pane-head{min-height:46px}
.q65-pane-head b{font-size:15px}
.q65-pane-head small{font-size:11px}
.q65-profile-tabs button{font-size:11px;padding:5px 8px}
.q65-card{font-size:13px}
.q65-grid b{font-size:13px}


/* R65.5: reference-matched compact filter controls. Keep the original R65.3 row renderer. */
#q65-bell,.q65-bell,#q65-bell-count{display:none!important}
#q653-filters{padding:4px 7px 5px!important;display:flex;flex-direction:column;gap:3px!important;border-bottom:1px solid #303a58}
.q653-kind-tabs,.q653-app-tabs{display:flex;align-items:center;gap:4px!important;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;min-height:29px;padding:1px 0!important}
.q653-kind-tabs .q655-kind{position:relative;flex:0 0 32px;width:32px;height:29px;min-width:32px;padding:0!important;display:grid;place-items:center;border:1px solid #46516f;background:#151d34;color:#e5e9ff;border-radius:6px}
.q653-kind-tabs .q655-kind.active{background:#7950ea;border-color:#9472f3;color:#fff}
.q653-kind-tabs .q655-kind svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.q653-kind-tabs .q655-kind i{position:absolute;top:-4px;left:-4px;min-width:14px;height:14px;padding:0 3px;display:grid;place-items:center;border-radius:20px;background:#2788f5;color:#fff;font-size:8px;font-style:normal;line-height:14px}
.q653-app-tabs .q653-app-btn{flex:0 0 31px;width:31px;height:29px;min-width:31px;padding:3px!important;display:grid;place-items:center;border-radius:6px}
.q653-app-tabs .q653-brand{width:18px;height:18px;object-fit:contain;display:block}
.q653-app-tabs .q653-app-btn.inactive{filter:grayscale(1);opacity:.55;background:#151b2b;border-color:#303a58;box-shadow:none}
.q653-app-tabs .q653-app-btn.active{filter:none;opacity:1}
.q65-search{grid-template-columns:minmax(82px,.52fr) minmax(0,1.5fr)!important;gap:4px!important;padding:5px 6px!important}
.q65-search input,.q65-search select{height:32px!important;padding:4px 7px!important;font-size:11px!important}
.q65-pane-head{min-height:42px!important;padding:5px 8px!important}
.q65-pane-head b{font-size:15px!important}
.q65-profile-tabs button{padding:4px 7px!important;font-size:10px!important}
.q65-conversations{padding:2px 5px!important}
.q65-conversations .conversation-row{gap:2px!important;padding:6px 7px!important;min-height:0!important}
.q65-conversations .row-head{gap:6px!important}
.q65-conversations .row-head b{font-size:13px!important;font-weight:800}
.q65-conversations .preview{font-size:11px!important;line-height:1.45!important}
.q65-conversations .meta{gap:4px!important;font-size:9px!important}
.q65-row-icon{width:20px!important;height:20px!important;flex:0 0 20px!important}
.q65-row-icon .q653-brand{width:16px!important;height:16px!important}
.q65-pager{padding:4px 7px!important}
@media(max-width:720px){
 .q653-kind-tabs .q655-kind{flex-basis:30px;width:30px;min-width:30px;height:28px}
 .q653-app-tabs .q653-app-btn{flex-basis:30px;width:30px;min-width:30px;height:28px}
}

/* Compact customer inbox, scoped to the desktop workspace. */
.q65-workspace{position:relative}
.q65-workspace #q65-customer-panel[hidden]{display:none!important}
.q65-workspace.customer-hidden{grid-template-columns:minmax(0,1fr) minmax(255px,.47fr)}
.q65-chat-tools{display:flex;justify-content:flex-end;padding:3px 8px;border-bottom:1px solid var(--line)}
#q65-toggle-customer{display:grid;place-items:center;width:30px;height:28px;padding:3px}
#q65-toggle-customer svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#q65-toggle-customer[aria-expanded=false] svg path{transform:scaleX(-1);transform-origin:15px center}
body.inbox-page .q65-chat-pane .messages{padding:6px 10px;gap:0}
body.inbox-page .q65-chat-pane .bubble{padding:4px 8px;margin-block:0 4px;line-height:1.4}
body.inbox-page .q65-chat-pane .bubble p{margin:0;line-height:inherit}
body.inbox-page .q65-chat-pane .bubble small,
body.inbox-page .q65-chat-pane .bubble .meta{margin-block:2px 0;line-height:1.2}
body.inbox-page .q65-chat-pane .chat-header{padding:5px 8px;line-height:1.35}
.q65-conversations .conversation-row{padding-block:4px!important;gap:1px!important}
.q65-conversations .preview{line-height:1.3!important}
.q65-conversations .meta{line-height:1.2!important}
.instagram-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.instagram-connection form{display:grid;gap:8px;max-width:420px}
.instagram-connection form label{display:grid;gap:4px}
.instagram-account,.instagram-web{border:1px solid var(--line);border-radius:10px;padding:12px;margin-block:8px}
@media(max-width:1050px){
 .q65-workspace:not(.customer-hidden) #q65-customer-panel{
  display:flex;position:absolute;z-index:5;inset-block:0;left:0;width:min(325px,85%);
  box-shadow:0 3px 18px #0005;
 }
 .q65-workspace:not(.customer-hidden) .q65-chat-tools{position:relative;z-index:6}
}
@media(max-width:720px){
 .q65-workspace:not(.customer-hidden) #q65-customer-panel{
  position:fixed;inset-block:12vh 0;max-height:76dvh;
 }
 .q65-workspace:not(.customer-hidden) .q65-chat-tools{justify-content:flex-start}
 .instagram-columns{grid-template-columns:1fr}
}
body.inbox-page .q65-chat-pane .message-footer{margin-top:2px;gap:4px;line-height:1.15}
body.inbox-page .q65-chat-pane .message-footer .chat-icon{width:23px;height:23px;padding:3px}
body.inbox-page .q65-chat-pane .message-footer svg{width:13px;height:13px}
body.inbox-page .q65-chat-pane .analysis-state{margin-block:2px 0;line-height:1.2}
body.inbox-page .q65-chat-pane :is(.message-transcript,.message-insight,.quoted-message){margin-block:3px}
body.inbox-page .q65-chat-pane :is(.message-transcript,.message-insight) summary{line-height:1.3}
