/* Run on TikTok (views/campaign/tiktok-run*.js), the campaign's TikTok tab. Every rule
   is .rt-*; buttons and inputs are the app's .btn, .link-btn and .input.
   Drawn on Deploy Previews only, with sample data, as in the mockup's four Run on TikTok
   boards (docs/prd-tiktok-partner-ops.md §7.2). */

.rt { padding-top: 4px; display: flex; flex-direction: column; gap: 16px; }
.rt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-head h3 { margin: 0; font-size: 15px; }
.rt-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--muted); }
.rt-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rt-pill.is-ready { color: var(--accent); }
.rt-pill.is-upcoming, .rt-pill.is-ongoing { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.rt-tag { display: inline-block; padding: 0 6px; border: 1px dashed var(--warn); border-radius: 4px; color: var(--warn); font-size: 10px; font-weight: 600;
  letter-spacing: .02em; line-height: 1.6; vertical-align: middle; white-space: nowrap; text-transform: none; }
.rt-banner { padding: 8px 12px; font-size: 12px; color: var(--muted); border: 1px dashed var(--warn); border-radius: 8px; }
.rt-banner strong { color: var(--text); }
.rt-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The four steps: green along the top once done, blue for the one on screen. */
.rt-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rt-steps li { display: flex; }
.rt-step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-top: 3px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.rt-step:not(:disabled):hover { background: color-mix(in srgb, var(--text) 4%, var(--surface)); }
.rt-step:disabled { cursor: default; opacity: .6; }
.rt-step.is-done { border-top-color: var(--good); }
.rt-step.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rt-step-mark { flex: none; width: 26px; height: 26px; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.rt-step.is-done .rt-step-mark { border-color: var(--good); color: var(--good); }
.rt-step.is-on .rt-step-mark { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.rt-step-t { display: flex; flex-direction: column; min-width: 0; }
.rt-step-t b { font-weight: 600; }
.rt-step-t small { font-size: 12px; color: var(--muted); }
.rt-step.is-on .rt-step-t small { color: var(--accent); }

/* One step: a title, one decision, one main button. */
.rt-card { position: relative; display: flex; flex-direction: column; gap: 22px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; }
.rt-title { display: flex; flex-direction: column; gap: 5px; }
.rt-title h4 { margin: 0; font-size: 18px; font-weight: 650; text-transform: none; letter-spacing: 0; color: var(--text); }
.rt-title h4 .rt-tag { margin-left: 8px; }
.rt-sub { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rt-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--good); }
.rt-hint { font-size: 12px; color: var(--muted); }
.rt-warn { display: block; margin-top: 4px; font-size: 12px; color: var(--warn); }
.rt-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rt-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rt-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-acts .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.rt-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--border); }

/* 1 · Create */
.rt-choose { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rt-field { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); font-size: 13px; color: var(--muted); }
.rt-field .input { height: 42px; box-sizing: border-box; font-size: 15px; color-scheme: dark; }
.rt-pct { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rt-num { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.rt-num-b { width: 40px; height: 40px; border: 0; background: none; color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rt-num-b:disabled { color: var(--border); cursor: default; }
.rt-num-v { min-width: 52px; text-align: center; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.rt-from { display: flex; flex-direction: column; gap: 10px; }
.rt-from-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rt-from-head .link-btn { margin: 0; padding: 6px 0; font-size: 13px; }
.rt-facts { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px 16px; font-size: 14px; }
.rt-facts dt { color: var(--muted); }
.rt-facts dd { margin: 0; min-width: 0; }
.rt-facts .rt-hint { display: block; margin-top: 2px; }
.rt-clip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-shop { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.rt-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.rt-checks { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rt-checks li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--good) 45%, transparent);
  border-radius: 999px; font-size: 12px; color: var(--good); }

/* 2 · Publish */
.rt-sees { display: flex; flex-direction: column; gap: 10px; }
.rt-preview { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.rt-preview-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rt-preview-t small { font-size: 12px; color: var(--muted); }
.rt-preview-t b { font-size: 18px; font-weight: 650; }
.rt-preview-t .rt-clip { font-size: 13px; color: var(--muted); }
.rt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rt-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rt-tile > span:last-child { display: flex; flex-direction: column; }
.rt-tile b { font-size: 15px; font-weight: 650; }
.rt-tile small { font-size: 12px; color: var(--muted); }
.rt-tile-i { flex: none; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rt-veil { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); }
.rt-dialog { width: 100%; max-width: 400px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; padding: 22px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); box-shadow: 0 16px 48px rgba(0, 0, 0, .45); }
.rt-dialog h4 { margin: 0; font-size: 17px; font-weight: 650; }
.rt-dialog .rt-acts { justify-content: flex-end; }

/* 3 · The brand adds products */
.rt-window { display: flex; flex-direction: column; gap: 8px; }
.rt-window-l { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; color: var(--muted); }
.rt-window-l b { font-size: 14px; color: var(--text); text-align: center; }
.rt-track { height: 8px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); overflow: hidden; }
.rt-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.rt-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.rt-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.rt-table th, .rt-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; }
.rt-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.rt-table tbody tr:last-child > * { border-bottom: 0; }
.rt-table .rt-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-table .rt-big { font-size: 15px; font-weight: 650; }
.rt-table .is-new { color: var(--accent); font-weight: 600; }
.rt-prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rt-prod > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.rt-prod small { font-size: 12px; color: var(--muted); }
.rt-thumb { flex: none; width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--border); color: var(--muted); }
.rt-thumb .rt-i { width: 20px; height: 20px; stroke-width: 1.3; }

/* 4 · Approve and link: the brand's total split between the creator and CREA. */
.rt-links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
/* A fixed column for the buttons, so every row's split bar lines up with the next. */
.rt-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 330px; align-items: center; gap: 14px 28px; padding: 16px 0;
  border-top: 1px solid var(--border); }
.rt-mid { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rt-link > .rt-acts { justify-content: flex-end; min-height: 40px; }
.rt-split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--bg); }
.rt-split i { display: block; }
.rt-split i:first-child { flex: none; background: var(--accent); }
.rt-split i:last-child { flex: 1; background: color-mix(in srgb, var(--accent) 40%, #ffffff); }
.rt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.rt-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rt-legend b { color: var(--text); font-weight: 650; }
.rt-legend .rt-warn { display: inline; margin: 0; }
.rt-key { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.rt-key.is-crea { background: color-mix(in srgb, var(--accent) 40%, #ffffff); }
.rt-why { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); }
.rt-reason { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; cursor: pointer; }
.rt-reason:hover { border-color: var(--muted); }
.rt-why .link-btn { margin-left: auto; font-size: 13px; }
.rt-note { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.rt-note .btn { margin-left: auto; }

/* The tab once it runs (tiktok-running.js): the numbers, then every product. */
.rt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.rt-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.rt-stat-k { font-size: 12px; color: var(--muted); }
.rt-stat-v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.rt-stat-s { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rt-stat-s .rt-i { width: 14px; height: 14px; }
.rt-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.rt-seg-b { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rt-seg-b span { font-weight: 500; }
.rt-seg-b.is-on { background: var(--border); color: var(--text); }
.rt-ptable { min-width: 940px; }
.rt-ptable td { padding-top: 14px; padding-bottom: 14px; vertical-align: middle; }
.rt-ptable tr.is-waiting > td { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.rt-ptable .rt-acts { justify-content: flex-end; flex-wrap: nowrap; }
.rt-ptable .rt-acts .btn { min-height: 34px; }
.rt-splitcell { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.rt-splitcell .rt-hint b { color: var(--text); font-weight: 650; }
.rt-split.is-thin { height: 8px; border-radius: 4px; }
.rt-sold { display: flex; flex-direction: column; align-items: flex-end; }
.rt-sold b { font-weight: 650; font-variant-numeric: tabular-nums; }
.rt-sold small { font-size: 12px; color: var(--muted); }
.rt-match { height: 36px; border-color: var(--warn); }
.rt-whycell { padding-top: 0; }
.rt-empty { padding: 28px 16px; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .rt-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-card { padding: 16px; }
  .rt-facts { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .rt-facts dd { margin-bottom: 10px; }
  .rt-link { grid-template-columns: minmax(0, 1fr); }
  .rt-mid:empty { display: none; }
  .rt-link > .rt-acts { justify-content: flex-start; }
}
/* Part 1: a check Create still waits on (tiktok-run-live.js) */
.rt-checks li.is-no { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
