/* propane — app (the authed studio). Layers on brand.css; never redefines its
   vars/classes. Monochrome, engineered, telemetry feel. */

/* ── boot loader ──────────────────────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-content: center; gap: 22px; justify-items: center;
  background: var(--bg);
  transition: opacity .4s var(--ease-out);
}
.boot.is-gone { opacity: 0; pointer-events: none; }
.boot-mark { display:flex; align-items:center; gap:.55em; font-weight:800; letter-spacing:-.05em; font-size:1.5rem; color: var(--ink); }
.boot-mark .dot { width:9px; height:9px; border-radius:50%; background: var(--accent); box-shadow:0 0 18px 2px color-mix(in srgb, var(--accent) 55%, transparent); animation: boot-pulse 1.6s var(--ease) infinite; }
.boot-mark .brand-tile { animation: boot-pulse 1.6s var(--ease) infinite; }
.boot-line { display:flex; align-items:center; gap:.6em; color: var(--ink-3); font-size:.85rem; letter-spacing:.06em; }
@keyframes boot-pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.82); } }
@media (prefers-reduced-motion: reduce) { .boot-mark .dot, .boot-mark .brand-tile { animation: none; } }

/* ── nav ──────────────────────────────────────────────────────────────────── */
/* center the nav links between the brandmark (left) and credits + signout (right) */
.nav .wrap { position: relative; }
.nav-links {
  display:flex; align-items:center; gap: 4px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
  position: relative; font-size:.92rem; font-weight:560; color: var(--ink-3);
  padding: .5em .85em; border-radius: var(--r-pill);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); background: var(--bg-3); }
.nav-right { display:flex; align-items:center; gap: 10px; }
.nav-credits { cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.nav-credits:hover { border-color: var(--line-2); }
.nav-credits.is-active { background: var(--bg-3); border-color: var(--line-2); }
.nav-credits .spin { width:.85em; height:.85em; }
.nav-credits b { color: var(--ink); }

/* ── layout shells ────────────────────────────────────────────────────────── */
.app { min-height: calc(100dvh - 64px); }
.app-wrap { padding-top: 34px; padding-bottom: 140px; }
.view { animation: view-in .4s var(--ease-out); }
@keyframes view-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .view, .boot { animation: none !important; transition: none !important; } }

.page-head { margin-bottom: 30px; }
.page-head h2 { margin-top: 6px; }
.lede { color: var(--ink-2); margin-top: 12px; max-width: 56ch; font-size: 1.05rem; }

/* ── wizard (paginated builder) ───────────────────────────────────────────── */
.wizard { scroll-margin-top: 86px; }

/* step indicator at the top — paginates the four builder steps */
.wizard-steps { display:flex; align-items:center; gap: 12px; margin-bottom: 26px; }
.wizard-step {
  display:inline-flex; align-items:center; gap: 13px; flex: 0 1 auto;
  padding: 12px 20px; font: inherit; text-align:left; cursor:pointer;
  background: var(--bg-1); border: 1px solid transparent; border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.wizard-step:hover:not(:disabled) { border-color: var(--line-2); color: var(--ink); }
.wizard-step:hover:not(:disabled) .ws-title { color: var(--ink); }
.wizard-step:disabled { opacity:.5; cursor:not-allowed; }
.wizard-step.is-active { border-color: var(--accent); background: var(--accent-weak); }
.wizard-step .ws-no {
  flex:0 0 auto; width: 28px; height: 28px; display:grid; place-items:center;
  border:1px solid var(--line-2); border-radius:50%; font-size:.78rem; color: var(--ink-3);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.wizard-step.is-active .ws-no { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ws-text { display:flex; flex-direction:column; gap: 1px; min-width:0; }
.ws-title { font-weight:600; font-size:.92rem; letter-spacing:-.01em; color: var(--ink-2); }
.wizard-step.is-active .ws-title { color: var(--ink); }
.ws-sub { font-family: var(--mono); font-size:.64rem; letter-spacing:.08em; text-transform:uppercase; color: var(--ink-3); }
.wizard-step-line { flex:1 1 auto; height:1px; min-width: 14px; background: var(--line); }

/* main = the active panel (left) + a persistent preview (right) */
.wizard-main { display:grid; grid-template-columns: minmax(0,1fr) 332px; gap: 22px; align-items: start; }
.wizard-main.is-solo { grid-template-columns: 1fr; }     /* legacy: no-preview fallback */
.wizard-main.is-solo .preview-col { display:none; }
/* the preview persists on every step; when the server ships no preview descriptors
   the column is .hide — collapse the empty track so the panel spans full width */
.wizard-main:has(> .preview-col.hide) { grid-template-columns: 1fr; }
.wizard-panels { min-width: 0; }

/* one panel visible at a time */
.wizard-panel { display:none; }
.wizard-panel.is-active { display:block; animation: panel-in .34s var(--ease-out); }
@keyframes panel-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .wizard-panel.is-active { animation:none; } }

/* the wizard's floating action bar carries a Back affordance on later steps */
.wizard-back.hide { display:none; }

/* review step recap */
.review-summary { display:flex; align-items:baseline; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom: 20px; }
.review-batch { font-size: 1.5rem; font-weight: 720; letter-spacing: -.02em; }
.review-batch small { font-size: .9rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.review-cost { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); }
.review-cost.is-bad { color: var(--bad); }
.review-head { font-family: var(--mono); font-size:.66rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-3); margin: 0 0 10px; }

/* ── panel heads ──────────────────────────────────────────────────────────── */
.step-head { display:flex; gap: 16px; align-items:flex-start; margin-bottom: 22px; }
.step-head h3 { margin-bottom: 2px; }

/* ── moment step: mode + filters ──────────────────────────────────────────── */
/* league × season scope pickers */
.scope-row { display:flex; flex-wrap:wrap; gap: 16px; margin-bottom: 18px; }
.scope-row.hide { display:none; }
.filter-scope { flex: 1 1 200px; min-width: 150px; }
.filter-scope select.input:disabled { opacity:.55; cursor: default; }

.mode-row { margin-bottom: 20px; }

/* segmented Match / Team / Player control */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-pill); }
.seg-opt {
  font: inherit; font-size: .85rem; font-weight: 560; cursor: pointer;
  padding: .5em 1.15em; border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--ink-3); transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.seg-opt:hover { color: var(--ink); }
.seg-opt.is-on { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-sm); }

.player-search { margin-bottom: 14px; }
.player-search.hide { display: none !important; }

/* player picker grid (reuses team-pick metrics) */
.player-opt {
  position: relative;
  font: inherit; text-align: left; cursor: pointer; color: var(--ink-2);
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; transition: all var(--t-fast) var(--ease);
  display: flex; flex-direction: column; gap: 4px;
}
.player-opt:hover { border-color: var(--line-2); color: var(--ink); transform: translateY(-1px); }
.player-opt.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-weak); color: var(--ink); }
/* avatar + name/team row at the top of a player card */
.po-head { display: flex; align-items: center; gap: 11px; min-width: 0; padding-right: 22px; }
.po-headtext { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.player-opt .po-name { font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* round select-grid avatar (player headshot / club crest) over an initials disc */
.sel-avatar {
  position: relative; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--ink-3); font-family: var(--mono); font-weight: 600; font-size: .74rem; letter-spacing: .02em;
}
.sel-avatar--team { background: var(--bg-1); }
.sel-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--bg-3); }
.sel-avatar--team .sel-avatar-img { object-fit: contain; padding: 5px; background: var(--bg-1); }
.sel-avatar.has-img { color: transparent; }       /* image covers the initials once it paints */
.player-opt.is-selected .po-name { color: var(--ink); }
.player-opt .po-meta { font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; color: var(--ink-3); }
.player-opt .po-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.player-opt .po-cat { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--ink-2); background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .15em .5em; }
/* primary stat (goals — the first pill the player-card builder appends) reads red */
/* the goals pill (tagged in app.mjs) is the single red "primary stat"; the
   active-category pill, when it isn't goals, gets a calm neutral emphasis so
   only one pill ever reads red */
.player-opt .po-cat--goals { color: var(--accent-strong); background: var(--accent-weak); border-color: var(--accent-line); }
.player-opt .po-cat.is-on:not(.po-cat--goals) { background: var(--bg-3); color: var(--ink); border-color: var(--line-2); }
/* red circular check on the selected card */
.player-opt.is-selected::after {
  content: "✓"; position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: .68rem; line-height: 1;
}
.switch { display:inline-flex; align-items:center; gap: 12px; cursor:pointer; user-select:none; }
.switch input { position:absolute; opacity:0; width:0; height:0; }
.switch-track {
  width: 42px; height: 24px; border-radius: var(--r-pill);
  background: var(--bg-3); border: 1px solid var(--line-2);
  position: relative; transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
  flex: 0 0 auto;
}
.switch-knob {
  position:absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius:50%;
  background: var(--ink-3); transition: transform var(--t) var(--ease), background var(--t) var(--ease);
}
.switch input:checked + .switch-track { background: var(--solid); border-color: var(--solid); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(18px); background: var(--solid-ink); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--accent-weak); }
.switch-label { font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; color: var(--ink-2); }

.filters {
  display:grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 22px;
  align-items: start; margin-bottom: 24px;
}
.filter-cats span { display:block; font-family: var(--mono); font-size:.7rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-3); margin-bottom:.5em; }
.chiprow { display:flex; flex-wrap:wrap; gap: 8px; }
.filters.is-team-mode .filter-cats { opacity:.45; pointer-events:none; }

/* ── match list ───────────────────────────────────────────────────────────── */
.match-list {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; max-height: 460px; overflow-y: auto; padding: 2px;
  scroll-snap-type: y proximity;
}
.match {
  text-align:left; background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px; cursor: pointer; font: inherit; color: inherit;
  display:flex; flex-direction:column; gap: 10px;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.match:hover { border-color: var(--line-2); background: var(--bg-2); transform: translateY(-1px); }
.match.is-selected { border-color: var(--accent); background: var(--accent-weak); box-shadow: 0 0 0 1px var(--accent) inset; }
.match-top { display:flex; justify-content:space-between; align-items:baseline; gap: 10px; }
.match-teams { font-weight: 650; letter-spacing:-.01em; line-height:1.2; }
.match-score { font-family: var(--mono); font-size:.95rem; color: var(--ink); white-space:nowrap; }
.match-date { font-family: var(--mono); font-size:.72rem; letter-spacing:.08em; color: var(--ink-3); text-transform:uppercase; }
.match-cats { display:flex; flex-wrap:wrap; gap: 6px; margin-top: 2px; }
.match-cat {
  font: inherit; cursor:pointer; font-size:.78rem; font-weight:550; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .3em .7em; transition: all var(--t-fast) var(--ease);
}
.match-cat:hover { border-color: var(--line-2); color: var(--ink); }
.match-cat.is-on { background: var(--accent-weak); color: var(--accent-strong); border-color: var(--accent-line); }
.match-cat .ct { font-family: var(--mono); opacity:.7; margin-left:.35em; }
.match-cat.is-on .ct { opacity:.7; }

.team-pick { display:grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 8px; max-height: 320px; overflow-y:auto; padding:2px; }
.team-opt {
  font: inherit; text-align:left; cursor:pointer; color: var(--ink-2);
  background: var(--bg-1); border:1px solid var(--line); border-radius: var(--r);
  padding: 11px 14px; font-weight:550; transition: all var(--t-fast) var(--ease);
  display: flex; align-items: center; gap: 11px; min-width: 0;
}
.team-opt .to-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-opt:hover { border-color: var(--line-2); color: var(--ink); }
.team-opt.is-selected { border-color: var(--accent); box-shadow:0 0 0 1px var(--accent) inset; background: var(--accent-weak); color: var(--ink); }

.empty { color: var(--ink-3); padding: 28px 6px; text-align:center; font-size:.92rem; grid-column: 1 / -1; }

/* ── step 2: variant matrix ───────────────────────────────────────────────── */
.matrix { display:flex; flex-direction:column; gap: 22px; }
.matrix-axes { display:flex; flex-direction:column; gap: 20px; }

/* ── step 2a: saved variant templates ─────────────────────────────────────────
   User-owned presets of the matrix. A saved template is a pill (apply + delete);
   the trailing control saves the current settings as a new one. */
.vtpl { display:flex; flex-direction:column; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.vtpl-head { display:flex; flex-direction:column; gap: 4px; }
.vtpl-title { font-family: var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-2); }
.vtpl-sub { font-size:.84rem; color: var(--ink-3); max-width: 62ch; line-height: 1.45; }

.vtpl-list { display:flex; flex-wrap:wrap; gap: 10px; align-items:stretch; }
.vtpl-empty { font-size:.84rem; color: var(--ink-3); align-self:center; }

/* a saved template — apply button + delete affordance share one bordered pill */
.vtpl-tpl {
  display:inline-flex; align-items:stretch; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line); overflow:hidden;
  transition: border-color var(--t-fast) var(--ease);
}
.vtpl-tpl:hover { border-color: var(--line-2); }
.vtpl-tpl.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-weak); }
.vtpl-tpl-apply {
  display:flex; flex-direction:column; gap: 2px; text-align:left;
  padding: 10px 14px; background:transparent; border:0; cursor:pointer;
  color: var(--ink-2); font: inherit; transition: color var(--t-fast) var(--ease);
}
.vtpl-tpl-apply:hover { color: var(--ink); }
.vtpl-tpl.is-on .vtpl-tpl-apply { color: var(--ink); }
.vtpl-tpl-name { font-weight: 600; font-size:.9rem; }
.vtpl-tpl-meta { font-family: var(--mono); font-size:.66rem; letter-spacing:.04em; color: var(--ink-3); }
.vtpl-tpl.is-on .vtpl-tpl-meta { color: var(--ink-2); }
.vtpl-tpl-del {
  flex: 0 0 auto; width: 34px; align-self:stretch; background:transparent;
  border:0; border-left: 1px solid var(--line); color: var(--ink-3);
  cursor:pointer; font-size: 1.1rem; line-height:1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.vtpl-tpl-del:hover { background: var(--bad-weak); color: var(--bad-ink); }

/* save control — button that swaps to an inline name field */
.vtpl-save { display:inline-flex; align-items:center; gap: 8px; }
.vtpl-save-btn {
  padding: 10px 16px; border-radius: var(--r); cursor:pointer; font: inherit;
  font-size:.88rem; font-weight: 550; background:transparent; color: var(--ink-2);
  border: 1px dashed var(--line-2); transition: all var(--t-fast) var(--ease);
}
.vtpl-save-btn:hover { color: var(--ink); border-color: var(--ink-3); background: var(--bg-1); }
.vtpl-save-input {
  height: 40px; padding: 0 12px; border-radius: var(--r); font: inherit; font-size:.9rem;
  background: var(--bg-3); color: var(--ink); border: 1px solid var(--line-2); min-width: 200px;
}
.vtpl-save-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vtpl-save-confirm {
  height: 40px; padding: 0 16px; border-radius: var(--r); cursor:pointer; font: inherit;
  font-size:.88rem; font-weight: 600; background: var(--solid); color: var(--solid-ink); border:1px solid var(--solid);
  transition: opacity var(--t-fast) var(--ease);
}
.vtpl-save-confirm:hover { opacity:.85; }
.vtpl-save-cancel {
  height: 40px; padding: 0 12px; border-radius: var(--r); cursor:pointer; font: inherit;
  font-size:.85rem; background:transparent; color: var(--ink-3); border:1px solid var(--line);
  transition: color var(--t-fast) var(--ease);
}
.vtpl-save-cancel:hover { color: var(--ink); }

.axis {}
.axis-head { display:flex; align-items:baseline; gap: 10px; margin-bottom: 10px; }
.axis-label { font-family: var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-2); }
.axis-hint { font-size:.72rem; color: var(--ink-4); font-family: var(--mono); letter-spacing:.04em; }
.axis-value { margin-left:auto; color: var(--ink); font-size:.78rem; }
.axis.is-gated { opacity:.4; }
.axis.is-gated .chip { pointer-events:none; }
.axis-chips { display:flex; flex-wrap:wrap; gap: 8px; }
.axis--range { display:flex; flex-direction:column; gap: 10px; }
.axis--range .axis-head { margin-bottom: 0; }
.axis-range {
  width: 100%; height: 40px; margin: 0;
  accent-color: var(--accent);
}
.axis-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
.axis-presets .chip { min-width: 54px; justify-content:center; }

.limit-warning { display:block; margin-top:10px; font-size:.78rem; color: var(--warn); font-family: var(--mono); letter-spacing:.02em; }
.limit-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap:8px; }
.limit-pill { justify-content:center; min-width:0; font-family: var(--mono); }
.limit-explain { margin: 2px 0 12px; font-size: .82rem; color: var(--ink-3); }

/* per-clip extras — replay / reaction toggles */
.extras-row { display:flex; flex-wrap:wrap; align-items:center; gap: 14px 28px; }
.extras-hint { margin: 12px 0 0; font-size:.72rem; color: var(--ink-4); font-family: var(--mono); letter-spacing:.02em; line-height: 1.5; }

/* max clip length — a single per-batch cap (mode chips + seconds) */
.clipcap .axis-chips { margin-bottom: 0; }
.clipcap-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display:flex; flex-direction:column; gap: 12px; }
.clipcap-block[hidden] { display:none; }
.clipcap-sec-row { display:flex; align-items:center; gap: 12px; }
.clipcap-sec-label { font-family: var(--mono); font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color: var(--ink-2); }
.clipcap-sec { width: 96px; flex: none; padding: .5em .7em; text-align:center; font-family: var(--mono); }
.clipcap-hint { margin: 0; font-size:.72rem; color: var(--ink-4); font-family: var(--mono); letter-spacing:.02em; line-height: 1.5; }

/* ── vetted soundtrack picker (Style step) ──────────────────────────────────── */
.music .switch { margin-top: 2px; }
.music-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display:flex; flex-direction:column; gap: 16px; }
.music-block[hidden] { display:none; }
.music-list { display:flex; flex-direction:column; gap: 8px; max-height: 280px; overflow-y:auto; padding-right: 2px; }
.music-track {
  display:flex; align-items:center; gap: 12px; cursor:pointer;
  background: var(--bg-1); border:1px solid var(--line); border-radius: var(--r);
  padding: 9px 12px; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.music-track:hover { border-color: var(--line-2); }
.music-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.music-track.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-weak); }
.music-play {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display:grid; place-items:center; cursor:pointer;
  background: var(--bg-3); border:1px solid var(--line-2); color: var(--ink); font-size:.62rem;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.music-play:hover { background: var(--solid); color: var(--solid-ink); }
.music-track.is-playing .music-play { background: var(--solid); color: var(--solid-ink); }
.music-meta { display:flex; flex-direction:column; gap: 2px; min-width:0; flex: 1 1 auto; }
.music-title { font-size:.9rem; color: var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.music-sub { font-family: var(--mono); font-size:.66rem; letter-spacing:.04em; color: var(--ink-3); }
.music-check { flex: none; width: 16px; text-align:center; color: var(--accent-strong); font-size:.82rem; }
.music-sync { display:flex; flex-direction:column; gap: 10px; }
.music-sync-label { font-family: var(--mono); font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color: var(--ink-2); }
.music-sync-hint { margin: 0; font-size:.72rem; color: var(--ink-4); font-family: var(--mono); letter-spacing:.02em; line-height: 1.5; }

/* ── copyright-risk estimate (Review step) ──────────────────────────────────── */
.copyright-card {
  margin-top: 20px; padding: 18px; border:1px solid var(--line); border-radius: var(--r);
  background: var(--bg-1); display:flex; flex-direction:column; gap: 14px;
}
.copyright-head { display:flex; align-items:center; gap: 10px; }
.copyright-title { font-family: var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-2); }
.copyright-tag {
  font-family: var(--mono); font-size:.6rem; letter-spacing:.08em; text-transform:uppercase; color: var(--ink-3);
  background: var(--bg-3); border:1px solid var(--line); border-radius: var(--r-pill); padding: .15em .55em;
}
.copyright-rows { display:flex; flex-direction:column; gap: 9px; }
.copyright-row { display:flex; align-items:center; gap: 12px; }
.copyright-platform { flex: 0 0 90px; font-size:.86rem; color: var(--ink); }
.copyright-meter { display:inline-flex; gap: 4px; flex: 0 0 auto; }
.copyright-meter i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-3); border:1px solid var(--line-2); }
.copyright-meter.is-low i.on { background: var(--ink-3); border-color: var(--ink-3); }
.copyright-meter.is-med i.on { background: var(--ink-2); border-color: var(--ink-2); }
.copyright-meter.is-high i.on { background: var(--ink); border-color: var(--ink); }
.copyright-level { margin-left:auto; font-family: var(--mono); font-size:.72rem; letter-spacing:.06em; text-transform:uppercase; }
.copyright-level.is-low { color: var(--ink-3); }
.copyright-level.is-med { color: var(--ink-2); }
.copyright-level.is-high { color: var(--ink); }
.copyright-tips { margin: 0; padding-left: 18px; display:flex; flex-direction:column; gap: 7px; }
.copyright-tips li { font-size:.8rem; color: var(--ink-2); line-height: 1.5; }
.copyright-foot { margin: 0; font-family: var(--mono); font-size:.66rem; letter-spacing:.02em; color: var(--ink-4); line-height: 1.5; }

/* ── live 9:16 reel preview ───────────────────────────────────────────────────
   A faithful mock of the engine's burned overlays (geometry + colours arrive
   from /api/catalog/variants `preview`). Inline top/height/colour/font-size
   come from that spec; this file only carries structure. All px sizes inside
   the canvas are cqw units (engine px ÷ 1080 × 100) against .pv-screen. */
.preview-col {
  position: sticky; top: 86px;
  /* short viewports: scroll inside the column rather than clip behind the costbar */
  max-height: calc(100dvh - 86px - 98px); overflow-y: auto; overscroll-behavior: contain;
}
.preview-card { padding: 18px; }
.preview-head { display:flex; align-items:baseline; justify-content:space-between; margin-bottom: 12px; }

.pv-screen {
  position: relative; width: 100%; aspect-ratio: 9 / 16;
  background: #000; border: 1px solid var(--line-2); border-radius: 14px;
  overflow: hidden; container-type: inline-size; user-select: none; touch-action: none;
}
.pv-screen * { pointer-events: none; }

/* draggable overlay groups — header, scorer, crests, tier strip */
.pv-drag { pointer-events: auto; cursor: grab; }
.pv-drag::after {
  content: ""; position: absolute; inset: -1.6cqw; border: 1px dashed transparent;
  border-radius: 2cqw; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.pv-screen:hover .pv-drag::after { border-color: rgba(255,255,255,.22); }
.pv-drag:hover::after { border-color: rgba(255,255,255,.65); background: rgba(255,255,255,.05); }
.pv-drag.is-dragging { cursor: grabbing; }
.pv-drag.is-dragging::after { border-color: #fff; border-style: solid; background: rgba(255,255,255,.08); }
.pv-drag.is-moved::after { border-color: rgba(255,255,255,.4); }
.pv-drag.is-selected::after { border-color: rgba(255,255,255,.82); background: rgba(255,255,255,.06); }
.pv-tool {
  position: absolute; top: -2.2cqw; right: -2.2cqw; z-index: 9;
  min-width: 5.8cqw; height: 5.8cqw; padding: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.42); border-radius: 999px;
  background: rgba(0,0,0,.78); color: #fff;
  font: 700 2.8cqw/1 var(--mono); letter-spacing: 0;
  cursor: pointer; pointer-events: auto; text-shadow: none;
}
.pv-tool:hover, .pv-tool:focus-visible { background: rgba(255,255,255,.16); outline: none; }
.pv-group { position: absolute; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; max-width: 96%; }
/* resize wrapper: holds an overlay's visual content so the size slider scales it
   without scaling the node's 3-dots tool / menu. Mirrors the parent's flex layout
   so the wrapped children stack/space exactly as before. */
.pv-scalewrap { display: inherit; flex-direction: inherit; align-items: inherit; gap: inherit; transform: scale(var(--pv-scale, 1)); }
.pv-group .pv-t { position: static; transform: none; left: auto; white-space: nowrap; }
.pv-header-g { gap: .6cqw; --pv-ls-base: 10.19cqw; } /* engine team→sub gap = 110px ÷ 1080 */
.pv-scorer-g { gap: .8cqw; --pv-ls-base: 8.52cqw; }  /* engine name→opp gap  =  92px ÷ 1080 */
/* Line spacing: shift each line after the first by (factor − 1) × the engine's
   default gap, matching the renderer's gap multiplier. Default factor 1 → 0 →
   byte-identical stacking. The .pv-scalewrap transform then scales this margin in
   lockstep with the size slider, exactly as the engine multiplies gap by scale. */
.pv-header-g > .pv-t ~ .pv-t,
.pv-header-g > .pv-scalewrap > .pv-t ~ .pv-t,
.pv-scorer-g > .pv-t ~ .pv-t,
.pv-scorer-g > .pv-scalewrap > .pv-t ~ .pv-t {
  margin-top: calc((var(--pv-line-spacing, 1) - 1) * var(--pv-ls-base, 0cqw));
}

/* footage stand-in: pitch SVG, crisp in the panel, blurred copy as band fill */
.pv-fill { position: absolute; inset: -5%; filter: blur(9px) brightness(.8) saturate(.7); }
.pv-panel { position: absolute; left: 0; right: 0; overflow: hidden; }
.pv-fill svg, .pv-panel svg { width: 100%; height: 100%; display: block; }

/* burned-text look: Impact + heavy black outline (engine draw_text_with_outline) */
.pv-t {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-family: Impact, Haettenschweiler, "Arial Narrow", "Avenir Next Condensed", "Franklin Gothic Medium", sans-serif;
  font-weight: 700; font-stretch: condensed;
  line-height: 1; white-space: nowrap; letter-spacing: .01em;
  text-shadow:
    .045em .045em 0 #000, -.045em .045em 0 #000, .045em -.045em 0 #000, -.045em -.045em 0 #000,
    .06em 0 0 #000, -.06em 0 0 #000, 0 .06em 0 #000, 0 -.06em 0 #000;
}
.pv-headline, .pv-scorer { text-transform: uppercase; }

/* crest stand-ins (engine pastes real club crests; we draw initial discs) */
.pv-crests { position: absolute; top: 2.1%; left: 50%; transform: translateX(-50%); display: flex; gap: 2.6cqw; }
.pv-crest {
  width: 14cqw; height: 14cqw; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-family: Impact, "Arial Narrow Bold", sans-serif; font-size: 5.4cqw;
  overflow: hidden;
}
.pv-crest img { max-width: 90%; max-height: 90%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 .5cqw 1cqw rgba(0,0,0,.55)); }
.pv-crest-fallback { background: rgba(0,0,0,.55); }
.pv-crest-placeholder { font-size: 3.2cqw; letter-spacing: 0; }
.pv-crests.is-solo { left: 3.7cqw; transform: none; }
.pv-crests.is-solo .pv-scalewrap { transform-origin: top left; } /* solo crest is a top-left badge — grow from its anchor */

/* tier: full-width strip of band boxes; each box carries its own count beneath */
.pv-strip { position: absolute; left: 3.7cqw; right: 3.7cqw; display: flex; gap: 1.3cqw; }
.pv-strip-scrim { position: absolute; left: 0; right: 0; background: rgba(0,0,0,.47); }
.pv-band {
  position: relative; flex: 1 1 0; min-width: 0; border-radius: 2cqw;
  display: grid; place-items: center; box-shadow: inset 0 0 0 .4cqw rgba(0,0,0,.85);
}
.pv-band-label {
  color: #000; font-family: Impact, "Arial Narrow Bold", sans-serif;
  font-size: 6.8cqw; line-height: 1; max-width: 92%; overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.pv-strip.is-words .pv-band-label { font-size: 3.4cqw; letter-spacing: .02em; }
.pv-band-ct {
  position: absolute; left: 0; right: 0; top: calc(100% + .7cqw); text-align: center;
  font-style: normal; color: #fff; font-family: Impact, sans-serif; font-size: 4.6cqw; line-height: 1;
  text-shadow: .05em .05em 0 #000, -.05em .05em 0 #000, .05em -.05em 0 #000, -.05em -.05em 0 #000;
}

/* tier: vertical rundown — a left-aligned list of band rows down the side. The
   container font-size is set inline (engine px → cqw); rows inherit it. */
.pv-rundown { position: absolute; display: flex; flex-direction: column; align-items: flex-start; }
.pv-rd-row {
  display: flex; align-items: center; color: #fff;
  font-family: Impact, "Arial Narrow Bold", sans-serif; line-height: 1; letter-spacing: .01em;
  white-space: nowrap;
  text-shadow: .05em .05em 0 #000, -.05em .05em 0 #000, .05em -.05em 0 #000, -.05em -.05em 0 #000;
}

/* dossier: bottom-left info card */
.pv-dossier { position: absolute; display: flex; flex-direction: column; gap: 1.3cqw; }
.pv-doss-row { border-radius: 2cqw; padding: 1.2cqw 2.4cqw; display: flex; flex-direction: column; justify-content: center; gap: .4cqw; }
.pv-doss-row b { font-family: Impact, sans-serif; font-weight: 400; font-size: 2.8cqw; letter-spacing: .08em; }
.pv-doss-row span { color: #fff; font-family: Impact, sans-serif; font-size: 5.2cqw; line-height: 1; text-transform: uppercase; }

/* effects */
.pv-skull { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); font-size: 30cqw; line-height: 1; filter: drop-shadow(0 .04em .12em rgba(0,0,0,.8)); opacity: 0; }

/* the 4s "goal moment" loop */
.pv-anim .pv-chip { animation: pv-pop 4s var(--ease) infinite; }
.pv-anim .pv-chip.is-moved, .pv-anim .pv-chip.is-dragging { animation: none; }
.pv-anim .pv-skull { animation: pv-flash 4s linear infinite; }
.pv-anim .pv-fx-punch { animation: pv-punch 4s var(--ease) infinite; }
.pv-anim .pv-band.is-active { animation: pv-band 4s linear infinite; }
.pv-anim .pv-cd-num { animation: pv-pop 4s var(--ease) infinite; }
@keyframes pv-pop { 0%, 36% { opacity: 0; transform: translateX(-50%) scale(.55); } 43% { opacity: 1; transform: translateX(-50%) scale(1.12); } 48%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes pv-flash { 0%, 39%, 52%, 100% { opacity: 0; } 41%, 49% { opacity: 1; } }
@keyframes pv-punch { 0%, 30%, 52%, 100% { transform: scale(1); } 40% { transform: scale(1.09); } }
@keyframes pv-band { 0%, 38% { box-shadow: inset 0 0 0 .4cqw rgba(0,0,0,.85); } 44%, 100% { box-shadow: inset 0 0 0 1cqw #fff; } }
@media (prefers-reduced-motion: reduce) {
  .pv-anim .pv-chip, .pv-anim .pv-skull, .pv-anim .pv-fx-punch, .pv-anim .pv-band.is-active, .pv-anim .pv-cd-num { animation: none; }
  .pv-anim .pv-skull { opacity: .9; }
  .pv-anim .pv-band.is-active { box-shadow: inset 0 0 0 1cqw #fff; }
}


/* pager + notes under the canvas */
.pv-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.pv-arrow {
  font: inherit; cursor: pointer; color: var(--ink-2);
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--r-pill);
  width: 30px; height: 30px; line-height: 1; display: grid; place-items: center;
  transition: all var(--t-fast) var(--ease);
}
.pv-arrow:hover { color: var(--ink); border-color: var(--line-2); }
.pv-arrow:disabled, .pv-arrow[aria-disabled="true"] { opacity: .3; cursor: not-allowed; }
.pv-pos { font-size: .72rem; color: var(--ink-3); letter-spacing: .08em; }
.pv-label { text-align: center; font-family: var(--mono); font-size: .7rem; color: var(--ink-2); letter-spacing: .02em; margin-top: 8px; min-height: 1.2em; }

/* preview edit toolbar */
.pv-edit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pv-edit.hide { display: none !important; }
.switch--sm { gap: 8px; }
.switch--sm .switch-track { width: 34px; height: 19px; }
.switch--sm .switch-knob { width: 14px; height: 14px; }
.switch--sm input:checked + .switch-track .switch-knob { transform: translateX(15px); }
.switch--sm .switch-label { font-size: .62rem; }
.pv-edit.is-shared #pv-edit-toggle { opacity: .5; }
.pv-elements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-top: 12px; }
.pv-element-toggle {
  min-height: 40px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-2);
}
.pv-notes { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.pv-note { display: flex; gap: 9px; align-items: baseline; font-size: .74rem; color: var(--ink-3); line-height: 1.4; }
.pv-note .pv-ic { font-family: var(--mono); color: var(--ink-2); flex: 0 0 auto; }
.pv-seq { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-seq span { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: .25em .6em; }
.pv-seq i { font-style: normal; color: var(--ink-4); }
.pv-foot { font-size: .68rem; color: var(--ink-4); margin-top: 14px; line-height: 1.5; }
.pv-menu {
  /* Centre-anchored on the element's stable centre (a .pv-group keeps its centre
     fixed via translateX(-50%) as it grows), so the open editor — and the input
     you're typing in — does NOT slide sideways as live text widens the element. */
  position: absolute; z-index: 8; min-width: 86px; padding: 4px;
  top: calc(100% + 1.8cqw); left: 50%; transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
  background: rgba(10,10,10,.94); box-shadow: 0 14px 36px rgba(0,0,0,.45);
  pointer-events: auto; text-shadow: none;
}
.pv-menu * { pointer-events: auto; }
.pv-menu--edit { min-width: 190px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.pv-menu-field { display: flex; flex-direction: column; gap: 5px; color: var(--ink-3); font-family: var(--mono); font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; }
.pv-menu-field input {
  width: 100%; min-height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  background: rgba(255,255,255,.08); color: #fff; padding: 0 8px;
  font: 400 .78rem/1.2 var(--sans); text-transform: none; letter-spacing: 0;
}
.pv-menu-field input:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: 2px; }
/* size slider — overrides the text-input box styling above for a range track */
.pv-menu-range { gap: 8px; }
.pv-menu-range-head { display: flex; align-items: baseline; justify-content: space-between; }
.pv-menu-range-val { color: #fff; letter-spacing: .02em; }
.pv-menu-range input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-height: 0; height: 15px; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; cursor: pointer;
}
.pv-menu-range input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,.24); }
.pv-menu-range input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,.24); }
.pv-menu-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -6px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 0;
}
.pv-menu-range input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 0; }
.pv-menu-range input[type="range"]:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: 3px; border-radius: 4px; }
.pv-menu button {
  width: 100%; min-height: 38px; border: 0; border-radius: 5px; padding: 0 10px;
  background: transparent; color: #fff; font: inherit; font-size: .78rem; text-align: left;
  cursor: pointer;
}
.pv-menu button:hover, .pv-menu button:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.pv-menu-danger { color: #ff8d8d !important; }
.pv-menu-danger:hover, .pv-menu-danger:focus-visible { background: rgba(255,141,141,.14) !important; }

/* menu dropdowns (font / when) + range-time inputs — match the text-input look */
.pv-menu-field select {
  width: 100%; min-height: 34px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  background: rgba(255,255,255,.08); color: #fff; padding: 0 8px;
  font: 400 .78rem/1.2 var(--sans); text-transform: none; letter-spacing: 0; cursor: pointer;
}
.pv-menu-field select:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: 2px; }
.pv-menu-times { display: flex; gap: 8px; }
.pv-menu-times.hide { display: none; }
.pv-menu-time { flex: 1; display: flex; flex-direction: column; gap: 5px; color: var(--ink-3); font-family: var(--mono); font-size: .58rem; letter-spacing: .04em; text-transform: uppercase; }
.pv-menu-time input {
  width: 100%; min-height: 32px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px;
  background: rgba(255,255,255,.08); color: #fff; padding: 0 8px; font: 400 .78rem/1.2 var(--sans);
}
.pv-menu-time input:focus-visible { outline: 2px solid rgba(255,255,255,.75); outline-offset: 2px; }

/* user-added custom text overlay — same burned look as the default chrome */
.pv-custom-g { z-index: 2; }
/* user-uploaded watermark (image / gif / video) — a draggable, resizable overlay.
   The inner media's width is set inline (engine base × scale); height keeps aspect. */
.pv-wm { z-index: 3; }
.pv-wm-media { display: block; height: auto; border-radius: 4px; }

/* Style-step image/watermark control (the entry point next to music/effects) */
.watermark-block { display: flex; flex-direction: column; gap: 10px; }
.wm-add { align-self: flex-start; }
.wm-row { display: flex; align-items: center; gap: 12px; }
.wm-thumb {
  width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.wm-meta { min-width: 0; }
.wm-name { font-size: .82rem; font-weight: 600; color: var(--ink); }
.wm-sub { font-size: .72rem; color: var(--ink-4); font-family: var(--mono); letter-spacing: .02em; line-height: 1.4; }
.wm-actions { display: flex; gap: 8px; }
/* PowerPoint-style selection box: a dashed outline laid over the element's on-
   screen rect with constant-size corner handles you drag to resize. Lives on the
   screen so its chrome doesn't scale with the element. The box passes pointer
   events through (so the body still drags); only the handles + tool capture. */
.pv-selbox {
  position: absolute; z-index: 8; pointer-events: none;
  border: 1.5px dashed rgba(255,255,255,.92); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35);
}
.pv-screen .pv-selhandle {
  position: absolute; width: 11px; height: 11px;
  background: #fff; border: 1.5px solid rgba(0,0,0,.55); border-radius: 2px;
  pointer-events: auto; touch-action: none; z-index: 9;
}
.pv-selhandle--nw { left: 0; top: 0; cursor: nwse-resize; }
.pv-selhandle--ne { right: 0; top: 0; cursor: nesw-resize; }
.pv-selhandle--se { right: 0; bottom: 0; cursor: nwse-resize; }
.pv-selhandle--sw { left: 0; bottom: 0; cursor: nesw-resize; }
/* the selection box now indicates selection, so drop the node's own outline */
.pv-drag.is-selected::after { border-color: transparent; background: transparent; }

/* dimmed when the current scrubber playhead is outside an element's timing window */
.pv-time-off { opacity: .16; }

/* realReel letterbox bands — a to-scale "how much to show" guide over the live
   reel; sit under the draggable overlays. Depict pixels, so literal black. */
.pv-rr-band { position: absolute; left: 0; right: 0; background: #000; z-index: 0; pointer-events: none; }
.pv-rr-band--top { top: 0; }
.pv-rr-band--bottom { bottom: 0; }

/* preview edit toolbar actions (Add text · Reset) */
.pv-edit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* timeline scrubber — only shown when an element has a non-default appearance window */
.pv-scrub { margin-top: 12px; }
.pv-scrub[hidden] { display: none; }
.pv-scrub-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.pv-scrub-label { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pv-scrub-cap { font-size: .66rem; color: var(--ink-2); letter-spacing: .04em; }
.pv-scrub-range { width: 100%; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pv-scrub-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* ── cost bar ─────────────────────────────────────────────────────────────── */
.costbar {
  position: fixed; left:0; right:0; bottom: 20px; z-index: 50;
  display:flex; justify-content:center; pointer-events:none;
  animation: cost-in .35s var(--ease-out);
}
/* author display:flex above would otherwise beat the UA [hidden] rule — restore it
   so the progress takeover (which sets costbar.hidden) actually drops the bar */
.costbar[hidden] { display: none; }
@keyframes cost-in { from { transform: translateY(140%); opacity:0; } to { transform:none; opacity:1; } }
.costbar-wrap {
  pointer-events:auto;
  display:flex; align-items:center; gap: 16px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  backdrop-filter: blur(16px); background: var(--bg-2);
  box-shadow: var(--shadow);
}
.cost-action { display:flex; align-items:center; gap: 16px; }
/* when there's a message it gets breathing room from the pill edge; when it's
   empty (early steps) it collapses so the lone Continue button stays centred */
.cost-msg { font-size:.82rem; color: var(--warn); text-align:right; white-space:nowrap; padding-left: 14px; }
.cost-msg:empty { display: none; }
.cost-msg.is-bad { color: var(--bad); }

/* ── progress takeover ────────────────────────────────────────────────────── */
.prog-top { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom: 22px; flex-wrap:wrap; }
.prog-title h3 { margin-bottom: 4px; }
.prog-meta { font-family: var(--mono); font-size:.78rem; color: var(--ink-3); letter-spacing:.04em; }
.prog-overall { margin: 18px 0 28px; }
.prog-overall .bar { height: 6px; }
.prog-overall-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.prog-overall-row .mono { color: var(--ink); font-size:.85rem; }

.item-row {
  display:grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items:center;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-main { min-width:0; }
.item-label { font-weight:560; letter-spacing:-.01em; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.item-detail { font-size:.78rem; color: var(--ink-3); font-family: var(--mono); margin-top: 3px; letter-spacing:.02em; }
.item-bar { grid-column: 1 / -1; margin-top: 6px; }
.item-right { display:flex; align-items:center; gap:10px; justify-self:end; }
.cached-tag { font-family: var(--mono); font-size:.62rem; letter-spacing:.1em; text-transform:uppercase; color: var(--ink-3); border:1px solid var(--line); border-radius: var(--r-pill); padding:.2em .55em; }
.item-dur { font-family: var(--mono); color: var(--ink-2); margin-left:.7em; }

/* expandable finished reel → inline render + chosen settings */
.item-row--expandable { cursor: pointer; }
.item-row--expandable:hover .item-label { color: var(--ink); }
.item-row--expandable:focus-visible { outline: 1px solid var(--line-2); outline-offset: 4px; border-radius: var(--r-sm); }
.item-chev {
  width: 9px; height: 9px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); margin-left: 2px; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.item-row--expandable:hover .item-chev { border-color: var(--ink); }
.item-row.is-open .item-chev { transform: rotate(225deg); }

.item-panel {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--t) var(--ease);
}
.item-panel-inner { overflow: hidden; min-height: 0; }
.item-row.is-open .item-panel { grid-template-rows: 1fr; }
.item-row.is-open .item-panel-inner { padding-top: 16px; }

.item-render { display:flex; justify-content:center; background:#000; border:1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item-video { display:block; width:auto; max-width:100%; max-height: 460px; background:#000; }

.item-settings-head { font-family: var(--mono); font-size:.66rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-3); margin: 18px 0 10px; }
.item-settings { display:grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--line); border:1px solid var(--line); border-radius: var(--r); overflow:hidden; }
.iset { display:flex; flex-direction:column; gap: 3px; padding: 11px 13px; background: var(--bg-1); }
.iset-k { font-family: var(--mono); font-size:.6rem; letter-spacing:.12em; text-transform:uppercase; color: var(--ink-3); }
.iset-v { font-size:.86rem; color: var(--ink); letter-spacing:-.01em; }

/* ── report a problem (under each finished reel) ───────────────────────────── */
.item-report { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.item-report-trigger {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit;
  font-size: .8rem; color: var(--ink-3); letter-spacing: .01em;
  transition: color var(--t-fast) var(--ease);
}
.item-report-trigger:hover { color: var(--warn); }
.item-report-form { display:flex; flex-direction:column; gap: 10px; }
.item-report-input {
  width:100%; resize: vertical; background: var(--bg-1); color:#fff; font: inherit; font-size:.85rem;
  border:1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px;
}
.item-report-input:focus { outline: none; border-color: var(--warn); }
.item-report-actions { display:flex; gap: 8px; }
.item-report-done { font-size: .82rem; color: var(--good); letter-spacing: .01em; }

/* ── history ──────────────────────────────────────────────────────────────── */
.hist-list { display:flex; flex-direction:column; gap: 10px; }
.hist-row {
  display:grid; grid-template-columns: 1fr auto auto; gap: 8px 20px; align-items:center;
  background: var(--bg-1); border:1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; cursor:pointer; font: inherit; color: inherit; text-align:left; width:100%;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.hist-row:hover { border-color: var(--line-2); background: var(--bg-2); }
.hist-row .ht { font-weight:600; letter-spacing:-.01em; }
.hist-row .hsub { font-family: var(--mono); font-size:.74rem; color: var(--ink-3); letter-spacing:.04em; margin-top:3px; }
.hist-row .hready { font-family: var(--mono); font-size:.82rem; color: var(--ink-2); white-space:nowrap; }
.hist-row .hcred { font-family: var(--mono); font-size:.82rem; color: var(--ink-3); white-space:nowrap; }
.detail-back { margin-bottom: 18px; }
/* Edits library rows aren't clickable as a whole (the actions are the buttons),
   so neutralize the history-row pointer affordance. */
.hist-row--static { cursor: default; grid-template-columns: 1fr auto; }
.hist-row--static:hover { border-color: var(--line); background: var(--bg-1); }

/* ── wallet ───────────────────────────────────────────────────────────────── */
.wallet-grid { display:grid; grid-template-columns: minmax(0,1fr); gap: 22px; }
.balance-card { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.balance-big { display:flex; flex-direction:column; gap: 2px; }
.balance-num { font-size: clamp(2.6rem, 7vw, 4rem); font-weight:780; letter-spacing:-.04em; line-height:1; }
.balance-cap { font-family: var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-3); }
.balance-note { font-size:.82rem; color: var(--ink-3); }

.packs { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 14px; }
.pack {
  background: var(--bg-1); border:1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; display:flex; flex-direction:column; gap: 4px;
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.pack:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pack.is-featured { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset, var(--shadow); }
.pack-flag { align-self:flex-start; font-family: var(--mono); font-size:.6rem; letter-spacing:.14em; text-transform:uppercase; background: var(--solid); color: var(--solid-ink); padding:.25em .6em; border-radius: var(--r-pill); margin-bottom: 6px; }
.pack-label { font-family: var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-3); }
.pack-credits { font-size: 2rem; font-weight:740; letter-spacing:-.03em; }
.pack-credits small { font-size:.95rem; font-weight:500; color: var(--ink-3); letter-spacing:0; }
.pack-price { font-family: var(--mono); color: var(--ink-2); font-size:.9rem; margin: 2px 0 16px; }
.pack .btn { margin-top: auto; }

.custom-topup { display:flex; align-items:flex-end; gap: 12px; flex-wrap:wrap; }
.custom-topup .field { flex: 1 1 160px; min-width: 140px; }
.custom-topup .ct-price { font-family: var(--mono); color: var(--ink-3); font-size:.82rem; padding-bottom:.9em; }

.pay-off { display:flex; align-items:center; gap:10px; color: var(--ink-3); font-size:.9rem; padding: 12px 0; }

.ledger-empty { color: var(--ink-3); font-size:.9rem; padding: 14px 0; }
.led-delta { font-family: var(--mono); font-weight:600; }
.led-delta.pos { color: var(--good); }
.led-delta.neg { color: var(--ink-2); }

/* ── settings ─────────────────────────────────────────────────────────────── */
/* settings live below the credits on the wallet page — set off with a rule */
.settings-section { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.settings-kicker { margin-bottom: 16px; }
.settings-grid { display:grid; gap:18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 760px; }
.settings-card { display:flex; flex-direction:column; gap:18px; }
.settings-row-text h3 { margin-bottom:6px; }
.settings-row-text p { font-size:.9rem; }

.theme-choice { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.theme-opt {
  position:relative; display:flex; flex-direction:column; gap:10px; align-items:flex-start;
  text-align:left; cursor:pointer; font:inherit; color:var(--ink-2);
  background:var(--bg-1); border:1px solid var(--line); border-radius:var(--r); padding:14px;
  transition:all var(--t-fast) var(--ease);
}
.theme-opt:hover { border-color:var(--line-2); }
.theme-opt.is-on { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; color:var(--ink); }
.theme-opt-name { font-weight:600; font-size:.92rem; }
.theme-opt-check {
  position:absolute; top:12px; right:12px; width:18px; height:18px; border-radius:50%;
  border:1px solid var(--line-2); display:grid; place-items:center;
}
.theme-opt.is-on .theme-opt-check { background:var(--accent); border-color:var(--accent); }
.theme-opt.is-on .theme-opt-check::after { content:"✓"; color:#fff; font-size:.7rem; line-height:1; }

/* mini theme preview swatch: a tiny window of the theme it represents */
.theme-swatch { width:100%; height:62px; border-radius:8px; padding:9px; display:flex; flex-direction:column; gap:5px; justify-content:center; overflow:hidden; }
.theme-swatch--light { background:#f4f4f5; border:1px solid #e7e7ea; }
.theme-swatch--dark  { background:#0a0a0b; border:1px solid #2a2a2d; }
.theme-swatch .ts-card { height:14px; border-radius:4px; }
.theme-swatch--light .ts-card { background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.08); }
.theme-swatch--dark  .ts-card { background:#161618; }
.theme-swatch .ts-bar { height:6px; width:60%; border-radius:3px; }
.theme-swatch--light .ts-bar { background:#d7d7dc; }
.theme-swatch--dark  .ts-bar { background:#3a3a40; }
.theme-swatch .ts-bar--accent { width:38%; background:#ef4444 !important; }

.theme-switch { align-self:flex-start; }
.settings-actions { display:flex; gap:10px; }

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .wizard-main { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .pv-screen { max-width: 320px; margin-inline: auto; }
  .wizard-steps { flex-wrap: wrap; }
  .wizard-step-line { display: none; }
  .wizard-step { flex: 1 1 auto; }
}
@media (max-width: 760px) {
  .nav .wrap { gap: 8px; }
  /* drop the absolute centering on narrow screens — let flex space-between lay
     out brandmark · links · right-side without overlap */
  .nav-links { position: static; left: auto; transform: none; gap: 0; }
  .nav-links a { padding: .5em .55em; font-size:.85rem; }
  .nav-right .btn { display:none; }
  .filters { grid-template-columns: 1fr; gap: 16px; }
  .costbar { left: 12px; right: 12px; }
  .costbar-wrap { width: 100%; justify-content: space-between; padding-left: 18px; }
  .cost-action { justify-content: space-between; flex: 1; }
  .cost-msg { white-space: normal; }
  .cost-action .btn { flex: 0 0 auto; }
  .hist-row { grid-template-columns: 1fr auto; }
  .hist-row .hcred { grid-column: 2; }
}
@media (max-width: 460px) {
  .match-list { grid-template-columns: 1fr; }
  .item-right .btn { padding:.5em .8em; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PUBLISH — Instagram (connect · compose · insights · comments)
   Brand tokens only, so the whole view re-skins with [data-theme].
   ══════════════════════════════════════════════════════════════════════════ */

.ig-glyph { display: inline-flex; align-items: center; }
.ig-glyph svg { width: 1.15em; height: 1.15em; display: block; }

/* ── connect (not yet linked) ─────────────────────────────────────────────── */
.ig-connect { text-align: center; max-width: 560px; margin-inline: auto; padding: clamp(28px, 5vw, 44px); }
.ig-connect-mark {
  width: 60px; height: 60px; margin: 0 auto 18px; display: grid; place-items: center;
  border-radius: var(--r-lg); background: var(--accent-weak); color: var(--accent-strong);
}
.ig-connect-mark .ig-glyph svg { width: 30px; height: 30px; }
.ig-connect h3 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .4em; }
.ig-connect > .muted { margin: 0 auto 22px; max-width: 44ch; line-height: 1.6; }

.ig-scopes { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ig-scopes li { background: var(--bg-1); padding: .8em 1em; display: grid; gap: 2px; }
.ig-scopes li b { font-size: .82rem; font-weight: 600; color: var(--ink); }
.ig-scopes li span { font-size: .82rem; color: var(--ink-3); line-height: 1.45; }

.ig-connect-btn { display: inline-flex; align-items: center; gap: .55em; }
.ig-fineprint { margin: 16px 0 0; font-size: .78rem; color: var(--ink-3); }

/* ── connected account header ─────────────────────────────────────────────── */
.ig-account {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px;
  margin-bottom: 18px;
}
.ig-avatar { width: 56px; height: 56px; border-radius: var(--r-pill); object-fit: cover; border: 1px solid var(--line-2); }
.ig-avatar--empty { display: grid; place-items: center; background: var(--bg-1); color: var(--ink-3); }
.ig-handle { display: flex; align-items: center; gap: .55em; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.ig-sub { font-size: .82rem; margin-top: 2px; }

.ig-stats { display: flex; gap: 22px; }
.ig-stat { display: grid; text-align: right; }
.ig-stat b { font-size: 1.05rem; font-weight: 700; }
.ig-stat span { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }

.ig-account-insights {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line);
}
.ig-insights-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-right: 4px; }
.ig-chip { font-size: .8rem; color: var(--ink-2); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .34em .8em; }
.ig-chip b { color: var(--ink); font-weight: 700; }

/* ── two-column body ──────────────────────────────────────────────────────── */
.ig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ── composer ─────────────────────────────────────────────────────────────── */
.ig-composer h3, .ig-posts h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .3em; letter-spacing: -.01em; }
.ig-composer-sub { font-size: .85rem; margin: 0 0 16px; }

.ig-reel-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 16px; }
.ig-reel {
  flex: 0 0 auto; text-align: left; cursor: pointer; min-width: 160px; max-width: 220px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
  padding: .7em .9em; transition: border-color .15s, background .15s;
}
.ig-reel:hover { border-color: var(--line-2); }
.ig-reel.is-active { border-color: var(--accent); background: var(--accent-weak); }
.ig-reel-title { font-size: .85rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-reel-sub { font-size: .75rem; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-reel.is-active .ig-reel-title { color: var(--accent-strong); }

.ig-composer-body { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
/* The preview shows the burned MP4 — literal black letterbox, not a themed surface. */
.ig-preview-wrap { background: #000; border-radius: var(--r); overflow: hidden; aspect-ratio: 9 / 16; }
.ig-preview { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

.ig-compose-fields { display: grid; gap: 10px; }
.ig-caption {
  width: 100%; resize: vertical; font: inherit; font-size: .88rem; line-height: 1.5;
  background: var(--bg-1); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r); padding: .75em .9em;
}
.ig-caption:focus { outline: none; border-color: var(--accent); }
.ig-count { font-size: .7rem; color: var(--ink-3); text-align: right; margin-top: -6px; }

.ig-toggle { display: flex; align-items: center; gap: .5em; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.ig-toggle input { accent-color: var(--accent); }

.ig-publish-status { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; font-size: .82rem; min-height: 1.2em; }
.ig-permalink { color: var(--accent-strong); font-size: .82rem; font-weight: 600; text-decoration: none; }
.ig-permalink:hover { text-decoration: underline; }

/* ── published list ───────────────────────────────────────────────────────── */
.ig-post-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ig-post { background: var(--bg-1); }
.ig-post-head {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: .85em 1em; background: none; border: 0; cursor: pointer; text-align: left; color: inherit;
}
.ig-post-head:hover { background: var(--bg-2, var(--bg-1)); }
.ig-post-cap { font-size: .87rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-post-sub { font-size: .75rem; margin-top: 2px; }
.ig-post.is-open .ig-post-head { border-bottom: 1px solid var(--line); }
.ig-post-error { padding: 0 1em .9em; font-size: .8rem; color: var(--bad); }
.ig-post-panel { padding: 14px 1em 16px; }

.ig-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ig-panel-head h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); color: var(--ink-3); font-weight: 600; margin: 0; }

.ig-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ig-metric { background: var(--raised); padding: .7em .8em; display: grid; gap: 2px; }
.ig-metric b { font-size: 1rem; font-weight: 700; color: var(--ink); }
.ig-metric span { font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-family: var(--mono); }

.ig-comments { margin-top: 18px; }
.ig-comment { padding: .7em 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.ig-comment:first-of-type { border-top: 0; }
.ig-comment.is-hidden { opacity: .5; }
.ig-comment-who { font-size: .78rem; font-weight: 600; color: var(--ink); }
.ig-comment-who .muted { font-weight: 400; }
.ig-comment-text { font-size: .85rem; color: var(--ink-2); line-height: 1.5; margin-top: 2px; }
.ig-comment-actions { display: flex; gap: 6px; }
.ig-comment--reply { grid-column: 1 / -1; margin-left: 20px; padding-left: 12px; border-top: 0; border-left: 2px solid var(--line-2); }
.ig-reply-box { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.ig-reply-input {
  flex: 1; font: inherit; font-size: .85rem; background: var(--raised); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: .55em .75em;
}
.ig-reply-input:focus { outline: none; border-color: var(--accent); }

@media (max-width: 980px) {
  .ig-grid { grid-template-columns: 1fr; }
  .ig-account { grid-template-columns: auto 1fr; row-gap: 14px; }
  .ig-stats { grid-column: 1 / -1; justify-content: flex-start; }
  .ig-stat { text-align: left; }
}
@media (max-width: 560px) {
  .ig-composer-body { grid-template-columns: 1fr; }
  .ig-preview-wrap { max-width: 180px; margin-inline: auto; }
}
