:root {
  color-scheme: dark;
  --black: #09070d;
  --black-2: #100d16;
  --black-3: #17121f;
  --black-4: #21182c;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, .58);
  --line: rgba(255, 255, 255, .12);
  --pink: #ff2f92;
  --purple: #8d4dff;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 0%, rgba(141, 77, 255, .13), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(255, 47, 146, .08), transparent 24rem),
    var(--black);
  color: var(--white);
  font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-dragging {
  overflow: hidden;
}

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

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
label[for]:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 7, 13, .92);
  backdrop-filter: blur(18px);
}

h1 {
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -.055em;
}

h1 span {
  color: var(--pink);
}

.topbar p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions,
.asset-actions,
.text-options,
.crop-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ghost,
.danger,
.play-button,
.assistant-button {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--black-3);
  font-size: 12px;
  font-weight: 700;
}

.ghost:hover,
.ghost.active {
  border-color: var(--purple);
  background: rgba(141, 77, 255, .12);
}

.danger {
  color: var(--pink);
}

.danger:hover {
  border-color: var(--pink);
  background: rgba(255, 47, 146, .1);
}

.assistant-button {
  border-color: rgba(255, 47, 146, .55);
  background: linear-gradient(135deg, rgba(255, 47, 146, .92), rgba(141, 77, 255, .92));
  color: var(--white);
}

.assistant-button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.workflow {
  display: flex;
  align-items: stretch;
  gap: 1px;
  padding: 0 clamp(16px, 3vw, 42px);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.workflow > * {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 15px;
  border: 0;
  border-radius: 0;
  background: var(--black-2);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.workflow label,
.workflow button {
  cursor: pointer;
}

.workflow label:hover,
.workflow button:hover {
  color: var(--white);
  background: var(--black-4);
}

.workflow b {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: rgba(141, 77, 255, .22);
  color: var(--white);
  font-size: 10px;
}

.workflow > :last-child b {
  background: var(--pink);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 22px;
  padding: 22px clamp(16px, 3vw, 42px) 40px;
}

body.editor-mode {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.editor-mode .app-shell {
  flex: 1;
  min-height: 0;
  padding-bottom: 22px;
}

body.editor-mode .stage-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 4px;
}

body.editor-mode .controls {
  overflow-y: auto;
  padding-right: 4px;
}

body.editor-mode .app-footer {
  display: none;
}

.stage-panel {
  min-width: 0;
}

.video-workspace {
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--black-3), var(--black-2));
}

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

.source-header > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.source-header strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-header span {
  color: var(--muted);
  font-size: 10px;
}

.interval-field {
  display: grid;
  grid-template-columns: auto 120px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.interval-field output {
  color: var(--white);
}

.source-summary {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: rgba(141, 77, 255, .1);
  border: 1px dashed var(--purple);
  border-radius: 9px;
  text-align: center;
}

.source-summary strong {
  font-size: 13px;
  color: var(--white);
}

.source-summary span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.source-player {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  gap: 10px;
  min-height: 132px;
}

.video-drop-zone,
#sourceVideo {
  grid-area: 1 / 1 / 2 / 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
}

.video-drop-zone {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed rgba(255, 47, 146, .55);
  background:
    linear-gradient(135deg, rgba(255, 47, 146, .12), rgba(141, 77, 255, .1)),
    var(--black);
  color: var(--white);
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}

.video-drop-zone small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}

.video-workspace.has-video .video-drop-zone {
  opacity: 0;
  pointer-events: none;
}

#sourceVideo {
  display: block;
  object-fit: cover;
  background: var(--black);
}

.transport {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, auto));
  align-items: center;
  align-content: center;
  justify-content: start;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, .24);
}

.transport .ghost {
  min-width: 44px;
}

.play-button {
  min-width: 64px;
  border-color: rgba(255, 47, 146, .5);
  background: var(--pink);
}

.transport output {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.filmstrip-wrap {
  position: relative;
  margin-top: 10px;
}

.filmstrip {
  display: flex;
  min-height: 92px;
  gap: 7px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, .22);
  scroll-snap-type: x proximity;
}

.filmstrip-empty {
  display: grid;
  min-width: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.frame-button {
  position: relative;
  flex: 0 0 126px;
  width: 126px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 7px;
  background: var(--black);
  scroll-snap-align: start;
}

.frame-button:hover,
.frame-button.active {
  border-color: var(--pink);
}

.frame-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.frame-button span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .82);
  color: var(--white);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.extract-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  color: var(--muted);
  font-size: 8px;
  pointer-events: none;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.preset {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--black-3);
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: .01em;
  white-space: nowrap;
}

.preset:hover,
.preset.active {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 47, 146, .18), rgba(141, 77, 255, .13));
  box-shadow: inset 0 0 0 1px rgba(255, 47, 146, .1);
}

.decision-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(16, 13, 22, .84);
}

.decision-toolbar > div {
  display: flex;
  min-width: 160px;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0 4px;
}

.decision-toolbar strong {
  font-size: 11px;
}

.decision-toolbar span {
  color: var(--muted);
  font-size: 9px;
}

.decision-toolbar button {
  flex: 0 0 auto;
}

.canvas-frame {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 13px;
  background: var(--black);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
  transition: width .2s ease;
}

.canvas-frame.mobile-preview {
  width: min(320px, 100%);
}

#thumbnailCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--black);
  cursor: grab;
  touch-action: none;
}

#thumbnailCanvas.dragging {
  cursor: grabbing;
}

.canvas-frame.contrast #thumbnailCanvas {
  filter: grayscale(1) contrast(1.32);
}

.safe-overlay {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.safe-overlay.visible {
  display: block;
}

.decision-overlay,
.balance-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.decision-overlay.visible,
.balance-overlay.visible {
  display: block;
}

.decision-overlay {
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .08);
}

.notice-marker {
  position: absolute;
  display: grid;
  width: clamp(34px, 5vw, 66px);
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: clamp(2px, .35vw, 5px) solid var(--white);
  border-radius: 50%;
  background: rgba(255, 47, 146, .92);
  color: var(--white);
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: clamp(18px, 3vw, 40px);
  font-style: italic;
  font-weight: 900;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .5);
}

.notice-marker:nth-child(2) {
  background: rgba(141, 77, 255, .92);
}

.notice-marker:nth-child(3) {
  background: rgba(9, 7, 13, .92);
}

.notice-marker span {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  padding: 3px 7px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: rgba(9, 7, 13, .92);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(7px, 1vw, 11px);
  font-style: normal;
  letter-spacing: .02em;
  white-space: nowrap;
}

.weight-region {
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
}

.weight-region.text {
  color: #ffffff;
  box-shadow: inset 0 0 30px rgba(255, 255, 255, .1);
}

.weight-region.face {
  color: var(--pink);
  background: rgba(255, 47, 146, .09);
  box-shadow: inset 0 0 30px rgba(255, 47, 146, .12);
}

.weight-region.plugin {
  color: #a879ff;
  background: rgba(141, 77, 255, .09);
  box-shadow: inset 0 0 30px rgba(141, 77, 255, .12);
}

.weight-region span {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(9, 7, 13, .88);
  color: currentColor;
  font-size: clamp(6px, .9vw, 10px);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.weight-center {
  position: absolute;
  width: clamp(14px, 2vw, 26px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 47, 146, .22);
}

.weight-summary {
  position: absolute;
  right: 1.5%;
  bottom: 2.5%;
  display: flex;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 6px;
  background: rgba(9, 7, 13, .88);
  color: var(--white);
  font-size: clamp(6px, .85vw, 10px);
  font-weight: 800;
}

.desktop-safe,
.mobile-safe {
  position: absolute;
  border-radius: 4px;
}

.desktop-safe {
  inset: 7%;
  border: 2px dashed rgba(255, 255, 255, .64);
  box-shadow: 0 0 0 9999px rgba(255, 47, 146, .035);
}

.mobile-safe {
  inset: 10% 14%;
  border: 2px dashed rgba(255, 47, 146, .8);
}

.desktop-safe span,
.mobile-safe span {
  position: absolute;
  top: 5px;
  left: 7px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .72);
  font-size: clamp(5px, .75vw, 9px);
  font-weight: 900;
  letter-spacing: .07em;
}

.mobile-safe span {
  top: auto;
  bottom: 5px;
  color: var(--pink);
}

.youtube-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .3), transparent 20%),
    linear-gradient(0deg, rgba(0, 0, 0, .35), transparent 22%);
}

.youtube-title {
  position: absolute;
  top: 5.5%;
  left: 4%;
  width: 32%;
  height: 2.3%;
  border-radius: 999px;
  background: rgba(255, 255, 255, .42);
}

.youtube-controls {
  position: absolute;
  bottom: 6%;
  left: 4%;
  width: 12%;
  height: 2.3%;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
}

.youtube-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1%;
  background: var(--pink);
}

.timestamp-area {
  position: absolute;
  right: 2%;
  bottom: 3%;
  padding: .3% .6%;
  border: 1px dashed rgba(255, 255, 255, .7);
  border-radius: 3px;
  background: rgba(0, 0, 0, .78);
  color: var(--white);
  font-size: clamp(6px, 1vw, 11px);
  font-weight: 800;
}

.contrast-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  display: none;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--pink);
  color: var(--white);
  font-size: clamp(6px, 1vw, 10px);
  font-weight: 900;
  letter-spacing: .08em;
  pointer-events: none;
}

.canvas-frame.contrast .contrast-badge {
  display: block;
}

.canvas-help {
  margin-top: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.variant-comparison {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(141, 77, 255, .32);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(141, 77, 255, .12), transparent 26rem),
    linear-gradient(180deg, var(--black-3), var(--black-2));
}

.variant-comparison[hidden] {
  display: none;
}

.comparison-header,
.variant-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comparison-header {
  margin-bottom: 12px;
}

.comparison-header h2 {
  margin-top: 2px;
  font-size: 18px;
}

.eyebrow {
  color: var(--pink);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.variant-card {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .24);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.variant-card.recommended {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px rgba(255, 47, 146, .2), 0 16px 34px rgba(255, 47, 146, .1);
}

.variant-title {
  margin-bottom: 7px;
  font-size: 11px;
}

.variant-title span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.variant-card canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
  background: var(--black);
}

.variant-card > button {
  width: 100%;
  min-height: 32px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--black-3);
  font-size: 10px;
  font-weight: 800;
}

.variant-card > button:hover {
  border-color: var(--pink);
  background: rgba(255, 47, 146, .1);
}

.variant-review-summary {
  display: grid;
  grid-template-columns: .8fr 1.1fr 1.1fr;
  gap: 10px;
  margin-top: 12px;
}

.variant-review-summary[hidden] {
  display: none;
}

.variant-review-summary > div {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, .22);
}

.variant-review-summary h3 {
  margin: 0 0 7px;
  font-size: 11px;
}

.variant-review-summary ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, .76);
  font-size: 10px;
}

.variant-review-summary li::before {
  margin-right: 6px;
  color: #62dc9b;
  content: "✓";
}

#variantCautions li::before {
  color: var(--pink);
  content: "×";
}

.variant-winner {
  display: flex;
  justify-content: center;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(255, 47, 146, .12), rgba(141, 77, 255, .12)) !important;
}

.variant-winner span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.variant-winner strong {
  margin-top: 2px;
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: 28px;
  font-style: italic;
}

.variant-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variant-row {
  display: flex;
  gap: 8px;
}

.variant-row button:first-child {
  flex: 1;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--black-3), var(--black-2));
}

.project-card {
  background:
    linear-gradient(135deg, rgba(255, 47, 146, .06), rgba(141, 77, 255, .07)),
    var(--black-2);
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.project-actions button {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 10px;
}

.project-actions button:nth-child(2),
.project-actions button:nth-child(3) {
  grid-column: auto;
}

.project-actions button:last-child {
  grid-column: 1 / -1;
}

.text-button {
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.text-button:hover {
  color: var(--white);
}

.control-card > summary {
  cursor: pointer;
  list-style: none;
}

.control-card > summary::-webkit-details-marker {
  display: none;
}

.review-card {
  padding: 0;
  border-color: rgba(255, 47, 146, .28);
  overflow: hidden;
}

.review-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  background: linear-gradient(135deg, rgba(255, 47, 146, .08), rgba(141, 77, 255, .08));
}

.review-card > summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.review-card > summary small {
  color: var(--pink);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.review-card > summary strong {
  font-size: 16px;
}

.review-card > summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  transition: transform .15s ease;
}

.review-card:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.confidence-pill {
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  color: rgba(255, 255, 255, .72);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.confidence-pill.high {
  border-color: rgba(98, 220, 155, .45);
  color: #82e7ad;
}

.confidence-pill.low {
  border-color: rgba(255, 47, 146, .5);
  color: #ff7fba;
}

.review-content {
  padding: 0 15px 15px;
}

.review-metrics {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.review-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 7px 9px;
  background: rgba(9, 7, 13, .78);
}

.review-metrics span {
  color: var(--muted);
  font-size: 9px;
}

.review-metrics strong {
  color: var(--white);
  font-size: 10px;
  text-align: right;
}

#reviewHeadline,
#reviewCuriosity,
#reviewClarity {
  color: #ffcc62;
  letter-spacing: .04em;
}

.review-section {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-title h3 {
  margin: 0;
  font-size: 11px;
}

.mini-title span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.reason-list,
.warning-list {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, .7);
  font-size: 9px;
}

.reason-list li,
.warning-list li {
  position: relative;
  padding-left: 18px;
}

.reason-list li::before,
.warning-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #62dc9b;
  content: "✓";
  font-weight: 900;
}

.reason-list li.warn::before,
.warning-list li::before {
  color: #ffae5e;
  content: "⚠";
}

.warning-list li.clear::before {
  color: #62dc9b;
  content: "✓";
}

.beginner-check {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.toggle-row > span {
  display: flex;
  flex-direction: column;
}

.toggle-row strong {
  font-size: 11px;
}

.toggle-row small {
  color: var(--muted);
  font-size: 8px;
}

.toggle-row input {
  width: 34px;
  height: 18px;
  accent-color: var(--pink);
}

.beginner-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}

.beginner-result[hidden] {
  display: none;
}

.beginner-result strong {
  align-self: start;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--purple);
  font-size: 9px;
}

.beginner-result strong.yes {
  background: #168655;
}

.beginner-result strong.no {
  background: #b52a67;
}

.beginner-result p {
  color: rgba(255, 255, 255, .68);
  font-size: 9px;
}

.local-note {
  margin-top: 12px;
  color: rgba(255, 255, 255, .38);
  font-size: 8px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 14px;
}

.section-title span {
  color: var(--muted);
  font-size: 10px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.upload-grid label,
.upload-grid button {
  display: grid;
  min-height: 36px;
  place-items: center;
  padding: 8px 5px;
  border: 1px solid rgba(141, 77, 255, .35);
  border-radius: 8px;
  background: rgba(141, 77, 255, .1);
  color: var(--white);
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.upload-grid label:hover,
.upload-grid button:hover {
  border-color: var(--pink);
  background: rgba(255, 47, 146, .1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

output {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: var(--black);
  color: var(--white);
}

input[type="text"],
select {
  height: 34px;
  padding: 0 9px;
}

textarea {
  min-height: 60px;
  padding: 8px 9px;
  resize: vertical;
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 900;
}

.headline-hint {
  margin-top: 7px;
  padding: 7px 8px;
  border-left: 2px solid var(--purple);
  border-radius: 0 6px 6px 0;
  background: rgba(141, 77, 255, .08);
  color: rgba(255, 255, 255, .62);
  font-size: 9px;
}

.headline-hint.warning {
  border-left-color: #ffae5e;
  background: rgba(255, 174, 94, .08);
}

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

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
  white-space: nowrap;
}

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

.asset-actions {
  margin-top: 10px;
}

.asset-actions .ghost {
  padding: 7px 8px;
}

.text-options {
  align-items: flex-end;
  margin-top: 2px;
}

.text-options .field {
  flex: 1 1 110px;
  margin-top: 0;
}

.text-options .check {
  min-height: 34px;
}

.export-card {
  background:
    linear-gradient(135deg, rgba(255, 47, 146, .08), rgba(141, 77, 255, .08)),
    var(--black-2);
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.export-grid button,
.export-button {
  min-height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: var(--white);
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(255, 47, 146, .15);
}

.export-grid button:nth-child(2) {
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.export-grid button:nth-child(3) {
  border: 1px solid var(--pink);
  background: var(--black);
}

.export-grid small {
  display: block;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 8px;
  font-style: normal;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.export-grid button:hover,
.export-button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.shortcut-card {
  padding: 0;
}

.shortcut-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  font-size: 11px;
  font-weight: 800;
}

.shortcut-card > summary span {
  color: var(--muted);
  font-size: 9px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px 10px;
  padding: 0 15px 15px;
  color: var(--muted);
  font-size: 9px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 3vw, 42px) 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.app-footer > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.app-footer strong {
  color: rgba(255, 255, 255, .78);
}

.project-status {
  flex: 0 0 auto;
  min-width: 68px;
  padding: 5px 8px;
  border: 1px solid rgba(98, 220, 155, .28);
  border-radius: 999px;
  background: rgba(98, 220, 155, .07);
  color: #82e7ad;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.project-status.saving {
  border-color: rgba(141, 77, 255, .38);
  background: rgba(141, 77, 255, .09);
  color: #b89aff;
}

.project-status.unsaved {
  border-color: rgba(255, 174, 94, .38);
  background: rgba(255, 174, 94, .08);
  color: #ffc17d;
}

.project-status.restored {
  border-color: rgba(255, 47, 146, .38);
  background: rgba(255, 47, 146, .08);
  color: #ff8fc3;
}

.utility-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(14px);
}

#nameDialog,
#confirmDialog {
  z-index: 70;
}

.utility-modal[hidden] {
  display: none;
}

.utility-dialog {
  width: min(520px, 94vw);
  max-height: 88vh;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: var(--black-2);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .68);
}

.utility-dialog-small {
  width: min(420px, 94vw);
}

.utility-dialog-small h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.dialog-note,
.dialog-message {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.dialog-actions button {
  min-width: 88px;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-empty {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, .22);
}

.template-item > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.template-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-item span {
  color: var(--muted);
  font-size: 8px;
}

.template-actions {
  display: flex;
  gap: 5px;
}

.template-actions button {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 8px;
}

.shortcut-grid-dialog {
  grid-template-columns: minmax(80px, auto) 1fr;
  padding: 0;
  font-size: 10px;
}

.shortcut-grid-dialog kbd {
  min-width: 78px;
}

.focus-preview {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2.5vmin;
  background: #050407;
  cursor: none;
}

.focus-preview[hidden] {
  display: none;
}

.focus-preview canvas {
  display: block;
  width: min(95vw, calc(95vh * 16 / 9));
  height: min(95vh, calc(95vw * 9 / 16));
  object-fit: contain;
  background: var(--black);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .72);
}

body.distraction-free {
  overflow: hidden;
}

.app-notice {
  position: fixed;
  z-index: 110;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 9px 12px;
  border: 1px solid rgba(98, 220, 155, .35);
  border-radius: 9px;
  background: rgba(16, 13, 22, .96);
  color: rgba(255, 255, 255, .84);
  font-size: 10px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
}

.app-notice[hidden] {
  display: none;
}

.app-notice.warning {
  border-color: rgba(255, 174, 94, .48);
}

.app-notice.error {
  border-color: rgba(255, 47, 146, .52);
}

kbd {
  min-width: 38px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--black);
  color: var(--white);
  font: 800 8px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  text-align: center;
}

.crop-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(14px);
}

.crop-modal[hidden] {
  display: none;
}

.crop-dialog {
  width: min(1040px, 96vw);
  max-height: 94vh;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(255, 47, 146, .35);
  border-radius: 14px;
  background: var(--black-2);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
}

#cropCanvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--black);
  cursor: crosshair;
  touch-action: none;
}

.crop-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.crop-actions .export-button {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 15px;
}

.drop-hint {
  position: fixed;
  z-index: 50;
  inset: 20px;
  display: none;
  place-items: center;
  border: 3px dashed var(--pink);
  border-radius: 18px;
  background: rgba(9, 7, 13, .9);
  color: var(--white);
  font-family: "League Gothic Italic", "League Gothic", Impact, "Arial Narrow", sans-serif;
  font-size: clamp(24px, 5vw, 64px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: .03em;
  pointer-events: none;
}

body.is-dragging .drop-hint {
  display: grid;
}

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

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .preset-row {
    grid-template-columns: repeat(7, 118px);
  }

  .decision-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .export-card {
    grid-column: 1 / -1;
  }

  .review-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1 1 auto;
  }

  .app-shell {
    padding-top: 14px;
  }

  .source-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .interval-field {
    width: 100%;
    grid-template-columns: auto 1fr;
  }

  .source-player {
    grid-template-columns: 1fr;
  }

  .video-drop-zone,
  #sourceVideo {
    grid-area: 1 / 1;
  }

  .transport {
    grid-area: 2 / 1;
    justify-content: stretch;
  }

  .transport .ghost,
  .play-button {
    min-width: 0;
  }

  .controls {
    display: flex;
  }

  .canvas-help {
    padding: 0 10px;
  }

  .decision-toolbar > div {
    flex-basis: 100%;
  }

  .decision-toolbar button {
    flex: 1 1 140px;
  }

  .variant-grid,
  .variant-review-summary {
    grid-template-columns: 1fr;
  }

  .comparison-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-item {
    grid-template-columns: 1fr;
  }
}
