.studio-page {
  min-height: 100vh;
}
#brief-ref-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.studio-brief-ref {
  min-width: 0;
  padding: 8px;
  background: var(--raised);
  border-radius: 12px;
}
.studio-brief-ref img {
  width: 100%;
  height: 104px;
  object-fit: contain;
  background: var(--canvas);
  border-radius: 8px;
}
.studio-brief-ref > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  margin: 8px 0;
}
.studio-brief-ref select,
.studio-pick-ref select {
  width: 100%;
  border: 1px solid #393939;
  background: var(--raised);
  color: var(--text);
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
}
.studio-brief-ref button {
  margin-top: 6px;
  font-size: 12px;
}
.studio-pick-ref {
  min-width: 0;
}
.studio-pick-ref select:disabled {
  opacity: 0.35;
}
#film-quality {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: var(--raised);
  color: var(--text);
  border: 1px solid #444;
}
.studio-header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
}
.studio-project {
  color: var(--muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 30px;
  margin: auto;
}
.workspace-switch a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 24px;
  color: var(--muted);
  font-size: 13px;
}
.workspace-switch .active {
  color: var(--text);
  background: var(--raised);
}
.studio-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}
.studio-library {
  border-right: 1px solid var(--raised);
  padding: 25px 16px;
  display: flex;
  flex-direction: column;
}
.studio-library-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 9px;
  color: var(--muted);
}
.studio-film {
  display: block;
  padding: 15px 10px;
  border-radius: 10px;
  margin-top: 5px;
}
.studio-film:hover,
.studio-film.active {
  background: var(--raised);
}
.studio-film strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.studio-film small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.studio-library-note {
  color: #666;
  font-size: 12px;
  line-height: 1.8;
  margin-top: auto;
  padding-top: 40px;
}
#studio-body {
  padding: 36px 40px;
  min-width: 0;
}
.studio-intro {
  text-align: center;
  margin: 45px 0 32px;
}
.studio-intro h1 {
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -1.1px;
  margin: 15px 0;
}
.studio-intro p {
  line-height: 1.8;
}
.studio-brief {
  max-width: 840px;
  margin: auto;
  background: var(--panel);
  border: 1px solid var(--raised);
  border-radius: 20px;
  padding: 28px;
}
.studio-page textarea,
.studio-page
  input:not([type="checkbox"]):not([type="range"]):not([type="file"]),
.studio-page select,
#studio-key,
.studio-image-picker ~ input,
#ref-prompt {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  width: 100%;
  color: var(--text);
}
.studio-page textarea {
  resize: vertical;
  line-height: 1.6;
}
.studio-page label {
  display: block;
  color: #bcbcbc;
  font-size: 12px;
  line-height: 1.6;
}
.studio-page label input,
.studio-page label select,
.studio-page label textarea {
  margin-top: 7px;
}
.studio-fields {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}
.studio-fields > label {
  flex: 1;
  min-width: 0;
}
.studio-options {
  margin-top: 23px;
  padding: 17px 0;
  border-top: 1px solid var(--raised);
  border-bottom: 1px solid var(--raised);
}
.studio-options summary {
  cursor: pointer;
  color: #d4d4d4;
  font-size: 13px;
}
.studio-options summary span {
  float: right;
  color: var(--subtle);
  font-size: 12px;
}
.studio-page .studio-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
}
.studio-check input {
  accent-color: var(--text);
  margin: 0 !important;
}
.studio-brief-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 23px;
}
.studio-brief-bottom .muted {
  font-size: 12px;
}
.studio-ref-label {
  display: inline-block;
  font-size: 12px;
  background: var(--raised);
  border-radius: 6px;
  padding: 6px;
  margin: 4px;
}
.studio-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.studio-title h1 {
  font-size: 27px;
  font-weight: 500;
  margin: 10px 0;
}
.studio-title p {
  font-size: 12px;
}
.studio-title .eyebrow {
  font-size: 12px;
}
#film-actions {
  display: flex;
  gap: 10px;
}
.studio-pipeline {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--raised);
  border-radius: 12px;
  padding: 15px 20px;
  margin: 23px 0 0;
}
.studio-pipeline > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #727272;
  white-space: nowrap;
}
.studio-pipeline b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 12px;
  border: 1px solid #393939;
  border-radius: 50%;
  font-weight: 400;
}
.studio-pipeline .current {
  color: var(--text);
}
.studio-pipeline .current b {
  background: var(--text);
  color: var(--canvas);
  border-color: var(--text);
}
.studio-pipeline .done {
  color: #b2b2b2;
}
.studio-pipeline small {
  margin-left: auto;
  color: var(--subtle);
  font-size: 12px;
}
.studio-error {
  color: #ef9a9a;
  line-height: 1.6;
  font-size: 12px;
}
.studio-error:empty {
  display: none;
}
.studio-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin-top: 25px;
}
.studio-preview {
  background: var(--canvas);
  border: 1px solid var(--raised);
  border-radius: 14px;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.studio-preview > div {
  max-width: 380px;
  padding: 20px;
  text-align: center;
  color: #9a9a9a;
  line-height: 1.7;
}
.studio-preview .icon {
  width: 42px;
  height: 42px;
  opacity: 0.4;
}
.studio-preview video {
  width: 100%;
  height: 100%;
  max-height: 490px;
  object-fit: contain;
}
.studio-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 9px;
}
.studio-timeline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  gap: 10px;
}
.studio-timeline-heading h2,
.studio-inspector h2 {
  font-weight: 500;
  font-size: 15px;
}
.studio-timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 18px;
  min-height: 153px;
}
.studio-shot {
  flex: 0 0 var(--clip-width);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  text-align: left;
  max-width: 180px;
  overflow: hidden;
}
.studio-shot.selected {
  outline: 1px solid #c2c2c2;
  outline-offset: -1px;
  background: var(--raised);
}
.studio-shot-art {
  height: 75px;
  background: #121212;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 5px;
  overflow: hidden;
}
.studio-shot-art video {
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.studio-shot-art b {
  position: absolute;
  top: 5px;
  left: 6px;
  background: #111a;
  padding: 2px 4px;
  font-size: 12px;
  border-radius: 4px;
}
.studio-shot strong {
  display: block;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 4px 5px;
}
.studio-shot small {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}
.studio-inspector {
  border-left: 1px solid #282828;
  padding-left: 22px;
}
.studio-inspector > p {
  line-height: 1.6;
}
.studio-inspector form > label {
  margin-top: 15px;
}
.studio-inspector fieldset {
  border: 0;
  border-top: 1px solid #282828;
  padding: 12px 0;
  margin: 17px 0 0;
}
.studio-inspector legend {
  font-size: 12px;
  color: #bcbcbc;
  padding-right: 8px;
}
.studio-inspector .studio-check {
  margin-top: 5px;
}
.studio-trim {
  display: flex;
  gap: 12px;
}
.studio-trim label {
  width: 50%;
}
.studio-scene-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.studio-scene-actions button {
  justify-content: center;
}
.studio-scene-order {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #282828;
  padding-top: 10px;
}
.studio-music-track {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1a;
  border: 1px dashed #3a3a3a;
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12px;
}
.studio-music-track span {
  margin-right: auto;
  color: var(--muted);
}
.studio-music-track label {
  cursor: pointer;
}
.studio-music-controls {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 10px;
}
.studio-music-controls audio {
  height: 32px;
  max-width: 65%;
}
.studio-story {
  border-top: 1px solid var(--raised);
  margin-top: 32px;
  padding: 20px 0;
}
.studio-story summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.studio-story p {
  max-width: 900px;
  line-height: 1.7;
  font-size: 13px;
}
.studio-reference-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.studio-reference-grid article {
  width: 145px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
}
.studio-reference-grid img,
.studio-reference-pending {
  height: 100px;
  width: 145px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--raised);
  display: grid;
  place-items: center;
}
.studio-reference-grid small {
  color: var(--muted);
}
.studio-image-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  margin-bottom: 15px;
}
.studio-image-picker label {
  position: relative;
  cursor: pointer;
}
.studio-image-picker img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}
.studio-image-picker input {
  position: absolute;
  top: 8px;
  left: 8px;
  accent-color: var(--text);
}
.studio-image-picker span {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.studio-wait {
  margin: auto;
  color: var(--subtle);
  font-size: 12px;
  text-align: center;
}
#studio-form-error {
  color: #ef9a9a;
  font-size: 13px;
}
#studio-key {
  margin: 10px 0;
}
.studio-work {
  max-width: 1600px;
  margin: auto;
}
@media (min-width: 1700px) {
  .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .studio-preview {
    max-height: 540px;
  }
  .studio-intro {
    margin-top: 80px;
  }
}
@media (max-width: 1150px) {
  .studio-layout {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  #studio-body {
    padding: 26px 22px;
  }
  .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
  }
  .studio-pipeline {
    gap: 12px;
  }
  .studio-pipeline small {
    display: none;
  }
  .studio-header {
    gap: 12px;
    padding: 0 18px;
  }
  .studio-project {
    display: none;
  }
  .studio-title {
    align-items: flex-start;
  }
  .studio-title h1 {
    font-size: 23px;
  }
  .studio-brief {
    padding: 22px;
  }
  .studio-intro h1 {
    font-size: 31px;
  }
}
@media (max-width: 850px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-library {
    border-right: 0;
    border-bottom: 1px solid var(--raised);
    padding: 12px 18px;
    display: block;
  }
  .studio-library-title {
    display: inline-flex;
    gap: 20px;
  }
  #studio-films {
    display: flex;
    overflow: auto;
    gap: 10px;
  }
  .studio-film {
    min-width: 150px;
  }
  .studio-library-note {
    display: none;
  }
  .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-inspector {
    border-left: 0;
    border-top: 1px solid #282828;
    padding: 20px 0;
  }
  .studio-header .brand span,
  .studio-header .pool-pill {
    display: none;
  }
  .workspace-switch {
    margin: auto;
  }
  .studio-fields {
    flex-wrap: wrap;
  }
  .studio-fields > label {
    min-width: 40%;
  }
  .studio-title {
    flex-wrap: wrap;
  }
  .studio-intro {
    margin-top: 20px;
  }
  .studio-intro h1 {
    font-size: 27px;
  }
  .studio-brief-bottom {
    align-items: stretch;
    flex-direction: column;
  }
  .studio-timeline-heading .small {
    display: none;
  }
  .studio-options summary span {
    display: none;
  }
  .studio-pipeline {
    gap: 9px;
    padding: 12px;
    overflow: auto;
  }
  .studio-pipeline > span {
    font-size: 12px;
  }
  .studio-pipeline b {
    width: 18px;
    height: 18px;
  }
  .studio-image-picker {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 520px) {
  .studio-header {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    padding: 12px 18px;
  }
  .studio-header #studio-connect {
    margin-left: auto;
  }
  .studio-header .workspace-switch {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .studio-edit-layout > div {
    min-width: 0;
  }
  .studio-transport,
  .studio-music-controls {
    flex-wrap: wrap;
    gap: 12px;
  }
  .studio-music-track {
    flex-wrap: wrap;
  }
  .studio-music-track > span {
    overflow-wrap: anywhere;
    min-width: 0;
  }
}
.studio-key-status {
  border: 1px solid #383838;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  background: var(--panel);
}
.studio-key-status p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.studio-key-status small {
  color: var(--subtle);
}
.studio-beat summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.studio-beat p {
  line-height: 1.6;
  max-height: 180px;
  overflow: auto;
}

.studio-seek {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
}
.studio-seek output {
  min-width: 44px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.studio-seek input {
  flex: 1;
  accent-color: var(--text);
}
.studio-timeline-trim {
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 12px;
}
.studio-timeline-trim:empty {
  display: none;
}
.studio-trim-ranges {
  display: flex;
  gap: 24px;
  margin-top: 10px;
}
.studio-trim-ranges label {
  flex: 1;
  font-size: 12px;
}
.studio-trim-ranges output {
  float: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.studio-trim-ranges input {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  accent-color: var(--text);
}
#video-download-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-view-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
}
.studio-view-tabs button[aria-pressed="true"] {
  background: var(--text);
  color: var(--panel);
}
#studio-montage[hidden],
#studio-board[hidden] {
  display: none;
}
.studio-board-intro h2 {
  font-size: 19px;
  font-weight: 500;
}
.studio-board-intro p {
  line-height: 1.6;
}
.studio-board-cards {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.studio-board-card {
  background: var(--panel);
  border: 1px solid var(--raised);
  border-radius: 14px;
  padding: 18px;
}
.studio-board-card.selected {
  border-color: var(--subtle);
}
.studio-board-card-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.studio-board-card h3 {
  margin: 12px 0 8px;
  font-weight: 500;
}
.studio-board-card p {
  line-height: 1.6;
  font-size: 13px;
}
.studio-board-refs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.studio-board-refs img {
  width: 54px;
  height: 44px;
  object-fit: cover;
  border-radius: 7px;
}
.studio-board-card details {
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.studio-board-prompt {
  white-space: pre-wrap;
  color: var(--muted);
}

/* Studio shares the manual workspace shell; only this central surface changes. */
.gallery-main.studio-page {
  min-height: 0;
  padding: 18px 28px 48px 14px;
}
.composer-wrap[hidden] {
  display: none !important;
}
.studio-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.studio-toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.studio-toolbar-title strong {
  font-size: 18px;
  font-weight: 550;
}
.studio-toolbar-title .muted {
  font-size: 12px;
  margin-left: 10px;
}
.studio-film-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--raised);
}
.studio-film-strip .studio-film {
  flex: 0 0 174px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  background: var(--panel);
  border-radius: 14px;
}
.studio-film-strip .studio-film.active {
  background: var(--line);
}
.studio-film-strip .studio-film strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-page.large .studio-film {
  flex-basis: 230px;
  padding: 18px;
}
.studio-page #studio-body {
  padding: 24px 0 0;
}
.studio-page .studio-intro {
  margin: 44px auto 26px;
  max-width: 700px;
  text-align: left;
}
.studio-page .studio-intro h1 {
  font-size: 30px;
  margin: 10px 0;
  letter-spacing: -0.8px;
}
.studio-page .studio-intro .eyebrow {
  display: none;
}
.studio-page .studio-intro p {
  font-size: 13px;
  line-height: 1.7;
}
.studio-page .studio-brief {
  max-width: 700px;
  border: 0;
  background: var(--panel);
  border-radius: 22px;
  padding: 24px;
}
.studio-page .studio-brief > .field-label {
  display: none;
}
.studio-page #film-prompt {
  background: transparent;
  border: 0;
  padding: 0 0 14px;
  min-height: 130px;
  font-size: 15px;
  resize: vertical;
  outline-offset: 8px;
}
.studio-page .studio-brief .studio-fields {
  gap: 10px;
  margin-top: 16px;
}
.studio-page .studio-brief select,
.studio-page .studio-brief input[type="number"] {
  border: 0;
  border-radius: 13px;
  background: var(--raised);
  padding: 10px;
}
.studio-page .studio-options {
  border-bottom: 0;
  padding-bottom: 0;
}
.studio-page .studio-brief-bottom {
  border-top: 1px solid var(--raised);
  padding-top: 18px;
}
.studio-page .studio-pipeline {
  border: 0;
  border-radius: 15px;
  background: var(--panel);
  margin-top: 18px;
}
.studio-page .studio-edit-layout {
  margin-top: 18px;
  gap: 20px;
}
.studio-page .studio-inspector {
  background: var(--panel);
  border: 0;
  border-radius: 16px;
  padding: 18px;
  align-self: start;
}
.studio-page .studio-preview {
  border: 0;
  border-radius: 16px;
  background: var(--panel);
}
.studio-page .studio-shot {
  border-radius: 12px;
}
.studio-page .studio-music-track {
  border: 0;
  border-radius: 12px;
  background: var(--panel);
}
.studio-page #film-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.studio-page .studio-board-cards article {
  border: 0;
  border-radius: 16px;
  background: var(--panel);
}
@media (max-width: 1100px) {
  .studio-toolbar-title .muted {
    display: none;
  }
  .gallery-main.studio-page {
    padding: 14px 18px 36px 8px;
  }
}
@media (max-width: 600px) {
  .gallery-main.studio-page {
    padding: 12px 12px 32px 8px;
  }
  .studio-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .studio-toolbar-title {
    flex-basis: 100%;
  }
  .studio-page .studio-brief {
    padding: 18px;
  }
  .studio-page .studio-intro {
    margin-top: 24px;
  }
  .studio-page .studio-intro h1 {
    font-size: 24px;
  }
  .studio-film-strip .studio-film {
    flex-basis: 150px;
  }
}

/* Compact time-based editor: video and music share one ruler and playhead. */
.studio-page .studio-timeline {
  display: block;
  overflow: visible;
  padding: 0;
  background: var(--panel);
  border-radius: 14px;
  min-width: 0;
}
.studio-page .tl-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  flex-wrap: wrap;
}
.studio-page .tl-toolbar button {
  padding: 7px 10px;
  font-size: 12px;
  min-height: 30px;
}
.tl-clock {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  min-width: 115px;
  color: var(--muted);
}
.tl-spacer {
  flex: 1;
}
.tl-toolbar [aria-pressed="true"] {
  background: #dedede;
  color: var(--panel);
}
.tl-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 14px;
  scrollbar-width: thin;
}
.tl-canvas {
  position: relative;
  min-height: 190px;
  padding-bottom: 12px;
  touch-action: pan-y;
}
.tl-ruler {
  position: relative;
  height: 32px;
  border-bottom: 1px solid var(--line);
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}
.tl-tick {
  position: absolute;
  top: 7px;
  font-size: 12px;
  color: var(--subtle);
  white-space: nowrap;
  border-left: 1px solid #666;
  height: 25px;
  padding-left: 4px;
  pointer-events: none;
}
.tl-video-track {
  position: relative;
  height: 95px;
  margin-top: 7px;
}
.tl-clip {
  position: absolute;
  top: 0;
  height: 90px;
  border: 1px solid #414141;
  border-radius: 8px;
  background: var(--raised);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  min-width: 0;
}
.tl-clip.selected {
  border: 2px solid var(--text);
}
.tl-clip-art {
  height: 54px;
  overflow: hidden;
  pointer-events: none;
}
.tl-clip-art video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.tl-clip-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  padding: 2px 9px;
  pointer-events: none;
}
.tl-clip small {
  display: block;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.tl-pending {
  font-size: 12px;
  color: var(--muted);
  padding: 8px;
  display: block;
}
.tl-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  border: 0;
  border-radius: 0;
  background: rgba(235, 235, 235, 0.45);
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
  padding: 0;
  opacity: 0;
}
.tl-handle:after {
  content: "";
  position: absolute;
  top: 36%;
  bottom: 36%;
  left: 4px;
  width: 1px;
  background: var(--panel);
}
.tl-handle.left {
  left: 0;
}
.tl-handle.right {
  right: 0;
}
.selected .tl-handle,
.tl-clip:hover .tl-handle,
.tl-audio-clip:hover .tl-handle,
.tl-handle:focus {
  opacity: 1;
}
.tl-handle:disabled {
  display: none;
}
.tl-audio-track {
  position: relative;
  height: 48px;
  margin: 4px 0 0;
  border-top: 1px solid #262626;
}
.tl-audio-clip {
  position: absolute;
  top: 4px;
  height: 42px;
  background: var(--line);
  border: 1px solid #666;
  border-radius: 7px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}
.tl-audio-clip.selected {
  border: 2px solid var(--text);
}
.tl-audio-clip span,
.tl-audio-clip small {
  display: block;
  padding: 4px 12px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  pointer-events: none;
}
.tl-audio-clip small {
  font-size: 12px;
  color: var(--muted);
  padding-top: 2px;
}
.tl-add-music {
  height: 43px;
  min-width: 220px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 2px;
  background: #fff;
  z-index: 5;
  cursor: ew-resize;
  touch-action: none;
  outline-offset: 5px;
}
.tl-playhead b {
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 13px;
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
}
.tl-snap-guide {
  position: absolute;
  top: 30px;
  bottom: 8px;
  width: 1px;
  background: var(--muted);
  z-index: 4;
  pointer-events: none;
}
.tl-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--raised);
}
.tl-footer > span {
  color: var(--subtle);
  font-size: 12px;
  flex: 1 1 230px;
}
.studio-page .tl-footer label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.studio-page .tl-footer input {
  width: 85px;
  margin: 0;
  accent-color: var(--text);
}
.studio-page .tl-footer button {
  padding: 6px 9px;
  font-size: 12px;
}
.studio-page #studio-music[hidden] {
  display: none;
}
.studio-page .studio-preview {
  max-height: 420px;
}
.studio-page .studio-preview video {
  max-height: 420px;
  object-fit: contain;
}
.studio-page .studio-inspector #scene-form .studio-trim {
  display: none;
}
@media (max-width: 600px) {
  .tl-toolbar .tl-clock {
    min-width: 100px;
  }
  .tl-handle {
    opacity: 1;
    width: 12px;
  }
  .studio-page .studio-preview,
  .studio-page .studio-preview video {
    max-height: 270px;
  }
  .tl-footer > span {
    flex-basis: 100%;
  }
}
.studio-edit-layout #studio-timeline-panel {
  grid-column: 1 / -1;
  min-width: 0;
}
#studio-timeline-panel[hidden] {
  display: none;
}
.studio-page .montage-mode .studio-inspector {
  max-height: 420px;
  overflow: auto;
  scrollbar-width: thin;
}
.studio-page .montage-mode .studio-edit-layout {
  align-items: start;
}
@media (max-width: 1100px) {
  .studio-page .montage-mode .studio-inspector {
    max-height: 340px;
  }
}
/* One aligned workspace and a centered viewer, with compact film metadata. */
.studio-page .studio-toolbar,
.studio-page .studio-film-carousel,
.studio-page #studio-body {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}
.studio-page .studio-title {
  gap: 14px;
  flex-wrap: wrap;
}
.studio-page .studio-title > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.studio-page .studio-title h1 {
  font-size: 21px;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.3px;
}
.studio-page .studio-title .film-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.studio-page #film-error:empty {
  display: none;
}
.studio-page .studio-pipeline {
  margin-top: 14px;
}
.studio-page .studio-preview {
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
}
.studio-page .studio-transport {
  max-width: 760px;
  margin: 9px auto 0;
}
.studio-page .studio-timeline-heading {
  margin-top: 0;
}
.studio-page .studio-edit-layout {
  gap: 18px 24px;
}
@media (max-width: 600px) {
  .studio-page .studio-title h1 {
    font-size: 19px;
  }
  .studio-page .studio-title .film-meta {
    font-size: 12px;
  }
  .studio-page .studio-title > div:first-child {
    gap: 5px;
  }
}
.studio-page .studio-edit-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 18px 22px;
}
.studio-page .studio-view-tabs {
  justify-content: center;
}
.studio-page .studio-transport {
  justify-content: center;
  margin-top: 8px;
}
.studio-page .studio-inspector {
  width: 100%;
}
@media (min-width: 1900px) {
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
  }
}
@media (max-width: 1100px) {
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
@media (max-width: 800px) {
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-page .studio-inspector {
    max-width: none;
  }
  .studio-page #studio-timeline-panel {
    grid-row: 2;
  }
  .studio-page .studio-inspector {
    grid-row: 3;
  }
}
.studio-film-strip .studio-film {
  padding: 8px;
  flex-basis: 174px;
  position: relative;
}
.studio-film-carousel {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--raised);
  padding-bottom: 14px;
}
.studio-film-carousel .studio-film-strip {
  scrollbar-width: none;
  padding-bottom: 0;
  border-bottom: 0;
  min-width: 0;
  overscroll-behavior-x: contain;
}
.studio-film-strip::-webkit-scrollbar {
  display: none;
}
.studio-film > a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.studio-film-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 40px;
  background: #191919;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
}
.studio-film-arrow:hover:not(:disabled) {
  background: var(--line);
  color: white;
}
.studio-film-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
.studio-film-arrow.previous .icon {
  transform: rotate(90deg);
}
.studio-film-arrow.next .icon {
  transform: rotate(-90deg);
}
.studio-film-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  background: #202020c9;
  border-radius: 50%;
  color: var(--text);
}
.studio-film-delete .icon {
  width: 14px;
  height: 14px;
}
.studio-trash-film {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--raised);
}
.studio-trash-film strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.studio-trash-film button {
  flex-shrink: 0;
}
.studio-film-purge {
  color: #d6a4a4;
  gap: 6px;
}
.studio-film-purge .icon {
  width: 14px;
  height: 14px;
}
.studio-film-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 78px;
  margin-bottom: 8px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--raised);
  color: #666;
}
.studio-film-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.studio-film-strip .studio-film strong,
.studio-film-strip .studio-film small {
  padding: 0 5px;
}
.studio-film-strip .studio-film strong {
  font-size: 12px;
}
.studio-page.large .studio-film-cover {
  height: 110px;
}
/* Film controls share a row; the viewer and inspector occupy 60/40. */
.studio-page .studio-film-controls {
  display: contents;
}
.studio-page .studio-title {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(max-content, 1fr) auto;
  align-items: center;
  gap: 18px;
}
.studio-page .studio-title > div:first-child {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.studio-page .studio-film-controls .studio-view-tabs {
  margin: 0;
  align-items: center;
  justify-self: center;
  padding: 4px;
  gap: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.studio-page .studio-view-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.studio-page .studio-view-tabs button:hover {
  background: var(--raised);
  color: var(--text);
}
.studio-page .studio-view-tabs button[aria-pressed="true"] {
  background: #eaeaea;
  color: var(--panel);
  box-shadow: 0 1px 4px #0004;
}
.studio-page .studio-view-tabs .icon {
  width: 15px;
  height: 15px;
}
.studio-page .studio-edit-layout {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: stretch;
}
.studio-page .studio-preview {
  width: 100%;
  max-height: 560px;
  margin: 0;
}
.studio-page .studio-preview video {
  max-height: 560px;
}
.studio-page .montage-mode .studio-inspector {
  contain: size;
  align-self: stretch;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
}
.studio-timeline-notes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  font-size: 12px;
}
@media (max-width: 800px) {
  .studio-page .studio-title {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .studio-page .studio-title > div:first-child {
    grid-column: 1 / -1;
  }
  .studio-page .studio-film-controls .studio-view-tabs {
    justify-self: start;
  }
  .studio-page .studio-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-page .montage-mode .studio-inspector {
    contain: none;
    max-height: 420px;
  }
  .studio-page .studio-film-controls {
    margin-left: 0;
    gap: 8px;
  }
}
@media (max-width: 600px) {
  .studio-page .studio-title {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-page .studio-film-controls .studio-view-tabs {
    justify-self: center;
  }
  .studio-page #film-actions {
    justify-content: center;
  }
}
.studio-page .studio-brief.studio-create-form {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 20px;
  max-width: none;
  padding: 0;
  background: transparent;
}
.studio-create-heading {
  margin: 0 0 20px;
}
.studio-create-heading h1 {
  font-size: 23px;
  font-weight: 500;
  margin: 0 0 7px;
}
.studio-create-heading p {
  margin: 0;
  font-size: 13px;
}
.studio-create-card {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px;
  min-width: 0;
}
.studio-create-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.studio-create-card-heading .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.studio-create-card-heading h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}
.studio-create-idea {
  display: flex;
  flex-direction: column;
  align-self: start;
}
.studio-page .studio-create-form #film-prompt {
  border: 1px solid #323232;
  border-radius: 13px;
  padding: 15px;
  background: var(--panel);
  margin-top: 8px;
  min-height: 190px;
  height: 300px;
  flex: none;
}
@media (min-width: 1001px) {
  .studio-create-settings {
    /* The idea card defines the row height; settings scroll within that row. */
    contain: size;
    min-height: 0;
    align-self: stretch;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #626262 transparent;
  }
}
.studio-create-form .studio-fields {
  margin-top: 0;
}
.studio-create-form .studio-film-name,
.studio-create-form .studio-workflow-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
}
.studio-create-form .studio-model-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.studio-create-form .studio-film-name input {
  padding: 11px 12px;
  border: 1px solid #323232;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .studio-create-form .studio-model-fields {
    grid-template-columns: 1fr;
  }
}
.studio-create-form .field-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.studio-choice-field {
  margin-top: 18px;
}
.studio-choices {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: var(--raised);
}
.studio-choices button {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 10px 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.studio-choices button[aria-pressed="true"] {
  background: #e7e7e7;
  color: var(--canvas);
}
.studio-choices button:hover:not([aria-pressed="true"]) {
  background: var(--line);
  color: var(--text);
}
.studio-creative-style {
  margin: 0 0 20px;
}
.studio-seconds {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.studio-second-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding-top: 14px;
}
.studio-second-time {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.studio-second-row textarea {
  margin-top: 6px;
  width: 100%;
}
.studio-style-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.studio-style-cards button {
  display: grid;
  grid-template-columns: 22px 1fr;
  text-align: left;
  gap: 7px 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raised);
  padding: 13px;
  color: var(--muted);
  cursor: pointer;
}
.studio-style-cards strong {
  font-size: 13px;
  font-weight: 500;
  align-self: center;
}
.studio-style-cards .icon {
  width: 18px;
  height: 18px;
}
.studio-style-cards small {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.4;
}
.studio-style-cards button[aria-pressed="true"] {
  background: #2e2e2e;
  border-color: var(--muted);
  color: white;
}
.studio-create-extra {
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--raised);
}
.studio-create-extra summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.studio-create-extra .studio-fields {
  margin-top: 14px;
}
.studio-create-path {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  color: var(--subtle);
  font-size: 12px;
}
.studio-create-path span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.studio-create-path .icon {
  width: 14px;
  height: 14px;
}
.studio-create-materials {
  grid-column: 1 / -1;
}
.studio-create-materials-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.studio-create-materials-head .studio-create-card-heading {
  margin-bottom: 0;
}
.studio-create-materials-head .studio-check {
  margin-top: 0;
}
.studio-create-materials > p {
  margin: 12px 0 18px;
}
.studio-create-materials #brief-ref-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.studio-create-materials .studio-brief-ref {
  padding: 9px;
  border-radius: 13px;
  background: var(--raised);
}
.studio-create-materials .studio-brief-ref img {
  height: 110px;
}
.studio-create-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 0;
}
.studio-create-footer #film-estimate {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.studio-create-footer .studio-check {
  margin-top: 10px;
  font-size: 12px;
}
.studio-create-footer .primary-button {
  padding: 13px 20px;
  white-space: nowrap;
}
.studio-create-form #studio-form-error {
  grid-column: 1 / -1;
  margin: 0;
}
.studio-create-form #studio-form-error:empty {
  display: none;
}
.tl-volume-level {
  min-width: 32px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1000px) {
  .studio-page .studio-brief.studio-create-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .studio-create-card {
    padding: 18px;
  }
  .studio-style-cards {
    gap: 6px;
  }
  .studio-style-cards button {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .studio-create-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .studio-create-footer .primary-button {
    justify-content: center;
  }
}
#studio-export .artifact-expiry {
  position: static;
  display: inline-block;
  margin-top: 8px;
}
