:root {
  --bg: #090d0f;
  --surface: #12191b;
  --surface-soft: #162123;
  --line: rgba(151, 182, 177, 0.18);
  --line-strong: rgba(167, 220, 213, 0.34);
  --ink: #eef7f5;
  --muted: #8ea09e;
  --teal: #22d2c2;
  --teal-dark: #78f4e8;
  --teal-soft: rgba(34, 210, 194, 0.12);
  --amber: #d49a41;
  --orange-soft: rgba(212, 154, 65, 0.14);
  --blue-soft: rgba(87, 122, 255, 0.14);
  --green-soft: rgba(47, 194, 129, 0.14);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --sidebar: 256px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(8, 124, 120, 0.08), transparent 28%),
    linear-gradient(135deg, #f9fbfb 0%, #eef4f4 100%);
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 56px;
}

.brand-logo {
  display: block;
  width: min(198px, 100%);
  height: auto;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #b45e31);
  box-shadow: 0 16px 34px rgba(8, 124, 120, 0.2);
}

.brand h1,
.brand p,
.page-head h2,
.page-head p,
.panel-title {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.15;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.language-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.language-switch button.active {
  color: var(--teal-dark);
  background: #fff;
  box-shadow: 0 8px 20px rgba(29, 42, 48, 0.08);
}

.brand p,
.crumb,
label span,
.panel-title span,
.panel-note,
.model-card small,
.usage-panel span {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #344249;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active,
.nav-item:focus-visible {
  color: var(--teal-dark);
  border-color: #c7dddd;
  background: var(--teal-soft);
  outline: none;
}

.workspace {
  min-width: 0;
  padding: 24px;
  overflow-x: hidden;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.page-head,
.head-actions,
.panel-title,
.tabs,
.chip-group {
  display: flex;
  align-items: center;
}

.page-head {
  min-height: 56px;
  justify-content: space-between;
  gap: 24px;
}

.page-head h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

.crumb {
  display: inline-block;
  margin-bottom: 6px;
  color: #344249;
  text-decoration: none;
}

.head-actions {
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
.chip,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.button,
.chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.button.primary {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
  font-weight: 750;
}

.button.ghost {
  color: var(--teal-dark);
  background: var(--surface-soft);
}

.button.compact {
  min-height: 34px;
  padding: 0 10px;
}

.button.full {
  width: 100%;
}

.button:hover,
.chip:hover,
.tabs button:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.button:active,
.chip:active {
  transform: translateY(1px);
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 124, 120, 0.16);
  outline: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel-title {
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 14px;
}

.panel-title.sub-title {
  min-height: 28px;
  margin: 12px 0 8px;
}

.panel-note,
.empty-state,
.workflow-message {
  margin: 0;
  line-height: 1.5;
}

.compact-head {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.home-head {
  min-height: 40px;
}

.composer-stage {
  min-height: auto;
  display: grid;
  align-content: start;
  place-items: center;
  gap: 18px;
  padding: clamp(34px, 5vh, 72px) 0 8px;
}

.composer-question {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.composer-card {
  width: min(1180px, 100%);
  padding: 26px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(29, 42, 48, 0.1);
}

.composer-input-row {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-height: 180px;
}

.composer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 18px;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.composer-card > textarea,
.composer-input-row > textarea {
  min-height: 180px;
  border: 0;
  padding: 10px 4px;
  background: transparent;
  font-size: 18px;
  line-height: 1.65;
}

.composer-card > textarea:focus,
.composer-input-row > textarea:focus {
  box-shadow: none;
}

.composer-assets {
  position: relative;
  display: grid;
  grid-template-columns: 96px 96px 96px;
  gap: 14px;
  min-height: 148px;
  margin: 0;
}

.asset-slot {
  position: relative;
  min-height: 148px;
}

.asset-library-button {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -34px;
  z-index: 9;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.upload-tile {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 126px;
  min-height: 0;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  transform: rotate(-7deg);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.asset-slot:has(.media-tile) .upload-tile {
  position: absolute;
  left: 58px;
  bottom: 8px;
  z-index: 8;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 999px;
  transform: none;
}

.model-slot .upload-tile {
  transform: rotate(3deg);
}

.viral-slot .upload-tile {
  transform: rotate(-2deg);
}

.optional-upload small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.upload-tile.drag-over {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 2px rgba(8, 124, 120, 0.14);
}

.upload-tile input {
  display: none;
}

.upload-tile svg {
  color: var(--teal);
}

.asset-slot:has(.media-tile) .upload-tile small,
.asset-slot:has(.media-tile) .upload-tile span {
  display: none;
}

.upload-tile span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.asset-strip {
  position: absolute;
  inset: 0;
  min-height: 148px;
}

.asset-strip .media-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 124px;
  aspect-ratio: auto;
  border: 2px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease, z-index 180ms ease;
}

.model-slot .media-tile {
  border-color: rgba(120, 244, 232, 0.75);
}

.viral-slot .media-tile {
  border-color: rgba(212, 154, 65, 0.78);
}

.video-preview-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-strip .media-tile:nth-child(1) {
  transform: translate(4px, 8px) rotate(-7deg);
  z-index: 4;
}

.asset-strip .media-tile:nth-child(2) {
  transform: translate(34px, 14px) rotate(4deg);
  z-index: 5;
}

.asset-strip .media-tile:nth-child(3) {
  transform: translate(62px, 20px) rotate(-2deg);
  z-index: 6;
}

.asset-strip .media-tile:nth-child(n + 4) {
  transform: translate(82px, 24px) rotate(5deg);
  z-index: 7;
}

.remove-asset-button {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 12;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #f5fffd;
  background: rgba(9, 13, 15, 0.78);
  opacity: 0;
  transition: opacity 160ms ease;
}

.media-tile:hover .remove-asset-button,
.remove-asset-button:focus-visible {
  opacity: 1;
}

.asset-strip:hover .media-tile:nth-child(1) {
  transform: translate(0, 4px) rotate(-6deg);
}

.asset-strip:hover .media-tile:nth-child(2) {
  transform: translate(82px, 4px) rotate(2deg);
}

.asset-strip:hover .media-tile:nth-child(3) {
  transform: translate(164px, 4px) rotate(-2deg);
}

.asset-strip:hover .media-tile:nth-child(n + 4) {
  transform: translate(246px, 4px) rotate(2deg);
}

.composer-footer {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  margin-top: 20px;
}

.composer-control {
  flex: 0 1 auto;
  min-height: 54px;
  width: auto;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.composer-control svg {
  color: var(--teal);
}

.composer-control select {
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-weight: 760;
}

.composer-control:not(.compact-control) select {
  min-width: 116px;
}

.composer-control:has(#videoModel) select {
  min-width: 120px;
  max-width: 132px;
}

.composer-control:has(#styleSelect) select {
  min-width: 98px;
  max-width: 112px;
}

.compact-control select {
  min-width: 56px;
}

.composer-submit {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  min-height: 58px;
  margin-left: 0;
  padding: 0;
  border-radius: 999px;
}

.cost-pill {
  flex: 0 0 auto;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.field-grid.compact {
  gap: 8px;
}

.stage-panel {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.idea-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
}

.idea-card:hover,
.idea-card.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.idea-card p,
.idea-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.studio-top {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1fr);
  gap: 18px;
}

.product-panel,
.workbench-panel,
.storyboard-panel,
.routing-panel,
.usage-panel {
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chip-group {
  gap: 8px;
  flex-wrap: wrap;
}

.chip.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.tabs {
  gap: 18px;
  min-height: 42px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  align-self: stretch;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #344249;
}

.tabs button.active {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  font-weight: 750;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.empty-state {
  min-height: 120px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  text-align: center;
}

.media-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3f4;
}

.media-tile {
  aspect-ratio: 1 / 0.78;
}

.product-asset {
  display: grid;
  grid-template-rows: minmax(76px, 1fr) auto;
}

.asset-preview {
  width: 100%;
  min-height: 76px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.asset-tools {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 6px;
  padding: 6px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.asset-tools select,
.asset-tools button {
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 6px;
}

.asset-tools button {
  display: grid;
  place-items: center;
  color: #8a3b00;
  background: var(--orange-soft);
}

.media-tile img,
.media-tile video,
.story-card img,
.phone-frame img,
.phone-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workbench-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.workbench-panel textarea {
  min-height: 220px;
  background: #fbfdfd;
}

.result-preview {
  --result-height: 540px;
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1.08fr);
  gap: 28px;
  align-items: stretch;
  padding-top: 4px;
}

.publish-copy-panel {
  min-height: var(--result-height);
  max-height: var(--result-height);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 14px;
}

.publish-copy-head,
.publish-field > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.publish-copy-head strong {
  font-size: 18px;
}

.publish-copy-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.copy-style-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.copy-style-switch button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.copy-style-switch button.active {
  color: #03100f;
  background: var(--teal);
}

.publish-field {
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(151, 182, 177, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.publish-field span {
  color: #a9c9c4;
  font-size: 12px;
  font-weight: 800;
}

.publish-field button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
}

.publish-field p {
  margin: 0;
  color: #f7fffd;
  line-height: 1.75;
  white-space: pre-wrap;
}

.publish-field.body-field {
  overflow: hidden;
}

.publish-field.body-field p {
  overflow: auto;
  padding-right: 8px;
}

.publish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 92px;
  overflow: auto;
}

.publish-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(120, 244, 232, 0.24);
  border-radius: 999px;
  color: #cffff9;
  background: rgba(34, 210, 194, 0.08);
}

.phone-result-shell {
  min-height: var(--result-height);
  display: grid;
  justify-items: center;
  align-items: center;
}

.mini-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.phone-frame {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 28px;
  background: #070b0d;
  border: 8px solid #151b1e;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.video-phone::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 50%;
  width: 70px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
}

.phone-frame > span {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: #fff;
  background: rgba(24, 32, 37, 0.78);
  font-weight: 800;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 42px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.56));
}

.panel-note {
  display: grid;
  gap: 10px;
  align-content: center;
}

.panel-note strong {
  color: #f5fffd;
  font-size: 18px;
}

.panel-note small {
  display: block;
  color: #9fb4b1;
}

.result-link {
  width: fit-content;
  color: #7af4e8;
  font-weight: 800;
}

.pipeline {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 12px;
}

.pipeline-step {
  min-height: 82px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.pipeline-dot {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eef3f4;
  color: var(--muted);
}

.pipeline i,
.pipeline b {
  display: grid;
  place-items: center;
  font-size: 13px;
}

.pipeline strong {
  color: var(--ink);
  font-size: 13px;
}

.pipeline span {
  font-size: 12px;
}

.pipeline .done .pipeline-dot,
.pipeline .active .pipeline-dot {
  color: #fff;
  background: var(--teal);
}

.pipeline .active .pipeline-dot {
  background: var(--teal-soft);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stage-actions {
  margin-top: 2px;
}

.stage-actions .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.studio-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.story-strip {
  display: grid;
  gap: 12px;
}

.storyboard-confirm-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 20px;
  align-items: stretch;
}

.storyboard-visual {
  min-height: 430px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.storyboard-composite {
  width: min(100%, 420px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.storyboard-composite img {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.storyboard-image-fallback {
  width: min(100%, 420px);
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed rgba(120, 244, 232, 0.28);
  border-radius: 14px;
  background: rgba(8, 19, 20, 0.72);
}

.storyboard-image-fallback i {
  color: #7af4e8;
}

.storyboard-image-fallback strong {
  color: var(--text);
}

.storyboard-image-fallback span {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.65;
}

.storyboard-loading {
  background: linear-gradient(180deg, rgba(10, 27, 30, 0.92), rgba(8, 18, 20, 0.96));
}

.storyboard-loading .spin {
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.shot-timeline {
  max-height: 540px;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-right: 4px;
}

.shot-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.shot-row > b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal-dark);
  font-size: 12px;
  line-height: 1;
}

.shot-row-body {
  min-width: 0;
}

.shot-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.shot-row small {
  white-space: nowrap;
  color: var(--teal-dark);
  font-weight: 850;
  font-size: 12px;
}

.shot-row strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.story-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.shot-image {
  width: 100%;
  padding: 0;
  border: 0;
  background: #eef3f4;
}

.story-card button {
  width: 100%;
  min-height: 92px;
  padding: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.story-card img {
  aspect-ratio: 4 / 3;
}

.story-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.story-card small {
  display: block;
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-weight: 800;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.compact-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.compact-options button {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: 32px 1fr;
  text-align: left;
}

.compact-options span,
.compact-options strong {
  display: block;
}

.compact-options strong {
  font-size: 12px;
}

.workflow-message {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.workflow-message.error {
  color: #8a3b00;
  border-color: #f0c27a;
  background: var(--orange-soft);
}

.thinking-overlay {
  position: fixed;
  top: 28px;
  right: 32px;
  z-index: 80;
  pointer-events: none;
}

.thinking-card {
  min-width: 260px;
  max-width: min(360px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(120, 244, 232, 0.28);
  border-radius: 16px;
  color: #effffd;
  background: rgba(9, 14, 16, 0.86);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(20px);
}

.thinking-card strong,
.thinking-card p {
  margin: 0;
}

.thinking-card p {
  margin-top: 3px;
  color: #9bb4b1;
  font-size: 13px;
}

.thinking-robot {
  position: relative;
  width: 48px;
  height: 48px;
  animation: robotThink 1.7s ease-in-out infinite;
}

.thinking-robot::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 16px;
  height: 5px;
  border-radius: 999px;
  background: #78f4e8;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(120, 244, 232, 0.62);
}

.robot-head {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(120, 244, 232, 0.45);
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, rgba(34, 210, 194, 0.24), rgba(10, 20, 23, 0.94));
}

.robot-head span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #78f4e8;
  animation: robotBlink 1.7s ease-in-out infinite;
}

.robot-body {
  width: 30px;
  height: 16px;
  margin: 2px auto 0;
  border-radius: 8px 8px 12px 12px;
  background: linear-gradient(135deg, #22d2c2, #d49a41);
}

@keyframes robotThink {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-5px) rotate(1deg);
  }
}

@keyframes robotBlink {
  0%,
  72%,
  100% {
    transform: scaleY(1);
  }
  82% {
    transform: scaleY(0.2);
  }
}

.model-page {
  display: grid;
  gap: 18px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.model-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}

.model-card .model-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #087c78, #45a084);
}

.model-card b {
  font-size: 17px;
}

.model-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.key-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 750;
}

.key-status.ready {
  color: #087c78;
  border-color: rgba(34, 210, 194, 0.36);
  background: rgba(34, 210, 194, 0.12);
}

.key-status.missing {
  color: #a33a24;
  border-color: rgba(206, 72, 45, 0.36);
  background: rgba(206, 72, 45, 0.12);
}

.model-card .meta-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  font-size: 13px;
}

.model-form {
  display: grid;
  gap: 12px;
}

.model-form label {
  margin-bottom: 0;
}

.model-form .key-state {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.model-form .key-state.ready {
  color: #0f6f43;
  background: var(--green-soft);
}

.routing-map {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  align-items: center;
}

.route-step {
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 7px;
  position: relative;
}

.route-step b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
}

.route-step small {
  color: var(--teal-dark);
  font-weight: 750;
}

.usage-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  overflow: hidden;
}

.usage-panel div {
  min-height: 72px;
  padding: 16px;
  background: #fff;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.45);
  z-index: 19;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.62);
  z-index: 33;
}

.pricing-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.62);
  z-index: 35;
}

.ledger-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.62);
  z-index: 37;
}

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.62);
  z-index: 29;
}

.asset-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 23, 0.62);
  z-index: 31;
}

.image-preview-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, 92vw);
  max-height: 90vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 30;
  display: grid;
  gap: 12px;
}

.asset-picker-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(840px, 92vw);
  max-height: 86vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 32;
  display: grid;
  gap: 14px;
  overflow: auto;
}

.auth-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(468px, 92vw);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 34;
  display: grid;
  gap: 16px;
}

.auth-dialog .settings-head {
  position: relative;
  align-items: start;
  padding-right: 46px;
}

.auth-dialog .settings-head strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.auth-dialog .settings-head p {
  margin-top: 10px;
  color: rgba(238, 247, 245, 0.82);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 650;
}

.auth-dialog label {
  display: grid;
  gap: 8px;
}

.auth-dialog label span {
  color: rgba(238, 247, 245, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.auth-dialog input {
  min-height: 48px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 750;
}

.auth-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(120, 244, 232, 0.22);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #d9fffb;
  background: rgba(255, 255, 255, 0.045);
}

.auth-close:hover,
.auth-close:focus-visible {
  color: #04110f;
  background: var(--teal-dark);
}

.auth-close svg {
  width: 18px;
  height: 18px;
}

.pricing-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, 94vw);
  max-height: 88vh;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 36;
  display: grid;
  gap: 16px;
  overflow: auto;
}

.ledger-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, 92vw);
  max-height: 82vh;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 38;
  display: grid;
  gap: 14px;
  overflow: auto;
}

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

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

.pricing-card {
  position: relative;
  min-height: 286px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 12px;
  align-content: start;
}

.pricing-card.popular {
  border-color: rgba(120, 244, 232, 0.62);
  background:
    linear-gradient(135deg, rgba(34, 210, 194, 0.16), rgba(255, 255, 255, 0.045) 48%),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(120, 244, 232, 0.24), 0 20px 60px rgba(34, 210, 194, 0.12);
}

.popular-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #04110f;
  background: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.pricing-card strong {
  font-size: 20px;
}

.pricing-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.price-line {
  display: grid;
  gap: 4px;
}

.price-line b {
  font-size: 34px;
  line-height: 1;
}

.price-line span {
  color: var(--teal-dark);
  font-weight: 900;
}

.pricing-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.pricing-card .button {
  width: 100%;
  margin-top: auto;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: end;
}

.auth-code-row label {
  margin: 0;
}

.auth-code-row input {
  height: 48px;
}

.auth-code-row .button {
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  justify-content: center;
  white-space: nowrap;
  font-size: 14px;
}

.auth-code-row .button:disabled {
  cursor: not-allowed;
  color: rgba(238, 247, 245, 0.5);
  border-color: rgba(151, 182, 177, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.auth-dialog > .button.primary {
  min-height: 48px;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
}

.auth-dialog .workflow-message {
  min-height: 46px;
  display: grid;
  align-items: center;
  margin: 0;
  color: rgba(238, 247, 245, 0.72);
  font-size: 13px;
  font-weight: 650;
}

.credit-badge {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(120, 244, 232, 0.22);
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(34, 210, 194, 0.1);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ledger-list {
  display: grid;
  gap: 10px;
}

.ledger-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(151, 182, 177, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.ledger-item strong {
  color: #f7fffd;
  font-size: 14px;
}

.ledger-item small {
  color: var(--muted);
}

.ledger-amount {
  color: var(--teal-dark);
  font-weight: 950;
  white-space: nowrap;
}

.ledger-amount.negative {
  color: #ffb4a8;
}

.ledger-empty {
  padding: 18px;
  border: 1px dashed rgba(151, 182, 177, 0.2);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.ledger-help-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(120, 244, 232, 0.22);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.045);
}

.ledger-help-button:hover,
.ledger-help-button:focus-visible {
  color: #04110f;
  background: var(--teal-dark);
}

.ledger-help-button svg {
  width: 17px;
  height: 17px;
}

.ledger-rules {
  padding: 14px;
  border: 1px solid rgba(120, 244, 232, 0.18);
  border-radius: var(--radius);
  color: rgba(238, 247, 245, 0.78);
  background: rgba(34, 210, 194, 0.06);
  font-size: 13px;
  line-height: 1.6;
}

.ledger-rules strong {
  display: block;
  margin-bottom: 6px;
  color: #f7fffd;
}

.ledger-rules p {
  margin: 0 0 8px;
}

.ledger-rules ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.model-cost {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(34, 210, 194, 0.08);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.asset-picker-card,
.reusable-asset-card {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.reusable-asset-card > button:first-child {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.delete-asset-button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffe4e4;
  background: rgba(82, 17, 17, 0.78);
  opacity: 0;
  transition: opacity 160ms ease;
}

.reusable-asset-card:hover .delete-asset-button,
.reusable-asset-card:focus-within .delete-asset-button {
  opacity: 1;
}

.asset-picker-card img,
.reusable-asset-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-soft);
}

.asset-picker-card span,
.asset-picker-card small,
.reusable-asset-card span {
  display: block;
  padding: 8px 10px 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.asset-picker-card small {
  padding-top: 3px;
  padding-bottom: 10px;
  color: var(--muted);
  font-weight: 500;
}

.reusable-assets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.reusable-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.asset-library-upload-card {
  min-height: 122px;
  padding: 12px 8px;
  border: 1px dashed rgba(120, 244, 232, 0.38);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #c8fffa;
  background: rgba(34, 210, 194, 0.06);
  text-align: center;
  cursor: pointer;
}

.asset-library-upload-card:hover,
.asset-library-upload-card:focus-within {
  border-color: rgba(120, 244, 232, 0.78);
  background: rgba(34, 210, 194, 0.12);
}

.asset-library-upload-card input {
  display: none;
}

.asset-library-upload-card svg {
  color: #7af4e8;
}

.asset-library-upload-card span {
  font-size: 12px;
  font-weight: 850;
}

.reusable-asset-card span {
  padding-bottom: 8px;
}

.compact-empty {
  min-height: 96px;
  font-size: 12px;
}

.image-preview-dialog img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.settings-drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 92vw);
  max-height: 86vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px;
  overflow: auto;
  z-index: 20;
  display: grid;
  align-content: start;
  gap: 12px;
}

.settings-head,
.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-list {
  display: grid;
  gap: 18px;
}

.video-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.video-asset-card {
  overflow: hidden;
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.video-asset-media {
  position: relative;
  overflow: hidden;
  background: #081012;
}

.video-asset-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  background: #081012;
  object-fit: cover;
}

.video-asset-body {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}

.video-asset-actions {
  position: absolute;
  right: 12px;
  top: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.video-asset-card:hover .video-asset-actions,
.video-asset-card:focus-within .video-asset-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.video-asset-actions .button {
  justify-content: center;
  border-color: rgba(120, 244, 232, 0.3);
  background: rgba(7, 16, 18, 0.82);
  color: #eefefd;
  backdrop-filter: blur(12px);
}

.video-asset-actions .button.primary {
  background: rgba(57, 226, 211, 0.92);
  color: #03100f;
}

.draft-section {
  display: grid;
  gap: 10px;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.project-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.project-title-row,
.project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-title-row {
  justify-content: space-between;
}

.project-title-row span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
  font-weight: 750;
}

.project-card p {
  max-width: 72ch;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}

.project-thumbs img {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.project-thumbs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.project-actions {
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

.project-actions small,
.project-card > small {
  color: var(--muted);
}

.danger-compact {
  border-color: rgba(255, 94, 94, 0.38) !important;
  color: #ffc6c6 !important;
}

.danger-compact:hover {
  border-color: rgba(255, 94, 94, 0.68) !important;
  background: rgba(255, 94, 94, 0.1) !important;
}

.compact-video video {
  width: min(360px, 100%);
}

.history-item video {
  width: min(420px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
}

body {
  background:
    radial-gradient(circle at 72% 0%, rgba(34, 210, 194, 0.18), transparent 34%),
    radial-gradient(circle at 10% 10%, rgba(212, 154, 65, 0.12), transparent 28%),
    linear-gradient(135deg, #070b0d 0%, #0d1517 48%, #130f16 100%);
}

.app-shell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 34%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 96px);
}

.sidebar {
  border-right-color: rgba(151, 182, 177, 0.16);
  background: rgba(8, 12, 14, 0.82);
  box-shadow: 18px 0 80px rgba(0, 0, 0, 0.28);
}

.brand-mark {
  border: 1px solid rgba(120, 244, 232, 0.22);
  background: linear-gradient(135deg, rgba(34, 210, 194, 0.92), rgba(212, 154, 65, 0.72));
  box-shadow: 0 0 32px rgba(34, 210, 194, 0.24);
}

.brand h1 {
  color: #f6fffd;
}

.nav-item {
  color: #a9b8b6;
  background: rgba(255, 255, 255, 0.02);
}

.nav-item > span {
  display: grid;
  gap: 2px;
  font-weight: 750;
}

.nav-item small {
  color: #617270;
  font-size: 12px;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.active,
.nav-item:focus-visible {
  color: #f5fffd;
  border-color: rgba(34, 210, 194, 0.42);
  background: linear-gradient(135deg, rgba(34, 210, 194, 0.14), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 0 0 1px rgba(120, 244, 232, 0.08), 0 14px 38px rgba(0, 0, 0, 0.22);
}

.nav-item:hover small,
.nav-item.active small {
  color: #90aaa6;
}

.workspace {
  padding: 28px 32px;
}

.compact-head,
.stage-panel,
.pipeline,
.stage-actions,
.studio-bottom {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.page-head h2 {
  color: #f7fffd;
  letter-spacing: 0;
}

.crumb {
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(120, 244, 232, 0.16);
  border-radius: 8px;
  color: #9deee7;
  background: rgba(34, 210, 194, 0.08);
}

.page-head p,
.brand p,
.panel-title span,
.mini-title,
.project-card p,
.video-asset-body p {
  color: var(--muted);
}

.button,
.chip,
select,
input,
textarea {
  color: var(--ink);
  border-color: rgba(151, 182, 177, 0.2);
  background: rgba(255, 255, 255, 0.055);
}

textarea::placeholder,
input::placeholder {
  color: rgba(238, 247, 245, 0.42);
}

.button.primary {
  color: #05100f;
  border-color: rgba(120, 244, 232, 0.72);
  background: linear-gradient(135deg, #7af4e8, #22d2c2);
  box-shadow: 0 16px 46px rgba(34, 210, 194, 0.22);
}

.button.ghost {
  color: #c8fffa;
  border-color: rgba(120, 244, 232, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  border-color: rgba(120, 244, 232, 0.76);
  box-shadow: 0 0 0 3px rgba(34, 210, 194, 0.16);
}

.composer-stage {
  min-height: clamp(520px, 74vh, 720px);
}

#view-home {
  gap: 12px;
}

#view-home .composer-stage {
  min-height: 0;
  padding-bottom: 0;
}

#ideasStage {
  margin-top: 0;
}

.composer-card,
.panel,
.stage-panel,
.pipeline,
.stage-actions,
.settings-drawer,
.image-preview-dialog,
.asset-picker-dialog,
.auth-dialog,
.pricing-dialog,
.ledger-dialog,
.project-card,
.video-asset-card {
  border-color: rgba(151, 182, 177, 0.18);
  background: linear-gradient(180deg, rgba(18, 25, 27, 0.9), rgba(11, 16, 18, 0.86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.composer-card {
  position: relative;
  width: min(1180px, 100%);
  padding: 26px 34px 28px;
  border-radius: 24px;
  overflow: hidden;
}

.composer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(120, 244, 232, 0.18), transparent 32%, rgba(212, 154, 65, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%);
  opacity: 0.7;
}

.composer-card > * {
  position: relative;
}

.composer-brand {
  color: #f7fffd;
}

.composer-card > textarea,
.composer-input-row > textarea {
  color: #f2fffd;
  background: rgba(255, 255, 255, 0.02);
}

.composer-question {
  color: #f7fffd;
}

.composer-control {
  border-color: rgba(151, 182, 177, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.upload-tile {
  color: #d9f7f3;
  border-color: rgba(120, 244, 232, 0.28);
  background: rgba(34, 210, 194, 0.055);
}

.asset-library-button {
  color: #c8fffa;
  border-color: rgba(120, 244, 232, 0.2);
  background: rgba(15, 23, 25, 0.92);
}

.upload-tile.drag-over {
  border-color: rgba(120, 244, 232, 0.82);
  background: rgba(34, 210, 194, 0.16);
}

.asset-preview,
.media-tile,
.shot-image,
.storyboard-composite,
.phone-frame,
.image-preview-dialog img {
  background: #0f1719;
}

.asset-tools,
.story-card button {
  border-color: rgba(151, 182, 177, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.idea-card,
.story-card,
.model-card,
.asset-picker-card,
.reusable-asset-card,
.pricing-card,
.ledger-item {
  border-color: rgba(151, 182, 177, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.idea-card strong,
.story-card strong,
.panel-title strong,
.project-title-row strong,
.asset-picker-card span,
.reusable-asset-card span,
.pricing-card strong,
.price-line b,
.ledger-item strong {
  color: #f7fffd;
}

.asset-picker-card small {
  color: var(--muted);
}

.idea-card:hover,
.idea-card.selected {
  border-color: rgba(120, 244, 232, 0.58);
  background: rgba(34, 210, 194, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.pipeline {
  position: relative;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  padding: 18px;
  overflow: hidden;
}

.pipeline-step {
  position: relative;
  color: #91a5a2;
}

.pipeline strong {
  color: #e7f7f4;
}

.pipeline-dot {
  color: #9eb3b0;
  background: rgba(17, 27, 29, 0.86);
  border: 1px solid rgba(151, 182, 177, 0.24);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.025);
}

.pipeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  left: calc(50% + 28px);
  width: calc(100% - 56px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34, 210, 194, 0.5), rgba(34, 210, 194, 0.08));
}

.pipeline .done .pipeline-dot,
.pipeline .active .pipeline-dot {
  color: #06100f;
  background: linear-gradient(135deg, #7af4e8, #22d2c2);
  box-shadow: 0 0 28px rgba(34, 210, 194, 0.32);
}

.pipeline .active strong,
.pipeline .active span {
  color: #7af4e8;
}

.stage-actions {
  justify-content: flex-end;
}

.storyboard-panel,
.video-panel {
  padding: 20px;
}

.storyboard-composite {
  border-color: rgba(120, 244, 232, 0.18);
}

.story-card small {
  color: #7af4e8;
}

.shot-row {
  border-color: rgba(151, 182, 177, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.shot-row > b {
  border-color: rgba(120, 244, 232, 0.28);
  background: rgba(120, 244, 232, 0.08);
}

.shot-row small {
  color: #7af4e8;
}

.shot-row strong {
  color: #f7fffd;
}

.shot-row p {
  color: #a9c9c4;
}

.workflow-message {
  color: #b5c7c4;
  border-color: rgba(151, 182, 177, 0.18);
  background: rgba(255, 255, 255, 0.045);
  font-size: 13px;
}

.workflow-message.error {
  color: #ffd5d5;
  border-color: rgba(255, 78, 78, 0.72);
  background: rgba(146, 19, 19, 0.34);
  box-shadow: 0 18px 50px rgba(120, 0, 0, 0.24);
  font-size: 15px;
  font-weight: 750;
}

.stage-alert {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.workflow-message details {
  margin-top: 8px;
}

.workflow-message summary {
  width: fit-content;
  cursor: pointer;
  color: #ffe5b8;
  font-weight: 750;
}

.workflow-message pre {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e9c88d;
  font-size: 12px;
}

.project-title-row span,
.model-form .key-state.ready {
  color: #091211;
  background: #7af4e8;
}

.project-thumbs a {
  color: #d9fffb;
  border-color: rgba(151, 182, 177, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

#view-workshop .compact-head {
  position: relative;
  max-width: 1180px;
  padding: 22px 24px;
  border: 1px solid rgba(151, 182, 177, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(34, 210, 194, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(18, 25, 27, 0.92), rgba(11, 16, 18, 0.78));
  box-shadow: var(--shadow);
  overflow: hidden;
}

#view-workshop .compact-head::after {
  content: "";
  position: absolute;
  inset: auto 24px 0 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(34, 210, 194, 0.64), transparent 72%);
}

#view-workshop .compact-head h2 {
  max-width: 820px;
  font-size: clamp(24px, 3vw, 34px);
}

#view-workshop .compact-head p {
  max-width: 760px;
}

#view-workshop .stage-panel {
  border-radius: 14px;
}

#view-workshop .stage-actions {
  position: sticky;
  bottom: 14px;
  z-index: 8;
}

.settings-backdrop,
.image-preview-backdrop {
  background: rgba(2, 6, 7, 0.72);
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-top,
  .studio-bottom,
  .result-preview,
  .storyboard-confirm-layout,
  .composer-input-row {
    grid-template-columns: 1fr;
  }

  .composer-footer {
    width: 100%;
  }

  .cost-pill {
    margin-left: 0;
  }

  .composer-footer .composer-submit {
    justify-self: end;
  }

  .model-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .routing-map {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .page-head,
  .head-actions,
  .nav-list,
  .field-grid,
    .media-grid,
    .project-card,
    .composer-footer,
    .composer-input-row,
    .shot-grid,
  .model-grid,
  .routing-map,
  .usage-panel {
    grid-template-columns: 1fr;
  }

  .page-head,
  .head-actions {
    align-items: stretch;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .compact-options {
    grid-template-columns: 1fr;
  }

  .project-actions {
    flex-direction: row;
    align-items: center;
  }
}
