/* PixLab v12 — Developer Build (expanded CSS) */
:root {
  --bg: #0b0e15;
  --panel: #12162a;
  --border: #2a2f47;
  --text: #e6eafa;
  --muted: #91a0b3;
  --accent: #7bdcb5;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

#topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #0f1322;
  position: sticky;
  top: 0;
  z-index: 3;
}

#topbar .row {
  display: flex;
  gap: 6px;
  align-items: center;
}

#topbar input, #topbar select {
  background: #0b0e15;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
}

#topbar button {
  background: #1b2030;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  display: inline-block;
  margin: 0 6px;
}

#layout {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 8px;
  padding: 8px;
  height: calc(100vh - 54px);
}

#left, #right {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  overflow: auto;
}

#center {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 8px;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.tabs button {
  background: #1b2030;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.tabs button.active { background: #24304e; }

.tab { display: none; }
.tab.active { display: block; }

.asset-list {
  display: grid;
  gap: 6px;
}

.asset {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #151a2e;
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 8px;
}

.asset .thumb {
  width: 48px;
  height: 36px;
  background: #0b0e15;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.asset .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset .badge {
  font-size: 10px;
  color: #111;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: auto;
}

.asset .actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.media-actions input { width: 100%; }

.ai-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #111423;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.ai-box textarea {
  min-height: 72px;
  resize: vertical;
  background: #0b0e15;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}

#viewerWrap {
  background: #0f1322;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#viewer {
  max-width: 100%;
  max-height: 60vh;
  background: #000;
  border-radius: 8px;
}

#timeline {
  background: #0f1322;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: auto;
}

#ruler {
  height: 24px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  align-items: center;
  color: var(--muted);
  padding-left: 8px;
  position: sticky;
  top: 0;
  background: #141a2e;
  z-index: 1;
}

#tracks { position: relative; overflow: auto; }

.track {
  height: 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.track .label {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 120px;
  background: #141a2e;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.stripline {
  position: absolute;
  left: 120px;
  right: 0;
  top: 0;
  bottom: 0;
}

.transition-lane {
  position: relative;
  height: 20px;
  margin: 0 0 6px 120px;
  background: #101426;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.transition {
  position: absolute;
  top: 2px;
  height: 16px;
  background: #3a4a7a;
  border: 1px solid #6b83c3;
  border-radius: 4px;
  cursor: ew-resize;
}

.clip {
  position: absolute;
  height: 40px;
  top: 8px;
  background: #2b3b6a;
  border: 1px solid #5b73b3;
  border-radius: 8px;
  color: #fff;
  padding: 2px 6px;
  cursor: pointer;
  overflow: hidden;
}

.clip.audio {
  background: #2b6a3b;
  border-color: #6ab35b;
}

.clip.overlay {
  background: #6a2b52;
  border-color: #b35b96;
}

.clip .handle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  background: rgba(255,255,255,0.2);
  cursor: ew-resize;
}

.clip .handle.left { left: 0; border-radius: 8px 0 0 8px; }
.clip .handle.right { right: 0; border-radius: 0 8px 8px 0; }

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffcc00;
  pointer-events: none;
}

.selection { outline: 2px solid var(--accent); }

.kf-diamond {
  position: absolute;
  top: 2px;
  width: 8px;
  height: 8px;
  background: #ffd54a;
  transform: rotate(45deg);
  border: 1px solid #8a6f1a;
}

.kf-lane {
  position: absolute;
  left: 120px;
  right: 0;
  height: 12px;
  top: 0;
}

.pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: #1b2030;
  border: 1px solid var(--border);
  font-size: 12px;
}

.pill.video { border-color: #5b73b3; }
.pill.audio { border-color: #6ab35b; }
.pill.overlay { border-color: #b35b96; }

#right input, #right select {
  width: 100%;
  background: #0b0e15;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
}

#right input[type="range"] { width: 100%; }

#right hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.pm-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.pm-list {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 64px;
  display: grid;
  gap: 6px;
}

.pm-list .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b2030;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  width: min(860px, 90vw);
  display: grid;
  gap: 8px;
}

.modal-card .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal-card textarea {
  min-height: 160px;
  background: #0b0e15;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
}
