:root {
  color-scheme: dark;
  --canvas: #111113;
  --stage: #080809;
  --surface: #1b1b1e;
  --soft: #25252a;
  --line: #303036;
  --control-line: #696975;
  --ink: #eeeef1;
  --muted: #a6a6ae;
  --accent: #a7c7ff;
  --accent-ink: #121c30;
  --focus: #8cbbff;
  --danger: #ffb0b3;
  --warning: #ffd59a;
  font-family: Inter, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 32px); line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 18px; line-height: 1.4; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, input:not([type="checkbox"], [type="file"]), select, textarea {
  min-height: 44px; border: 1px solid var(--control-line); border-radius: 8px;
  background: var(--canvas); color: var(--ink); padding: 8px 12px;
}
button { cursor: pointer; font-weight: 650; background: var(--soft); transition: background .14s, border-color .14s; }
button:hover { background: #303036; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { background: #c4d9ff; }
button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
button.quiet:hover { color: var(--ink); background: var(--soft); }
button:disabled { opacity: .5; cursor: default; }
.skip { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 8px; transform: translateY(-150%); background: var(--surface); }
.skip:focus { transform: none; }
.shell {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 clamp(16px, 4vw, 48px); min-height: 64px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.shell nav { display: flex; align-items: center; gap: clamp(8px, 3vw, 24px); flex-wrap: wrap; }
.shell nav a { display: inline-flex; align-items: center; min-height: 44px; }
.brand { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-sub { color: var(--muted); font-weight: 550; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); margin-right: 3px; }
.mark::before { content: ""; border-block: 6px solid transparent; border-left: 9px solid var(--accent-ink); margin-left: 2px; }
main { width: min(1200px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) 48px; }
.intro { margin-bottom: 24px; display: grid; gap: 6px; }
.muted { color: var(--muted); }
.status { color: var(--muted); overflow-wrap: anywhere; }
.status[data-error="true"], .error { color: var(--danger); }
.studio-grid, .task-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; }
.card, .stage {
  min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.stage video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 65dvh; object-fit: contain; background: var(--stage); }
.stage-preview { position: relative; aspect-ratio: 16 / 9; max-height: 65dvh; background: var(--stage); }
.stage-preview button, .stage-preview video { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-preview button { display: grid; place-items: center; border: 0; border-radius: 0; padding: 0; background: var(--stage); }
.stage-preview button:focus-visible { outline-offset: -4px; }
.stage-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.play-icon {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px;
  border: 1px solid #ffffff80; border-radius: 50%; background: #111113d9;
}
.play-icon::after { content: ""; margin-left: 4px; border-block: 9px solid transparent; border-left: 14px solid var(--ink); }
.stage-preview button:hover .play-icon { background: var(--accent-ink); border-color: var(--accent); }
.stage-info { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.stage-info span { font-variant-numeric: tabular-nums; }
.cast, .task-panel { display: grid; gap: 14px; padding: 16px; }
.roles { display: grid; gap: 8px; }
.role-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }
.role-card img { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--stage); }
.role-card small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.role-actions { display: flex; gap: 4px; align-items: center; }
.role-actions button { padding-inline: 9px; }
.role-actions .remove { min-width: 44px; }
.check, .spread { display: flex; align-items: center; gap: 10px; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.spread { justify-content: space-between; }
.total { border-top: 1px solid var(--line); padding-top: 12px; }
.checkout-roles, .job-list { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.checkout-roles { color: var(--muted); }
dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--control-line); border-radius: 16px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: #000a; }
dialog form, .form { display: grid; gap: 10px; }
.task-main { max-width: 1060px; }
.account-main { max-width: 600px; }
.task-panel progress { width: 100%; accent-color: var(--accent); }
.task-panel > button { justify-self: start; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--control-line); background: var(--soft); color: var(--ink);
  font-weight: 650; text-decoration: none;
}
.button:hover { background: #303036; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.primary:hover { background: #c4d9ff; }
.job-list { padding: 0; list-style: none; }
.job-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
@media (max-width: 740px) {
  .studio-grid, .task-grid { grid-template-columns: 1fr; }
  .stage video, .stage-preview { max-height: 49dvh; }
  .shell { align-items: center; }
  .shell nav { justify-content: flex-end; }
}
@media (max-width: 360px) {
  .role-card { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 6px; }
  .role-card img { width: 42px; height: 42px; }
  .role-actions { gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
