/* Layout: one column. Setup (topic, length, drop) → queue of videos → the open video: player + timeline strip,
   editor's notes, every phrase as a keep/cut line, then the Final Cut export. BHH black, orange, navy. */
:root {
  --ink: #0B0B0C; --panel: #141519; --panel-2: #1A1C22; --line: #262833;
  --navy: #1B2A4C; --navy-hi: #3A5594; --navy-text: #C4CCE0;
  --cream: #F4F1EB; --muted: #A3A1AB; --cut: #3A3B42;
  --orange: #ED7333; --orange-dim: #5a2f17; --danger: #E5484D;
  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0; background: var(--ink); color: var(--cream); font-family: var(--body); font-size: 15px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: max(20px, env(safe-area-inset-top, 0px)) 56px;
}
[hidden] { display: none !important; }
.wrap { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, .drop:focus-within { outline: 2px solid var(--orange); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.mark { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 8vw, 54px); line-height: .95; text-transform: uppercase; margin: 0; }
.mark b { font-weight: 400; color: var(--orange); }
.sub { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.sub span:first-child { font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: 16px; color: var(--muted); }
.term { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.setup { background: var(--navy); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-text); }
select, input[type=text], input:not([type]) {
  font: inherit; color: var(--cream); background: #101a31; border: 1px solid var(--navy-hi); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
.export input { background: var(--panel-2); border-color: var(--line); font-family: var(--mono); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--navy-hi); color: var(--navy-text); font-size: 14px; }
.chips button[aria-checked=true] { background: var(--orange); border-color: var(--orange); color: var(--ink); font-weight: 700; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 16px; border: 2px dashed var(--navy-hi); border-radius: 12px; cursor: pointer; background: #142140; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.over { border-color: var(--orange); background: #1f2a45; }
.drop-big { font-family: var(--display); font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
.drop-small { font-size: 13px; color: var(--navy-text); max-width: 52ch; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.sec-head h2, .export h3 { font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; margin: 0; }
#queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.q.active { border-color: var(--orange); }
.q-open { text-align: left; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-name { font-weight: 700; overflow-wrap: anywhere; }
.q-meta { font-size: 13px; color: var(--muted); }
.q-bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--orange); width: 0; transition: width .3s; }
.pill { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.pill.work { border-color: var(--navy-hi); color: var(--navy-text); }
.pill.ready { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.pill.err { border-color: var(--danger); color: var(--danger); }
.q-err { grid-column: 1 / -1; font-size: 13px; color: var(--danger); }

.result { display: flex; flex-direction: column; gap: 16px; }
.res-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.res-title { min-width: 0; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); }
.res-head h2 { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.05; text-transform: uppercase; margin: 2px 0 0; overflow-wrap: anywhere; }
.tally { display: flex; gap: 8px; }
.tally div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.tally b { display: block; font-family: var(--mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.tally b.o { color: var(--orange); }
.tally span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.player { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
video { width: 100%; max-height: 52vh; background: #000; border-radius: 8px; display: block; }
.player-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg button { padding: 6px 12px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--orange); color: var(--ink); font-weight: 700; }
.strip { position: relative; height: 44px; border-radius: 8px; background: var(--cut); cursor: pointer; overflow: hidden; touch-action: none; }
.strip .k { position: absolute; top: 12px; bottom: 0; background: var(--orange); }
.strip .p { position: absolute; top: 2px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--navy-text); box-shadow: 0 0 0 2px var(--navy); }
.strip .h { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--cream); }
.strip .ph { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .k { background: var(--orange); } .legend .c { background: var(--cut); } .legend .p { background: var(--navy-text); border-radius: 50%; } .legend .h { background: var(--cream); width: 3px; }

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.note { background: var(--navy); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.note h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--navy-text); font-weight: 500; }
.note p, .note ul { margin: 0; }
.note ul { padding-left: 18px; }
.note .quote { font-weight: 700; }
.note button { margin-top: 8px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--orange); }

.tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tick { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.tick input { width: 18px; height: 18px; accent-color: var(--orange); }
.ghost { border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 14px; }
.ghost:hover { border-color: var(--navy-hi); }
.go { background: var(--orange); color: var(--ink); font-weight: 700; border-radius: 10px; padding: 11px 18px; }

.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ln { display: grid; grid-template-columns: 92px 1fr auto; gap: 4px 12px; align-items: start; padding: 8px 10px; border-radius: 10px; background: var(--panel); border-left: 3px solid var(--orange); }
.ln.cut { background: transparent; border-left-color: var(--cut); }
.ln.cut .tx { color: var(--muted); text-decoration: line-through; text-decoration-color: #5b5c66; }
.ln.now { box-shadow: inset 0 0 0 1px var(--navy-hi); }
.tc { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; text-align: left; }
.tc:hover { color: var(--cream); }
.tx { min-width: 0; overflow-wrap: anywhere; }
.flip { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--orange); color: var(--orange); white-space: nowrap; }
.ln.cut .flip { border-color: var(--line); color: var(--muted); }
.why { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
.why b { color: var(--cream); font-weight: 500; }
.add { grid-column: 2 / -1; font-size: 13px; color: var(--navy-text); display: flex; gap: 8px; align-items: baseline; }
.add::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--navy-text); transform: translateY(-1px); }
.add b { color: var(--cream); font-weight: 500; }
.hooktag { grid-column: 2 / -1; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cream); }

.export { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.export .lbl { color: var(--muted); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.how { margin: 4px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.how b { color: var(--cream); font-weight: 500; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--cream); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); }
.foot { font-size: 12px; }

@media (max-width: 560px) {
  .ln { grid-template-columns: 1fr auto; }
  .tc { grid-column: 1 / -1; }
  .why, .add, .hooktag { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
