/* TS WhatsApp 15.13 — final shared visual normalization layer.
   Functional forms, POST endpoints, authorization, and WhatsApp backend untouched.
   Intent: consistent, legible UI across the existing modules and color schemes. */
html body.ts-studio {
  --ts13-surface:var(--ts15-paper);
  --ts13-surface-alt:var(--ts15-paper-2);
  --ts13-canvas:var(--ts15-bg);
  --ts13-fg:var(--ts15-ink);
  --ts13-heading:var(--ts15-heading);
  --ts13-sub:var(--ts15-muted);
  --ts13-stroke:var(--ts15-line);
  --ts13-stroke-strong:var(--ts15-line-dark);
  --ts13-accent:#205b9e;
  --ts13-accent-contrast:#fff;
  --ts13-control-height:38px;
  --ts13-radius:10px;
  --ts13-focus:#5a9ff2;
  color:var(--ts13-fg);
  min-width:0;
}
html[data-theme="dark"] body.ts-studio {
  --ts13-accent:#8abaff;
  --ts13-accent-contrast:#112038;
  --ts13-focus:#9bc9ff;
}
html body.ts-studio *,html body.ts-studio *::before,html body.ts-studio *::after{box-sizing:border-box}
html body.ts-studio .workspace,
html body.ts-studio .content,
html body.ts-studio .content > *,
html body.ts-studio .content section,
html body.ts-studio .content article,
html body.ts-studio .content .card{min-width:0}
html body.ts-studio .content :is(h1,h2,h3,h4){color:var(--ts13-heading);overflow-wrap:break-word}
html body.ts-studio .content h1{line-height:1.24}
html body.ts-studio .content :is(p,small,.muted,.hint,.help-text){line-height:1.48}
html body.ts-studio .content :is(.card,.settings-section-card,.source-card,.tsbh-card,.provider-section,.device-section-card,.ai-simple-panel){color:var(--ts13-fg)!important;border-color:var(--ts13-stroke)!important}
html body.ts-studio .content :is(.card,.provider-section,.ai-console-pane,.tsbh-card){border-radius:12px!important}
html body.ts-studio .content .card :is(h2,h3){line-height:1.35!important}
/* Navbar and header: control sizing is independent from theme or state. */
html body.ts-studio .sidebar :is(.nav-item,.sidebar-width-toggle,.logout-link){min-width:0!important}
html body.ts-studio .sidebar .nav-item :is(svg,.nav-icon svg){height:18px!important;width:18px!important;max-height:18px!important;max-width:18px!important;flex:0 0 18px!important;stroke-width:1.8!important}
html body.ts-studio .sidebar .nav-icon{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:22px!important;min-height:22px!important}
html body.ts-studio .sidebar .nav-label{overflow:hidden;text-overflow:ellipsis}
html body.ts-studio .sidebar .sidebar-label{letter-spacing:.07em}
html body.ts-studio .sidebar .logout-text-link{border:1px solid #e9a0a8!important;background:#fff0f1!important;color:#a91d30!important;border-radius:9px!important;min-height:39px!important;display:flex!important;align-items:center!important;gap:10px!important;padding:8px 12px!important;margin:4px 8px 8px!important}
html body.ts-studio .sidebar .logout-text-link :is(svg,.nav-label){color:#a91d30!important;stroke:#a91d30!important}
html body.ts-studio .sidebar .logout-text-link svg{width:18px!important;height:18px!important;max-width:18px!important;max-height:18px!important;min-width:18px!important;min-height:18px!important;flex:0 0 18px!important;fill:none!important;stroke-width:1.8!important}
html[data-theme="dark"] body.ts-studio .sidebar .logout-text-link{border-color:#b94c60!important;background:#50242e!important;color:#ffe6e8!important}
html[data-theme="dark"] body.ts-studio .sidebar .logout-text-link :is(svg,.nav-label){color:#ffe6e8!important;stroke:#ffe6e8!important}
html body.ts-studio .sidebar .logout-text-link:hover{filter:brightness(.97)!important}
html body.ts-studio .sidebar .sidebar-width-toggle :is(.sidebar-toggle-icon,.sidebar-toggle-icon svg){height:18px!important;width:18px!important;max-width:18px!important;max-height:18px!important}
html body.ts-studio .topbar{min-width:0!important}
html body.ts-studio .topbar .topbar-right{min-width:0!important}
html body.ts-studio .topbar .ts16-device-scope{min-width:0!important;max-width:245px!important}
html body.ts-studio .topbar .ts16-device-control{min-width:0!important}
html body.ts-studio .topbar .ts16-device-control :is(select,strong){max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
html body.ts-studio .topbar :is(.menu-toggle,.studio-mobile-search-toggle,.notif-chip,.account-trigger) svg,
html body.ts-studio .topbar .studio-search-mark svg{height:18px!important;width:18px!important;max-height:18px!important;max-width:18px!important}
html body.ts-studio .account-dropdown{width:min(325px,calc(100vw - 22px))!important;max-width:calc(100vw - 22px)!important;box-shadow:0 12px 34px rgba(5,23,52,.17)!important}
html body.ts-studio .account-dropdown[hidden],
html body.ts-studio [hidden]{display:none!important}
html body.ts-studio .theme-switch{display:flex!important;align-items:center!important;gap:5px!important;flex-wrap:wrap!important}
html body.ts-studio .theme-switch button{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;min-width:0!important;padding:7px 8px!important;font-size:12px!important;color:var(--ts13-fg)!important;background:var(--ts13-surface-alt)!important;border:1px solid var(--ts13-stroke)!important;border-radius:8px!important}
html body.ts-studio .theme-switch svg{height:15px!important;width:15px!important}
html body.ts-studio :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--ts13-focus)!important;outline-offset:2px!important}
/* Every form remains native. Avoid layout overflow without changing action semantics. */
html body.ts-studio .content :is(form,.form-grid,.form-grid-2,.bc-grid,.profile-grid,.settings-grid,.ai-simple-workspace){min-width:0}
html body.ts-studio .content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){max-width:100%!important;min-width:0;color:var(--ts13-fg)!important;min-height:var(--ts13-control-height);border-color:var(--ts13-stroke-strong)!important;background:var(--ts13-surface)!important;border-radius:9px!important;box-shadow:none!important;line-height:1.35!important}
html body.ts-studio .content :is(input,textarea)::placeholder{color:var(--ts13-sub)!important;opacity:1!important}
html body.ts-studio .content select option{background:var(--ts13-surface);color:var(--ts13-fg)}
html body.ts-studio .content :is(input,select,textarea):disabled{opacity:.7!important;cursor:not-allowed}
html body.ts-studio .content :is(input[type=checkbox],input[type=radio]){width:16px!important;height:16px!important;min-height:16px!important;max-height:16px!important;max-width:16px!important;margin:0!important;accent-color:#2165b2!important;vertical-align:middle!important;flex:0 0 16px!important}
html body.ts-studio .content :is(label,.form-field-label){line-height:1.45!important}
html body.ts-studio .content :is(button,.btn,[role=button]){line-height:1.3!important;max-width:100%;white-space:normal;word-break:normal}
html body.ts-studio .content :is(.pagination,.tsqr-pagination,.ts18-datagrid-pager,.ts18-list-pager,.ts19-history-pager){max-width:100%;gap:8px!important}
html body.ts-studio .content :is(.pagination,.tsqr-pagination) a,
html body.ts-studio .content :is(.pagination,.tsqr-pagination) button{min-width:34px!important;min-height:34px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important;border-radius:8px!important}
/* Icons in action controls: never inherit gigantic image dimensions. */
html body.ts-studio .content :is(button,.btn,a.btn,.btn-icon,.icon-btn,.ts18-menu-icon,.ts-mobile-more) > svg,
html body.ts-studio .content :is(.eyebrow,.section-heading,.tab-button,.bc-step,.toolbar) svg{width:17px!important;height:17px!important;max-width:17px!important;max-height:17px!important;flex:0 0 17px!important}
html body.ts-studio .content .icon-btn{min-width:34px!important;min-height:34px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:6px!important}
html body.ts-studio .content :is(.status,.badge,.pill){line-height:1.4!important}
/* Table/list visual consistency and visible selection controls. */
html body.ts-studio .content :is(.table-wrap,.tsqr-table-wrap,.source-table-wrap,.ts18-table-scroll,.ts19-history-scroll){max-width:100%;min-width:0;overflow-x:auto!important;scrollbar-gutter:stable}
html body.ts-studio .content :is(table,.tsqr-table,.tsbh-table){border-collapse:separate;border-spacing:0;width:100%}
html body.ts-studio .content :is(table,.tsqr-table,.tsbh-table) th{vertical-align:middle!important;line-height:1.35!important;padding:11px 12px!important;color:var(--ts13-sub)!important;background:var(--ts13-surface-alt)!important;border-bottom:1px solid var(--ts13-stroke)!important;font-size:11px!important;letter-spacing:.02em!important;font-weight:700!important}
html body.ts-studio .content :is(table,.tsqr-table,.tsbh-table) td{vertical-align:middle!important;line-height:1.47!important;padding:12px!important;color:var(--ts13-fg)!important;background:var(--ts13-surface)!important;border-bottom:1px solid var(--ts13-stroke)!important;font-size:12.5px!important;overflow-wrap:break-word}
html body.ts-studio .content :is(table,.tsqr-table,.tsbh-table) tr:hover td{background:var(--ts13-surface-alt)!important}
html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar,.ts18-datagrid-pager,.ts18-list-pager){box-sizing:border-box!important;display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;gap:9px!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin!important;background:var(--ts13-surface-alt)!important;color:var(--ts13-fg)!important;border-color:var(--ts13-stroke)!important;padding:9px 11px!important}
html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar,.ts18-datagrid-pager,.ts18-list-pager) > *{min-width:0}
html body.ts-studio .content :is(.ts18-grid-controls,.ts18-datagrid-toolbar,.ts18-list-toolbar) input[type=search]{flex:1 1 160px!important;min-width:125px!important;max-width:260px!important;height:36px!important}
html body.ts-studio .content :is(.ts18-grid-controls,.ts18-datagrid-toolbar,.ts18-list-toolbar) select{flex:0 0 auto!important;min-width:92px!important;height:36px!important}
html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar) :is(button,select){min-height:34px!important;height:auto!important;white-space:nowrap!important;flex:0 0 auto!important;padding:6px 10px!important;border-radius:8px!important}
html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar) :is(label,span){white-space:nowrap!important;flex:0 0 auto!important}
html body.ts-studio .content :is(.ts18-datagrid-pager,.ts18-list-pager) :is(button,select){min-height:34px!important}
/* Accordions and tabs: compact, predictable click targets. */
html body.ts-studio .content details>summary{cursor:pointer;line-height:1.45!important;min-height:41px;align-items:center}
html body.ts-studio .content :is(.source-fold>summary,.ts46-accordion>summary,.ai-config-drawer>summary,.ts46-guide-section>summary){padding:10px 13px!important;border-radius:9px!important;color:var(--ts13-heading)!important}
html body.ts-studio .content :is(.ai-console-tabs,.ai-simple-tabs,.bc-stepper,.ts46-help-nav,.tabs,.tab-strip){min-width:0;max-width:100%;scrollbar-width:thin}
html body.ts-studio .content :is(.ai-console-tabs,.ai-simple-tabs,.bc-stepper,.ts46-help-nav,.tabs,.tab-strip) > :is(a,button){white-space:nowrap!important;flex:0 0 auto!important;min-height:36px!important}
/* Modules with multi-panel layouts and long list contents. */
html body.ts-studio.page-index .content .dashboard-grid,
html body.ts-studio.page-updater .content .profile-grid,
html body.ts-studio.page-reports .content .report-grid-3,
html body.ts-studio.page-ai_chatbot .content .ai-provider-layout,
html body.ts-studio.page-ai_chatbot .content .ai-api-grid{align-items:stretch!important;min-width:0}
html body.ts-studio.page-index .content .studio-dashboard-detail > section,
html body.ts-studio.page-updater .content .profile-grid > section{margin-top:0!important;transform:none!important;align-self:stretch!important;min-width:0}
html body.ts-studio.page-index .content :is(.task-list a,.quick-grid a){border-radius:9px!important;text-decoration:none!important}
html body.ts-studio.page-index .content .task-list a b{color:var(--ts13-heading)!important;font-weight:800!important}
html body.ts-studio.page-updater .content .profile-grid > section.card{padding:17px!important}
html body.ts-studio.page-updater .content .profile-grid > section.card>form{max-width:100%!important}
html body.ts-studio.page-ai_chatbot .content :is(.ai-console-pane,.ai-provider-card,.ai-simple-panel,.ai-config-drawer){min-width:0;max-width:100%;border-radius:12px!important}
html body.ts-studio.page-ai_chatbot .content :is(.ai-console-tabs,.ai-simple-tabs){gap:6px!important;overflow-x:auto!important;flex-wrap:nowrap!important}
html body.ts-studio.page-notifications .notification-row{padding:12px!important;min-height:58px!important}
html body.ts-studio.page-inbox .inbox-chat-actions{min-width:0!important;gap:5px!important}
html body.ts-studio.page-inbox .inbox-chat-head .inbox-chat-person{min-width:0!important}
html body.ts-studio.page-inbox .inbox-chat-head .inbox-chat-person :is(h2,p){overflow:hidden;text-overflow:ellipsis}
html body.ts-studio.page-inbox .ts-mobile-menu-panel:not([hidden]){background:var(--ts13-surface)!important;color:var(--ts13-fg)!important;border:1px solid var(--ts13-stroke)!important;box-shadow:0 15px 32px rgba(0,22,48,.22)!important;border-radius:12px!important;max-width:calc(100vw - 24px)!important}
html body.ts-studio.page-inbox .ts-mobile-menu-panel :is(button,a){font-size:12px!important;min-height:37px!important;line-height:1.35!important}
html body.ts-studio.page-inbox .inbox-message-wall .message-row .message-bubble{max-width:min(78%,520px)!important}
html body.ts-studio.page-inbox .inbox-message-wall .message-row .message-body{font-size:12px!important;line-height:1.43!important}
html body.ts-studio.page-inbox .inbox-message-wall .message-row .message-meta{font-size:9px!important}
html body.ts-studio.page-inbox .inbox-composer .composer-input textarea{min-height:38px!important}
html body.ts-studio.page-campaigns .bc-grid{align-items:start!important;min-width:0}
html body.ts-studio.page-campaigns :is(.bc-preview,.bc-shell,.bc-form){min-width:0!important}
html body.ts-studio.page-lead_source .source-fold>summary{min-height:42px!important}
html body.ts-studio.page-users .user-admin-list{min-width:0!important}
html body.ts-studio.page-users .user-admin-row{gap:10px!important}
html body.ts-studio.page-help .ts46-help-nav{scrollbar-width:thin}
/* Themes: no invisible labels or dark buttons with dark text. */
html[data-theme="dark"] body.ts-studio .content :is(.card,.source-card,.provider-section,.settings-section-card,.ai-simple-panel,.tsbh-card){background:var(--ts13-surface)!important;color:var(--ts13-fg)!important}
html[data-theme="dark"] body.ts-studio .content :is(label,legend,.table-wrap td,.tsqr-table td,.tsbh-table td){color:var(--ts13-fg)!important}
html[data-theme="dark"] body.ts-studio .content :is(.muted,.hint,small,.helper-text){color:var(--ts13-sub)!important}
html[data-theme="dark"] body.ts-studio .content :is(input,select,textarea):not(:disabled){background:var(--ts13-surface-alt)!important;color:var(--ts13-fg)!important;border-color:var(--ts13-stroke-strong)!important}
html[data-theme="dark"] body.ts-studio .content :is(.pagination a,.ts18-datagrid-pager button,.ts18-list-pager button){color:var(--ts13-fg)!important;background:var(--ts13-surface-alt)!important;border-color:var(--ts13-stroke)!important}
html[data-theme="dark"] body.ts-studio .content :is(.pagination .active,.tsqr-pagination .active){background:#367dd5!important;color:#fff!important}
html body.ts-studio .content :is(a,button,summary){-webkit-tap-highlight-color:transparent}
@media(max-width:1260px){
 html body.ts-studio .topbar{gap:10px!important;padding-inline:14px!important}
 html body.ts-studio .topbar-right{gap:6px!important}
 html body.ts-studio .topbar .ts16-device-scope{max-width:205px!important}
 html body.ts-studio .studio-topbar-center{max-width:300px!important}
}
@media(max-width:1020px){
 html body.ts-studio .topbar .topbar-right .workspace-switcher,
 html body.ts-studio .topbar .topbar-right .workspace-static{display:flex!important;min-width:0!important;max-width:112px!important}
 html body.ts-studio .topbar .topbar-right .workspace-switcher select{min-width:0!important;max-width:90px!important}
 html body.ts-studio:not(.page-inbox) .content{padding:22px 18px 40px!important}
 html body.ts-studio.page-index .dashboard-grid.studio-dashboard-detail,
 html body.ts-studio.page-updater .profile-grid{grid-template-columns:1fr!important}
 html body.ts-studio.page-reports .report-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 html body.ts-studio .content :is(.ai-console-tabs,.ai-simple-tabs,.ts46-help-nav,.tabs,.tab-strip,.bc-stepper){overflow-x:auto!important;flex-wrap:nowrap!important}
 html body.ts-studio .content :is(.table-wrap,.source-table-wrap,.tsqr-table-wrap) table{min-width:620px}
}
@media(max-width:760px){
 html body.ts-studio{font-size:13px!important}
 html body.ts-studio:not(.page-inbox) .content{padding:15px 12px 35px!important}
 html body.ts-studio .ts15-page-heading{gap:10px!important;margin-bottom:14px!important}
 html body.ts-studio .ts15-page-heading h1{font-size:20px!important}
 html body.ts-studio .content .card{padding:14px!important}
 html body.ts-studio .content :is(.page-heading,.section-heading,.section-head){gap:8px!important}
 html body.ts-studio .content :is(.dashboard-grid,.profile-grid,.settings-grid,.form-grid-2,.bc-grid,.report-grid-3,.ai-provider-layout,.ai-api-grid){grid-template-columns:minmax(0,1fr)!important}
 html body.ts-studio .topbar{height:62px!important;min-height:62px!important;max-height:62px!important;padding:0 9px!important;gap:6px!important}
 html body.ts-studio .topbar .studio-topbar-left{gap:6px!important}
 html body.ts-studio .topbar .ts15-topbar-shortcut{max-width:136px!important;padding:7px!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:10px!important}
 html body.ts-studio .topbar :is(.menu-toggle,.studio-mobile-search-toggle,.notif-chip){height:35px!important;width:35px!important;min-width:35px!important}
 html body.ts-studio .topbar .topbar-right{gap:4px!important}
 html body.ts-studio .topbar .workspace-switcher{max-width:120px!important}
 html body.ts-studio .topbar .workspace-switcher select{max-width:85px!important}
 html body.ts-studio .topbar .ts16-device-scope{max-width:125px!important;min-width:0!important}
 html body.ts-studio .topbar .ts16-device-icon{display:none!important}
 html body.ts-studio .topbar .ts16-device-control label{font-size:9px!important}
 html body.ts-studio .topbar .account-trigger{padding:4px!important;gap:4px!important}
 html body.ts-studio .topbar .user-copy{display:none!important}
 html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar){gap:7px!important;padding:8px!important}
 html body.ts-studio .content :is(.ts18-grid-controls,.ts18-datagrid-toolbar,.ts18-list-toolbar) input[type=search]{min-width:120px!important;max-width:180px!important}
 html body.ts-studio .content :is(.table-wrap,.source-table-wrap,.tsqr-table-wrap) table{min-width:550px!important}
 html body.ts-studio .content :is(.table-wrap,.source-table-wrap,.tsqr-table-wrap) :is(th,td){padding:10px!important}
 html body.ts-studio.page-inbox .inbox-message-wall .message-row .message-bubble{max-width:90%!important}
 html body.ts-studio.page-inbox .inbox-chat-head{padding:8px!important;gap:7px!important}
 html body.ts-studio.page-reports .report-grid-3{grid-template-columns:1fr!important}
 html body.ts-studio.page-users .user-admin-row{display:flex!important;flex-wrap:wrap!important}
 html body.ts-studio.page-users .user-admin-row .user-admin-actions{min-width:0!important;width:100%!important}
 html body.ts-studio.page-ai_chatbot .ai-simple-number-list{overflow-x:auto!important;display:flex!important}
 html body.ts-studio.page-ai_chatbot .ai-simple-number-list>*{flex:0 0 220px!important}
 html body.ts-studio .content :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px!important}
}
@media(max-width:430px){
 html body.ts-studio .topbar .ts15-topbar-shortcut{display:none!important}
 html body.ts-studio .topbar .workspace-switcher{display:flex!important;max-width:39px!important;min-width:39px!important;width:39px!important;padding:2px 3px!important;overflow:hidden!important}
 html body.ts-studio .topbar .workspace-switcher span{display:none!important}
 html body.ts-studio .topbar .workspace-switcher:before{content:'B';display:inline-flex!important;align-items:center!important;justify-content:center!important;color:#fff!important;font-size:11px!important;font-weight:800!important;flex:0 0 12px!important}
 html body.ts-studio .topbar .workspace-switcher select{width:35px!important;max-width:35px!important;min-width:35px!important;padding:0 2px!important;font-size:0!important;cursor:pointer!important}
 html body.ts-studio .topbar .ts16-device-scope{max-width:115px!important}
 html body.ts-studio .topbar .ts16-device-scope{max-width:146px!important}
 html body.ts-studio .content :is(.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts18-selection-bar,.ts18-users-bulk,.ts19-one-row-bulk,.ts19-handoff-bulk,.ts19-history-toolbar) :is(button,select){font-size:11px!important}
 html body.ts-studio .content :is(.table-wrap,.source-table-wrap,.tsqr-table-wrap) table{min-width:500px!important}
 html body.ts-studio .sidebar .logout-text-link{padding:7px!important}
}
@media(prefers-reduced-motion:reduce){html body.ts-studio *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
