/* TS WhatsApp v15.16 - compact bulk controls and measured spacing.
 * This is a presentation-only patch: no new buttons, fake actions, or changed permissions.
 * Scoped to app pages and known action bars; preserve form submission behaviour. */

/* Single-row action bars. These remain the full width of their list, but not excessively tall. */
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.tsqr-toolbar,.ts15-list-toolbar,
 .ts18-history-bulk,.ts20-inbox-bulk
){
 box-sizing:border-box!important;
 display:flex!important;flex-direction:row!important;align-items:center!important;
 justify-content:flex-start!important;flex-wrap:nowrap!important;
 gap:8px!important;min-height:46px!important;max-height:none!important;
 height:auto!important;max-width:100%!important;
 padding:6px 10px!important;margin:0 0 12px!important;
 border:1px solid var(--ts15-line,var(--ts18-border,#dbe3ed))!important;
 border-radius:10px!important;
 background:var(--ts15-paper-2,var(--ts18-hover,#f6f8fb))!important;
 color:var(--ts15-ink,var(--ts18-fg,#142d49))!important;
 overflow-x:auto!important;overflow-y:hidden!important;
 scrollbar-width:thin!important;scrollbar-color:transparent transparent!important;
 text-align:left!important;
}
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.tsqr-toolbar,.ts15-list-toolbar,.ts20-inbox-bulk
):hover{scrollbar-color:var(--ts15-line,#dbe3ed) transparent!important}
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.ts20-inbox-bulk
) :is(label,span,small,strong,b){
 font-size:12px!important;line-height:1.4!important;
 margin-top:0!important;margin-bottom:0!important;
 white-space:nowrap!important;flex-shrink:0!important;
 color:inherit!important;
}
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.ts20-inbox-bulk
) :is(select,button,input[type=search],input[type=text]){
 box-sizing:border-box!important;min-height:34px!important;max-height:36px!important;
 height:34px!important;max-width:240px!important;
 padding:5px 10px!important;margin:0!important;
 line-height:1.35!important;font-size:12px!important;font-weight:600!important;
 border-radius:8px!important;white-space:nowrap!important;flex:0 0 auto!important;
}
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.ts20-inbox-bulk
) select{min-width:118px!important;width:auto!important;max-width:205px!important;background:var(--ts15-paper,var(--ts18-card,#fff))!important;color:var(--ts15-ink,#1b324d)!important;border:1px solid var(--ts15-line,#cbd5e1)!important}
html body.ts-studio .content :is(
 .bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,
 .ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,
 .ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,
 .tsm-bulk-row,.ts20-inbox-bulk
) :is(input[type=checkbox],input[type=radio]){
 box-sizing:border-box!important;width:16px!important;height:16px!important;
 min-width:16px!important;min-height:16px!important;max-width:16px!important;max-height:16px!important;
 padding:0!important;margin:0!important;accent-color:#2766a6!important;flex:0 0 16px!important;
}
html body.ts-studio .content :is(.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.source-bulk-toolbar) > label{
 display:inline-flex!important;align-items:center!important;gap:6px!important;flex:0 0 auto!important;
}
html body.ts-studio.page-broadcast_handoff .content .ts19-handoff-bulk .ts19-bulk-hint{display:none!important}
html body.ts-studio.page-broadcast_handoff .content .ts19-handoff-bulk select[data-ts19-handoff-status]{min-width:142px!important;width:152px!important;max-width:170px!important}
html body.ts-studio.page-updater .content .ts19-bulk-toolbar .ts19-history-search{margin-left:auto!important}
html body.ts-studio.page-updater .content .ts19-bulk-toolbar .ts19-history-size{flex:0 0 auto!important}
html body.ts-studio.page-inbox .content .ts20-inbox-bulk[hidden]{display:none!important}
html body.ts-studio.page-inbox .content .ts20-inbox-bulk{min-height:44px!important;padding:5px 7px!important;gap:5px!important;margin-bottom:0!important;border-radius:0!important}
html body.ts-studio.page-inbox .content .ts20-inbox-bulk .inbox-bulk-action-select{min-width:115px!important;max-width:160px!important}
html body.ts-studio .content :is(.bulk-actions-bar,.ts18-users-bulk,.ts18-notification-bulk,.ts19-handoff-bulk,.ts19-bulk-toolbar) button:disabled{opacity:.52!important;cursor:not-allowed!important}
html body.ts-studio .content :is(.bulk-actions-bar,.ts18-users-bulk,.ts18-notification-bulk,.ts19-handoff-bulk,.ts19-bulk-toolbar) input:focus-visible,
html body.ts-studio .content :is(.bulk-actions-bar,.ts18-users-bulk,.ts18-notification-bulk,.ts19-handoff-bulk,.ts19-bulk-toolbar) select:focus-visible,
html body.ts-studio .content :is(.bulk-actions-bar,.ts18-users-bulk,.ts18-notification-bulk,.ts19-handoff-bulk,.ts19-bulk-toolbar) button:focus-visible{outline:2px solid #5a9ff2!important;outline-offset:2px!important}

/* Consistent but moderate spacing for high-level groups (not arbitrary nested sections). */
html body.ts-studio .content :is(.dashboard-grid,.profile-grid,.settings-grid,.report-grid-3,.tsbh-stats,.bc-grid,.tsqr-page,.studio-dashboard-detail){gap:14px!important;row-gap:14px!important}
html body.ts-studio .content :is(.studio-page-heading,.ts15-page-heading){margin-bottom:14px!important}
html body.ts-studio .content :is(.studio-module-intro,.section-heading,.tsbh-top,.tsqr-header){margin-bottom:12px!important}
html body.ts-studio .content > :is(.card,.table-wrap,.studio-module-intro,.module-search-shell,.section-heading){margin-bottom:14px!important}
html body.ts-studio .content :is(.table-wrap,.tsbh-table-scroll,.tsm-table-wrap) :is(th,td){line-height:1.42!important}
html body.ts-studio .content :is(.table-wrap,.tsbh-table-scroll,.tsm-table-wrap) td{padding-block:10px!important}
html body.ts-studio .content :is(.table-wrap,.tsbh-table-scroll,.tsm-table-wrap) th{padding-block:9px!important}
html body.ts-studio .content :is(.pagination,.ts18-datagrid-pager,.ts18-list-pager,.ts19-history-pager){margin-top:10px!important;gap:8px!important}

/* Light/dark semantic contrast; never overwrite the intended disabled/primary actions. */
html[data-theme="dark"] body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row,.ts20-inbox-bulk){
 background:var(--ts15-paper-2,#172b40)!important;color:var(--ts15-ink,#e9f2ff)!important;border-color:var(--ts15-line,#34475c)!important;
}

/* On mobile: controls remain accessible in a single scrolling row, with less chunky text.
 * Keep input text 16px where focus may invoke Safari zoom, but labels/buttons are compact. */
@media(max-width:760px){
 html body.ts-studio:not(.auth-body){font-size:12.5px!important;line-height:1.48!important}
 html body.ts-studio .content :is(h1,.studio-page-heading h1,.ts15-page-heading h1){font-size:19px!important;line-height:1.27!important}
 html body.ts-studio .content h2{font-size:16px!important;line-height:1.33!important}
 html body.ts-studio .content h3{font-size:14px!important;line-height:1.34!important}
 html body.ts-studio .content :is(p,.muted,small,.help-text,.hint,td,th){font-size:12px!important;line-height:1.45!important}
 html body.ts-studio .content :is(.card,.tsbh-card,.settings-section-card){padding:12px!important}
 html body.ts-studio .content :is(.dashboard-grid,.profile-grid,.settings-grid,.report-grid-3,.tsbh-stats,.bc-grid,.tsqr-page,.studio-dashboard-detail){gap:11px!important;row-gap:11px!important}
 html body.ts-studio .content :is(.studio-page-heading,.ts15-page-heading){margin-bottom:11px!important}
 html body.ts-studio .content :is(.studio-module-intro,.section-heading,.tsbh-top,.tsqr-header){margin-bottom:10px!important}
 html body.ts-studio .content > :is(.card,.table-wrap,.studio-module-intro,.module-search-shell,.section-heading){margin-bottom:11px!important}
 html body.ts-studio .content :is(.table-wrap,.tsbh-table-scroll,.tsm-table-wrap) td{padding-block:9px!important}
 html body.ts-studio .content :is(.table-wrap,.tsbh-table-scroll,.tsm-table-wrap) th{padding-block:8px!important}
 html body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row,.tsqr-toolbar,.ts15-list-toolbar,.ts20-inbox-bulk){
  gap:6px!important;padding:5px 7px!important;min-height:44px!important;margin-bottom:10px!important;
 }
 html body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row,.ts20-inbox-bulk) :is(button,select){font-size:11.5px!important;min-height:32px!important;height:32px!important;padding:5px 8px!important}
 html body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row,.ts20-inbox-bulk) :is(label,span,small,strong,b){font-size:11.5px!important}
 html body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row,.ts20-inbox-bulk) input:not([type=checkbox]):not([type=radio]){font-size:16px!important}
 html body.ts-studio .content .ts20-inbox-bulk{margin-bottom:0!important}
}
@media(max-width:390px){
 html body.ts-studio .content :is(.bulk-actions-bar,.ts19-handoff-bulk,.ts19-bulk-toolbar,.ts18-users-bulk,.ts18-notification-bulk,.ts18-datagrid-toolbar,.ts18-list-toolbar,.ts19-one-row-bulk,.source-bulk-toolbar,.tsm-bulk-row){gap:5px!important;padding:5px 6px!important}
 html body.ts-studio .content .ts19-handoff-bulk select[data-ts19-handoff-status]{min-width:135px!important;width:135px!important}
}
/* Narrow phones: hide redundant prose labels, not the select controls or their accessible names. */
@media(max-width:480px){
 html body.ts-studio.page-broadcast_handoff .content .ts19-handoff-bulk > label:nth-of-type(2),
 html body.ts-studio.page-updater .content .ts19-bulk-toolbar > .ts19-action-label,
 html body.ts-studio.page-updater .content .ts19-bulk-toolbar > .ts19-history-search,
 html body.ts-studio.page-updater .content .ts19-bulk-toolbar > .ts19-history-size{
  font-size:0!important;gap:0!important;
 }
 html body.ts-studio.page-broadcast_handoff .content .ts19-handoff-bulk > label:nth-of-type(2) select,
 html body.ts-studio.page-updater .content .ts19-bulk-toolbar > label :is(select,input){font-size:12px!important}
 html body.ts-studio.page-broadcast_handoff .content .ts19-handoff-bulk{scroll-padding:8px!important}
}
