/* dashboard-tests.css: page rules for Trial Reels, Ad Tests and the hook set page (.tr- shared, .at- ad tests, .set- sets).
   Layout only, on the shared classes in dashboard.css. Colours are themes.css tokens and the core's --d-* mixes; square
   corners. Calm round, 2026-11-26 (u-polish B3): sections sit straight on the page with no panel around them; the only
   fills are the version cards; 1px rules only between rows; compare tables and the retention chart use the full width;
   the accent fills only the primary button and focus rings, and states are words with a small marker. */

/* ---------- shared bits ---------- */
.tr-intro,.tr-readonly{max-width:72ch;margin:0 0 var(--d-section)}
.tr-strong{font-weight:400;color:var(--text)}
.tr-sub{display:block;margin:2px 0 0;font-size:12px;line-height:1.4;color:var(--muted)}
.tr-nums{font-variant-numeric:tabular-nums}
.tr-grow{flex:1 1 auto;min-width:0}
.tr-tag{flex:none}
.tr-head-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.tr-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:16px 0 0}
.tr-actions + .note{margin-top:16px}
.tr-row-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px 16px;margin-left:auto}
.tr-row-actions .tr-sub{margin:0}
.tr-link{display:inline-flex;align-items:center;gap:4px;min-height:28px;color:var(--muted);font-size:13px;text-decoration:none}
.tr-link:hover{color:var(--text);text-decoration:underline}
.tr-name{color:var(--text);text-decoration:none}
.tr-name:hover{text-decoration:underline}
.tr-good,.tr-bad{display:flex;align-items:flex-start;gap:6px;margin:8px 0 0;font-size:13px;line-height:1.4;color:var(--text)}
.tr-good .icon,.tr-bad .icon{margin-top:2px}
.tr-good .icon{color:var(--muted)}
/* a notice is a line on the page: the mark, the words, at most one way to fix it */
.tr-banner{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;max-width:100%;margin:0 0 var(--d-section)}
.tr-banner > .icon{color:var(--text)}
.tr-banner > p,.tr-banner > ul{flex:0 1 auto;max-width:72ch;margin:0}
.tr-banner > ul{padding-left:18px}
.tr-more{display:flex;justify-content:center;padding:16px 0 0}
.tr-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:calc(var(--d-gap) * -0.5) 0 var(--d-section)}
.tr-meta-line{margin:0;font-size:13px;color:var(--muted)}
.tr-winner-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 8px}
.tr-winner-line .tr-sub{margin:0}
.tr-problems{margin:0 0 var(--d-section);padding:12px 16px;box-shadow:inset 2px 0 0 var(--text)}
.tr-problems:focus-visible{outline-offset:2px}
.tr-problems > .tr-bad{margin-top:0}
.tr-problem-list{margin:6px 0 0;padding-left:18px}
.tr-choices{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px}
.tr-foot{margin:0}
.tr-fine{display:grid;gap:4px;margin-top:16px}
.tr-fine .note{margin:0}
/* a closed line that opens: how a winner is picked, the steps a finished ad test took */
.tr-how{margin:0 0 var(--d-section)}
.tr-fine .tr-how{margin:0}
.tr-how > summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;width:fit-content;max-width:100%;min-height:var(--d-row);color:var(--muted);font-size:13px;cursor:pointer;list-style:none}
.tr-how > summary::-webkit-details-marker{display:none}
.tr-how > summary:hover,.tr-how[open] > summary{color:var(--text)}
.tr-how > summary:focus-visible{outline-offset:2px}
.tr-how > summary .icon{flex:none;color:var(--muted)}
.tr-how[open] > summary .icon{transform:rotate(90deg)}
.tr-how-label{color:inherit}
.tr-how-note{color:var(--muted)}
.tr-how-body{display:grid;gap:4px;padding:4px 0 8px 24px}
.tr-how-body .note{margin:0}
.tr-rule-more,.tr-eligible{min-width:0}
/* the finished steps read as a section heading that opens */
.at-steps-done > summary{font-family:var(--display);font-weight:var(--display-weight);font-size:13px;line-height:1.2;letter-spacing:.12em;text-transform:uppercase;color:var(--text)}
.at-steps-done .tr-how-note{font:400 13px/1.3 var(--d-body);letter-spacing:0;text-transform:none}
.at-steps-done .tr-how-body{gap:0;padding:8px 0 0}
/* a quiet text button, for the one control a row keeps once its choice is made */
.tr-quiet{display:inline-flex;align-items:center;min-height:28px;padding:0;border:0;background:none;color:var(--muted);font:400 13px/1.3 var(--d-body);text-align:left;text-decoration:underline;text-decoration-color:var(--line-strong);text-underline-offset:3px;cursor:pointer}
.tr-quiet:hover{color:var(--text);text-decoration-color:currentColor}
.tr-quiet:focus-visible{outline-offset:2px}
.tr-change{white-space:nowrap}
/* the header's quiet More menu, the post page's pattern */
.tr-menu-wrap{position:relative}
.btn.ghost.tr-menu-btn{border-color:transparent;color:var(--muted)}
.btn.ghost.tr-menu-btn:not(:disabled):not([aria-disabled="true"]):hover,.btn.ghost.tr-menu-btn[aria-expanded="true"]{border-color:var(--d-edge);color:var(--text)}
.tr-menu-btn[aria-expanded="true"] .icon{transform:rotate(180deg)}
.tr-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:15;min-width:200px;padding:4px 0;background:var(--panel-deep);border:1px solid var(--d-edge);box-shadow:6px 6px 0 0 var(--shadow-ink)}
.tr-menu a,.tr-menu button{display:flex;align-items:center;width:100%;min-height:40px;padding:0 14px;border:0;background:none;color:var(--text);font:400 13px/1.2 var(--d-body);text-align:left;text-decoration:none;white-space:nowrap;cursor:pointer}
.tr-menu a:hover,.tr-menu a:focus,.tr-menu button:hover,.tr-menu button:focus{background:var(--d-hover)}
.tr-menu a:focus-visible,.tr-menu button:focus-visible{outline-offset:-3px}

/* ---------- lists: sets, reels, picked files ---------- */
.rows.tr-sets > li,.rows.tr-reels > li,.rows.tr-files > li{flex-wrap:wrap}
.rows.tr-reels > li{align-items:flex-start;padding:12px 0}
.tr-set-main,.tr-reel-main{display:flex;flex-direction:column;gap:2px;flex:1 1 260px;min-width:0}
.tr-reel-main .tr-bad,.tr-reel-main .tr-sub{margin:2px 0 0}
.tr-reel-state{flex:0 0 160px;padding-top:1px}
.tr-reels .tr-row-actions{flex:0 1 auto;min-width:200px}

/* ---------- version cards: the one fill on these pages ---------- */
.tr-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:var(--d-gap)}
.tr-ver{display:flex;flex-direction:column;gap:12px;min-width:0;padding:16px;background:var(--panel)}
.tr-ver.is-off{background:transparent;box-shadow:inset 0 0 0 1px var(--line)}
.tr-ver.is-off .tr-ver-name{color:var(--muted)}
.tr-ver.is-off .tr-video,.tr-ver.is-off .tr-noplay{opacity:.5}
.tr-ver.is-picked{box-shadow:inset 0 2px 0 var(--text)}
.tr-ver-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 8px;min-height:22px}
.tr-ver .tr-ver-name,.section .tr-ver-name{margin:0;font-size:15px;line-height:1.25;color:var(--text)}
.tr-video,.tr-noplay{display:block;width:100%;aspect-ratio:9 / 16;max-height:300px;background:var(--bar)}
.tr-video{object-fit:contain}
.tr-noplay{display:grid;place-items:center;font-size:12px;color:var(--muted)}
.tr-hook{display:flex;flex-direction:column;gap:2px;margin:0;font-size:14px;color:var(--text)}
.tr-ver .field{margin-bottom:0}
.tr-ver .field .btn.link{justify-self:start}
.tr-card-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:auto}
.tr-card-actions .tr-sub{margin:0}

/* ---------- the new batch and new test forms ---------- */
.tr-summary .tr-sum-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:0 0 16px}
.tr-sum-line .tr-good,.tr-sum-line .tr-bad{margin:0}
.tr-set-field,.tr-pane .field{max-width:480px}
.at-spend{max-width:320px}
.tr-upload progress{max-width:480px;margin:8px 0 4px}
.tr-up-go{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 12px}
.rows.tr-files{max-width:720px;margin:0 0 16px}
.tr-files .tr-good,.tr-files .tr-bad{margin:0}
.tr-two{align-items:start}
.tr-sched{margin-top:12px}
.tr-sched-row{display:flex;flex-wrap:wrap;gap:0 16px;max-width:480px}
.tr-sched-row .field{flex:1 1 140px;margin-bottom:8px}
.tr-zone{margin:0}
.tr-when{margin-bottom:0}
/* lane W4: the one Accept or Decline for reels an AI sent: a section like the others, what each reel sends as version
   cards (its words as typed, line breaks kept), then its When on one line */
.tr-ok-when{margin-bottom:0}
.tr-ok-reels{margin:12px 0 16px}
.tr-ok-text{white-space:pre-wrap;overflow-wrap:anywhere}
/* the W4 integration review: every option a reel sends and the AI that made or changed it, on its card (handles break
   anywhere); a draft's start names that AI above the cards */
.tr-ok-opt,.tr-ok-by{overflow-wrap:anywhere}
.tr-start-ai{margin-top:8px}
.tr-warns:empty{display:none}
.tr-warns{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:12px}
.tr-warns .tr-bad{margin:0}
/* More options: one quiet row that opens; what it holds is summed up beside it */
.tr-options{margin:0 0 var(--d-section)}
.tr-options > summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:var(--d-row);padding:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);color:var(--text);cursor:pointer;list-style:none}
.tr-options > summary::-webkit-details-marker{display:none}
.tr-options > summary:focus-visible{outline-offset:-3px}
.tr-options > summary .icon{color:var(--muted)}
.tr-options[open] > summary .icon{transform:rotate(90deg)}
.tr-more-label{font-weight:600}
.tr-more-note{font-size:13px;color:var(--muted)}
.tr-options-body{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:0 var(--d-section);padding:24px 0 0}
.tr-opts-col{min-width:0}
.tr-opts-col .field{max-width:560px}
.tr-people{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.tr-people li{display:inline-flex;align-items:center;gap:2px}
.tr-person{color:var(--text)}
.tr-x{display:inline-grid;place-items:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--muted);cursor:pointer}
.tr-x:hover{background:var(--d-hover);color:var(--text)}
.tr-preview{margin-top:4px;max-width:560px}
.tr-preview > .label{margin:0;font:800 10.5px/1.2 var(--d-body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.tr-times{margin:8px 0 0;padding:0;list-style:none}
.tr-times li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}
.tr-times li:last-child{border-bottom:0}
.tr-times li span:last-child{flex:none;font-variant-numeric:tabular-nums;color:var(--muted);text-align:right}
.tr-why{margin:0;max-width:56ch}
.tr-why:empty{display:none}
.tr-submit{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px 16px;margin:0 0 var(--d-section)}
.tr-submit > .tr-why,.tr-why-list{flex:1 1 240px;text-align:right}
.tr-why-list{display:grid;gap:2px;justify-items:end}
.tr-submit-btns{display:flex;flex-wrap:wrap;gap:8px}
.section .tr-submit{margin:16px 0 0}

/* ---------- trial results: verdict, the full-width compare table, the fine print ---------- */
.tr-verdict{margin:0 0 16px}
.tr-verdict p{margin:0}
.tr-verdict-main{font-family:var(--display);font-weight:var(--display-weight);font-size:18px;line-height:1.3;color:var(--text)}
.tr-compare{min-width:520px}
.tr-compare td{white-space:nowrap}
.tr-compare thead th{height:auto;min-width:118px;padding:8px 12px 10px;vertical-align:bottom;white-space:normal;letter-spacing:.1em}
.tr-compare thead th:not(.tr-stick){text-align:right}
.tr-col-name{display:block;color:var(--muted)}
.tr-col-label{display:block;margin:2px 0 4px;font:400 14px/1.3 var(--d-body);letter-spacing:0;text-transform:none;color:var(--text)}
.tr-compare thead .chip{margin:2px 0;letter-spacing:0;text-transform:none}
.tr-compare thead .tr-sub{font-weight:400;letter-spacing:0;text-transform:none}
.tr-compare thead th.tr-col-pick{box-shadow:inset 0 2px 0 var(--text)}
.tr-compare tbody td.tr-col-pick{background:var(--d-hover)}
.tr-stick{position:sticky;left:0;z-index:1;background:var(--bg);text-align:left}
.tr-compare thead .tr-stick,.table thead .tr-stick{z-index:2}
.table tbody th.tr-stick{height:var(--d-row);padding:10px 12px;border-bottom:1px solid var(--line);font:400 13px/1.35 var(--d-body);letter-spacing:0;text-transform:none;color:var(--text);vertical-align:middle;white-space:nowrap}
.table tbody tr:last-child > th.tr-stick{border-bottom:0}
.tr-compare tbody th.tr-stick{white-space:normal;min-width:150px}
.tr-compare .tr-group th{height:auto;padding:20px 12px 8px;background:none;border-bottom:1px solid var(--line);font:800 10.5px/1.2 var(--d-body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted);text-align:left}
.tr-compare tbody tr.tr-group:hover{background:none}
.tr-term{padding:0;border:0;background:none;color:var(--text);font:inherit;text-align:left;text-decoration:underline dotted;text-decoration-color:var(--muted);text-underline-offset:3px;cursor:help}
.tr-term:focus-visible{outline-offset:2px}
.tr-tip{display:block;max-width:260px;margin:6px 0 2px;padding:8px 10px;background:var(--panel-deep);border:1px solid var(--d-edge);box-shadow:6px 6px 0 0 var(--shadow-ink);font-size:12.5px;line-height:1.4;color:var(--text);white-space:normal}
.tr-pick-row th,.tr-pick-row td{padding-top:12px;padding-bottom:12px;border-bottom:0}
.tr-pick-row td{text-align:right}
.tr-pick-row:hover{background:none}
.tr-swipe{display:none}

/* ---------- ad tests ---------- */
.tr-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px 24px;max-width:960px;margin:0 0 12px}
.tr-facts div{min-width:0}
.tr-facts dt{font:800 10.5px/1.2 var(--d-body);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.tr-facts dd{margin:6px 0 0;font-size:14px;color:var(--text);overflow-wrap:anywhere}
.rows.tr-meta-problems{max-width:960px;margin:0 0 12px}
.at-total{margin:0 0 8px;font-family:var(--display);font-weight:var(--display-weight);font-size:18px;line-height:1.3;color:var(--text)}
.at-facts{margin:0;padding:0;list-style:none}
.at-facts li{position:relative;padding:4px 0 4px 16px;font-size:13px;color:var(--muted)}
.at-facts li::before{content:"";position:absolute;left:0;top:11px;width:4px;height:4px;background:var(--muted)}
.at-end-line{margin:0 0 16px}
.tr-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;margin:0;padding:0;list-style:none}
.tr-step{display:flex;align-items:flex-start;gap:8px;min-width:0;padding:12px 0 0;border-top:2px solid var(--line)}
.tr-step[data-step="done"],.tr-step[data-step="running"]{border-top-color:var(--text)}
.tr-step-name{color:var(--text)}
.tr-step[data-step="pending"] .tr-step-name{color:var(--muted)}
.tr-step[aria-current="step"] .tr-step-name{font-weight:600}
.tr-step .pip{margin-top:5px}
.tr-step[data-step="done"] .pip,.tr-step[data-step="running"] .pip{color:var(--text)}
.tr-step-text{display:flex;flex-direction:column;min-width:0}
.at-terms{margin:16px 0 0}
.at-chart-box{margin-top:8px}
.at-chart-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 24px;margin:0 0 12px}
.section .at-chart-head h3{margin:0}
.at-legend{display:flex;flex-wrap:wrap;gap:4px 16px}
.at-key{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:0 2px;border:0;background:transparent;color:var(--text);font:400 13px/1.2 var(--d-body);cursor:pointer}
.at-key:hover{text-decoration:underline}
.at-key[aria-pressed="false"]{color:var(--muted)}
.at-key[aria-pressed="false"] .at-swatch{opacity:.3}
.at-chart:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.at-chart-scroll{overflow-x:auto}
.at-svg{display:block;width:100%;height:auto}
.at-grid{stroke:var(--line);stroke-width:1}
.at-axis{stroke:var(--line-strong);stroke-width:1}
.at-guide{stroke:var(--line);stroke-width:1;stroke-dasharray:2 3}
.at-tick{fill:var(--muted);font:400 11px var(--d-body);font-variant-numeric:tabular-nums}
.at-end{fill:var(--text);font:600 11px var(--d-body)}
.at-cross{stroke:var(--text);stroke-width:1}
.at-series polyline,.at-swatch line{fill:none;stroke-linecap:square;stroke-linejoin:miter}
.at-s1 polyline,.at-s1 line{stroke:var(--accent);stroke-width:2}
.at-s2 polyline,.at-s2 line{stroke:var(--text);stroke-width:1.5;stroke-dasharray:4 3}
.at-s3 polyline,.at-s3 line{stroke:var(--accent-faint);stroke-width:2}
.at-s4 polyline,.at-s4 line{stroke:var(--accent-faint);stroke-width:2;stroke-dasharray:1 3}
.at-series.is-off{display:none}
.at-readout{min-height:20px;margin:12px 0 4px;font-size:13px;color:var(--text)}
.at-table-row,.at-all-row{margin:4px 0 0}
.at-numbers-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--d-section)}
.at-numbers-grid h3{margin-top:0}
.at-numbers .table-wrap{margin:0 0 8px}
.at-versions td{white-space:nowrap}
.at-versions thead th{height:auto;padding:8px 10px;line-height:1.25;white-space:normal;vertical-align:bottom}
.at-versions tbody th .chip{display:flex;width:max-content;margin:2px 0 0}
.at-versions:not([data-all]) .at-more{display:none}
.at-curve td{height:32px;padding:4px 12px}
.at-pick-top{margin:0 0 16px}
.at-pick-top .tr-actions{margin-top:8px}

/* ---------- the set page ---------- */
.set-meta{display:flex;flex-direction:column;gap:6px;margin:calc(var(--d-gap) * -0.5) 0 var(--d-section)}
.set-meta p{margin:0}
.set-badges{display:flex;flex-wrap:wrap;gap:4px 16px}
.set-winner{margin:0 0 var(--d-section)}
.set-marks{display:inline-flex;flex-wrap:wrap;gap:4px 10px}
.set-caption{max-width:72ch;white-space:pre-wrap}
/* the two runs sit side by side only where each table has room for every column; otherwise they stack */
.set-runs-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,720px),1fr));gap:var(--d-section)}
.set-run-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 8px}
.section .set-run-head h3{margin:0}
.set-run-head .tr-sub{margin:0}
.set-mini{min-width:440px}
.set-mini td{white-space:nowrap}
.set-rename{max-width:560px;margin:0 0 var(--d-section)}
.set-rename .field{margin-bottom:8px}
.set-rename .tr-actions{justify-content:flex-end;margin-top:0}

/* ---------- hooks the script and tests find, with nothing of their own to draw ---------- */
.set-run,.set-cap,.at-cards,.tr-batches,.at-tests,.tr-compare-wrap,.tr-form,.tr-versions,.tr-results,.tr-start,.tr-ok,.tr-ok-reel,.tr-source,.tr-timing,.tr-sets-block,.at-results,.at-setup,.at-steps,.at-banner,.tr-ig-failed,.set-warnings,.set-runs,.at-marks-box,.at-versions-box,.at-marks,.at-ver,.set-ver,.tr-reel,.tr-soft-cap,.tr-ig-cap,.tr-fresh,.tr-rule,.tr-fix,.at-all{min-width:0}
.tr-refresh,.set-rename-btn{flex:none}

/* ---------- wide screens: the marks table beside the versions table ---------- */
@media (min-width:1280px){
  .at-numbers-grid{grid-template-columns:minmax(280px,340px) minmax(0,1fr)}
}

/* ---------- narrow screens ---------- */
@media (max-width:899.98px){
  .tr-steps{grid-template-columns:minmax(0,1fr);gap:0}
  .tr-step{padding:10px 0 10px 12px;border-top:0;border-left:2px solid var(--line)}
  .tr-step[data-step="done"],.tr-step[data-step="running"]{border-left-color:var(--text)}
  .tr-x{width:40px;height:40px}
  .at-key{min-height:40px}
  .tr-link{min-height:40px}
  .tr-reel-state{flex-basis:auto}
}
@media (max-width:640px){
  .tr-submit{justify-content:stretch}
  .tr-submit > .tr-why,.tr-why-list{text-align:left;justify-items:start}
  .tr-submit-btns{width:100%}
  .tr-submit-btns .btn{flex:1 1 0}
  .tr-row-actions{justify-content:flex-start;margin-left:0}
  .tr-reels .tr-row-actions{min-width:0}
  .tr-grid{grid-template-columns:minmax(0,1fr)}
  /* cards with nothing to type in sit two to a row, so the page stays short */
  .tr-grid.at-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .at-cards .tr-ver{gap:8px;padding:10px}
  .at-cards .tr-video,.at-cards .tr-noplay{max-height:260px}
  .tr-swipe{display:block;margin:0 0 6px}
  .tr-compare th,.tr-compare td{padding-left:8px;padding-right:8px}
  .tr-compare thead th{min-width:92px}
  .tr-col-name{white-space:nowrap}
  .at-versions{min-width:640px}
  .at-versions[data-all]{min-width:980px}
  .tr-compare tbody th.tr-stick{min-width:110px}
  .set-runs-grid{grid-template-columns:minmax(0,1fr)}
  /* More alone at the left of the header opens rightward, so the menu stays on screen */
  .dash-actions > .tr-menu-wrap:first-child .tr-menu{right:auto;left:0}
}
