/* Growth Engine, Step 3: the Broadcasts view (list, saved segments, the segment builder, the create page and a
   broadcast's page). Tokens only (public/tokens.css); both themes come from the tokens. */

.bc{max-width:1180px;margin:0 auto}
.bc-back{margin:0 0 8px -8px}
.bc-head-actions{display:flex;gap:8px}
.bc-tabs{margin:0 0 16px}
.bc-list{display:flex;flex-direction:column;gap:12px}
.bc-list[aria-busy="true"]>:not(.skeleton){opacity:.6;transition:opacity var(--dur-quick) ease}
.bc .tone-success{color:var(--success)}
/* fields: the Meetings field style (.sc-meet, on the root) plus the select arrow's room and the disabled look */
.bc select{padding-right:var(--select-arrow-space)}
.bc :is(input,select,textarea):disabled{opacity:.6;cursor:not-allowed}
.gr-tag.is-done{border-color:color-mix(in srgb,var(--info) 35%,transparent);background:var(--info-tint);color:var(--info)}

/* ---------- list ---------- */
.bc-table{padding:0}
.bc-table .data-table tbody tr{cursor:pointer}
.bc-table .data-table tbody tr:hover>*{background:var(--line-soft)}
.bc-table .data-table th[scope="row"]{min-width:220px}
.bc-name{display:block;max-width:100%;padding:0;border:0;background:none;font:500 15px/20px var(--font);color:var(--text-strong);text-align:left;overflow-wrap:anywhere;cursor:pointer;border-radius:var(--r-xs)}
.bc-name:hover{text-decoration:underline;text-underline-offset:3px}
.bc-rate{color:var(--muted);font-size:12px}
.bc-cards{display:none;list-style:none;margin:0;padding:0;flex-direction:column;gap:8px}
.bc-card{display:flex;flex-direction:column;align-items:stretch;gap:4px;width:100%;padding:12px 14px;text-align:left;color:inherit;font:inherit;cursor:pointer;min-height:44px}
.bc-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.bc-card-name{font:500 15px/20px var(--font);color:var(--text-strong);overflow-wrap:anywhere}
.bc-card-nums{font:400 13px/18px var(--font);color:var(--text-2)}
.bc-segments{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.bc-segment{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 12px 12px 16px}
.bc-segment-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.bc-segment-actions{display:flex;align-items:center;gap:4px;flex:none}

/* ---------- the segment builder ---------- */
.bc-builder{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:16px;align-items:start}
.bc-filters{display:flex;flex-direction:column;gap:16px;padding:16px}
.bc-filters .ui-field{margin:0}
.bc-filters .chip-row{margin-top:6px}
.bc-filters .seg{margin-top:6px}
.bc-picker-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}
.bc-picker select{width:100%}
.bc-picked{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.bc-picked:empty{display:none}
.bc-pill{display:inline-flex;align-items:center;gap:2px;max-width:100%;padding:2px 2px 2px 10px;border:1px solid var(--accent-border);border-radius:var(--r-pill);background:var(--accent-tint);color:var(--accent-text);font:600 12px/16px var(--font);overflow-wrap:anywhere}
.bc-pill-x{display:inline-grid;place-items:center;width:28px;height:28px;flex:none;border:0;border-radius:var(--r-pill);background:transparent;color:inherit;cursor:pointer}
.bc-pill-x:hover{background:var(--accent-tint-soft)}
.bc-filter-foot{display:flex;justify-content:flex-start}
.bc-results{display:flex;flex-direction:column;gap:12px;position:sticky;top:0}
.bc-count{padding:16px}
.bc-count[aria-busy="true"]{opacity:.7;transition:opacity var(--dur-quick) ease}
.bc-count-main{margin:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
.bc-stat{font:400 34px/40px var(--font-display);color:var(--text-strong);letter-spacing:-.01em}
.bc-count-word{font:500 15px/20px var(--font);color:var(--text-2)}
.bc-count-sub{margin:4px 0 0;font:400 13px/18px var(--font);color:var(--muted)}
.bc-excl{list-style:none;margin:12px 0 0;padding:0;display:flex;flex-direction:column}
.bc-excl li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:6px 0;border-top:1px solid var(--line-soft);font:400 13px/18px var(--font);color:var(--text-2)}
.bc-excl li:first-child{border-top:0}
.bc-excl li>.tnum{color:var(--text);font-weight:500}
.bc-h3{margin:0;font:400 20px/26px var(--font-display);color:var(--text-strong)}
.bc-h4{margin:16px 0 0;font:600 12px/16px var(--font);color:var(--text-2)}
.bc-preview .bc-h4{margin:4px 0 8px}
.bc-h4+.bc-excl{margin-top:4px}
.bc-ptable{padding:0}
.bc-ptable .data-table{min-width:640px}
.bc-ptable .data-table th,.bc-ptable .data-table td{padding:10px 12px}
.bc-ptable .data-table td:nth-child(2){white-space:nowrap}

/* ---------- create / edit ---------- */
.bc-form{display:flex;flex-direction:column;gap:16px;max-width:1180px}
.bc-sec{display:flex;flex-direction:column;gap:12px;padding:16px}
.bc-sec>.ui-field,.bc-sec .ui-grid2 .ui-field{margin:0}
.bc-sec:not(.surface){padding:0}
.bc-sec-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px}
.bc-sec-head .bc-h3{margin-right:auto}
.bc-namefield{max-width:560px}
.bc-vars{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.bc-var{display:grid;grid-template-columns:64px minmax(0,220px) minmax(0,1fr);align-items:center;gap:8px 12px}
.bc-var-key{font:600 13px/18px var(--font);color:var(--text-2)}
.bc-var-note{font:400 13px/18px var(--font);color:var(--muted)}
.bc-mt{margin-top:8px}
.bc-preview-msg{display:flex;flex-direction:column;gap:6px}
.bc-preview-msg:empty{display:none}
.bc-bubble{margin:0;max-width:560px;padding:10px 14px;border:1px solid var(--line);border-radius:var(--r) var(--r) var(--r) var(--r-xs);background:var(--well);color:var(--text);font:400 14px/20px var(--font);white-space:pre-wrap;overflow-wrap:anywhere}

/* ---------- a broadcast's page ---------- */
.bc-title{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px}
.bc-title .gr-tag{font-size:12px;padding:2px 10px}
.bc-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.bc-start-hint{margin:-12px 0 12px}
.bc>[data-bc-body]>[data-bc-detail]>.banner,.bc [data-bc-detail]>.banner{margin:0 0 16px}
[data-bc-detail]{display:flex;flex-direction:column;gap:16px}
[data-bc-detail]>.screen-head{margin-bottom:0}
.bc-progress-head{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 12px}
.bc-progress-text{font:400 13px/18px var(--font);color:var(--text-2)}
.bc-meter{height:8px;border-radius:var(--r-pill);background:var(--raised);overflow:hidden}
.bc-meter>span{display:block;height:100%;width:100%;background:var(--info);transform-origin:left center;transition:transform var(--dur-view) var(--ease-out-soft)}
.bc-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.bc-score{margin-top:4px}
.bc-score th,.bc-score td{padding:9px 0}
.bc-score td.num{padding-left:12px}
.bc-score tbody th[scope="row"]{color:var(--text)}
.bc-of{color:var(--muted);font-size:12px}
.bc-varlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font:400 13px/18px var(--font);color:var(--text-2)}
.bc-estimate{margin-top:4px}
.bc-log{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.bc-log li{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-top:1px solid var(--line-soft)}
.bc-log li:first-child{border-top:0;padding-top:0}
.bc-log-what{font:500 14px/20px var(--font);color:var(--text)}
@media (prefers-reduced-motion:reduce){.bc-meter>span{transition:none}}

/* ---------- tablet and phone ---------- */
@media (max-width:1099px){
  .bc-builder{grid-template-columns:minmax(0,1fr)}
  /* one column: the live count leads (it answers every filter tap), the filters follow, then the preview rows */
  .bc-results{display:contents}
  .bc-count{order:-1}
  .bc-preview{order:1}
  .bc-detail-grid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:767px){
  /* a broadcast's, the create and the segment page keep their own title on phones (the top bar says only Broadcasts) */
  .bc .screen-h.bc-title,.bc .screen-h.bc-page-h{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal;font-size:26px;line-height:32px}
  .bc-table{display:none}
  .bc-cards{display:flex}
  .bc-picker-grid{grid-template-columns:minmax(0,1fr)}
  .bc-var{grid-template-columns:minmax(0,1fr)}
  .bc-var-key{margin-top:4px}
  .bc-segment{flex-direction:column;align-items:stretch;padding:12px}
  .bc-segment-actions{justify-content:space-between}
  .bc-actions{width:100%}
  .bc-actions>.btn{flex:1 1 auto}
  .bc-head-actions,.bc-head-actions>.btn{width:100%}
  .bc-tabs .seg{width:100%}
  .bc-stat{font-size:30px;line-height:36px}
  /* the create and segment forms always have something to save and run long (the filters, the count, 20 preview
     rows), so their bar stays in reach above the tab bar and the mic: Cancel and Save share one row to keep it one
     button tall; the error, when there is one, takes its own row above them */
  .bc-savebar .btn{flex:1 1 0}
  .bc-savebar .ui-error{flex:1 1 100%}
}
@media (pointer:coarse){.bc-pill-x{width:36px;height:36px}.bc-pill{min-height:36px}}
/* The template select's place while Interakt's list is read (the size of the select it becomes). */
.bc-tpl-skel{height:44px}
.bc-tpl-fallback{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:12px}
@media (max-width:767px){.bc-tpl-fallback .btn{min-height:44px}}
