:root {
  --bg: #0f1115;
  --panel: #171a21;
  --text: #e6e6e6;
  --muted: #9aa0a6;
  --accent: #5b9cff;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #242836;
}

* {
  box-sizing: border-box;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #141823, #10131a);
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
}

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

button {
  background: #222638;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: #3c74d9; }
button.success { background: var(--success); border-color: #199947; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.app-main {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100% - 56px);
}

.sidebar {
  padding: 12px;
  border-right: 1px solid var(--border);
  overflow: auto;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.card h2 { font-size: 14px; margin: 0 0 8px 0; }

.field { display: grid; gap: 6px; margin: 8px 0; }
label.toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; }

.file-list { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }

.studio {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 12px;
}

.preview-wrap {
  position: relative;
  background: #0c0f18;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 360px;
}

#preview-canvas {
  max-width: 100%;
  height: auto;
  background: black;
  border-radius: 8px;
}

.progress {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  font-size: 12px;
}

.clips {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.clip-list { display: grid; gap: 8px; }
.clip {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.chip { font-size: 11px; color: var(--muted); }
.clip-ctx { font-size: 12px; color: var(--text); }
.clip-actions { display: flex; gap: 6px; }

.app-footer {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.safe-guides::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(255,255,255,0.25);
  transform: scale(0.9);
  pointer-events: none;
}

