:root {
  color-scheme: dark;
  --bg: #07090b;
  --panel: #111820;
  --panel2: #18222b;
  --grid: #2b3942;
  --grid2: #40515c;
  --text: #edf5df;
  --muted: #8ea09b;
  --yellow: #f3cc58;
  --cyan: #61d8d2;
  --red: #ff6b61;
  --green: #94df69;
  --second-width: 38.4px;
  --timeline-panel-height: calc((100% - 8px) / 2);
  --preview-panel-width: calc((100% - 16px) / 3);
  --settings-panel-width: calc((100% - 8px) / 2);
  --clip-button-height: 20px;
  --clip-button-pad-x: 5px;
  --clip-button-radius: 3px;
  --clip-button-edge: 8px;
  --field-scrollbar-space: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #101923, var(--bg) 260px);
  color: var(--text);
  font: 14px/1.35 "Segoe UI", Arial, sans-serif;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

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

.app {
  width: calc(100vw - 28px);
  height: calc(100vh - 28px);
  margin: 14px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.panel {
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.transport {
  position: relative;
  padding: 14px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 14px;
  align-items: center;
  overflow: visible;
}

.brand-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 2px #000;
  user-select: none;
}

.brand-mark-c {
  color: var(--cyan);
  font-weight: 900;
  font-family: Arial, Helvetica, sans-serif;
}

.brand-mark-separator {
  color: rgba(231, 239, 218, 0.72);
  font-weight: 700;
  transform: translateY(-1px);
}

.brand-mark-play {
  color: var(--yellow);
  font-weight: 900;
  font-size: 0.9em;
  transform: translateY(-1px);
}

.project-name {
  width: min(360px, 38vw);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  font: 800 18px/26px "Courier New", monospace;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-block {
  grid-column: 2;
  justify-self: start;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 0 2px;
}

.auth-block {
  grid-column: 4;
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-signin,
.auth-user button {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
  font: 800 12px/1 "Courier New", monospace;
  opacity: 0.86;
}

.auth-signin:hover,
.auth-user button:hover {
  color: var(--yellow);
  opacity: 1;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-user[hidden] {
  display: none;
}

.auth-user span {
  max-width: 160px;
  overflow: hidden;
  color: var(--text);
  font: 800 12px/1 "Courier New", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-actions button {
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
  font: 800 12px/1 "Courier New", monospace;
  opacity: 0.86;
}

.project-actions button:hover {
  color: var(--yellow);
  opacity: 1;
}

.project-actions .ai-all-pics {
  padding: 3px 7px;
  border: 1px solid rgba(255, 142, 67, 0.62);
  border-radius: 3px;
  background: rgba(11, 16, 20, 0.72);
  color: #ff9a4d;
}

.project-actions .ai-all-pics:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.project-actions button:active {
  transform: none;
  box-shadow: none;
}

.sub,
.hint,
.panel-title,
.pill,
.badge,
.clip-name,
.clip-bottom,
.meta-line {
  font-family: "Courier New", monospace;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font: 13px/1 "Courier New", monospace;
}

.pill {
  min-height: 30px;
  padding: 8px 10px;
  border: 1px solid var(--grid);
  border-radius: 4px;
  background: #0b1014;
}

.pill strong {
  color: var(--text);
}

button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid #7b6427;
  border-radius: 5px;
  background: linear-gradient(#ffe07d, #c88c2e);
  color: #120d05;
  font: 800 13px/1 "Courier New", monospace;
  box-shadow: 0 4px 0 #5a3d18;
  cursor: pointer;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #5a3d18;
}

.timeline-play {
  position: relative;
  top: -3px;
  min-height: 36px;
  min-width: 86px;
  padding: 0 16px;
  border: 1px solid rgba(97, 216, 210, 0.55);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.86);
  color: var(--cyan);
  box-shadow: none;
  font: 800 13px/1 "Courier New", monospace;
}

.timeline-play:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.timeline-play:active {
  transform: none;
  box-shadow: none;
}

.workspace {
  display: grid;
  grid-template-rows: var(--timeline-panel-height) 8px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.preview,
.timeline-panel,
.properties,
.settings-panel {
  padding: 12px;
}

.preview {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.preview-head {
  min-width: 0;
}

.preview-action {
  position: absolute;
  top: 8px;
  z-index: 6;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 4px;
  background: rgba(8, 20, 24, 0.72);
  color: var(--cyan);
  box-shadow: none;
  font: 700 18px/1 "Courier New", monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 180ms ease;
}

.preview-fullscreen {
  right: 8px;
  font-size: 18px;
  line-height: 1;
  padding-bottom: 1px;
}

.preview-snapshot {
  right: 38px;
  font-size: 15px;
  line-height: 1;
  padding-top: 1px;
}

.preview-action:disabled {
  opacity: 0.35;
  cursor: default;
}

.preview-action:hover:not(:disabled) {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(97, 216, 210, 0.12);
}

.preview-action:active {
  transform: none;
  box-shadow: none;
}

.preview-fullscreen.is-hidden,
.preview-snapshot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.preview.is-fullscreen {
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #05080a;
}

.preview.is-fullscreen .preview-head {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10;
  min-width: 0;
}

.preview.is-fullscreen .panel-title {
  display: none;
}

.preview.is-fullscreen .preview-frame {
  width: 100vw;
  height: 100vh;
  border: 0;
}

.preview.is-fullscreen .preview-fullscreen {
  position: fixed;
  top: 12px;
  right: 12px;
}

.preview.is-fullscreen .preview-snapshot {
  position: fixed;
  top: 12px;
  right: 42px;
}

.properties-head {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
  min-width: 0;
}

.bottom-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--preview-panel-width) 8px minmax(0, 1fr);
  overflow: hidden;
}

.right-bottom {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 8px minmax(220px, var(--settings-panel-width));
  overflow: hidden;
}

.timeline-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.splitter {
  position: relative;
  background: transparent;
  z-index: 20;
}

.splitter-horizontal {
  cursor: row-resize;
}

.splitter-vertical {
  cursor: col-resize;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr);
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.panel-head .badge {
  justify-self: end;
}

.timeline-readout {
  justify-self: end;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.compact-pill {
  min-height: 28px;
  padding: 7px 9px;
  font-size: 11px;
}

.panel-title {
  color: var(--yellow);
  font-weight: 800;
  font-size: 12px;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scale-slider {
  width: 160px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--yellow);
}

.hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--grid);
  border-radius: 4px;
  background: #0b1014;
  color: var(--cyan);
  font-size: 11px;
}

.properties-frame-name {
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font: 11px/1 "Courier New", monospace;
}

.preview-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--grid);
  border-radius: 4px;
  background: #05080a;
}

.preview-frame img,
.preview-frame video {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.preview-frame img[hidden],
.preview-frame video[hidden] {
  display: none !important;
}

.meta-line {
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.meta-line span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-shell {
  position: relative;
  display: grid;
  grid-template-columns: max-content;
  grid-template-rows: 34px minmax(120px, 1fr) 48px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  min-height: 0;
  border: 1px solid var(--grid);
  border-radius: 4px;
  background: #0a0f13;
  touch-action: none;
}

.ruler {
  grid-column: 1;
  position: relative;
  height: 34px;
  min-width: 100%;
  border-bottom: 1px solid var(--grid);
  background: linear-gradient(180deg, var(--panel2), rgba(24, 34, 43, 0.92));
}

.tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #2a343c;
}

.tick.major {
  background: #58616b;
}

.tick span {
  position: absolute;
  top: 8px;
  left: 5px;
  color: var(--muted);
  font: 12px/1 "Courier New", monospace;
}

.frames-track {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  display: flex;
  height: 100%;
  min-width: 100%;
  border-bottom: 1px solid var(--grid);
  background:
    repeating-linear-gradient(to right, transparent 0 calc(var(--second-width) - 1px), rgba(255, 255, 255, 0.045) calc(var(--second-width) - 1px) var(--second-width)),
    #0a0f13;
}

.empty-frame {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: min(520px, 100vw);
  height: 100%;
  background: #020405;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.empty-frame.drag-over {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.empty-plus {
  color: var(--cyan);
  font: 800 72px/0.8 "Courier New", monospace;
}

.empty-text {
  color: var(--muted);
  font: 800 13px/1 "Courier New", monospace;
}

.clip {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  border-right: 0;
  background: #10171d;
  overflow: visible;
  cursor: pointer;
  transition: transform 120ms ease, left 120ms ease;
}

.clip-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #10171d;
}

.clip.dragging {
  z-index: auto;
  cursor: grabbing;
  transition: none;
}

.clip.copying {
  opacity: 0.92;
  cursor: copy;
}

.clip.copy-source {
  cursor: copy;
}

body.copy-key-down .clip:hover {
  cursor: copy;
}

.clip.copying::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 90;
  border: 1px dashed rgba(243, 204, 88, 0.9);
  pointer-events: none;
}

.clip.dragging .clip-visual {
  z-index: 50;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
}

.clip.dragging .clip-info {
  z-index: auto;
}

.clip.dragging .clip-edit-button,
.clip.dragging .clip-video-still,
.clip.dragging .clip-open,
.clip.dragging .clip-actions {
  display: none !important;
}

.clip.dragging .clip-edit-button,
.clip.dragging .clip-video-still,
.clip.dragging .clip-open,
.clip.dragging .clip-actions {
  z-index: 80;
}

.clip-edit-button {
  display: none;
  position: absolute;
  top: 8px;
  z-index: 80;
  width: auto;
  height: 20px;
  min-height: 0;
  padding: 0 5px;
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: 3px;
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.clip.selected .clip-edit-button {
  display: block;
}

.clip-edit-button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.clip-edit-button:active {
  transform: none;
  box-shadow: none;
}

.clip-delete {
  left: 8px;
}

.clip-insert {
  right: 8px;
}

.clip-video-still {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 80;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.74);
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  transform: translateY(-50%);
}

.clip.selected .clip-video-still {
  display: grid;
  place-items: center;
}

.clip-video-still-left {
  left: 10px;
}

.clip-video-still-right {
  right: 10px;
}

.clip-video-still-current-right {
  right: 10px;
  top: calc(50% + 28px);
  font: 800 12px/1 "Courier New", monospace;
}

.clip-video-still::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.clip-video-still-left::before {
  border-right: 8px solid currentColor;
  margin-left: -1px;
}

.clip-video-still-right::before {
  border-left: 8px solid currentColor;
  margin-right: -1px;
}

.clip-video-still-current-right::before {
  content: none;
}

.clip-video-still:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.clip-video-still:active,
.clip-video-still:focus {
  transform: translateY(-50%);
  box-shadow: none;
  outline: none;
}

.clip-video-still:focus-visible {
  outline: 1px solid var(--yellow);
  outline-offset: 2px;
}

.clip.generating .clip-video-still {
  display: none !important;
}

.insert-arrow {
  color: var(--text);
  font-weight: 800;
  margin-left: 3px;
}

.clip::before,
.clip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.clip::before {
  z-index: 7;
  box-shadow: inset 0 0 0 2px rgba(97, 216, 210, 0.95);
  background: rgba(97, 216, 210, 0.08);
}

.clip::after {
  z-index: 4;
  background: rgba(255, 255, 255, 0.07);
  mix-blend-mode: screen;
}

.clip.selected::before,
.clip.active::after {
  opacity: 1;
}

.clip img,
.clip video {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center center;
  display: block;
  filter: saturate(0.95) contrast(1.05);
  transform: translateX(-50%);
  user-select: none;
  -webkit-user-drag: none;
}

.clip-empty-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  background: #020405;
  color: var(--text);
  text-align: center;
  user-select: none;
}

.clip-empty-placeholder.drag-over {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

.clip-empty-plus {
  position: relative;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 4px;
  background: rgba(8, 20, 24, 0.72);
  color: var(--cyan);
  font: 800 38px/1 "Courier New", monospace;
  cursor: pointer;
  box-shadow: none;
}

.clip-empty-plus span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -49%);
}

.clip-empty-plus:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.clip-empty-text {
  width: min(132px, calc(100% - 24px));
  color: var(--muted);
  font: 800 11px/1.2 "Courier New", monospace;
  text-align: center;
}

.clip-empty .clip-name {
  color: rgba(241, 245, 224, 0.68);
}

.clip-info {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: auto;
  display: block;
  padding: 8px;
  min-width: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 8, 10, 0.82), rgba(5, 8, 10, 0) 22%),
    linear-gradient(180deg, rgba(5, 8, 10, 0), rgba(5, 8, 10, 0.9));
}

.clip-name {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  text-align: center;
  max-width: calc(100% - 150px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.is-playing .clip-name {
  left: 8px;
  right: 8px;
  bottom: 8px;
  transform: none;
  max-width: none;
}

.clip-open {
  display: none;
  position: absolute;
  left: var(--clip-button-edge);
  bottom: var(--clip-button-edge);
  z-index: 80;
  width: auto;
  height: var(--clip-button-height);
  min-height: 0;
  padding: 0 var(--clip-button-pad-x);
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: var(--clip-button-radius);
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.clip.selected .clip-open {
  display: block;
}

.clip.generating .clip-open,
.clip.generating .clip-edit-button {
  display: none !important;
}

.clip-open:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.clip-open:active {
  transform: none;
  box-shadow: none;
}

.clip-actions {
  position: absolute;
  z-index: 80;
  right: var(--clip-button-edge);
  bottom: var(--clip-button-edge);
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  pointer-events: auto;
}

.clip-duration {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
  white-space: nowrap;
}

.clip-duration.video-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.clip-duration.video-duration::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid var(--text);
  filter: drop-shadow(0 1px 2px #000);
  transform: translateY(-1px);
}

.clip-job-badge {
  position: absolute;
  left: 50%;
  top: 29px;
  z-index: 5;
  max-width: calc(100% - 22px);
  padding: 3px 7px;
  border: 1px solid rgba(243, 204, 88, 0.72);
  border-radius: 3px;
  background: rgba(37, 31, 12, 0.78);
  color: var(--yellow);
  font: 800 10px/1 "Courier New", monospace;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transform: translateX(-50%);
  pointer-events: none;
}

.clip-job-badge.error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.clip-job-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
}

.clip-job-actions button {
  appearance: none;
  border: 1px solid rgba(255, 189, 176, 0.72);
  border-radius: 4px;
  background: rgba(12, 18, 21, 0.72);
  color: #ffd8d0;
  font: 800 10px/1 "Courier New", monospace;
  padding: 3px 5px;
  cursor: pointer;
}

.clip-job-actions button:hover {
  border-color: #ffd8d0;
  color: #fff1ec;
}

.clip-job-badge.error {
  border-color: rgba(255, 107, 97, 0.78);
  background: rgba(52, 17, 16, 0.78);
  color: #ffb3ac;
}

.clip.generating .clip-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(243, 204, 88, 0.08) 0 6px,
      rgba(243, 204, 88, 0.02) 6px 12px
    );
  pointer-events: none;
}

.clip-mode,
.clip-generate {
  width: auto;
  height: var(--clip-button-height);
  min-height: 0;
  padding: 0 var(--clip-button-pad-x);
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: var(--clip-button-radius);
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.clip-mode {
  border-color: transparent;
  background: rgba(11, 16, 20, 0.58);
  color: var(--muted);
}

.is-playing .clip-mode,
.is-playing .clip-generate,
.is-playing .clip-open,
.is-playing .clip-video-still,
.is-playing .clip-edit-button,
.is-playing .clip.selected .clip-open,
.is-playing .clip.selected .clip-video-still,
.is-playing .clip.selected .clip-edit-button {
  display: none !important;
}

.clip-mode:hover,
.clip-generate:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.clip-mode:active,
.clip-generate:active {
  transform: none;
  box-shadow: none;
}

.handle {
  position: absolute;
  top: 0;
  right: -7px;
  z-index: 30;
  width: 14px;
  height: 100%;
  touch-action: none;
  cursor: ew-resize;
}

.handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--yellow);
  box-shadow:
    -1px 0 0 rgba(5, 8, 10, 0.75),
    1px 0 0 rgba(5, 8, 10, 0.75),
    0 0 10px rgba(243, 204, 88, 0.55);
}

.handle::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(243, 204, 88, 0);
}

.handle:hover::after {
  background: rgba(243, 204, 88, 0.14);
}

.handle[title] {
  cursor: ew-resize;
}

.music-track {
  grid-column: 1;
  grid-row: 3;
  position: relative;
  height: 48px;
  min-height: 48px;
  min-width: 100%;
  background:
    repeating-linear-gradient(to right, transparent 0 calc(var(--second-width) - 1px), rgba(255, 255, 255, 0.045) calc(var(--second-width) - 1px) var(--second-width)),
    repeating-linear-gradient(90deg, #121c21 0, #121c21 16px, #17232a 16px, #17232a 32px);
}

.waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.95;
  pointer-events: none;
}

.music-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  background: rgba(97, 216, 210, 0.14);
  box-shadow: inset 0 0 0 1px rgba(148, 223, 105, 0.18);
}

.music-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 28px;
  margin-left: -14px;
  cursor: ew-resize;
  touch-action: none;
}

.music-end-handle {
  z-index: 7;
}

.music-fade-handle {
  z-index: 6;
}

.music-track.dragging-music-end .music-fade-handle,
.music-track.dragging-music-fade .music-end-handle {
  pointer-events: none;
}

.music-fade-curve {
  position: absolute;
  top: 7px;
  bottom: 7px;
  z-index: 4;
  min-width: 1px;
  pointer-events: none;
}

.music-fade-curve::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(255, 246, 166, 0.95) 50%, transparent calc(50% + 1px));
}

.music-fade-curve::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(97, 216, 210, 0.18), rgba(97, 216, 210, 0));
}

.music-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13px;
  width: 2px;
  background: var(--yellow);
  box-shadow:
    -1px 0 0 rgba(5, 8, 10, 0.75),
    1px 0 0 rgba(5, 8, 10, 0.75),
    0 0 10px rgba(243, 204, 88, 0.55);
}

.music-fade-handle::before {
  background: var(--cyan);
  box-shadow:
    -1px 0 0 rgba(5, 8, 10, 0.75),
    1px 0 0 rgba(5, 8, 10, 0.75),
    0 0 10px rgba(97, 216, 210, 0.55);
}

.music-label {
  position: absolute;
  left: 62px;
  top: 50%;
  transform: none;
  z-index: 2;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font: 800 11px/1 "Courier New", monospace;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
  translate: 0 -50%;
}

.music-open {
  position: absolute;
  left: 8px;
  top: 50%;
  z-index: 3;
  width: auto;
  height: 20px;
  min-height: 0;
  padding: 0 5px;
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: 3px;
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
  translate: 0 -50%;
}

.music-open:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.music-open:active {
  transform: none;
  box-shadow: none;
}

.music-duration {
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 2;
  color: var(--text);
  font: 800 11px/1 "Courier New", monospace;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
}


.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  width: 1.6px;
  background: #fff6a6;
  box-shadow: 0 0 12px rgba(243, 204, 88, 0.9);
  pointer-events: none;
  transform: translateX(0);
}

.properties {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.settings-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.settings-scroll {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-gutter: stable;
}

.settings-grid {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
}

.settings-block {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(77, 98, 115, 0.72);
  border-radius: 6px;
  background: rgba(5, 12, 15, 0.36);
}

.settings-block-title {
  color: var(--yellow);
  font: 800 13px/1 "Courier New", monospace;
  letter-spacing: 0;
}

.settings-hint {
  margin: 0;
  color: var(--muted);
  font: 700 11px/1.35 "Courier New", monospace;
}

.influence-setting {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-items: stretch;
  gap: 0;
  color: var(--muted);
}

.influence-setting > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 11px/1.15 "Courier New", monospace;
}

.influence-setting input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  height: 14px;
  margin: -1px 0 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.influence-setting input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(232, 190, 73, 0.62);
  border: 0;
}

.influence-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  border-radius: 50%;
  border: 0;
  background: var(--yellow);
  box-shadow: none;
}

.influence-setting input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(232, 190, 73, 0.62);
  border: 0;
}

.influence-setting input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 0;
  background: var(--yellow);
  box-shadow: none;
}

.influence-setting small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: rgba(168, 190, 184, 0.68);
  font: 700 9px/0.9 "Courier New", monospace;
  margin-top: -3px;
}

.influence-setting small b {
  font: inherit;
  text-transform: uppercase;
}

.influence-bubble {
  position: absolute;
  top: 10px;
  left: 0;
  z-index: 3;
  padding: 2px 5px;
  border: 1px solid rgba(232, 190, 73, 0.82);
  border-radius: 4px;
  background: rgba(8, 20, 24, 0.94);
  color: var(--yellow);
  font: 800 10px/1 "Courier New", monospace;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
}

.influence-bubble.is-visible {
  opacity: 1;
}

.character-sheet-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.compact-setting {
  grid-template-columns: minmax(82px, 1fr) minmax(86px, 1.2fr);
  align-items: center;
  gap: 8px;
}

.compact-setting span {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-setting select {
  min-height: 28px;
}

.character-sheet-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.14);
  border-radius: 4px;
  background: transparent;
  color: var(--cyan);
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  transform: none;
}

.character-sheet-thumb:hover {
  border-color: rgba(243, 204, 88, 0.38);
  color: var(--yellow);
}

.character-sheet-thumb:active {
  transform: none;
  box-shadow: none;
}

.character-sheet-thumb strong {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 5px;
  z-index: 2;
  color: var(--text);
  font: 800 9px/1 "Courier New", monospace;
  text-align: center;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
  pointer-events: none;
}

.character-sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-sheet-thumb span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding-bottom: 11px;
  font: 800 32px/1 "Courier New", monospace;
}

.project-dialog.character-sheet-dialog {
  width: min(1040px, calc(100vw - 48px));
  overflow: hidden;
}

.project-dialog.character-sheet-dialog form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, min(60vh, 620px)) minmax(300px, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  grid-template-areas:
    "title title"
    "preview notes"
    "preview progress"
    "preview danger"
    "preview error"
    "preview actions";
  gap: 12px 18px;
  max-height: calc(100vh - 88px);
  overflow: hidden;
  align-items: start;
}

.character-sheet-preview {
  grid-area: preview;
  position: relative;
  display: grid;
  place-items: center;
  width: min(60vh, 620px);
  max-width: min(58vw, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(77, 98, 115, 0.95);
  border-radius: 4px;
  background: #03080a;
  overflow: hidden;
}

.character-sheet-preview-upload,
.character-sheet-preview-delete {
  position: absolute;
  left: 10px;
  z-index: 4;
  width: auto;
  height: 22px;
  min-height: 0;
  padding: 0 7px;
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: 3px;
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.character-sheet-preview-upload {
  bottom: 10px;
}

.character-sheet-preview-delete {
  top: 10px;
  border-color: rgba(255, 107, 97, 0.5);
  color: #ffb3ac;
}

.character-sheet-preview-upload:hover,
.character-sheet-preview-delete:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.character-sheet-preview-upload:active,
.character-sheet-preview-delete:active {
  transform: none;
  box-shadow: none;
}

.character-sheet-preview.drag-over {
  border-color: var(--yellow);
  background: rgba(243, 204, 88, 0.06);
}

.character-sheet-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.character-sheet-preview div {
  display: grid;
  place-items: center;
  gap: 7px;
  width: 152px;
  min-height: 104px;
  padding: 13px 12px;
  border: 1px solid rgba(97, 216, 210, 0.55);
  border-radius: 4px;
  color: var(--cyan);
}

.character-sheet-preview div strong {
  font: 800 42px/0.8 "Courier New", monospace;
}

.character-sheet-preview div span {
  color: var(--muted);
  font: 800 10px/1.2 "Courier New", monospace;
  text-align: center;
  text-transform: uppercase;
}

.project-dialog.character-sheet-dialog .dialog-title {
  grid-area: title;
}

.project-dialog.character-sheet-dialog label {
  grid-area: notes;
  min-height: 0;
}

.project-dialog.character-sheet-dialog textarea {
  height: 220px;
  min-height: 0;
  resize: none;
}

.project-dialog.character-sheet-dialog .dialog-error {
  grid-area: error;
}

.character-sheet-progress {
  grid-area: progress;
  display: grid;
  gap: 8px;
  align-self: start;
}

.character-sheet-progress[hidden] {
  display: none !important;
}

.character-sheet-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font: 700 13px/1.2 "Courier New", monospace;
}

.character-sheet-progress-track {
  height: 12px;
  border: 1px solid rgba(93, 224, 219, 0.65);
  background: rgba(4, 9, 11, 0.85);
  overflow: hidden;
}

.character-sheet-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--yellow));
  transition: width 0.25s ease;
}

.project-dialog.character-sheet-dialog .character-sheet-danger {
  grid-area: danger;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.project-dialog.character-sheet-dialog .dialog-actions {
  grid-area: actions;
  align-self: stretch;
  justify-content: flex-end;
  align-items: end;
}

.project-style-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 150px;
}

.project-style-box {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
}

.project-style-field textarea {
  min-height: 0;
  height: 100%;
  padding-bottom: 44px;
  resize: none;
}

.project-style-box #aiStyleButton {
  position: absolute;
  right: var(--clip-button-edge);
  bottom: var(--clip-button-edge);
  z-index: 2;
  width: auto;
  height: var(--clip-button-height);
  min-height: 0;
  min-width: 0;
  padding: 0 var(--clip-button-pad-x);
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: var(--clip-button-radius);
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
  transform: none;
}

.project-style-box.has-scrollbar #aiStyleButton {
  right: calc(var(--clip-button-edge) + var(--field-scrollbar-space));
}

.project-style-box #aiStyleButton:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

.project-style-box #aiStyleButton:active {
  transform: none;
  box-shadow: none;
}

.settings-readonly {
  display: grid;
  gap: 5px;
  min-height: 36px;
  align-content: center;
  color: var(--muted);
  font: 11px/1 "Courier New", monospace;
}

.settings-readonly strong {
  color: var(--text);
  font: 800 12px/1 "Courier New", monospace;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font: 11px/1 "Courier New", monospace;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: #0b1014;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 36px;
  padding: 0 9px;
}

textarea {
  height: clamp(72px, 18vh, 180px);
  min-height: 0;
  padding: 9px;
  resize: none;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow);
}

.project-dialog {
  width: min(420px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 44px);
  padding: 16px;
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: #0b1014;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.project-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.project-dialog form {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 78px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#generatePromptDialog {
  width: min(640px, calc(100vw - 36px));
}

#generatePromptDialog form {
  grid-template-rows: auto auto auto minmax(0, auto) auto;
}

#generatePromptDialog label {
  min-width: 0;
}

.auth-dialog {
  width: min(380px, calc(100vw - 36px));
}

.auth-dialog form {
  gap: 12px;
}

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

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.prompt-tools-dialog {
  width: min(760px, calc(100vw - 36px));
  height: min(620px, calc(100vh - 44px));
  min-width: 520px;
  min-height: 420px;
  resize: both;
  overflow: hidden;
}

.prompt-tools-dialog form {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

.prompt-tools-dialog label {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.prompt-tools-dialog textarea {
  min-height: 0;
  height: 100%;
  resize: none;
  font-size: 13px;
  line-height: 1.35;
}

.video-generate-dialog {
  width: min(560px, calc(100vw - 36px));
  max-height: min(720px, calc(100vh - 44px));
}

.video-generate-summary {
  white-space: pre-wrap;
  padding: 9px 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
  color: var(--muted);
  font: 800 11px/1.35 "Courier New", monospace;
  max-height: 116px;
  overflow: auto;
  overflow-wrap: anywhere;
}

.video-generate-dialog #videoGeneratePromptInput {
  height: clamp(86px, 22vh, 150px);
}

.video-compare-dialog {
  width: min(960px, calc(100vw - 36px));
}

.video-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.video-compare-grid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: #020405;
}

#generatePromptInput {
  height: clamp(86px, 22vh, 180px);
}

.dialog-title {
  color: var(--yellow);
  font: 800 14px/1 "Courier New", monospace;
}

.dialog-error {
  padding: 8px 10px;
  border: 1px solid rgba(255, 107, 97, 0.55);
  border-radius: 4px;
  background: rgba(255, 107, 97, 0.12);
  color: #ffb3ac;
  font: 800 11px/1.3 "Courier New", monospace;
}

.new-project-options {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
}

.lyrics-project-dialog {
  width: min(620px, calc(100vw - 36px));
}

.lyrics-project-dialog form {
  gap: 12px;
}

.lyrics-project-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(180px, 1.3fr);
  gap: 10px;
}

.lyrics-project-dialog textarea {
  height: clamp(92px, 24vh, 210px);
}

#lyricsGeneratorNotesInput {
  height: clamp(58px, 12vh, 100px);
}

.ai-all-dialog {
  width: min(560px, calc(100vw - 36px));
  padding: 18px;
}

.ai-all-dialog form {
  gap: 18px;
  overflow: hidden;
}

.ai-all-dialog .dialog-title {
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(64, 81, 92, 0.72);
  font-size: 16px;
}

#aiAllConfirmDialog {
  width: min(620px, calc(100vw - 36px));
}

#aiAllConfirmSummary {
  max-height: none;
  min-height: 138px;
  overflow: visible;
}

.ai-all-warning {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: start;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(255, 107, 97, 0.78);
  border-left-width: 4px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 107, 97, 0.2), rgba(255, 107, 97, 0.05)),
    rgba(11, 16, 20, 0.86);
  color: #ffb3ac;
  font: 800 11px/1.35 "Courier New", monospace;
  overflow-wrap: anywhere;
}

.ai-all-warning::before {
  content: "!";
  grid-row: 1 / span 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 107, 97, 0.7);
  border-radius: 4px;
  color: #ffd0cc;
  background: rgba(255, 107, 97, 0.14);
  font: 800 15px/1 "Courier New", monospace;
}

.ai-all-warning strong {
  color: #ffd0cc;
  font-size: 12px;
  text-transform: uppercase;
}

.ai-all-warning span {
  display: block;
  min-width: 0;
}

.ai-all-steps {
  counter-reset: ai-step;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(64, 81, 92, 0.82);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(97, 216, 210, 0.06), rgba(97, 216, 210, 0.01)),
    rgba(5, 9, 12, 0.52);
  overflow: hidden;
}

.ai-all-step {
  counter-increment: ai-step;
  display: grid;
  grid-template-columns: 30px 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 11px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.78);
  color: var(--muted);
  font: 800 11px/1.2 "Courier New", monospace;
  overflow: hidden;
}

.ai-all-step::before {
  content: counter(ai-step, decimal-leading-zero);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(97, 216, 210, 0.38);
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(97, 216, 210, 0.08);
  font: 800 11px/1 "Courier New", monospace;
}

.ai-all-step:has(input:checked) {
  border-color: rgba(97, 216, 210, 0.55);
  background: rgba(11, 22, 25, 0.88);
}

.ai-all-step input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--cyan);
}

.ai-all-step span {
  min-width: 0;
  overflow: hidden;
}

.ai-all-step strong {
  display: block;
  color: var(--text);
  font: 800 12px/1 "Courier New", monospace;
}

.ai-all-step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 800 10px/1.25 "Courier New", monospace;
  overflow-wrap: anywhere;
}

.ai-all-arrow {
  position: relative;
  height: 18px;
  color: var(--yellow);
  text-align: center;
  font: 800 0/1 "Courier New", monospace;
  opacity: 0.9;
  margin: -2px 0;
  overflow: hidden;
}

.ai-all-arrow::before {
  content: "\2193";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.ai-all-dialog .dialog-actions {
  padding-top: 14px;
  border-top: 1px solid rgba(64, 81, 92, 0.55);
  margin-top: 4px;
}

.ai-all-dialog .dialog-actions button[type="submit"] {
  border-color: rgba(243, 204, 88, 0.72);
  color: var(--yellow);
  background: rgba(37, 31, 12, 0.62);
}

.ai-all-dialog .dialog-actions button[type="submit"]:hover {
  border-color: var(--yellow);
  color: #ffe38a;
}

.reference-options {
  display: grid;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
  max-height: 120px;
  overflow: auto;
}

.generation-output-options {
  display: grid;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
}

.generation-output-head {
  color: var(--muted);
  font: 800 11px/1 "Courier New", monospace;
}

.generation-output-tabs {
  display: flex;
  gap: 8px;
}

.generation-output-tabs label {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(97, 216, 210, 0.38);
  border-radius: 4px;
  color: var(--cyan);
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.generation-output-tabs label:has(input:checked) {
  border-color: var(--yellow);
  color: var(--yellow);
  background: rgba(232, 190, 73, 0.11);
}

.generation-output-tabs input {
  margin: 0;
  accent-color: var(--cyan);
}

.generation-output-hint {
  color: var(--muted);
  font: 800 10px/1.3 "Courier New", monospace;
}

.reference-options[hidden],
.reference-option[hidden] {
  display: none;
}

.reference-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font: 800 11px/1.2 "Courier New", monospace;
}

.reference-option input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  accent-color: var(--cyan);
}

.reference-option span,
.reference-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-option strong {
  color: var(--text);
  white-space: nowrap;
}

#openProjectDialog {
  width: min(560px, calc(100vw - 36px));
  min-width: min(560px, calc(100vw - 36px));
  height: min(620px, calc(100vh - 44px));
}

#openProjectDialog form {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 100%;
}

.project-search {
  min-height: 32px;
  width: 100%;
}

.project-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  max-height: none;
  padding-right: 8px;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.project-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 12px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.86);
  color: var(--text);
  box-shadow: none;
  text-align: left;
  font: 800 12px/1 "Courier New", monospace;
}

.project-list-item span,
.project-list-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-item small,
.project-list-empty {
  color: var(--muted);
  font: 11px/1.2 "Courier New", monospace;
}

.project-list-empty {
  padding: 10px;
  border: 1px solid var(--grid2);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.7);
}

.project-list-item:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.project-list-item:active {
  transform: none;
  box-shadow: none;
}

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

.dialog-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(97, 216, 210, 0.55);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.86);
  color: var(--cyan);
  box-shadow: none;
  font: 800 12px/1 "Courier New", monospace;
}

.dialog-actions button.is-video-output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.video-output-triangle {
  color: var(--yellow);
  font-size: 0.92em;
  line-height: 1;
  transform: translateY(-1px);
}

.dialog-actions button:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.dialog-actions button:active {
  transform: none;
  box-shadow: none;
}

.export-status {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  padding: 0;
  border: 0;
  margin: 0;
  color: inherit;
  background: rgba(0, 0, 0, 0.48);
}

.export-status::backdrop {
  background: transparent;
}

.export-status[hidden] {
  display: none;
}

.export-status-box {
  position: relative;
  width: min(420px, calc(100vw - 36px));
  padding: 18px;
  border: 1px solid var(--grid2);
  border-radius: 6px;
  background: #0b1014;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58);
}

.export-status-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(97, 216, 210, 0.58);
  border-radius: 4px;
  background: rgba(8, 20, 24, 0.72);
  color: var(--cyan);
  font: 700 18px/1 "Courier New", monospace;
  cursor: pointer;
  box-shadow: none;
  display: grid;
  place-items: center;
}

.export-status-close:hover {
  border-color: var(--cyan);
  background: rgba(97, 216, 210, 0.12);
}

.export-status-close[hidden] {
  display: none;
}

.export-status-title {
  color: var(--yellow);
  font: 800 14px/1 "Courier New", monospace;
}

.export-status-message {
  margin-top: 10px;
  color: var(--text);
  font: 12px/1.4 "Courier New", monospace;
}

.export-progress {
  margin-top: 16px;
}

.export-progress[hidden] {
  display: none;
}

.export-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font: 800 10px/1 "Courier New", monospace;
}

.export-progress-track {
  height: 8px;
  margin-top: 8px;
  border: 1px solid rgba(97, 216, 210, 0.38);
  background: rgba(5, 11, 14, 0.92);
  overflow: hidden;
}

.export-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(97, 216, 210, 0.92), rgba(255, 223, 91, 0.92));
  transition: width 160ms linear;
}

.export-status-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.export-status-cancel {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 107, 97, 0.62);
  border-radius: 4px;
  background: rgba(52, 17, 16, 0.72);
  color: #ffb3ac;
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
}

.export-status-cancel:hover:not(:disabled) {
  border-color: #ffb3ac;
  color: #ffd0cc;
}

.export-status-cancel:disabled {
  cursor: default;
  opacity: 0.55;
}

.export-status-cancel[hidden] {
  display: none;
}

.prompt-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.prompt-box {
  position: relative;
  display: block;
  min-height: 0;
  height: 100%;
}

.prompt-field textarea {
  height: 100%;
  min-height: 0;
  padding-bottom: 44px;
  resize: none;
}

.frame-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  height: 82px;
  min-height: 82px;
  overflow: hidden;
}

.frame-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.frame-actions button,
.style-actions button,
.character-sheet-dialog button {
  min-height: 28px;
  min-width: 74px;
  padding: 0 10px;
  border: 1px solid rgba(97, 216, 210, 0.55);
  border-radius: 4px;
  background: rgba(11, 16, 20, 0.86);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.frame-actions button:hover:not(:disabled),
.style-actions button:hover:not(:disabled),
.character-sheet-dialog button:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

.frame-actions button:disabled,
.style-actions button:disabled,
.character-sheet-dialog button:disabled {
  cursor: default;
  opacity: 0.38;
}

.camera-prompt-chips {
  display: grid;
  grid-template-rows: 28px 48px;
  gap: 3px;
  align-items: start;
  align-content: start;
  flex: 1 1 auto;
  min-width: 0;
  height: 80px;
  max-height: 80px;
  overflow: hidden;
}

.prompt-tool-tabs,
.prompt-tool-chip-row {
  display: flex;
  box-sizing: border-box;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.prompt-tool-tabs {
  gap: 0;
  height: 28px;
  min-height: 28px;
  padding-top: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(97, 216, 210, 0.2);
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.prompt-tool-tabs::-webkit-scrollbar {
  display: none;
}

.prompt-tool-tab-spacer {
  flex: 1 0 14px;
  min-width: 14px;
}

.prompt-tool-chip-row {
  flex-wrap: wrap;
  align-content: flex-start;
  row-gap: 4px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
}

#aiPromptButton {
  position: absolute;
  right: var(--clip-button-edge);
  bottom: var(--clip-button-edge);
  z-index: 2;
  width: auto;
  height: var(--clip-button-height);
  min-height: 0;
  min-width: 0;
  padding: 0 var(--clip-button-pad-x);
  border: 1px solid rgba(97, 216, 210, 0.45);
  border-radius: var(--clip-button-radius);
  background: rgba(11, 16, 20, 0.82);
  color: var(--cyan);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
  transform: none;
}

.prompt-box.has-scrollbar #aiPromptButton {
  right: calc(var(--clip-button-edge) + var(--field-scrollbar-space));
}

#aiPromptButton:hover:not(:disabled) {
  border-color: var(--yellow);
  color: var(--yellow);
}

#aiPromptButton:active {
  transform: none;
  box-shadow: none;
}

.prompt-tool-chip-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  box-sizing: border-box;
  min-width: 0;
  min-height: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  border-color: rgba(97, 216, 210, 0.42);
  background: rgba(7, 13, 17, 0.9);
  color: rgba(177, 232, 225, 0.84);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.prompt-tool-tabs button {
  flex: 0 0 auto;
  height: 18px;
  min-height: 18px;
  min-width: max-content;
  padding: 0 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(177, 232, 225, 0.62);
  box-shadow: none;
  font: 800 11px/1 "Courier New", monospace;
  cursor: pointer;
}

.prompt-tool-tabs button.is-active {
  color: var(--yellow);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prompt-tool-tabs button.prompt-tool-edit {
  flex: 0 0 auto;
  position: sticky;
  right: 0;
  z-index: 2;
  margin-top: 0;
  height: 18px;
  padding: 0 7px;
  border: 1px solid rgba(97, 216, 210, 0.38);
  border-radius: 4px;
  background: #111820;
  color: rgba(97, 216, 210, 0.78);
  font-size: 9px;
  text-decoration: none;
}

.prompt-tool-tabs button.prompt-tool-edit:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

@media (min-width: 1320px) {
  .prompt-tool-chip-row {
    max-height: 54px;
  }
}

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

  .workspace {
    grid-template-rows: var(--timeline-panel-height) 8px minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .preview {
    min-height: 0;
  }
}
