:root {
  font-family: system-ui, sans-serif;
  color: #212037;
  background: #f5f4fa;
  line-height: 1.5;
  --line: #dcd8eb;
  --accent: #534090;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: white; border-bottom: 1px solid var(--line); padding: 1rem clamp(1rem, 5vw, 4rem); }
header a { color: var(--accent); font-weight: 750; text-decoration: none; }
main { max-width: 1120px; margin: 0 auto; padding: clamp(2rem, 7vw, 4rem) 1rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -.052em; }
.intro { margin: .8rem 0 1.6rem; }
.workspace { display: grid; grid-template-columns: minmax(275px, .85fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
section { background: white; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.55rem); min-width: 0; }
label { display: block; font-weight: 700; margin: 0 0 .28rem; }
input, textarea, select { font: inherit; max-width: 100%; margin: 0 0 .65rem; }
input[type="file"] { width: 100%; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: .65rem; }
select { border: 1px solid var(--line); border-radius: 8px; min-height: 42px; background: white; padding: .4rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .42rem; }
button, .primary, input::file-selector-button { display: inline-flex; align-items: center; min-height: 44px; font: inherit; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: #f6f4fa; cursor: pointer; text-decoration: none; }
.primary { color: white; background: var(--accent); border-color: var(--accent); }
button:disabled { cursor: default; opacity: .52; }
.help { color: #5b5470; overflow-wrap: anywhere; font-size: .9rem; margin: .3rem 0 .85rem; }
.stage { position: relative; background: #121018; border-radius: 8px; overflow: hidden; }
video { display: block; width: 100%; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#status { margin: .8rem 0 0; }
#status[data-error="true"] { color: #902a33; }
@media (max-width: 735px) { .workspace { grid-template-columns: minmax(0, 1fr); } }

header { display: flex; justify-content: space-between; gap: 1rem; }
