@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=codex-transcript-order-20260710a");
@import url("/style-chunks/09-full-site-shell.css?v=frontend-split-20260623a");
@import url("/style-chunks/10-motion-admin.css?v=admin-actions-20260711a");
@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");
@import url("/style-chunks/14-site-motion-light.css?v=cyber-motion-20260710a");
@import url("/style-chunks/15-pricing.css?v=pricing-usage-20260712b");

/* 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.4;
  text-align: right;
  letter-spacing: 0;
  user-select: text;
}

body.tools-shell .site-version nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-right: 16px;
}

body.tools-shell .site-version a {
  color: rgba(216, 226, 255, 0.72);
  text-decoration: none;
}

body.tools-shell .site-version a:hover,
body.tools-shell .site-version a:focus-visible {
  color: rgba(244, 248, 255, 0.96);
  text-decoration: underline;
}

@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;
  }
}

/* Desktop core workspace refinement.
 * Keep the page shell fixed while settings, history, and results scroll inside
 * their own work areas. This layer intentionally targets the five primary
 * desktop experiences without changing the shared tool data contract. */
body.tools-shell .generation-empty-state {
  display: none;
}

@media (min-width: 921px) {
  body.tools-shell[data-page-shell="chat"],
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body.tools-shell[data-page-shell="chat"] .shell,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.tools-shell[data-page-shell="chat"] .site-version,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .site-version {
    position: fixed;
    right: 14px;
    bottom: 4px;
    z-index: 6;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  /* Text Chat: conversation history and messages scroll independently so the
   * composer never leaves the viewport. */
  body.tools-shell[data-page-shell="chat"] .chat-view,
  body.tools-shell[data-page-shell="chat"] .chat-layout {
    height: 100dvh;
    min-height: 0;
  }

  body.tools-shell[data-page-shell="chat"] .chat-layout {
    grid-template-columns: minmax(260px, 304px) minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    padding: 12px;
  }

  body.tools-shell[data-page-shell="chat"] .chat-panel,
  body.tools-shell[data-page-shell="chat"] .chat-workspace {
    height: calc(100dvh - 24px);
    min-height: 0;
    max-height: calc(100dvh - 24px);
  }

  body.tools-shell[data-page-shell="chat"] .chat-panel {
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
  }

  body.tools-shell[data-page-shell="chat"] .chat-panel h1 {
    margin-top: -4px;
    font-size: 28px;
  }

  body.tools-shell[data-page-shell="chat"] .chat-conversation-list,
  body.tools-shell[data-page-shell="chat"] .chat-messages {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.tools-shell[data-page-shell="chat"] .chat-messages {
    padding: 18px clamp(18px, 3vw, 42px);
  }

  body.tools-shell[data-page-shell="chat"] .chat-message {
    max-width: min(820px, 86%);
  }

  body.tools-shell[data-page-shell="chat"] .chat-composer {
    flex: 0 0 auto;
    padding: 12px;
    background: rgba(3, 9, 29, 0.94);
    backdrop-filter: blur(18px);
  }

  body.tools-shell[data-page-shell="chat"] .chat-composer textarea {
    min-height: 54px;
    max-height: 180px;
    padding: 15px 92px 15px 15px;
  }

  body.tools-shell[data-page-shell="chat"] .chat-send-button {
    right: 22px;
    bottom: 21px;
  }

  /* Image, Video, and Voice: compact header, settings rail, persistent action,
   * and a preview surface that occupies the rest of the desktop viewport. */
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) {
    --catalog-content-max: 1560px;
    --core-workspace-gap: 12px;
    --core-settings-width: clamp(390px, 31vw, 500px);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-view,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-layout {
    height: 100dvh;
    min-height: 0;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-layout {
    grid-template-columns: var(--core-settings-width) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "info info"
      "prompt stage"
      "controls stage";
    gap: var(--core-workspace-gap);
    padding: 12px max(16px, calc((100% - var(--catalog-content-max)) / 2));
    overflow: hidden;
    background:
      radial-gradient(circle at 78% 4%, rgba(112, 77, 225, 0.14), transparent 28%),
      linear-gradient(180deg, #03091d, #020714 82%);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-info-panel,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .prompt-field-list,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-form,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .run-panel {
    border-color: rgba(126, 146, 255, 0.18);
    border-radius: 12px;
    background: rgba(7, 14, 35, 0.88);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-info-panel {
    display: grid;
    min-height: 64px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 18px;
    align-items: center;
    padding: 10px 18px;
    background: rgba(7, 14, 35, 0.92);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-info-panel::after,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-hero-image {
    display: none;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-info-panel h1 {
    margin: 0;
    color: #f7f8ff;
    font-size: clamp(26px, 2vw, 32px);
    line-height: 1;
    letter-spacing: -0.03em;
    text-shadow: none;
    white-space: nowrap;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-info-panel > p:last-child {
    min-width: 0;
    max-width: none;
    margin: 0;
    overflow: hidden;
    color: rgba(213, 220, 244, 0.66);
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) :is(.prompt-field-list) {
    min-height: 0;
    max-height: 196px;
    gap: 10px;
    align-items: stretch;
    overflow: hidden;
    padding: 10px;
  }

  body.tools-shell[data-page="imageGeneration"] :is(.prompt-field-list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tools-shell:is(
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) :is(.prompt-field-list) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .prompt-field-list .field {
    min-height: 0;
    padding: 0;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .prompt-field textarea {
    min-height: 86px;
    height: 86px;
    max-height: 108px;
    padding: 11px 12px;
    resize: vertical;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .field-help {
    margin-top: 5px;
    color: rgba(213, 220, 244, 0.68);
    font-size: 11px;
    line-height: 1.35;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-form {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 10px 10px 0;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .field-list {
    min-height: 0;
    align-content: start;
    gap: 10px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 4px 10px 0;
    scrollbar-gutter: stable;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .image-model-card {
    min-height: 70px;
    padding: 9px 10px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .image-model-card-preview {
    width: 48px;
    min-width: 48px;
    height: 48px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .form-footer {
    position: relative;
    z-index: 2;
    margin: 0 -10px;
    padding: 10px;
    border-top: 1px solid rgba(126, 146, 255, 0.18);
    background: rgba(5, 11, 29, 0.96);
    box-shadow: 0 -12px 28px rgba(2, 7, 20, 0.28);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .submit-button {
    min-height: 44px;
    border-radius: 9px;
    box-shadow: 0 10px 24px rgba(83, 74, 218, 0.24);
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .run-panel {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: 72px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    padding: 10px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .history-carousel {
    --history-thumb-size: 64px;
    width: 100%;
    max-width: none;
    min-height: 64px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) [aria-label="Generation preview"] {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    justify-self: stretch;
    overflow: auto;
    overscroll-behavior: contain;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) :is(.result-image, .result-video, .result-model-viewer) {
    max-width: 100%;
    max-height: calc(100dvh - 190px);
    object-fit: contain;
  }

  /* AI Tools: a compact branded header, one-row filter rail, and actual tool
   * cards in the first viewport. */
  body.tools-shell[data-page-shell="tools"] {
    --catalog-content-max: 1560px;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tools-layout {
    padding: 0 16px 32px;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tools-header {
    gap: 10px;
    padding-bottom: 12px;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tools-hero {
    min-height: 132px;
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 0;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tools-hero::before {
    background:
      linear-gradient(90deg, rgba(3, 9, 29, 0.98), rgba(3, 9, 29, 0.82) 52%, rgba(3, 9, 29, 0.38)),
      linear-gradient(180deg, rgba(3, 9, 29, 0.12), rgba(3, 9, 29, 0.62));
  }

  body.tools-shell[data-page-shell="tools"] .tools-hero-art {
    opacity: 0.58;
    filter: saturate(0.82) contrast(1.04);
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .section-heading h1 {
    font-size: clamp(42px, 4vw, 56px);
    line-height: 0.96;
    letter-spacing: -0.035em;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tools-intro {
    max-width: 680px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.5;
  }

  body.tools-shell[data-page-shell="tools"] .tools-toolbar,
  body.tools-shell[data-page-shell="tools"] :is(.tool-search, .tool-sort, .tool-view-toggle) {
    min-height: 48px;
  }

  body.tools-shell[data-page-shell="tools"] .tool-sort {
    min-width: 200px;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .category-row.tool-tag-filter-row {
    display: flex;
    max-height: 44px;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 0 5px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .category-row.tool-tag-filter-row .category-item {
    min-height: 36px;
    gap: 8px;
    padding: 0 14px;
    border-radius: 9px;
    box-shadow: none;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .category-row.tool-tag-filter-row .category-item strong {
    min-width: 20px;
    height: 20px;
    font-size: 12px;
  }

  body.tools-shell[data-page-shell="tools"] .tools-view .tool-grid {
    gap: 14px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .lyfi-web-pet,
  body.tools-shell[data-page-shell="tools"] .lyfi-web-pet {
    display: none;
  }

  body.tools-shell[data-page="imageGeneration"] :is(.prompt-field-list) {
    grid-template-columns: minmax(0, 1fr);
    max-height: 270px;
    overflow-y: auto;
  }

  body.tools-shell[data-page="imageGeneration"] .prompt-field:first-child textarea {
    min-height: 82px;
    height: 82px;
  }

  body.tools-shell[data-page="imageGeneration"] .prompt-field:last-child textarea {
    min-height: 52px;
    height: 52px;
  }

  body.tools-shell[data-page="imageGeneration"] .prompt-field:last-child .field-help {
    display: none;
  }

  body.tools-shell[data-page="imageGeneration"] .prompt-field {
    height: auto;
  }

  body.tools-shell[data-page="voiceGeneration"] .audio-sample-name {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: normal;
    word-break: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    line-height: 1.15;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .image-model-card-body > span:last-child,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .image-model-field > .field-help {
    display: none;
  }

  body.tools-shell[data-page="videoGeneration"] .field-list > .asset-field {
    order: 5;
  }

  body.tools-shell[data-page="videoGeneration"] .field-list > .seed-field,
  body.tools-shell[data-page="videoGeneration"] .field-list > .field:has([data-arg-name="seed"]) {
    order: 10;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) #dynamicFields:empty::before {
    content: "Loading workspace settings";
    display: grid;
    min-height: 180px;
    place-items: center;
    border: 1px dashed rgba(126, 146, 255, 0.22);
    border-radius: 10px;
    color: rgba(213, 220, 244, 0.62);
    background:
      linear-gradient(100deg, transparent 20%, rgba(126, 146, 255, 0.08) 42%, transparent 64%) 0 0 / 220% 100%,
      rgba(5, 11, 29, 0.56);
    font-size: 13px;
    animation: core-workspace-loading 1.6s ease-in-out infinite;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .tool-form:has(#dynamicFields:empty) .submit-button {
    cursor: wait;
    opacity: 0.48;
    filter: saturate(0.4);
    box-shadow: none;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .field-list {
    scroll-padding-bottom: 28px;
    padding-bottom: 28px;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) [aria-label="Generation preview"] {
    position: relative;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) .generation-empty-state {
    display: block;
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(360px, calc(100% - 48px));
    margin: 0;
    transform: translate(-50%, -50%);
    color: rgba(213, 220, 244, 0.62);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
  }

  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) [aria-label="Generation preview"]:not(:has(#results:empty)) .generation-empty-state,
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) [aria-label="Generation preview"]:has(.rose-loader:not(.hidden)) .generation-empty-state {
    display: none;
  }

  body.tools-shell #sessionUser {
    color: rgba(238, 242, 255, 0.78);
    font-weight: 700;
  }

  body.tools-shell :is(
    .field-list,
    .chat-conversation-list,
    .chat-messages,
    .history-strip,
    .category-row.tool-tag-filter-row
  ) {
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 146, 255, 0.42) rgba(3, 9, 29, 0.38);
  }

  body.tools-shell :is(
    .field-list,
    .chat-conversation-list,
    .chat-messages,
    .history-strip,
    .category-row.tool-tag-filter-row
  )::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  body.tools-shell :is(
    .field-list,
    .chat-conversation-list,
    .chat-messages,
    .history-strip,
    .category-row.tool-tag-filter-row
  )::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 146, 255, 0.42);
    background-clip: padding-box;
  }

  /* Shared AI Tool detail: keep the prompt, settings, primary action, history,
   * and preview inside one desktop viewport. Long schemas scroll inside their
   * own rails instead of pushing Generate below the fold. */
  body.tools-shell[data-page="tools"][data-page-shell="tool"]:has(.tool-view:not(.studio-tool-view)) {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"]:has(.tool-view:not(.studio-tool-view)) .shell,
  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view),
  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-layout {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-layout {
    grid-template-columns: minmax(400px, 0.92fr) minmax(0, 1.55fr);
    grid-template-rows: 132px minmax(180px, 0.42fr) minmax(0, 0.58fr);
    grid-template-areas:
      "info info"
      "prompt stage"
      "controls stage";
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px max(16px, calc((100% - var(--catalog-content-max)) / 2));
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-layout:has(.prompt-field-list.hidden) {
    grid-template-rows: 132px minmax(0, 1fr);
    grid-template-areas:
      "info info"
      "controls stage";
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-info-panel {
    display: grid;
    min-height: 0;
    grid-template-rows: auto auto auto;
    align-content: center;
    gap: 4px;
    padding: 12px min(48%, 620px) 12px 18px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-info-panel .back-link {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-info-panel h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 0.96;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-info-panel > p:last-child {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .prompt-field-list {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px;
    scrollbar-gutter: stable;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .prompt-field-list .field {
    min-height: 0;
    padding: 0;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .prompt-field textarea {
    min-height: 96px;
    max-height: 160px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .tool-form {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    padding: 12px 12px 0;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .field-list {
    min-height: 0;
    align-content: start;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 4px 16px 0;
    scrollbar-gutter: stable;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .form-footer {
    position: relative;
    z-index: 2;
    margin: 0 -12px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(126, 146, 255, 0.18);
    background: rgba(5, 11, 29, 0.96);
    box-shadow: 0 -12px 28px rgba(2, 7, 20, 0.28);
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .submit-button {
    min-height: 44px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .run-panel {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: 72px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    padding: 10px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) .history-carousel {
    --history-thumb-size: 64px;
    width: 100%;
    max-width: none;
    min-height: 64px;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"] .tool-view:not(.studio-tool-view) [aria-label="Generation preview"] {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  body.tools-shell[data-page="tools"][data-page-shell="tool"]:has(.tool-view:not(.studio-tool-view)) .site-version {
    position: fixed;
    right: 14px;
    bottom: 4px;
    z-index: 6;
    margin: 0;
    pointer-events: none;
  }
}

@keyframes core-workspace-loading {
  0% { background-position: 120% 0, 0 0; }
  100% { background-position: -120% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.tools-shell:is(
    [data-page="imageGeneration"],
    [data-page="videoGeneration"],
    [data-page="voiceGeneration"]
  ) #dynamicFields:empty::before {
    animation: none;
  }
}

/* Sprite Studio desktop workspace.
 * This page is a production surface, so wide screens prioritize the staged
 * controls and media previews instead of preserving article-sized gutters. */
@media (min-width: 1181px) {
  body.tools-shell .tool-view.studio-tool-view .tool-layout {
    width: 100%;
    max-width: none;
    gap: 14px;
    margin: 0;
    padding: 12px clamp(20px, 1.45vw, 28px) 40px;
  }

  body.tools-shell .tool-view.studio-tool-view .tool-info-panel {
    min-height: 132px;
    padding: 16px 20px;
    border-color: rgba(126, 146, 255, 0.2);
    background: rgba(5, 11, 30, 0.9);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
  }

  body.tools-shell .tool-view.studio-tool-view .tool-info-panel h1 {
    max-width: none;
    font-size: clamp(40px, 3vw, 50px);
    line-height: 0.98;
  }

  .sprite-studio {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
  }

  .sprite-studio > :is(.studio-autosave-status, .studio-workspace-history),
  .sprite-studio > .studio-step-card:not([data-studio-step-index="1"]):not([data-studio-step-index="2"]) {
    grid-column: 1 / -1;
  }

  .sprite-studio > [data-studio-step-index="1"] {
    grid-column: span 5;
  }

  .sprite-studio > [data-studio-step-index="2"] {
    grid-column: span 7;
  }

  .studio-workspace-history,
  .studio-step-card {
    border-color: rgba(126, 146, 255, 0.2);
    background: rgba(4, 10, 28, 0.92);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  }

  .studio-workspace-history {
    gap: 10px;
    padding: 12px;
  }

  .studio-workspace-card,
  .studio-workspace-empty,
  .studio-workspace-skeleton {
    min-height: 82px;
  }

  .studio-workspace-card {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 8px;
  }

  .studio-workspace-preview {
    width: 56px;
  }

  .studio-step-card {
    gap: 12px;
    padding: 14px;
  }

  .studio-step-card.is-active {
    border-color: rgba(107, 255, 185, 0.5);
    box-shadow:
      inset 0 1px 0 rgba(169, 255, 211, 0.06),
      0 18px 42px rgba(0, 0, 0, 0.26);
  }

  .studio-step-card.is-active .studio-step-index {
    color: #071a16;
    background: #8ff4c4;
    box-shadow: 0 0 0 5px rgba(107, 255, 185, 0.1);
  }

  .studio-setup-grid {
    grid-template-columns: minmax(220px, 280px) minmax(320px, 0.9fr) minmax(520px, 1.45fr);
    gap: 14px;
  }

  .studio-setup-grid > * + * {
    border-left: 1px solid rgba(126, 146, 255, 0.14);
    padding-left: 14px;
  }

  .studio-setup-model .studio-parameter-panel,
  [data-studio-step-index="3"] > .studio-parameter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-studio-step-index="1"] .studio-pose-preview-panel,
  [data-studio-step-index="2"] .studio-padding-preview-panel {
    height: 300px;
    min-height: 260px;
    max-height: 300px;
  }

  [data-studio-step-index="2"] .studio-padding-controls {
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  }

  [data-studio-step-index="3"] {
    grid-template-columns: minmax(360px, 0.78fr) minmax(560px, 1.22fr);
    grid-template-areas:
      "video-head video-head"
      "video-status video-status"
      "video-presets video-parameters"
      "video-prompt video-parameters"
      "video-model video-parameters"
      "video-warning video-parameters"
      "video-actions video-parameters"
      "video-busy video-busy";
    column-gap: 16px;
    align-items: start;
  }

  [data-studio-step-index="3"] > .studio-step-card-header {
    grid-area: video-head;
  }

  [data-studio-step-index="3"] > .studio-muted {
    grid-area: video-status;
  }

  [data-studio-step-index="3"] > .studio-chip-row {
    grid-area: video-presets;
  }

  [data-studio-step-index="3"] > .studio-textarea-label {
    grid-area: video-prompt;
  }

  [data-studio-step-index="3"] > .studio-tool-selector {
    grid-area: video-model;
  }

  [data-studio-step-index="3"] > .studio-parameter-panel {
    grid-area: video-parameters;
    align-self: stretch;
  }

  [data-studio-step-index="3"] > .studio-warning {
    grid-area: video-warning;
  }

  [data-studio-step-index="3"] > .studio-action-row {
    grid-area: video-actions;
  }

  [data-studio-step-index="3"] > .studio-busy-indicator {
    grid-area: video-busy;
  }

  [data-studio-step-index="3"] .studio-video-prompt {
    min-height: 190px;
    max-height: 260px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
  }

  [data-studio-step-index="5"] {
    grid-template-columns: minmax(340px, 0.72fr) minmax(600px, 1.28fr);
    grid-template-areas:
      "frames-head frames-head"
      "frames-summary frames-summary"
      "frames-modes frames-modes"
      "frames-keying frames-keying"
      "frames-preview frames-grid"
      "frames-progress frames-progress"
      "frames-actions frames-actions";
    column-gap: 16px;
    align-items: start;
  }

  [data-studio-step-index="5"] > .studio-step-card-header {
    grid-area: frames-head;
  }

  [data-studio-step-index="5"] > .studio-muted {
    grid-area: frames-summary;
  }

  [data-studio-step-index="5"] > .studio-frame-mode-row {
    grid-area: frames-modes;
  }

  [data-studio-step-index="5"] > .studio-keying-controls {
    grid-area: frames-keying;
  }

  [data-studio-step-index="5"] > .studio-selected-frame-preview {
    grid-area: frames-preview;
  }

  [data-studio-step-index="5"] > .studio-export-progress {
    grid-area: frames-progress;
  }

  [data-studio-step-index="5"] > .studio-frame-grid {
    grid-area: frames-grid;
  }

  [data-studio-step-index="5"] > .studio-action-row {
    grid-area: frames-actions;
  }

  .studio-selected-frame-stage {
    --studio-selected-frame-stage-height: clamp(340px, 28vw, 460px);
  }

  [data-studio-step-index="5"] .studio-frame-grid {
    --studio-frame-cell-size: clamp(84px, 6vw, 104px);
  }

  [data-studio-step-index="5"] .studio-frame-check {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    padding: 0;
    font-size: 0;
  }

  [data-studio-step-index="5"] .studio-frame-check::before {
    content: "\2713";
    font-size: 11px;
    line-height: 1;
  }

  [data-studio-step-index="5"] .studio-frame-select.is-excluded .studio-frame-check::before {
    content: "\2013";
    font-size: 12px;
  }
}

@media (min-width: 1500px) {
  [data-studio-step-index="5"] .studio-frame-grid {
    grid-template-columns: repeat(10, minmax(56px, 1fr));
  }
}
