/* Reel editor: clip bin, player + trim strip, beat timeline. Builds on app.css tokens. */
.rl { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.rl-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rl-back { color: var(--ink-2); text-decoration: none; font-size: 13px; }
.rl-name { background: none; border: 1px solid transparent; border-radius: 6px; color: var(--ink); font: 500 20px var(--serif); padding: 4px 8px; min-width: 120px; width: 260px; }
.rl-name:hover, .rl-name:focus { border-color: var(--line-2); outline: none; }
.rl-spacer { flex: 1; }
.rl-lbl { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.rl select { background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink); border-radius: 6px; padding: 6px 8px; font: 13px var(--sans); max-width: 220px; }
.rl-startbox { display: flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; }
.rl-sbt { font-size: 12px; color: var(--ink-2); min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.rl-mini { background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink); border-radius: 999px; min-width: 26px; height: 26px; cursor: pointer; font-size: 14px; line-height: 1; }
.rl-mini:hover { border-color: var(--accent); }
.rl-len { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 86px; text-align: right; }
.rl .btn { padding: 8px 16px; }

.rl-main { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; }
.rl-bin { border-right: 1px solid var(--line); display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.rl-binhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 13px; }
.rl-check { display: flex; gap: 6px; align-items: center; color: var(--ink-3); font-size: 12px; }
.rl-bingrid { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 10px 14px; align-content: start; }
.rl-clip { position: relative; height: 0; padding-top: 177.78%; border-radius: 4px; overflow: hidden; background: var(--bg-3); cursor: grab; touch-action: pan-y; user-select: none; }
.rl-clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.rl-clip.used { opacity: .45; }
.rl-clip span { position: absolute; left: 3px; bottom: 3px; font-size: 10px; background: rgba(0, 0, 0, .65); padding: 1px 4px; border-radius: 3px; pointer-events: none; }
.rl-clip button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }

.rl-work { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; min-width: 0; }
.rl-stage { display: flex; justify-content: center; gap: 22px; padding: 12px; min-height: 0; }
.rl-player { height: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; overflow: hidden; position: relative; flex: none; }
.rl-player video { width: 100%; height: 100%; object-fit: cover; }
.rl-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; color: var(--ink-3); font-size: 13px; }
.rl-side { align-self: center; max-width: 300px; display: grid; gap: 10px; }
.rl-side h2 { font: 500 22px var(--serif); margin: 0; }
.rl-muted { color: var(--ink-3); font-size: 12.5px; margin: 0; }
.rl-help { line-height: 1.6; }
.rl-row { display: flex; gap: 8px; align-items: center; }
.rl-row b { min-width: 64px; text-align: center; font-weight: 500; font-size: 13px; }
.rl-kbd { border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; font-size: 11px; color: var(--ink-2); }
.rl-danger { color: var(--danger) !important; }

.rl-trim { padding: 0 14px 8px; }
.rl-strip { position: relative; height: 64px; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; touch-action: none; user-select: none; }
.rl-strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rl-dim { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .62); pointer-events: none; }
.rl-win { position: absolute; top: 0; bottom: 0; border: 2px solid #e9c48f; border-radius: 4px; cursor: grab; }
.rl-win span { position: absolute; top: -1px; left: 4px; font-size: 10.5px; background: #e9c48f; color: #111; padding: 0 5px; border-radius: 0 0 4px 4px; white-space: nowrap; }
.rl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }

.rl-tlwrap { border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; padding: 10px 14px 14px; background: var(--bg-2); }
.rl-tl { display: flex; align-items: stretch; height: 112px; min-width: min-content; }
.rl-slot { position: relative; flex: none; height: 100%; border-radius: 5px; overflow: hidden; background: var(--bg-3) center / cover no-repeat; outline: 1px solid rgba(0, 0, 0, .8); outline-offset: -1px; cursor: grab; touch-action: pan-x; user-select: none; }
.rl-slot.sel { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.rl-slot.over { outline: 2px dashed #fff; outline-offset: -2px; }
.rl-slot.moving { opacity: .35; }
.rl-slot__lbl { position: absolute; left: 4px; top: 4px; font-size: 10.5px; background: rgba(0, 0, 0, .7); padding: 1px 5px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.rl-slot__beats { position: absolute; left: 0; right: 0; bottom: 0; height: 12px; display: flex; pointer-events: none; }
.rl-slot__beats i { flex: 1; border-left: 1px solid rgba(255, 255, 255, .55); background: rgba(0, 0, 0, .35); }
.rl-slot__grip { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; cursor: ew-resize; background: linear-gradient(90deg, transparent, rgba(233, 196, 143, .55)); }
.rl-add { flex: none; width: 120px; margin-left: 8px; border: 1px dashed var(--line-2); border-radius: 5px; display: grid; place-items: center; color: var(--ink-3); font-size: 12px; text-align: center; padding: 6px; }
.rl-add.over { border-color: #fff; color: #fff; }
.rl-ghost { position: fixed; z-index: 100; width: 54px; height: 96px; border-radius: 4px; background: #000 center / cover; pointer-events: none; opacity: .9; box-shadow: 0 8px 24px rgba(0, 0, 0, .6); transform: translate(-50%, -50%); }

.rl-pv { position: fixed; inset: 0; background: rgba(0, 0, 0, .94); display: none; place-items: center; z-index: 50; }
.rl-pv.on { display: grid; }
.rl-pvframe { height: 92vh; height: 92dvh; max-width: 96vw; aspect-ratio: 9 / 16; position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.rl-pvframe video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rl-pvlbl { position: absolute; top: 10px; left: 10px; font-size: 12px; background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 999px; }
.rl-pvbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .15); }
.rl-pvbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.rl-pvclose { position: absolute; top: 14px; right: 16px; }
.rl-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--line-2); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
.rl-toast.on { opacity: 1; }

@media (max-width: 800px) {
  .rl { height: auto; min-height: 100dvh; overflow: auto; }
  .rl-main { grid-template-columns: 1fr; }
  .rl-bin { border-right: 0; border-bottom: 1px solid var(--line); order: 2; }
  .rl-bingrid { grid-template-columns: repeat(5, 1fr); max-height: 38vh; }
  .rl-stage { flex-direction: column; align-items: center; }
  .rl-player { height: 46vh; }
  .rl-help { display: none; }
  .rl-name { width: 150px; font-size: 17px; }
}

/* Song bar: the whole song as a waveform; the gold region is the part the reel uses */
.rl-songrow { display: flex; align-items: flex-start; gap: 10px; padding: 8px 14px 4px; border-bottom: 1px solid var(--line); }
.rl-listen { padding: 8px 12px !important; white-space: nowrap; margin-top: 8px; }
.rl-songcol { flex: 1; min-width: 0; }
.rl-songbar { position: relative; height: 52px; border-radius: 5px; background: var(--bg-3); cursor: pointer; touch-action: none; user-select: none; overflow: visible; }
.rl-songbar canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 5px; }
.rl-songwin { position: absolute; top: -2px; bottom: -2px; min-width: 8px; border: 2px solid #e9c48f; border-radius: 5px; cursor: grab; box-shadow: 0 0 0 9999px rgba(14, 13, 12, .0); }
.rl-songwin span { position: absolute; left: -2px; top: -2px; transform: translateY(-100%); background: #e9c48f; color: #111; font-size: 10.5px; padding: 1px 6px; border-radius: 4px 4px 0 0; white-space: nowrap; display: none; }
.rl-songhead { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; display: none; pointer-events: none; }
.rl-songruler { position: relative; height: 16px; font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rl-songruler i { position: absolute; top: 2px; font-style: normal; transform: translateX(-50%); }
.rl-songruler b { position: absolute; top: 2px; font-weight: 500; color: #e9c48f; transform: translateX(-50%); background: var(--bg); padding: 0 4px; z-index: 1; white-space: nowrap; }

/* render dialog */
.rl-rn { position: fixed; inset: 0; background: rgba(0, 0, 0, .78); display: none; place-items: center; z-index: 55; padding: 16px; }
.rl-rn.on { display: grid; }
.rl-rncard { width: min(460px, 100%); max-height: 94dvh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 20px 22px; display: grid; gap: 10px; }
.rl-rncard h2 { font: 500 24px var(--serif); margin: 0; }
.rl-rncard p { margin: 0; }
.rl-rncard .rl-check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.rl-rncard .rl-row { flex-wrap: wrap; margin-top: 6px; }
.rl-rncard a.btn { text-decoration: none; }
.rl-rnbar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.rl-rnbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s ease; }
#rn-run, #rn-done, #rn-fail, #rn-ask { display: grid; gap: 10px; }
#rn-run[hidden], #rn-done[hidden], #rn-fail[hidden], #rn-ask[hidden] { display: none; }
#rn-video { width: 100%; max-height: 52dvh; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; object-fit: contain; }
#render.is-busy { background: transparent; color: var(--accent); border-color: var(--accent); }
#steady.is-on { color: var(--accent); border-color: var(--accent); }

/* customer chooser */
.rl-oplist { display: grid; gap: 6px; }
.rl-oplist h3 { font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 10px 0 2px; }
.rl-oprow { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; text-decoration: none; color: var(--ink); }
.rl-oprow:hover { border-color: var(--accent); }
.rl-oprow span { font-size: 12.5px; }
#rn-quota { font-size: 13.5px; color: var(--accent); }
