.overlay-editor {
  max-width: 1720px;
  padding-top: 28px;
}
.editor-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-bottom: 26px;
}
.editor-heading h1 {
  font: 600 clamp(23px, 2.4vw, 36px) var(--font-heading);
  letter-spacing: -0.04em;
}
.editor-output {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 10px;
  max-width: 390px;
  margin-top: 14px;
}
.editor-output > span {
  color: var(--mut);
  font-size: 12px;
}
.editor-picker {
  position: relative;
}
.editor-picker button {
  padding: 10px 12px;
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: 12px var(--font-body);
}
#editor-output::after {
  content: '';
  float: right;
  width: 6px;
  height: 6px;
  margin: 3px 2px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
#editor-outputs {
  position: absolute;
  inset: calc(100% + 4px) 0 auto;
  z-index: 5;
  border: 1px solid var(--line-2);
  background: var(--panel);
}
#editor-outputs button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
}
#editor-outputs button::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 1px solid var(--mut);
}
#editor-outputs button[aria-selected='true']::before {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--bg);
}
.editor-legacy {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.editor-legacy .editor-help {
  margin: 0;
}
.editor-legacy .secondary {
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  font: 600 12px var(--font-body);
}
#editor-output-status {
  grid-column: 2;
  margin: 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}
.editor-publish {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px 20px;
  flex-shrink: 0;
}
.editor-save-status {
  grid-column: 1 / -1;
  color: var(--gold-soft);
  font-size: 11px;
  text-align: right;
  max-width: 440px;
  line-height: 1.6;
}
.editor-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 380px);
  align-items: start;
  gap: 24px;
}
.editor-panes {
  scroll-margin-top: 96px;
}
.editor-panes.is-dual {
  display: grid;
  grid-template-columns: minmax(0, calc((100% - 16px) * 81 / 337)) minmax(0, 1fr) minmax(
      0,
      calc(50% - 8px)
    );
  gap: 24px 16px;
  align-items: start;
}
.is-dual .editor-pane {
  display: contents;
}
.is-dual [data-output='tiktok'] .editor-review {
  grid-area: 1 / 1 / 2 / 2;
}
.is-dual [data-output='twitch'] .editor-review {
  grid-area: 1 / 2 / 2 / 4;
}
.is-dual [data-output='tiktok'] .editor-settings {
  grid-area: 2 / 1 / 3 / 3;
}
.is-dual [data-output='twitch'] .editor-settings {
  grid-area: 2 / 3 / 3 / 4;
}
.is-dual .editor-preview-surface {
  padding: 0;
}
.is-dual .editor-canvas.vertical {
  max-width: none;
}
.editor-settings {
  min-width: 0;
}
.editor-settings-title {
  margin: 0 0 14px;
  font: 600 18px var(--font-heading);
}
.editor-settings .editor-publish,
.editor-settings .overlay-source-status,
.editor-settings .editor-history-actions {
  margin-bottom: 16px;
}
.editor-settings .editor-history-actions,
.editor-settings .editor-reset-action {
  flex-wrap: wrap;
}
.editor-settings .editor-reset-action {
  margin-top: 12px;
}
.editor-review .editor-export {
  margin-top: 12px;
}
.copy-status:empty {
  display: none;
}
.overlay-editor [hidden] {
  display: none !important;
}
.editor-review {
  min-width: 0;
}
.editor-controls {
  min-width: 0;
}
.editor-group {
  background: var(--panel);
  border: 1px solid var(--line-2);
  padding: 19px;
  margin: 0 0 14px;
}
.editor-inspector {
  border-top: 2px solid var(--gold);
}
.editor-inspector .eyebrow {
  font-size: 9px;
  margin-bottom: 13px;
}
.editor-group h2,
.editor-group summary,
.editor-preview-heading h2 {
  font: 600 14px var(--font-heading);
  margin: 0 0 14px;
}
.editor-group summary {
  cursor: pointer;
  margin: 0;
}
.editor-group[open] > summary,
.editor-subgroup[open] > summary {
  margin-bottom: 16px;
}
.editor-subgroup {
  padding-top: 17px;
  border-top: 1px solid var(--line-2);
  margin-top: 18px;
}
.editor-subgroup summary {
  font: 500 12px var(--font-body);
  color: var(--mut);
}
.editor-controls label {
  display: block;
  margin: 14px 0 7px;
  color: var(--mut);
  font-size: 11px;
}
.editor-controls select,
.editor-controls input[type='number'],
.editor-source textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font: 12px var(--font-body);
}
.editor-controls input[type='range'] {
  width: 100%;
  accent-color: var(--gold);
}
.editor-controls output {
  float: right;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}
.overlay-editor .editor-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
  font-size: 11px;
  color: var(--mut);
}
.editor-publish .editor-check {
  color: var(--ink);
  white-space: nowrap;
}
.editor-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.editor-color {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.editor-color input {
  width: 48px;
  height: 30px;
  padding: 2px;
  background: var(--bg);
  border: 1px solid var(--line-2);
}
.editor-number-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.editor-help {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.7;
  margin: 12px 0 0;
}
.editor-source-quality {
  padding: 10px 12px;
  border-left: 2px solid var(--line-2);
  background: var(--panel);
}
.editor-source-quality[data-state='warning'] {
  border-color: var(--gold);
  color: var(--gold-soft);
}
.editor-selected-help {
  min-height: 37px;
  margin-top: 0;
}
.editor-element-tabs {
  display: flex;
  border: 1px solid var(--line-2);
  margin-bottom: 20px;
}
.editor-element-tabs button {
  flex: 1;
  border: 0;
  padding: 11px 8px;
  background: var(--bg);
  color: var(--mut);
  font: 600 12px var(--font-body);
  cursor: pointer;
}
.editor-element-tabs button[aria-pressed='true'] {
  background: var(--gold);
  color: var(--bg);
}
.editor-align-actions {
  display: flex;
  gap: 8px;
  margin-top: 17px;
}
.editor-align-actions button {
  flex: 1;
  padding: 9px 7px;
  font-size: 10px;
}
.editor-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 42px;
  margin-bottom: 14px;
}
.editor-preview-heading h2 {
  margin: 0 0 5px;
}
.editor-preview-heading span {
  color: var(--dim);
  font: 10px var(--font-heading);
}
.editor-history-actions {
  display: flex;
  gap: 7px;
}
.editor-history-actions > * {
  padding: 9px 11px;
  font-size: 11px;
}
.editor-reset-action {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.editor-reset-action button {
  flex-shrink: 0;
  max-width: 100%;
  padding: 11px 14px;
  font-size: 11px;
  white-space: normal;
}
.editor-reset-action .editor-help {
  margin: 0;
}
.editor-preview-surface {
  display: flex;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  padding: 16px;
}
.editor-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  outline: 1px solid var(--line-2);
  overflow: hidden;
  isolation: isolate;
}
.editor-canvas.vertical {
  max-width: min(420px, 100%);
}
.editor-vertical-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.editor-vertical-tools button {
  padding: 9px 11px;
  font-size: 10px;
}
.editor-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.editor-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.editor-hit-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.editor-element {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
  appearance: none;
  outline: none;
}
.editor-element:hover {
  outline: calc(1px * var(--editor-inverse-zoom)) solid var(--mut);
}
.editor-element.is-selected,
.editor-element:focus-visible {
  outline: calc(1px * var(--editor-inverse-zoom)) solid var(--gold);
  outline-offset: 0;
  z-index: 1;
}
.editor-canvas.is-dragging .editor-element {
  cursor: grabbing;
}
.editor-element-label {
  display: none;
  position: absolute;
  bottom: calc(100% + 5px * var(--editor-inverse-zoom));
  left: 0;
  background: var(--gold);
  color: var(--bg);
  font: 600 calc(10px * var(--editor-inverse-zoom)) var(--font-body);
  padding: calc(4px * var(--editor-inverse-zoom)) calc(6px * var(--editor-inverse-zoom));
  white-space: nowrap;
  pointer-events: none;
}
.editor-element.is-selected .editor-element-label,
.editor-element.is-selected .editor-handle {
  display: block;
}
.editor-handle {
  display: none;
  position: absolute;
  width: calc(12px * var(--editor-inverse-zoom));
  height: calc(12px * var(--editor-inverse-zoom));
  background: var(--gold);
  border: calc(2px * var(--editor-inverse-zoom)) solid var(--bg);
}
.editor-handle[data-resize='nw'],
.editor-handle[data-resize='ne'] {
  top: calc(-6px * var(--editor-inverse-zoom));
}
.editor-handle[data-resize='sw'],
.editor-handle[data-resize='se'] {
  bottom: calc(-6px * var(--editor-inverse-zoom));
}
.editor-handle[data-resize='nw'],
.editor-handle[data-resize='sw'] {
  left: calc(-6px * var(--editor-inverse-zoom));
}
.editor-handle[data-resize='ne'],
.editor-handle[data-resize='se'] {
  right: calc(-6px * var(--editor-inverse-zoom));
}
.editor-handle[data-resize='nw'],
.editor-handle[data-resize='se'] {
  cursor: nwse-resize;
}
.editor-handle[data-resize='ne'],
.editor-handle[data-resize='sw'] {
  cursor: nesw-resize;
}
.editor-rulers {
  position: absolute;
  inset: 0;
  z-index: 3;
  color: var(--ink);
  font: 600 11px/1.25 var(--font-body);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}
.editor-rulers [data-ruler] {
  --length: clamp(0%, var(--gap), 100%);
}
.editor-rulers [data-ruler]::before,
.editor-rulers [data-ruler] span {
  position: absolute;
}
.editor-rulers [data-ruler]::before {
  content: '';
  background: var(--red);
}
.editor-rulers [data-ruler] span {
  left: clamp(3.3em, var(--label-x), calc(100% - 3.3em));
  top: clamp(10px, var(--label-y), calc(100% - 10px));
  transform: translate(-50%, -50%);
  padding: 1px 4px;
  background: var(--bg);
  white-space: nowrap;
}
.editor-rulers [data-ruler='left'],
.editor-rulers [data-ruler='right'] {
  --label-y: var(--center-y);
}
.editor-rulers [data-ruler='left']::before,
.editor-rulers [data-ruler='right']::before {
  width: var(--length);
  height: 1px;
  top: clamp(0%, var(--center-y), 100%);
}
.editor-rulers [data-ruler='left'] {
  --label-x: calc(var(--length) / 2);
}
.editor-rulers [data-ruler='left']::before {
  left: 0;
}
.editor-rulers [data-ruler='right'] {
  --label-x: calc(100% - var(--length) / 2);
}
.editor-rulers [data-ruler='right']::before {
  right: 0;
}
.editor-rulers [data-ruler='top'],
.editor-rulers [data-ruler='bottom'] {
  --label-x: var(--center-x);
}
.editor-rulers [data-ruler='top']::before,
.editor-rulers [data-ruler='bottom']::before {
  width: 1px;
  height: var(--length);
  left: clamp(0%, var(--center-x), 100%);
}
.editor-rulers [data-ruler='top'] {
  --label-y: calc(var(--length) / 2);
}
.editor-rulers [data-ruler='top']::before {
  top: 0;
}
.editor-rulers [data-ruler='bottom'] {
  --label-y: calc(100% - var(--length) / 2);
}
.editor-rulers [data-ruler='bottom']::before {
  bottom: 0;
}
.editor-guide {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}
.editor-guide[data-guide='x'] {
  top: 0;
  bottom: 0;
  border-left: calc(1px * var(--editor-inverse-zoom)) dashed var(--gold-soft);
}
.editor-guide[data-guide='y'] {
  left: 0;
  right: 0;
  border-top: calc(1px * var(--editor-inverse-zoom)) dashed var(--gold-soft);
}
.editor-alerts {
  scroll-margin-top: 90px;
  border-top: 2px solid var(--gold);
}
.editor-play {
  width: 100%;
  margin-top: 10px;
}
.editor-export {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.editor-part-source {
  display: grid;
  gap: 6px;
}
.editor-part-source input {
  width: 100%;
  min-width: 0;
}
.editor-part-source [role='status']:empty {
  display: none;
}
.editor-source {
  margin-top: 18px;
  color: var(--dim);
  font-size: 11px;
}
.editor-source summary {
  cursor: pointer;
  margin-bottom: 10px;
}
.editor-source textarea {
  resize: vertical;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.editor-conflict {
  border: 1px solid var(--gold-line);
  background: var(--panel-gold);
  padding: 16px;
  margin-bottom: 20px;
  color: var(--mut);
  font-size: 12px;
}
.editor-conflict p {
  margin: 0 0 14px;
}
.overlay-editor :is(input, select, button, a, summary, textarea):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.overlay-editor :is(input, button):disabled {
  opacity: 0.4;
  cursor: default;
}
.editor-inspector-switch.editor-element-tabs {
  display: none;
}
@media (min-width: 821px) {
  body {
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .overlay-editor {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    margin: 0 auto;
    padding-block: 12px 8px;
  }
  .editor-heading {
    margin-bottom: 12px;
  }
  .editor-heading h1 {
    font-size: clamp(20px, 2vw, 30px);
    overflow-wrap: anywhere;
  }
  .editor-output {
    margin: 0;
    flex-shrink: 0;
  }
  #editor-output-status:empty {
    display: none;
  }
  .editor-panes {
    flex: 1;
    min-height: 0;
  }
  .editor-panes.is-dual,
  .editor-panes:not(.is-dual) .editor-pane {
    height: 100%;
    grid-template-rows: auto minmax(0, max-content) auto auto auto minmax(0, 1fr);
    row-gap: 0;
  }
  .editor-panes .editor-review {
    grid-column: 1;
    grid-row: 1 / 6;
    display: grid;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-self: stretch;
  }
  .editor-preview-heading {
    margin-bottom: 6px;
  }
  .editor-preview-surface {
    container-type: size;
    aspect-ratio: var(--canvas-ratio, 1.77778);
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: center;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .editor-preview-surface .editor-canvas {
    width: min(100cqw, calc(100cqh * var(--canvas-ratio, 1.77778)));
    max-width: none;
  }
  .editor-review .editor-export {
    grid-row: 3;
    align-items: start;
    margin-top: 8px;
  }
  .editor-review .copy-status {
    grid-row: 4;
  }
  .editor-review .editor-source {
    grid-row: 5;
    margin-top: 6px;
  }
  .editor-review .editor-source textarea {
    resize: none;
  }
  .editor-panes .editor-settings {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 2px 9px 8px 2px;
  }
  .editor-panes.is-dual {
    --inspector-width: clamp(300px, 20vw, 360px);
    grid-template-columns:
      minmax(0, calc((100% - var(--inspector-width) - 32px) * 81 / 337))
      minmax(0, 1fr) var(--inspector-width);
  }
  .is-dual [data-output='tiktok'] .editor-review {
    grid-area: 1 / 1 / 6 / 2;
  }
  .is-dual [data-output='twitch'] .editor-review {
    grid-area: 1 / 2 / 6 / 3;
  }
  .is-dual [data-output] .editor-settings {
    grid-area: 1 / 3 / -1 / 4;
  }
  .is-dual[data-inspected='tiktok'] [data-output='twitch'] .editor-settings,
  .is-dual[data-inspected='twitch'] [data-output='tiktok'] .editor-settings {
    display: none;
  }
  .is-dual .editor-inspector-switch.editor-element-tabs {
    display: flex;
  }
  .editor-review .editor-export > * {
    max-width: 100%;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: center;
  }
}
@media (max-width: 1100px) {
  .editor-pane {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 18px;
  }
  .editor-heading {
    align-items: start;
    gap: 16px;
  }
  .editor-publish {
    grid-template-columns: 1fr;
  }
  .editor-save-status {
    text-align: left;
    max-width: 260px;
  }
  .editor-publish .editor-check {
    margin: 0;
  }
}
@media (max-width: 820px) {
  .overlay-editor {
    padding-top: 22px;
  }
  .editor-heading {
    flex-direction: column;
  }
  .editor-publish {
    grid-template-columns: auto auto;
    width: 100%;
    justify-content: start;
  }
  .editor-save-status {
    max-width: none;
  }
  .editor-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .editor-review,
  .editor-settings,
  .editor-controls {
    width: 100%;
  }
  .editor-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 14px;
  }
  .editor-group {
    margin-bottom: 0;
  }
  .editor-advanced {
    grid-column: 1 / -1;
  }
  .editor-preview-surface {
    padding: 10px;
  }
  .is-dual .editor-controls {
    display: block;
  }
}
@media (max-width: 640px) {
  .editor-panes.is-dual {
    grid-template-columns: minmax(0, 1fr);
  }
  .is-dual [data-output] :is(.editor-review, .editor-settings) {
    grid-area: auto;
  }
  .is-dual .editor-settings {
    order: 1;
  }
  .is-dual .editor-canvas.vertical {
    max-width: 220px;
  }
}
@media (max-width: 520px) {
  .editor-output {
    grid-template-columns: 1fr;
  }
  #editor-output-status {
    grid-column: 1;
  }
  .editor-reset-action {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .editor-controls {
    display: block;
  }
  .editor-group {
    margin-bottom: 14px;
  }
  .editor-history-actions {
    width: 100%;
  }
  .editor-history-actions > * {
    flex: 1;
  }
  .editor-preview-surface {
    padding: 8px;
  }
  .editor-export > * {
    width: 100%;
    text-align: center;
  }
}
