/* editor.css - the shared Studio editor (W-0226). Studio house style (post.html tokens), phone-first, reduced motion respected. */
.ed { --ink:#1c2530; --muted:#5b6b7b; --line:#e3e8ee; --band:#f6f8fa; --accent:#a13b5c; --accent-ink:#7d2d47; --accent-soft:#f6e7ec; --accent-tint:#fcf6f8;
  --ok:#0a7d33; --stop:#b42318; --stop-soft:#fdecea; --warn:#9a6700; --warn-soft:#fff8e6; --test:#5c636e; --test-soft:#f3f4f6;
  background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 10px 30px rgba(125,45,71,.12), 0 1px 2px rgba(28,37,48,.06); overflow:hidden; }
.ed [hidden] { display:none !important; }
.ed-top { display:flex; align-items:center; gap:.6rem; padding:.7rem .9rem; background:var(--accent-tint); border-bottom:1px solid var(--line); }
.ed-title { margin:0; font:700 1.05rem/1.2 "Montserrat",sans-serif; }
.ed-demo { margin-left:auto; font:700 .64rem/1 "Inter",sans-serif; text-transform:uppercase; letter-spacing:.06em; padding:.3rem .55rem; border-radius:999px;
  background:var(--test-soft); color:var(--test); border:1px dashed var(--test); }
.ed-grid { display:grid; grid-template-columns:minmax(0, 1fr); gap:.9rem; padding:.9rem; }
@media (min-width:900px) {
  .ed-grid { grid-template-columns:minmax(300px, 380px) minmax(0, 1fr); align-items:start; }
  .ed-preview { position:sticky; top:12px; }
}
.ed-preview { min-width:0; }
.ed-issues { list-style:none; margin:.5rem 0 0; padding:0; display:grid; gap:.35rem; font-size:.82rem; }
.ed-issues li { padding:.45rem .6rem; border-radius:8px; }
.ed-issues .error { background:var(--stop-soft); color:var(--stop); font-weight:600; }
.ed-issues .warn { background:var(--warn-soft); color:var(--warn); }

/* Actions */
.ed-actions { display:flex; flex-wrap:wrap; gap:.4rem; position:sticky; top:0; z-index:2; background:#fff; padding:.2rem 0 .4rem; }
.ed-btn { font:600 .9rem/1 "Inter",sans-serif; color:var(--ink); background:#fff; border:2px solid var(--line); border-radius:10px; padding:.6rem .85rem;
  min-height:44px; cursor:pointer; display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; }
.ed-btn:hover { border-color:var(--accent); }
.ed-btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.ed-btn.primary:hover { background:var(--accent-ink); }
.ed-btn:disabled, .ed-btn[aria-disabled="true"] { opacity:.5; cursor:not-allowed; }
.ed-btn.small { font-size:.8rem; padding:.45rem .65rem; min-height:36px; }
.ed-btn kbd { font:600 .68rem/1 ui-monospace,Consolas,monospace; border:1px solid currentColor; border-radius:4px; padding:.1rem .25rem; opacity:.75; }
.ed button:focus-visible, .ed input:focus-visible, .ed textarea:focus-visible, .ed a:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
.ed-said { margin:.2rem 0 .6rem; font-size:.85rem; color:var(--muted); min-height:1.3em; }
.ed-plan { border:2px solid var(--accent); border-radius:12px; padding:.6rem .7rem; margin-bottom:.7rem; background:var(--accent-tint); font-size:.85rem; }
.ed-plan-k { margin:.2rem 0; font-weight:600; }
.ed-plan pre { margin:.2rem 0 .5rem; padding:.5rem .6rem; background:#fff; border:1px solid var(--line); border-radius:8px; overflow-x:auto; white-space:pre-wrap; overflow-wrap:anywhere; font:500 .75rem/1.45 ui-monospace,Consolas,monospace; }
.ed-plan .json { max-height:16rem; overflow:auto; }
.ed-plan-row { display:flex; gap:.4rem; flex-wrap:wrap; margin:.3rem 0 0; }

/* Elements */
.ed-els { display:grid; gap:.55rem; }
.ed-el { border:2px solid var(--line); border-radius:12px; padding:.6rem .7rem; min-width:0; }
.ed-el.child { margin-left:.9rem; background:var(--band); border:1px solid var(--line); }
.ed-el.locked { border-color:var(--accent); background:var(--accent-tint); }
.ed-el.clash { border-color:var(--stop); box-shadow:inset 0 0 0 1px var(--stop); }
.ed-el.off .ed-chips, .ed-el.off input, .ed-el.off textarea, .ed-el.off .ed-up, .ed-el.off .ed-audio { opacity:.45; }
.ed-el.fixed { background:var(--test-soft); border-style:dashed; border-color:var(--test); }
.ed-el-head { display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; }
.ed-name { font:700 .9rem/1.2 "Inter",sans-serif; margin-right:auto; }
.ed-help, .ed-reason, .ed-lockmsg { margin:.3rem 0 0; font-size:.78rem; color:var(--muted); }
.ed-lockmsg { color:var(--accent-ink); font-weight:600; }
.ed-fixed { font:700 .66rem/1 "Inter"; text-transform:uppercase; letter-spacing:.05em; color:var(--test); }

/* Switch and lock buttons */
.tog, .lock { display:inline-flex; align-items:center; gap:.35rem; min-height:36px; padding:.3rem .6rem; border:2px solid var(--line); border-radius:999px; background:#fff;
  font:600 .78rem/1 "Inter",sans-serif; color:var(--ink); cursor:pointer; }
.tog i { width:30px; height:18px; border-radius:999px; background:#c9d1d9; position:relative; transition:background .15s; }
.tog i::after { content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; transition:transform .15s; }
.tog[aria-pressed="true"] i { background:var(--ok); }
.tog[aria-pressed="true"] i::after { transform:translateX(12px); }
.lock i { width:12px; height:10px; border-radius:2px; background:var(--muted); position:relative; margin-top:5px; }
.lock i::before { content:""; position:absolute; left:2px; top:-7px; width:8px; height:9px; box-sizing:border-box; border:2px solid var(--muted); border-bottom:0; border-radius:5px 5px 0 0; transform:translateX(3px); }
.lock[aria-pressed="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }
.lock[aria-pressed="true"] i { background:#fff; }
.lock[aria-pressed="true"] i::before { border-color:#fff; transform:none; }

/* Choice chips with samples */
.ed-chips { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.5rem; }
.chip { display:inline-flex; flex-direction:column; align-items:center; gap:.25rem; padding:.3rem; min-width:64px; min-height:44px; border:2px solid var(--line); border-radius:10px;
  background:#fff; font:600 .74rem/1.15 "Inter",sans-serif; color:var(--ink); cursor:pointer; text-align:center; }
.chip:hover { border-color:var(--accent); }
.chip[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-tint); box-shadow:inset 0 0 0 1px var(--accent); }
.chip[aria-pressed="true"] .cl::before { content:"\2713 "; color:var(--accent-ink); }
.chip[aria-disabled="true"] { cursor:not-allowed; }
.chip[aria-disabled="true"]:not([aria-pressed="true"]) { opacity:.55; }
.chip.txt { flex-direction:row; padding:.45rem .6rem; max-width:100%; }
.ideas .chip { font-weight:500; }
.smp { display:block; }
.smp.img { position:relative; width:64px; border-radius:6px; overflow:hidden; background:var(--band); }
.smp.img img { display:block; width:100%; height:auto; }
.smp .vid { position:absolute; right:3px; bottom:3px; width:16px; height:16px; border-radius:50%; background:rgba(0,0,0,.6); }
.smp .vid::after { content:""; position:absolute; left:6px; top:4px; border:4px solid transparent; border-left:6px solid #fff; border-right:0; }
.smp.sw { width:40px; height:28px; border-radius:6px; border:1px solid var(--line); }
.smp.spot { width:30px; height:44px; border-radius:5px; background:var(--band); border:1px solid var(--line); position:relative; }
.smp.spot i { position:absolute; width:9px; height:9px; margin:-4.5px 0 0 -4.5px; border-radius:2px; background:var(--accent); }
.smp.txt { font:500 .68rem/1.2 "Inter",sans-serif; color:var(--muted); max-width:9rem; }
.ed-el input[type=text], .ed-el textarea { width:100%; margin-top:.45rem; font:500 .95rem/1.35 "Inter",sans-serif; border:2px solid var(--line); border-radius:8px; padding:.55rem .6rem; color:var(--ink); }
.ed-el input[type=text]:focus, .ed-el textarea:focus { border-color:var(--accent); }
.ed-el input[readonly], .ed-el textarea[readonly] { background:var(--accent-tint); }
.ed-up { display:block; margin-top:.5rem; font-size:.78rem; color:var(--muted); }
.ed-up input { display:block; margin-top:.25rem; font-size:.8rem; max-width:100%; }
.ed-audio { width:100%; margin-top:.45rem; height:36px; }

/* Preview: caption video (sizes in cqw: 1cqw = 7.2 px of the 720 px render) */
.pv-stage { position:relative; width:100%; max-width:380px; margin:0 auto; aspect-ratio:9 / 16; border-radius:12px; overflow:hidden; background:#222; container-type:inline-size; }
.pv-poster, .pv-real { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.pv-real { z-index:5; background:#000; }
.pv-logo { position:absolute; z-index:3; height:auto; }
.pv-logo.own-badge { background:rgba(255,255,255,.94); border-radius:25%; padding:1.6cqw; box-sizing:border-box; }
.pv-head { position:absolute; z-index:2; left:9.7cqw; right:9.7cqw; top:20.8cqw; text-align:center; font-weight:700; font-size:7.2cqw; line-height:1.15; color:#fff;
  background:var(--primary); padding:2cqw 2.6cqw; border-radius:1.2cqw; }
.pv-cta { position:absolute; z-index:2; left:50%; transform:translateX(-50%); bottom:16.7cqw; white-space:nowrap; font-weight:700; font-size:6.6cqw; color:#111;
  background:var(--accent); padding:2cqw 3cqw; border-radius:1.2cqw; }
.pv-cap { position:absolute; z-index:2; left:5.6cqw; right:5.6cqw; text-align:center; font-weight:700; font-size:8.9cqw; line-height:1.2; color:#fff; }
.pv-stage[data-pos="low"] .pv-cap { bottom:46.2cqw; }
.pv-stage[data-pos="middle"] .pv-cap { bottom:85.3cqw; }
.pv-stage[data-pos="high"] .pv-cap { top:39cqw; }
.pv-cap .w { display:inline-block; text-shadow:0 0 .7cqw #111, 0 0 .7cqw #111, .3cqw .3cqw 0 rgba(0,0,0,.5); }
.pv-cap .w.on { color:var(--accent); }
.st-box .w { text-shadow:none; background:var(--primary); padding:0 1cqw; margin:0 -.6cqw; }
.st-box { font-size:8.3cqw; }
.st-pop .w.on { transform:scale(1.18); }
.st-minimal { font-size:7.2cqw; }
.st-minimal .w { text-shadow:0 0 .3cqw #111; }
.st-wordpop .w.fut { visibility:hidden; }
.st-wordpop .w.on { animation:pv-pop .13s ease-out; }
.st-bounce .w.on { transform:translateY(-3cqw); }
.st-typewriter .w.fut { display:none; }
.st-typewriter { display:inline-block; left:50%; right:auto; transform:translateX(-50%); white-space:nowrap; background:var(--primary); padding:0 1.6cqw; font-size:8cqw; }
.st-typewriter .w { text-shadow:none; }
.st-typewriter .cursor { color:var(--accent); }
.st-sweep .w.past, .st-sweep .w.on { color:var(--accent); }
.st-sweep .w.on { background:linear-gradient(90deg, var(--accent) 55%, #fff 55%); -webkit-background-clip:text; background-clip:text; color:transparent; }
.st-perword-box .w.on { background:var(--primary); color:#fff; text-shadow:none; padding:0 1.2cqw; border-radius:.6cqw; }
.st-underline .w.on { box-shadow:0 1.6cqw 0 -.4cqw var(--accent); }
.st-twotone { font-size:8cqw; }
.st-twotone .ln { display:block; }
.st-twotone .ln.a .w { color:var(--accent); }
.st-twotone .w.fut { opacity:.7; }
.st-headline { font-size:6.1cqw; }
.st-emoji .emo { display:block; font-size:12.8cqw; margin-bottom:1cqw; animation:pv-pop .26s ease-out; }
@keyframes pv-pop { from { transform:scale(.4); opacity:0; } to { transform:scale(1); opacity:1; } }
.pv-bar { display:flex; gap:.4rem; flex-wrap:wrap; justify-content:center; margin-top:.5rem; }
.pv-meta { margin:.45rem 0 0; font-size:.78rem; color:var(--muted); text-align:center; }

/* Preview: card (drawn at 1080 x 1350 and scaled to fit) */
.pv-card-wrap { width:100%; max-width:380px; margin:0 auto; overflow:hidden; border-radius:10px; border:1px solid var(--line); }
.pv-card-scale { transform-origin:0 0; width:1080px; }

@media (prefers-reduced-motion: reduce) {
  .ed *, .ed *::before, .ed *::after { animation:none !important; transition:none !important; }
  .st-pop .w.on, .st-bounce .w.on { transform:none; }
}

/* W-0229 smart place: drag to place, "Show what we avoid", and the W-0230 emphasis and contrast previews.
   No side borders (W-0228): every box here has a full outline or a fill. */
.pv-drag { cursor:grab; touch-action:none; user-select:none; }
.pv-drag.dragging { cursor:grabbing; outline:2px dashed #fff; outline-offset:.8cqw; }
.pv-drag:focus-visible { outline:3px solid #fff; outline-offset:.8cqw; box-shadow:0 0 0 1.6cqw rgba(0,0,0,.45); }
.pv-avoid { position:absolute; inset:0; z-index:1; pointer-events:none; }
.pv-avoid i { position:absolute; box-sizing:border-box; border-radius:1cqw; }
.pv-avoid .face { border:.6cqw solid #ff5a5a; background:rgba(255,90,90,.16); }
.pv-avoid .person { border:.4cqw dashed rgba(255,200,90,.9); background:rgba(255,200,90,.08); }
.pv-avoid .zone { background:repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 1.2cqw, rgba(255,255,255,0) 1.2cqw 2.4cqw); }
.pv-avoid .subject { border:.4cqw dotted rgba(120,200,255,.95); }
.pv-avoid-key { display:flex; flex-wrap:wrap; gap:.4rem .9rem; justify-content:center; margin:.4rem 0 0; font-size:.78rem; color:var(--muted); }
.pv-avoid-key .k::before { content:""; display:inline-block; width:12px; height:12px; margin-right:.3rem; vertical-align:-2px; border-radius:3px; box-sizing:border-box; }
.pv-avoid-key .face::before { border:2px solid #ff5a5a; background:rgba(255,90,90,.16); }
.pv-avoid-key .person::before { border:2px dashed #d99a20; }
.pv-avoid-key .zone::before { background:repeating-linear-gradient(45deg, #9aa5b1 0 3px, transparent 3px 6px); border:1px solid #9aa5b1; }
.pv-avoid-key .subject::before { border:2px dotted #3a8fd6; }
.pv-cap .w.key { transform:scale(1.25); text-decoration:underline; text-decoration-thickness:.5cqw; text-underline-offset:.8cqw; margin:0 1.2cqw; }
.pv-cap.scrim { background:rgba(0,0,0,.45); border-radius:2.5cqw; padding:1cqw 0; }
.ed-places { list-style:none; margin:.3rem 0 0; padding:0; display:grid; gap:.35rem; }
.ed-places li { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; font-size:.85rem; }
.ed-places .pl-name { font-weight:700; min-width:5.5em; }
.ed-places .pl-at { color:var(--muted); }
@media (prefers-reduced-motion: reduce) { .pv-cap .w.key { transform:none; } }
