/* Split Test Lab — uses the tokens from style.css (--surface, --border, …) so it
   inherits the app's look rather than defining a second palette. */

.split-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.split-head h2 { font-size: 22px; font-weight: 700; }
.split-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.split-empty { color: var(--text-muted); padding: 32px 0; text-align: center; }
.split-error { color: var(--danger); padding: 24px 0; }
.split-hint { color: var(--text-muted); font-size: 12px; margin: 4px 0 10px; }
.split-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Importing an existing campaign ───────────────────────────────────────── */

.split-imp-window {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.split-imp-window label { font-size: 13px; font-weight: 600; margin-right: 4px; }
.split-imp-window .split-hint { margin: 0; flex-basis: 100%; }

.split-imp-list { display: flex; flex-direction: column; gap: 10px; }

/* An already-imported campaign stays visible — knowing it is there and why it can't be
   picked again is more useful than hiding it. */
.split-card-disabled { opacity: 0.55; cursor: not-allowed; }
.split-card-disabled:hover { border-color: var(--border); }

.split-imp-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
}
.split-imp-group:hover { border-color: var(--accent, #4f8cff); }
.split-imp-group input { margin-top: 3px; }
.split-imp-group .split-hint { margin: 2px 0 0; }

.split-imp-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Same reason as .split-conv-row code — a background without a colour inherits the page's
   text colour and can land light-on-light. */
.split-table code,
.split-meta-line code {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text, #e6e9ef);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

/* Reference images on an existing test. Every generated image is composed from these, and
   an imported test starts with none. */
.split-refs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.split-ref-kind {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #12161d);
  color: var(--text, #e6e9ef);
  font-size: 13px;
  max-width: 300px;
}
.split-ref-thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  display: block;
}

/* Always on screen, never self-hiding: this panel is the only route to adding or removing
   references on an existing test, so it must remain reachable once satisfied. */
.split-refs-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface, #12161d);
}
.split-refs-panel > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: revert;
}
.split-refs-panel > summary::-webkit-details-marker { display: revert; }

.split-ref-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.split-ref-item { position: relative; width: 72px; }
.split-ref-tag {
  display: block;
  font-size: 10px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.split-ref-x {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface, #12161d);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.split-ref-x:hover { color: var(--danger, #f87171); border-color: var(--danger, #f87171); }

.split-brief-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.split-warn-inline { color: var(--danger, #f87171); font-size: 13px; margin: 6px 0 10px; }

/* ─── Disconnect from Meta ─────────────────────────────────────────────────── */

/* Tinted rather than a full .btn-danger: it sits in a row of six neutral secondary
   actions, and a solid red button there reads as the primary thing to do. The
   unmistakable red is saved for the confirm button inside the dialog, where it IS the
   primary action. */
.split-btn-danger { color: var(--danger, #f87171); border-color: rgba(239, 68, 68, 0.4); }
.split-btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.1); }

.split-disc-list { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.split-disc-list li { margin-bottom: 6px; }

.split-disc-ack {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.split-disc-ack input { margin-top: 2px; flex-shrink: 0; }

/* ─── Acting on a "who converts" finding ───────────────────────────────────── */

.split-apply-h { margin: 20px 0 8px; font-size: 14px; }

/* Deliberately not a compact radio list. Each option carries a cost the user has to weigh —
   which half of an age range to keep is not a preference, it is a trade with numbers on
   both sides — so the options are given room rather than squeezed into one line each. */
.split-plan {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
}
.split-plan:hover { border-color: var(--text-muted); }
.split-plan-on { border-color: var(--accent, #6366f1); background: rgba(99, 102, 241, 0.06); }
.split-plan input { margin-top: 3px; flex-shrink: 0; }
.split-plan-change { color: var(--text-muted); margin-top: 3px; }
.split-plan-exact { color: #34d399; margin-top: 5px; }
/* The collateral is the whole reason this screen exists — it gets the warning colour even
   though nothing has gone wrong, because it is what the decision turns on. */
.split-plan-cost { color: var(--danger, #f87171); margin-top: 5px; }
.split-plan-cost .split-hint { margin: 3px 0 0; }

/* ─── "What is being watched" ──────────────────────────────────────────────── */

.split-watch {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
}
.split-watch-line { display: flex; align-items: baseline; gap: 8px; line-height: 1.5; }
.split-watch-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* A live indicator that does not blink: this panel is read while deciding whether to trust
   the tool, and motion there reads as urgency rather than as reassurance. */
.split-watch-on { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.split-watch-idle { background: var(--text-muted); }

.split-watch-more { margin-top: 10px; }
.split-watch-more summary { cursor: pointer; color: var(--text-muted); font-size: 12px; }
.split-watch-more ul { margin: 10px 0 0; padding-left: 20px; line-height: 1.6; }
.split-watch-more li { margin-bottom: 8px; }

.split-event-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
/* The kind matters as much as the wording: "an ad was paused" and "your Canadian spend is
   dead" need acting on very differently, and the titles alone do not separate them. */
.split-event-kind {
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

/* The written visual direction used when there is no reference image to match. Editable
   because it is inferred from ad copy, which cannot know a brand's colours or typeface. */
.split-brief-box {
  display: block;
  width: 100%;
  margin: 10px 0 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #12161d);
  color: var(--text, #e6e9ef);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

/* Marks anything this tool did not create and must not write to. */
.split-pill-imported {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2, #eef2f7);
  color: var(--text-muted);
  border: 1px solid var(--border);
  vertical-align: middle;
  margin-left: 6px;
}

/* One candidate conversion event, with what Meta reported for it. */
.split-conv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
/* Both colours are set explicitly. Setting only the background inherited the page's light
   text onto a light surface, which rendered white on white in the dark theme. */
.split-conv-row code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.16);
  color: var(--text, #e6e9ef);
  border: 1px solid var(--border);
  word-break: break-all;
}
.split-conv-row .split-hint { margin: 0; flex: 1 1 200px; }

/* ─── Banners ──────────────────────────────────────────────────────────────── */

.split-banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid;
}
.split-banner a { color: inherit; text-decoration: underline; }
.split-banner-warn  { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.35); color: #fbbf24; }
.split-banner-error { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.35);  color: #f87171; }
.split-banner-ok    { background: rgba(16,185,129,0.07); border-color: rgba(16,185,129,0.3);  color: var(--text-muted); line-height: 1.55; }
.split-banner-ok strong { color: #34d399; }
.split-banner-note { display: block; margin-top: 4px; color: var(--text-dim); font-size: 12px; }

/* ─── Test list ────────────────────────────────────────────────────────────── */

.split-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.split-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.split-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.split-card-head h3 { font-size: 15px; font-weight: 600; }
.split-card-meta { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

.split-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-muted);
  white-space: nowrap;
}
.split-status-live     { background: rgba(16,185,129,0.15); color: #34d399; }
.split-status-ready    { background: rgba(61,99,221,0.18);  color: #7f9cf5; }
.split-status-paused   { background: rgba(245,158,11,0.15); color: #fbbf24; }
.split-status-complete { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* ─── Setup form ───────────────────────────────────────────────────────────── */

.split-form { max-width: 780px; }
.split-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  background: var(--surface);
}
.split-fieldset legend {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.split-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}
.split-form input,
.split-form select,
.split-form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
}
.split-form input:focus,
.split-form select:focus,
.split-form textarea:focus { outline: none; border-color: var(--border-focus); }
.split-form textarea { resize: vertical; }

/* The blanket `display: block` above outranks the `hidden` attribute, which would
   otherwise leave the dropzones' file inputs rendered as raw "Choose Files" widgets. */
.split-form [hidden] { display: none; }

.split-row { display: flex; gap: 12px; flex-wrap: wrap; }
.split-row > label { flex: 1 1 160px; }

.split-estimate {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}
.split-estimate strong { color: var(--text); }

/* ─── Detail ───────────────────────────────────────────────────────────────── */

.split-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.split-btn-sm { padding: 6px 12px; font-size: 12px; }
.split-progress { color: var(--text-muted); font-size: 13px; min-height: 20px; margin-bottom: 12px; }

/* Determinate progress for long Meta operations. Without it a push or a launch is
   indistinguishable from a hung page — the request just sits there producing nothing. */
.split-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.2);
  overflow: hidden;
  margin-bottom: 6px;
}
.split-bar-fill {
  height: 100%;
  background: var(--accent, #4f8cff);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.split-bar-label { color: var(--text-muted); font-size: 12px; }

.split-angles { display: flex; flex-direction: column; gap: 14px; }
.split-angle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.split-angle-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.split-angle-head h4 { font-size: 15px; font-weight: 600; }
.split-premise { color: var(--text-muted); font-size: 12px; margin-top: 3px; max-width: 60ch; }

/* Stage tracker: creative → hook → body → CTA */
.split-stages { display: flex; gap: 6px; flex-wrap: wrap; }
.split-stage {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-dim);
  white-space: nowrap;
}
.split-stage.current { background: var(--accent-dim); color: #a5b8f7; }
.split-stage.done    { background: rgba(16,185,129,0.15); color: #34d399; }

/* Variant image grid */
.split-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.split-tile {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.split-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.split-tile-pending,
.split-tile-fail {
  font-size: 10px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.split-tile-fail { color: var(--danger); }

/* Push / rejection state on a variant tile */
.split-tile { position: relative; }
.split-tile-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.5;
}
.split-tile-badge.pushed   { background: rgba(16,185,129,0.85); color: #04211a; }
.split-tile-badge.rejected { background: rgba(239,68,68,0.9);  color: #fff; }

/* ─── Meta panel ───────────────────────────────────────────────────────────── */

.split-meta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.split-meta-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.split-meta-head h3 { font-size: 14px; font-weight: 600; }
.split-meta-line { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.split-meta-line code { font-size: 11px; color: var(--text); }
.split-meta-line strong { color: var(--text); }
.split-rejected { color: var(--danger); font-weight: 600; }
.split-meta-warn {
  font-size: 12px;
  color: #fbbf24;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
}
.split-meta-panel .split-actions { margin: 12px 0 0; }

.split-dryrun { margin-top: 12px; font-size: 12px; }
.split-dryrun summary { cursor: pointer; color: var(--text-muted); padding: 6px 0; }
.split-dryrun pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;          /* wide JSON scrolls inside its own box, never the page */
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
}

.split-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.split-preview iframe { border: 0; max-width: 100%; margin-top: 12px; display: block; }

/* ─── Performance leaderboard ──────────────────────────────────────────────── */

.split-perf { margin: 12px 0; }
.split-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  display: block;
  overflow-x: auto;        /* wide tables scroll inside their own box, not the page */
  white-space: nowrap;
}
.split-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--border);
}
.split-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.split-table tbody tr:last-child td { border-bottom: 0; }
.split-row-dead td { color: var(--text-dim); text-decoration: line-through; }
.split-row-dead .split-row-note { text-decoration: none; }
.split-row-note { display: block; font-size: 10px; color: var(--danger); text-transform: uppercase; letter-spacing: 0.04em; }
.split-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.split-pick input { width: auto; margin: 0; }

/* The verdict box. "No measurable difference" must not look like a win — the colour
   coding is doing real work here. */
.split-verdict {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 12px;
  font-size: 13px;
  background: var(--bg);
}
.split-verdict p { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.split-verdict-clear  { border-left-color: var(--success); }
.split-verdict-winner { border-left-color: var(--success); }
.split-verdict-weak   { border-left-color: #f59e0b; }
.split-verdict-none   { border-left-color: var(--text-dim); }

.split-pbest { list-style: none; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.split-pbest li { padding: 2px 0; }
.split-ci { color: var(--text-dim); }

.split-promote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.split-promote-hint { font-size: 11px; color: var(--text-dim); }

/* ─── Early indicators ─────────────────────────────────────────────────────── */

.split-sig {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.split-sig > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }
.split-sig-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 18px 0 8px;
}
.split-banner-info {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
}

.split-vbadge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.split-vbadge-promising   { background: rgba(16,185,129,0.16); color: #34d399; }
.split-vbadge-no-signal   { background: var(--surface2);       color: var(--text-dim); }
.split-vbadge-insufficient{ background: rgba(245,158,11,0.14); color: #fbbf24; }
.split-vbadge-bad         { background: rgba(239,68,68,0.16);  color: #f87171; }

.split-ind-good td { color: var(--text); }

/* Live read on a running round */
.split-earlyread { margin-bottom: 12px; }
.split-earlyread h5 { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.split-read {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
}
.split-read strong { color: var(--text); }
.split-read-early-leader  { border-left-color: var(--success); }
.split-read-early-laggard { border-left-color: var(--danger); }

.split-copy { font-size: 12px; color: var(--text-muted); }
.split-copy summary { cursor: pointer; padding: 6px 0; }
.split-copy-hook { color: var(--text); font-weight: 600; margin-top: 6px; }
.split-copy-body { white-space: pre-wrap; margin-top: 6px; }
.split-copy-meta { margin-top: 8px; color: var(--text-dim); }

/* ─── Recommendation inbox ─────────────────────────────────────────────────── */

.split-events { margin-bottom: 18px; }
.split-events h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.split-event {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.split-event p { color: var(--text-muted); font-size: 12px; margin: 4px 0 8px; }
.split-event-info   { border-left-color: var(--text-dim); }
.split-event-warn   { border-left-color: #f59e0b; }
.split-event-action { border-left-color: var(--danger); }

/* ─── Country picker ───────────────────────────────────────────────────────── */

.split-countries { margin-bottom: 14px; }
.split-countries-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.split-countries-label { font-size: 12px; color: var(--text-muted); }
.split-countries-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.split-chip-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
}
.split-chip-btn:hover { border-color: var(--accent); color: var(--text); }

.split-country-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 26px; }
.split-country-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border-focus);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 6px 3px 10px;
  font-size: 12px;
}
.split-country-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
}
.split-country-chip button:hover { color: var(--text); }
.split-country-code { color: var(--text-dim); font-size: 10px; letter-spacing: 0.06em; }

#splitCountrySearch { width: 100%; }
.split-country-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px;
  max-height: 190px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.split-country-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.split-country-opt:hover { background: var(--surface2); color: var(--text); }
.split-country-opt.on { color: var(--text); }
.split-country-tick { width: 12px; color: var(--success); font-size: 11px; }

/* ─── Ad reviewer (lightbox) ───────────────────────────────────────────────── */

.split-tile-note { font-size: 9px; margin-left: 4px; }

.split-lb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6,8,14,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.split-lb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.split-lb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.split-lb-head h3 { font-size: 15px; font-weight: 600; }
.split-lb-head p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.split-lb-pushed { color: var(--success); }
.split-lb-x {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.split-lb-x:hover { color: var(--text); }

.split-lb-body { display: flex; gap: 0; overflow: hidden; }
.split-lb-imgwrap {
  position: relative;
  flex: 1 1 58%;
  min-width: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.split-lb-imgwrap img { max-width: 100%; max-height: 72vh; border-radius: 8px; display: block; }
.split-lb-blank {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 60px 20px;
}
.split-lb-blank small { color: var(--text-dim); }
.split-lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,17,23,0.75);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.split-lb-arrow:hover { border-color: var(--accent); }
.split-lb-arrow.left  { left: 10px; }
.split-lb-arrow.right { right: 10px; }

.split-lb-side {
  flex: 1 1 42%;
  min-width: 300px;
  padding: 16px 18px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}
.split-lb-sec { margin-bottom: 18px; }
.split-lb-sec h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.split-lb-side textarea,
.split-lb-side input[type=text],
.split-lb-side select { width: 100%; margin-bottom: 8px; }
.split-lb-fields { margin-top: 12px; font-size: 12px; }
.split-lb-fields summary { cursor: pointer; color: var(--text-muted); padding: 6px 0; }
.split-lb-fields label { display: block; font-size: 11px; color: var(--text-muted); margin-top: 8px; }
/* "What happens next" strip */
.split-next {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.split-next strong { color: var(--text); }
.split-next-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  flex-shrink: 0;
}

/* Working overlay on an image being edited */
.split-lb-working {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: rgba(15,17,23,0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Settings dialog */
.split-settings { width: min(760px, 100%); }
.split-settings-body { padding: 18px; overflow-y: auto; }
.split-settings-body > label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.split-settings-body input[type=text],
.split-settings-body input[type=url],
.split-settings-body input[type=number],
.split-settings-body select { width: 100%; }
.split-check { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.split-check input { width: auto; }
.split-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Model bake-off */
.split-bakeoff { width: min(1200px, 100%); }
.split-bakeoff-body { padding: 18px; overflow-y: auto; }
.split-bakeoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.split-bakeoff-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.split-bakeoff-card.cheapest { border-color: rgba(16,185,129,0.45); }
.split-bakeoff-img {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 10px;
}
.split-bakeoff-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.split-bakeoff-card h4 { font-size: 13px; font-weight: 600; }
.split-bakeoff-cost { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.split-bakeoff-cost strong { color: var(--text); font-variant-numeric: tabular-nums; }
.split-bakeoff-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }
.split-bakeoff-scale { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.split-bakeoff-scale strong { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Policy screen */
.split-tile-badge.policy {
  right: auto;
  left: 3px;
  background: rgba(245,158,11,0.9);
  color: #2b1a02;
}
.split-tile-badge.policy.block { background: rgba(239,68,68,0.92); color: #fff; }

.split-policy {
  border: 1px solid;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
}
.split-policy.warn  { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.35); }
.split-policy.block { background: rgba(239,68,68,0.07);  border-color: rgba(239,68,68,0.35); }
.split-policy.ok    { background: rgba(16,185,129,0.06); border-color: rgba(16,185,129,0.28); }
.split-policy.ok h4 { color: #34d399; margin-bottom: 4px; }
.split-policy.ok p  { color: var(--text-muted); }
.split-policy h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.split-policy.warn h4  { color: #fbbf24; }
.split-policy.block h4 { color: #f87171; }
.split-policy-item + .split-policy-item { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.split-policy-where {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-right: 6px;
}
.split-policy-match { color: var(--text); font-style: italic; }
.split-policy-item p { color: var(--text-muted); margin-top: 4px; line-height: 1.45; }

.split-lb-status { font-size: 12px; min-height: 18px; margin-top: 6px; }
.split-lb-status-ok    { color: var(--success); }
.split-lb-status-error { color: var(--danger); }
.split-lb-status-info  { color: var(--text-muted); }

@media (max-width: 900px) {
  .split-lb-body { flex-direction: column; overflow-y: auto; }
  .split-lb-side { border-left: none; border-top: 1px solid var(--border); min-width: 0; }
  .split-lb-imgwrap img { max-height: 46vh; }
}

@media (max-width: 640px) {
  .split-row > label { flex-basis: 100%; }
  .split-head { flex-direction: column; }
  .split-lb-backdrop { padding: 0; }
  .split-lb { max-height: 100vh; border-radius: 0; }
}

/* ─── Challenger vs original ───────────────────────────────────────────────── */

.split-h2h {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
/* Colour only once the verdict is real. A "too early" or "level" comparison stays neutral,
   because tinting it green or red is a conclusion the numbers have not reached. */
.split-h2h-win { border-left-color: #34d399; }
.split-h2h-lose { border-left-color: var(--danger, #f87171); }

.split-h2h-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.split-h2h-head h3 { margin: 0; font-size: 14px; }
.split-h2h-verdict { font-size: 13px; line-height: 1.6; margin: 8px 0 12px; }
.split-h2h-chal td { font-weight: 600; }

/* An objective whose ad set carries no pixel. Not an error — a consequence worth reading
   before the push rather than wondering about afterwards. */
.split-hint-strong { color: var(--text, #e6e9ef); border-left: 2px solid var(--danger, #f87171); padding-left: 10px; }
