/* SalesVidGen — Premium v3 step ⑤ Storyboard + step ⑥ Film. The storyboard reads like a director's board:
   tall 9:16 frames in scene order, each numbered in the display face with its place, what we see and the
   presenter's line underneath. One moving thing only: the frame being drawn (a light sweep across a
   framing grid) and the frame being checked (a scan line). App theme tokens only, so every theme carries
   over. Colour carries meaning: accent = drawing, yellow = look again, red = could not be made, green = saved. */

.bd-root { display: grid; gap: 1.6rem; font-variant-numeric: lining-nums; }
.bd-status { display: grid; gap: 0.7rem; justify-items: start; }
.bd-status:empty { display: none; }
.bd-intro { font-family: var(--font-display); font-size: clamp(1.15rem, 3.2vw, 1.4rem); line-height: 1.35; color: var(--text-primary); max-width: 34ch; }
.bd-draw { padding: 0.8rem 1.4rem; font-variant-numeric: lining-nums; }
.bd-line { color: var(--text-secondary); font-size: 0.93rem; line-height: 1.5; max-width: 62ch; }
.bd-line.is-ok { color: var(--success); font-weight: 600; }
.bd-line.is-ok::before { content: '✓ '; }
.bd-line.is-bad { color: var(--error); font-weight: 600; }
.bd-line.is-warn { color: var(--text-primary); padding-left: 0.6rem; border-left: 3px solid var(--warning); }
.bd-msg { color: var(--error); font-size: 0.84rem; line-height: 1.45; }

/* Needs a look · All: one quiet two-way switch over the board; the amber dot is the warnings' colour. */
.bd-filter-slot:empty { display: none; }
.bd-filter { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 999px; }
.bd-filter-btn { min-height: 36px; padding: 0.4rem 0.95rem; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-variant-numeric: lining-nums tabular-nums; }
.bd-filter-btn:hover { color: var(--text-primary); }
.bd-filter-btn[aria-pressed="true"] { background: var(--bg-surface); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bd-filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bd-filter-btn.is-look::before { content: ''; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.45rem; border-radius: 50%; background: var(--warning); }

/* ---------- The board ---------- */
.bd-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.8rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.bd-tile { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.bd-pic { position: relative; aspect-ratio: 9 / 16; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--bg-surface); }
.bd-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bd-chip { position: absolute; left: 0.5rem; bottom: 0.5rem; z-index: 2; padding: 0.22rem 0.6rem; border-radius: 999px; background: var(--bg-base); color: var(--text-primary); font-size: 0.75rem; font-weight: 700; line-height: 1.3; }
.bd-tile.is-done .bd-chip { display: none; }
.bd-tile.is-none .bd-pic, .bd-tile.is-waiting .bd-pic { border-style: dashed; border-color: var(--border-strong); background: transparent; }
.bd-tile.is-waiting .bd-chip { color: var(--text-tertiary); }
.bd-tile.is-failed .bd-pic { border-color: var(--error); background: var(--error-bg); }
.bd-tile.is-failed .bd-chip { color: var(--error); }

/* The frame being drawn: thirds grid of a camera frame + a slow light sweep. */
.bd-tile.is-working .bd-pic, .bd-tile.is-redrawing .bd-pic {
  border-color: var(--accent);
  background:
    linear-gradient(90deg, transparent calc(33.33% - 0.5px), var(--border-strong) calc(33.33% - 0.5px), var(--border-strong) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px),
      transparent calc(66.66% - 0.5px), var(--border-strong) calc(66.66% - 0.5px), var(--border-strong) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    linear-gradient(180deg, transparent calc(33.33% - 0.5px), var(--border-strong) calc(33.33% - 0.5px), var(--border-strong) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px),
      transparent calc(66.66% - 0.5px), var(--border-strong) calc(66.66% - 0.5px), var(--border-strong) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    var(--accent-subtle);
}
.bd-tile.is-working .bd-pic::after, .bd-tile.is-redrawing .bd-pic::after {
  content: ''; position: absolute; inset: -10% -60%; z-index: 1;
  background: linear-gradient(105deg, transparent 38%, var(--accent-subtle) 46%, var(--bg-base) 50%, var(--accent-subtle) 54%, transparent 62%);
  opacity: 0.55; animation: bdSweep 2.6s var(--ease, ease-in-out) infinite;
}
.bd-tile.is-working .bd-chip { color: var(--accent); }
.bd-tile.is-redrawing .bd-chip, .bd-tile.is-checking .bd-chip { color: var(--warning); }
.bd-tile.is-working .bd-pic img, .bd-tile.is-redrawing .bd-pic img { opacity: 0.45; }
/* The frame being checked: a thin line reads the picture top to bottom. */
.bd-tile.is-checking .bd-pic { border-color: var(--warning); }
.bd-tile.is-checking .bd-pic::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 1;
  background: var(--warning); box-shadow: 0 0 12px 2px var(--warning-bg); animation: bdScan 1.8s linear infinite;
}
@keyframes bdSweep { from { transform: translateX(-35%); } to { transform: translateX(35%); } }
@keyframes bdScan { from { top: 0; } to { top: calc(100% - 2px); } }

/* Words under each frame */
.bd-text { display: grid; gap: 0.3rem; align-content: start; min-width: 0; }
.bd-where { display: flex; align-items: baseline; gap: 0.55rem; margin: 0 0 0.15rem; min-width: 0; }
.bd-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.bd-place { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); overflow-wrap: anywhere; }
.bd-k { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--text-tertiary); }
.bd-see { font-size: 0.88rem; line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.bd-says { font-family: var(--font-display); font-style: italic; font-size: 0.98rem; line-height: 1.45; color: var(--text-primary); overflow-wrap: anywhere; }
.bd-says::before { content: '“'; }
.bd-says::after { content: '”'; }

/* Check results (the warnings are the Director's check, premium-preview.css) + out of date */
.bd-tile.is-look .bd-pic { border-color: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.bd-unchecked { justify-self: start; margin-top: 0.4rem; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-tertiary); font-size: 0.75rem; font-weight: 600; }
.bd-quiet { margin-top: 0.3rem; font-size: 0.78rem; color: var(--text-tertiary); line-height: 1.4; }
.bd-stale { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.4rem; }
.bd-stale-badge { padding: 0.18rem 0.6rem; border-radius: 999px; background: var(--warning-bg); border: 1px solid var(--warning); color: var(--text-primary); font-size: 0.75rem; font-weight: 700; }

/* Change picture + Pro prompt */
.bd-change-open { justify-self: start; margin-top: 0.5rem; }
.bd-change { display: grid; gap: 0.45rem; margin-top: 0.5rem; padding: 0.7rem; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-surface); }
.bd-label { margin: 0; text-transform: none; letter-spacing: normal; font-size: 0.84rem; font-weight: 600; color: var(--text-primary); }
.bd-change textarea, .bd-pro textarea { width: 100%; resize: vertical; font-size: 0.88rem; }
.bd-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bd-pro { margin-top: 0.5rem; border-top: 1px solid var(--border-color); padding-top: 0.45rem; }
.bd-pro summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); padding: 0.2rem 0; }
.bd-pro summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bd-pro[open] { display: grid; gap: 0.45rem; }
.bd-pro textarea { min-height: 7rem; font-family: inherit; line-height: 1.45; }
.bd-pro textarea[readonly] { opacity: 0.75; }
.bd-pro-go { justify-self: start; }

/* Draw all again — small on purpose, with a confirm because it replaces every picture */
.bd-foot { padding-top: 1.1rem; border-top: 1px solid var(--border-color); }
.bd-foot:empty { display: none; }
.bd-again { border: 0; background: none; padding: 0.2rem 0; font: inherit; font-size: 0.86rem; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-variant-numeric: lining-nums; }
.bd-again:hover { color: var(--text-primary); }
.bd-again:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bd-confirm { display: grid; gap: 0.6rem; max-width: 34rem; padding: 0.8rem 0.9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.bd-confirm p { font-size: 0.9rem; line-height: 1.5; color: var(--text-primary); }

/* ---------- ⑥ Film (until filming ships) ---------- */
.pf-panel { display: grid; gap: 1.1rem; justify-items: start; padding: 1.6rem 1.4rem; border: 1px solid var(--border-color); border-left: 3px solid var(--success); border-radius: var(--radius-sm); background: var(--bg-surface); }
.pf-line { font-family: var(--font-display); font-size: clamp(1.2rem, 3.4vw, 1.5rem); line-height: 1.4; color: var(--text-primary); max-width: 32ch; }
.pf-strip { list-style: none; margin: 0; padding: 0 0 0.3rem; display: flex; gap: 0.45rem; max-width: 100%; overflow-x: auto; }
.pf-strip li { flex: 0 0 auto; }
.pf-strip img { display: block; width: 54px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.pf-sub { font-size: 0.88rem; color: var(--text-secondary); font-variant-numeric: lining-nums tabular-nums; }

/* Change picture, two ways (PV.picMode, premiumStepBoardPro.js): one stacked list, the picked way lit; Change scenes too */
.pm-ways { display: grid; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; min-width: 0; }
.pm-way { position: relative; display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0.55rem; align-items: start; margin: 0;
  padding: 0.6rem 0.7rem; min-height: 44px; cursor: pointer; font-weight: 400; text-transform: none; letter-spacing: normal; }
.pm-way + .pm-way { border-top: 1px solid var(--border-strong); }
.pm-way input { margin: 0.15rem 0 0; width: 1rem; height: 1rem; accent-color: var(--accent); cursor: pointer; }
.pm-way-body { display: grid; gap: 0.1rem; min-width: 0; }
.pm-way-body strong { font-size: 0.86rem; color: var(--text-primary); }
.pm-way-body span { font-size: 0.78rem; line-height: 1.4; color: var(--text-secondary); overflow-wrap: anywhere; }
.pm-way:has(input:checked) { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
.pm-way:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.pm-hint, .pm-note { margin: 0; font-size: 0.78rem; line-height: 1.45; color: var(--text-tertiary); overflow-wrap: anywhere; }
.pm-note { color: var(--text-secondary); }

/* ---------- Phone: one big picture per row, its words under it ---------- */
@media (max-width: 719px) {
  .bd-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .bd-pic { width: min(100%, calc(72vh * 9 / 16)); }
  .bd-num { font-size: 1.6rem; }
  .bd-filter-btn { min-height: 40px; }
  .bd-draw { width: 100%; justify-content: center; }
  .pf-panel { padding: 1.2rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bd-tile .bd-pic::after { animation: none !important; }
  .bd-tile.is-checking .bd-pic::after { top: 50%; }
}
