@import url("/style-chunks/01-base-shell.css?v=file-preview-contrast-20260709a");
@import url("/style-chunks/02-catalog-legacy.css?v=three-model-preview-20260625a");
@import url("/style-chunks/03-workspace-legacy.css?v=frontend-split-20260623a");
@import url("/style-chunks/04-current-shell.css?v=frontend-split-20260623a");
@import url("/style-chunks/05-tool-workspace-orientation.css?v=frontend-split-20260623a");
@import url("/style-chunks/06-ai-tools-listing.css?v=frontend-split-20260623a");
@import url("/style-chunks/07-refined-tool-catalog.css?v=frontend-split-20260623a");
@import url("/style-chunks/08-image-backed-tools.css?v=frontend-split-20260623a");
@import url("/style-chunks/09-full-site-shell.css?v=frontend-split-20260623a");
@import url("/style-chunks/10-motion-admin.css?v=provider-costs-20260702a");
@import url("/style-chunks/11-model-catalog.css?v=frontend-split-20260624b");
@import url("/style-chunks/12-home-redesign.css?v=frontend-split-20260623a");
@import url("/style-chunks/13-home-theme-alignment.css?v=frontend-split-20260623a");

/* Final UX stabilization layer for route shells that share the split CSS chunks. */
body.tools-shell .workspace-empty-mode .tool-workspace {
  grid-template-columns: minmax(0, 1fr);
}

body.tools-shell .workspace-empty-mode .tool-form {
  grid-column: 1 / -1;
}

body.tools-shell .workspace-empty-mode .run-panel,
body.tools-shell .workspace-empty-mode .form-footer,
body.tools-shell .workspace-empty-mode :is(.prompt-field-list) {
  display: none;
}

body.tools-shell .workspace-empty-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid rgba(126, 146, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 20, 46, 0.9), rgba(6, 10, 28, 0.94));
  color: var(--catalog-ink);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

body.tools-shell .workspace-empty-card h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1.1;
  letter-spacing: 0;
}

body.tools-shell .workspace-empty-card p {
  margin: 0;
  max-width: 66ch;
  color: var(--catalog-muted);
  line-height: 1.6;
}

body.tools-shell .workspace-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.tools-shell .workspace-empty-actions a,
body.tools-shell .workspace-empty-actions button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(135, 226, 255, 0.28);
  border-radius: 8px;
  background: rgba(12, 19, 48, 0.9);
  color: rgba(245, 249, 255, 0.94);
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

body.tools-shell .workspace-empty-actions a:first-child,
body.tools-shell .workspace-empty-actions button:first-child {
  border-color: rgba(185, 125, 255, 0.42);
  background: linear-gradient(135deg, #7c3cff, #b15cff);
  color: white;
}

body.tools-shell .three-d-studio-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(135, 226, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 14, 35, 0.72);
}

body.tools-shell .three-d-studio-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.tools-shell .three-d-studio-panel-header h2 {
  margin: 0;
  color: rgba(245, 249, 255, 0.96);
  font-size: 14px;
  font-weight: 820;
  line-height: 1.2;
  letter-spacing: 0;
}

body.tools-shell .three-d-studio-panel-header span {
  max-width: 100%;
  border: 1px solid rgba(135, 226, 255, 0.22);
  border-radius: 6px;
  padding: 5px 8px;
  color: rgba(198, 240, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

body.tools-shell .three-d-studio-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.tools-shell .three-d-studio-module {
  appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(126, 146, 255, 0.18);
  border-radius: 8px;
  background: rgba(12, 19, 48, 0.78);
  color: rgba(230, 238, 255, 0.9);
  cursor: pointer;
  text-align: left;
}

body.tools-shell .three-d-studio-module:disabled {
  cursor: default;
}

body.tools-shell .three-d-studio-module.is-supported:hover,
body.tools-shell .three-d-studio-module.is-supported:focus-visible {
  border-color: rgba(135, 226, 255, 0.44);
  background: rgba(18, 31, 68, 0.92);
  outline: none;
}

body.tools-shell .three-d-studio-module span {
  grid-row: 1 / 4;
  color: rgba(135, 226, 255, 0.76);
  font-size: 11px;
  font-weight: 820;
}

body.tools-shell .three-d-studio-module strong,
body.tools-shell .three-d-studio-module small,
body.tools-shell .three-d-studio-module em {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.tools-shell .three-d-studio-module strong {
  font-size: 13px;
  line-height: 1.15;
}

body.tools-shell .three-d-studio-module small {
  justify-self: end;
  color: rgba(192, 205, 240, 0.68);
  font-size: 11px;
  line-height: 1.2;
}

body.tools-shell .three-d-studio-module em {
  grid-column: 2 / 4;
  color: rgba(192, 205, 240, 0.72);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

body.tools-shell .three-d-studio-module.is-supported {
  border-color: rgba(135, 226, 255, 0.38);
  background: rgba(23, 42, 86, 0.74);
}

body.tools-shell .three-d-studio-module.is-optional {
  opacity: 0.74;
}

body.tools-shell .three-d-studio-focus-target {
  outline: 2px solid rgba(135, 226, 255, 0.72);
  outline-offset: 4px;
}

body.tools-shell .tool-view .asset-chip-file {
  border-color: rgba(135, 226, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(24, 40, 82, 0.96), rgba(8, 14, 36, 0.96));
}

body.tools-shell .tool-view .asset-preview-file:disabled {
  background:
    radial-gradient(circle at 22% 14%, rgba(135, 226, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(21, 35, 74, 0.92), rgba(5, 10, 29, 0.98));
  color: rgba(245, 249, 255, 0.94);
}

body.tools-shell .result-model-viewer::after {
  position: absolute;
  top: 10px;
  left: 10px;
  border: 1px solid rgba(135, 226, 255, 0.28);
  border-radius: 6px;
  padding: 5px 8px;
  background: rgba(6, 10, 24, 0.68);
  color: rgba(218, 244, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

body.tools-shell .result-model-viewer[data-viewport-mode="mesh"]::after {
  content: "Mesh";
}

body.tools-shell .result-model-viewer[data-viewport-mode="materials"]::after {
  content: "Texture off";
}

body.tools-shell .site-version {
  position: relative;
  z-index: 2;
  margin: 0 24px 14px 224px;
  padding: 0 0 calc(8px + env(safe-area-inset-bottom));
  color: rgba(216, 226, 255, 0.42);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  text-align: right;
  letter-spacing: 0;
  user-select: text;
}

@media (min-width: 921px) {
  body.tools-shell .tool-view :is(.prompt-field-list) {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 14px;
    align-items: start;
  }

  body.tools-shell .tool-view .prompt-field textarea {
    max-height: 180px;
    overflow: auto;
  }

  body.tools-shell .tool-view .prompt-field:last-child textarea {
    max-height: 132px;
  }
}

@media (max-width: 920px) {
  body.tools-shell {
    --mobile-topbar-height: 86px;
  }

  body.tools-shell .topbar {
    inset: 0 0 auto 0;
    width: 100%;
    min-height: var(--mobile-topbar-height);
    padding: 12px 14px;
    z-index: 95;
  }

  body.tools-shell .shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: var(--mobile-topbar-height);
  }

  body.tools-shell .site-version {
    margin: 0;
    padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
    text-align: center;
  }

  body.tools-shell .home-layout,
  body.tools-shell .favorites-layout,
  body.tools-shell .profile-layout,
  body.tools-shell .tools-view .tools-layout,
  body.tools-shell .civitai-models-layout,
  body.tools-shell .chat-layout,
  body.tools-shell .tool-view .tool-layout {
    padding-top: 14px;
  }

  body.tools-shell .tools-view .tools-layout {
    padding-right: 10px;
    padding-left: 10px;
  }

  body.tools-shell .category-row.tool-tag-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  body.tools-shell .category-row.tool-tag-filter-row button {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  body.tools-shell .tools-toolbar {
    gap: 10px;
  }

  body.tools-shell .tool-view :is(.prompt-field-list) {
    gap: 12px;
  }

  body.tools-shell .tool-view .tool-form {
    grid-template-rows: auto auto;
  }

  body.tools-shell .tool-view .form-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 92;
    grid-row: 1;
    margin: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(126, 146, 255, 0.2);
    border-bottom: 0;
    background: rgba(3, 9, 29, 0.94);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(16px) saturate(120%);
  }

  body.tools-shell .tool-view .field-list {
    grid-row: 2;
  }

  body.tools-shell .tool-view .tool-layout {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  body.tools-shell .tool-view .prompt-field textarea {
    max-height: 150px;
    overflow: auto;
  }

  body.tools-shell .tool-view .prompt-field:last-child textarea {
    max-height: 92px;
  }

  body.tools-shell .tool-view .field,
  body.tools-shell .tool-view .switch-row,
  body.tools-shell .tool-view .asset-upload-control,
  body.tools-shell .tool-view .asset-chip,
  body.tools-shell .tool-view .asset-add-slot,
  body.tools-shell .tool-view .button-select-button,
  body.tools-shell .workspace-empty-actions a,
  body.tools-shell .workspace-empty-actions button {
    min-height: 44px;
  }

  body.tools-shell .chat-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100svh - var(--mobile-topbar-height));
  }

  body.tools-shell .chat-workspace {
    order: 1;
    min-height: min(560px, calc(100svh - var(--mobile-topbar-height) - 34px));
  }

  body.tools-shell .chat-panel {
    order: 2;
  }

  body.tools-shell .civitai-model-grid,
  body.tools-shell .model-selector-official-grid,
  body.tools-shell .model-selector-checkpoint-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  body.tools-shell {
    --mobile-topbar-height: 82px;
  }

  body.tools-shell .topbar {
    padding: 10px 12px;
  }

  body.tools-shell .page-heading h1,
  body.tools-shell .profile-hero h1,
  body.tools-shell .tool-view .tool-info-panel h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  body.tools-shell .workspace-empty-actions {
    flex-direction: column;
  }
}

body.tools-shell .tool-view.studio-tool-view .tool-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "info"
    "controls";
  width: min(1280px, calc(100% - 44px));
  max-width: 1280px;
  min-height: auto;
  margin-right: auto;
  margin-left: auto;
  padding: 18px clamp(16px, 3vw, 42px) 56px;
}

body.tools-shell .tool-view.studio-tool-view :is(.prompt-field-list),
body.tools-shell .tool-view.studio-tool-view .run-panel {
  display: none !important;
}

body.tools-shell .tool-view.studio-tool-view .tool-form {
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.tools-shell .tool-view.studio-tool-view .tool-info-panel {
  padding: 18px;
}

body.tools-shell .tool-view.studio-tool-view .tool-info-panel h1 {
  max-width: 760px;
  font-size: clamp(34px, 5vw, 56px);
  overflow-wrap: normal;
  text-wrap: balance;
}

body.tools-shell .tool-view.studio-tool-view .tool-info-panel p {
  max-width: 76ch;
}

.sprite-studio {
  display: grid;
  gap: 18px;
}

.studio-intro,
.studio-step-card,
.studio-empty {
  border: 1px solid rgba(161, 178, 255, 0.18);
  border-radius: 8px;
  background: rgba(6, 12, 34, 0.74);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.26);
}

.studio-intro,
.studio-empty {
  padding: 18px;
}

.studio-intro h2,
.studio-empty h2 {
  margin: 4px 0 8px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  letter-spacing: 0;
}

.studio-intro p,
.studio-empty p,
.studio-muted {
  margin: 0;
  color: rgba(235, 240, 255, 0.72);
  line-height: 1.55;
}

.studio-mode-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(107, 255, 185, 0.38);
  border-radius: 999px;
  padding: 4px 10px;
  color: #a9ffd3;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.studio-autosave-status {
  width: fit-content;
  min-height: 28px;
  border: 1px solid rgba(235, 240, 255, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
  color: rgba(235, 240, 255, 0.68);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.studio-autosave-status.is-saving {
  border-color: rgba(141, 183, 255, 0.38);
  color: #dbe6ff;
}

.studio-autosave-status.is-saved {
  border-color: rgba(107, 255, 185, 0.32);
  color: #a9ffd3;
}

.studio-autosave-status.is-failed {
  border-color: rgba(255, 112, 112, 0.42);
  color: #ffb4b4;
}

.studio-workspace-history {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(161, 178, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(6, 12, 34, 0.68);
}

.studio-workspace-history-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.studio-workspace-history-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.studio-workspace-history-title strong {
  color: #f7f9ff;
  font-size: 14px;
}

.studio-workspace-history-title span,
.studio-workspace-error {
  color: rgba(235, 240, 255, 0.62);
  font-size: 12px;
}

.studio-workspace-new-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(107, 255, 185, 0.44);
  border-radius: 999px;
  color: #a9ffd3;
  background: rgba(107, 255, 185, 0.1);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.studio-workspace-new-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.studio-workspace-strip {
  display: grid;
  grid-auto-columns: minmax(178px, 220px);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.studio-workspace-card,
.studio-workspace-empty,
.studio-workspace-skeleton {
  min-height: 96px;
  border: 1px solid rgba(235, 240, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.studio-workspace-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: #f7f9ff;
  cursor: pointer;
  text-align: left;
}

.studio-workspace-card.is-active {
  border-color: rgba(107, 255, 185, 0.56);
  background: rgba(107, 255, 185, 0.1);
}

.studio-workspace-card:disabled {
  cursor: wait;
  opacity: 0.72;
}

.studio-workspace-preview {
  display: grid;
  width: 64px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: rgba(235, 240, 255, 0.58);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 8px, transparent 8px 16px),
    rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.studio-workspace-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-workspace-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.studio-workspace-copy strong,
.studio-workspace-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-workspace-copy strong {
  font-size: 13px;
}

.studio-workspace-copy span {
  color: rgba(235, 240, 255, 0.64);
  font-size: 12px;
}

.studio-workspace-empty {
  display: grid;
  min-width: 220px;
  align-content: center;
  gap: 5px;
  padding: 12px;
  color: rgba(235, 240, 255, 0.68);
}

.studio-workspace-empty strong {
  color: #f7f9ff;
  font-size: 13px;
}

.studio-workspace-empty span {
  font-size: 12px;
  line-height: 1.4;
}

.studio-workspace-skeleton {
  min-width: 178px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

.studio-step-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.studio-block-history {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.studio-block-history-heading {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: rgba(235, 240, 255, 0.64);
  font-size: 12px;
  font-weight: 800;
}

.studio-block-history-heading strong {
  color: #f7f9ff;
  font-size: 13px;
}

.studio-block-history-heading span {
  color: rgba(235, 240, 255, 0.58);
}

.studio-block-history-error {
  color: #ffb4b4;
}

.studio-block-history-strip {
  --history-thumb-size: clamp(64px, 7vw, 82px);
  max-width: 100%;
}

.studio-history-empty {
  display: grid;
  min-width: var(--history-thumb-size, 72px);
  min-height: var(--history-thumb-size, 72px);
  place-items: center;
  border: 1px dashed rgba(235, 240, 255, 0.18);
  border-radius: 8px;
  color: rgba(235, 240, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
}

.studio-step-card.is-locked {
  opacity: 0.58;
}

.studio-step-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.studio-step-title-group {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.studio-step-card-action {
  display: flex;
  max-width: 260px;
  margin-left: auto;
  justify-content: flex-end;
}

.studio-step-index {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(107, 255, 185, 0.12);
  color: #6bffb9;
  font-size: 12px;
  font-weight: 800;
}

.studio-step-card h2 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.08;
  letter-spacing: 0;
}

.studio-step-card h3 {
  margin: 0;
  color: #f7f9ff;
  font-size: 14px;
  letter-spacing: 0;
}

.studio-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.studio-setup-character,
.studio-setup-action,
.studio-setup-model {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.studio-setup-character .asset-tray {
  grid-auto-columns: minmax(176px, 200px);
  justify-content: start;
  min-height: 200px;
}

.studio-setup-character .asset-chip,
.studio-setup-character .asset-add-slot {
  width: min(100%, 200px);
  max-width: 200px;
  height: 200px;
  min-height: 200px;
  border-radius: 8px;
}

.studio-setup-character .asset-add-slot.asset-add-slot-full {
  display: none;
}

.studio-start-pose-upload {
  width: 100%;
}

.studio-video-upload {
  width: 100%;
}

.studio-start-pose-upload label {
  display: grid;
  gap: 6px;
}

.studio-video-upload label {
  display: grid;
  gap: 6px;
}

.studio-start-pose-upload .field-label-text {
  color: rgba(235, 240, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.studio-video-upload .field-label-text {
  color: rgba(235, 240, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.studio-start-pose-upload .field-help {
  display: none;
}

.studio-video-upload .field-help {
  display: none;
}

.studio-start-pose-upload .asset-tray {
  grid-auto-columns: 64px;
  justify-content: center;
  min-height: 64px;
  margin-top: 0;
}

.studio-video-upload .asset-tray {
  grid-auto-columns: 64px;
  justify-content: center;
  min-height: 64px;
  margin-top: 0;
}

.studio-start-pose-upload .asset-chip,
.studio-start-pose-upload .asset-add-slot {
  width: 64px;
  border-radius: 8px;
  font-size: 18px;
}

.studio-video-upload .asset-chip,
.studio-video-upload .asset-add-slot {
  width: 64px;
  border-radius: 8px;
  font-size: 18px;
}

.studio-start-pose-upload-panel {
  display: grid;
  height: 100%;
  min-height: inherit;
  place-items: center;
}

.studio-video-upload-panel {
  display: grid;
  height: 100%;
  min-height: inherit;
  place-items: center;
}

.studio-start-pose-upload-panel label {
  width: 100%;
  height: 100%;
  min-height: inherit;
  align-content: center;
  border: 1px dashed rgba(16, 21, 34, 0.28);
  border-radius: 8px;
  padding: 18px;
  color: #101522;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.studio-video-upload-panel label {
  width: 100%;
  height: 100%;
  min-height: inherit;
  align-content: center;
  border: 1px dashed rgba(235, 240, 255, 0.22);
  border-radius: 8px;
  padding: 18px;
  color: #f7f9ff;
  background: rgba(6, 12, 34, 0.64);
  cursor: pointer;
}

.studio-start-pose-upload-panel .field-label-text {
  color: #101522;
  font-size: 15px;
}

.studio-video-upload-panel .field-label-text {
  color: #f7f9ff;
  font-size: 15px;
}

.studio-start-pose-upload-panel .asset-tray {
  grid-auto-columns: 112px;
  min-height: 112px;
}

.studio-video-upload-panel .asset-tray {
  grid-auto-columns: 112px;
  min-height: 112px;
}

.studio-start-pose-upload-panel .asset-chip,
.studio-start-pose-upload-panel .asset-add-slot {
  width: 112px;
  min-height: 112px;
  color: #101522;
  background: rgba(255, 255, 255, 0.72);
}

.studio-video-upload-panel .asset-chip,
.studio-video-upload-panel .asset-add-slot {
  width: 112px;
  min-height: 112px;
  color: #f7f9ff;
  background: rgba(12, 19, 48, 0.74);
}

.studio-button-spinner,
.studio-busy-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(235, 240, 255, 0.34);
  border-top-color: #a9ffd3;
  border-radius: 999px;
  animation: studio-spin 860ms linear infinite;
}

.studio-main-action.is-busy,
.studio-secondary-action.is-busy {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.studio-main-action.is-busy:disabled {
  opacity: 0.82;
}

.studio-busy-indicator {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(107, 255, 185, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f7f9ff;
  background: rgba(6, 12, 34, 0.72);
}

.studio-busy-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.studio-busy-copy strong {
  color: #f7f9ff;
  font-size: 14px;
}

.studio-busy-copy span {
  color: rgba(235, 240, 255, 0.66);
  font-size: 12px;
}

.studio-pose-preview-panel.is-busy {
  place-items: center;
}

@keyframes studio-spin {
  to {
    transform: rotate(360deg);
  }
}

.studio-start-pose-upload-replace {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 76px;
}

.studio-video-upload-replace {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 76px;
}

.studio-start-pose-upload-replace label {
  gap: 4px;
}

.studio-video-upload-replace label {
  gap: 4px;
}

.studio-start-pose-upload-replace .field-label-text {
  display: none;
}

.studio-video-upload-replace .field-label-text {
  display: none;
}

.studio-start-pose-upload-replace .asset-tray {
  grid-auto-columns: 56px;
  min-height: 56px;
}

.studio-video-upload-replace .asset-tray {
  grid-auto-columns: 56px;
  min-height: 56px;
}

.studio-start-pose-upload-replace .asset-chip,
.studio-start-pose-upload-replace .asset-add-slot {
  width: 56px;
  min-height: 56px;
  border-color: rgba(16, 21, 34, 0.28);
  color: #101522;
  background: rgba(255, 255, 255, 0.78);
}

.studio-video-upload-replace .asset-chip,
.studio-video-upload-replace .asset-add-slot {
  width: 56px;
  min-height: 56px;
  border-color: rgba(235, 240, 255, 0.24);
  color: #f7f9ff;
  background: rgba(12, 19, 48, 0.78);
}

.studio-pose-preview-panel {
  position: relative;
  display: grid;
  height: clamp(240px, 32vw, 360px);
  min-height: 240px;
  max-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(161, 178, 255, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 12%, rgba(139, 131, 255, 0.18), transparent 34%),
    radial-gradient(circle at 88% 28%, rgba(34, 240, 223, 0.08), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 20px),
    linear-gradient(135deg, rgba(8, 14, 35, 0.96), rgba(3, 9, 29, 0.98));
  background-size: auto, auto, 22px 22px, 20px 20px, auto;
}

.studio-video-preview-panel {
  position: relative;
  display: grid;
  width: 100%;
  height: clamp(240px, 32vw, 360px);
  min-height: 240px;
  max-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(161, 178, 255, 0.22);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 20px),
    linear-gradient(135deg, rgba(8, 14, 35, 0.96), rgba(3, 9, 29, 0.98));
}

.studio-padding-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.studio-keying-controls {
  grid-template-columns: minmax(150px, 190px) minmax(150px, 190px) max-content;
}

body.tools-shell .studio-keying-reextract {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 168px;
  border: 1px solid rgba(126, 146, 255, 0.34);
  border-radius: 8px;
  padding: 0 18px;
  color: #f7f9ff;
  background:
    linear-gradient(180deg, rgba(45, 60, 122, 0.94), rgba(22, 31, 76, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

body.tools-shell .studio-keying-reextract:hover {
  border-color: rgba(169, 255, 211, 0.52);
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(50, 73, 138, 0.96), rgba(25, 43, 92, 0.96));
}

body.tools-shell .studio-keying-reextract:focus-visible {
  outline: 2px solid rgba(169, 255, 211, 0.68);
  outline-offset: 3px;
}

body.tools-shell .studio-keying-reextract:disabled {
  border-color: rgba(235, 240, 255, 0.14);
  color: rgba(235, 240, 255, 0.42);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

.studio-padding-input-label {
  display: grid;
  gap: 8px;
  color: rgba(235, 240, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
}

.studio-padding-input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(235, 240, 255, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: #f7f9ff;
  background: rgba(0, 0, 0, 0.2);
  font: inherit;
}

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

.studio-padding-preview-panel {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(161, 178, 255, 0.22);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 20px),
    linear-gradient(135deg, rgba(8, 14, 35, 0.96), rgba(3, 9, 29, 0.98));
}

.studio-padding-preview-panel.is-busy {
  align-content: center;
}

.studio-video-preview {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.studio-pose-preview-panel .studio-start-pose-upload-panel label {
  border-color: rgba(235, 240, 255, 0.2);
  color: #f7f9ff;
  background: rgba(6, 12, 34, 0.64);
}

.studio-pose-preview-panel .studio-start-pose-upload-panel .field-label-text {
  color: #f7f9ff;
}

.studio-pose-preview-panel .studio-start-pose-upload-panel .asset-chip,
.studio-pose-preview-panel .studio-start-pose-upload-panel .asset-add-slot {
  color: #f7f9ff;
  background: rgba(12, 19, 48, 0.74);
}

.studio-pose-preview-image {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
}

.studio-pose-preview-empty {
  display: grid;
  gap: 6px;
  max-width: 320px;
  padding: 18px;
  border: 1px dashed rgba(16, 21, 34, 0.32);
  border-radius: 8px;
  color: #101522;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.studio-pose-preview-empty strong {
  font-size: 15px;
}

.studio-pose-preview-empty span {
  color: rgba(16, 21, 34, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .studio-step-card-header {
    align-items: stretch;
  }

  .studio-step-title-group {
    width: 100%;
  }

  .studio-step-card-action {
    width: 100%;
    max-width: none;
    margin-left: 46px;
    justify-content: flex-start;
  }

  .studio-start-pose-upload .field-label-text {
    text-align: center;
  }

  .studio-start-pose-upload .asset-tray {
    justify-content: center;
  }

  .studio-padding-controls,
  .studio-padding-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.studio-character-drop {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px dashed rgba(235, 240, 255, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.studio-character-thumb {
  display: grid;
  width: 96px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(0, 255, 0, 0.35) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 255, 0, 0.35) 25%, transparent 25%),
    #10271d;
  color: #a9ffd3;
  font-weight: 800;
}

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

.studio-step-copy {
  display: grid;
  gap: 4px;
}

.studio-step-copy strong {
  color: #f7f9ff;
  overflow-wrap: anywhere;
}

.studio-step-copy span,
.studio-textarea-label,
.studio-file-input {
  color: rgba(235, 240, 255, 0.72);
  font-size: 14px;
}

.studio-file-input {
  width: 100%;
}

.studio-chip-row,
.studio-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.studio-chip {
  min-height: 42px;
  border: 1px solid rgba(235, 240, 255, 0.18);
  border-radius: 999px;
  padding: 8px 14px;
  color: rgba(235, 240, 255, 0.78);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.studio-chip.is-active {
  border-color: rgba(107, 255, 185, 0.62);
  color: #a9ffd3;
  background: rgba(107, 255, 185, 0.11);
}

.studio-textarea-label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.studio-action-prompt {
  min-height: 92px;
  resize: none;
  overflow: hidden;
  border: 1px solid rgba(235, 240, 255, 0.18);
  border-radius: 8px;
  padding: 12px;
  color: #f7f9ff;
  background: rgba(0, 0, 0, 0.2);
  font: inherit;
}

.studio-tool-selector {
  display: grid;
  gap: 8px;
  color: rgba(235, 240, 255, 0.72);
  font-size: 14px;
  font-weight: 700;
}

.studio-tool-selector-label {
  color: rgba(235, 240, 255, 0.78);
}

.studio-tool-select {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(235, 240, 255, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: #f7f9ff;
  background: rgba(0, 0, 0, 0.2);
  font: inherit;
}

.studio-parameter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(235, 240, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.studio-setup-model .studio-parameter-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.studio-setup-model .button-select {
  gap: 6px;
}

.studio-setup-model .aspect-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(68px, 88px));
  justify-content: start;
}

.studio-setup-model .aspect-option-grid .button-select-button {
  min-height: 58px;
  padding: 6px;
}

.studio-setup-model .image-size-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(86px, 120px));
  justify-content: start;
}

.studio-parameter-heading {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.studio-parameter-heading strong {
  color: #f7f9ff;
}

.studio-parameter-heading span {
  max-width: 100%;
  color: rgba(235, 240, 255, 0.62);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.studio-parameter-field {
  min-width: 0;
}

.studio-parameter-field.prompt-field {
  grid-column: 1 / -1;
}

.studio-warning {
  margin: 0;
  border: 1px solid rgba(255, 211, 112, 0.34);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffe4a0;
  background: rgba(255, 211, 112, 0.08);
  line-height: 1.45;
}

.studio-main-action,
.studio-secondary-action {
  min-height: 44px;
}

.studio-preview-badge {
  position: absolute;
  right: 14px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.studio-preview-badge {
  top: 14px;
  color: #101522;
  background: #ffd370;
}

.studio-frame-grid {
  --studio-frame-cell-size: clamp(112px, 8vw, 136px);
  display: grid;
  grid-template-columns: repeat(8, minmax(48px, 1fr));
  grid-auto-rows: var(--studio-frame-cell-size);
  align-content: start;
  gap: 10px;
}

.studio-frame-mode-row {
  align-items: center;
}

.studio-selected-frame-preview {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(235, 240, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(9, 15, 38, 0.94);
  backdrop-filter: blur(14px);
}

.studio-selected-frame-preview-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.studio-selected-frame-preview-heading strong {
  color: #f7f9ff;
}

.studio-selected-frame-preview-heading span {
  color: rgba(235, 240, 255, 0.64);
  font-size: 13px;
}

.studio-selected-frame-stage {
  --studio-selected-frame-stage-height: clamp(360px, 52vw, 600px);
  display: grid;
  height: var(--studio-selected-frame-stage-height);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(161, 178, 255, 0.18);
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.055) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, rgba(8, 14, 35, 0.96), rgba(3, 9, 29, 0.98));
}

.studio-selected-frame-playback {
  width: auto;
  height: var(--studio-selected-frame-stage-height);
  max-width: 100%;
  max-height: var(--studio-selected-frame-stage-height);
  object-fit: contain;
}

.studio-frame-cell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(235, 240, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.studio-frame-cell {
  display: grid;
  height: var(--studio-frame-cell-size);
  min-height: 0;
  place-items: center;
  contain: layout paint;
  scroll-snap-align: start;
  color: rgba(235, 240, 255, 0.7);
  cursor: pointer;
}

.studio-frame-select {
  padding: 0;
}

.studio-frame-select.is-selected {
  border-color: rgba(107, 255, 185, 0.7);
  background: rgba(107, 255, 185, 0.1);
  box-shadow: inset 0 0 0 2px rgba(107, 255, 185, 0.18);
}

.studio-frame-select.is-excluded {
  opacity: 0.42;
  filter: grayscale(0.72);
}

.studio-frame-cell img {
  width: auto;
  height: auto;
  max-width: calc(100% - 18px);
  max-height: calc(100% - 28px);
  object-fit: contain;
}

.studio-frame-number {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
}

.studio-frame-check {
  position: absolute;
  right: 5px;
  bottom: 5px;
  border-radius: 999px;
  padding: 3px 6px;
  color: #101522;
  background: #a9ffd3;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.studio-frame-select.is-excluded .studio-frame-check {
  color: rgba(235, 240, 255, 0.78);
  background: rgba(16, 21, 34, 0.82);
}

.studio-frame-figure {
  width: 26%;
  height: 54%;
  border-radius: 999px 999px 24% 24%;
  background: #f7f9ff;
  transform: translateX(calc(var(--frame-shift) * 4px)) rotate(calc(var(--frame-shift) * 2deg));
}

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

.studio-export-item {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(235, 240, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.studio-export-item strong {
  color: #f7f9ff;
}

.studio-export-item span {
  color: rgba(235, 240, 255, 0.66);
  font-size: 13px;
}

.studio-export-item .ghost-button {
  width: 100%;
  justify-content: center;
}

.studio-export-progress {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(105, 231, 194, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(5, 20, 32, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.studio-frame-progress {
  width: min(100%, 560px);
}

.studio-export-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #f7f9ff;
  font-size: 13px;
}

.studio-export-progress-head span,
.studio-export-progress-detail {
  color: rgba(235, 240, 255, 0.7);
  font-size: 12px;
}

.studio-export-progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(235, 240, 255, 0.12);
}

.studio-export-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69e7c2, #8db7ff);
  transition: width 160ms ease;
}

.studio-export-progress.is-failed {
  border-color: rgba(255, 112, 112, 0.4);
}

.studio-export-progress.is-failed .studio-export-progress-fill {
  background: linear-gradient(90deg, #ff7070, #ffb07c);
}

.studio-export-progress-detail {
  margin: 0;
}

@media (max-width: 1180px) {
  .studio-frame-grid {
    grid-template-columns: repeat(6, minmax(46px, 1fr));
  }
}

@media (max-width: 860px) {
  body.tools-shell .tool-view.studio-tool-view .tool-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.tools-shell .tool-view.studio-tool-view .tool-form {
    order: 1;
  }

  .studio-setup-grid,
  .studio-parameter-panel,
  .studio-export-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-pose-preview-panel {
    height: 240px;
    min-height: 220px;
  }

  .studio-frame-grid {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
}

@media (max-width: 560px) {
  .studio-character-drop {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-character-thumb {
    width: 100%;
    max-width: 180px;
  }
}
