:root {
  --bg: #14161a;
  --panel: #1c1f25;
  --line: #2c313a;
  --text: #e6e8ec;
  --muted: #9aa2ae;
  --accent: #7ee0a0;
  --warn: #ffcf70;
  --error: #ff8a80;
}
* { box-sizing: border-box; }
/* Our display rules are more specific than the UA's [hidden], so restate it. */
[hidden] { display: none !important; }
body {
  margin: 0;
  padding: 24px 20px 60px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header, main, footer { max-width: 1100px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
     margin: 24px 0 8px; }
header p { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
code { background: #000; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); font-size: 13px; }

#drop {
  display: block; padding: 28px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--panel);
}
#drop:hover, #drop.over { border-color: var(--accent); }
#drop strong { color: var(--accent); }
#drop span { color: var(--muted); }
#file { position: absolute; width: 1px; height: 1px; opacity: 0; }

.error { background: #3a1f22; border: 1px solid var(--error); color: var(--error);
         padding: 12px 14px; border-radius: 8px; }

#app { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 24px; margin-top: 24px; }
@media (max-width: 900px) { #app { grid-template-columns: minmax(0, 1fr); } }

.stage { position: sticky; top: 20px; align-self: start; }
#screen { background: #000; border: 1px solid var(--line); border-radius: 10px;
          overflow: hidden; display: flex; justify-content: center; }
#screen canvas { max-width: 100%; max-height: 70vh; display: block; image-rendering: auto; }

.transport { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.transport output { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 8ch;
                    text-align: right; font-size: 13px; }
#scrub { flex: 1; accent-color: var(--accent); }

button, .primary {
  background: var(--line); color: var(--text); border: 0; border-radius: 7px;
  padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover { background: #39404c; }
button.primary, a.primary { background: var(--accent); color: #10231a; font-weight: 600; }
button.primary:hover, a.primary:hover { filter: brightness(1.1); }
button:disabled { opacity: .5; cursor: default; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 20px; }
.panel h2:first-child { margin-top: 16px; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td .chip { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
           border: 1px solid #0006; vertical-align: -1px; margin-right: 5px; }
tr.active td { color: var(--accent); }

#warnings { margin: 0; padding-left: 18px; font-size: 13px; color: var(--warn); }
#warnings li { margin-bottom: 6px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 12px; }
.form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.form label.check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
input[type=number], select {
  background: #0f1114; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; font: inherit; width: 100%;
}
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.swatches { display: grid; gap: 8px; }
.swatches > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.swatches > div > span { width: 150px; }
.swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line);
                              border-radius: 5px; background: none; cursor: pointer; }

#progressBox { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
progress { flex: 1; height: 8px; accent-color: var(--accent); }
#progressText { font-size: 13px; color: var(--muted); min-width: 12ch; }
#result { margin-top: 14px; }
#resultImg { max-width: 100%; margin-top: 12px; border-radius: 8px; background: #000; display: block; }

footer p { color: var(--muted); font-size: 12px; margin-top: 40px; border-top: 1px solid var(--line);
           padding-top: 14px; }
