:root {
  --bg: #08080a;
  --sidebar: #0c0c10;
  --card: #12121a;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #71717a;
  --accent: #6366f1;
  --accent-dim: rgba(99, 102, 241, 0.14);
  --accent-border: rgba(99, 102, 241, 0.35);
}

* { box-sizing: border-box; }

body.ped-showcase {
  margin: 0;
  overflow: hidden;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.ps-studio {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--site-header-h, 88px));
  overflow: hidden;
}

.ps-sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.ps-head {
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ps-head h1 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.ps-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.ps-block {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ps-dropzone {
  text-align: center;
  padding: 24px 14px;
  border: 1.5px dashed var(--accent-border);
  border-radius: 12px;
  background: var(--accent-dim);
  transition: border-color 0.15s, background 0.15s;
}

.ps-dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.22);
}

.ps-drop-icon {
  display: block;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 8px;
}

.ps-btn-primary {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ps-btn-secondary {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ps-btn-ghost {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ps-hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); }

.ps-progress { margin-top: 12px; }
.ps-progress-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-bottom: 6px;
}
.ps-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s;
}
.ps-progress span { font-size: 11px; color: var(--muted); }

.ps-err { margin: 8px 0 0; font-size: 12px; color: #f87171; }

.ps-pack-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ps-pack-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.ps-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: #c7d2fe;
}

.ps-search {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a0a0f;
  color: var(--text);
  font-size: 13px;
}

.ps-slider-row {
  display: grid;
  grid-template-columns: 56px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.ps-slider-row input { accent-color: var(--accent); }

.ps-toggle-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.ps-toggle {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ps-toggle.active {
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: #e0e7ff;
}

.ps-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.ps-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.ps-ped-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.ped-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ped-row:hover { border-color: var(--border); }
.ped-row.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.ped-row.missing {
  opacity: 0.45;
  cursor: default;
}

.ped-row-name { flex: 1; font-weight: 600; font-size: 11px; word-break: break-all; }
.ped-row-meta { font-size: 10px; color: var(--muted); }

.ped-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}

.ped-dot.warn { background: #f59e0b; }

.ps-stage {
  position: relative;
  background: #030305;
  min-height: 0;
  overflow: hidden;
}

.ps-viewer {
  position: absolute;
  inset: 0;
}

.ps-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.ps-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #3f3f46;
  font-size: 14px;
}

.ps-stage-empty.hidden { display: none; }

.ps-stage-hints {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.ps-stage-hints span {
  font-size: 10px;
  color: var(--muted);
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
}

.ps-active-label {
  color: #e0e7ff !important;
  border-color: var(--accent-border) !important;
}

.hidden { display: none !important; }

code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

@media (max-width: 820px) {
  body.ped-showcase { overflow: auto; height: auto; }
  .ps-studio {
    grid-template-columns: 1fr;
    grid-template-rows: auto 55vh;
    height: auto;
  }
}
