/* Dark-only on purpose: this is an editing surface, and every NLE is dark so the
   footage is the brightest thing on screen. */
* { box-sizing: border-box; }

:root {
  --bg: #0e1013;
  --panel: #16191e;
  --line: #262b33;
  --ink: #e8ecf2;
  --dim: #8b95a5;
  --accent: #4c9aff;
  --live: #35c07a;
  --warn: #e0a33a;
  --sp: 8px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;
}

header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
header h1 { font-size: 16px; margin: 0; letter-spacing: .01em; }
header .tag { color: var(--dim); font-size: 13px; }
header nav { display: flex; gap: 16px; margin-left: auto; }
header a { color: var(--accent); font-size: 13px; }

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 24px;
  align-items: start;
}
@media (max-width: 900px) { .wrap { grid-template-columns: minmax(0, 1fr); } }

/* ---- stage ---- */
#stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.transport {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
button {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button:focus-visible,
.clip:focus-visible,
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[disabled] { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #04101f; font-weight: 600; }
.transport .spacer { margin-left: auto; }

/* ---- timeline ---- */
.timeline {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}
.timeline h2, .surface h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  margin: 0 0 16px;
}
.track { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.clip {
  flex: 0 0 auto;
  width: 128px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #1d222a;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}
.clip[aria-selected="true"] { border-color: var(--accent); background: #1b2735; }
.clip .thumb { width: 100%; height: 48px; border-radius: 4px; display: block; }
.clip .name { font-size: 12px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip .meta { font-size: 11px; color: var(--dim); }
.clip .cap { font-size: 11px; color: var(--warn); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--dim); font-size: 13px; }

/* ---- equivalent human controls, used by the DOM comparison ---- */
.inspector {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  margin: 0;
}
.section-head strong { font-size: 13px; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.edit-grid fieldset { border: 1px solid var(--line); border-radius: 6px; min-width: 0; padding: 10px; }
.edit-grid legend { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.edit-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.edit-grid input,
.edit-grid select {
  min-width: 0;
  width: 100%;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  font: inherit;
}
.edit-grid button { width: 100%; }
.edit-status { min-height: 21px; color: var(--dim); margin: 10px 0 0; font-size: 12px; }
.edit-status.error { color: #ff8f8f; }
@media (max-width: 700px) { .edit-grid { grid-template-columns: 1fr; } }

/* ---- live tool surface ---- */
.surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  position: sticky;
  top: 24px;
}
.surface .count { color: var(--live); font-weight: 700; }
ul.tools { list-style: none; margin: 0; padding: 0; }
ul.tools li {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  animation: in .28s ease;
}
ul.tools li:first-child { border-top: 0; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.tname { font-family: ui-monospace, monospace; font-size: 13px; color: var(--live); }
.tdesc { font-size: 12px; color: var(--dim); margin-top: 4px; }
.tbadge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--dim);
  margin-left: 8px;
}

.log {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  max-height: 240px;
  overflow-y: auto;
}
.log div { font-family: ui-monospace, monospace; font-size: 12px; padding: 4px 0; color: var(--dim); }
.log div b { color: var(--ink); font-weight: 600; }
