:root {
  --bg: #141414;
  --panel: #151515;
  --stage: #1a1a1a;
  --surface: #1d1d1d;
  --surface-2: #262626;
  --ink: #f2f2f2;
  --ink-2: #c9c9c9;
  --muted: #8c8c8c;
  --line: rgb(255 255 255 / 0.075);
  --line-strong: rgb(255 255 255 / 0.13);
  --accent: #f2f2f2;
  --accent-ink: #121212;
  --target: #e0673a;
  --ok: #7fd18b;
  --warn: #e0b04a;
  --bad: #ff7b6e;
  --btn-green: var(--accent);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-pill: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 span {
  font-weight: 450;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.bar h1 {
  font-size: 17px;
}
.bar__left {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  flex: 1;
}
.bar__left h2 {
  margin: 0;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bar__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar__left .badge,
.bar__left .back {
  flex: none;
}
.bar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.bar__actions {
  display: contents;
}
body.is-workspace .bar {
  position: static;
  flex: none;
  padding: 8px 16px;
}
body.is-workspace .bar .back {
  margin: 0;
  font-size: 15px;
}
body.is-workspace .bar .live-note {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A narrow window: the top bar's buttons are their icons (the words stay for screen readers, and as tooltips). */
@media (max-width: 1180px) {
  body.is-workspace .bar .btn {
    padding: 7px;
  }
  body.is-workspace .bar .btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--surface-2);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.btn--primary {
  background: var(--btn-green);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 650;
}
.btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
  background: var(--btn-green);
}
.btn--primary:disabled {
  background: var(--surface);
  color: var(--muted);
  font-weight: 550;
  opacity: 1;
}
.btn svg {
  flex: none;
  width: 15px;
  height: 15px;
  display: block;
}
.btn--danger {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 12%, var(--surface));
}
.btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--bad) 20%, var(--surface));
}
.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.gate__card {
  width: min(100%, 360px);
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 550;
  font-size: 13px;
  color: var(--muted);
}
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible,
.iconbtn:focus-visible,
.tool:focus-visible,
.view:focus-visible,
.ws-tabs button:focus-visible,
.tl-name:focus-visible,
.obj__name:focus-visible,
.back:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}
input[type="file"] {
  padding: 7px;
}
small,
.muted {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.error {
  min-height: 1.4em;
  margin: 0;
  color: var(--bad);
  font-size: 14px;
}

.dialog {
  width: min(100% - 24px, 560px);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.dialog::backdrop {
  background: rgb(0 0 0 / 0.65);
}
.dialog .card {
  display: grid;
  gap: 14px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .row {
    grid-template-columns: 1fr;
  }
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
progress {
  width: 100%;
  accent-color: var(--accent);
}

.empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--muted);
}
.empty h2 {
  color: var(--ink);
  margin-bottom: 6px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.list .card.item {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.list .card.item:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}
.item {
  display: grid;
  gap: 10px;
}
.item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}
.item__title {
  font-size: 17px;
  font-weight: 650;
}
.item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
  font-size: 13px;
}
.item__link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.item__link code {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge--draft,
.badge--archived {
  color: var(--muted);
}
.badge--processing,
.badge--incomplete {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
}
.badge--ready,
.badge--published {
  color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 85%, #fff);
}
.badge--empty {
  color: var(--muted);
}
.assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
}
.assets .ok {
  color: var(--ok);
}
.assets .missing {
  color: var(--warn);
}

/* ── Campaign page ─────────────────────────────────────────────────────────────────────────────── */
.bar__title {
  color: inherit;
  text-decoration: none;
}
.back {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.back:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.page-head h2 {
  font-size: 24px;
}
.page-head__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.stack {
  display: grid;
  gap: 16px;
}
.section > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section h3 {
  margin: 0;
  font-size: 16px;
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.checklist .ok {
  color: var(--ok);
}
.checklist .todo {
  color: var(--ink);
}
.checklist .later {
  color: var(--muted);
}
.checklist li::before {
  display: inline-block;
  width: 1.4em;
}
.checklist .ok::before {
  content: "✓";
}
.checklist .todo::before {
  content: "○";
  color: var(--warn);
}
.checklist .later::before {
  content: "–";
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fields .wide {
  grid-column: 1 / -1;
}
@media (max-width: 560px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
.kv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13px;
}

.scenes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.scene {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}
.scene__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scene__num {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}
.scene__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 0;
  font-size: 14px;
}
.file__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file__meta {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 12px;
}
.size {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.size--ok {
  color: var(--ok);
}
.size--warn {
  color: var(--warn);
}
.size--bad {
  color: var(--bad);
}
.pill {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.pill--ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}
.pill--warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
}
.pill--bad {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 14%, var(--surface));
}
.chip {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.chip--blend {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--warn);
}
.iconbtn {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.iconbtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 12%, var(--surface-2));
}
.iconbtn:disabled {
  opacity: 0.35;
  cursor: default;
}
.iconbtn--danger {
  color: var(--bad);
}
.add-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.add-file select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.add-scene {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.add-scene input {
  flex: 1;
}

/* ── Campaign workspace: left pane (target + scenes) · WebGL stage · placement pane ─────────────── */
body.is-workspace .wrap {
  max-width: none;
  padding: 0;
}
body.is-workspace #error {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 5;
  min-height: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
body.is-workspace #error:empty {
  display: none;
}
/* The editor fills the window exactly: no page scroll, the side panes scroll inside themselves. */
body.is-workspace {
  height: 100dvh;
  overflow: hidden;
}
body.is-workspace #app {
  display: flex;
  flex-direction: column;
  height: 100%;
}
body.is-workspace .wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
}
body.is-workspace #detail-view {
  height: 100%;
}
.ws {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
}
@media (max-width: 800px) {
  body.is-workspace {
    height: auto;
    overflow: auto;
  }
  body.is-workspace #app {
    height: auto;
  }
  .ws {
    grid-template-columns: 1fr;
    grid-template-rows: auto 80vh auto;
    height: auto;
  }
}
.ws-pane {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  align-content: start;
  gap: 20px;
  background: var(--panel);
}
.ws-left {
  border-right: 1px solid var(--line);
}
.ws-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-left: 1px solid var(--line);
}
.ws-tabpanel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ws-tabpanel__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 18px;
  padding: 14px;
  scrollbar-gutter: stable; /* a panel that grows past the window doesn't narrow what's in it */
}
.ws-pane,
.ws-tabpanel__scroll,
#timeline,
.tl-body {
  scrollbar-width: thin;
}
.ws-tabs button:hover {
  color: var(--ink);
}
.ws-tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}
.ws-tabs button {
  padding: 10px;
  border: 0;
  border-top: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ws-tabs button[aria-selected="true"] {
  border-top-color: var(--accent);
  color: var(--ink);
}
.ws-pane h3 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.ws-pane h3 {
  margin: 0 0 10px;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ws-stage {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) minmax(0, auto);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
#timeline {
  min-height: min(146px, 30vh); /* its head and a row: the stage is its final size before the timeline has loaded */
  overflow-y: auto;
  background: var(--panel);
}
.ws-view {
  position: relative;
  min-height: 0;
}
.ws-viewport {
  position: absolute;
  inset: 0;
}
.ws-viewport canvas {
  transition: opacity 0.25s ease;
}
.ws-viewport.is-loading canvas {
  opacity: 0;
  transition: none;
}
.ws-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 92px); /* clear of the view buttons */
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 24px;
  background: rgb(26 26 26 / 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.ws-toolbar .tool {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #c8c8c8;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ws-toolbar .tool:hover:not(:disabled, [aria-pressed="true"]) {
  background: var(--surface-2);
  color: var(--ink);
}
.ws-toolbar .tool svg {
  width: 18px;
  height: 18px;
  display: block;
}
.ws-toolbar .tool[aria-pressed="true"] {
  background: var(--btn-green);
  color: var(--accent-ink);
}
.ws-toolbar .tool[data-act="shadows-toggle"][aria-pressed="false"] {
  color: #666;
  opacity: 0.7;
}
.ws-toolbar .tool:disabled {
  opacity: 0.35;
  cursor: default;
}
.ws-toolbar .sep {
  width: 1px;
  margin: 6px 4px;
  background: var(--line-strong);
}
@media (max-width: 1280px) {
  .ws-toolbar .sep:last-of-type {
    display: none; /* the add buttons wrap to their own line: nothing left for it to separate */
  }
}
.ws-views {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 4px;
  border-radius: 14px;
  background: rgb(26 26 26 / 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.ws-views .view {
  min-width: 52px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c8c8c8;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.ws-views .view:hover {
  background: var(--surface-2);
}
.ws-views .view[aria-pressed="true"] {
  background: var(--btn-green);
  color: var(--accent-ink);
}
.ws-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}
.ws-overlay:empty {
  display: none;
}
.ws-view.is-light .ws-overlay,
.ws-view.is-light .ws-hint {
  color: #55575e;
}
.ws-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  pointer-events: none;
}
@media (max-width: 1100px) {
  .ws-hint {
    display: none; /* the stage is too narrow to spare the room */
  }
}
.target-box {
  display: grid;
  gap: 8px;
}
.target-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.target-meta--line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--bg) center / contain no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 4px;
}
.target-thumb.has-image {
  border-style: solid;
  border-color: var(--line);
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.scene-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.scene-item {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
}
.scene-item.is-selected {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.scene-item.is-selected .scene-item__name {
  color: var(--accent);
}
.scene-item__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius);
  cursor: pointer;
}
.scene-item:not(.is-selected) .scene-item__head:hover {
  background: var(--surface-2);
}
.scene-item__rename {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px;
  align-items: center;
}
.scene-item__rename input {
  padding: 5px 8px;
  font-size: 13px;
}
.sobjs {
  grid-template-columns: minmax(0, 1fr); /* a long file name shortens, it doesn't widen the row */
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.sobj {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 12px;
}
.sobj.is-selected {
  outline: 1px solid var(--accent);
}
.sobj--unused {
  opacity: 0.7;
}
.sobj__name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.sobj__name {
  cursor: pointer;
}
.sobj__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sobj .file__meta {
  flex: 0 0 100%;
}
.sobj .file__meta:empty {
  display: none;
}
.scene-item__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-item__body {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}
.scene-item .files .file {
  font-size: 13px;
}
.place-grid {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  gap: 6px 6px;
  align-items: center;
  font-size: 13px;
}
.place-grid span {
  color: var(--muted);
}
.place-grid input {
  min-width: 0;
  padding: 7px 4px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  appearance: textfield; /* no spinners: they cover the digits in a field this narrow (arrow keys still step) */
}
.place-grid input::-webkit-inner-spin-button,
.place-grid input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.place-grid .axis {
  text-align: center;
  font-size: 11px;
}
.place-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.place-link input {
  flex: none;
  width: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--accent);
}
.place-actions {
  display: flex;
  gap: 6px;
}
.place-actions .btn {
  flex: 1;
}
.actions--split {
  justify-content: space-between;
}
.actions--split > span {
  display: flex;
  gap: 8px;
}

.ws-pane > *,
.ws-pane section,
.scene-item,
.scene-item__body,
.target-box {
  min-width: 0;
}
.target-meta {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.scene-item__body .add-file,
.scene-item__body .row-actions {
  min-width: 0;
}
.scene-list,
.scene-item__body,
.scene-item .files,
.target-box {
  grid-template-columns: minmax(0, 1fr);
}
.scene-item .file,
.scene-item__body > input {
  min-width: 0;
  width: 100%;
}

/* Lighting panel */
.lights {
  display: grid;
  gap: 8px;
}
.light-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 450;
}
.light-row span {
  color: var(--muted);
}
.light-row input[type="range"] {
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}
.light-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.light-note {
  margin: 0;
  color: var(--warn);
  font-size: 12px;
}
.light-note:empty {
  display: none;
}
.light-row--color {
  grid-template-columns: 96px minmax(0, 1fr);
}
.light-row--color input[type="color"] {
  height: 28px;
  padding: 2px;
  cursor: pointer;
}
.light-check {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  font-weight: 450;
}
.light-check input {
  width: auto;
  accent-color: var(--accent);
}

.live-note {
  font-size: 12px;
  color: var(--warn);
}
.live-note--on {
  color: var(--ok);
}

.light-switch {
  flex-wrap: wrap;
}
.light-settings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.light-settings:disabled {
  opacity: 0.45;
}

/* Text panel: one block per TEXT_<slot> of the selected scene's model */
.particles {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.particles h4 {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.particles h4:first-child {
  margin-top: 0;
}
.look {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.look summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.look__body {
  margin-top: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}
.particles .particles__choice {
  grid-template-columns: 96px minmax(0, 1fr);
}
.particles__colors {
  display: grid;
  grid-template-columns: 96px 44px 44px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 450;
}
.particles__colors span {
  color: var(--muted);
}
.particles__colors input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 2px;
}
.text-slot {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.text-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 450;
}
.text-field span {
  color: var(--muted);
}
.text-field textarea {
  resize: vertical;
  min-height: 52px;
}
.text-slot .light-row {
  grid-template-columns: 96px minmax(0, 1fr);
}
.text-slot input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 2px;
}
.text-style {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}
.text-bold {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.text-bold input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.text-bold:has(:checked) {
  border-color: transparent;
  background: var(--btn-green);
  color: var(--accent-ink);
}
.text-bold:has(:focus-visible) {
  outline: 2px solid var(--accent);
}

/* Objects panel: the selected scene's models, images and texts, in draw order */
.objs {
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.obj {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 4px;
}
.obj.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.obj__name {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.obj__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.obj__icon {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  background: var(--line-strong);
}
.add-obj {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.add-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Viewport toolbar: add objects (text buttons next to the icon tools) */
.ws-toolbar .tool.tool--label {
  width: auto;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

/* Timeline, docked under the viewport */
.tl {
  --tl-label: 170px;
  padding-bottom: 14px; /* clear of the window's bottom edge */
  border-top: 1px solid var(--line-strong);
  background: var(--panel);
  font-size: 12px;
  user-select: none;
}
.tl-head,
.tl-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.tl-edit {
  min-height: 39px;
}
.tl label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.tl input,
.tl select {
  width: auto;
  height: 26px;
  margin: 0;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.tl input[type="number"] {
  width: 56px;
}
.tl input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}
.tl .tool {
  width: 30px;
  height: 30px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: #e8e8e8;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tl .tool:hover {
  background: var(--surface-2);
}
.tl .tool svg {
  width: 16px;
  height: 16px;
  display: block;
}
.tl-time {
  min-width: 6.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.tl-spring {
  flex: 1;
}
.tl-note {
  color: var(--muted);
}
.tl-body {
  max-height: 168px;
  overflow-y: auto;
}
.tl-rows {
  position: relative; /* the playhead spans all the rows, scrolled or not */
}
.tl-ruler,
.tl-row {
  display: grid;
  grid-template-columns: var(--tl-label) minmax(0, 1fr);
}
.tl-ruler {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tl-scale {
  position: relative;
  cursor: ew-resize;
  touch-action: none;
}
.tl-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 3px 0 0 4px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tl-row {
  height: 28px;
  border-bottom: 1px solid var(--line);
}
.tl-row.is-selected {
  background: rgb(255 255 255 / 0.04);
}
.tl-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px 0 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tl-name:hover {
  background: var(--surface);
}
.tl-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-track {
  position: relative;
  overflow: hidden;
}
.tl-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 8px;
  display: flex;
  align-items: center;
  padding: 0 10px 0 6px;
  border-radius: 5px;
  background: #5b5fc7;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.tl-bar--text {
  background: #b0705a;
}
.tl-bar--image {
  background: #3f8a84;
}
.tl-bar--particles {
  background: #a5843a;
}
.tl-bar--shadow {
  background: #5f6470;
}
.tl-row.is-selected .tl-bar {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.tl-bar__end {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  background: rgb(255 255 255 / 0.28);
  cursor: ew-resize;
}
.tl-idle {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(135deg, rgb(255 255 255 / 0.22) 0 4px, transparent 4px 8px);
  pointer-events: none;
}
.tl-clip {
  position: absolute;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--warn);
  pointer-events: none;
}
.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tl-label);
  right: 0;
  z-index: 4;
  pointer-events: none;
}
.tl-playhead i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--accent);
  will-change: transform;
}
.tl-empty {
  padding: 10px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .tl {
    --tl-label: 96px;
  }
}

/* Side panes: small icon buttons, so names get the room */
.ws-pane .iconbtn {
  width: 24px;
  height: 24px;
  flex: none;
  padding: 0;
  font-size: 12px;
}
.ws-pane .scene__num {
  flex: none;
  width: auto;
  height: auto;
  margin: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
}

/* A model's parts (its file's nodes): a tree under the selected model, and the selected part's own settings. */
.parts {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.parts summary {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.parts summary span {
  color: var(--muted);
  font-weight: 450;
  margin-left: 6px;
}
.part-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.part {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding-left: calc(var(--depth, 0) * 14px);
}
.part.is-selected {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.part.is-hidden .part__label {
  color: var(--muted);
  text-decoration: line-through;
}
.part__name {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.part__name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}
.part__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.part__tags {
  flex: none;
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.part .iconbtn svg {
  width: 14px;
  height: 14px;
}
.part-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
}
.part-head strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.tl-bar--part {
  background: #7a5fc7;
}
.tl-row--part .tl-name {
  padding-left: 18px;
}

/* ── Campaign list ─────────────────────────────────────────────────────────────────────────────── */
body:not(.is-workspace) .wrap {
  max-width: 1180px;
}
.lv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 18px;
}
.lv-head h2 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lv-head p {
  margin: 4px 0 0;
}
.lv-count {
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.lv-count:empty {
  display: none;
}
.lv-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lv-search {
  position: relative;
  display: block;
  margin: 0;
  width: 240px;
  max-width: 100%;
}
.lv-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.lv-search input {
  margin: 0;
  height: 36px;
  padding-left: 34px;
  border-radius: var(--radius-pill);
}
.lv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--panel);
  border: 1px solid var(--line);
}
.lv-filters button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.lv-filters button span {
  margin-left: 2px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.lv-filters button:hover {
  color: var(--ink);
}
.lv-filters button[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--ink);
}
.lv-none {
  padding: 40px 0;
  text-align: center;
}
.lv-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.cc {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cc:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.38);
}
.cc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cc__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 90% at 15% 10%, hsl(var(--hue) 70% 62% / 0.55), transparent 60%),
    radial-gradient(90% 80% at 90% 100%, hsl(calc(var(--hue) + 40) 65% 45% / 0.6), transparent 65%),
    hsl(var(--hue) 25% 16%);
  background-size: cover;
  background-position: center;
}
.cc__cover.has-image {
  background-color: #0d0d0d;
}
.cc__cover.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 0.45), transparent 45%);
}
.cc__cover.has-image .cc__art {
  display: none;
}
.cc__art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.cc__art span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.18);
  backdrop-filter: blur(6px);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.cc__badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.35);
}
.badge--expired {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 18%, var(--surface));
}
.cc__body {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 14px 14px;
}
.cc__title {
  font-size: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  color: var(--muted);
  font-size: 13px;
}
.cc__meta span + span::before {
  content: "·";
  margin: 0 7px;
}
.cc__progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.cc__step {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
}
.cc__step.is-done {
  background: var(--accent);
}
.cc__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: var(--muted);
  font-size: 12px;
}
.cc__steps .ok {
  color: var(--ink);
}
.cc__expiry {
  color: var(--muted);
  font-size: 12px;
}
.cc__expiry.is-bad {
  color: var(--bad);
}
.empty__art {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 45%, transparent), var(--surface));
  color: var(--ink);
  font-size: 30px;
}
.empty .btn {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .lv-tools,
  .lv-search {
    width: 100%;
  }
  .lv-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
  }
}

/* Start a campaign: what it is for */
.kinds {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.kinds legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 14px;
}
.kinds__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.kind:hover {
  border-color: hsl(var(--hue) 60% 60% / 0.7);
}
.kind.is-on {
  border-color: hsl(var(--hue) 70% 62%);
  background: hsl(var(--hue) 55% 50% / 0.22);
}
.dialog .small {
  margin: -4px 0 0;
  font-size: 12px;
}

/* ── Timeline: compact rows, a grip to size it, exits ─────────────────────────────────────────── */
#timeline {
  min-height: 0;
}
#timeline:empty {
  min-height: min(120px, 30vh); /* the stage is its final size before the timeline has loaded */
}
.tl {
  position: relative;
  padding-bottom: 6px;
}
.tl-grip {
  position: absolute;
  z-index: 6;
  top: -5px;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
  touch-action: none;
  display: grid;
  place-items: center;
}
.tl-grip i {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.15s ease, width 0.15s ease;
}
.tl-grip:hover i,
.tl-grip:focus-visible i,
.tl.is-sizing .tl-grip i {
  width: 56px;
  background: var(--accent);
}
.tl-grip:focus-visible {
  outline: none;
}
.tl.is-sizing,
.tl.is-sizing * {
  cursor: ns-resize !important;
}
.tl-head,
.tl-edit {
  gap: 4px 10px;
  padding: 4px 10px;
}
.tl-edit {
  min-height: 33px;
}
.tl input,
.tl select {
  height: 24px;
}
.tl .tool {
  width: 26px;
  height: 26px;
}
.tl-sep {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
}
.tl-body {
  max-height: 150px;
}
.tl-ruler {
  height: 18px;
}
.tl-tick {
  padding-top: 1px;
}
.tl-row {
  height: 20px;
}
.tl-name {
  gap: 5px;
  font-size: 11px;
}
.tl-bar {
  top: 2px;
  bottom: 2px;
  padding: 0 9px 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
}
.tl-bar__end {
  width: 7px;
}
.tl-bar--out {
  background-image: linear-gradient(90deg, rgb(0 0 0 / 0) 0%, rgb(0 0 0 / 0.32) 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
}
.tl-idle {
  top: 6px;
  bottom: 6px;
}
.tl-clip {
  bottom: 1px;
  height: 2px;
}

/* ── Animate tab: the animation gallery (animGallery.js) ─────────────────────────────────────────── */
.ws-tabpanel__scroll--gallery {
  padding: 0 0 16px;
  gap: 0;
}
.ag {
  display: grid;
  gap: 0;
  min-width: 0;
}
.ag-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}
.ag-head__icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-size: 15px;
}
.ag-head__text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}
.ag-head__text b {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-head__text small {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-seg {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 14px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.8);
}
.ag-seg button {
  display: grid;
  gap: 1px;
  padding: 6px 4px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  min-width: 0;
  transition: background 0.15s, color 0.15s;
}
.ag-seg button span {
  font-size: 12px;
  font-weight: 650;
}
.ag-seg button small {
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
}
.ag-seg button:hover {
  color: var(--ink);
}
.ag-seg button[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.ag-seg button[aria-selected="true"] small {
  color: var(--accent);
  opacity: 1;
}
.ag-timing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px 4px;
}
.ag-field {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ag-field__box {
  position: relative;
}
.ag-field__box input {
  padding: 7px 26px 7px 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ag-field__box i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.ag-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.ag-check input {
  width: auto;
}
.ag-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.ag-group {
  padding: 12px 14px 0;
}
.ag-group h4 {
  margin: 4px 0 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.ag-group--fx h4 {
  color: #d7b8ff;
}
.ag-note {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
}
.ag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.ag-card {
  position: relative;
  display: grid;
  gap: 0;
  padding: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.ag-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.ag-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}
.ag-card.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.ag-card[data-ag-fallback] .ag-fx {
  opacity: 0.45;
}
.ag-card__label {
  padding: 0 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  min-height: 2.4em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  align-content: center;
}
.ag-card.is-selected .ag-card__label {
  color: var(--accent);
}
.ag-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a764ff, #ff8a2a);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.ag-tick {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.ag-tick svg {
  width: 11px;
  height: 11px;
}
/* A motion's stage: a little cube on a floor, in perspective. */
.ag-stage {
  position: relative;
  height: 56px;
  display: grid;
  place-items: center;
  perspective: 260px;
  background: radial-gradient(120% 90% at 50% 20%, rgb(255 255 255 / 0.05), transparent 70%);
}
.ag-floor {
  position: absolute;
  left: 50%;
  bottom: 13px;
  width: 44px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), transparent);
}
.ag-iso {
  position: relative;
  top: 4px;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-34deg);
}
.ag-move {
  display: block;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.ag-cube {
  --s: 20px;
  position: relative;
  display: block;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
}
.ag-cube i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(145deg, #a8a8a8, #5c5c5c);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.18);
}
.ag-cube i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.ag-cube i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.55); }
.ag-cube i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.72); }
.ag-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.6); }
.ag-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); filter: brightness(1.15); }
.ag-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); filter: brightness(0.45); }
.ag-card.is-selected .ag-cube i {
  background: linear-gradient(145deg, #ffffff, #cfcfcf);
}
.ag-fx {
  display: block;
  width: 100%;
  height: 56px;
  background: radial-gradient(120% 100% at 50% 10%, rgb(167 100 255 / 0.16), transparent 70%);
}
.ag-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 40px 22px;
  text-align: center;
}
.ag-empty p {
  margin: 0;
}
.ag-empty__art {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  perspective: 260px;
}
.ag-empty__art .ag-cube {
  --s: 26px;
  animation: ag-spin 6s linear infinite;
  opacity: 0.7;
}
@keyframes ag-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to { transform: rotateX(-22deg) rotateY(360deg); }
}

/* The timeline's chips: what the selected row does, opening it in the gallery. */
.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tl-chip span {
  color: var(--muted);
}
.tl-chip b {
  font-weight: 650;
}
.tl-chip svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}
.tl-chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.tl-chip.is-empty b {
  color: var(--muted);
  font-weight: 500;
}

/* The stage's status card (loading, uploading, messages), over whatever the viewport shows. */
.stage-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 14px;
  min-width: 260px;
  max-width: min(420px, 90%);
  padding: 16px 20px;
  border-radius: 16px;
  background: rgb(18 18 20 / 0.86);
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow: 0 18px 50px -18px rgb(0 0 0 / 0.9);
  backdrop-filter: blur(14px) saturate(1.2);
  color: #f2f2f2;
  text-align: left;
  animation: stage-card-in 0.25s ease-out;
}
.stage-card--info {
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}
.stage-card--error {
  border-color: color-mix(in srgb, var(--bad) 50%, transparent);
}
.stage-card__spin {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgb(255 255 255 / 0.12);
  border-top-color: var(--accent);
  animation: stage-spin 0.8s linear infinite;
}
.stage-card__icon {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--bad);
  font-weight: 800;
}
.stage-card__title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.005em;
}
.stage-card__step {
  font-size: 12.5px;
  color: #a9a9ad;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stage-card__bar {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  overflow: hidden;
}
.stage-card__bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: inherit;
  background: var(--btn-green);
  transition: width 0.25s ease-out;
}
.stage-card__bar--busy i {
  width: 35%;
  animation: stage-bar 1.2s ease-in-out infinite;
}
@keyframes stage-spin {
  to { transform: rotate(360deg); }
}
@keyframes stage-bar {
  from { transform: translateX(-100%); }
  to { transform: translateX(290%); }
}
@keyframes stage-card-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
}
.ws-view.is-light .ws-overlay {
  color: inherit;
}

/* ── Objects: one tree, as a 3D app's outliner ───────────────────────────────────────────────────── */
.objs.tree {
  gap: 1px;
}
.tree-row {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 0 4px 0 calc(4px + var(--depth, 0) * 14px);
  border: 1px solid transparent;
  border-radius: 7px;
}
.tree-row:hover {
  background: rgb(255 255 255 / 0.035);
}
.obj.tree-row {
  border-color: var(--line);
  margin-top: 3px;
}
.obj.tree-row:first-child {
  margin-top: 0;
}
.obj.tree-row.is-ancestor {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.tree-row.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.part.tree-row::before {
  /* the guide line down from its parent */
  content: "";
  position: absolute;
  left: calc(12px + (var(--depth, 1) - 1) * 14px);
  top: -1px;
  bottom: -1px;
  border-left: 1px solid var(--line-strong);
}
.tree-caret {
  width: 18px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.tree-caret:hover {
  color: var(--ink);
  background: rgb(255 255 255 / 0.06);
}
.tree-caret svg {
  width: 12px;
  height: 12px;
  transition: transform 0.15s;
}
.tree-caret[aria-expanded="true"] svg {
  transform: rotate(90deg);
}
.tree-caret--none {
  cursor: default;
}
.tree-count {
  flex: none;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 17px;
}
.tree-actions {
  display: none;
  gap: 2px;
}
.tree-row:hover .tree-actions,
.tree-row.is-selected .tree-actions,
.tree-actions:focus-within {
  display: flex;
}
.tree-row .iconbtn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}
.tree-row .iconbtn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.part.tree-row .iconbtn {
  opacity: 0.55;
}
.part.tree-row:hover .iconbtn,
.part.tree-row.is-hidden .iconbtn {
  opacity: 1;
}
.part__icon {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}
.tree-row.is-selected .part__icon {
  color: var(--accent);
}
.obj__icon--primitive svg {
  width: 14px;
  height: 14px;
}

/* + Shape: its menu, under the toolbar button. */
.shape-menu-wrap {
  position: relative;
  display: inline-flex;
}
.shape-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  background: rgb(26 26 28 / 0.97);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px -14px rgb(0 0 0 / 0.9);
  backdrop-filter: blur(12px);
}
.shape-menu button,
.shape-pick button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.shape-menu button:hover,
.shape-pick button:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}
.shape-menu svg,
.shape-pick svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.shape-pick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
}
.shape-pick button {
  background: var(--surface);
  border-color: var(--line);
}
.shape-pick button[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

/* ── Deleting a campaign ─────────────────────────────────────────────────────────────────────────── */
.lv-grid > li {
  position: relative;
}
.cc__delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 9px;
  background: rgb(18 18 20 / 0.72);
  color: #e9e9ea;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.cc__delete svg {
  width: 16px;
  height: 16px;
}
.lv-grid > li:hover .cc__delete,
.cc__delete:focus-visible {
  opacity: 1;
}
.cc__delete:hover {
  background: color-mix(in srgb, var(--bad) 85%, black);
  border-color: transparent;
  color: #fff;
}
@media (hover: none) {
  .cc__delete {
    opacity: 1;
  }
}
/* The project card's way to its Performance page: on the cover, always visible. */
.cc__perf {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgb(21 21 21 / 0.85);
  backdrop-filter: blur(8px);
  color: #e9e9ea;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.cc__perf svg {
  width: 15px;
  height: 15px;
}
.cc__perf:hover {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
}
.cc__perf:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dialog--danger .card {
  max-width: 440px;
}
.danger-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.danger-head__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}
.danger-head__icon svg {
  width: 20px;
  height: 20px;
}
.danger-note {
  margin: 0;
  color: var(--bad);
  font-weight: 600;
  font-size: 14px;
}
.danger-word {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--bad);
  letter-spacing: 0.04em;
}
#delete-confirm {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
}
.btn--solid-danger:not(:disabled) {
  background: var(--bad);
  color: #1a0b09;
}
.btn--solid-danger:not(:disabled):hover {
  background: color-mix(in srgb, var(--bad) 85%, white);
}
.btn--solid-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Stage: shortcuts panel, renaming in the tree ────────────────────────────────────────────────── */
.shortcuts {
  position: absolute;
  top: 60px;
  left: 12px;
  z-index: 4;
  width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 80px);
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgb(20 20 22 / 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px -18px rgb(0 0 0 / 0.9);
  backdrop-filter: blur(14px);
  color: #f2f2f2;
}
.shortcuts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.shortcuts__head .iconbtn {
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--muted);
}
.shortcuts dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  align-items: center;
}
.shortcuts dt {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
}
.shortcuts dd {
  margin: 0;
  font-size: 12.5px;
  color: #c4c4c8;
}
kbd {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  color: var(--ink);
  font: 600 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
}
.obj__rename {
  min-width: 0;
  padding: 3px 6px;
  font-size: 13px;
  border-color: var(--accent);
}

/* ══ Editor layout, 2026-11: neutral panels, white primary actions, the card target in orange ═══════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
kbd {
  font: 500 11px/1 var(--mono);
}

/* Buttons: squared-off, white for the main action, dark with a hairline for the rest. */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border-color: var(--line-strong);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.btn--small {
  height: 30px;
  padding: 0 11px;
  font-size: 13px;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn--primary:hover:not(:disabled) {
  background: #fff;
  filter: none;
}
.btn--primary:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: #5f5f5f;
}
.btn:disabled {
  opacity: 1;
  color: #5f5f5f;
  border-color: var(--line);
}
.btn--quiet-danger {
  background: none;
  border-color: transparent;
  color: var(--muted);
}
.btn--quiet-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  color: var(--bad);
}
.linkbtn {
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.linkbtn:hover {
  background: var(--surface-2);
}
.linkbtn--danger {
  color: var(--muted);
}
.linkbtn--danger:hover {
  color: var(--bad);
}
input,
textarea,
select {
  border-radius: var(--radius-sm);
  border-color: var(--line-strong);
  background: var(--bg);
}

/* Status badges: outlined, quiet. */
.badge {
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: none;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
}
.badge--processing,
.badge--incomplete,
.badge--draft {
  color: var(--ink-2);
  background: none;
}
.badge--ready {
  color: var(--ink);
  background: none;
  border-color: rgb(255 255 255 / 0.3);
}
.badge--published {
  color: var(--ok);
  background: none;
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.badge--expired {
  color: var(--bad);
  background: none;
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

/* ── The top bar ── */
.bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  height: 56px;
  padding: 0 16px;
  background: var(--bg);
  backdrop-filter: none;
}
body.is-workspace .bar {
  padding: 0 12px 0 10px;
}
.bar__center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar__right {
  flex-wrap: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand__mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
}
.brand__mark svg {
  width: 18px;
  height: 18px;
}
.back,
body.is-workspace .bar .back {
  width: 32px;
  height: 32px;
  margin: 0;
  background: none;
  color: var(--ink-2);
}
.back svg {
  width: 18px;
  height: 18px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 15px;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.crumbs a:hover {
  color: var(--ink);
}
.crumbs__sep {
  color: #555;
}
.crumbs__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 4px;
  margin: 0 -4px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.crumbs__name:hover {
  background: var(--surface-2);
}
.crumbs .badge {
  flex: none;
}
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}
.save-state svg {
  width: 15px;
  height: 15px;
}
.save-state.is-dirty i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
}
.save-state__spin {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  animation: stage-spin 0.8s linear infinite;
}
.ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 14px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.ring {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2.5;
}
.ring .ring__on {
  stroke: var(--target);
  stroke-linecap: round;
}
.ready-pill.is-ready .ring__on {
  stroke: var(--ok);
}
.ready-pill.is-live {
  max-width: 260px;
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
.ready-pill.is-live span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ready-pill.is-live i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}
.avatar {
  width: 36px;
  height: 36px;
  margin-left: 4px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.avatar:hover,
.avatar[aria-expanded="true"] {
  background: var(--surface-2);
}
.avatar svg {
  width: 17px;
  height: 17px;
}
body.is-workspace .bar .btn svg,
.bar #new svg {
  width: 15px;
  height: 15px;
}
/* The bar's secondary buttons show their words; their icons only once the window is narrow. */
body.is-workspace .bar__actions .btn svg {
  display: none;
}
@media (max-width: 1180px) {
  body.is-workspace .bar__actions .btn svg {
    display: block;
  }
  .ready-pill span {
    display: none;
  }
  .ready-pill {
    padding: 0 9px;
  }
}
@media (max-width: 900px) {
  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .bar__center {
    display: none;
  }
}

/* ── Dropdown menus (Add object, the camera, the account) ── */
.menu-wrap {
  position: relative;
  display: inline-flex;
}
.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 230px;
  display: grid;
  gap: 1px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #1c1c1c;
  box-shadow: 0 20px 50px -12px rgb(0 0 0 / 0.75);
}
.menu--right {
  left: auto;
  right: 0;
}
.menu > button,
.menu #account-items > button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu > button:hover:not(:disabled),
.menu #account-items > button:hover:not(:disabled) {
  background: var(--surface-2);
}
.menu > button:disabled,
.menu #account-items > button:disabled {
  color: #5f5f5f;
  cursor: default;
}
.menu button > svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--ink-2);
}
.menu button > span {
  display: grid;
  min-width: 0;
}
.menu b {
  font-weight: 550;
}
.menu small {
  font-size: 12px;
}
.menu button[aria-checked="true"] {
  background: var(--surface-2);
}
.menu hr {
  margin: 4px 2px;
  border: 0;
  border-top: 1px solid var(--line);
}
#account-items {
  display: contents;
}
.menu__label {
  padding: 8px 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.menu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.menu__grid button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.menu__grid button:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.menu__grid svg {
  width: 20px;
  height: 20px;
}

/* ── The three columns ── */
.ws {
  grid-template-columns: 300px minmax(0, 1fr) 312px;
}
.ws-pane {
  background: var(--panel);
}
.ws-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  gap: 0;
}
.ws-left__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.pane-sec {
  display: grid;
  gap: 12px;
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--line);
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}
.ws-pane h3,
.pane-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  justify-content: flex-start;
}
.ws-pane h3 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}
.ws-pane h3 {
  margin-bottom: 0;
  gap: 8px;
}
.pane-head__aside {
  color: var(--muted);
  font-size: 12px;
}
.pane-head .iconbtn {
  width: 28px;
  height: 28px;
  color: var(--ink-2);
}
.pane-head .iconbtn svg {
  width: 17px;
  height: 17px;
}
.pane-note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.pane-note b {
  color: var(--ink-2);
  font-weight: 600;
}

/* The card target: a dashed drop zone until there is one. */
.drop {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.012);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover {
  border-color: rgb(255 255 255 / 0.3);
  background: rgb(255 255 255 / 0.03);
}
.drop:disabled {
  opacity: 0.6;
  cursor: progress;
}
.drop__icon {
  width: 56px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.drop__icon svg {
  width: 20px;
  height: 20px;
}
.drop__text {
  display: grid;
  gap: 3px;
}
.drop__text b {
  font-size: 14.5px;
  font-weight: 650;
}
.drop__text span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.target-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.target-card .target-thumb {
  width: 64px;
  height: 82px;
  border-radius: 6px;
  background-size: cover;
  border: 1px solid var(--line-strong);
}
.target-card__info {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.target-card__info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
}
.target-card__info .row-actions {
  margin-top: 6px;
  gap: 4px;
}
.target-meta:empty {
  display: none;
}

/* Scenes */
.scene-list {
  gap: 4px;
}
.scene-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
}
.scene-item.is-selected {
  background: var(--surface);
  border-color: var(--line-strong);
}
.scene-item.is-selected .scene-item__name {
  color: var(--ink);
}
.scene-item__head {
  border-radius: var(--radius-sm);
}
.scene-item:not(.is-selected) .scene-item__head:hover {
  background: var(--surface);
}
.ws-pane .scene__num {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
}
.add-scene {
  display: grid;
  gap: 6px;
}
.add-scene label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.add-scene__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.add-scene input {
  height: 40px;
  font-size: 14.5px;
}
.add-scene .btn {
  height: 40px;
}

/* Audio */
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.audio-row__icon {
  flex: none;
  color: var(--muted);
}
.audio-row__icon svg {
  display: block;
  width: 16px;
  height: 16px;
}
.audio-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.audio-row.has-music .audio-row__name {
  color: var(--ink);
}
.audio-row .row-actions {
  flex-wrap: nowrap;
  gap: 0;
}
.audio-row + audio {
  height: 36px;
}

/* Before publishing */
.publish-check {
  flex: none;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}
.publish-check h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.publish-check ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.publish-check li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 14px;
}
.publish-check li.is-done {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgb(255 255 255 / 0.25);
}
.publish-check__box {
  flex: none;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1.5px solid #555;
  border-radius: 50%;
}
.is-done .publish-check__box {
  border-color: var(--ok);
  background: var(--ok);
  color: #10240f;
}
.publish-check__box svg {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}

/* ── The right pane: tabs on top, Layers then Properties, shortcuts at the foot ── */
.ws-tabs {
  order: -1;
  margin: 12px 12px 0;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.ws-tabs button {
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
}
.ws-tabs button[aria-selected="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.ws-tabpanel__scroll {
  gap: 0;
  padding: 0;
}
.ws-tabpanel__scroll > .pane-sec {
  padding: 16px 16px 18px;
}
.ws-tabpanel__scroll > .pane-sec:last-child {
  border-bottom: 0;
}
.ws-tabpanel__scroll--gallery,
#lighting {
  padding: 14px;
}
.pane-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.pane-foot:hover,
.pane-foot[aria-expanded="true"] {
  color: var(--ink);
}
.pane-foot kbd {
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}
.tree-row.layer-locked {
  min-height: 38px;
  border-color: var(--line);
  background: rgb(255 255 255 / 0.02);
  cursor: default;
}
.tree-row.layer-locked:hover {
  background: rgb(255 255 255 / 0.02);
}
.layer-locked .obj__name {
  cursor: default;
}
.obj__icon--target {
  width: 14px;
  height: 17px;
  border: 1.5px dashed var(--target);
  border-radius: 3px;
  background: none;
}
.layer-lock {
  padding-right: 6px;
  color: var(--muted);
  font-size: 12px;
}
.objs.tree .obj.tree-row {
  min-height: 38px;
}

/* ── The stage ── */
.ws-stage {
  background: var(--stage);
}
.ws-toolbar,
.ws-viewbar {
  position: absolute;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 46px;
  padding: 4px 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(21 21 21 / 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px -10px rgb(0 0 0 / 0.6);
}
.ws-toolbar {
  left: 12px;
  max-width: none;
  flex-wrap: nowrap;
}
.ws-viewbar {
  right: 12px;
}
.ws-toolbar .tool,
.ws-viewbar .tool {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ws-toolbar .tool svg,
.ws-viewbar .tool svg {
  width: 18px;
  height: 18px;
  display: block;
}
.ws-toolbar .tool:hover:not(:disabled, [aria-pressed="true"]),
.ws-viewbar .tool:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}
.ws-toolbar .tool[aria-pressed="true"],
.ws-viewbar .tool[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.ws-toolbar .tool:disabled {
  opacity: 0.3;
  cursor: default;
}
.ws-toolbar .sep {
  align-self: stretch;
  width: 1px;
  margin: 6px 5px;
  background: var(--line-strong);
}
.ws-toolbar .tool.tool--label,
.ws-viewbar .tool.tool--label {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.ws-viewbar .tool.tool--label {
  color: var(--ink);
  font-weight: 600;
}
.tool--label svg.chev {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  opacity: 0.7;
}
.ws-toolbar .tool--label > svg:first-child {
  width: 16px;
  height: 16px;
}
.ws-view.is-light .ws-toolbar,
.ws-view.is-light .ws-viewbar {
  background: rgb(21 21 21 / 0.88);
}
.ws-hint {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  font-size: 12.5px;
}
.ws-hint kbd {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-2);
  font-weight: 600;
}
.shortcuts {
  top: auto;
  left: auto;
  right: 12px;
  bottom: 12px;
}

/* First run: what the outline is, and what to do first. Under the card on the stage. */
.ws-empty::before {
  /* keeps the words readable over the grid and the card */
  content: "";
  position: absolute;
  inset: -40px -60px;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(26 26 26 / 0.92), rgb(26 26 26 / 0));
  pointer-events: none;
}
.ws-view.is-light .ws-empty::before {
  background: radial-gradient(closest-side, rgb(233 233 230 / 0.92), rgb(233 233 230 / 0));
}
.ws-empty {
  position: absolute;
  left: 50%;
  bottom: 9%;
  z-index: 2;
  width: min(460px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.ws-empty h2 {
  font-size: 17px;
  font-weight: 650;
}
.ws-empty p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
}
.ws-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.ws-empty .btn {
  height: 40px;
  padding: 0 18px;
  font-size: 14.5px;
}
.ws-view.is-light .ws-empty h2 {
  color: #1a1a1a;
}
.ws-view.is-light .ws-empty p {
  color: #4a4a4a;
}
.ws-empty:not([hidden]) ~ .ws-hint {
  opacity: 0.7;
}
.stage-card {
  border-radius: var(--radius);
  background: rgb(21 21 21 / 0.92);
}
.stage-card__spin {
  border-top-color: var(--ink);
}
.stage-card__bar i {
  background: var(--ink);
}

/* ── The timeline ── */
.tl {
  --tl-label: 200px;
  padding-bottom: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.tl-head {
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px 8px 10px;
}
.tl label {
  gap: 7px;
  color: var(--ink-2);
  font-size: 14px;
}
.tl input,
.tl select {
  height: 34px;
  padding: 0 10px;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
}
.tl select {
  width: auto;
  max-width: 96px;
  padding-right: 6px;
}
.tl-head {
  flex-wrap: wrap;
}
.tl-edit input[type="number"] {
  width: 64px;
  height: 30px;
  padding: 0 8px;
  font: 13px var(--mono);
}
.tl-edit label {
  font-size: 13px;
}
.tl-num {
  position: relative;
  display: inline-flex;
}
.tl-num input[type="number"] {
  width: 64px;
  padding-right: 22px;
  font-family: var(--mono);
  font-size: 13px;
  -moz-appearance: textfield;
}
.tl-num input::-webkit-inner-spin-button {
  display: none;
}
.tl-num i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font: 13px var(--mono);
  font-style: normal;
  pointer-events: none;
}
.tl-num input:disabled + i {
  opacity: 0.5;
}
.tl input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #e8e8e8;
}
.tl .tool {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.tl .tool--quiet {
  color: var(--muted);
}
.tl .tool svg {
  width: 15px;
  height: 15px;
}
.tl-head > * {
  flex: none;
}
.tl-head > .tl-spring {
  flex: 1;
}
.tl-time {
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  color: var(--muted);
  font: 13px var(--mono);
}
.tl-time b {
  color: var(--ink);
  font-weight: 500;
}
.tl .btn--small {
  height: 34px;
  padding: 0 10px;
  font-size: 14px;
}
.tl-edit {
  padding: 6px 14px;
}
.tl-ruler {
  height: 34px;
  background: var(--panel);
}
.tl-ruler > span {
  border-right: 1px solid var(--line);
}
.tl-tick {
  padding: 8px 0 0 6px;
  border-left-color: var(--line);
  font: 12px var(--mono);
}
.tl-row {
  height: 34px;
}
.tl-name {
  padding: 0 10px 0 16px;
  font-size: 13px;
}
.tl-row--empty {
  height: 90px;
  border-bottom: 0;
}
.tl-row--empty .tl-name {
  align-items: flex-start;
  padding-top: 16px;
  color: var(--ink-2);
  cursor: default;
}
.tl-row--empty .tl-name:hover {
  background: none;
}
.tl-row--empty .tl-track {
  display: grid;
  place-items: center;
}
.tl-empty {
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.tl-bar {
  top: 6px;
  bottom: 6px;
  border-radius: 5px;
  background: #4a4a4a;
  font-size: 12px;
}
.tl-bar--text {
  background: #6b5a52;
}
.tl-bar--image {
  background: #45605d;
}
.tl-bar--particles {
  background: #6b6040;
}
.tl-row.is-selected .tl-bar {
  outline-color: var(--ink);
}
.tl-playhead i {
  width: 2px;
  margin-left: -1px;
  background: var(--target);
}
.tl-playhead i::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 8px;
  border-radius: 2px 2px 5px 5px;
  background: var(--target);
}
.tl-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.tl-grip i {
  background: var(--line-strong);
}

/* ── The project list ── */
body:not(.is-workspace) .bar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
}
body:not(.is-workspace) .wrap {
  max-width: 1240px;
  padding: 36px 28px 64px;
}
.lv-head {
  margin-bottom: 24px;
}
.lv-head h2 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.lv-count {
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font: 500 12.5px/1.5 var(--mono);
}
.lv-search input {
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.lv-filters {
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border-color: var(--line-strong);
}
.lv-filters button {
  height: 30px;
  border-radius: 5px;
  font-weight: 500;
  font-size: 13.5px;
}
.lv-filters button[aria-selected="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.lv-filters button span {
  font-family: var(--mono);
  font-size: 12px;
}
.lv-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.cc {
  border-radius: var(--radius);
  border-color: var(--line);
  background: var(--panel);
}
.cc:hover {
  transform: none;
  border-color: rgb(255 255 255 / 0.22);
  box-shadow: none;
}
.cc__cover {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--stage);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.cc__cover.has-image {
  background-color: var(--stage);
  background-size: cover;
}
.cc__cover.has-image::after {
  background: linear-gradient(to top, rgb(0 0 0 / 0.25), transparent 40%);
}
.cc__art span {
  width: 92px;
  height: 64px;
  border: 1.5px dashed color-mix(in srgb, var(--target) 75%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--target) 7%, transparent);
  backdrop-filter: none;
  transform: perspective(300px) rotateX(48deg) rotateZ(-14deg);
  color: color-mix(in srgb, var(--target) 80%, #fff);
  font-size: 22px;
  font-weight: 650;
}
.cc__body {
  gap: 6px;
  padding: 14px 16px 16px;
}
.cc__top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cc__title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
.cc__top .badge {
  flex: none;
}
.cc__meta {
  font-size: 13px;
}
.cc__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cc__steps {
  gap: 4px 12px;
  font-size: 12.5px;
}
.cc__steps span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cc__steps i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #555;
}
.cc__steps .ok {
  color: var(--ink-2);
}
.cc__steps .ok i {
  border-color: var(--ok);
  background: var(--ok);
}
.cc__expiry {
  font: 12px var(--mono);
}
.lv-grid > li {
  position: relative;
}
.cc__delete {
  border-radius: var(--radius-sm);
  background: rgb(21 21 21 / 0.85);
  border: 1px solid var(--line-strong);
}
.empty {
  padding: 96px 16px;
}
.empty__art {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--target);
}
.empty__art svg {
  width: 38px;
  height: 38px;
}
.empty h2 {
  font-size: 20px;
}

/* Dialogs and the sign-in card follow the same surfaces. */
.card {
  border-radius: 14px;
  border-color: var(--line-strong);
  background: var(--panel);
}
.dialog .card {
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8);
}
.kind.is-on {
  border-color: var(--ink);
  background: var(--surface-2);
}

.tl-head .tl-check {
  margin-left: 2px;
}
.ws-view:has(.ws-empty:not([hidden])) .stage-card--info {
  display: none; /* the first-run card says what to do */
}

/* ── Template library: its page, its cards, and the pick / save dialog ─────────────────────────────── */
.bar__left:has(.nav-tabs) {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-tabs {
  display: flex;
  gap: 2px;
}
.nav-tabs a {
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 550;
  text-decoration: none;
}
.nav-tabs a:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.nav-tabs a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
}
.pane-head__tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.lib .lv-tools .btn {
  flex: none;
}
.lib-status {
  min-height: 1.5em;
  margin: 0 0 8px;
  font-size: 13px;
}
.lib-status:empty {
  min-height: 0;
  margin: 0;
}
.lib-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.lc {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.lc:hover {
  border-color: var(--line-strong);
}
.lc__thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--stage) center / cover no-repeat;
  color: var(--muted);
  font-size: 28px;
}
.lc__thumb.has-image span {
  display: none;
}
.lc__body {
  display: grid;
  gap: 2px;
  padding: 10px 12px 4px;
  min-width: 0;
}
.lc__title {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lc__meta {
  color: var(--muted);
  font-size: 12px;
}
.lc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 6px 8px;
}
.lc__actions .linkbtn {
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-2);
}
.lc__actions .linkbtn--danger {
  margin-left: auto;
  color: var(--muted);
}
.lc__actions .linkbtn--danger:hover {
  color: var(--bad);
}
.dialog--wide {
  width: min(100% - 24px, 760px);
}
.dialog--lib .card {
  max-height: min(86dvh, 760px);
  overflow: auto;
}
.lib-pick {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.lib-pick__card {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 0 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.lib-pick__card:hover {
  border-color: var(--line-strong);
}
.lib-pick__card:has(input:checked) {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.lib-pick__card input {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}
.lib-pick__card .lc__thumb {
  margin-bottom: 6px;
  font-size: 22px;
}
.lib-pick__name {
  overflow: hidden;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lib-pick__meta {
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.lib-pick__search {
  width: 100%;
}
.lib-checks {
  margin: 0;
  padding: 0;
  border: 0;
}
.lib-checks legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}
.lib-checks ul {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 40dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.lib-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--ink);
  font-weight: 450;
  cursor: pointer;
}
.lib-check:hover {
  background: var(--surface-2);
}
.lib-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}
.lib-check:has(input:disabled) {
  opacity: 0.5;
  cursor: default;
}
.lib-check .muted {
  margin-left: auto;
  font-size: 12px;
}
.lib-note {
  color: var(--ok);
}
.lib-note a {
  color: var(--ink);
  font-weight: 600;
}
@media (max-width: 640px) {
  .lib-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .bar__left:has(.nav-tabs) {
    gap: 8px;
  }
}

/* Library: a card opens its 3D view */
.lc__view {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.lc__view .lc__thumb {
  transition: filter 0.15s ease;
}
.lc__view:hover .lc__thumb {
  filter: brightness(1.12);
}
.lc__view:focus-visible,
button.lc__title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
button.lc__title {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
button.lc__title:hover {
  text-decoration: underline;
}
.dialog--viewer {
  width: min(100% - 24px, 980px);
}
.lib-viewer {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.lib-viewer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lib-viewer__title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.lib-viewer__title h2 {
  overflow: hidden;
  font-size: 18px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lib-viewer__title .muted {
  font-size: 12px;
}
.lib-viewer__tools {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
}
.lib-viewer__stage {
  position: relative;
  height: min(68dvh, 620px);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--stage);
}
#lib-viewer-stage {
  position: absolute;
  inset: 0;
}
.lib-viewer__msg {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
.lib-viewer__hint {
  margin: 0;
  text-align: center;
}
@media (max-width: 640px) {
  .lib-viewer__stage {
    height: 60dvh;
  }
}

/* "Stays on": how many scenes an object is carried over (its scene names can be long). */
.span-pick {
  display: grid;
  gap: 6px;
  margin: 12px 0 4px;
  font-size: 12px;
}
.span-pick select {
  width: 100%;
  min-width: 0;
}

/* The Always-on layer: above the scenes, outside their order. */
.always-sec .pane-note {
  margin: 0;
}
.linkbtn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #c5ff4a);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Performance (a project's guest analytics: performance.js) ─────────────────────────────────── */
.pf {
  --pf-good: var(--ok);
  --pf-fair: var(--warn);
  --pf-poor: var(--bad);
  --pf-bar: #d9d9d9;
}
.pf-loading {
  padding: 40px 0;
}
.pf-empty h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 16px;
}
.pf-empty code,
.pf-errors code {
  font: 12px/1.4 var(--mono);
}
.pf-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.pf-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.pf-tile__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.pf-tile__value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.pf-tile__note {
  color: var(--muted);
  font-size: 12px;
}
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.pf-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.pf-card--wide {
  margin-bottom: 12px;
  overflow-x: auto;
}
.pf-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pf-card__head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.pf-card__head .muted {
  font-size: 12px;
}
.pf-section {
  margin: 28px 0 12px;
  font-size: 16px;
}
.pf-foot {
  margin: 12px 0 0;
  font-size: 12px;
}

/* Score: status colour with its word, never colour alone. */
.pf-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.pf-chip small {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}
.pf-chip--good small {
  background: var(--pf-good);
}
.pf-chip--fair small {
  background: var(--pf-fair);
}
.pf-chip--poor small {
  background: var(--pf-poor);
}
.pf-tile .pf-chip small {
  font-size: 12px;
  transform: translateY(-3px);
}
.pf-stack {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
}
.pf-stack i {
  min-width: 4px;
}
.pf-stack--good,
.pf-dot--good {
  background: var(--pf-good);
}
.pf-stack--fair,
.pf-dot--fair {
  background: var(--pf-fair);
}
.pf-stack--poor,
.pf-dot--poor {
  background: var(--pf-poor);
}
.pf-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.pf-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.pf-legend__n {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Share bars (funnel, devices). */
.pf-bars,
.pf-funnel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pf-bars li,
.pf-funnel li {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) 1.4fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.pf-funnel li {
  grid-template-columns: minmax(120px, 1fr) 1.4fr auto;
}
.pf-bars__label,
.pf-funnel__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.pf-bars__track,
.pf-funnel__track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.pf-bars__track i,
.pf-funnel__track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--pf-bar);
}
.pf-bars__n,
.pf-funnel__n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pf-bars__n small,
.pf-funnel__n small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}
.pf-bars__score {
  min-width: 74px;
  text-align: right;
}

.pf-dl {
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.pf-dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pf-dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.pf-dl dt {
  color: var(--ink-2);
}
.pf-dl dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pf-errors {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.pf-errors li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.pf-errors code {
  color: var(--bad);
  overflow-wrap: anywhere;
}

/* Sessions per day. */
.pf-daily-wrap {
  position: relative;
}
.pf-daily {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}
.pf-bar {
  fill: var(--pf-bar);
}
.pf-hit {
  fill: transparent;
}
.pf-hit:hover {
  fill: rgb(255 255 255 / 0.04);
}
.pf-gridline {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.pf-baseline {
  stroke: var(--line-strong);
  vector-effect: non-scaling-stroke;
}
.pf-axis {
  fill: var(--muted);
  font-size: 11px;
}
.pf-tip {
  position: absolute;
  top: -6px;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.pf-table-toggle {
  margin-top: 10px;
  font-size: 13px;
}
.pf-table-toggle summary {
  color: var(--muted);
  cursor: pointer;
}
.pf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pf-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pf-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.pf-table tr:last-child td {
  border-bottom: 0;
}
.pf-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
@media (max-width: 1100px) {
  .pf-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .pf-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pf-grid {
    grid-template-columns: 1fr;
  }
  .pf-bars li {
    grid-template-columns: minmax(70px, 1fr) 1fr auto;
  }
  .pf-bars__score {
    display: none;
  }
}
