/* Story Video Generator: promo editor. Scoped under .stvg-pe so it cannot clash with a theme or the WP admin. */
.stvg-pe{
  --pe-primary:#4f46e5; --pe-primary-dark:#4338ca; --pe-text:#0f172a; --pe-muted:#64748b;
  --pe-border:#e2e8f0; --pe-soft:#f1f5f9; --pe-bad:#b91c1c;
  color:var(--pe-text); font-size:15px; line-height:1.5; text-align:left; box-sizing:border-box;
}
.stvg-pe *,.stvg-pe *::before,.stvg-pe *::after{ box-sizing:border-box; }
.stvg-pe-layout{ display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:22px; align-items:start; }
.stvg-pe-side{ position:sticky; top:16px; background:var(--pe-soft); border:1px solid var(--pe-border); border-radius:14px; padding:12px; text-align:center; }
.stvg-pe-sidehead{ font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--pe-muted); margin-bottom:8px; }
.stvg-pe-canvas{ display:block; width:100%; height:auto; aspect-ratio:9/16; border-radius:10px; background:#000; margin-bottom:10px; }
.stvg-pe-bar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.stvg-pe-bar select{ flex:1 1 220px; min-width:0; }
.stvg-pe-list{ display:flex; flex-direction:column; gap:10px; }
.stvg-pe-empty{ color:var(--pe-muted); background:var(--pe-soft); border:1px dashed #cbd5e1; border-radius:12px; padding:18px; margin:0; }
.stvg-pe .stvg-pe-summary{ margin:16px 0 0 !important; padding:10px 14px; background:#eef2ff; color:#3730a3; border-radius:10px; font-size:13.5px; }
.stvg-pe .stvg-pe-adminnote{ background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; border-radius:10px; padding:10px 14px; margin:0 0 14px; font-size:13.5px; }
.stvg-pe .stvg-pe-fixedlist{ margin:8px 0 0 18px; padding:0; color:var(--pe-text); }

.stvg-pe-item{ border:1px solid var(--pe-border); border-radius:14px; background:#fff; overflow:hidden; }
.stvg-pe-item[open]{ border-color:#a5b4fc; box-shadow:0 0 0 3px rgba(79,70,229,.10); }
.stvg-pe-item > summary{ display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer; list-style:none; font-weight:600; }
.stvg-pe-item > summary::-webkit-details-marker{ display:none; }
.stvg-pe-item > summary::after{ content:'▾'; margin-left:auto; color:var(--pe-muted); transition:transform .15s; }
.stvg-pe-item[open] > summary::after{ transform:rotate(180deg); }
.stvg-pe-item > summary input{ width:18px; height:18px; margin:0; accent-color:var(--pe-primary); flex:none; }
.stvg-pe-title{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stvg-pe-chip{ flex:none; font-size:12px; font-weight:600; background:var(--pe-soft); color:var(--pe-muted); border-radius:999px; padding:2px 10px; }
.stvg-pe-off{ opacity:.55; }
.stvg-pe-body{ padding:4px 16px 16px; border-top:1px solid var(--pe-border); }
.stvg-pe-h{ margin:18px 0 8px !important; font-size:13px !important; text-transform:uppercase; letter-spacing:.06em; color:var(--pe-muted) !important; font-weight:700 !important; }
.stvg-pe-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:10px; }
.stvg-pe-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px 14px; }
.stvg-pe-wide{ grid-column:1 / -1; }
.stvg-pe-field{ margin-top:0; min-width:0; }
.stvg-pe-row > .stvg-pe-field{ margin-top:0; }
.stvg-pe-body > .stvg-pe-field{ margin-top:12px; }
.stvg-pe-dim{ opacity:.5; }
.stvg-pe-label{ display:block; font-weight:600; font-size:13.5px; margin:0 0 5px; }
.stvg-pe-hint{ color:var(--pe-muted); font-size:12.5px; margin:5px 0 0; }
.stvg-pe input[type=text],.stvg-pe input[type=number],.stvg-pe select,.stvg-pe textarea{
  display:block; width:100%; max-width:100%; padding:9px 11px; font:inherit; font-size:14.5px; color:var(--pe-text);
  background:#fff; border:1px solid #cbd5e1; border-radius:9px; box-shadow:none; min-height:40px; height:auto;
}
.stvg-pe textarea,.stvg .stvg-pe textarea{ resize:vertical; min-height:76px; height:76px; line-height:1.45; }
.stvg-pe input[type=file]{ display:block; width:100%; font-size:13.5px; padding:8px; background:var(--pe-soft); border:1px dashed #cbd5e1; border-radius:9px; }
.stvg-pe input[type=range]{ width:100%; accent-color:var(--pe-primary); }
.stvg-pe input:focus,.stvg-pe select:focus,.stvg-pe textarea:focus{ outline:none; border-color:var(--pe-primary); box-shadow:0 0 0 3px rgba(79,70,229,.22); }
.stvg-pe input.stvg-pe-bad{ border-color:var(--pe-bad); box-shadow:0 0 0 3px rgba(185,28,28,.15); }
.stvg-pe-check{ display:flex; gap:8px; align-items:flex-start; margin-top:12px; font-size:14px; cursor:pointer; }
.stvg-pe-check input{ margin-top:3px; accent-color:var(--pe-primary); }
.stvg-pe-colors{ display:flex; flex-wrap:wrap; gap:10px 16px; margin-top:12px; }
.stvg-pe-color{ display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600; }
.stvg-pe-color input{ width:38px; height:30px; padding:0; border:1px solid #cbd5e1; border-radius:8px; background:#fff; cursor:pointer; }
.stvg-pe-logo{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.stvg-pe-logo input[type=text]{ flex:1 1 220px; }
.stvg-pe-actions{ display:flex; gap:10px; margin-top:18px; padding-top:14px; border-top:1px solid var(--pe-border); }

.stvg-pe-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:9px 15px; min-height:40px;
  font:inherit; font-size:14px; font-weight:600; color:var(--pe-text); background:#fff; border:1px solid #cbd5e1;
  border-radius:9px; cursor:pointer; line-height:1.2;
}
.stvg-pe-btn:hover{ background:var(--pe-soft); }
.stvg-pe-primary{ background:var(--pe-primary); border-color:var(--pe-primary); color:#fff; }
.stvg-pe-primary:hover{ background:var(--pe-primary-dark); }
.stvg-pe-danger{ color:var(--pe-bad); border-color:#fecaca; }
.stvg-pe-danger:hover{ background:#fef2f2; }

@media (max-width:820px){
  .stvg-pe-layout{ grid-template-columns:1fr; }
  .stvg-pe-side{ position:static; order:-1; max-width:260px; margin:0 auto; width:100%; }
}
@media (max-width:560px){
  .stvg-pe-row,.stvg-pe-grid{ grid-template-columns:1fr; }
}

/* ---------- Promo chat moment picker ---------- */
.stvg-pe-code{ margin:0 0 12px; padding:12px 14px; background:#0f172a; color:#e2e8f0; border-radius:10px; font:13.5px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; word-break:break-word; }
.stvg-pe-tiles{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
.stvg-pe-tile{ position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; padding:8px 6px 10px; border:2px solid var(--pe-border); border-radius:12px; background:#fff; cursor:pointer; text-align:center; font-size:12.5px; font-weight:600; line-height:1.25; }
.stvg-pe-tile:hover{ border-color:#a5b4fc; }
.stvg-pe-tile input{ position:absolute; opacity:0; pointer-events:none; }
.stvg-pe-tile canvas{ width:100%; height:auto; aspect-ratio:9/16; border-radius:8px; background:#000; display:block; }
.stvg-pe-tile:has(input:checked){ border-color:var(--pe-primary); box-shadow:0 0 0 3px rgba(79,70,229,.18); background:#eef2ff; }
.stvg-pe-tile:has(input:focus-visible){ outline:3px solid var(--pe-primary); outline-offset:2px; }
@media (max-width:700px){ .stvg-pe-tiles{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
