/* Create screen (docs/design/SPEC.md section 7). Components live in css/app.css; this file lays them
   out and adds the script-only pieces: radio lists, idea cards, timeline, fill-in chips, action bar.
   .radio-list and the status / slot chips are also used by the Plan screen. */

.create-step { animation: rise-in var(--dur-3) var(--ease-out); }
.back-link { align-self: flex-start; margin-left: calc(-1 * var(--sp-1)); }
.saved-link { align-self: flex-start; }

/* ---------- radio lists (format picker, day picker, idea picker, post picker) ---------- */

.radio-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.radio-list .radio-card { cursor: pointer; }
.radio-card-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; }
.radio-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.format-icon { color: var(--op-navy); }
.format-list .radio-card-body { flex-wrap: nowrap; align-items: flex-start; }
@container (min-width: 520px) {
  .format-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.day-list .radio-card { min-height: var(--tap); align-items: center; padding: var(--sp-2) var(--sp-3); }
.day-list .radio-card-body { justify-content: space-between; }
.day-name { font-weight: 700; }
.post-picker .post { border: 0; padding: 0; }
.post-picker .radio-card { padding: var(--sp-3); }

.slot-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 32px; padding: 2px 10px;
  border-radius: var(--r-pill); background: var(--surface); color: var(--op-navy); font-size: var(--fs-small); font-weight: 700;
}
.status-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border-radius: var(--r-pill);
  border: 2px solid var(--border); background: var(--card); color: var(--text); font-size: var(--fs-small); font-weight: 700; line-height: 1.2;
}
.status-posted { border-color: var(--op-ok); color: var(--op-ok); }
.status-filmed { border-color: var(--op-navy); color: var(--op-navy); }
.status-skipped { border-style: dashed; color: var(--text-soft); }

/* ---------- pick ---------- */

.sticky-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--sp-2)); z-index: 5;
  padding: var(--sp-2) 0;
}
.sticky-bar .btn { box-shadow: var(--el-2); }

/* ---------- ideas ---------- */

.create-note {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4);
  background: var(--card); border-radius: var(--r-card); border-left: 6px solid var(--op-blue); font-size: var(--fs-small);
}
.create-note > .ico { color: var(--op-blue); }
.create-note-warn { border-left-color: var(--warn); }
.create-note-warn > .ico { color: var(--warn); }
.idea-list, .saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.idea-card, .saved-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.idea-top { display: flex; gap: var(--sp-3); align-items: flex-start; }
.idea-rank { font-family: var(--op-font-heading); font-size: var(--fs-h3); font-weight: 800; color: var(--op-navy); line-height: var(--lh-head); min-width: 1ch; }
.idea-head { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.idea-why { background: var(--surface); border-radius: 8px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); }
.idea-why-label { font-weight: 700; font-size: var(--fs-small); }
.idea-actions { display: flex; flex-direction: column; gap: var(--sp-2); }
.idea-more { align-items: center; }
.saved-actions { gap: var(--sp-2); }
.ideas-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
/* S9 / SPEC 7.5: from 1100 px the pickers (step 1) sit in a left column beside the ideas. The
   column measures itself, so its format list stays one card wide. */
@media (min-width: 1100px) {
  .ideas-layout { display: grid; grid-template-columns: clamp(300px, 38%, 400px) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
  .create-picker.desktop-only { display: flex; flex-direction: column; gap: var(--sp-5); container-type: inline-size; }
  .create-picker .sticky-bar { position: static; padding: 0; }
  .ideas-main { container-type: inline-size; }
}
@container (min-width: 520px) {
  .idea-actions { flex-direction: row; flex-wrap: wrap; }
  .idea-actions .btn-block { width: auto; }
}

/* ---------- script ---------- */

.script-subbar { display: flex; align-items: center; gap: var(--sp-3); margin-top: calc(-1 * var(--sp-3)); }
.subbar-title { font-weight: 700; color: var(--heading); }
.script-layout { display: flex; flex-direction: column; gap: var(--sp-5); }
.script-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.script-hook { font-size: clamp(24px, 20px + 1.2vw, 32px); }
.script-block .card-head h2 { font-size: var(--fs-h3); }
.hook-text { font-weight: 700; margin-top: var(--sp-2); }
.caption-text { white-space: pre-wrap; }

.fill-banner {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4);
  background: var(--card); border-radius: var(--r-card); border-left: 6px solid var(--warn); box-shadow: var(--el-1);
}
.fill-banner > .ico { color: var(--warn); margin-top: 2px; }
.fill-banner-ok { border-left-color: var(--op-ok); }
.fill-banner-ok > .ico { color: var(--op-ok); }
.fill-banner-body { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-3); font-weight: 700; }
.fill-banner-body .btn-quiet { font-size: var(--fs-small); }
.fill-card { scroll-margin-top: calc(var(--header-h) + var(--sp-4)); }
.fill-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-3); }

/* placeholder chip: inline, 32 px tall, tap area padded to 48 px */
.ph {
  position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 0 6px; margin: 0 1px;
  border: 2px dashed var(--op-warn); border-radius: 6px; background: var(--op-paper); color: var(--op-warn);
  font: inherit; font-weight: 700; line-height: 1.2; vertical-align: baseline; text-align: left;
}
button.ph::after { content: ""; position: absolute; inset: -8px -2px; }
.ph-filled { border: 0; border-bottom: 2px solid var(--op-ok); border-radius: 0; padding: 0 2px; color: inherit; background: transparent; font-weight: inherit; }
.ph-static { min-height: 0; padding: 0 4px; }
.band .ph { border-color: #FFFFFF; color: #FFFFFF; background: transparent; }
.band .ph-filled { border-bottom-color: #FFFFFF; }
.band .ph:focus-visible { outline-color: #FFFFFF; }
.stage { font-style: italic; color: var(--text-soft); }
.band .stage { color: var(--op-mist); }

/* timeline */
.tl-bar { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; margin: var(--sp-1) 0 var(--sp-4); }
.tl-seg { display: block; height: 100%; background: var(--op-navy); border-right: 2px solid var(--card); }
.tl-seg:nth-child(even) { background: var(--op-blue); }
.tl-seg:last-child { border-right: 0; }
.beats, .frames { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.beat, .frame { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--sp-3); }
.beat-time { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.time-pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 2px solid var(--op-navy); border-radius: var(--r-pill);
  color: var(--op-navy); font-size: var(--fs-small); font-weight: 700; white-space: nowrap;
}
.beat-rail { flex: 1; width: 2px; min-height: var(--sp-4); margin-left: var(--sp-4); background: var(--op-line-soft); }
.beat-body { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.band {
  align-self: flex-start; max-width: 100%; padding: var(--sp-2) var(--sp-3); border-radius: 8px;
  background: var(--op-navy); color: #FFFFFF; font-weight: 800; line-height: 1.35;
}
.voiceover, .visual-note { display: flex; gap: var(--sp-2); align-items: flex-start; color: var(--text-soft); }
.voiceover .ico, .visual-note .ico { margin-top: 3px; color: var(--op-navy); }
.vo-label { font-weight: 700; }
@media (max-width: 359px) {
  .beat, .frame { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .beat-rail { display: none; }
}
.shots { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--sp-2); }
.on-image h3 { font-size: var(--fs-body); }

.sticker { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3); border-radius: 8px; background: var(--surface); }
.sticker-options { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.sticker-option { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: var(--r-pill); border: 2px solid var(--border); background: var(--card); font-size: var(--fs-small); }
.sticker-correct { border-color: var(--op-ok); color: var(--op-ok); font-weight: 700; }

.best-time { display: flex; gap: var(--sp-2); align-items: flex-start; }
.best-time .ico { color: var(--op-navy); margin-top: 2px; }
.consent-note {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4);
  background: var(--card); border-left: 6px solid var(--op-blue); border-radius: var(--r-card);
}
.consent-note > .ico { color: var(--op-blue); margin-top: 2px; }
.consent-note h2 { font-size: var(--fs-body); margin-bottom: var(--sp-1); }
.claude-block { align-items: flex-start; }
.claude-after { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); font-weight: 700; }
.warn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.warn-list li { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; }
.fill-count-line { font-weight: 700; }
.copy-fallback { min-height: 160px; font-size: var(--fs-small); }

/* action bar: sticky above the bottom nav on phone and tablet, a side column on desktop */
.script-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom)); z-index: 5;
  display: flex; gap: var(--sp-2); align-items: center; container-type: inline-size;
  margin: 0 calc(-1 * var(--gutter)); padding: var(--sp-2) var(--gutter);
  background: var(--card); border-top: 1px solid var(--op-line-soft); box-shadow: var(--el-2);
}
.bar-main { flex: 1 1 auto; min-width: 0; padding: var(--sp-2) var(--sp-4); }
.bar-btn { flex: none; width: var(--tap); padding: 0; border-radius: 50%; }
.bar-btn .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@container (max-width: 359px) { .bar-opt { display: none; } }
@media (min-width: 600px) {
  .script-bar { margin: 0; border-radius: var(--r-card); border-top: 0; }
  .bar-btn { width: auto; min-width: 72px; flex-direction: column; gap: 0; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-control); font-size: 14px; }
  .bar-btn .btn-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
}
@media (min-width: 1100px) {
  .script-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .script-bar {
    position: sticky; top: calc(var(--header-h) + var(--sp-4)); bottom: auto;
    flex-direction: column; align-items: stretch; padding: var(--sp-4); box-shadow: var(--el-1);
  }
  .bar-main { flex: none; }
  .bar-btn { width: 100%; flex-direction: row; justify-content: flex-start; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); font-size: var(--fs-body); }
  .bar-opt { display: inline-flex; }
  .sticky-bar { bottom: var(--sp-4); }
}

/* ---------- print: the script only ---------- */

.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .print-logo { width: 140px; height: auto; }
  .script-subbar, .script-bar, .claude-block, .sticky-bar { display: none !important; }
  .script-layout { display: block; }
  .create-step, .create-script { animation: none; }
  .ph, .ph-filled { border: 0; background: transparent; color: #000000; padding: 0; text-decoration: underline; font-weight: 700; }
  .ph:not(.ph-filled)::before { content: "["; position: static; }
  .ph:not(.ph-filled)::after { content: "]"; position: static; inset: auto; }
  .band { background: transparent; color: #000000; border: 1px solid #000000; }
  .band .ph { color: #000000; }
  .tl-bar { display: none; }
  .fill-empty { display: none; }
  .print-footer { margin-top: 12pt; font-size: 10pt; color: #333333; }
}
