.converter { --border:#334155; --muted:#94a3b8; }
.converter [hidden] { display:none !important; }
.converter h2 { font-size:1.2rem; font-weight:650; margin:0 0 1rem; }
.converter h3 { font-size:1.1rem; margin:1.5rem 0 .75rem; }
.upload-panel,.preview-panel,.settings-panel { background:#0f172a; border:1px solid var(--border); border-radius:1rem; padding:1.5rem; min-width:0; }
.upload-panel { margin-bottom:1.5rem; border-style:dashed; }
.upload-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.upload-heading h2 { margin-bottom:.5rem; }
.empty-preview { max-width:26rem; padding:2rem; text-align:center; color:#94a3b8; line-height:1.6; }
.empty-preview h3 { color:#e2e8f0; margin-top:0; }
.stage:has(.empty-preview:not([hidden])) { background:#020617; border:1px dashed #475569; }
.upload-panel.dragging { border-color:#a78bfa; background:#1e1b4b; }
.upload-panel p { margin:0; color:var(--muted); }
.button { display:inline-flex; align-items:center; justify-content:center; padding:.75rem 1rem; border-radius:.5rem; font-weight:600; cursor:pointer; text-decoration:none; border:1px solid transparent; line-height:1.4; }
.primary { color:white; background:#7c3aed; }
.primary:hover { background:#6d28d9; }
.secondary { color:#e2e8f0; background:#1e293b; border-color:#475569; }
.converter button:disabled,.file-label.disabled { opacity:.5; cursor:not-allowed; }
.converter :is(button,a,input,select,summary):focus-visible { outline:3px solid #c4b5fd; outline-offset:3px; }
.file-label { position:relative; overflow:hidden; margin:0; flex-shrink:0; }
.file-label input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.workspace { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr); align-items:start; gap:1.5rem; }
.stage { min-height:240px; padding:1rem; background:#020617; height:auto; display:flex; justify-content:center; align-items:center; border-radius:.5rem; overflow:hidden; margin:1rem 0; }
.renderer-host { position:fixed; left:-20000px; top:0; width:10000px; height:10000px; pointer-events:none; }
.renderer-host iframe { border:0; width:640px; height:360px; }
#frame-viewport { position:relative; overflow:hidden; max-width:100%; box-shadow:0 0 0 1px #475569; isolation:isolate; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-user-drag:none; cursor:grab; }
#frame-layer { position:absolute; inset:0; overflow:hidden; pointer-events:none; contain:strict; }
#frame-layer canvas { display:block; width:100%; height:100%; }
#frame-preview { display:block; max-width:100%; max-height:480px; object-fit:contain; cursor:grab; touch-action:none; box-shadow:0 0 0 1px #475569; }
#frame-viewport[data-dragging=true],#frame-viewport[data-dragging=true] #frame-preview { cursor:grabbing; }
#frame-viewport canvas { -webkit-user-drag:none; user-select:none; -webkit-user-select:none; }
.framing-settings { border-top:1px solid var(--border); padding-top:1rem; margin-top:1rem; }
.converter .framing-settings h3 { margin-top:0; }
.framing-settings output { float:right; width:6ch; text-align:right; color:var(--muted); font-variant-numeric:tabular-nums; }
.playback { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.playback output { font-variant-numeric:tabular-nums; color:#cbd5e1; }
.converter input[type=range] { width:100%; accent-color:#a78bfa; }
.converter fieldset { border:0; padding:0; margin:0; min-width:0; }
.converter label:not(.button) { display:block; font-size:.9rem; color:#cbd5e1; margin-bottom:1rem; }
.converter input:not([type=range],[type=checkbox],[type=file],[type=color]),.converter select { display:block; width:100%; padding:.65rem .75rem; margin-top:.4rem; background:#020617; color:#f1f5f9; border:1px solid #475569; border-radius:.5rem; min-width:0; }
.fields-row { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.unit { color:var(--muted); font-size:.8rem; }
.converter .check-label { display:flex; align-items:center; gap:.5rem; }
.converter label.colour-label { display:flex; align-items:center; justify-content:space-between; }
.converter input[type=color] { width:3rem; height:2.25rem; border:1px solid #475569; border-radius:.4rem; cursor:pointer; background:transparent; }
.hint { font-size:.85rem; color:var(--muted); line-height:1.6; margin:.75rem 0; }
.converter .advanced-settings { border-top:1px solid var(--border); padding-top:1rem; margin:1rem 0; }
.converter .advanced-settings h3 { margin-top:0; }
.converter :is(input,select):disabled { opacity:.55; cursor:not-allowed; }
.export-button { width:100%; }
.notice { border:1px solid #a78bfa; background:#1e1b4b; padding:1rem; border-radius:.5rem; margin-bottom:1.25rem; overflow-wrap:anywhere; }
.notice.error { border-color:#fb7185; background:#4c0519; }
.converter progress { display:block; width:100%; height:1rem; accent-color:#a78bfa; margin:1rem 0; }
#progress-panel { margin-top:1rem; }
#result video { width:100%; max-height:360px; background:#020617; margin-bottom:1rem; border-radius:.5rem; }
@media (max-width:850px) { .workspace { grid-template-columns:1fr; } .stage { min-height:220px; } }
@media (prefers-reduced-motion:reduce) { .converter * { scroll-behavior:auto; } }


@media (max-width:600px) { .upload-heading { align-items:stretch; flex-direction:column; } }
