:root{color-scheme:dark;--bg:#090e1b;--panel:#121b2d;--panel2:#0c1424;--line:#273651;--muted:#9aaac6;--text:#eef3ff;--accent:#9db4ff;--accent2:#7d8eff;--green:#8be3bd}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 15% 0%,#17274a 0%,transparent 36%),radial-gradient(ellipse at 95% 10%,#1c2449 0%,transparent 28%),var(--bg);color:var(--text);font:15px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;min-height:100vh}.wrap{max-width:1360px;margin:auto;padding:32px 22px 20px}.hero{display:flex;justify-content:space-between;align-items:center;gap:22px;padding:12px 2px 26px}.eyebrow{font-size:10px;letter-spacing:.18em;font-weight:800;color:#8fa8ff;margin-bottom:5px}.hero h1{margin:0;font-size:clamp(29px,4vw,42px);letter-spacing:-.045em;line-height:1.1}.hero h1 span{background:linear-gradient(100deg,#a6bbff,#9ee9d2);-webkit-background-clip:text;background-clip:text;color:transparent}.hero p{margin:10px 0 0;color:var(--muted);font-size:15px}.status{display:flex;align-items:center;gap:9px;padding:10px 14px;border:1px solid var(--line);border-radius:999px;font-size:12px;white-space:nowrap;background:#101a2c}.status i{width:7px;height:7px;border-radius:50%;background:#ff9d94}.status.ok i{background:#7fe1b5;box-shadow:0 0 13px #7fe1b577}.status.ok{color:#c5f5e0}.status.bad{color:#ffc2bb}.tabs{display:flex;gap:8px;flex-wrap:wrap;padding:7px;background:#0d1526;border:1px solid var(--line);border-radius:15px;margin-bottom:18px;position:sticky;top:8px;z-index:10;backdrop-filter:blur(14px)}.tab{background:transparent;color:#aebbd4;border:1px solid transparent;border-radius:10px;padding:12px 17px;font:inherit;font-weight:700;display:flex;align-items:center;gap:10px}.tab span{font-size:10px;letter-spacing:.08em;color:#7f91b7}.tab:hover{background:#18243a;color:#fff}.tab.active{background:linear-gradient(135deg,#9eb4ff,#c3ceff);color:#111a30;box-shadow:0 5px 18px #8295ff24}.tab.active span{color:#34476e}.tab-panel{display:none;animation:fadein .2s ease}.tab-panel.active{display:block}@keyframes fadein{from{opacity:.5;transform:translateY(3px)}to{opacity:1;transform:none}}.panel{background:linear-gradient(145deg,#141f34,#111a2c 65%);border:1px solid var(--line);border-radius:19px;padding:24px;margin:0 0 18px;box-shadow:0 12px 34px #00000014}.section-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}.section-head h2{font-size:21px;letter-spacing:-.025em;margin:0}.section-head .eyebrow{margin-bottom:3px}.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;background:#1b2940;border:1px solid #2d405f;border-radius:999px;color:#c0ccef;font-size:11px;overflow-wrap:anywhere}.step-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#202f4d;color:#aebfff;font-weight:850}.search{display:grid;grid-template-columns:minmax(220px,2fr) minmax(100px,.6fr) minmax(130px,.8fr) minmax(150px,.9fr) auto;gap:10px}input,select{width:100%;min-width:0;background:#0a1221;color:#f1f5ff;border:1px solid #30415f;border-radius:10px;padding:11px 12px;font:inherit;margin:6px 0 12px;outline:none;transition:border-color .15s,box-shadow .15s}input:focus,select:focus{border-color:#829cff;box-shadow:0 0 0 3px #829cff20}input[type=file]{padding:10px;font-size:12px;color:#b8c7e1}input[type=checkbox]{width:17px;height:17px;accent-color:#9bb2ff;margin:3px 0 0;flex:0 0 auto}input[type=range]{padding:0;border:0;box-shadow:none;accent-color:#9db4ff;margin:9px 0 3px;background:transparent}label{display:block;margin:8px 0 12px;color:#cbd6ec;font-size:13px;font-weight:650}label small{display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:3px}output{float:right;color:#aebfff;font-size:12px;font-weight:800}button{border:1px solid transparent;border-radius:10px;padding:11px 15px;font:inherit;font-size:13px;font-weight:800;cursor:pointer;transition:transform .15s,filter .15s,background .15s}button:hover:not(:disabled){filter:brightness(1.07);transform:translateY(-1px)}button:disabled{opacity:.4;cursor:not-allowed}.primary{background:linear-gradient(130deg,#a7bbff,#8fa4ff);color:#101a31;box-shadow:0 5px 16px #8295ff1c}.primary b{margin-left:8px;font-size:17px}.secondary{background:#1a2942;border-color:#344866;color:#dce6ff}.full{width:100%;margin-top:8px}.hint,.empty,small,footer{color:var(--muted);font-size:12px}.hint{margin:13px 0 0}.flash{padding:12px 16px;border-radius:12px;margin:0 0 15px;border:1px solid transparent;font-size:13px;overflow-wrap:anywhere}.success{background:#102e2a;border-color:#245c4e;color:#b5f2d7}.error{background:#361e2a;border-color:#6a3343;color:#ffd0d6}.cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}.upload-box{padding:13px;background:#0c1526;border:1px dashed #3b4e70;border-radius:13px;margin:12px 0}.upload-box button{width:100%}.subpanel{min-width:0;padding:16px;background:linear-gradient(150deg,#0e192c,#0b1424);border:1px solid #293a56;border-radius:15px}.subpanel h3{margin:0 0 8px;color:#e4ebff;font-size:15px}.subpanel h4{margin:16px 0 4px;color:#cbd6ec;font-size:12px}.divider{height:1px;background:var(--line);margin:18px 0}.file-list{list-style:none;padding:0;margin:8px 0 0}.file-list li{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #25334b}.file-dot{display:grid;place-items:center;width:29px;height:29px;border-radius:9px;background:#1b2b45;color:#aabaff;font-size:11px}.file-name{min-width:0;overflow-wrap:anywhere;font-size:12px}.file-name small{display:block;margin-top:3px}.empty{padding:15px;background:#0d1627;border:1px dashed #2b3a56;border-radius:12px}.empty.large{text-align:center;padding:35px}.export{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:16px 0}.table-wrap{overflow:auto;max-height:560px;border:1px solid var(--line);border-radius:12px}table{border-collapse:collapse;width:100%;font-size:12px}th,td{text-align:left;vertical-align:top;padding:11px;border-bottom:1px solid #26354e}th{position:sticky;top:0;background:#1a2942;color:#dce6ff;z-index:1}td strong{font-size:12px}td small{display:inline-block;margin-top:4px}.thumb{width:105px;border-radius:8px}.banner-upload{margin:4px 0 12px}.banner-file{display:flex;align-items:end;gap:14px}.banner-file label{flex:1;min-width:180px}.banner-file button{margin-bottom:12px;white-space:nowrap}.banner-chips{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 20px}.clip-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr));gap:16px;margin-top:17px}.clip{background:linear-gradient(150deg,#0d1729,#0a1220);border:1px solid #2b3c59;border-radius:16px;padding:13px;min-width:0;overflow:hidden}.clip video{display:block;width:100%;max-height:350px;aspect-ratio:9/16;object-fit:contain;background:#03060b;border-radius:10px;border:1px solid #1f2b40}.clip-meta{padding:8px 2px 4px}.clip-meta strong,.clip-meta small{display:block;overflow-wrap:anywhere;margin:4px 0}.clip-meta strong{font-size:12px}.banner-settings{border-top:1px solid #25344c;margin-top:10px;padding-top:12px}.form-title{font-size:13px;font-weight:850;color:#dce6ff;margin-bottom:7px}.field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check-row{display:flex;align-items:flex-start;gap:10px;padding:11px;background:#111f32;border:1px solid #2a3b55;border-radius:11px;font-weight:400}.check-row span{display:block;min-width:0}.check-row strong{display:block;color:#e2eaff;font-size:12px}.check-row small{display:block;margin-top:3px;line-height:1.45}.banner-settings button{margin-top:9px}a{color:#afc0ff;text-decoration:none}a:hover{text-decoration:underline}footer{display:flex;gap:8px;align-items:center;padding:17px 2px 5px;border-top:1px solid #1f2d44;margin-top:8px}footer span{font-weight:800;color:#9fb3ff}@media(max-width:1000px){.search{grid-template-columns:1fr 1fr}.search input:first-child{grid-column:1/-1}.cols{grid-template-columns:1fr}}@media(max-width:600px){.wrap{padding:20px 12px}.hero{align-items:flex-start;flex-direction:column}.tabs{position:static}.tab{flex:1;justify-content:center;padding:10px 8px;font-size:12px}.tab span{display:none}.panel{padding:17px;border-radius:15px}.search{grid-template-columns:1fr}.search input:first-child{grid-column:auto}.banner-file{display:block}.banner-file button{width:100%}.field-row{grid-template-columns:1fr}.section-head h2{font-size:19px}.export{align-items:flex-start;flex-direction:column}}


/* Blocking, informative status while FFmpeg runs */
.processing-overlay{position:fixed;inset:0;z-index:9999;background:rgba(4,9,20,.82);backdrop-filter:blur(7px);display:flex;align-items:center;justify-content:center;padding:24px}.processing-overlay[hidden]{display:none}.processing-card{width:min(540px,100%);padding:30px;border:1px solid #344664;border-radius:22px;background:#101a2d;color:#eaf1ff;box-shadow:0 24px 90px rgba(0,0,0,.45);text-align:center}.processing-card h2{margin:18px 0 8px}.processing-card p{color:#b8c9e7;line-height:1.6}.processing-card small{display:block;color:#91a8cc;line-height:1.5;margin-top:14px}.processing-spinner{width:44px;height:44px;margin:auto;border:4px solid #2b3d5e;border-top-color:#9eb6ff;border-radius:50%;animation:cf-spin .8s linear infinite}.processing-track{height:6px;background:#263650;border-radius:9px;overflow:hidden;margin-top:22px}.processing-track span{display:block;width:35%;height:100%;background:#9eb6ff;border-radius:9px;animation:cf-progress 1.8s ease-in-out infinite alternate}@keyframes cf-spin{to{transform:rotate(360deg)}}@keyframes cf-progress{from{transform:translateX(-20%)}to{transform:translateX(210%)}}

/* Live montage canvas with draggable/resizable layers */
.live-layout{margin-bottom:18px}.live-stage{position:relative;width:min(100%,360px);aspect-ratio:9/16;margin:16px auto;background:#05070d;border:1px solid #344563;border-radius:12px;overflow:hidden;touch-action:none;isolation:isolate}.live-stage video#stage-main{position:absolute;left:50%;top:25%;width:100%;height:50%;object-fit:contain;transform:translate(-50%,-50%);z-index:1;background:#090d16;outline:1px dashed #64748b;touch-action:none}.live-stage .stage-object{position:absolute;display:block;max-width:none;max-height:none;height:auto;object-fit:contain;outline:2px solid #6ca9ff;box-shadow:0 0 0 1px #0b1220;cursor:move;touch-action:none;z-index:4}.live-stage #stage-banner,.live-stage #stage-banner-video{outline-color:#70e1a1;z-index:6}.live-stage .resize-handle{position:absolute;width:18px;height:18px;right:-1px;bottom:-1px;background:#8fb5ff;border:2px solid #fff;border-radius:4px;cursor:nwse-resize;z-index:10;touch-action:none}.live-stage #stage-banner .resize-handle{background:#70e1a1}.stage-label{position:absolute;z-index:8;font-size:10px;font-weight:800;background:#101a2bd9;color:#fff;padding:4px 6px;border-radius:5px;pointer-events:none}.main-label{top:8px;left:8px}.asmr-label{bottom:8px;left:8px}.banner-label{top:8px;right:8px;color:#70e1a1}.stage-help{font-size:12px;color:#9db0cf;text-align:center;line-height:1.5}.live-stage.split-mode #stage-main{height:auto;max-height:50%;object-fit:contain}.live-stage.split-mode #stage-asmr{height:50%;object-fit:contain;outline:1px dashed #6ca9ff}.live-stage.split-mode #stage-banner,.live-stage.split-mode #stage-banner-video{z-index:8}

/* Batch clip picker */
select[multiple] { min-height: 150px; padding: 8px; }
select[multiple] option { padding: 6px 8px; border-radius: 5px; }

/* Reliable batch selection and real video resize handles */
.batch-picker{padding:12px;border:1px solid #2b3a56;border-radius:12px;background:#0b1424;margin:12px 0;display:grid;gap:10px}.batch-actions{display:flex;gap:8px;flex-wrap:wrap}.batch-list{display:grid;gap:6px;max-height:260px;overflow:auto;padding:4px}.batch-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid #263650;border-radius:8px;background:#101b2e;cursor:pointer}.batch-item input{width:18px;height:18px;flex:0 0 auto}.batch-item span{display:grid;gap:3px;min-width:0}.batch-item small{color:#9db0cf}.live-stage video#stage-main{height:auto;max-width:none;max-height:100%;object-fit:contain;outline:2px solid #647fe5;z-index:3;cursor:move;touch-action:none}live-stage.split-mode #stage-main{max-height:50%}

.live-stage .main-resize-handle{position:absolute;width:14px;height:14px;background:#8fb5ff;border:2px solid #fff;border-radius:50%;z-index:12;touch-action:none;pointer-events:auto}.live-stage .main-resize-handle.corner-nw{cursor:nwse-resize}.live-stage .main-resize-handle.corner-ne{cursor:nesw-resize}.live-stage .main-resize-handle.corner-sw{cursor:nesw-resize}.live-stage .main-resize-handle.corner-se{cursor:nwse-resize}

/* Auto-constructor and true corner/edge resizing */
.constructor-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.preset-card{display:flex;flex-direction:column;gap:8px;text-align:left;padding:18px;border:1px solid var(--line,#ccd3dd);border-radius:14px;background:var(--panel,#fff);color:inherit;cursor:pointer;min-height:120px}
.preset-card strong{font-size:1rem}.preset-card span{font-size:.88rem;opacity:.8;line-height:1.4}.preset-card.chosen{border:2px solid #2477f3;box-shadow:0 0 0 3px #2477f322}
.live-stage{position:relative;overflow:hidden;touch-action:none}
#stage-main,#stage-asmr,#stage-banner{position:absolute;box-sizing:border-box;touch-action:none;user-select:none}
#stage-main{left:0;top:0;max-width:none;max-height:none}
#stage-asmr{left:50%;top:75%;transform:none;max-width:none;max-height:none}
#stage-banner{left:50%;top:85%;transform:none;max-width:none;max-height:none}
.corner-handle{position:absolute!important;display:block!important;width:12px;height:12px;border:2px solid white;border-radius:50%;background:#2878ff;box-shadow:0 0 0 1px #174a9b;z-index:30;touch-action:none}
.corner-nw{left:-6px;top:-6px;cursor:nwse-resize}.corner-n{left:calc(50% - 6px);top:-6px;cursor:ns-resize}.corner-ne{right:-6px;top:-6px;cursor:nesw-resize}.corner-e{right:-6px;top:calc(50% - 6px);cursor:ew-resize}.corner-se{right:-6px;bottom:-6px;cursor:nwse-resize}.corner-s{left:calc(50% - 6px);bottom:-6px;cursor:ns-resize}.corner-sw{left:-6px;bottom:-6px;cursor:nesw-resize}.corner-w{left:-6px;top:calc(50% - 6px);cursor:ew-resize}
#stage-main .corner-handle{background:#2878ff}#stage-asmr .corner-handle{background:#2878ff}#stage-banner .corner-handle{background:#22a06b}
@media(max-width:760px){.constructor-grid{grid-template-columns:1fr}}

.corner-handle{position:absolute!important;z-index:60!important;pointer-events:auto!important}.main-handle{background:#2878ff!important}.asmr-handle{background:#2878ff!important}.banner-handle{background:#22a06b!important}

/* Final preview fixes: a true 9:16 stage with independent video geometry */
#live-stage{position:relative!important;width:min(100%,360px)!important;aspect-ratio:9/16!important;overflow:hidden!important;isolation:isolate!important}
#live-stage #stage-main,#live-stage #stage-asmr,#live-stage #stage-banner,#live-stage #stage-banner-video{position:absolute!important;display:block;max-width:none!important;max-height:none!important;object-fit:fill!important;box-sizing:border-box!important;transform:translate(-50%,-50%)!important;cursor:move!important;touch-action:none!important}
#live-stage #stage-main{z-index:2!important;outline:2px solid #4388ff!important;background:#05070d!important}
#live-stage #stage-asmr{z-index:4!important;outline:2px solid #4388ff!important}
#live-stage #stage-banner,#live-stage #stage-banner-video{z-index:6!important;outline:2px solid #45ce8b!important}
#live-stage .corner-handle{position:absolute!important;width:12px!important;height:12px!important;padding:0!important;margin:0!important;border:2px solid #fff!important;border-radius:50%!important;background:#2878ff!important;box-shadow:0 0 0 1px #174a9b!important;z-index:100!important;display:block;pointer-events:auto!important;transform:none!important}
#live-stage .corner-handle.banner-handle{background:#22a06b!important}
#live-stage .corner-handle.corner-nw{cursor:nwse-resize!important}#live-stage .corner-handle.corner-n{cursor:ns-resize!important}#live-stage .corner-handle.corner-ne{cursor:nesw-resize!important}#live-stage .corner-handle.corner-e{cursor:ew-resize!important}#live-stage .corner-handle.corner-se{cursor:nwse-resize!important}#live-stage .corner-handle.corner-s{cursor:ns-resize!important}#live-stage .corner-handle.corner-sw{cursor:nesw-resize!important}#live-stage .corner-handle.corner-w{cursor:ew-resize!important}
#live-stage .stage-label{z-index:110!important;pointer-events:none!important}

/* Distinct resize handles: main clip blue, ASMR violet, banner green */
#live-stage .corner-handle.main-handle{background:#2878ff!important;box-shadow:0 0 0 2px #164cba!important}
#live-stage .corner-handle.asmr-handle{background:#c45cff!important;box-shadow:0 0 0 2px #7022a5!important}
#live-stage .corner-handle.banner-handle{background:#28c76f!important;box-shadow:0 0 0 2px #137a40!important}
#live-stage #stage-banner{background:transparent!important;border:0!important;outline:2px solid #28c76f!important}
#live-stage #stage-asmr{background:transparent!important;outline:2px solid #c45cff!important}
#live-stage #stage-main{background:transparent!important;outline:2px solid #2878ff!important}
#live-stage #stage-banner-video{outline:2px solid #28c76f!important}

/* No placeholder fill: empty or transparent assets must never cover the preview */
#live-stage #stage-main,#live-stage #stage-asmr,#live-stage #stage-banner,#live-stage #stage-banner-video{background:transparent!important}
#live-stage #stage-banner{color:transparent!important}
#live-stage video:empty{background:transparent!important}

#live-stage #stage-main,#live-stage #stage-asmr,#live-stage #stage-banner-video{background:transparent!important;background-color:transparent!important}
#live-stage #stage-main:not([src]),#live-stage #stage-asmr:not([src]){display:none!important}

/* Prevent empty banner image / video elements from painting a green placeholder */
#live-stage,#live-stage #stage-main,#live-stage #stage-asmr,#live-stage #stage-banner,#live-stage #stage-banner-video{background-color:transparent!important}
#live-stage #stage-banner:not([src]),#live-stage #stage-banner[src=""]{display:none!important}
#live-stage #stage-banner-video:not([src]),#live-stage #stage-banner-video[src=""]{display:none!important}

#live-stage #stage-banner-keyed{position:absolute!important;z-index:7!important;max-width:none!important;max-height:none!important;object-fit:fill!important;transform:translate(-50%,-50%)!important;pointer-events:none!important;outline:2px solid #28c76f!important;background:transparent!important}

.quick-template-picker{border:1px solid #5c76b2!important;background:rgba(30,48,79,.55)!important;margin-bottom:16px!important}
.quick-template-picker select{min-width:260px;width:100%;min-height:42px}
.quick-template-picker .field-row{align-items:end}
#editor-template-status{min-height:1.2em}

/* Banner sizing defaults: 50% width x 50% height equals 25% of the 9:16 frame area. */

.job-live-panel{border:1px solid #34496c!important;background:rgba(8,15,29,.92)!important}
.job-live-summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;color:#c6d6f7;font-size:13px;margin:10px 0}
.job-live-track{height:7px;border-radius:99px;background:#25334d;overflow:hidden;margin:10px 0}
.job-live-track span{display:block;height:100%;width:0;background:#8faaff;transition:width .35s ease}
#job-live-log{display:block;max-height:220px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:#050b14;border:1px solid #273651;border-radius:8px;padding:12px;color:#c4d3ec;font:12px/1.55 Consolas,monospace;margin:10px 0 0}

/* Iteration 03: deterministic preview stacking and reliable mouse dragging */
#live-stage{position:relative;isolation:isolate;touch-action:none}
#live-stage #stage-asmr{pointer-events:auto}
#live-stage #stage-main{pointer-events:auto}
#live-stage #stage-banner,#live-stage #stage-banner-video,#live-stage #stage-banner-keyed{pointer-events:auto;z-index:10!important;cursor:grab!important}
#live-stage #stage-banner:active,#live-stage #stage-banner-video:active,#live-stage #stage-banner-keyed:active{cursor:grabbing!important}
#live-stage[data-layout-mode="background"] #stage-asmr{left:50%!important;top:50%!important;width:100%!important;height:100%!important;object-fit:cover!important;filter:blur(5px) brightness(.55)!important;z-index:1!important}
#live-stage[data-layout-mode="background"] #stage-main{z-index:3!important;object-fit:contain!important}
#live-stage[data-layout-mode="overlay"] #stage-asmr{z-index:4!important}
#live-stage .stage-label{pointer-events:none!important}
.inline-check{display:flex;align-items:center;gap:9px;margin:10px 0}
.inline-check input{width:auto;min-width:18px;min-height:18px}
/* Iteration 04: the preview and its controls are siblings inside the editor form,
   so the grid must be applied to the form, not to .live-layout alone. */
@media(min-width:1050px){
  #unified-editor{display:grid;grid-template-columns:minmax(340px, min(42%, 460px)) minmax(380px,1fr);grid-auto-flow:row dense;align-items:start;column-gap:18px;row-gap:14px}
  #unified-editor>.quick-template-picker{grid-column:1/-1}
  #unified-editor>.live-layout{grid-column:1;grid-row:2;min-width:0;align-self:start}
  #unified-editor>.live-layout .live-stage{width:min(100%,360px);margin:16px auto}
  #unified-editor>.live-layout .stage-help{grid-column:1}
  #unified-editor>.job-live-panel{grid-column:1;grid-row:3;min-width:0}
  #unified-editor>.subpanel:not(.quick-template-picker):not(.live-layout):not(.job-live-panel){grid-column:2;min-width:0}
  #unified-editor>button[type=submit],#unified-editor>p.hint{grid-column:2;min-width:0}
}
@media(max-width:1049px){#unified-editor{display:flex;flex-direction:column}#unified-editor>.subpanel{width:100%;box-sizing:border-box}}



/* Iteration 06: robust editor two-column layout and restored layer locks. */
@media (min-width: 1050px) {
  body #unified-editor.banner-settings { display:grid !important; grid-template-columns:minmax(340px,400px) minmax(420px,1fr) !important; grid-auto-flow:row !important; align-items:start !important; column-gap:20px !important; row-gap:14px !important; }
  body #unified-editor > #quick-template-picker { grid-column:1 / -1 !important; grid-row:1 !important; }
  body #unified-editor > .live-layout { grid-column:1 !important; grid-row:2 / span 2 !important; width:100% !important; align-self:start !important; }
  body #unified-editor > .live-layout .live-stage { width:min(100%,360px) !important; margin:16px auto !important; }
  body #unified-editor > .job-live-panel { grid-column:1 !important; grid-row:4 !important; }
  body #unified-editor > .subpanel:not(#quick-template-picker):not(.live-layout):not(.job-live-panel) { grid-column:2 !important; width:100% !important; min-width:0 !important; }
  body #unified-editor > button[type=submit], body #unified-editor > p.hint { grid-column:2 !important; }
}
@media (max-width:1049px) { body #unified-editor.banner-settings { display:flex !important; flex-direction:column !important; gap:14px !important; } body #unified-editor > .subpanel { width:100% !important; } }
.layer-locks { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-top:12px; padding:10px 12px; border:1px solid #344866; border-radius:10px; background:#0b1424; font-size:12px; }
.layer-locks strong { width:100%; color:#e4ebff; }
.layer-locks label { display:flex; align-items:center; gap:7px; margin:0; font-size:12px; font-weight:500; }
.layer-locks input { width:16px; height:16px; margin:0; }


/* Iteration 08: keep the preview visible beside long controls while the right column scrolls. */
@media (min-width: 1050px) {
  body #unified-editor.banner-settings {
    display: grid !important;
    grid-template-columns: minmax(300px, 34vw) minmax(420px, 1fr) !important;
    align-items: start !important;
    column-gap: 20px !important;
  }
  body #unified-editor > .live-layout {
    grid-column: 1 !important; grid-row: 2 !important;
    position: sticky !important; top: 76px !important; align-self: start !important;
    max-height: calc(100vh - 88px) !important; overflow-y: auto !important;
    overscroll-behavior: contain; z-index: 5;
  }
  body #unified-editor > .live-layout .live-stage {
    width: min(100%, 360px, calc((100vh - 260px) * 0.5625)) !important;
    max-height: calc(100vh - 260px) !important; margin: 12px auto !important;
  }
  body #unified-editor > .layer-locks { grid-column: 1 !important; grid-row: 3 !important; }
  body #unified-editor > .job-live-panel { grid-column: 1 !important; grid-row: 4 !important; }
  body #unified-editor > .subpanel:not(.quick-template-picker):not(.live-layout):not(.job-live-panel) {
    grid-column: 2 !important; min-width: 0 !important; width: 100% !important;
  }
}


/* Iteration 12: visible bulk actions and QC report access */
.bulk-actions,.export-head-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:18px 0 8px}
.bulk-actions h3{margin:0}
.export-head-actions{margin:0}
.danger{background:#4a202d;border:1px solid #8b4051;color:#ffd9df}
.danger:disabled{opacity:.4;cursor:not-allowed}
.export-head-actions form,.bulk-actions form{margin:0}
.clip-meta .field-row{align-items:center}
@media(max-width:600px){.bulk-actions,.export-head-actions{align-items:stretch;flex-direction:column}.bulk-actions form,.export-head-actions form,.bulk-actions button,.export-head-actions button{width:100%}}


/* R17: automation log and restored editor layout styles */
@media (min-width: 1050px) {
  body #unified-editor.banner-settings {
    display: grid !important;
    grid-template-columns: minmax(340px, 400px) minmax(420px, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    column-gap: 20px !important;
    row-gap: 14px !important;
  }
  body #unified-editor > #quick-template-picker { grid-column: 1 / -1 !important; grid-row: 1 !important; }
  body #unified-editor > .live-layout { grid-column: 1 !important; grid-row: 2 / span 2 !important; width: 100% !important; align-self: start !important; }
  body #unified-editor > .live-layout .live-stage { width: min(100%, 360px) !important; margin: 16px auto !important; }
  body #unified-editor > .job-live-panel { grid-column: 1 !important; grid-row: 4 !important; }
  body #unified-editor > .subpanel:not(#quick-template-picker):not(.live-layout):not(.job-live-panel) { grid-column: 2 !important; width: 100% !important; min-width: 0 !important; }
  body #unified-editor > button[type=submit], body #unified-editor > p.hint { grid-column: 2 !important; }
}
@media (max-width: 1049px) {
  body #unified-editor.banner-settings { display: flex !important; flex-direction: column !important; gap: 14px !important; }
  body #unified-editor > .subpanel { width: 100% !important; }
}
.layer-locks { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-top:12px; padding:10px 12px; border:1px solid #344866; border-radius:10px; background:#0b1424; font-size:12px; }
.layer-locks strong { width:100%; color:#e4ebff; }
.layer-locks label { display:flex; align-items:center; gap:7px; margin:0; font-size:12px; font-weight:500; }
.layer-locks input { width:16px; height:16px; margin:0; }
.automation-log-panel{display:block!important;margin:0 0 16px;position:relative;z-index:1}.automation-log-panel #automation-log{display:block;min-height:72px;max-height:240px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.55 ui-monospace,Consolas,monospace;background:#080f1f;border:1px solid #293955;border-radius:10px;padding:12px;color:#dce6ff}.automation-log-panel .section-head{margin-bottom:10px}

/* Render queue (R27) */
.queue-badge{display:inline-flex;min-width:20px;height:20px;padding:0 6px;align-items:center;justify-content:center;border-radius:999px;background:var(--green);color:#0b1a14;font-size:11px}
.queue-controls{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.queue-controls label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.queue-btn{margin-top:8px}
.queue-stats{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.queue-list{display:grid;gap:10px}
.queue-job{padding:14px 16px;background:linear-gradient(150deg,#0e192c,#0b1424);border:1px solid #293a56;border-left:3px solid #3a4d70;border-radius:13px;min-width:0}
.queue-job.q-running{border-left-color:var(--accent)}.queue-job.q-done{border-left-color:var(--green)}
.queue-job.q-failed{border-left-color:#ff9d94}.queue-job.q-cancelled{opacity:.72}
.queue-job-head{display:flex;justify-content:space-between;gap:10px;align-items:center;overflow-wrap:anywhere}
.queue-status{font-size:11px;font-weight:800;letter-spacing:.04em;padding:3px 9px;border-radius:999px;background:#1b2940;white-space:nowrap}
.queue-status.q-running{color:#c9d5ff}.queue-status.q-done{color:var(--green)}.queue-status.q-failed{color:#ffb4ab}
.queue-sub,.queue-meta{color:var(--muted);font-size:12px;margin-top:4px;overflow-wrap:anywhere}
.queue-msg{font-size:13px;margin-top:6px;overflow-wrap:anywhere}
.queue-job.q-failed .queue-msg{color:#ffc2bb}
.queue-bar{height:6px;background:#273651;border-radius:99px;overflow:hidden;margin-top:9px}
.queue-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--accent2),var(--accent));transition:width .6s ease}
.queue-out{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.queue-out a{text-decoration:none}
.queue-actions{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap;margin-top:10px}
.queue-actions button{padding:7px 12px}
.queue-actions details{flex:1 1 260px;min-width:0}
.queue-actions summary{cursor:pointer;color:var(--muted);font-size:12px;padding:7px 0}
.queue-actions pre{max-height:220px;overflow:auto;background:#070d18;border:1px solid #273651;border-radius:10px;padding:10px;font:11px/1.55 ui-monospace,Consolas,monospace;white-space:pre-wrap;margin:6px 0 0}
.queue-toast{position:fixed;right:18px;bottom:18px;z-index:100000;max-width:min(440px,calc(100vw - 32px));padding:12px 16px;border-radius:12px;background:#15301f;border:1px solid #2e6a47;color:#d4f7e4;box-shadow:0 12px 40px #0008;font-size:14px}
.queue-toast.bad{background:#3a1820;border-color:#8b4051;color:#ffd9df}
.queue-badge[hidden]{display:none}
@media (min-width:1050px){body #unified-editor > .queue-btn{grid-column:2 !important}}

/* Conveyor (R28) */
.tab-toggle{background:transparent;color:#7f91b7;border:1px dashed #33476a;border-radius:10px;padding:10px 14px;font:inherit;font-size:13px;font-weight:700;margin-left:auto;cursor:pointer}
.tab-toggle:hover,.tab-toggle[aria-expanded="true"]{color:#dce6ff;border-color:#4a5f86}
.manual-tabs{display:flex;gap:8px;flex-wrap:wrap;width:100%;padding-top:6px;border-top:1px solid var(--line)}
.manual-tabs[hidden]{display:none}
.manual-tabs .tab{font-size:13px;padding:9px 14px}
.cv-libs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
@media (max-width:1100px){.cv-libs{grid-template-columns:1fr}}
.cv-lib{display:flex;flex-direction:column;gap:10px;min-height:220px}
.cv-lib-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.cv-lib-head h3{margin:0;display:flex;align-items:center;gap:8px}
.cv-lib .hint{margin:0;font-size:12px}
.cv-upload{display:inline-flex;align-items:center;cursor:pointer;padding:8px 14px;border-radius:10px;border:1px solid #344866;font-weight:700;font-size:13px;white-space:nowrap}
.cv-upload.busy{opacity:.6;pointer-events:none}
.cv-list{display:flex;flex-direction:column;gap:6px;max-height:340px;overflow:auto;padding-right:2px}
.cv-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:8px 10px;border:1px solid #243450;border-radius:10px;background:#0a1220;font-size:13px}
div.cv-item{grid-template-columns:minmax(0,1fr) auto auto}
.cv-item input{width:16px;height:16px;margin:0}
.cv-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cv-item small{color:var(--muted);white-space:nowrap}
.cv-del{background:transparent;border:1px solid transparent;color:#8d9bb8;border-radius:8px;width:28px;height:28px;padding:0;cursor:pointer;font-size:12px}
.cv-del:hover{color:#ffd9df;border-color:#8b4051;background:#3a1820}
.cv-banner-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.cv-banner{position:relative;margin:0;border:1px solid #243450;border-radius:10px;overflow:hidden;background:#0a1220 repeating-conic-gradient(#0f1a2c 0 25%,#0a1220 0 50%) 0 0/16px 16px}
.cv-banner img,.cv-banner video{display:block;width:100%;height:84px;object-fit:contain}
.cv-banner figcaption{font-size:11px;color:var(--muted);padding:5px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#0a1220}
.cv-banner .cv-del{position:absolute;top:4px;right:4px;background:#0a1220cc}
.cv-select-row{display:flex;gap:12px}
.link-btn{background:none;border:0;color:var(--accent);padding:0;font:inherit;font-size:12px;cursor:pointer}
.cv-yt summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700}
.cv-yt-form{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.cv-yt-form input{flex:1 1 160px;min-width:0}
.cv-yt-results{display:flex;flex-direction:column;gap:6px;margin-top:8px;max-height:320px;overflow:auto}
.cv-yt-item{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:8px;align-items:center;font-size:12px}
.cv-yt-item img{width:72px;height:40px;object-fit:cover;border-radius:6px}
.cv-yt-item a{color:var(--text);text-decoration:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cv-yt-item small{color:var(--muted)}
.cv-yt-item button{padding:6px 10px;font-size:12px}
.bad-text{color:#ffc2bb}
.cv-run{margin-top:14px}
.cv-run-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
@media (max-width:1100px){.cv-run-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.cv-run-grid{grid-template-columns:1fr}}
.cv-run fieldset{border:1px solid #243450;border-radius:12px;padding:12px;margin:0;display:flex;flex-direction:column;gap:8px;min-width:0}
.cv-run legend{padding:0 6px;font-weight:800;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#8fa8ff}
.cv-run .field-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.cv-run .field-row[hidden],.cv-run select[hidden]{display:none}
.cv-run .hint{font-size:12px;margin:0}
.cv-start{margin-top:14px;font-size:16px;padding:14px}
.cv-start:disabled{opacity:.55;cursor:not-allowed}
.cv-runs{display:grid;gap:10px}
.sample-clip{margin-bottom:14px}
.sample-clip-form{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.sample-clip-form h3{margin:0}
.cv-run .check-row{display:flex !important;align-items:flex-start;gap:10px;padding:9px 11px;margin:0;border:1px solid #243450;border-radius:10px;background:#0a1220;cursor:pointer;grid-template-columns:none}
.cv-run .check-row:has(input:checked){border-color:#5d74b8;background:#111d35}
.cv-run .check-row input{width:16px;height:16px;margin:2px 0 0;flex:none}
.cv-run .check-row span{display:flex;flex-direction:column;gap:2px;text-align:left}
.cv-run .check-row small{color:var(--muted);font-size:12px;line-height:1.35}
.cv-run label:not(.check-row){display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:700}
.cv-run input[type=number],.cv-run select{width:100%;min-width:0}

/* R29: auto search, template studio, trial clip, captions */
.cv-auto{margin-bottom:14px;background:linear-gradient(135deg,#13234a,#0e1a33);border-color:#3a4f86}
.cv-auto-row{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;gap:10px;align-items:end}
@media (max-width:760px){.cv-auto-row{grid-template-columns:1fr 1fr}.cv-auto-q{grid-column:1/-1}}
.cv-auto label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:700}
.cv-auto-q span{color:#c9d5ff;font-size:14px}
.cv-auto-q input{font-size:15px;padding:12px 14px}
.cv-auto-go{white-space:nowrap;padding:12px 18px}
.cv-auto-more{margin-top:10px}
.cv-auto-more summary,.cv-run details summary,.manual-uploads summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700}
.cv-auto-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px}
@media (max-width:900px){.cv-auto-grid{grid-template-columns:1fr 1fr}}
.cv-auto-wide{grid-column:1/-1}
.cv-auto .check-row{flex-direction:row;font-weight:400}
.cv-studio{margin-top:14px;display:flex;flex-direction:column;gap:12px}
.cv-studio-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}
.cv-studio-head h3{margin:0}.cv-studio-head .hint{margin:4px 0 0;font-size:12px}
.cv-studio-actions{display:flex;gap:8px;flex-wrap:wrap}
.cv-studio-actions button{padding:10px 16px}
.cv-studio-actions button:disabled{opacity:.5;cursor:not-allowed}
.tpl-bar{display:grid;grid-template-columns:minmax(180px,1.2fr) minmax(160px,1fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid #2d4170;border-radius:12px;background:#0d1730}
@media (max-width:820px){.tpl-bar{grid-template-columns:1fr}}
.tpl-field{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:700;min-width:0}
.tpl-buttons{display:flex;gap:8px}
.tpl-buttons button{padding:10px 14px;white-space:nowrap}
.tpl-state{grid-column:1/-1;font-size:12px;color:var(--green);min-height:1em}
.tpl-state.dirty{color:#ffd28a}
.tpl-state:empty{display:none}
#tab-editor .tpl-bar{margin:14px 0}
.tpl-bar-sticky{position:sticky;top:84px;z-index:8;box-shadow:0 8px 24px #0007}
.cv-editor-slot{border:1px solid #243450;border-radius:14px;padding:12px;background:#0a1220}
.cv-editor-slot #unified-editor > button.primary.full,.cv-editor-slot #unified-editor > .queue-btn,
.cv-editor-slot #unified-editor > p.hint:last-of-type,.cv-editor-slot .batch-picker{display:none !important}
.cv-trial{border:1px solid #2e6a47;border-radius:14px;padding:14px;background:#0c1a17}
.cv-trial-wait{display:flex;gap:14px;align-items:center}
.cv-trial-wait small{display:block;color:var(--muted)}
.cv-trial-wait .processing-spinner{width:30px;height:30px;flex:none}
.cv-trial-result{display:grid;grid-template-columns:minmax(200px,300px) minmax(0,1fr);gap:18px;align-items:start}
@media (max-width:700px){.cv-trial-result{grid-template-columns:1fr}}
.cv-trial-result video{width:100%;aspect-ratio:9/16;background:#000;border-radius:12px;border:1px solid #2e6a47}
.cv-trial-info strong{color:#d4f7e4}
.cv-caption{margin-top:10px;padding:10px 12px;border-radius:10px;background:#0a1220;border:1px solid #243450}
.cv-caption span{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#8fa8ff;font-weight:800}
.cv-caption p{margin:6px 0 0}.cv-tags{color:var(--accent)}
.cv-run details label{margin-top:8px}
.manual-uploads{margin:6px 0 4px}
.manual-uploads summary small{color:var(--muted);font-weight:400}
.manual-uploads[open] > .cols{margin-top:12px}
.cv-folder{margin:auto 0 0;font-size:11px;color:var(--muted);line-height:1.5;overflow-wrap:anywhere}
.cv-folder code{font:11px ui-monospace,Consolas,monospace;color:#c0ccef;background:#0a1220;border:1px solid #243450;border-radius:6px;padding:1px 5px}
.cv-run-grid{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))}
.cv-qc{font-size:13px;margin:8px 0 0;padding:7px 10px;border-radius:8px;background:#0a1220;border:1px solid #243450}
.cv-qc.ok{color:var(--green);border-color:#2e6a47}.cv-qc.bad{color:#ffc2bb;border-color:#8b4051}

/* R34: login + user chip */
.hero-side{display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.user-chip{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}
.user-chip span{color:var(--text);font-weight:700}
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:16px}
.login-card{width:min(100%,400px)}
.login-card h1{margin:0 0 16px;font-size:28px;letter-spacing:-.04em}
.login-card h1 span{background:linear-gradient(100deg,#a6bbff,#9ee9d2);-webkit-background-clip:text;background-clip:text;color:transparent}
.login-card code{color:var(--green)}
@media(max-width:600px){.hero-side{align-items:flex-start}}

/* R34: publisher tab */
.pub-state{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.pub-dot{width:9px;height:9px;border-radius:50%;background:#ffb86b}.pub-dot.on{background:var(--green);box-shadow:0 0 12px #7fe1b577}
.pub-counters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}.pub-counters b{color:var(--text)}
.pub-c-unknown b,.pub-c-failed b{color:#ffc2bb}
.pub-options{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;align-items:center;margin-bottom:16px}
.pub-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;margin-bottom:16px}
.pub-accounts{display:grid;gap:10px;margin-top:8px}
.pub-acc{border:1px solid #2b3c59;border-radius:12px;padding:12px;background:#0c1526;min-width:0}
.pub-acc-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.pub-acc-meta{color:var(--muted);font-size:12px;margin-top:4px;overflow-wrap:anywhere}
.pub-acc-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px}
.pub-acc-actions button{padding:8px 12px}.pub-del{color:#ffb4ab;margin-left:auto}
.pub-acc details summary,.pub-add summary,.pub-log summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700;margin-top:10px}
.pub-dry-row{display:flex;gap:8px;align-items:center}.pub-dry-row select{margin:6px 0}
.pub-dr{font-size:12px;margin:8px 0 0}.pub-dr.ok{color:var(--green)}.pub-dr.bad,.pub-err{color:#ffc2bb;font-size:12px;overflow-wrap:anywhere}
.pub-chip{display:inline-block;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:700;background:#1b2940;color:#c0ccef;white-space:nowrap}
.pub-chip.ok{background:#123326;color:var(--green)}.pub-chip.warn{background:#3a2a12;color:#ffd08a}.pub-chip.bad{background:#3a1a22;color:#ffc2bb}
.pub-chip.run{background:#1d2b55;color:#c9d5ff}.pub-chip.sched{background:#16263f;color:var(--accent)}
.pub-upcoming{display:grid;gap:6px;max-height:420px;overflow:auto;margin-top:8px}
.pub-slot{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px;padding:7px 9px;border:1px solid #23324b;border-radius:9px}
.pub-slot small{grid-column:1/-1;color:var(--muted);overflow-wrap:anywhere}
.pub-filter{display:flex;gap:12px}.pub-filter .active{color:var(--text);text-decoration:underline}
.pub-table td small{display:block;color:var(--muted)}.pub-name{max-width:280px;overflow-wrap:anywhere}
.pub-msg{max-width:320px;overflow-wrap:anywhere;color:var(--muted)}.pub-btns{white-space:nowrap}.pub-btns .link-btn{margin-right:10px}
.pub-queue-box{margin-bottom:16px}
.pub-events{max-height:360px;overflow:auto;font-size:12px;margin-top:8px}
.pub-ev{display:flex;gap:10px;padding:5px 0;border-bottom:1px solid #1f2d44}.pub-ev time{color:var(--muted);white-space:nowrap}
.pub-ev b{color:var(--accent)}.pub-ev span{overflow-wrap:anywhere}.pub-ev.error span{color:#ffc2bb}.pub-ev.warn span{color:#ffd08a}
.pub-shots{position:fixed;inset:0;background:#000b;z-index:50;display:grid;place-items:center;padding:16px}
.pub-shots[hidden]{display:none}
.pub-shots-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px;max-width:min(1100px,100%);max-height:90vh;overflow:auto}
.pub-shots-row{display:flex;gap:12px;overflow-x:auto;margin-top:10px}.pub-shots-row figure{margin:0;flex:0 0 220px}
.pub-shots-row img{width:100%;border-radius:8px;border:1px solid var(--line)}.pub-shots-row figcaption{font-size:11px;color:var(--muted)}
@media(max-width:1000px){.pub-grid,.pub-options{grid-template-columns:1fr}}
.pub-table{min-width:780px}
@media(max-width:600px){.pub-panel>.section-head{flex-direction:column;align-items:flex-start}.pub-filter{flex-wrap:wrap;gap:8px 12px}.pub-queue-box .cv-lib-head{flex-direction:column;align-items:flex-start;gap:6px}}
.pub-connect{display:flex;gap:8px;align-items:center}.pub-connect input{margin:6px 0}.pub-connect button{white-space:nowrap}
.pub-notice{margin-bottom:12px}
.pub-chips{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.pub-cookies textarea{width:100%;min-height:80px;background:#0a1221;color:#f1f5ff;border:1px solid #30415f;border-radius:10px;padding:10px;font:12px/1.4 ui-monospace,monospace;margin:6px 0}
.pub-adb{margin-top:12px}.pub-adb summary{cursor:pointer;color:var(--muted);font-size:13px;font-weight:700}
.pub-trends summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700;margin-top:10px}
.pub-tags{min-width:0}.pub-tags td small{color:var(--muted)}.pub-trends h4{margin:12px 0 4px;font-size:12px;color:#cbd6ec}
.pub-top{margin:0;padding-left:18px;font-size:12px}.pub-top li{margin:4px 0;overflow-wrap:anywhere}.pub-top small{color:var(--muted)}
.pub-src{color:var(--green);font-weight:700}
.pub-btn-link{display:inline-flex;align-items:center;padding:8px 12px;border-radius:10px;font-size:13px;font-weight:800;text-decoration:none}
.pub-btn-link:hover{text-decoration:none;filter:brightness(1.07)}
.pub-ext summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700;margin-top:10px}
.pub-steps{margin:8px 0;padding-left:20px;font-size:12px;line-height:1.6}.pub-steps li{margin:6px 0}
.pub-copy{display:flex;gap:8px;align-items:center;margin:4px 0;flex-wrap:wrap}.pub-copy span{color:var(--muted);min-width:44px}
.pub-copy code{background:#0a1221;border:1px solid var(--line);border-radius:6px;padding:3px 7px;overflow-wrap:anywhere}
.pub-inline-check{align-self:end}
.warm-list{display:grid;gap:14px}
.warm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:0 12px}
.warm-bar{height:6px;border-radius:999px;background:#1b2940;overflow:hidden;margin:10px 0 4px}.warm-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--accent2),var(--green))}
.warm-table{min-width:520px}.warm-settings summary{cursor:pointer;color:var(--accent);font-size:13px;font-weight:700;margin-top:10px}
.warm-live{margin:12px 0;padding:12px;border:1px solid #2e6a47;border-radius:12px;background:#0d1d18}
.warm-live.stale{border-color:#8b4051;background:#1e1016}
.warm-live-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.warm-live-head small{color:var(--muted)}
.warm-dot{width:9px;height:9px;border-radius:50%;background:var(--green);box-shadow:0 0 10px #7fe1b5;animation:warmpulse 1.4s infinite}
.warm-live.stale .warm-dot{background:#ffb4ab;box-shadow:none;animation:none}
@keyframes warmpulse{50%{opacity:.35}}
.warm-live-stats{display:flex;gap:18px;flex-wrap:wrap;margin:10px 0 4px;font-size:13px;color:var(--muted)}.warm-live-stats b{color:var(--text);font-size:18px;margin-right:4px}
.warm-now{font-size:12px;margin:6px 0;overflow-wrap:anywhere}
.warm-frame{margin-top:10px}.warm-frame img{display:block;max-width:100%;max-height:520px;border-radius:10px;border:1px solid var(--line)}
.warm-frame small{color:var(--muted)}.warm-wait{margin:8px 0}
.warm-next{margin:10px 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#0c1526;font-size:13px}
.warm-next small{color:var(--muted)}
.team-secret{margin:12px 0;padding:12px;border:1px solid #2e6a47;border-radius:12px;background:#0d1d18}
.team-secret pre{background:#0a1221;border:1px solid var(--line);border-radius:8px;padding:10px;white-space:pre-wrap;margin:8px 0}
.team-table td small{display:block;color:var(--muted)}.team-table select{margin:0;padding:6px 8px}
.acct-stats{margin:10px 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#0c1526;font-size:12px}
.acct-row{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:baseline}.acct-row b{color:var(--text);font-size:14px}
.acct-row span{color:var(--muted)}.acct-row small{color:var(--muted)}.acct-act{margin-top:6px}
.acct-row small.up{color:var(--green)}.acct-row small.down{color:#ffb4ab}
.warm-form textarea{width:100%;background:#0a1221;color:#f1f5ff;border:1px solid #30415f;border-radius:10px;padding:10px;font:inherit;margin:6px 0 12px}
/* ---------------- R42: phone layout ---------------- */
@media(max-width:600px){
 html{-webkit-text-size-adjust:100%}
 body{font-size:14px}
 .wrap{padding:8px 10px calc(16px + env(safe-area-inset-bottom))}
 .hero{flex-direction:row;align-items:center;justify-content:space-between;gap:8px;padding:4px 2px 10px}
 .hero .eyebrow,.hero p{display:none}
 .hero h1{font-size:21px;white-space:nowrap}
 .hero-side{flex-direction:row;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
 .hero-side .status{padding:5px 9px;font-size:10px}
 .tabs{position:sticky;top:0;z-index:30;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;
   margin:0 -10px 12px;padding:6px 10px;border-radius:0;border-left:0;border-right:0;gap:6px;background:#0d1526f2}
 .tabs::-webkit-scrollbar{display:none}
 .tabs .tab{flex:0 0 auto;white-space:nowrap;padding:9px 13px;font-size:13px}
 .tabs .tab-toggle{flex:0 0 auto;white-space:nowrap;padding:8px 12px;font-size:12px;margin:0}
 .tabs .manual-tabs:not([hidden]){display:contents}
 .panel{padding:14px 12px;border-radius:14px;margin-bottom:12px}
 .subpanel{padding:12px}
 .section-head{flex-wrap:wrap;margin-bottom:12px}
 input,select,textarea{font-size:16px}
 button{min-height:42px}
 .link-btn{min-height:0}
 .pub-acc,.warm-card{padding:12px}
 .table-wrap{max-height:none;border:0;overflow:visible}
 table.pub-table,table.warm-table{display:block;min-width:0;width:100%}
 table.pub-table thead,table.warm-table thead{display:none}
 table.pub-table tbody,table.warm-table tbody{display:grid;gap:8px}
 table.pub-table tr,table.warm-table tr{display:grid;grid-template-columns:1fr 1fr;gap:2px 10px;padding:10px 12px;
   background:#0d1729;border:1px solid #2b3c59;border-radius:12px}
 table.pub-table td,table.warm-table td{border:0;padding:3px 0;min-width:0;overflow-wrap:anywhere}
 table.pub-table td[data-label]::before,table.warm-table td[data-label]::before{content:attr(data-label);display:block;
   font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:#7f91b7;font-weight:700}
 table.pub-table td.pub-name,table.pub-table td.pub-msg,table.pub-table td.pub-btns{grid-column:1/-1}
 table.pub-table td.pub-btns{display:flex;flex-wrap:wrap;gap:4px 14px}
 table.pub-table td.pub-btns::before,table.pub-table td[data-label=""]::before{display:none}
 table.pub-table td.empty{grid-column:1/-1}
 .pub-btns .link-btn{padding:6px 0}
}
/* R42: remote browser screen */
.pub-screen-btn{margin:6px 0 10px}
.scr-overlay{position:fixed;inset:0;z-index:100;background:#03060bd9;display:flex;align-items:flex-start;justify-content:center;overflow:auto;padding:16px}
.scr-overlay[hidden]{display:none}
body.scr-open{overflow:hidden}
.scr-card{width:min(980px,100%);background:#111a2c;border:1px solid var(--line);border-radius:16px;padding:14px;display:grid;gap:10px}
.scr-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.scr-view{position:relative;background:#000;border-radius:10px;overflow:hidden;min-height:120px}
.scr-view img{display:block;width:100%;height:auto;cursor:crosshair;touch-action:manipulation}
.scr-wait{position:absolute;inset:0;display:grid;place-items:center;margin:0;color:var(--muted)}
.scr-wait[hidden]{display:none}
.scr-dot{position:absolute;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;border:2px solid #9db4ff;background:#9db4ff55;pointer-events:none;animation:scrdot .6s ease-out forwards}
@keyframes scrdot{to{transform:scale(1.8);opacity:0}}
.scr-url{color:var(--muted);overflow-wrap:anywhere}
.scr-type{display:flex;gap:8px}.scr-type input{margin:0}.scr-type button{white-space:nowrap}
.scr-keys{display:flex;flex-wrap:wrap;gap:6px}.scr-keys button{padding:8px 11px}
@media(max-width:600px){.scr-overlay{padding:0}.scr-card{border-radius:0;min-height:100%;padding:10px}}
.scr-view.zoom{overflow:auto;max-height:70vh}.scr-view.zoom img{width:240%;max-width:none}
.ok-text{color:#9ff0c9}.hero-side .status.bad{cursor:pointer}
.pub-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0}
/* R43: per-account publishing + bulk delete */
.pub-acc-go{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:10px 0 6px;padding:10px 12px;background:#0f1d33;border:1px solid #2c4166;border-radius:12px}
.pub-acc-go small{flex:1 1 220px}
.pub-acc-note{margin:6px 0}
.pub-select-bar{position:sticky;top:64px;z-index:9;display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 12px;margin:8px 0;background:#1d1830;border:1px solid #6a3343;border-radius:12px}
.pub-select-bar span{font-weight:700}
.pub-danger{background:linear-gradient(130deg,#ff9d94,#f27a8a);color:#2a0d12}
.pub-pick{display:inline-flex;margin:0 8px 0 0;align-items:center}
.pub-pick input{width:22px;height:22px;margin:0}
.pub-acc-selected{border-color:#f27a8a !important;box-shadow:0 0 0 2px #f27a8a44}
.cv-lib-head #pub-select-toggle{padding:7px 11px;font-size:12px}
@media(max-width:600px){.pub-select-bar{top:52px}}
.pub-proxy{margin:8px 0;padding:10px 12px;background:#0f1d33;border:1px solid #2c4166;border-radius:12px}.pub-proxy summary{cursor:pointer;font-weight:700}.pub-proxy code{font-size:11px}
/* R46: proxy pool */
.px-acc{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid #25334b;margin:0}
.px-acc span{min-width:0}.px-acc small{display:block;font-weight:400;color:var(--muted);overflow-wrap:anywhere}
.px-acc select{max-width:60%;margin:0}
.px-table code{font-size:11px;overflow-wrap:anywhere}
#proxy-root textarea{width:100%;min-height:120px;background:#0a1221;color:#f1f5ff;border:1px solid #30415f;border-radius:10px;padding:10px;font:13px/1.5 ui-monospace,Consolas,monospace;margin:6px 0 12px}
@media(max-width:600px){.px-acc{flex-direction:column;align-items:stretch}.px-acc select{max-width:none}}
/* R48: quick start */
.guide-panel{padding:18px 20px}
.guide-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.guide-head h2{margin:0;font-size:19px}
.guide-steps{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr))}
.guide-steps li{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#0f1d33;border:1px solid #2c4166;border-radius:12px}
.guide-steps li.ok{border-color:#245c4e;background:#0f2622}
.guide-steps li>div{flex:1;min-width:0}.guide-steps b{display:block;font-size:13px}.guide-steps small{display:block;color:var(--muted);font-size:11px;font-weight:400}
.guide-n{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:50%;background:#202f4d;color:#aebfff;font-weight:800}
.guide-steps li.ok .guide-n{background:#1b4a3d;color:#9ff0c9}
.guide-steps button{padding:7px 10px;font-size:12px;min-height:0;white-space:nowrap}
.guide-reopen{margin:0 0 10px;text-align:right}
@media(max-width:600px){.guide-panel{padding:12px}}
[hidden]{display:none !important}
.cv-lib-head #pub-add-open{padding:7px 11px;font-size:12px}
