:root {
  --coral: #ff957a;
  --coral-light: #ffc3b0;
  --studio-line: #32324c;
}
.workspace {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 68% 520px at 92% 0%, #4526709c, transparent 72%),
    radial-gradient(ellipse 61% 650px at 16% 11%, #123555a6, transparent 72%),
    radial-gradient(ellipse 70% 700px at 101% 40%, #28226672, transparent 70%), #0a0b17;
}
.workspace::before, .workspace::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: -1;
}
.workspace::before {
  inset: 0;
  background-image: radial-gradient(#b2c9ff66 1px, transparent 1px), radial-gradient(#c0adff4d 1px, transparent 1px);
  background-position: 2px 9px, 19px 25px;
  background-size: 31px 31px, 62px 62px;
  mask-image: linear-gradient(black 0, #0006 570px, transparent 1000px);
}
.workspace::after {
  inset: 66px 0 auto;
  height: 450px;
  background:
    repeating-linear-gradient(111deg, transparent 0 67px, #adacff12 68px 69px, transparent 70px 153px),
    linear-gradient(159deg, transparent 31%, #6a59e729 47%, #9074ff56 48%, #65e3ff12 49.3%, transparent 61%);
  mask-image: linear-gradient(black, transparent 90%);
}
.topbar { background: #0b0d1bda; }
.main { max-width: 1232px; }
.studio-intro { padding: 6px 4px 6px; margin-bottom: 22px; }
.studio-intro::before {
  content: "";
  position: absolute;
  pointer-events: none;
  width: min(54%, 510px);
  height: 175px;
  top: -33px;
  right: 6px;
  z-index: -1;
  background:
    radial-gradient(ellipse at 72% 54%, transparent 24%, #7b90f253 25%, transparent 26% 35%, #a879eb82 35.8%, transparent 37.4% 44%, #718cff49 44.5%, transparent 45.5%),
    radial-gradient(ellipse at 75% 57%, #754fdd51, transparent 65%);
  transform: rotate(-13deg);
  mask-image: linear-gradient(90deg, transparent, black 36%);
}
.studio-intro .eyebrow {
  background: #1e29469e;
  color: #bef2ff;
  border: 1px solid #5869949e;
}
.studio-intro .intro-line h1 { font-size: clamp(34px, 4.3vw, 57px); }
.studio-intro .intro-line h1 span {
  background-image: linear-gradient(105deg, #a1eaff, #ada2ff 63%, #d6a3fa);
  text-shadow: 0 0 40px #b690ff41;
}
.studio-intro .intro-line p { color: #bfc6e3; }
.creator {
  position: relative;
  border-color: #484163;
  background: linear-gradient(145deg, #161a2ceb, #141424f7 62%);
  box-shadow: 0 22px 65px #04041078, 0 0 32px #6349b126;
  border-radius: 15px;
}
.creator::before {
  position: absolute;
  content: "";
  height: 1px;
  inset: 0 12% auto;
  background: linear-gradient(90deg, transparent, #a5e5ff, #bc90ff, transparent);
  opacity: .72;
}
.creator-head {
  padding: 13px 20px;
  min-height: 63px;
  border-color: var(--studio-line);
  background: linear-gradient(90deg, #222b44b0, #251a364a 75%);
}
.creator-head .panel-icon { width: 32px; height: 32px; }
.creator-head .mode-switch { margin: 0; width: min(100%, 234px); }
.creator-head .mode-switch button { height: 29px; white-space: nowrap; }
.creator-head .mode-switch .selected {
  color: #ffe0d6;
  border-color: #9b635d91;
  background: linear-gradient(100deg, #4a303b, #392c42);
}
#composer { padding: 16px 20px 17px; }
.composition { padding-bottom: 13px; }
.composition .prompt-label { align-items: center; margin: 0 0 8px; gap: 6px; }
.composition .field-label { margin: 0; }
.field-label[for="prompt"] { color: #ebedff; font-size: 13px; }
.prompt-actions { display: flex; align-items: center; gap: 11px; white-space: nowrap; color: #9ea8ca; font-size: 11px; }
.prompt-actions #prompt-count { color: #b1b8d8; font: 10px var(--mono); }
.prompt-actions .link-btn { color: var(--coral-light); }
#prompt {
  display: block;
  width: 100%;
  min-height: 110px;
  max-height: 370px;
  resize: vertical;
  border: 1px solid #353651;
  border-radius: 8px;
  padding: 12px 13px;
  background: linear-gradient(120deg, #0d1424d9, #0f101deb);
  color: #eff2ff;
  line-height: 1.7;
  font-size: 14px;
}
#prompt:focus { border-color: #8381bb; }
.reference-section { margin-top: 10px; }
.reference-tiles { display: flex; gap: 8px; padding: 4px 0 7px; overflow: auto; }
.ref-tile { position: relative; flex: 0 0 97px; min-width: 0; text-align: center; }
.ref-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 58px;
  color: #adc1f2;
  background: linear-gradient(160deg, #1e2d49, #27213b);
  border: 1px solid #3b3f5d;
  border-radius: 7px 7px 0 0;
  overflow: hidden;
}
.ref-thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.ref-name {
  display: block;
  padding: 3px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.5;
  color: #c3cbea;
  background: #101322;
  border: 1px solid #3b3f5d;
  border-top: 0;
  border-radius: 0 0 7px 7px;
}
.ref-remove {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  background: #0b0d1be6;
  border: 1px solid #607094;
  border-radius: 50%;
}
.ref-remove:hover { background: #592e3a; }
.ref-remove svg { width: 13px; height: 13px; }
.ref-number { padding: 4px 2px; color: var(--coral); font-size: 11px; font-weight: 680; }
.ref-number:hover { color: #ffe2da; }
.reference-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b6bddb;
  background: #222239;
  border: 1px solid #393952;
  border-radius: 7px;
  min-height: 33px;
  padding: 6px 8px;
  margin: 0 0 8px;
  font-size: 11px;
}
.reference-hint svg { width: 14px; height: 14px; color: var(--coral); }
.reference-hint strong { color: var(--coral-light); white-space: nowrap; }
.reference-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.reference-tools .outline { min-height: 30px; border-radius: 7px; padding: 0 9px; background: #171b2e; }
.reference-tools .outline:hover { background: #252c47; }
.reference-tools #reference-count { color: #a5b1d4; font-size: 11px; padding: 0 3px; }
.reference-tools #fill-example { margin-left: auto; }
.reference-row { margin: 8px 0 0; }
.reference-row #reference {
  min-width: 0;
  width: 100%;
  background: var(--field);
  border: 1px solid #34405a;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
}
.model-section { border-block: 1px solid var(--studio-line); padding: 11px 0 13px; }
.composer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 0 0 9px;
}
.composer-section-title h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.composer-section-title h3 svg { width: 15px; height: 15px; color: var(--coral); }
.composer-section-title .link-btn { color: #acb9e4; font-size: 11px; }
.model-cards { display: grid; gap: 6px; }
.model-row { display: grid; grid-template-columns: 102px repeat(12,minmax(0,1fr)); gap: 6px; }
.model-family {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 8px;
  border: 1px solid #363850;
  border-radius: 7px;
  color: #e7ebff;
  background: #191c2e;
  font-size: 11px;
  font-weight: 730;
}
.model-family small { color: #9da8ca; font-weight: 500; font-size: 9px; white-space: nowrap; }
.model-card {
  grid-column: span 4;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #34364e;
  padding: 7px 8px;
  border-radius: 7px;
  background: #15182a;
  color: #f0f2ff;
  text-align: left;
}
.model-row.four .model-card { grid-column: span 3; }
.model-card:hover { background: #242940; border-color: #7788b6; }
.model-card.selected {
  color: #fff0ec;
  background: linear-gradient(108deg, #492e3d, #31263f);
  border-color: #f09c87;
  box-shadow: inset 0 0 0 1px #ed9c8542, 0 0 16px #f8806127;
}
.model-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.model-card strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.25; }
.model-price { color: var(--coral); font-size: 10px; font-weight: 750; flex: none; }
.model-spec { display: block; color: #afb8d7; margin-top: 4px; font-size: 10px; line-height: 1.28; }
.model-empty { color: #b6bfdb; padding: 6px 0; font-size: 12px; }
.composer-settings {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2,minmax(0,1fr));
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--studio-line);
}
.composer-settings .select-shell { background: #101321; }
.duration-heading, .duration-input { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.duration-heading output { color: var(--coral); font: 650 11px var(--mono); margin-bottom: 7px; }
.duration-input .select-shell { min-width: 70px; }
#duration-range { width: 100%; min-width: 0; accent-color: var(--coral); height: 5px; }
.composer-submit { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 11px; }
.composer-cost { min-width: 0; }
.composer-cost-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; }
#estimate-label { color: #b0b9d8; font-size: 11px; }
#estimate-price { color: #ffbbab; font-size: 22px; font-variant-numeric: tabular-nums; font-weight: 770; white-space: nowrap; }
.estimate-source { color: #aab6d8; font-size: 10px; white-space: nowrap; }
.estimate-source.verified { color: #a2e9cd; }
.composer-cost .form-note { justify-content: flex-start; margin-top: 2px; line-height: 1.35; }
.composer-cost .form-note.low-balance { color: #ffb6a1; }
.composer-submit #generate {
  width: auto;
  min-width: 153px;
  min-height: 44px;
  padding: 0 36px 0 14px;
  background: linear-gradient(100deg, #ffc096, #fb8c79 64%, #df82ad);
  border: 1px solid #ffa58e;
  border-radius: 9px;
  color: #241321;
  box-shadow: 0 3px 20px #ed836c35;
}
.creator .error { margin-top: 3px; }
.studio-editor-grid,.studio-results { display: grid; align-items: start; gap: 16px; }
.studio-editor-grid > *,.studio-results > * { min-width: 0; }
.studio-results { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.studio-results .panel-head { padding: 13px 16px; }
.studio-results .panel-icon { width: 32px; height: 32px; }
.studio-results .preview .panel-head { min-height: 63px; }
.studio-results .recent { margin: 0; }
.studio-results .recent > .clip-grid { padding: 12px; }
.studio-results .recent .empty { padding: 15px 12px; }
.studio-results .child-history .job-actions { flex-wrap: wrap; justify-content: flex-start; }
.studio-results .clip-grid { grid-template-columns: 1fr; gap: 7px; }
.studio-results .clip-card { display: grid; grid-template-columns: minmax(85px, 35%) minmax(0,1fr); }
.studio-results .clip-cover { height: clamp(52px, 7vw, 87px); }
.studio-results .clip-card-text { flex-direction: column; justify-content: center; align-items: flex-start; }
.studio-results .clip-card-text strong { max-width: 100%; }
@media (min-width: 1180px) {
  .studio-editor-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 22px;
  }
  .studio-results { grid-template-columns: minmax(0, 1fr); }
  .studio-editor-grid #prompt { min-height: 152px; }
  .studio-editor-grid .model-card { min-height: 54px; }
  .studio-editor-grid .model-card-top { flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .model-card-top { flex-wrap: wrap; }
  .model-family { grid-row: 1 / span 2; }
  .model-row { grid-template-columns: 91px repeat(6,minmax(0,1fr)); }
  .model-row .model-card { grid-column: span 2; }
}
@media (max-width: 700px) {
  .creator-head, #composer { padding-left: 12px; padding-right: 12px; }
  .studio-intro { margin-bottom: 10px; }
  .studio-intro .intro-line h1 { font-size: clamp(25px, 7.2vw, 34px); margin: 7px 0; }
  .studio-intro .intro-line p { font-size: 12px; }
  .studio-intro::before { width: 60%; height: 130px; }
  .creator-head .mode-switch { width: 176px; }
  .creator-head .mode-switch button { gap: 4px; font-size: 11px; }
  .model-row { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .model-family { grid-column: 1 / -1; grid-row: auto; min-height: 26px; flex-direction: row; justify-content: space-between; padding: 4px 7px; }
  .model-row .model-card, .model-row.four .model-card { grid-column: span 3; }
  .composer-settings { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .duration-control { grid-column: 1 / -1; }
  .studio-results { grid-template-columns: 1fr; }
  .studio-results .clip-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .studio-results .clip-card { display: block; }
}
@media (max-width: 360px) {
  #draft-status { display: none; }
  .reference-tools #fill-example { margin-left: 0; }
  .creator-head .mode-switch { width: 159px; }
}
