/* ═══════════════════════════════════════════════════════════════════════════
   TikTok screens (moved in from the TikTok dashboard, Hashtags first).

   Built on the Data Builder overview's language (data-builder-list.css): a
   white toolbar bar edge to edge, 32px controls in IBM Plex, Figtree body,
   Mirrors teal for the primary action and progress only. Scoped under .tt-pg
   so none of it reaches the rest of the app.
   ═══════════════════════════════════════════════════════════════════════════ */

.tt-pg {
  --tt-bg:      #FBFBFC;
  --tt-surface: #FFFFFF;
  --tt-ink:     #17181C;
  --tt-muted:   #6B6F76;
  --tt-faint:   #9A9EA6;
  --tt-line:    #E6E7EA;
  --tt-line-2:  #EEEFF1;
  --tt-hover:   #F7F8F9;
  --tt-sel:     #F0FBF9;
  --tt-teal:    #0FB8A2;
  --tt-teal-hover: #088E89;
  --tt-red:     #D9463A;
  --tt-sans: "Figtree", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --tt-ctl:  "IBM Plex Sans", "Inter", system-ui, sans-serif;
  --tt-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Edge to edge inside .app-content's 26px padding, like Data Builder. */
  margin: -26px;
  width: auto;
  min-height: calc(100vh - 64px);
  padding: 0 0 24px;
  background: var(--tt-bg);
  color: var(--tt-ink);
  font-family: var(--tt-sans);
  font-variant-numeric: tabular-nums;
}
.tt-pg *:focus-visible { outline: 2px solid var(--tt-teal); outline-offset: 2px; border-radius: 5px; }

/* ── Header / toolbar ────────────────────────────────────────────────────── */
.tt-hd {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 22px; background: var(--tt-surface); border-bottom: 1px solid var(--tt-line);
}
.tt-title { display: flex; align-items: baseline; gap: 10px; }
.tt-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--tt-muted); white-space: nowrap; }
.tt-kicker .bi { font-size: 12px; color: var(--tt-ink); }
.tt-title h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.01em; white-space: nowrap; }

/* <social-tabs>: sibling screens under one sidebar entry (Hashtags + Trending,
   Interests). Underline tabs on the header's surface, so they read as part of it. */
.tt-tabs {
  display: flex; gap: 4px; padding: 0 22px; overflow-x: auto;
  background: var(--tt-surface); border-bottom: 1px solid var(--tt-line);
}
.tt-tabs__tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px;
  font-size: 13px; color: var(--tt-muted); white-space: nowrap; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tt-tabs__tab .bi { font-size: 13px; }
.tt-tabs__tab:hover { color: var(--tt-ink); text-decoration: none; }
.tt-tabs__tab.is-on { color: var(--tt-ink); font-weight: 600; border-bottom-color: var(--tt-teal); }
.tt-tabs__tab.is-on .bi { color: var(--tt-teal-hover); }

.tt-tools { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; justify-content: flex-end; }

.tt-srch { position: relative; display: flex; align-items: center; flex: 1; min-width: 260px; max-width: 520px; }
.tt-srch .bi { position: absolute; left: 10px; font-size: 13px; color: var(--tt-faint); pointer-events: none; }
.tt-srch input {
  height: 32px; width: 100%; padding: 0 10px 0 30px; border: 1px solid rgba(15,58,58,.25); border-radius: 6px;
  background: var(--tt-surface); font-family: var(--tt-ctl); font-size: 13px; color: var(--tt-ink);
}
.tt-srch input::placeholder { color: var(--tt-faint); }
.tt-srch input:focus { outline: 0; border-color: var(--tt-teal); box-shadow: 0 0 0 3px rgba(15,184,162,.15); }

.tt-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; margin: 0;
  border: 1px solid rgba(15,58,58,.25); border-radius: 6px; background: var(--tt-surface);
  font-family: var(--tt-ctl); font-size: 13px; color: var(--tt-ink); white-space: nowrap;
}
.tt-chip small { color: var(--tt-muted); font-size: 13px; }
.tt-chip searchable-select { min-width: 92px; }

.tt-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border: 1px solid rgba(15,58,58,.25); border-radius: 6px; background: var(--tt-surface);
  font-family: var(--tt-ctl); font-size: 14px; color: #4A5E5E; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tt-btn:hover:not(:disabled) { background: var(--tt-hover); border-color: rgba(15,58,58,.4); color: var(--tt-ink); }
.tt-btn:disabled { opacity: .55; cursor: not-allowed; }
.tt-btn--primary { background: var(--tt-teal); border-color: var(--tt-teal); color: #fff; }
.tt-btn--primary:hover:not(:disabled) { background: var(--tt-teal-hover); border-color: var(--tt-teal-hover); color: #fff; }
.tt-btn .bi { font-size: 12px; }
.tt-spin { display: inline-block; animation: tt-spin 1s linear infinite; }
@keyframes tt-spin { to { transform: rotate(360deg); } }

/* ── Body ────────────────────────────────────────────────────────────────── */
.tt-body { padding: 16px 22px 0; display: flex; flex-direction: column; gap: 14px; }

.tt-tips { border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-surface); }
.tt-tips-hd {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px;
  border: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--tt-ink); cursor: pointer; text-align: left;
}
.tt-tips-hd > .bi:first-child { color: var(--tt-teal); }
.tt-tips-caret { margin-left: auto; font-size: 11px; color: var(--tt-faint); }
.tt-tips ul { margin: 0; padding: 0 14px 12px 34px; display: grid; gap: 5px; font-size: 12.5px; color: var(--tt-muted); line-height: 1.45; }
.tt-tips li::marker { color: var(--tt-teal); }
.tt-tips strong { color: var(--tt-ink); font-weight: 600; }
.tt-tips li.is-important {
  list-style: none; margin: 4px 0 0 -20px; padding: 8px 10px; border-radius: 6px;
  background: #FFF6E8; border: 1px solid #F0DCB4; color: #8A6520;
}
.tt-tips li.is-important .bi { margin-right: 4px; }

.tt-err {
  padding: 9px 12px; border-radius: 8px; font-size: 13px;
  background: #FDECEC; color: var(--tt-red); border: 1px solid #F3C0C0;
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.tt-progress {
  border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-surface);
  padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.tt-progress-top, .tt-bar, .tt-progress-sub { width: 100%; max-width: 440px; }
.tt-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tt-progress-msg { font-size: 14px; font-weight: 500; }
.tt-progress-pct { font-size: 14px; font-weight: 600; color: var(--tt-teal-hover); }
.tt-bar { height: 6px; border-radius: 3px; background: var(--tt-line-2); overflow: hidden; }
/* Scaled, not resized — transform is composited, width would relayout. */
.tt-bar i { display: block; height: 100%; width: 100%; background: var(--tt-teal);
  transform-origin: left center; transition: transform .3s ease; }
.tt-progress-sub { font-size: 12.5px; color: var(--tt-muted); text-align: left; }

/* ── Results ─────────────────────────────────────────────────────────────── */
.tt-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--tt-muted); padding: 0 2px 8px; }
.tt-meta b { color: var(--tt-ink); font-weight: 600; }

.tt-tablewrap { border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-surface); overflow-x: auto; }
table.tt-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tt-tbl th {
  text-align: left; font-size: 11px; font-weight: 500; color: var(--tt-faint);
  padding: 9px 12px; border-bottom: 1px solid var(--tt-line); white-space: nowrap; background: #FAFBFC;
}
table.tt-tbl td { padding: 0 12px; height: 42px; border-top: 1px solid var(--tt-line-2); white-space: nowrap; color: #3E4148; }
table.tt-tbl tbody tr:first-child td { border-top: 0; }
table.tt-tbl tbody tr:hover { background: var(--tt-hover); }
table.tt-tbl tbody tr.is-on { background: var(--tt-sel); }
.tt-ck { width: 36px; }
.tt-ck input { accent-color: var(--tt-teal); cursor: pointer; }
td.tt-kw { color: var(--tt-ink); font-weight: 500; }
td.tt-mono { font-family: var(--tt-mono); font-size: 12px; }

.tt-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.tt-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tt-pill.is-ok::before  { background: var(--tt-teal); }
.tt-pill.is-off::before { background: transparent; border: 1.5px solid var(--tt-red); }
.tt-pill.is-off { color: var(--tt-red); }

.tt-empty { border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-surface); padding: 44px 24px; text-align: center; }
.tt-pg > .tt-empty { margin: 16px 22px; }
.tt-empty .bi { font-size: 24px; color: var(--tt-faint); }
.tt-empty h3 { font-size: 15px; font-weight: 600; margin: 12px 0 4px; }
.tt-empty p { font-size: 13px; color: var(--tt-muted); margin: 0; }

@media (max-width: 900px) {
  .tt-tools { justify-content: flex-start; }
  .tt-srch { max-width: none; min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-pg *, .tt-pg *::before, .tt-pg *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ═══ Trending Hashtags (.tt-tr) ════════════════════════════════════════════ */
.tt-sub { font-size: 12.5px; color: var(--tt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-tr .tt-title { min-width: 0; flex-wrap: wrap; }
.tt-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tt-badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px;
  border: 1px solid var(--tt-line); background: var(--tt-surface); font-size: 12px; color: var(--tt-muted); white-space: nowrap;
}

.tt-card { border: 1px solid var(--tt-line); border-radius: 8px; background: var(--tt-surface); }

.tt-fetch { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }
.tt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tt-field label { font-size: 11px; font-weight: 600; color: var(--tt-muted); margin: 0; }
.tt-field label small { font-weight: 400; color: var(--tt-faint); font-size: 11px; }
.tt-field--geo { width: 240px; }
.tt-field--cat { flex: 1; min-width: 260px; max-width: 520px; }
.tt-field--dr  { width: 150px; }

.tt-warn {
  position: relative; padding: 10px 36px 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.5;
  background: #FFF6E8; border: 1px solid #F0DCB4; color: #7A5709;
}
.tt-warn b { display: block; margin-bottom: 2px; font-weight: 600; }
.tt-warn-x { position: absolute; top: 6px; right: 6px; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 5px; }
.tt-warn-x:hover { background: rgba(122,87,9,.1); }

.tt-results-card { overflow: hidden; }
.tt-controls { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--tt-line); }
.tt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Pills inside a card, the Data Builder view switcher. */
.tt-seg {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 3px;
  border: 1px solid var(--tt-line); border-radius: 9px; background: var(--tt-surface);
}
.tt-seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px; border: 0; border-radius: 6px;
  background: transparent; font-family: var(--tt-ctl); font-size: 13px; color: var(--tt-muted); cursor: pointer;
}
.tt-seg button:hover { background: var(--tt-hover); color: var(--tt-ink); }
.tt-seg button.is-on, .tt-seg button.is-on:hover { background: #0F3A3A; color: #fff; font-weight: 600; }
.tt-cnt { font-size: 11px; padding: 0 6px; border-radius: 8px; background: rgba(15,58,58,.08); }
.tt-seg button.is-on .tt-cnt { background: rgba(255,255,255,.18); }
.tt-hint { font-size: 12.5px; color: var(--tt-muted); flex: 1; min-width: 240px; }

.tt-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; cursor: pointer; white-space: nowrap; }
.tt-check input { accent-color: var(--tt-teal); }
.tt-srch--sm { flex: 0 1 260px; min-width: 200px; }
.tt-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tt-chips-label { font-size: 12px; color: var(--tt-muted); }
.tt-fchip {
  height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--tt-line); background: var(--tt-surface);
  font-family: var(--tt-ctl); font-size: 12px; color: var(--tt-muted); cursor: pointer;
}
.tt-fchip:hover { border-color: rgba(15,58,58,.4); color: var(--tt-ink); }
.tt-fchip.is-on { background: var(--tt-sel); border-color: var(--tt-teal); color: #0B6E61; }
.tt-vcount { margin-left: auto; font-size: 12.5px; color: var(--tt-muted); white-space: nowrap; }

.tt-tablewrap--flush { border: 0; border-radius: 0; }
.tt-tbl--sort th { cursor: pointer; user-select: none; }
.tt-tbl--sort th.tt-ck, .tt-tbl--sort th.tt-nosort { cursor: default; }
.tt-tbl--sort th:hover:not(.tt-ck):not(.tt-nosort) { color: var(--tt-ink); }
table.tt-tbl th.tt-num, table.tt-tbl td.tt-num { text-align: right; }
.tt-si { font-size: 10px; margin-left: 3px; color: var(--tt-line); }
.tt-si.is-on { color: var(--tt-teal-hover); }
.tt-th-note { font-weight: 400; color: var(--tt-faint); }
.tt-tbl--sort tbody tr { cursor: pointer; }
.tt-catcell { color: var(--tt-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tt-hname { color: var(--tt-ink); font-weight: 500; text-decoration: none; }
.tt-hname:hover { color: var(--tt-teal-hover); text-decoration: underline; }
.tt-hid {
  border: 1px dashed transparent; background: transparent; border-radius: 5px; padding: 2px 5px; margin-left: -6px;
  font-family: var(--tt-mono); font-size: 12px; color: #3E4148; cursor: copy;
}
.tt-hid:hover { border-color: var(--tt-teal); background: var(--tt-sel); }

/* Ads Manager targetability: only ONLINE can be targeted. */
.tt-st { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: #F1F2F4; color: var(--tt-muted); }
.tt-st--ONLINE { background: #E6F7F3; color: #0B6E61; }
.tt-st--OFFLINE, .tt-st--LEGAL_OFFLINE { background: #FDECEC; color: var(--tt-red); }
.tt-st--UNKNOWN { background: #FFF6E8; color: #8A6520; }
.tt-trend { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #0B6E61; }
.tt-faint { color: var(--tt-faint); }
.tt-spark { display: block; }
.tt-d30 { margin-left: 3px; font-size: 11px; color: var(--tt-faint); }
.tt-mom-up { color: #0B6E61; font-weight: 600; }
.tt-mom-down { color: var(--tt-red); font-weight: 600; }
.tt-empty--inline { border: 0; border-radius: 0; }
.tt-empty--inline .bi + p { margin-top: 10px; }
.tt-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--tt-line-2); }

/* Sticky action bar, pinned to the bottom of the scrolling content. */
.tt-abar {
  position: sticky; bottom: 0; z-index: 20; margin: 16px 22px 0; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--tt-line); border-radius: 10px; background: rgba(255,255,255,.96);
  box-shadow: 0 -6px 24px -12px rgba(15,58,58,.25); backdrop-filter: blur(6px);
}
.tt-selcount { font-size: 13px; color: var(--tt-muted); margin-right: auto; }
.tt-selcount b { color: var(--tt-ink); }
.tt-dd { position: relative; }
.tt-dd-menu {
  position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 170px; padding: 4px; border: 1px solid var(--tt-line);
  border-radius: 8px; background: var(--tt-surface); box-shadow: 0 12px 32px -12px rgba(15,58,58,.35); display: flex; flex-direction: column;
}
.tt-dd-menu button {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent;
  font-family: var(--tt-ctl); font-size: 13px; color: var(--tt-ink); cursor: pointer; text-align: left;
}
.tt-dd-menu button:hover { background: var(--tt-hover); }

.tt-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 1300;
  padding: 9px 14px; border-radius: 8px; background: #0F3A3A; color: #fff; font-size: 13px;
  transition: opacity .2s ease, transform .2s ease;
}
.tt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .tt-field--geo, .tt-field--dr, .tt-field--cat { width: 100%; max-width: none; }
  .tt-badges { margin-left: 0; }
}

/* ═══ Brand Safety (.tt-bs) ═════════════════════════════════════════════════ */
.tt-bs .tt-hd .tt-seg { margin-left: auto; }
.tt-seg--full { display: flex; width: 100%; }
.tt-seg--full button { flex: 1; justify-content: center; }
.tt-seg button:disabled { opacity: .55; cursor: not-allowed; }

.bs-steps { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--tt-faint); }
.bs-steps li { display: inline-flex; align-items: center; gap: 8px; }
.bs-steps li.is-on { color: var(--tt-ink); font-weight: 600; }
.bs-steps li.is-done { color: #0B6E61; }
.bs-step-n {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--tt-line); background: var(--tt-surface); font-size: 11px; font-weight: 600;
}
.bs-steps li.is-on .bs-step-n { background: #0F3A3A; border-color: #0F3A3A; color: #fff; }
.bs-steps li.is-done .bs-step-n { background: #E6F7F3; border-color: var(--tt-teal); color: #0B6E61; }
.bs-step-sep { color: var(--tt-line); }

.bs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.bs-config { padding: 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
.bs-hint { margin: 2px 0 0; font-size: 12px; color: var(--tt-muted); line-height: 1.45; }
.bs-run { justify-content: center; width: 100%; height: 36px; }
.bs-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.bs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bs-row-r { display: flex; align-items: center; gap: 8px; }
.bs-h { font-size: 14px; font-weight: 600; margin: 0; }
.bs-meta { font-size: 12.5px; font-weight: 400; color: var(--tt-muted); }
.bs-meta code { font-size: 12px; padding: 1px 5px; border-radius: 4px; background: var(--tt-line-2); color: var(--tt-ink); }

.bs-prog { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bs-stages { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.bs-stages li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; font-size: 13px; color: var(--tt-faint); }
.bs-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--tt-line); }
.bs-stages li.is-run { color: var(--tt-ink); font-weight: 500; }
.bs-stages li.is-run .bs-dot { border-color: var(--tt-teal); background: var(--tt-teal); animation: bs-pulse 1.1s ease-in-out infinite; }
.bs-stages li.is-ok { color: #0B6E61; }
.bs-stages li.is-ok .bs-dot { border-color: var(--tt-teal); background: var(--tt-teal); }
.bs-stage-d { font-family: var(--tt-mono); font-size: 12px; color: var(--tt-muted); }
@keyframes bs-pulse { 50% { box-shadow: 0 0 0 4px rgba(15,184,162,.2); } }

.bs-done { display: flex; flex-direction: column; gap: 12px; }
.bs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bs-stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.bs-stat b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--tt-ink); }
.bs-stat b.is-teal { color: #0B6E61; }
.bs-stat span { font-size: 12px; color: var(--tt-muted); }
.bs-btn-note { font-size: 12px; opacity: .85; }
.bs-handle { color: #0B6E61; }
.bs-geo { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--tt-line-2); font-size: 11px; font-weight: 600; color: #3E4148; }
.bs-foot { margin: 0; font-size: 12.5px; color: var(--tt-muted); }
.bs-link { border: 0; background: transparent; padding: 0; color: #0B6E61; font: inherit; text-decoration: underline; cursor: pointer; }

.bs-mc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bs-mc-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bs-mc-card h3 { font-size: 14px; font-weight: 600; margin: 0; }
.bs-mc-card .bs-meta { margin: -6px 0 0; }
.bs-req { display: flex; gap: 6px; flex-wrap: wrap; }
.bs-req span { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--tt-sel); color: #0B6E61; }
.bs-drop {
  border: 1.5px dashed rgba(15,58,58,.25); border-radius: 8px; padding: 18px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: border-color .15s ease, background .15s ease;
}
.bs-drop:hover, .bs-drop.is-drag { border-color: var(--tt-teal); background: var(--tt-sel); }
.bs-drop .bi { font-size: 20px; color: var(--tt-teal); }
.bs-drop p { margin: 0; font-size: 13px; }
.bs-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--tt-sel); font-size: 13px; }
.bs-file .bi { color: #0B6E61; }
.bs-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-input {
  height: 32px; padding: 0 10px; border: 1px solid rgba(15,58,58,.25); border-radius: 6px; background: var(--tt-surface);
  font-family: var(--tt-ctl); font-size: 13px; color: var(--tt-ink);
}
.bs-input:focus { outline: 0; border-color: var(--tt-teal); box-shadow: 0 0 0 3px rgba(15,184,162,.15); }
.bs-input.is-err { border-color: var(--tt-red); }
.bs-star { color: var(--tt-red); }
.bs-ok { padding: 8px 10px; border-radius: 6px; background: #E6F7F3; color: #0B6E61; font-size: 13px; font-weight: 600; }
.bs-new { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; background: var(--tt-teal); color: #fff; font-size: 10px; font-weight: 700; }
.bs-db table.tt-tbl td { height: 38px; }

/* ═══ Targeting Finder (.tf-pg) ═════════════════════════════════════════════ */
.tf-card { display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.tf-stack { display: flex; flex-direction: column; gap: 14px; }
.tf-mode { align-self: flex-start; height: 40px; }
.tf-mode button { padding: 0 16px; font-size: 14px; }
.tf-inputrow { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.tf-field { flex: 1 1 420px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--tt-muted); }
.tf-field input {
  height: 40px; padding: 0 12px; border: 1px solid rgba(15,58,58,.25); border-radius: 8px; background: var(--tt-surface);
  font-family: var(--tt-ctl); font-size: 14px; color: var(--tt-ink);
}
.tf-field input:focus { outline: 0; border-color: var(--tt-teal); box-shadow: 0 0 0 3px rgba(15,184,162,.15); }
.tf-inputrow .tt-btn, .tf-runbar .tt-btn--primary { height: 40px; padding: 0 20px; }
.tf-fresh { font-size: 13px; color: var(--tt-muted); }
.tf-drop { padding: 40px 24px; gap: 8px; }
.tf-drop .bi { font-size: 30px; }
.tf-drop p { font-size: 15px; }
.tf-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.tf-file { padding: 12px 14px; }
.tf-file .bs-file-name { white-space: normal; }
.tf-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tf-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 6px; background: var(--tt-line-2); color: var(--tt-muted); font-size: 13px; }
.tf-chip.is-ok { background: #E6F7F3; color: #0B6E61; font-weight: 600; }
.tf-runbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--tt-line); }
.tf-runbar .tf-stack { flex: 1 1 320px; gap: 8px; }
.tf-stages { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--tt-line); border-radius: 8px; }
.tf-stage.is-error .tt-progress-pct { color: var(--tt-red); font-weight: 600; }
.tf-stage.is-error .tt-bar i { background: var(--tt-red); }
.tf-stage.is-idle .tt-progress-pct { color: var(--tt-faint); }
.tf-tabs { align-self: flex-start; }
.tf-match { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--tt-line-2); color: var(--tt-muted); }
.tf-match.is-exact { background: #DFF0EC; color: #1F5C50; }
/* The output preview scrolls sideways: 15 columns do not fit a screen. */
.tf-prev { overflow-x: auto; }
.tf-prev table { min-width: 1500px; }
.tf-band th { text-align: center; background: #0F3A3A; color: #fff; border-left: 1px solid rgba(255,255,255,.2); }
.tf-band th:first-child { border-left: 0; }
.tf-cell { white-space: pre-line; vertical-align: top; font-size: 12.5px; }
/* Sidebar badge: outside .tt-pg, so no --tt-* variables here. */
.tf-new { margin-left: auto; padding: 1px 6px; border-radius: 4px; background: #0FB8A2; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .4px; }

@media (max-width: 1000px) {
  .bs-layout, .bs-mc { grid-template-columns: 1fr; }
  .bs-config { position: static; }
  .bs-stats { grid-template-columns: 1fr; }
}

/* ═══ History (.th-*) ═══════════════════════════════════════════════════════ */
.th-intro { margin: 0 0 4px; max-width: 760px; }
.th-filters { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.th-find { flex: 1 1 320px; max-width: 520px; }
.th-find-box { position: relative; display: block; }
.th-find-box input { width: 100%; padding-right: 34px; }
.th-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--tt-muted); cursor: pointer; padding: 4px 6px; }
.th-clear:hover { color: var(--tt-ink); }
.th-select { flex: 0 0 auto; }
.th-select .bs-input { height: 40px; min-width: 170px; }
.th-tbl { table-layout: fixed; width: 100%; min-width: 1120px; }
.th-tbl td { vertical-align: top; }
.th-c-when { width: 150px; }
.th-c-page { width: 175px; }
.th-c-by { width: 160px; }
.th-c-act { width: 360px; }
table.th-tbl td { white-space: normal; padding: 10px 12px; overflow-wrap: anywhere; }
table.th-tbl td.th-when, table.th-tbl td:last-child { white-space: nowrap; }
table.th-tbl td:nth-child(3), table.th-tbl td:nth-child(4) { padding-right: 20px; }
.th-when { white-space: nowrap; color: var(--tt-muted); }
.th-page { font-weight: 600; }
.th-mode { color: var(--tt-muted); }
.th-input { padding-right: 16px; }
.th-input .tt-kw { word-break: break-word; }
.th-input small { display: block; margin-top: 2px; }
.th-more, .th-you { color: var(--tt-muted); }
.th-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-start; }
.th-tbl th.th-actions-h { text-align: left; }
.th-tbl td:last-child { padding-left: 12px; }
.th-tbl .th-actions .tt-btn { height: 30px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; flex: 0 0 auto; }


/* ═══ Targeting Finder, History and saved runs: the Buckets look ═════════════
   The same hero, pills, cards, buttons and segmented controls as Channel Buckets
   (main.css), so these screens read as part of the app. Scoped to .tf-pg, so the
   keyword screens keep their flat Data Builder style. */
.tt-pg.tf-pg {
  --tt-bg: transparent; --tt-surface: #fff; --tt-ink: var(--text, #0F3A3A); --tt-muted: var(--muted, #4A5E5E);
  --tt-line: var(--border, rgba(15,58,58,.14)); --tt-line-2: rgba(15,58,58,.08); --tt-hover: var(--surface-soft, #F8FBFA);
  --tt-sel: var(--primary-soft, #E8F5F4);
  margin: 0; min-height: 0; padding: 0 0 36px; background: transparent; font-family: inherit;
}
.tf-pg .tt-body { padding: 0; gap: 20px; }
.tf-pg .tf-hero { margin-bottom: 24px; }

/* Cards */
.tf-pg .tt-card, .tf-pg .tt-tips, .tf-pg .tt-tablewrap, .tf-pg .tt-empty, .tf-pg .tt-progress, .tf-pg .tf-stages {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 2px 12px rgba(11,32,32,.05);
}
.tf-pg .tt-tablewrap { overflow-x: auto; overflow-y: hidden; }
.tf-pg .tf-card { padding: 24px; gap: 22px; }
.tf-pg .tf-card .tt-tablewrap, .tf-pg .tf-card .tf-stages { box-shadow: none; border-radius: 12px; }
.tf-pg .tt-empty { padding: 56px 24px; }
.tf-pg .tt-empty .bi { font-size: 30px; color: var(--primary); }
.tf-pg .tt-empty h3 { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.tf-pg .tt-empty--inline { box-shadow: none; border: 0; }

/* Quick tips */
.tf-pg .tt-tips-hd { padding: 14px 18px; font-size: .85rem; font-weight: 700; }
.tf-pg .tt-tips-hd > .bi:first-child { font-size: 1rem; }
.tf-pg .tt-tips ul { padding: 0 18px 16px 40px; font-size: .82rem; gap: 7px; }
.tf-pg .tt-tips li.is-important { border-radius: 10px; padding: 10px 12px; margin-left: -22px; }

/* Buttons */
.tf-pg .tt-btn {
  height: 38px; padding: 0 16px; gap: 7px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: #fff;
  font-family: inherit; font-size: .82rem; font-weight: 700; color: var(--muted-strong, #2E3E3E);
  transition: all .18s;
}
.tf-pg .tt-btn:hover:not(:disabled) { background: var(--surface-soft); border-color: var(--primary); color: var(--primary-deep); transform: translateY(-1px); }
.tf-pg .tt-btn .bi { font-size: .85rem; }
.tf-pg .tt-btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.tf-pg .tt-btn--primary:hover:not(:disabled) {
  background: var(--primary-deep); border-color: var(--primary-deep); color: #fff; box-shadow: 0 4px 14px rgba(15,184,162,.3);
}
.tf-pg .tt-btn:disabled { opacity: .5; transform: none; box-shadow: none; }
.tf-pg .tf-inputrow .tt-btn, .tf-pg .tf-runbar .tt-btn--primary { height: 42px; padding: 0 22px; }

/* Segmented controls: the Buckets status tabs */
.tf-pg .tt-seg { height: auto; padding: 3px; gap: 4px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; }
.tf-pg .tt-seg button { height: 32px; padding: 0 14px; border-radius: 7px; font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--muted); transition: all .15s; }
.tf-pg .tt-seg button:hover { background: rgba(15,58,58,.08); color: var(--text); }
.tf-pg .tt-seg button.is-on, .tf-pg .tt-seg button.is-on:hover { background: #0F3A3A; color: #fff; }
.tf-pg .tf-mode button { height: 38px; padding: 0 20px; font-size: .85rem; }

/* Inputs */
.tf-pg .tf-field { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); gap: 7px; }
.tf-pg .tf-field input, .tf-pg .bs-input, .tf-pg .th-find-box input {
  height: 42px; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: #fff;
  font-family: inherit; font-size: .9rem; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tf-pg .tf-field input::placeholder, .tf-pg .th-find-box input::placeholder { color: #9AA8A8; font-weight: 400; }
.tf-pg .tf-field input:focus, .tf-pg .bs-input:focus, .tf-pg .th-find-box input:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,184,162,.12);
}
.tf-pg .th-select .bs-input { min-width: 180px; }
.tf-pg .tt-chip { height: 38px; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 0 6px 0 12px; font-family: inherit; }
.tf-pg .tt-check { font-size: .82rem; font-weight: 500; color: var(--muted); }
.tf-pg .tt-check input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Upload zone */
.tf-pg .tf-drop {
  padding: 44px 24px; border: 2px dashed rgba(15,184,162,.45); border-radius: 16px; background: linear-gradient(180deg, #fff, var(--primary-soft));
  transition: all .18s;
}
.tf-pg .tf-drop:hover, .tf-pg .tf-drop.is-drag { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.tf-pg .tf-drop .bi { font-size: 2.2rem; color: var(--primary); }
.tf-pg .tf-drop p { font-size: 1rem; color: var(--text); }
.tf-pg .bs-file { padding: 12px 16px; border-radius: 12px; background: var(--primary-soft); border: 1px solid rgba(15,184,162,.25); }
.tf-pg .bs-file .bi { font-size: 1.1rem; }
.tf-pg .bs-meta { font-size: .8rem; color: var(--muted); }
.tf-pg .tf-h:not(:first-child) { margin-top: 24px; }
.tf-pg .tt-tablewrap + .bs-meta { margin-top: 12px; display: block; }
.tf-pg .tf-h { margin: 0 0 10px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tf-pg .tf-chip { padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgba(15,58,58,.06); }
.tf-pg .tf-chip.is-ok { background: var(--success-soft); color: #067a4a; }
.tf-pg .tf-runbar { padding-top: 20px; }

/* Progress: one card per section */
.tf-pg .tf-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px; background: var(--surface-soft); box-shadow: none; }
.tf-pg .tf-stages > :not(.tf-stage) { grid-column: 1 / -1; }
.tf-pg .tf-stage { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.tf-pg .tf-stage .tt-progress-top, .tf-pg .tf-stage .tt-bar { max-width: none; }
.tf-pg .tf-stage .tt-progress-msg { font-size: .85rem; font-weight: 700; color: var(--text); }
.tf-pg .tf-stage .tt-progress-pct { font-size: .8rem; font-weight: 800; color: var(--primary-deep); }
.tf-pg .tt-bar { height: 8px; border-radius: 999px; background: rgba(15,58,58,.08); }
.tf-pg .tt-bar i { background: linear-gradient(90deg, #0FB8A2, #22d3ee); border-radius: 999px; }
.tf-pg .tf-stage.is-done { border-color: rgba(15,169,104,.35); background: #fbfefc; }
.tf-pg .tf-stage.is-done .tt-progress-pct { color: var(--success); }
.tf-pg .tf-stage.is-done .tt-bar i { background: var(--success); }
.tf-pg .tf-stage.is-error { border-color: rgba(217,70,58,.35); }
.tf-pg .tf-stage.is-running .tt-bar i { background-size: 200% 100%; animation: tf-flow 1.6s linear infinite; }
@keyframes tf-flow { to { background-position: -200% 0; } }

/* Alerts */
.tf-pg .tt-err, .tf-pg .tt-warn { border-radius: 12px; padding: 12px 16px; font-size: .82rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tf-pg .tt-warn { background: var(--warning-soft); border-color: #F0DCB4; }

/* Tables */
.tf-pg table.tt-tbl th {
  padding: 12px 16px; background: var(--surface-soft); font-size: .68rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border);
}
.tf-pg table.tt-tbl td { padding: 0 16px; height: 48px; font-size: .84rem; color: var(--text); }
.tf-pg table.tt-tbl tbody tr { transition: background .12s; }
.tf-pg table.tt-tbl tbody tr:hover { background: var(--primary-soft); }
.tf-pg td.tt-kw { font-weight: 700; }
.tf-pg td.tt-mono { font-size: .78rem; color: var(--muted); }
.tf-pg .tf-match { padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: capitalize; background: rgba(15,58,58,.07); }
.tf-pg .tf-match.is-exact { background: var(--success-soft); color: #067a4a; }
.tf-pg .tf-band th { background: #0F3A3A; color: #fff; letter-spacing: .05em; }
.tf-pg .tf-prev { border-radius: 12px; }

/* Status pills in Your runs */
.tf-st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: rgba(15,58,58,.07); color: var(--muted, #4A5E5E); }
.tf-st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tf-st.is-running, .tf-st.is-queued { background: var(--primary-soft, #E8F5F4); color: var(--primary-deep, #088E89); }
.tf-st.is-running::before { animation: tt-pulse 1.1s ease-in-out infinite; }
.tf-st.is-done { background: var(--success-soft, #E8F7EF); color: #067a4a; }
.tf-st.is-incomplete, .tf-st.is-interrupted { background: var(--warning-soft, #FFF6E8); color: #8A6520; }
@keyframes tt-pulse { 50% { opacity: .3; } }

/* History */
.tf-pg .th-intro { display: none; }
.tf-pg .th-filters { gap: 16px; padding-bottom: 4px; }
.tf-pg .th-page, .tf-pg .th-when { font-size: .84rem; }
.tf-pg .th-mode { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--info-soft, #EEF4FF); color: #1F5FBF; }
.tf-pg .th-you { color: var(--primary-deep); font-weight: 700; }
.tf-pg table.th-tbl td { padding: 14px 16px; }
.tf-pg .th-tbl .th-actions .tt-btn { height: 32px; padding: 0 12px; font-size: .76rem; }
.tf-pg .th-input small { font-size: .74rem; }

@media (max-width: 900px) {
  .tf-pg .tf-stages { grid-template-columns: 1fr; }
  .tf-pg .tf-card { padding: 16px; }
}
.tf-pg .tt-row > .tf-stack { flex: 1 1 320px; }
.tf-pg .tt-row > .tf-stack + .tt-hint { display: none; }
.tf-pg .tt-hint { min-width: 0; }
.tf-pg .tf-stages > .tt-btn { justify-self: start; }
.tf-pg .tf-stages > p { margin: 0; }

/* Button colours: solid teal for the main action, soft teal for opening, red for stopping. */
.tt-pg .tt-btn--soft { background: var(--primary-soft); border-color: rgba(15,184,162,.45); color: var(--primary-deep); }
.tt-pg .tt-btn--soft:hover:not(:disabled) { background: #D4EEEA; border-color: var(--primary); color: #066E6A; }
.tt-pg .tt-btn--outline { background: #fff; border-color: rgba(15,184,162,.55); color: var(--primary-deep); }
.tt-pg .tt-btn--outline:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); color: #066E6A; }
.tt-pg .tt-btn--danger { background: #FFF1F0; border-color: rgba(217,70,58,.4); color: #C0382D; }
.tt-pg .tt-btn--danger:hover:not(:disabled) { background: #FDE2DF; border-color: #D9463A; color: #A82D23; box-shadow: 0 4px 14px rgba(217,70,58,.18); }
.tf-pg .tt-warn .tt-btn--primary { margin-left: auto; }

.tt-pg .tt-btn--outline .bi { color: var(--tt-teal); }
