:root {
  color-scheme: dark;
  --bg: #0e1111;
  --panel: #171b1c;
  --panel-2: #1f2425;
  --line: #303738;
  --line-strong: #465052;
  --text: #eef3ef;
  --muted: #9ca8a2;
  --soft: #c9d1cb;
  --accent: #46d0b8;
  --accent-2: #f3b15a;
  --danger: #ff6f61;
  --paper: #f3eee2;
  --sticky-top-offset: 0px;
  --global-timeline-height: 88px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

html {
  scroll-padding-top: calc(var(--sticky-top-offset) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="number"] {
  border: 1px solid var(--line);
  background: #121616;
  color: var(--text);
}

button {
  cursor: pointer;
}

button:disabled,
a.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
  pointer-events: none;
}

button[hidden],
a[hidden],
[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) var(--global-timeline-height);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-width: 960px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 17, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 220px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #5d6868;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(70, 208, 184, 0.18), rgba(243, 177, 90, 0.12)),
    #151a1a;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.topbar-ratio-toolbar {
  flex: 0 1 330px;
  min-width: 0;
}

.topbar-ratio-toolbar .ratio-chips {
  max-width: min(24vw, 300px);
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-ratio-toolbar .ratio-chips::-webkit-scrollbar {
  display: none;
}

.module-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101414;
}

.module-tabs button {
  min-height: 30px;
  padding: 0 9px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.module-tabs button.is-active {
  border-color: rgba(70, 208, 184, 0.48);
  background: #16302d;
  color: #dcfff7;
}

.export-preview-toggle {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #0e1111;
  color: var(--muted);
  font-size: 12px;
}

.export-preview-toggle.is-active {
  border-color: rgba(243, 177, 90, 0.66);
  background: rgba(243, 177, 90, 0.12);
  color: #ffe0aa;
}

.icon-button,
.primary-button,
.secondary-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.primary-button {
  padding: 0 18px;
  border-color: rgba(70, 208, 184, 0.52);
  background: #16342f;
  color: #eafff9;
  font-weight: 750;
}

.primary-button.is-recording {
  border-color: rgba(255, 111, 97, 0.65);
  background: #3a1b1a;
  color: #ffe6e2;
}

.secondary-button,
.download-link {
  padding: 0 12px;
  background: #121616;
  color: var(--soft);
  font-weight: 650;
}

.download-link:not(.is-disabled) {
  border-color: rgba(243, 177, 90, 0.56);
  color: #ffe2b3;
}

.license-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(243, 177, 90, 0.46);
  border-radius: 999px;
  background: rgba(243, 177, 90, 0.1);
  color: #ffe2b3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.license-pill.is-pro {
  border-color: rgba(70, 208, 184, 0.62);
  background: rgba(70, 208, 184, 0.14);
  color: #dffff7;
}

button:hover,
.download-link:hover {
  border-color: var(--line-strong);
  background: #1c2222;
}

button:active {
  transform: translateY(1px);
}

.workspace {
  display: grid;
  grid-template-columns: 288px minmax(420px, 1fr) 288px;
  min-height: 0;
  position: relative;
}

.module-frame-panel {
  position: relative;
  z-index: 2;
  display: block;
  grid-column: 1 / -1;
  min-height: 0;
  background: #0b0d0c;
}

.module-frame-panel[hidden] {
  display: none;
}

.module-frame-panel iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0d0c;
}

body[data-active-module="brand"] .workspace,
body[data-active-module="splash"] .workspace,
body[data-active-module="audio"] .workspace {
  grid-template-columns: minmax(420px, 1fr) 288px;
}

body.show-export-preview[data-active-module="brand"] .workspace,
body.show-export-preview[data-active-module="splash"] .workspace,
body.show-export-preview[data-active-module="audio"] .workspace {
  grid-template-columns: minmax(320px, 34vw) minmax(420px, 1fr) 288px;
}

body[data-active-module="brand"] .panel-left,
body[data-active-module="splash"] .panel-left,
body[data-active-module="audio"] .panel-left {
  display: none;
}

body[data-active-module="brand"] .stage-area,
body[data-active-module="splash"] .stage-area,
body[data-active-module="audio"] .stage-area {
  position: absolute;
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: minmax(0, 1fr);
  left: 0;
  top: 0;
  width: 864px;
  height: calc(864px / var(--preview-ratio, 1.7777778));
  min-height: calc(864px / var(--preview-ratio, 1.7777778));
  border-right: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

body.show-export-preview[data-active-module="brand"] .stage-area,
body.show-export-preview[data-active-module="splash"] .stage-area,
body.show-export-preview[data-active-module="audio"] .stage-area {
  position: relative;
  width: auto;
  height: auto;
  min-height: 0;
  border-right: 1px solid var(--line);
  opacity: 1;
  z-index: 1;
}

body[data-active-module="brand"] .module-frame-panel,
body[data-active-module="splash"] .module-frame-panel,
body[data-active-module="audio"] .module-frame-panel {
  grid-column: 1;
  grid-row: 1;
}

body.show-export-preview[data-active-module="brand"] .module-frame-panel,
body.show-export-preview[data-active-module="splash"] .module-frame-panel,
body.show-export-preview[data-active-module="audio"] .module-frame-panel {
  grid-column: 2;
}

body[data-active-module="brand"] .panel-right,
body[data-active-module="splash"] .panel-right,
body[data-active-module="audio"] .panel-right {
  display: block;
  grid-column: 2;
  grid-row: 1;
}

body.show-export-preview[data-active-module="brand"] .panel-right,
body.show-export-preview[data-active-module="splash"] .panel-right,
body.show-export-preview[data-active-module="audio"] .panel-right {
  grid-column: 3;
}

body[data-active-module="brand"] .panel-right [data-module-control],
body[data-active-module="splash"] .panel-right [data-module-control],
body[data-active-module="audio"] .panel-right [data-module-control] {
  display: none;
}

body.is-embedded .topbar {
  display: none;
}

body.is-embedded .app-shell {
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
}

.panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-top: 18px;
  background: var(--panel);
}

.panel-left {
  border-right: 1px solid var(--line);
}

.panel-right {
  border-left: 1px solid var(--line);
}

.control-group {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.group-header h2 {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.control-group.is-collapsible .group-header {
  cursor: pointer;
  margin-bottom: 0;
}

.control-group.is-collapsible:not(.is-collapsed) .group-header {
  margin-bottom: 14px;
}

.control-group.is-collapsed > :not(.group-header) {
  display: none !important;
}

.accordion-toggle {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121615;
  color: var(--soft);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.group-header span,
#sourceBadge {
  color: var(--muted);
  font-size: 12px;
}

.drop-zone {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px dashed #596463;
  border-radius: 8px;
  background: #121616;
  cursor: pointer;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #14201f;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-symbol {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: #182020;
}

.drop-symbol svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.drop-zone strong {
  color: var(--text);
  font-size: 14px;
}

.drop-zone small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.button-row.single-action {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.export-module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}

[data-module-control][hidden] {
  display: none;
}

.module-open-link.full-button {
  width: 100%;
}

.batch-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed #596463;
  border-radius: 8px;
  background: #121616;
  color: var(--soft);
  cursor: pointer;
}

.file-picker-input {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.batch-picker-button {
  width: 100%;
  text-align: left;
  font: inherit;
}

.batch-picker + .batch-picker {
  margin-top: 10px;
}

.batch-picker span {
  font-size: 13px;
  font-weight: 750;
}

.batch-picker small,
.batch-status {
  color: var(--muted);
  font-size: 12px;
}

.batch-status {
  min-height: 16px;
  margin: 10px 0 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.segmented button {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border-color: var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.05;
  outline: 1px solid rgba(255, 255, 255, 0.04);
  outline-offset: -2px;
  overflow-wrap: anywhere;
}

.segmented button.is-active {
  border-color: rgba(70, 208, 184, 0.65);
  background: #16302d;
  color: #dcfff7;
}

.material-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  margin-bottom: 0;
}

.material-segmented button {
  min-height: 38px;
  padding: 0 6px;
  border-color: var(--line-strong);
  font-size: 11px;
}

.axis-segmented {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 14px;
  margin-bottom: 0;
}

.slider-field,
.field {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.field {
  grid-template-columns: 72px 1fr;
}

.slider-field[hidden],
.field[hidden] {
  display: none !important;
}

.field input,
.field select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 0 10px;
}

.slider-field output {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.keyframe-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 22, 0.72);
}

.keyframe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.keyframe-header output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.keyframe-playhead {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.keyframe-slider {
  grid-template-columns: 58px 1fr 48px;
  margin-top: 10px;
}

.keyframe-actions {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.keyframe-actions .secondary-button {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.keyframe-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.keyframe-list-empty {
  color: var(--muted);
  font-size: 11px;
}

.keyframe-list button {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: #101414;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.keyframe-list button.is-active {
  border-color: rgba(70, 208, 184, 0.58);
  background: #142925;
  color: #dffff7;
}

.keyframe-list span:last-child {
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.switch input {
  accent-color: var(--accent);
}

.export-switch {
  margin-top: 2px;
}

.stage-area {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  --preview-ratio: 1.7777778;
  --preview-aspect: 16 / 9;
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    #0b0d0d;
}

.stage-area.is-transparent-backdrop {
  background-color: #151817;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.12) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.canvas-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  container-type: size;
}

.stage-area.preview-aspect-16-9 {
  --preview-ratio: 1.7777778;
  --preview-aspect: 16 / 9;
}

.stage-area.preview-aspect-9-16 {
  --preview-ratio: 0.5625;
  --preview-aspect: 9 / 16;
}

.stage-area.preview-aspect-1-1 {
  --preview-ratio: 1;
  --preview-aspect: 1 / 1;
}

#stageCanvas,
#finalPreviewCanvas {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
}

#stageCanvas {
  cursor: grab;
}

.stage-area.is-preview-framed #stageCanvas,
.stage-area.is-preview-framed #finalPreviewCanvas {
  width: min(100cqw, calc(100cqh * var(--preview-ratio)));
  height: min(100cqh, calc(100cqw / var(--preview-ratio)));
  aspect-ratio: var(--preview-aspect);
  background: #050707;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stage-area.is-transparent-backdrop.is-preview-framed #stageCanvas,
.stage-area.is-transparent-backdrop.is-preview-framed #finalPreviewCanvas {
  background: transparent;
}

#finalPreviewCanvas[hidden] {
  display: none;
}

#finalPreviewCanvas {
  pointer-events: none;
}

#stageCanvas:active {
  cursor: grabbing;
}

.stage-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 28px);
  pointer-events: none;
}

.ratio-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.ratio-chips {
  display: flex;
  gap: 5px;
}

.ratio-remove-button,
.ratio-select-button,
.ratio-add-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 10, 10, 0.78);
  color: #dbe3df;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.ratio-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ratio-select-button {
  border-radius: 8px;
}

.ratio-remove-button {
  min-height: 20px;
  width: 20px;
  padding: 0;
  border-radius: 999px;
  color: #b7c1bd;
  font-size: 13px;
}

.ratio-chip.is-active .ratio-select-button {
  border-color: rgba(70, 208, 184, 0.66);
  color: #dffff8;
  background: rgba(22, 52, 47, 0.86);
}

.ratio-chip.is-active .ratio-remove-button {
  border-color: rgba(70, 208, 184, 0.36);
}

.ratio-add-button {
  width: 28px;
  padding: 0;
}

.ratio-menu {
  position: absolute;
  z-index: 40;
  top: 34px;
  left: 0;
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 10, 10, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.ratio-menu.is-hidden {
  display: none;
}

.ratio-menu button {
  justify-content: flex-start;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.stage-hud span {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(8, 10, 10, 0.74);
  color: #dbe3df;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.mobile-preview-transport {
  display: none;
}

.timeline {
  display: grid;
  grid-template-columns: 58px 58px 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(15, 18, 18, 0.96);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.global-timeline {
  position: relative;
  z-index: 20;
  min-height: var(--global-timeline-height);
}

.timeline-button {
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #121616;
  color: var(--soft);
  font-size: 12px;
  font-weight: 750;
}

.timeline-button.is-playing {
  border-color: rgba(70, 208, 184, 0.56);
  background: #16302d;
  color: #dcfff7;
}

.timeline-track {
  position: relative;
  min-width: 0;
  min-height: 58px;
}

.timeline-track input {
  position: relative;
  z-index: 1;
  display: block;
  margin: 12px 0 0;
}

.timeline-keyframes {
  position: absolute;
  inset: -9px 0;
  z-index: 2;
  pointer-events: none;
}

.timeline-keyframes button {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border-radius: 7px;
  background: #f3b15a;
  box-shadow: 0 0 0 2px rgba(8, 10, 10, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
}

.timeline-keyframes button:active {
  cursor: grabbing;
}

.timeline-keyframes button.is-active {
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 10, 10, 0.9), 0 0 0 4px rgba(70, 208, 184, 0.32);
}

.timeline-section-bars {
  position: absolute;
  left: 0;
  right: 0;
  top: 39px;
  height: 17px;
  z-index: 3;
  pointer-events: auto;
}

.timeline-section-bars[hidden] {
  display: none;
}

.timeline-section-segment {
  position: absolute;
  top: 2px;
  height: 8px;
  min-width: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(247, 255, 249, 0.88);
  font-size: 7px;
  font-weight: 850;
  line-height: 6px;
  text-align: center;
  white-space: nowrap;
}

.timeline-section-segment.is-intro {
  background: rgba(70, 208, 184, 0.42);
}

.timeline-section-segment.is-video {
  background: rgba(255, 255, 255, 0.12);
}

.timeline-section-segment.is-ending {
  background: rgba(243, 177, 90, 0.46);
}

.timeline-section-segment.is-transition {
  background: rgba(121, 215, 255, 0.26);
}

.timeline-section-marker {
  position: absolute;
  top: -1px;
  width: 12px;
  height: 14px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(247, 255, 249, 0.78);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(8, 10, 10, 0.74);
  cursor: ew-resize;
  transform: translateX(-50%);
}

.timeline-section-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2px;
  height: 8px;
  background: var(--accent);
  transform: translateX(-50%);
}

.timeline-text-cues {
  position: absolute;
  left: 0;
  right: 0;
  top: 39px;
  height: 17px;
  z-index: 3;
  pointer-events: auto;
}

.timeline-text-cues[hidden] {
  display: none;
}

.timeline-text-cues button {
  position: absolute;
  top: 1px;
  height: 11px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(70, 208, 184, 0.6);
  border-radius: 999px;
  background: rgba(70, 208, 184, 0.42);
  box-shadow: 0 0 0 1px rgba(8, 10, 10, 0.72);
  cursor: grab;
  touch-action: none;
}

.timeline-text-cues button:active {
  cursor: grabbing;
}

.timeline-text-cues button.is-active {
  border-color: rgba(243, 177, 90, 0.86);
  background: rgba(243, 177, 90, 0.7);
}

.timeline span:last-child {
  text-align: right;
}

.progress {
  width: 100%;
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101414;
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 120ms linear;
}

.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 6, 6, 0.72);
  backdrop-filter: blur(10px);
}

.paywall-modal.is-hidden {
  display: none;
}

.paywall-card {
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #151a1a;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.46);
}

.paywall-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.paywall-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
}

.paywall-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.paywall-header .icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.pro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.pro-grid span {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101414;
  color: var(--soft);
  font-size: 12px;
  font-weight: 750;
}

.paywall-actions {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.license-entry {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.license-entry input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #101414;
  color: var(--text);
}

.license-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-links {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.legal-links a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--accent);
}

#sourceVideo {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .app-shell {
    min-width: 760px;
  }

  .workspace {
    grid-template-columns: 248px minmax(360px, 1fr) 248px;
  }

  body[data-active-module="brand"] .workspace,
  body[data-active-module="splash"] .workspace,
  body[data-active-module="audio"] .workspace {
    grid-template-columns: minmax(360px, 1fr) 248px;
  }

  body.show-export-preview[data-active-module="brand"] .workspace,
  body.show-export-preview[data-active-module="splash"] .workspace,
  body.show-export-preview[data-active-module="audio"] .workspace {
    grid-template-columns: minmax(260px, 32vw) minmax(360px, 1fr) 248px;
  }

  .slider-field {
    grid-template-columns: 64px 1fr 38px;
  }
}

@media (max-width: 860px) {
  :root {
    --sticky-top-offset: max(env(safe-area-inset-top, 0px), 10px);
  }

  body {
    overflow: auto;
    overflow-x: hidden;
    min-height: 100dvh;
  }

  .app-shell {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    grid-template-rows: auto 1fr;
  }

  .topbar {
    position: sticky;
    top: var(--sticky-top-offset);
    z-index: 4;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 12px;
  }

  .brand {
    flex: 1 1 220px;
  }

  .brand p {
    max-width: 58vw;
  }

  .top-actions {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .module-tabs,
  .topbar-ratio-toolbar {
    flex: 0 0 auto;
  }

  .top-actions .primary-button,
  .top-actions .secondary-button,
  .top-actions .download-link {
    flex: 0 0 auto;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    min-height: 0;
    min-width: 0;
  }

  .stage-area {
    order: 1;
    height: min(68vh, 560px);
    min-height: 440px;
  }

  body[data-active-module="brand"] .stage-area,
  body[data-active-module="splash"] .stage-area,
  body[data-active-module="audio"] .stage-area {
    position: absolute;
    left: -9999px;
    order: 0;
    width: 864px;
    height: calc(864px / var(--preview-ratio, 1.7777778));
    min-height: calc(864px / var(--preview-ratio, 1.7777778));
    border-right: 0;
    border-bottom: 0;
    opacity: 0;
    pointer-events: none;
  }

  body.show-export-preview[data-active-module="brand"] .stage-area,
  body.show-export-preview[data-active-module="splash"] .stage-area,
  body.show-export-preview[data-active-module="audio"] .stage-area {
    position: relative;
    left: auto;
    order: 1;
    width: auto;
    height: min(52vh, 460px);
    min-height: 320px;
    border-bottom: 1px solid var(--line);
    opacity: 1;
    pointer-events: none;
  }

  body[data-active-module="brand"] .module-frame-panel,
  body[data-active-module="splash"] .module-frame-panel,
  body[data-active-module="audio"] .module-frame-panel {
    order: 1;
    min-height: 1400px;
  }

  body[data-active-module="brand"] .module-frame-panel {
    min-height: 1700px;
  }

  body[data-active-module="splash"] .module-frame-panel {
    min-height: 1800px;
  }

  body[data-active-module="audio"] .module-frame-panel {
    min-height: 2300px;
  }

  body.show-export-preview[data-active-module="brand"] .module-frame-panel,
  body.show-export-preview[data-active-module="splash"] .module-frame-panel,
  body.show-export-preview[data-active-module="audio"] .module-frame-panel {
    order: 2;
  }

  .panel-left {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .panel-right {
    order: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  body[data-active-module="brand"] .panel-right,
  body[data-active-module="splash"] .panel-right,
  body[data-active-module="audio"] .panel-right {
    order: 2;
  }

  body.show-export-preview[data-active-module="brand"] .panel-right,
  body.show-export-preview[data-active-module="splash"] .panel-right,
  body.show-export-preview[data-active-module="audio"] .panel-right {
    order: 3;
  }

  .panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: visible;
    scroll-margin-top: calc(var(--sticky-top-offset) + 88px);
  }

  .control-group {
    padding: 16px;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
  }

  .stage-hud {
    top: 10px;
    left: 10px;
  }

  .mobile-preview-transport {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 5;
    display: grid;
    grid-template-columns: 58px 58px 38px minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(9, 12, 12, 0.82);
    backdrop-filter: blur(10px);
  }

  .mobile-preview-transport span {
    color: var(--soft);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-preview-transport input {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    max-width: 68vw;
  }

  .stage-area {
    height: 58vh;
    min-height: 360px;
  }

  body[data-active-module="brand"] .module-frame-panel,
  body[data-active-module="splash"] .module-frame-panel,
  body[data-active-module="audio"] .module-frame-panel {
    min-height: 1600px;
  }

  body[data-active-module="brand"] .module-frame-panel {
    min-height: 1820px;
  }

  body[data-active-module="splash"] .module-frame-panel {
    min-height: 1920px;
  }

  body[data-active-module="audio"] .module-frame-panel {
    min-height: 2540px;
  }

  .timeline {
    grid-template-columns: 50px 50px 36px minmax(0, 1fr) 36px;
    gap: 8px;
    padding: 8px 10px 14px;
  }

  .mobile-preview-transport {
    grid-template-columns: 50px 50px minmax(0, 1fr);
  }

  .mobile-preview-transport span {
    display: none;
  }

  .slider-field {
    grid-template-columns: 68px 1fr 38px;
  }

  .paywall-actions,
  .pro-grid {
    grid-template-columns: 1fr;
  }
}
