/* Studio: the in-browser clip editor */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, calc((100vh - 150px) * 9 / 16 + 24px), 520px) 390px; gap: 0; height: calc(100vh - 57px); min-height: 560px; }
.studio > section { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.st-left { border-right: 1px solid var(--line); }
.st-mid { border-right: 1px solid var(--line); background: var(--bg2); align-items: center; padding: 12px; gap: 10px; }
.st-right { background: var(--bg); }
.st-player { position: relative; background: #000; flex: 0 0 auto; display: flex; justify-content: center; }
.st-player video { width: 100%; max-height: 38vh; display: block; background: #000; }
.st-transport { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.st-transport .time { font: 600 13px var(--mono); min-width: 150px; }
.st-tl { position: relative; padding: 0 10px; border-bottom: 1px solid var(--line); }
.st-tl canvas { width: 100%; display: block; cursor: pointer; }
.st-tl .lbl { position: absolute; left: 14px; top: 2px; font-size: 10.5px; color: var(--faint); pointer-events: none; }
.st-transcript { flex: 1 1 auto; overflow: auto; min-height: 120px; }
.st-transcript .bar { position: sticky; top: 0; background: var(--bg); display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); z-index: 2; align-items: center; flex-wrap: wrap; }
.st-transcript .bar input[type=search] { max-width: 240px; }
.cue { display: flex; gap: 10px; padding: 4px 12px; cursor: pointer; font-size: 13.5px; line-height: 1.45; border-left: 3px solid transparent; }
.cue:hover { background: var(--panel); }
.cue .tm { font: 11.5px var(--mono); color: var(--faint); min-width: 58px; padding-top: 2px; }
.cue .tx { flex: 1; }
.cue.now { background: var(--accent-soft); border-left-color: var(--accent); }
.cue.inclip { border-left-color: var(--line2); }
.cue.anchor { outline: 1px dashed var(--accent); }
.cue mark { background: rgba(255, 212, 0, .35); color: inherit; border-radius: 2px; }
.cue .tx[contenteditable=true] { outline: 1px solid var(--accent); background: var(--bg2); padding: 0 4px; border-radius: 4px; }
.st-preview-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; }
.st-preview { height: 100%; max-height: 100%; width: 100%; object-fit: contain; border-radius: 10px; background: #000; box-shadow: var(--shadow); cursor: grab; touch-action: none; }
.st-preview:active { cursor: grabbing; }
.st-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.st-tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 12.5px var(--font); padding: 10px 6px; cursor: pointer; white-space: nowrap; }
.st-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.st-panel { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.st-panel h4 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.clip-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; }
.clip-row:hover { border-color: var(--line2); }
.clip-row.on { border-color: var(--accent); background: var(--accent-soft); }
.clip-row .n { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-row .m { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.dur { font: 600 11.5px var(--mono); padding: 1px 6px; border-radius: 99px; background: var(--panel2); }
.dur.ok { color: var(--good); } .dur.short, .dur.long { color: var(--warn); }
.seg { display: flex; gap: 0; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; background: var(--panel2); border: 0; color: var(--muted); font: 600 12px var(--font); padding: 7px 6px; cursor: pointer; border-right: 1px solid var(--line2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.kv input[type=range] { width: 150px; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tc { display: flex; gap: 4px; align-items: center; }
.tc input { font-family: var(--mono); font-size: 13px; padding: 6px 8px; }
.drop { border: 2px dashed var(--line2); border-radius: 14px; padding: 46px 20px; text-align: center; background: var(--panel); transition: border-color .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.st-start { max-width: 1000px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.found { display: flex; gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--panel); }
.found .grow .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.busy { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.busy .progress { flex: 1; }
@media (max-width: 1250px) {
  .studio { grid-template-columns: minmax(0, 1fr) 360px; height: auto; }
  .st-mid { grid-column: 1 / -1; order: -1; height: 72vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .st-left { height: 80vh; }
  .st-right { height: 80vh; }
}
@media (max-width: 800px) {
  .studio { grid-template-columns: 1fr; }
  .st-left, .st-right { height: auto; min-height: 60vh; }
}
