/* Gewei Video Editor: one calm surface, black primary actions, a single coral accent. Light by default, dark when
   the system is. */
:root {
  --bg: #fafaf9; --surface: #ffffff; --sunken: #f4f4f2; --line: #e7e6e3; --line-strong: #d6d5d1;
  --text: #0c0c0d; --soft: #5f5f63; --faint: #8e8e93;
  --accent: #ff5f38; --accent-soft: #fff0eb; --good: #16a34a; --warn: #b45309; --bad: #dc2626;
  --primary: #0c0c0d; --on-primary: #ffffff;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(0, 0, 0, .12);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .25);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c; --surface: #141416; --sunken: #1b1b1e; --line: #26262a; --line-strong: #34343a;
    --text: #f4f4f5; --soft: #a1a1aa; --faint: #71717a;
    --accent: #ff7452; --accent-soft: #2a1812; --primary: #f4f4f5; --on-primary: #0b0b0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.loading .owner-only, body.loading .visitor-only { display: none !important; }
body:not(.is-owner) .owner-only, body.is-owner .visitor-only { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
::selection { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s, transform .1s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.btn.primary:hover:not(:disabled) { opacity: .88; }
.btn.ghost { background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 50px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0;
  background: transparent; color: var(--soft); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--sunken); color: var(--text); }
input, select, textarea { width: 100%; font: 15px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }
textarea { resize: vertical; min-height: 44px; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input[type=color] { padding: 3px; height: 42px; cursor: pointer; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--text); margin: 0; flex: none; }
input[type=range] { padding: 0; border: 0; accent-color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--soft); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--faint); font-size: 13px; }
.fine { color: var(--faint); font-size: 12px; text-align: center; }

/* ---------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
.logo .mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); }
.logo .mark svg { width: 18px; height: 18px; fill: var(--accent); stroke: none; }
.logo em { font-style: normal; color: var(--faint); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); padding: 0 10px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.ok::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.status.err::before { background: var(--bad); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--sunken); color: var(--soft); font-size: 12px; }
.count:empty { display: none; }

/* ---------------------------------------------------------------- layout */
.shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 64px); }
body.no-jobs .shell { grid-template-columns: 1fr; }
body.no-jobs .edits, body.no-jobs .edits-btn { display: none; }
.view { min-width: 0; padding: 40px 32px 80px; }
.edits { border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.edits-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; }
.edits-head h2 { font-size: 13px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.job-list { display: flex; flex-direction: column; gap: 2px; }
.job-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; transition: background .15s; }
.job-item:hover { background: var(--sunken); }
.job-item.on { background: var(--surface); box-shadow: var(--shadow); }
.job-item b { display: block; font-size: 14px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-item small { color: var(--faint); font-size: 12px; }
.job-item > div { min-width: 0; flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line-strong); }
.dot.done { background: var(--good); }
.dot.review { background: var(--accent); }
.dot.error { background: var(--bad); }
.dot.busy { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.edits-btn { display: none; }
.scrim { display: none; }
.empty-list { color: var(--faint); font-size: 14px; padding: 8px; }

/* ---------------------------------------------------------------- create */
.create { max-width: 560px; margin: 0 auto; }
.hero { text-align: center; margin: 12px 0 32px; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 14px;
  padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); }
.hero h1 { font-size: clamp(32px, 5.4vw, 48px); line-height: 1.06; letter-spacing: -.035em; font-weight: 700; }
.hero h1 span { color: var(--faint); }
.lede { margin-top: 14px; color: var(--soft); font-size: 17px; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.drop { display: block; border: 1.5px dashed var(--line-strong); border-radius: 16px; cursor: pointer;
  background: var(--sunken); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--text); background: color-mix(in srgb, var(--sunken) 60%, var(--surface)); }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 40px 16px; text-align: center; }
.drop-empty b { font-size: 16px; font-weight: 600; margin-top: 10px; }
.drop-empty span { color: var(--soft); font-size: 14px; }
.drop-empty small { color: var(--faint); font-size: 12px; margin-top: 10px; }
.drop-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); }
.drop-file { display: none; align-items: center; gap: 14px; padding: 12px; }
.drop.has { border-style: solid; border-color: var(--line); background: var(--surface); cursor: default; }
.drop.has .drop-empty { display: none; }
.drop.has .drop-file { display: flex; }
.drop-file video { width: 54px; height: 96px; object-fit: cover; border-radius: 10px; background: #000; flex: none; }
.file-meta { flex: 1; min-width: 0; }
.file-meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta small { color: var(--soft); font-size: 13px; }
.file-meta small.bad { color: var(--bad); }
.opt { padding: 14px 8px 6px; display: flex; flex-direction: column; gap: 10px; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--soft); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px; border-radius: 12px; background: var(--sunken); }
.segmented button { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); padding: 0 8px;
  font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 600; }
.fold { border-top: 1px solid var(--line); margin: 0 8px; }
.fold:first-of-type { margin-top: 8px; }
.fold summary { list-style: none; cursor: pointer; padding: 14px 0; font-size: 14px; font-weight: 550;
  display: flex; align-items: center; gap: 8px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.8px solid var(--faint);
  border-bottom: 1.8px solid var(--faint); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.fold[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.opt-tag { font-size: 12px; color: var(--faint); font-weight: 400; }
.fold-body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong);
  cursor: pointer; padding: 0; transition: transform .1s, box-shadow .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatch.auto { width: auto; padding: 0 12px; border-radius: 999px; font: 500 13px var(--font); color: var(--soft);
  background: conic-gradient(from 0deg, #e4572e22, #2e86ab22, #7b61ff22, #00a67622, #e4572e22); }
.swatch.custom { position: relative; overflow: hidden; background: var(--sunken); display: grid; place-items: center; color: var(--soft); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.composer > .btn.block { margin: 10px 4px 4px; width: auto; }
.upload { display: flex; align-items: center; gap: 12px; padding: 4px 8px; font-size: 13px; color: var(--soft); }
.upload .bar { flex: 1; }
.composer .fine { padding: 6px 8px 2px; }
.composer .fine:empty { display: none; }
.how { list-style: none; padding: 0; margin: 28px 0 0; display: flex; justify-content: center; gap: 28px; color: var(--faint); font-size: 13px; }
.how li { display: flex; align-items: center; gap: 8px; }
.how b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong);
  font-size: 11px; color: var(--soft); }

/* ---------------------------------------------------------------- progress bars */
.bar { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .6s ease; }
.bar.busy i { background-image: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff), var(--accent));
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- one edit */
.job { max-width: 1040px; margin: 0 auto; }
.job-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 28px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--soft); font-size: 14px; padding: 6px 10px 6px 4px; border-radius: 999px; }
.back:hover { color: var(--text); background: var(--sunken); }
.back svg { width: 18px; height: 18px; }
.job-title { min-width: 0; }
.job-title h1 { font-size: 22px; letter-spacing: -.02em; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-title p { color: var(--faint); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }

.progress { max-width: 640px; margin: 4vh auto 0; text-align: center; padding: 36px 32px; }
.steps { display: flex; justify-content: center; gap: 0; margin-bottom: 32px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); width: 96px; position: relative; }
.step::before { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.on::before { background: var(--text); }
.step i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; position: relative; z-index: 1; font-style: normal; }
.step.done i { background: var(--text); border-color: var(--text); }
.step.done i::after { content: ""; width: 8px; height: 4px; border-left: 2px solid var(--on-primary); border-bottom: 2px solid var(--on-primary); transform: rotate(-45deg) translate(1px, -1px); }
.step.on { color: var(--text); font-weight: 600; }
.step.on i { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.on i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.progress h2 { font-size: 24px; letter-spacing: -.02em; font-weight: 650; }
.progress .sub { color: var(--soft); margin-top: 6px; min-height: 22px; font-size: 14px; }
.progress .bar { margin: 26px auto 8px; height: 8px; max-width: 460px; }
.progress .fine { max-width: 380px; margin: 0 auto; }
.bar-meta { display: flex; justify-content: space-between; gap: 12px; max-width: 460px; margin: 0 auto 22px; font-size: 12.5px;
  color: var(--faint); font-variant-numeric: tabular-nums; }
.bar-meta span:first-child { color: var(--text); font-weight: 600; }
.live-quote { margin: 0 auto 16px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--text);
  font-size: 15px; line-height: 1.45; text-align: left; font-style: italic; }
.live-quote span { display: block; font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); margin-bottom: 3px; }
.live { display: flex; gap: 18px; align-items: flex-start; text-align: left; margin-bottom: 12px; }
.tasks { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.task { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; font-size: 14px; }
.task.active { background: var(--sunken); }
.task.todo { color: var(--faint); }
.t-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); box-sizing: border-box; }
.t-icon svg { width: 12px; height: 12px; stroke-width: 3; }
.task.done .t-icon { background: var(--good); border-color: var(--good); color: #fff; }
.task.failed .t-icon { background: var(--bad); border-color: var(--bad); color: #fff; }
.task.active .t-icon { border-color: color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-line { display: flex; align-items: baseline; gap: 8px; }
.t-line b { font-weight: 550; }
.task.todo .t-line b { font-weight: 450; }
.t-pct { font-size: 12px; color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.t-detail { font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.task.done .t-detail, .task.failed .t-detail { color: var(--faint); }
.t-bar { display: block; height: 3px; border-radius: 999px; background: var(--line); margin-top: 6px; overflow: hidden; }
.t-bar b { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s ease; }
.t-time { font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 1px; }
.task.active .t-time { color: var(--soft); }
.tasks.compact .task { padding: 5px 8px; font-size: 13px; }
.live-preview { margin: 0; flex: none; width: 128px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.live-preview img { width: 128px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; background: #000; box-shadow: var(--shadow); }
.live-preview figcaption { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; animation: pulse 1.4s ease-in-out infinite; }
.live-preview .pulse { background: var(--bad); }
.live-state { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; color: var(--soft); margin: 2px 0 12px; flex-wrap: wrap; }
.live-state.warn { color: var(--warn); }
.live-state.bad { color: var(--bad); font-weight: 500; }
.failed .tasks { width: 100%; }

.result { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 40px; align-items: start; }
.player { position: relative; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg); }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player.plan { background: var(--sunken); box-shadow: none; border: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 22px; gap: 4px; overflow-y: auto; }
.beats-title { font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.beat { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.beat:last-child { border-bottom: 0; }
.beat span { color: var(--faint); font: 12px var(--mono); padding-top: 2px; }
.side { display: flex; flex-direction: column; gap: 20px; padding-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--sunken); color: var(--soft); width: fit-content; }
.badge.done { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge.review { background: var(--accent-soft); color: var(--accent); }
.side h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; }
.side .summary { color: var(--soft); font-size: 15px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--soft); font-size: 13px; }
.stats b { color: var(--text); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn.primary { height: 46px; padding: 0 22px; font-size: 15px; }
.revise { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.revise h3 { font-size: 15px; font-weight: 600; }
.revise textarea { border: 0; padding: 0; min-height: 66px; box-shadow: none !important; background: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--soft); font: 13px var(--font); cursor: pointer; transition: color .15s, border-color .15s; }
.chip:hover { color: var(--text); border-color: var(--text); }
.revise-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.banner { border-radius: 14px; padding: 14px 16px; font-size: 14px; background: color-mix(in srgb, var(--bad) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); color: var(--text); }
.banner.warn { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.banner b { display: block; margin-bottom: 2px; }
.failed { max-width: 520px; margin: 4vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.failed h2 { font-size: 24px; letter-spacing: -.02em; }
.failed p { color: var(--soft); }
.failed code { font: 12px var(--mono); color: var(--faint); background: var(--sunken); padding: 10px 12px; border-radius: 10px;
  display: block; text-align: left; white-space: pre-wrap; word-break: break-word; max-width: 100%; }

/* ---------------------------------------------------------------- under the hood */
.hood { margin-top: 48px; border-top: 1px solid var(--line); }
.hood > summary { list-style: none; cursor: pointer; padding: 18px 0; display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 14px; font-weight: 550; }
.hood > summary::-webkit-details-marker { display: none; }
.hood > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.8px solid var(--faint);
  border-bottom: 1.8px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
.hood[open] > summary::after { transform: rotate(225deg); }
.hood-body { display: flex; flex-direction: column; gap: 22px; padding-bottom: 20px; }
.hood h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .06em; }
.timeline { font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.tl-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 8px; }
.tl-row > span { color: var(--faint); }
.track { position: relative; height: 22px; background: var(--sunken); border-radius: 6px; overflow: hidden; }
.track.cuts { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 18%, var(--sunken)) 0 4px, var(--sunken) 4px 8px); }
.ruler .track { background: transparent; height: 16px; overflow: visible; }
.ruler i { position: absolute; top: 0; transform: translateX(-50%); font-style: normal; color: var(--faint); font-size: 10px; }
.blk { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; padding: 0 5px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; line-height: 18px; color: #fff; font-size: 10px; min-width: 2px; }
.blk.face { background: #6366f1; } .blk.screen { background: #0ea5e9; } .blk.gap { background: var(--bad); }
.blk.keep { background: var(--good); } .blk.insert { background: #8b5cf6; } .blk.broll { background: #0891b2; }
.blk.callout { background: var(--accent); } .blk.punch, .blk.zoom { background: #64748b; } .blk.sticker { background: #db2777; }
table.events { width: 100%; border-collapse: collapse; font-size: 13px; }
.events td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.events td:first-child { color: var(--faint); font: 12px var(--mono); white-space: nowrap; }
.kind { font-size: 11px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.transcript { max-height: 280px; overflow-y: auto; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.transcript span { color: var(--faint); font: 12px var(--mono); margin-right: 10px; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.sheets img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
textarea.json { font: 12px var(--mono); min-height: 260px; }
pre.log { font: 12px/1.6 var(--mono); color: var(--soft); background: var(--sunken); border-radius: 12px; padding: 14px; max-height: 260px; overflow: auto; margin: 0; white-space: pre-wrap; }
.inline-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ok-text { color: var(--good); } .err-text { color: var(--bad); }

/* ---------------------------------------------------------------- settings */
dialog.settings { width: min(680px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 0; border: 1px solid var(--line);
  border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.settings::backdrop { background: rgba(10, 10, 12, .35); backdrop-filter: blur(4px); }
dialog.settings form { display: flex; flex-direction: column; max-height: inherit; }
.settings-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px 24px; }
.settings-head h2 { font-size: 20px; letter-spacing: -.02em; }
.tabs { flex: none; display: flex; gap: 4px; padding: 6px 20px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 10px 12px; color: var(--soft); font: 500 14px var(--font); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.panes { overflow-y: auto; padding: 22px 24px; flex: 1; min-height: 0; }
.panes fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.panes fieldset[hidden] { display: none; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-row img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); }
dialog.settings menu { flex: none; display: flex; justify-content: flex-end; gap: 10px; margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- account + sign-in */
.account { display: flex; align-items: center; }
.acct { position: relative; }
.acct summary { list-style: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  overflow: hidden; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 14px; border: 1px solid var(--line); }
.acct summary::-webkit-details-marker { display: none; }
.acct summary img { width: 100%; height: 100%; object-fit: cover; }
.acct summary img[src=""], .acct summary img:not([src]) { display: none; }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 240px; display: flex; flex-direction: column; gap: 2px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.acct-pop b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop small { color: var(--soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop .hint { margin: 8px 0 12px; }
.acct-pop .btn + .btn { margin-top: 8px; }
.quota { margin: 10px 4px 0; font-size: 13px; color: var(--soft); text-align: center; }
.quota b { color: var(--text); font-weight: 600; }
.quota a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
dialog.login { width: min(400px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.login::backdrop { background: rgba(10, 10, 12, .35); backdrop-filter: blur(4px); }
dialog.login form { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 28px 26px; }
dialog.login .close { position: absolute; top: 10px; right: 10px; }
.login-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--primary); margin-bottom: 6px; }
.login-mark svg { width: 26px; height: 26px; fill: var(--accent); stroke: none; }
dialog.login h2 { font-size: 22px; letter-spacing: -.02em; }
dialog.login .sub { color: var(--soft); font-size: 15px; max-width: 300px; }
.gsi { min-height: 44px; margin: 14px 0 2px; display: flex; justify-content: center; }
dialog.login .err-text { font-size: 13px; }
dialog.login .err-text:empty { display: none; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--primary); color: var(--on-primary); padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .view { padding: 24px 16px 64px; }
  .edits-btn { display: inline-flex; }
  .edits { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: 100%; background: var(--bg);
    transform: translateX(-102%); transition: transform .25s ease; border-right: 1px solid var(--line); padding-top: 22px; }
  body.drawer .edits { transform: none; box-shadow: var(--shadow-lg); }
  body.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 10, 12, .3); }
  .result { grid-template-columns: 1fr; gap: 24px; }
  .player { max-width: 360px; width: 100%; margin: 0 auto; }
  .side h2 { font-size: 24px; }
  .row2 { grid-template-columns: 1fr; }
  .job-head { grid-template-columns: 1fr auto; }
  .job-head .back { grid-column: 1 / -1; width: fit-content; }
  .logo em { display: none; }
  .progress { padding: 28px 18px; }
  .live { flex-direction: column-reverse; align-items: stretch; }
  .live-preview { align-self: center; }
  .task.active { grid-template-columns: 20px minmax(0, 1fr); }
  .task.active .t-time { grid-column: 2; padding-top: 0; }
  .step { width: 72px; }
  .how { gap: 16px; flex-wrap: wrap; }
  .segmented button { font-size: 13px; padding: 0 4px; }
  .status { font-size: 0; gap: 0; padding: 0 8px; }  /* just the dot on a phone; the text is in its tooltip */
}
