/* Видео засварлагч / Video editor layout (builds on style.css) */
.vapp {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto minmax(190px, 34vh) auto;
}


.vmain { display: grid; grid-template-columns: 240px 1fr 290px; gap: 12px; padding: 12px 18px 8px; min-height: 0; }
.vbin, .vprops { min-height: 0; overflow: hidden; }
.vprops { overflow-y: auto; }

/* media bin */
.bin-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bin-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; padding: 6px;
  background: var(--panel-2); border-radius: var(--radius-s); cursor: grab; border: 1px solid transparent;
}
.bin-item:hover { border-color: #3a4f6e; }
.bin-item canvas { width: 64px; height: 36px; border-radius: 4px; background: #000; display: block; }
.bin-info { min-width: 0; display: flex; flex-direction: column; }
.bin-info b { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bin-info span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bin-acts { display: flex; flex-direction: column; gap: 3px; }
.bin-acts button {
  width: 26px; height: 22px; border: 1px solid var(--line); border-radius: 5px; background: transparent;
  cursor: pointer; font-size: 14px; line-height: 1; color: var(--text);
}
.bin-acts button:hover { background: #2a3b55; }
.bin-acts .x { color: var(--muted); }
.bin-empty { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.bin-empty b { color: var(--text); }

/* stage */
.vstage { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 8px; }
.stage-wrap {
  flex: 1; min-height: 0; position: relative; display: grid; place-items: center;
  background: repeating-conic-gradient(#121a26 0% 25%, #0f1621 0% 50%) 50% / 24px 24px;
  border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden;
}
#preview { display: block; background: #000; box-shadow: 0 8px 30px rgba(0,0,0,.45); touch-action: none; }
.stage-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 20px; background: rgba(15,22,33,.88);
}
.stage-empty[hidden] { display: none; }
.stage-empty h2 { margin: 0; font-size: 19px; }
.stage-empty p { margin: 0 0 8px; color: var(--muted); max-width: 48ch; }
.stage-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.stage-bar .clock { font-size: 26px; }
.stage-format { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-left: auto; }
.stage-format select, .vprops select {
  height: 30px; padding: 0 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text);
}

/* properties */
.props-empty { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
#propsBody { display: flex; flex-direction: column; gap: 12px; }
#propsBody[hidden] { display: none; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pgrid label, .pfield { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.pgrid input, .pfield textarea {
  height: 30px; padding: 0 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--text); font-variant-numeric: tabular-nums; width: 100%;
}
.pfield textarea { height: auto; padding: 8px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.4; }
.pgrid input:focus, .pfield textarea:focus { border-color: var(--sel); outline: none; }
.psec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.psec[hidden] { display: none; }
.prow { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.prow output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.prow input[type=color] { width: 44px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.prow .check { grid-column: span 2; }
.pbtns { display: flex; gap: 6px; }
.pbtns .btn { flex: 1; justify-content: center; }

/* timeline */
.tl-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.tl-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-toolbar .zoom { margin-left: 0; }
.tl { display: flex; flex-direction: column; min-height: 0; background: #0f1621; padding: 0 18px 6px; }
.tl .mt-body { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.tl .mt-headrow { border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0; overflow: hidden; }
.tl .hscroll { margin-top: 6px; }
#tlCanvas { display: block; touch-action: none; }
#tlRuler { display: block; cursor: pointer; touch-action: none; }
.mt-head .kind { font-size: 10px; font-weight: 700; color: var(--c); border: 1px solid var(--c); border-radius: 4px; padding: 0 4px; flex: none; }
.mt-head .tname-static { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-head .ms.eye.on { background: #8d98ab; border-color: #8d98ab; color: #0f1621; }

@media (max-width: 1200px) {
  .vmain { grid-template-columns: 200px 1fr 250px; }
}
@media (max-width: 900px) {
  .vapp { height: auto; grid-template-rows: auto auto auto 300px auto; }
  .vmain { grid-template-columns: 1fr; }
  .stage-wrap { min-height: 240px; aspect-ratio: 16 / 9; }
  .vbin { max-height: 220px; }
}

[hidden] { display: none !important; }
.tl .mt-heads, .tl .mt-corner { width: 236px; }
