:root {
  --bg: #111318;
  --card: #1a1d25;
  --line: #2a2f3b;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #ffcf33;
  --accent-ink: #1a1400;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.top { padding: 20px 24px 4px; }
.top h1 { margin: 0; font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.muted.small { margin: 8px 0 0; }
.top p { margin: 4px 0 0; }

.warn {
  margin: 12px 24px 0;
  padding: 10px 14px;
  background: #3a2a10;
  border: 1px solid #7a5a1a;
  border-radius: 8px;
}
code { background: #0003; padding: 1px 5px; border-radius: 4px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  padding: 16px 24px 40px;
  align-items: start;
}
.preview-col { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.stage {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: center;
}
#canvas {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  width: auto;
  height: auto;
  background: #222;
}
.drop-hint {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: #000a; border: 2px dashed var(--accent); border-radius: 10px;
  font-size: 18px; color: var(--accent);
}
.stage.dragging .drop-hint { display: flex; }

.transport { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.toast { min-height: 20px; margin-top: 6px; color: var(--accent); font-size: 13px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .55; pointer-events: none; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 15px; }

label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.row > label { flex: 1 1 130px; margin-top: 0; }

textarea, select, input[type=number], input[type=search] {
  width: 100%;
  margin-top: 4px;
  background: #0f1117;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}
textarea { resize: vertical; }
input[type=range] { width: 100%; margin-top: 6px; accent-color: var(--accent); }
output { color: var(--text); }

button, .btn {
  display: inline-block;
  background: #272c39;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: #4a5266; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin-top: 10px;
  padding-right: 4px;
}
.grid:empty::after, .list:empty::after {
  content: "Brak plików — wrzuć je do folderu i odśwież stronę.";
  color: var(--muted); font-size: 13px; grid-column: 1 / -1;
}
.thumb {
  padding: 0; overflow: hidden; background: #000;
  aspect-ratio: 1; position: relative;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumb .own {
  position: absolute; left: 3px; top: 3px; background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
}

.list { display: flex; flex-direction: column; gap: 5px; max-height: 210px; overflow: auto; }
.list button { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list button.sel { border-color: var(--accent); background: #3a3215; }

progress { width: 100%; margin-top: 10px; accent-color: var(--accent); }
.result { margin-top: 12px; }
.result video { width: 100%; max-height: 360px; background: #000; border-radius: 8px; margin-bottom: 8px; }

#hold { position: fixed; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: .01; pointer-events: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .preview-col { position: static; }
  .top { padding: 16px 12px 0; }
  .warn { margin: 12px 12px 0; }
}

/* sceny */
.card.scenes { margin: 10px 0 0; }
.scenes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scenes-head h2 { margin: 0 0 6px; }
.scene-tools { margin-top: 4px; }
button:disabled { opacity: .4; cursor: default; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 8px; margin-top: 4px; }
.scene {
  flex: 0 0 112px; position: relative; padding: 0; text-align: left; overflow: hidden;
  background: #0f1117; border: 2px solid var(--line); border-radius: 8px;
}
.scene.sel { border-color: var(--accent); }
.scene.playing { box-shadow: 0 0 0 3px #4cc38a; }
.sthumb { width: 100%; aspect-ratio: 3 / 2; background: #000; }
.sthumb img, .sthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.snum, .sdur {
  position: absolute; top: 4px; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: #000b; color: #fff;
}
.snum { left: 4px; background: var(--accent); color: var(--accent-ink); }
.sdur { right: 4px; }
.stext {
  padding: 4px 6px 5px; font-size: 11.5px; line-height: 1.25; color: var(--text); height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}


