:root {
  --bg: #111111;
  --panel: #1a1a1a;
  --inset: #121212;
  --border: #303030;
  --border-strong: #3c3c3c;
  --text: #f4f0e8;
  --muted: #aaa69f;
  --accent: #b88955;
  --accent-ink: #1c140c;
  --success: #7fa37a;
  --error: #c96d63;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

button, a { cursor: pointer; }

h1, h2, p { margin: 0; }

h1 {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 0.95rem;
  font-weight: 650;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #d7b48a; }

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: #0e0e0e;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  min-width: max-content;
}

.brand-logo { height: 36px; width: auto; display: block; }
.auth-logo { height: 52px; margin: 0 auto; }

.brand-rule {
  width: 1px;
  height: 22px;
  background: #4a4a4a;
}

.brand-product {
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tabs { display: flex; gap: 6px; align-items: center; }

.tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 22px 12px 18px;
  border-bottom: 2px solid transparent;
}

.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab[hidden] { display: none; }

.user-menu { margin-left: auto; position: relative; }

.user-button, .text-button, .primary, .advanced-toggle {
  appearance: none;
  border: 0;
  background: transparent;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  padding: 6px;
  border-radius: 999px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2a2a2a;
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  display: inline-block;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.menu p {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 10px;
  word-break: break-all;
}

.menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}

.menu button:hover { background: #2a2a2a; }

main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.page-head { margin-bottom: 22px; }
.page-head p, .auth-lead, .field-hint, .job-sub, .status-label {
  color: var(--muted);
}

.page-head p { margin-top: 8px; max-width: 46rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.step { margin-top: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
}
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.step-head .replace { margin-top: 0; }

.card-head, .job-row, .toolbar, .invite-form, .users-layout {
  display: flex;
  gap: 16px;
}

.card-head { justify-content: space-between; align-items: center; margin-bottom: 12px; }

.text-button { color: var(--accent); padding: 0; }
.text-button:hover { color: #d7b48a; }

.dropzone {
  margin-top: 12px;
  min-height: 230px;
  border: 1px dashed #4a433c;
  border-radius: 12px;
  background: var(--inset);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 24px;
  cursor: pointer;
}

#video-file { display: none; }
.dropzone.is-hot, .dropzone:hover { border-color: var(--accent); }

.drop-icon {
  width: 28px;
  height: 34px;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
  position: relative;
  margin-bottom: 8px;
}

.drop-icon::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  border-top: 10px solid var(--inset);
  border-left: 10px solid var(--muted);
}

.drop-title { font-weight: 650; }
.drop-or, .drop-hint { color: var(--muted); font-size: 0.92rem; }
.dropzone.has-file .drop-or,
.dropzone.is-uploading .drop-or { display: none; }

.dropzone.is-uploading {
  cursor: progress;
  border-color: var(--accent);
  pointer-events: none;
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

#upload-percent {
  min-width: 4.6ch;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
}

.upload-progress .bar span {
  background: linear-gradient(90deg, #8a6840, #f0d7b4, #b88955);
  background-size: 200% 100%;
  animation: job-sheen 1.4s linear infinite;
}

textarea, input, select {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  line-height: 1.7;
}

textarea:focus, input:focus, select:focus {
  outline: 2px solid rgba(184, 137, 85, 0.45);
  border-color: var(--accent);
}

.field { display: grid; gap: 8px; }
.field span, .status-label { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.field-hint { margin-top: 8px; font-size: 0.92rem; }

.help {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.options-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 340px);
  gap: 28px;
  align-items: start;
  margin-top: 16px;
}

.options-main { display: flex; align-items: end; gap: 16px; }
.options-main .field { flex: 1; }

.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding-bottom: 12px;
}

.advanced-toggle[aria-expanded="true"] .chevron { transform: rotate(225deg) translate(-2px, -1px); }

.advanced {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 18px;
  white-space: nowrap;
}

.primary:hover { filter: brightness(1.06); }
.primary:disabled { opacity: 0.55; cursor: wait; }

.form-error, .form-note { margin-top: 10px; }
.form-error { color: var(--error); }
.form-note { color: var(--success); }

.picked-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

#video-thumb {
  width: 92px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  flex: none;
}

.video-name {
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.video-meta { color: var(--muted); margin-top: 4px; font-size: 0.92rem; }

.replace, .reset-placement {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.replace {
  margin-top: 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 650;
}

.replace:hover, .reset-placement:hover { color: #d7b48a; }
.replace svg, .reset-placement svg { width: 16px; height: 16px; }

.placement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.75fr);
  gap: 22px;
  align-items: start;
  margin-top: 14px;
}

.filmstrip-wrap { position: relative; margin-top: 8px; padding-top: 28px; }

.filmstrip {
  position: relative;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.filmstrip-frames { display: flex; height: 100%; }
.filmstrip-frames img { flex: 1; width: 0; height: 100%; object-fit: cover; }

.filmstrip-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.filmstrip-bubble {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.75rem;
  pointer-events: none;
}

#preview-time {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  padding: 0;
  border: 0;
  background: transparent;
}

.scrubber {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

#preview-scrub {
  width: 100%;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #b88955;
}

.placement-stage {
  position: relative;
  width: 100%;
  max-height: 460px;
  line-height: 0;
  border-radius: 10px;
  background: #000;
}

.placement-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 10px;
}

.placement-box {
  position: absolute;
  visibility: hidden;
  border: 1.5px dashed rgba(255, 255, 255, 0.92);
  border-radius: 8%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.placement-box:active { cursor: grabbing; }

#placement-chart {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8%;
}

.corner, .placement-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 0;
  border-radius: 1px;
  padding: 0;
}

.corner.nw { left: -4px; top: -4px; }
.corner.ne { right: -4px; top: -4px; }
.corner.sw { left: -4px; bottom: -4px; }
.placement-handle { right: -4px; bottom: -4px; cursor: nwse-resize; }

.preset-label {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.reset-placement { margin-top: 10px; }

.preset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #141414;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
}

.preset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.preset.is-selected { border-color: var(--accent); }

.width-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 22px;
}

.width-control label { grid-column: 1 / -1; }

#chart-width {
  grid-column: 1;
  width: 100%;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  accent-color: #b88955;
}

#chart-width-value { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

.themes { display: flex; gap: 12px; }
.theme {
  width: 112px;
  display: grid;
  gap: 8px;
  justify-items: center;
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 10px;
  color: var(--text);
}
.theme img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f3eee6;
}
.theme[data-theme="dark"] img { background: #111; }
.theme.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.chord-catalog { min-width: 0; }
.chord-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chord-name {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.92rem;
}
.chord-name:hover { border-color: var(--accent); color: #f0d7b4; }
.chord-catalog .field-hint { margin-top: 8px; }

.create-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #161616;
}
.create-row .primary { min-width: min(100%, 320px); }

.job-card, .recent-card { margin-top: 16px; }

.job-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f0d7b4;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.job-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(184, 137, 85, 0.7);
  animation: job-pulse 1.4s ease-out infinite;
}

.job-card.is-running {
  border-color: #c4a06a;
  box-shadow: 0 0 0 1px rgba(184, 137, 85, 0.65), 0 0 32px rgba(184, 137, 85, 0.18);
  background:
    linear-gradient(180deg, rgba(184, 137, 85, 0.16), rgba(184, 137, 85, 0) 96px),
    var(--panel);
}

.job-card.is-failed { border-color: var(--error); }

.job-row { align-items: center; margin-top: 14px; }
.job-name { font-weight: 700; }
.job-status, .job-elapsed { min-width: 120px; display: grid; gap: 4px; }
.job-progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
#job-percent { min-width: 3.2ch; font-variant-numeric: tabular-nums; font-weight: 700; }

.bar {
  flex: 1;
  height: 12px;
  background: #2c2c2c;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.45s ease;
}

.job-card.is-running .bar span,
.render-modal.is-running .bar span {
  background: linear-gradient(90deg, #8a6840, #f0d7b4, #b88955);
  background-size: 200% 100%;
  animation: job-sheen 1.4s linear infinite;
}

.job-card.is-running .bar.is-indeterminate span,
.render-modal.is-running .bar.is-indeterminate span {
  width: 36%;
  transition: none;
  animation: job-indeterminate 1.15s ease-in-out infinite;
}

.bar.is-error span { background: var(--error); animation: none; }

@keyframes job-pulse {
  0% { box-shadow: 0 0 0 0 rgba(184, 137, 85, 0.65); }
  100% { box-shadow: 0 0 0 8px rgba(184, 137, 85, 0); }
}

@keyframes job-sheen {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes job-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .job-live::before,
  .job-card.is-running .bar span,
  .job-card.is-running .bar.is-indeterminate span,
  .render-modal.is-running .bar span,
  .render-modal.is-running .bar.is-indeterminate span,
  .dropzone.is-uploading .bar span,
  .upload-progress .bar span { animation: none; }
  .bar span { transition: none; }
}

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-analyzing::before, .status-rendering::before, .status-queued::before, .status-render_queued::before { background: var(--accent); }
.status-complete::before, .status-review::before { background: var(--success); }
.status-failed::before { background: var(--error); }

.job-warning { color: #e0c089; margin-top: 12px; }
.job-actions { display: flex; gap: 16px; margin-top: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #2a2a2a; white-space: nowrap; }
th { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
th[hidden], td[hidden] { display: none; }
td.num, th.num { text-align: right; }

.empty { color: var(--muted); padding: 12px 0 4px; }

.users-layout { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; margin-bottom: 16px; }
.invite-form { margin-top: 14px; align-items: center; }
.invite-form input { flex: 1; }

.usage-card { display: grid; align-content: start; gap: 8px; }
.usage-stats { display: grid; gap: 6px; margin-top: 8px; }
.usage-stats strong { font-size: 1.35rem; font-weight: 650; }
.usage-meta { color: var(--muted); font-size: 0.92rem; }

.stack-form { display: grid; gap: 14px; }
.account-card, .auth-shell .card { max-width: 460px; }
.auth-body { min-height: 100vh; }
.auth-shell {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}
.auth-shell .card { width: 100%; text-align: left; }
.auth-shell h1 { font-size: 1.8rem; }

.linkish {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 0;
}
.linkish:hover { color: #d7b48a; }
.expired { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  main { width: min(1120px, calc(100% - 28px)); }
  .advanced, .users-layout, .job-row, .placement-layout, .options-layout, .editor-grid { grid-template-columns: 1fr; display: grid; }
  .editor-head, .timeline-head { flex-wrap: wrap; }
  .options-main, .themes { flex-wrap: wrap; }
  .create-row .primary { width: 100%; }
  .toolbar { flex-wrap: wrap; }
  .primary { width: 100%; }
  .editor-actions .primary, .editor-actions .ghost,
  .render-modal-actions .primary, .render-modal-actions .ghost { width: auto; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.editor-head, .timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.editor-actions, .zoom-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dirty-flag { color: #e0c089; font-size: 0.92rem; }
.dirty-flag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e0c089;
}

.ghost, .danger {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
}

.ghost:hover { border-color: var(--accent); }
.ghost:disabled, .danger:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost.tiny { padding: 6px 8px; }
.ghost.wide, .danger.wide { width: 100%; margin-top: 8px; }
.danger { color: #f0b2ab; border-color: #6a3a36; margin-top: 8px; }
.danger:hover { border-color: var(--error); }

.editor-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.editor-side { display: grid; gap: 16px; }
.editor-side .card h2, .timeline-head h2 { display: flex; align-items: center; gap: 10px; }
.editor-main { display: grid; gap: 16px; min-width: 0; }
.monitor-card, .timeline-card { min-width: 0; }

.info-list { display: grid; gap: 8px; margin: 14px 0 0; }
.info-list div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; }
.inspector input {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}
.audio-ok { color: var(--success); }
.audio-ok::before, .audio-missing::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
}
.audio-missing { color: var(--muted); }
.audio-missing::before { background: var(--muted); }

.palette { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.palette button {
  appearance: none;
  background: var(--inset);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
}
.palette button.is-selected, .palette button:hover { border-color: var(--accent); color: #f0d7b4; }

.chord-change { display: block; margin-top: 14px; }
.chord-change select, .merge-row { width: 100%; }
.chord-change select {
  background: var(--inset);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.merge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.merge-row .ghost { width: 100%; }

.monitor-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}
.monitor-frame video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 38vh;
  background: #000;
}
.monitor-chart {
  position: absolute;
  height: auto;
  pointer-events: none;
  border-radius: 8%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.monitor-note {
  position: absolute;
  inset: auto 16px 16px 16px;
  color: var(--muted);
}

.transport {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(80px, 1fr) 90px auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.transport-play {
  appearance: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.transport-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.92rem; }
.transport input[type="range"] { width: 100%; }

.version-pill { color: #e0c089; font-size: 0.88rem; margin-right: auto; }
.timeline-head { margin-bottom: 12px; }
.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #141414;
}
.timeline { position: relative; min-width: 100%; padding-bottom: 8px; }
.ruler { position: relative; height: 28px; margin-left: 64px; width: calc(100% - 64px); border-bottom: 1px solid #2a2a2a; }
.ruler span {
  position: absolute;
  top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  transform: translateX(-50%);
}
.track-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; min-height: 64px; }
.track-label { color: var(--muted); font-size: 0.78rem; padding-left: 10px; }
.track-row canvas { width: 100%; height: 64px; display: block; }
.chord-track { position: relative; height: 64px; }
.chord-block {
  position: absolute;
  top: 10px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #f4f0e8;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  text-align: left;
}
.chord-block.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.boundary {
  position: absolute;
  top: 8px;
  width: 12px;
  height: 48px;
  margin-left: -6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: ew-resize;
  z-index: 4;
}
.boundary::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 2px;
  height: 40px;
  border-radius: 2px;
  background: #d7d2c8;
}
.boundary:hover::before, .boundary:focus-visible::before {
  left: 4px;
  width: 4px;
  background: var(--accent);
}
.playhead {
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 14px;
  transform: translateX(-50%);
  background: transparent;
  cursor: ew-resize;
  z-index: 3;
  touch-action: none;
}
.playhead::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--accent);
  pointer-events: none;
}
.render-modal {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.render-modal::backdrop { background: rgba(0, 0, 0, 0.66); }

.render-modal-card {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.render-modal-card h2 { font-size: 1.45rem; }
.render-modal-name, .render-modal-message { color: var(--muted); }
.render-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.render-modal-actions .primary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.playhead span {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #8a6a3e;
  color: var(--text);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
}
