/* Long form: films, the storyboard, and the shot-by-shot workbench. Builds on studio.css. */
.lf { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 14px var(--gutter) 150px; display: grid; gap: 16px; }
.lf-view { display: grid; gap: 14px; min-width: 0; }
.lf [hidden] { display: none !important; }
.lf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.lf-head h1 { font-size: clamp(28px, 5vw, 40px); letter-spacing: -.03em; line-height: 1; margin: 0; background: linear-gradient(180deg, #fff, #c8c8d2); -webkit-background-clip: text; background-clip: text; color: transparent; }
a.tool { text-decoration: none; }

.lf-msg { margin: 0; font-size: 14px; color: var(--ink-2); }
.lf-msg:empty { display: none; }
.lf-msg.is-err { color: var(--red); }
.lf-keep { margin: 0; font-size: 12.5px; color: var(--muted); }
.lf-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: #ffd9a0; background: rgba(255, 160, 40, .08); border: 1px solid rgba(255, 160, 40, .25); }

/* films */
.lf-films { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lf-film { display: grid; gap: 4px; padding: 14px 16px; text-decoration: none; color: var(--ink); border-radius: 16px; }
.lf-film:hover { border-color: rgba(255, 191, 58, .4); }
.lf-film strong { font-size: 16px; }
.lf-film-meta { font-size: 13px; color: var(--muted); }
.lf-empty { color: var(--muted); padding: 20px 0; }

/* new film */
.lf-new { padding: 18px 16px 6px; }
.lf-new textarea, .lf-input, .lf-select, .lf-look textarea, .lf-dlg textarea, .lf-dlg input {
  width: 100%; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .1); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.45;
}
.lf-new textarea { resize: vertical; min-height: 120px; }
.lf-input, .lf-select { height: 46px; padding-top: 0; padding-bottom: 0; }
.lf-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.lf-select optgroup { background: #111; color: var(--muted); }
.lf-select option { background: #111; color: var(--ink); }
.lf-bar { position: sticky; bottom: 0; padding: 14px 0 16px; display: flex; justify-content: flex-end; background: linear-gradient(180deg, transparent, rgba(7, 7, 8, .9) 40%); }
.lf-bar .render-btn { width: 100%; }
.render-btn.is-busy { animation: lf-pulse 1.4s ease-in-out infinite; }
@keyframes lf-pulse { 50% { filter: brightness(.82); } }

/* film head */
.lf-film-head { align-items: flex-start; }
.lf-title-wrap { display: grid; gap: 6px; min-width: 0; flex: 1; justify-items: start; }
.lf-title { width: 100%; font: inherit; font-size: clamp(24px, 4.5vw, 34px); font-weight: 900; letter-spacing: -.03em; color: var(--ink); background: transparent; border: 0; border-bottom: 1px dashed transparent; padding: 2px 0; }
.lf-title:hover, .lf-title:focus { border-bottom-color: rgba(255, 255, 255, .2); outline: 0; }
.lf-meta { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lf-state { flex-shrink: 0; margin-top: 34px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: var(--ink-2); }
.lf-state[data-state="rendering"] { color: var(--yellow); border-color: rgba(255, 191, 58, .4); }
.lf-state[data-state="paused"] { color: #ffb36b; }
.lf-state[data-state="ready"], .lf-state[data-state="done"] { color: var(--green); border-color: rgba(182, 240, 168, .35); }
.lf-error { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; color: var(--red); background: rgba(255, 139, 139, .07); border: 1px solid rgba(255, 139, 139, .25); }

/* timeline */
.lf-strip { display: flex; gap: 3px; height: 54px; border-radius: 12px; overflow: hidden; background: rgba(0, 0, 0, .35); padding: 3px; border: 1px solid rgba(255, 255, 255, .07); }
.lf-cell { position: relative; flex: 1 1 0; min-width: 14px; border-radius: 7px; overflow: hidden; border: 0; padding: 0; background: rgba(255, 255, 255, .06); cursor: pointer; }
.lf-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.lf-cell span { position: absolute; left: 5px; bottom: 3px; font-size: 10.5px; font-weight: 900; color: #fff; text-shadow: 0 1px 3px #000; }
.lf-cell[data-state="approved"] { box-shadow: inset 0 -3px 0 var(--green); }
.lf-cell[data-state="review"] { box-shadow: inset 0 -3px 0 var(--yellow); }
.lf-cell[data-state="rendering"] { background: rgba(255, 191, 58, .18); animation: lf-pulse 1.4s ease-in-out infinite; }
.lf-cell[data-state="failed"] { box-shadow: inset 0 -3px 0 var(--red); }
.lf-cell[data-cont="cut"] { margin-left: 3px; }

/* look */
.lf-look { border-radius: 16px; padding: 0; }
.lf-look summary { cursor: pointer; padding: 14px 16px; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); list-style: none; }
.lf-look summary::-webkit-details-marker { display: none; }
.lf-look-body { padding: 0 16px 16px; display: grid; gap: 8px; }
.lf-look-line { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }

/* shots */
.lf-shots { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.lf-shot { border-radius: 18px; padding: 12px; display: grid; gap: 10px; scroll-margin-top: 80px; }
.lf-shot[data-state="review"] { border-color: rgba(255, 191, 58, .55); box-shadow: 0 0 0 1px rgba(255, 191, 58, .25), 0 20px 60px rgba(0, 0, 0, .45); }
.lf-shot[data-state="approved"] { border-color: rgba(182, 240, 168, .22); }
.lf-shot[data-state="failed"] { border-color: rgba(255, 139, 139, .35); }
.lf-shot-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lf-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 900; background: rgba(255, 255, 255, .07); }
.lf-beat { flex: 1; min-width: 0; font: inherit; font-weight: 800; font-size: 15px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px dashed transparent; padding: 3px 0; }
.lf-beat:hover:not(:disabled), .lf-beat:focus { border-bottom-color: rgba(255, 255, 255, .2); outline: 0; }
.lf-beat:disabled { color: var(--ink); opacity: 1; }
.lf-badge { flex-shrink: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.lf-badge[data-state="review"] { color: var(--yellow); }
.lf-badge[data-state="approved"] { color: var(--green); }
.lf-badge[data-state="failed"] { color: var(--red); }
.lf-badge[data-state="rendering"] { color: var(--yellow-2); }
.lf-shot-body { display: grid; gap: 10px; min-width: 0; }
.lf-take { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }
.lf-making { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255, 191, 58, .06); border: 1px solid rgba(255, 191, 58, .2); font-size: 13.5px; color: var(--yellow-2); font-weight: 700; }
.lf-making .ring { width: 28px; height: 28px; }
.lf-shot-fields { display: grid; gap: 8px; min-width: 0; }
.lf-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.lf-row .chip { padding: 6px 11px; font-size: 12px; }
.lf-row .chip:disabled { opacity: .45; }
.lf-from { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lf-from img { width: 44px; height: 26px; object-fit: cover; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .15); }
.lf-prompt { width: 100%; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); color: var(--ink); font: inherit; font-size: 14.5px; line-height: 1.5; resize: vertical; }
.lf-prompt:disabled { color: var(--ink-2); background: rgba(0, 0, 0, .15); }
.lf-shot-err { margin: 0; font-size: 13px; color: var(--red); }
.lf-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lf-acts .btn-sm { margin: 0; padding: 8px 16px; font-size: 13px; }
.lf-acts-r { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.lf-price { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink-2); margin-right: 6px; font-variant-numeric: tabular-nums; }
.lf-price .coin { width: 13px; height: 13px; }
.lf-ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--muted); }
.lf-ico:hover:not(:disabled) { color: var(--ink); border-color: rgba(255, 255, 255, .12); }
.lf-ico:disabled { opacity: .3; }
.lf-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lf-add-end { justify-self: start; }

/* dock */
.lf-dock { position: sticky; bottom: 10px; z-index: 5; padding: 12px; border-radius: 18px; display: grid; gap: 10px; background: rgba(14, 14, 18, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lf-dock .agree { margin: 0; font-size: 12.5px; }
.lf-dock .agree.is-flag { border-color: var(--red); }
.lf-dock-row { display: flex; align-items: center; gap: 10px; }
.lf-dock-row .price { flex: 1; }
.lf-dock-row .btn { margin: 0; }

/* add-shot dialog */
.lf-dlg .chips { margin-top: 10px; }
.lf-dlg textarea { min-height: 120px; resize: vertical; }

@media (min-width: 760px) {
  .lf { padding-top: 22px; }
  .lf-shot { padding: 16px; }
  .lf-shot-body { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .lf-shot-body > .lf-shot-fields:only-child { grid-column: 1 / -1; }
  .lf-new { padding: 22px 24px 6px; }
}

/* the Studio's rail, kept as a row here */
.lf .tool-rail { flex-direction: row; position: static; overflow-x: auto; }
@media (min-width: 1024px) {
  .lf .tool-rail { margin: 0; padding: 0 0 4px; }
  .lf .tool { width: auto; flex-direction: row; padding: 9px 14px 9px 9px; border-radius: 999px; font-size: 12px; }
}
.lf-ico svg, .lf-n svg { max-width: none; flex: none; }

/* finished film */
.lf-msg.is-ok { color: var(--green); }
.lf-out { border-radius: 18px; padding: 12px; display: grid; gap: 12px; }
.lf-out-video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; }
.lf-out-making { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: rgba(255, 191, 58, .06); border: 1px solid rgba(255, 191, 58, .2); font-weight: 800; color: var(--yellow-2); }
.lf-out-making .ring { width: 30px; height: 30px; }
.lf-out-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-out-acts .btn { margin: 0; }
.lf-out-acts .is-hot { border-color: var(--yellow); color: var(--yellow); }

/* editor */
.lf-edit { border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .07); }
.lf-edit summary { cursor: pointer; padding: 10px 12px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); list-style: none; }
.lf-edit summary::-webkit-details-marker { display: none; }
.lf-edit[open] summary { color: var(--yellow); }
.lf-edit-body { padding: 0 12px 12px; display: grid; gap: 14px; }
.lf-ed-sec { display: grid; gap: 8px; }
.lf-ed-sec h4 { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.lf-ed-sec .chip { padding: 6px 11px; font-size: 12px; }
.lf-ed-sec .btn-sm { justify-self: start; margin: 0; }
.lf-sl { display: grid; grid-template-columns: 84px 1fr 54px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.lf-sl[hidden] { display: none; }
.lf-sl input { width: 100%; accent-color: var(--yellow); }
.lf-sl output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.lf-tip { margin: 0; font-size: 12px; color: var(--muted-2); }
.lf-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.lf-check input { width: 17px; height: 17px; accent-color: var(--yellow); }

.lf .presets { margin: 0 0 8px; }
.lf-look-body .lf-input { height: 42px; }

.lf-h-ico { font-size: 13px; color: var(--yellow); margin-bottom: 8px; display: block; }
