/* Paper & Ink — nicbenedetto.com/ds */

:root {
  --canvas: #ffffff;
  --soft: #f7f6f3;
  --hover: rgba(55, 53, 47, 0.06);
  --ink: #37352f;
  --muted: #787774;
  --faint: #9b9a97;
  --line: rgba(55, 53, 47, 0.09);
  --line-strong: rgba(55, 53, 47, 0.16);
  --link: #2383e2;
  --cta: #0075de;
  --cta-hover: #005bab;
  --accent-soft: #f2f9ff;
  --callout: #f1f1ef;
  --warn: #c47d1a;
  --fail: #eb5757;
  --fail-wash: #fdebec;
  --focus: rgba(35, 131, 226, 0.57) 0 0 0 1px inset, rgba(35, 131, 226, 0.35) 0 0 0 2px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

.shell,
.shell-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 45px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.topbar .ready-tag {
  margin-right: 2px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
}

.breadcrumbs .crumb {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.breadcrumbs a.crumb:hover {
  color: var(--ink);
}

.breadcrumbs .crumb.current {
  color: var(--ink);
}

.breadcrumbs .sep {
  color: var(--faint);
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.meta.warn {
  color: var(--warn);
}

.spacer {
  flex: 1;
}

.btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--canvas);
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}

.btn:hover:not(:disabled) {
  background: var(--hover);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn.primary {
  background: var(--cta);
  border-color: var(--cta);
  color: #fff;
  font-weight: 500;
}

.btn.primary:hover:not(:disabled) {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}

.btn.stop {
  background: var(--fail);
  border-color: var(--fail);
  color: #fff;
  font-weight: 500;
}

.btn.stop:hover {
  background: #d14646;
  border-color: #d14646;
}

.render-eta {
  flex: 0 0 auto;
  min-width: 5.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.debug-menu {
  position: relative;
  display: inline-flex;
}

.debug-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(55, 53, 47, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.debug-menu.is-open .debug-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.debug-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.debug-menu-item:hover {
  background: var(--callout);
}

.download-gate {
  position: relative;
  display: inline-flex;
}

.download-gate .btn:disabled {
  pointer-events: none;
}

.download-gate-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(55, 53, 47, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.download-gate:hover .download-gate-menu,
.download-gate:focus-within .download-gate-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.download-gate-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.download-gate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-gate-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.download-gate-list li.is-ready {
  color: #0f7b6c;
}

.download-gate-list li.is-pending {
  color: var(--ink);
}

.download-gate-check {
  flex: none;
  width: 1em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.download-gate-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

/* ---------- layout ---------- */

.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.library {
  width: 232px;
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--soft);
  overflow: auto;
  padding: 16px 8px 32px;
}

.group-label {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px;
  margin-bottom: 4px;
}

.group-label.spaced {
  margin-top: 24px;
}

.group-title {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
  font-weight: 500;
}

.group-actions {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.group-icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0;
}

.group-icon:hover {
  background: var(--hover);
  color: var(--ink);
}

.group-icon.on {
  background: var(--fail-wash);
  color: var(--fail);
}

.group-filter {
  height: 22px;
  padding: 0 6px;
  margin-right: 2px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.group-filter:hover {
  background: var(--hover);
  color: var(--ink);
}

.group-filter.on {
  background: var(--accent-soft);
  color: var(--link);
}

.file-input {
  display: none;
}

.media-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding-right: 2px;
}

.media-row .media {
  flex: 1;
  min-width: 0;
}

.media-thumb-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.media-thumb-btn.wide {
  width: 52px;
}

.media-thumb-btn:hover {
  background: var(--hover);
}

.library.tools .tool-row .media-name,
.library.tools .tool-row .name-edit {
  flex: 1;
  min-width: 0;
}

.media.song .media-name,
.media.song .name-edit {
  flex: 1;
  min-width: 0;
}

.media-name {
  flex: 1;
  min-width: 0;
  padding: 0 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.media-row.current {
  background: var(--accent-soft);
  border-radius: 4px;
}

.media-trash {
  width: 26px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0;
}

.media-trash:hover {
  background: var(--fail-wash);
  color: var(--fail);
}

.media-pick {
  flex: none;
  margin: 0 2px 0 6px;
  accent-color: var(--cta);
  cursor: pointer;
}

.media-row .media-thumb {
  flex: none;
  cursor: pointer;
}

.media-row .media-note {
  flex: none;
  width: 1.25em;
  text-align: center;
  color: var(--muted);
}

.media-row .len {
  flex: none;
  margin-right: 4px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.media-row .sound-volume {
  flex: none;
  width: 64px;
  margin-right: 4px;
  accent-color: var(--link);
  cursor: pointer;
}

.media-row .media-name {
  cursor: default;
}

.media {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.media:hover {
  background: var(--hover);
}

.media.song {
  cursor: grab;
}

.media.song:active {
  cursor: grabbing;
}

.media.current {
  background: var(--accent-soft);
}

.media.dragging {
  opacity: 0.4;
}

.media-thumb {
  width: 32px;
  height: 22px;
  flex: none;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--canvas) center/cover no-repeat;
}

.media-note {
  width: 32px;
  flex: none;
  text-align: center;
  color: var(--faint);
}

.media .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media .len {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- video page ---------- */

.video-page {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 32px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* Video editor: scenes/transitions rail + main stage */
.video-page.is-workspace {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  padding: 0;
  max-width: none;
  margin: 0;
}

.video-sidebar {
  flex: 0 0 260px;
  width: 260px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px 16px 28px;
  border-right: 1px solid var(--line);
  background: var(--soft);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.video-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.video-sidebar .sequence-head {
  margin: 0;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.video-sidebar .sequence-head .meta {
  font-size: 11px;
}

.video-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 32px;
}

.video-main .page-title-row {
  max-width: 960px;
}

.video-main .page-blurb,
.video-main .creative-brief,
.video-main .video-preview,
.video-main .overlay-toggles,
.video-main .player,
.video-main .progress {
  max-width: 960px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.video-row:hover {
  background: var(--hover);
}

.video-thumb {
  width: 72px;
  height: 48px;
  flex: none;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: var(--soft) center/cover no-repeat;
}

.video-thumb.blank {
  background: var(--soft);
}

.video-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.video-meta .name {
  font-weight: 500;
}

.video-meta .len {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.jars-page {
  max-width: 1100px;
}

.jar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.jar-card {
  display: flex;
  flex-direction: column;
  max-width: 460px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(55, 53, 47, 0.09);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.jar-card:hover {
  transform: translateY(-2px);
  border-color: rgba(55, 53, 47, 0.22);
  box-shadow: 0 16px 40px rgba(55, 53, 47, 0.13);
}

.jar-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--soft) center/cover no-repeat;
  border-bottom: 1px solid var(--line);
}

.jar-card-thumb.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: repeating-linear-gradient(
    -45deg,
    var(--soft),
    var(--soft) 10px,
    #efeee9 10px,
    #efeee9 20px
  );
}

.jar-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 18px;
}

.jar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.jar-card-name {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jar-card-summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.jar-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.jar-card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b7794a;
  flex: none;
}

.jar-card-count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.jar-descriptor {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a6a4a;
  background: #f3ebe2;
  padding: 3px 8px;
  border-radius: 999px;
}

.jar-descriptor.is-large {
  align-self: center;
  font-size: 11px;
  padding: 4px 10px;
}

.jar-page .jar-hero {
  margin: 4px 0 18px;
  width: min(100%, 720px);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1714;
  border: 1px solid var(--line-strong);
}

.jar-hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jar-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 22px;
  max-width: 920px;
}

.jar-panel {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.jar-panel-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.jar-panel-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
}

.jar-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .jar-panels {
    grid-template-columns: 1fr;
  }
}

.ready-tag {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--callout);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.ready-tag.is-ready {
  color: #0f7b6c;
  background: #e7f5f2;
}

.ready-tag.is-outdated {
  color: #8a5a00;
  background: #fff3d6;
}

.ready-tag.is-missing {
  color: #a32020;
  background: #fdecec;
}

.btn.icon-btn {
  width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.icon-btn:disabled {
  opacity: 0.35;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  flex-wrap: wrap;
}

.page-title-row .page-title {
  margin: 0;
}

.page-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.25px;
}

.scene-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scene-meta-top .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-meta-top .ready-tag {
  padding: 1px 6px;
  font-size: 10px;
}

.scene-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(35, 131, 226, 0.12);
  color: var(--link);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.page-blurb {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.creative-brief {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
}

.details-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.details-toggle:hover {
  background: var(--hover);
}

.details-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.details-chevron {
  flex: none;
  width: 1em;
  color: var(--muted);
  font-weight: 500;
}

.details-status {
  flex: none;
  font-size: 12px;
  font-weight: 500;
}

.details-status.is-incomplete {
  color: var(--fail);
}

.details-status.is-complete {
  color: #0f7b6c;
}

.brief-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 12px 14px;
  border-top: 1px solid var(--line-strong);
  background: #fff;
}

.brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.brief-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brief-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.brief-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brief-copy {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.brief-copy-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.brief-label .req {
  margin-left: 3px;
  color: var(--fail);
  font-weight: 700;
}

.brief-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.brief-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.brief-input:focus {
  outline: none;
  border-color: var(--link);
  background: #fff;
}

.brief-prompt {
  min-height: 140px;
}

.destination-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.destination-prompt {
  min-height: 72px;
}

.scene-brief {
  margin: 0 0 16px;
}

.destination-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.destination-index {
  flex: none;
  width: 1.25em;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.destination-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.destination-input:focus {
  outline: none;
  border-color: var(--link);
}

.destination-remove {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}

.destination-remove:hover:not(:disabled) {
  color: var(--fail);
  background: var(--fail-wash);
}

.destination-remove:disabled {
  opacity: 0.35;
  cursor: default;
}

.destination-add {
  align-self: flex-start;
  margin-top: 2px;
}

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

.cast-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cast-thumb {
  width: 100%;
  aspect-ratio: 1;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--soft) center/cover no-repeat;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.cast-thumb:hover {
  border-color: var(--link);
  color: var(--ink);
}

.cast-slot.filled .cast-thumb {
  border-style: solid;
}

.cast-thumb.blank {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cast-note {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.cast-note:focus {
  outline: none;
  border-color: var(--link);
}

.cast-clear {
  align-self: flex-start;
  border: none;
  padding: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.cast-clear:hover {
  color: var(--fail);
}

@media (max-width: 720px) {
  .cast-grid {
    grid-template-columns: 1fr;
  }

  .video-page.is-workspace {
    flex-direction: column;
    overflow: auto;
  }

  .video-page.is-workspace .video-sidebar {
    flex: none;
    width: 100%;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .video-page.is-workspace .video-main {
    overflow: visible;
  }
}

.player.video-player {
  margin-top: 0;
  margin-bottom: 8px;
}

.video-preview {
  margin: 0 0 10px;
}

.overlay-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 16px;
}

.overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.overlay-toggle.on {
  color: var(--ink);
}

.overlay-toggle input {
  margin: 0;
  accent-color: var(--cta);
}

.shell.is-expanded .video-page {
  position: fixed;
  inset: 0;
  z-index: 40;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #141210;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
}

.shell.is-expanded .video-sidebar {
  display: none;
}

.shell.is-expanded .video-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  max-width: none;
  overflow: hidden;
  background: #141210;
}

.shell.is-expanded .video-main > :not(.video-preview) {
  display: none;
}

.shell.is-expanded .video-main > .video-preview {
  width: min(100%, calc((100vh - 40px) * 3 / 2));
  max-height: calc(100vh - 40px);
  margin: 0;
  max-width: none;
}

.scene-strip {
  display: flex;
  align-items: stretch;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 16px;
  min-height: 180px;
}

.video-sidebar .scene-strip {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: visible;
  padding: 0;
  min-height: 0;
  gap: 8px;
}

.video-sidebar .scene-card {
  width: 100%;
}

.scene-strip.is-placing {
  gap: 0;
}

.video-sidebar .scene-strip.is-placing {
  gap: 0;
}

.scene-slot {
  flex: none;
  align-self: stretch;
  width: 28px;
  margin: 4px 6px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.video-sidebar .scene-slot {
  width: 100%;
  height: 22px;
  margin: 0;
}

.scene-slot::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 52px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--link);
  opacity: 0.35;
  transition: opacity 120ms ease, width 120ms ease, margin-left 120ms ease,
    height 120ms ease, margin-top 120ms ease;
}

.video-sidebar .scene-slot::before {
  top: 50%;
  bottom: auto;
  left: 10px;
  right: 10px;
  width: auto;
  height: 3px;
  margin-left: 0;
  margin-top: -1.5px;
}

.scene-slot:hover::before,
.scene-slot:focus-visible::before {
  opacity: 1;
  width: 4px;
  margin-left: -2px;
}

.video-sidebar .scene-slot:hover::before,
.video-sidebar .scene-slot:focus-visible::before {
  width: auto;
  height: 4px;
  margin-left: 0;
  margin-top: -2px;
}

.scene-slot:focus-visible {
  outline: none;
}

.scene-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 200px;
  flex: none;
  position: relative;
  padding: 4px;
  border-radius: 8px;
  transition: background 150ms ease, opacity 150ms ease;
}

.scene-card:hover {
  background: var(--hover);
}

.scene-card.playing {
  background: var(--accent-soft);
}

.scene-card.moving {
  opacity: 0.45;
  outline: 1px solid var(--link);
  outline-offset: 1px;
}

.scene-card .handle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
}

.scene-card .handle:hover {
  color: var(--ink);
  background: #fff;
}

.scene-card.moving .handle {
  color: var(--link);
  background: #fff;
}

.scene-card .trash {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--faint);
  cursor: pointer;
  opacity: 0;
}

.scene-card:hover .trash {
  opacity: 1;
}

.scene-card .trash:hover {
  color: var(--fail);
}

.scene-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--soft) center/cover no-repeat;
  cursor: pointer;
}

.scene-thumb.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--faint);
  font-size: 12px;
}

.scene-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
  cursor: pointer;
}

.scene-meta .name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-meta .len {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.video-sidebar .btn.add,
.video-sidebar .transition-add {
  align-self: stretch;
  justify-content: center;
  margin: 0;
}

.transition-pool {
  margin: 0;
  padding: 12px 10px 10px;
  border-radius: 8px;
  background: #e8e7e4;
  border: 1px solid var(--line-strong);
}

.transition-pool > .sequence-head {
  margin: 0 0 4px;
}

.transition-strip {
  min-height: 0;
  padding-bottom: 0;
  align-items: stretch;
}

.transition-add {
  flex: none;
  align-self: stretch;
  margin: 0;
}

.scene-card.selected {
  outline: 2px solid #c4554d;
  outline-offset: 1px;
  background: rgba(196, 85, 77, 0.08);
}

.scene-card.is-transition {
  position: relative;
}

.transition-use-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  min-width: 44px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #c4554d;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.transition-use-btn:hover {
  background: #a9443e;
}

.transition-use-btn.is-on {
  background: #37352f;
}

.transition-gap-spacer {
  flex: none;
  width: 10px;
}

.video-sidebar .transition-gap-spacer {
  width: auto;
  height: 6px;
}

.transition-markers {
  flex: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 32px;
  margin: 0 2px;
}

.video-sidebar .transition-markers {
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 2px 0;
  gap: 6px;
  justify-content: center;
}

.transition-dot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.transition-dot {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #c4554d;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(196, 85, 77, 0.25);
}

.transition-variant-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c4554d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.transition-settings {
  margin: 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.transition-settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.transition-settings-toggle:hover {
  background: rgba(55, 53, 47, 0.04);
}

.transition-settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 12px 12px;
}

.transition-variants {
  margin-top: 4px;
}

.transition-bridge-list li {
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 0 -6px;
  align-items: center;
}

.transition-bridge-list li:hover {
  background: rgba(55, 53, 47, 0.06);
}

.transition-bridge-list li.is-selected {
  background: rgba(196, 85, 77, 0.12);
}

.transition-variant-label {
  flex: 1 1 auto;
  min-width: 0;
}

.transition-bridge-list .fade-zoom-includes.is-row {
  flex: 0 0 auto;
  gap: 6px;
}

.transition-bridge-list .fade-zoom-include.is-compact {
  min-width: 0;
  gap: 5px;
  padding: 3px 8px;
  font-size: 12px;
}

.transition-bridge-list .len {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.transition-dot:hover,
.transition-dot:focus-visible {
  transform: scale(1.15);
  outline: none;
}

.transition-dot-x {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #9b2c2c;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(55, 53, 47, 0.16);
}

.transition-dot-wrap:hover .transition-dot-x,
.transition-dot-wrap:focus-within .transition-dot-x {
  display: flex;
}

.transition-dot-x:hover {
  background: #fdecea;
}

.transition-drop {
  flex: none;
  align-self: stretch;
  width: 28px;
  margin: 4px 6px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(196, 85, 77, 0.14);
  cursor: pointer;
  position: relative;
}

.video-sidebar .transition-drop {
  width: 100%;
  height: 22px;
  margin: 0;
}

.transition-drop::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 52px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #c4554d;
  opacity: 0.85;
}

.video-sidebar .transition-drop::before {
  top: 50%;
  bottom: auto;
  left: 10px;
  right: 10px;
  width: auto;
  height: 3px;
  margin-left: 0;
  margin-top: -1.5px;
}

.transition-drop:hover,
.transition-drop:focus-visible {
  background: rgba(196, 85, 77, 0.28);
  outline: none;
}

.scene-strip.is-placing-transition .scene-card:not(.selected) {
  opacity: 0.72;
}

.transition-fx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.transition-fx-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.transition-fx-select {
  min-width: 140px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.fade-zoom-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.fade-zoom-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fade-zoom-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.fade-zoom-includes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fade-zoom-include {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--canvas);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.fade-zoom-include.on {
  color: var(--ink);
  border-color: rgba(35, 131, 226, 0.45);
  background: rgba(35, 131, 226, 0.08);
}

.fade-zoom-include input {
  margin: 0;
  accent-color: var(--cta);
}

.fade-zoom-guide {
  position: absolute;
  z-index: 2;
  border: 2px dashed rgba(196, 85, 77, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  background: rgba(196, 85, 77, 0.08);
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

.fade-zoom-guide.is-end {
  z-index: 3;
  border-color: rgba(35, 131, 226, 0.95);
  background: rgba(35, 131, 226, 0.1);
}

.fade-zoom-guide.dragging {
  cursor: grabbing;
}

.fade-zoom-guide.is-start.dragging {
  background: rgba(196, 85, 77, 0.16);
}

.fade-zoom-guide.is-end.dragging {
  background: rgba(35, 131, 226, 0.18);
}

.fade-zoom-guide.is-preview-hidden {
  visibility: hidden;
  pointer-events: none;
}

.fade-zoom-label {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
}

.fade-zoom-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgba(196, 85, 77, 0.95);
  border: 1.5px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  cursor: nwse-resize;
  touch-action: none;
}

.fade-zoom-guide.is-end .fade-zoom-handle {
  background: rgba(35, 131, 226, 0.95);
}

.scene-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.scene-title-row .scene-title {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.scene-transition-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.scene-transition-toggle.on {
  border-color: rgba(35, 131, 226, 0.35);
  background: rgba(35, 131, 226, 0.08);
  color: var(--link);
}

.scene-transition-toggle input {
  margin: 0;
}

.transition-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.transition-note {
  margin: 0;
  line-height: 1.45;
}

.transition-bridge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.transition-bridge-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.transition-bridge-list li:first-child {
  border-top: none;
}

.transition-duration-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.transition-map-hold {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  position: relative;
}

.transition-map-hold input {
  width: 72px;
  padding: 4px 28px 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
}

.transition-unit {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 11px;
  color: var(--faint);
  pointer-events: none;
}

.transition-duration-total {
  padding-bottom: 6px;
}

.transition-variants-head {
  align-items: center;
}

.transition-variants-head .btn {
  margin-left: auto;
}

.scene-title {
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  background: none;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.25px;
  color: var(--ink);
}

.scene-title:focus {
  outline: none;
}

.scene-title::placeholder {
  color: var(--faint);
}

.scene-place {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--faint);
}

/* ---------- stage ---------- */

.stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
}

.picture-frame {
  position: relative;
}

.picture-expand,
.picture-download,
.picture-short,
.picture-region {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
}

.picture-expand,
.picture-download,
.picture-short {
  position: absolute;
  top: 10px;
  z-index: 5;
}

.picture-expand {
  right: 10px;
}

.picture-download {
  left: 10px;
}

.picture-short {
  left: 46px;
}

.picture-short:hover,
.picture-short.on {
  color: var(--ink);
  background: #fff;
}

.picture-short.on {
  color: var(--link);
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.35);
}

.picture-region-tools {
  position: absolute;
  top: 10px;
  left: 46px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}

.picture-expand:hover,
.picture-download:hover,
.picture-short:hover,
.picture-region:hover,
.picture-region.on {
  color: var(--ink);
  background: #fff;
}

.picture-region.on {
  color: var(--link);
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.35);
}

.picture-edit.on {
  color: #b45309;
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.35);
}

.picture-fuse {
  width: auto;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.picture-fuse-label {
  line-height: 1;
}

.fuse-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.short-cut-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--soft);
  max-width: 420px;
}

.short-cut-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.short-cut-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.short-cut-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.short-cut-num {
  width: 88px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.short-cut-num:focus {
  outline: none;
  box-shadow: var(--focus);
}

.short-cut-end {
  font-variant-numeric: tabular-nums;
  padding-bottom: 6px;
}

.short-cut-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.picture.short-cut-mode {
  cursor: ew-resize;
}

.short-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 6;
  background: rgba(20, 18, 14, 0.45);
  pointer-events: none;
}

.short-shade-left {
  left: 0;
}

.short-shade-right {
  right: 0;
}

.short-rect {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 7;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.55), inset 0 0 0 1px rgba(35, 131, 226, 0.35);
  cursor: ew-resize;
  touch-action: none;
}

.short-rect-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.player .rail-short-range {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  background: rgba(35, 131, 226, 0.28);
  border-radius: 2px;
  pointer-events: none;
}

.fuse-bar .meta {
  color: var(--muted);
  font-size: 12px;
}

.region-kind {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}

.region-kind.is-disabled {
  opacity: 0.72;
}

.region-kind-btn {
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 7px;
  cursor: pointer;
}

.region-kind-btn:hover:not(:disabled) {
  color: var(--ink);
}

.region-kind-btn.on {
  color: var(--ink);
  background: rgba(55, 53, 47, 0.08);
}

.region-kind-btn:disabled {
  cursor: default;
}

.anim-dials .region-kind {
  background: rgba(255, 255, 255, 0.14);
}

.anim-dials .region-kind-btn {
  color: rgba(255, 255, 255, 0.72);
}

.anim-dials .region-kind-btn.on {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.region-aspect {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}

.region-aspect-btn {
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.region-aspect-btn:hover {
  color: var(--ink);
}

.region-aspect-btn.on {
  background: var(--link);
  color: #fff;
}

.picture {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--soft);
  overflow: hidden;
}

.shell.is-expanded .topbar {
  display: none;
}

.shell.is-expanded .body {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #141210;
}

.shell.is-expanded .library.tools {
  position: relative;
  z-index: 42;
  background: rgba(247, 246, 243, 0.96);
  border-right-color: rgba(55, 53, 47, 0.16);
}

.shell.is-expanded .stage {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shell.is-expanded .stage > .scene-title,
.shell.is-expanded .stage > .scene-title-row,
.shell.is-expanded .stage > .scene-brief,
.shell.is-expanded .stage > .creative-brief,
.shell.is-expanded .stage > .player,
.shell.is-expanded .stage > .sequence-head,
.shell.is-expanded .stage > .playlist,
.shell.is-expanded .stage > .playlist-wrap,
.shell.is-expanded .stage > .callout,
.shell.is-expanded .stage > .progress,
.shell.is-expanded .stage > .add-song,
.shell.is-expanded .stage > .transition-panel,
.shell.is-expanded .stage > .fuse-bar,
.shell.is-expanded .stage > .short-cut-panel,
.shell.is-expanded .stage > .anim-lock-note {
  display: none;
}

.shell.is-expanded .picture-frame {
  width: min(100%, calc((100vh - 40px) * 3 / 2));
  max-height: calc(100vh - 40px);
}

.shell.is-expanded .picture {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 40px);
  border-radius: 6px;
  border-color: rgba(255, 255, 255, 0.12);
}

.shell.is-expanded .picture-expand {
  top: 14px;
  right: 14px;
}

.shell.is-expanded .picture-download {
  top: 14px;
  left: 14px;
}

.shell.is-expanded .picture-region-tools {
  top: 14px;
  left: 50px;
}

.shell.is-expanded .region-aspect {
  background: rgba(255, 255, 255, 0.95);
}

.picture.region-mode {
  cursor: crosshair;
}

.region-capture {
  position: absolute;
  inset: 0;
  z-index: 8;
  cursor: crosshair;
  touch-action: none;
}

.region-marquee {
  position: absolute;
  z-index: 9;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: rgba(35, 131, 226, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.region-marquee.is-edit {
  background: rgba(180, 83, 9, 0.2);
}

.picture.blank {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  color: var(--faint);
}

.picture-zoom-plane {
  position: absolute;
  inset: 0;
  z-index: 1;
  will-change: transform;
}

.picture-still,
.picture-fx-wrap,
.picture-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.picture-still {
  background: center/cover no-repeat;
}

.picture-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.picture-motion .anim-layer {
  pointer-events: none;
  z-index: 2;
}

.picture-map-overlay {
  z-index: 5;
  pointer-events: none;
  /* No CSS transition — video preview updates every frame; easing looked choppy. */
  will-change: transform, opacity;
  overflow: hidden;
}

.picture-map-still {
  z-index: 0;
}

.picture-map-motion {
  z-index: 2;
}

.stage .picture-still {
  will-change: transform;
}

.picture-map-overlay.is-hidden {
  visibility: hidden;
}

.picture-fx-wrap {
  z-index: 4;
  pointer-events: none;
}

.picture-fx-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.picture-fx {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.picture-fx.is-back {
  /* opacity driven by seamless crossfade */
}

.picture-empty {
  position: relative;
  z-index: 1;
}

.library.tools .tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.library.tools .tool-row:hover {
  background: var(--hover);
}

.library.tools .tool-row.on {
  background: var(--accent-soft);
}

.library.tools .tool-row input[type="checkbox"] {
  margin: 0;
  accent-color: var(--cta);
}

.effect-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2px;
}

.effect-block.on {
  padding-bottom: 6px;
}

.effect-speed {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px 2px 30px;
}

.effect-speed-label,
.effect-speed-value {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.effect-speed-value {
  min-width: 2.75em;
  text-align: right;
}

.effect-speed-range {
  width: 100%;
  margin: 0;
  accent-color: var(--cta);
}

.library.tools .media-thumb.wide {
  width: 44px;
  height: 28px;
}

.anim-dials {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 0 2px;
}

.anim-dial {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.anim-dial-label,
.anim-dial-value {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.anim-dial-label {
  min-width: 2.75em;
}

.anim-dial-value {
  min-width: 2.75em;
  text-align: right;
}

.anim-dial-range {
  width: 100%;
  margin: 0;
  accent-color: var(--cta);
}

.anim-aspect {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.anim-aspect-choices {
  display: flex;
  align-items: center;
  gap: 10px;
}

.anim-aspect-btn {
  display: block;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
  background: var(--soft);
  cursor: pointer;
}

.anim-aspect-btn.landscape {
  width: 34px;
  height: 20px;
}

.anim-aspect-btn.portrait {
  width: 16px;
  height: 28px;
}

.anim-aspect-btn:hover {
  border-color: var(--muted);
}

.anim-aspect-btn.on {
  border-color: var(--link);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--link);
}

.anim-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.anim-check.on {
  color: var(--ink);
}

.anim-check input {
  margin: 0;
  accent-color: var(--cta);
}

.anim-trim {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.anim-trim-rail {
  position: relative;
  height: 22px;
  border-radius: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.anim-trim-fill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 3px;
  background: var(--accent-soft);
  border: 1px solid rgba(35, 131, 226, 0.35);
  pointer-events: none;
}

.anim-trim-start,
.anim-trim-end {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.anim-trim-start::-webkit-slider-thumb,
.anim-trim-end::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  border: 1.5px solid #fff;
  background: var(--link);
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.35);
  cursor: ew-resize;
  pointer-events: auto;
  position: relative;
}

.anim-trim-start::-moz-range-thumb,
.anim-trim-end::-moz-range-thumb {
  width: 12px;
  height: 18px;
  border-radius: 3px;
  border: 1.5px solid #fff;
  background: var(--link);
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.35);
  cursor: ew-resize;
  pointer-events: auto;
}

.anim-trim-start::-webkit-slider-runnable-track,
.anim-trim-end::-webkit-slider-runnable-track,
.anim-trim-start::-moz-range-track,
.anim-trim-end::-moz-range-track {
  background: transparent;
  border: none;
}

.shell.is-expanded .stage > .anim-dials:not(.pending-hint) {
  display: none;
}

.shell.is-expanded .stage > .anim-dials.pending-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 45;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(20, 18, 16, 0.82);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.shell.is-expanded .stage > .anim-dials.pending-hint .meta {
  color: rgba(255, 255, 255, 0.78);
}

.anim-dials.pending-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.anim-layer {
  position: absolute;
  z-index: 3;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.anim-layer.can-drag {
  cursor: grab;
}

.anim-layer.can-drag.selected {
  cursor: grabbing;
}

.anim-layer.is-locked:not(.can-drag),
.anim-layer.is-locked.selected:not(.can-drag) {
  cursor: pointer;
}

.anim-lock-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.shell.is-expanded .stage > .anim-lock-note {
  display: none;
}

.anim-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--cta);
  border: 1.5px solid #fff;
  cursor: nwse-resize;
  touch-action: none;
}

.anim-layer.is-pending {
  border: 1.5px dashed rgba(255, 255, 255, 0.9);
  background: rgba(35, 131, 226, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.anim-layer.is-pending.selected {
  border-color: #fff;
  background: rgba(35, 131, 226, 0.28);
}

.edit-layer.is-pending {
  background: rgba(180, 83, 9, 0.18);
}

.edit-layer.is-pending.selected {
  background: rgba(180, 83, 9, 0.3);
}

.edit-layer .anim-mark {
  background: #b45309;
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.35);
}

.edit-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.anim-pending-fill {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.anim-pending-label {
  position: absolute;
  left: 6px;
  bottom: 5px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(20, 18, 16, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.anim-copy {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 3;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.anim-copy:hover {
  background: #fff;
}

.anim-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--link);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(35, 131, 226, 0.35);
  pointer-events: none;
}

.anim-video-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
}

.anim-video-wrap.is-back {
  opacity: 0;
}

.anim-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
  background: transparent;
}

.anim-video.soft-edges,
.edit-still.soft-edges {
  /* Soft rectangular falloff so hard frame edges blend into the scene. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect;
}

.name-edit {
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 0;
  padding: 0 4px;
  border: 1px solid var(--link);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.anim-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lower-third {
  position: absolute;
  z-index: 6;
  max-width: min(46%, 420px);
  padding: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 2px 14px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: opacity 40ms linear;
  pointer-events: auto;
}

.lower-third.selected {
  outline: 1.5px solid rgba(255, 255, 255, 0.85);
  outline-offset: 6px;
  cursor: grabbing;
}

.lower-third.is-hidden {
  pointer-events: none;
}

.lower-third-title {
  font-size: clamp(15px, 2.1vw, 22px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.lower-third-sub {
  margin-top: 3px;
  font-size: clamp(11px, 1.35vw, 14px);
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

.lower-third-credit .lower-third-title {
  font-size: clamp(13px, 1.7vw, 17px);
  font-weight: 500;
  opacity: 0.92;
}

/* ---------- player ---------- */

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

.play {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--canvas);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  transition: background 150ms ease;
}

.play:hover:not(:disabled) {
  background: var(--hover);
}

.play:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.play:disabled {
  opacity: 0.4;
  cursor: default;
}

.player .time {
  width: 36px;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.player .rail {
  position: relative;
  flex: 1;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.player .rail-fill {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.player .rail .fill {
  height: 100%;
  width: 0;
  background: var(--ink);
}

.player .rail-event-span.is-transition {
  position: absolute;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: rgba(196, 85, 77, 0.38);
  pointer-events: none;
  z-index: 1;
}

.player .rail-event.is-transition {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  padding: 0;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: rgba(196, 85, 77, 0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 2;
}

.player .rail-event.is-transition:hover,
.player .rail-event.is-transition.is-active {
  transform: scale(1.2);
  background: rgba(175, 60, 52, 1);
}

.player .rail-event.is-transition:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.player .knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(15, 15, 15, 0.08);
  pointer-events: none;
  z-index: 3;
}

.player .rail:hover .knob {
  transform: scale(1.15);
}

.song-row.playing {
  background: var(--accent-soft);
}

.song-row.playing .name {
  color: var(--ink);
}

.sequence-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- playlist ---------- */

.playlist-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist {
  min-height: 76px;
  border-radius: 6px;
}

.playlist.drop-into {
  outline: 1px solid var(--link);
  outline-offset: 2px;
}

.song-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 150ms ease;
}

.song-row:hover {
  background: var(--hover);
}

.song-row.moving {
  opacity: 0.45;
  outline: 1.5px solid var(--link);
  outline-offset: -1px;
}

.playlist.is-placing .song-row {
  cursor: default;
}

.song-slot {
  display: block;
  width: 100%;
  height: 10px;
  margin: 2px 0;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.song-slot::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 1px;
  background: var(--link);
  opacity: 0.35;
}

.song-slot:hover::before {
  opacity: 1;
  height: 3px;
  margin-top: -1.5px;
}

.song-row .handle {
  width: 24px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0;
}

.song-row .handle:hover {
  background: var(--hover);
  color: var(--muted);
}

.song-row.moving .handle {
  background: var(--accent-soft);
  color: var(--link);
}

.grip {
  display: grid;
  grid-template-columns: 3px 3px;
  gap: 2px;
}

.grip span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.song-row .index {
  width: 18px;
  flex: none;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.song-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.song-row .at,
.song-row .len {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.song-row .at {
  color: var(--faint);
}

.song-row.missing .len {
  color: var(--fail);
}

.song-row .trash {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--faint);
  border-radius: 4px;
  cursor: pointer;
}

.song-row .trash:hover {
  color: var(--fail);
  background: var(--hover);
}

.song-row .trash .icon {
  display: block;
}

.add-song {
  position: relative;
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn.ghost:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}

.btn.add {
  height: 32px;
  padding: 0 8px;
  justify-content: flex-start;
}

.picker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--canvas);
  box-shadow: rgba(15, 15, 15, 0.05) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 3px 6px,
    rgba(15, 15, 15, 0.2) 0 9px 24px;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.picker-row:hover {
  background: var(--hover);
}

.picker-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-row .len {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-note {
  color: var(--faint);
  font-size: 13px;
  padding: 8px;
  margin: 0;
}

.drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 76px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}

/* ---------- progress ---------- */

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

.progress .track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.progress .fill {
  height: 100%;
  background: var(--ink);
  transition: width 300ms linear;
}

.process-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  width: min(320px, calc(100vw - 32px));
  padding: 14px 14px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(55, 53, 47, 0.16);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.process-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.process-panel-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.process-panel-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.process-panel-close:hover {
  color: var(--ink);
}

.process-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(40vh, 280px);
  overflow: auto;
}

.process-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
}

.process-panel-mark {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.process-panel-item.is-done .process-panel-mark {
  color: #fff;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
}

.process-panel-item.is-running .process-panel-mark {
  color: var(--ink);
}

.process-panel-item.is-error .process-panel-mark {
  color: #a32020;
}

.process-panel-item.is-cancelled .process-panel-mark,
.process-panel-item.is-bundled .process-panel-mark {
  color: var(--muted);
}

.process-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.process-panel-label {
  color: var(--ink);
  font-weight: 550;
}

.process-panel-meta {
  color: var(--muted);
}

.process-panel-item.is-running .process-panel-label {
  font-weight: 650;
}

.process-panel-item.is-transition .process-panel-label {
  font-weight: 500;
}

.process-panel-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.process-panel-bar .fill {
  height: 100%;
  background: var(--ink);
  transition: width 300ms linear;
}

.process-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.process-panel-total {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink);
  line-height: 1.3;
}

.callout {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--callout);
  color: var(--muted);
  font-size: 13px;
}

.callout.error {
  background: var(--fail-wash);
  color: var(--fail);
}

/* ---------- landing ---------- */

.shell--landing {
  background: #14110e;
}

.landing {
  --landing-cream: #f4efe6;
  position: relative;
  flex: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--landing-cream);
}

.landing-bg,
.landing-veil,
.landing-vignette {
  position: absolute;
  inset: 0;
}

.landing-bg {
  overflow: hidden;
  background: #14110e
    url("/assets/videos/landing-poster.jpg?v=2") center / cover no-repeat;
  transform: scale(1.04);
  animation: landing-drift 28s ease-in-out infinite alternate;
}

.landing-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* Soft pool of dark behind the copy — edges stay bright so the miniature reads. */
.landing-veil {
  background: radial-gradient(
    ellipse 58% 72% at 22% 48%,
    rgba(12, 9, 7, 0.78) 0%,
    rgba(12, 9, 7, 0.42) 38%,
    rgba(12, 9, 7, 0.12) 62%,
    rgba(12, 9, 7, 0) 78%
  );
  pointer-events: none;
}

.landing-vignette {
  background: radial-gradient(
    ellipse 92% 88% at 50% 50%,
    rgba(0, 0, 0, 0) 62%,
    rgba(8, 6, 4, 0.28) 100%
  );
  pointer-events: none;
}

.landing-brand {
  position: absolute;
  top: clamp(28px, 4.5vh, 48px);
  left: clamp(28px, 4.5vw, 56px);
  z-index: 2;
  margin: 0;
  font-family: Fraunces, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-optical-sizing: auto;
  font-weight: 520;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: color-mix(in srgb, var(--landing-cream) 80%, transparent);
  text-decoration: none;
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-brand:hover {
  color: var(--landing-cream);
}

.landing-brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--landing-cream) 55%, transparent);
  border-radius: 2px;
}

.landing-copy {
  position: relative;
  z-index: 1;
  margin-left: clamp(28px, 5.5vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: min(22em, 42vw);
  max-width: calc(100% - 48px);
  text-align: left;
}

.landing-title {
  margin: 0;
  font-family: Fraunces, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-optical-sizing: auto;
  font-weight: 560;
  font-size: clamp(2.35rem, 4.6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  /* ~2 lines on desktop: "Build a world worth / staying in." */
  max-width: 11.5em;
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 40ms both;
}

.landing-desc {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(0.92rem, 1.35vw, 1.05rem);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.015em;
  color: color-mix(in srgb, var(--landing-cream) 72%, transparent);
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 100ms both;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 10px;
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both;
}

.landing-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid color-mix(in srgb, var(--landing-cream) 78%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--landing-cream);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  isolation: isolate;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

/* Warm amber bloom — reads as a lantern, not a chrome button. */
.landing-cta::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px -28px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse 70% 80% at 50% 55%,
    rgba(232, 156, 72, 0.42) 0%,
    rgba(196, 110, 42, 0.18) 42%,
    rgba(140, 70, 20, 0) 72%
  );
  filter: blur(10px);
  opacity: 0.9;
  pointer-events: none;
}

.landing-cta:hover {
  border-color: var(--landing-cream);
  transform: translateY(-1px);
}

.landing-cta:hover::before {
  opacity: 1;
  filter: blur(12px);
}

.landing-cta:active {
  transform: translateY(0);
}

.landing-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--landing-cream) 55%, transparent);
}

.landing-secondary {
  margin-left: 4px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--landing-cream) 58%, transparent);
  text-decoration: none;
  border: 0;
  background: none;
  transition: color 140ms ease;
}

.landing-secondary:hover {
  color: color-mix(in srgb, var(--landing-cream) 88%, transparent);
}

.landing-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--landing-cream) 45%, transparent);
  border-radius: 2px;
}

.landing-sound {
  position: absolute;
  z-index: 3;
  right: clamp(18px, 3vw, 28px);
  bottom: clamp(18px, 3.5vh, 32px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--landing-cream) 28%, transparent);
  border-radius: 999px;
  background: rgba(12, 9, 7, 0.42);
  color: var(--landing-cream);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 320ms both;
}

.landing-sound:hover {
  background: rgba(12, 9, 7, 0.62);
  border-color: color-mix(in srgb, var(--landing-cream) 48%, transparent);
  transform: translateY(-1px);
}

.landing-sound:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--landing-cream) 45%, transparent);
}

.landing-sound.is-muted {
  color: color-mix(in srgb, var(--landing-cream) 72%, transparent);
}

.landing-scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: clamp(20px, 3.5vh, 36px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: landing-rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 280ms both;
}

.landing-scroll-mark {
  width: 1px;
  height: 32px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--landing-cream) 0%, transparent) 0%,
    color-mix(in srgb, var(--landing-cream) 55%, transparent) 40%,
    color-mix(in srgb, var(--landing-cream) 55%, transparent) 100%
  );
  opacity: 0.55;
  animation: landing-scroll-pulse 2.4s ease-in-out infinite;
}

@keyframes landing-drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(-1.2%, -0.8%, 0);
  }
}

@keyframes landing-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes landing-scroll-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.85);
    transform-origin: top center;
  }
  50% {
    opacity: 0.7;
    transform: scaleY(1);
    transform-origin: top center;
  }
}

@media (max-width: 720px) {
  .landing-copy {
    margin-left: clamp(22px, 6vw, 36px);
    margin-right: clamp(22px, 6vw, 36px);
    width: auto;
    max-width: 22ch;
  }

  .landing-title {
    font-size: clamp(2.1rem, 9vw, 2.8rem);
    max-width: 10.5em;
  }

  .landing-veil {
    background: radial-gradient(
      ellipse 88% 70% at 30% 46%,
      rgba(12, 9, 7, 0.8) 0%,
      rgba(12, 9, 7, 0.4) 42%,
      rgba(12, 9, 7, 0.1) 68%,
      rgba(12, 9, 7, 0) 82%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-bg,
  .landing-brand,
  .landing-title,
  .landing-desc,
  .landing-actions,
  .landing-sound,
  .landing-scroll,
  .landing-scroll-mark {
    animation: none;
  }

  .landing-bg {
    transform: none;
  }

  .landing-sound:hover {
    transform: none;
  }
}
