:root {
  --studio-bg: #f4f6fb;
  --studio-panel: #ffffff;
  --studio-panel-soft: #f8fafc;
  --studio-soft: #f8fafc;
  --studio-border: #e5e7eb;
  --studio-border-strong: #d1d5db;
  --studio-text: #121826;
  --studio-muted: #667085;
  --studio-faint: #98a2b3;
  --studio-black: #111827;
  --studio-green: #16864f;
  --studio-blue: #1477e8;
  --studio-accent-strong: #111827;
  --studio-accent-foreground: #ffffff;
}

/* 2026-06-08 clean creator workspace refresh. */
body[data-panel="studio"],
body[data-panel="studio"].theme-dark {
  --studio-bg: #f4f7fb;
  --studio-panel: #ffffff;
  --studio-panel-soft: #f8fafc;
  --studio-soft: #eef3f7;
  --studio-border: #d9e4ec;
  --studio-border-strong: #a9c6d6;
  --studio-text: #0f172a;
  --studio-muted: #64748b;
  --studio-faint: #94a3b8;
  --studio-black: #0f172a;
  --studio-green: #099268;
  --studio-blue: #0e7490;
  --studio-accent-strong: #0f172a;
  --studio-accent-foreground: #ffffff;
  color: var(--studio-text);
  background:
    radial-gradient(circle at 20% 0%, rgba(14, 116, 144, 0.12), transparent 30%),
    radial-gradient(circle at 82% 6%, rgba(245, 158, 11, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%);
}

body[data-panel="studio"] .studio-shell {
  max-width: 1720px;
  gap: 12px;
  padding: 12px;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace,
body[data-panel="studio"] .composer-card,
body[data-panel="studio"] .result-thread {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace {
  border-radius: 18px;
}

body[data-panel="studio"] .rail-brand strong,
body[data-panel="studio"] .workspace-title h1,
body[data-panel="studio"] .thread-head h2,
body[data-panel="studio"] .history-panel-head h2 {
  color: #0f172a;
}

body[data-panel="studio"] .rail-brand span,
body[data-panel="studio"] .rail-copy small,
body[data-panel="studio"] .preview-footer,
body[data-panel="studio"] #promptCount,
body[data-panel="studio"] .status {
  color: #64748b;
}

body[data-panel="studio"] .rail-action {
  min-height: 50px;
  border-radius: 10px;
  color: #334155;
}

body[data-panel="studio"] .rail-action.rail-active,
body[data-panel="studio"] .rail-action.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a 0%, #164e63 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

body[data-panel="studio"] .rail-action.rail-active .rail-icon,
body[data-panel="studio"] .rail-action.active .rail-icon {
  color: #0f172a;
  background: #67e8f9;
}

body[data-panel="studio"] .rail-logo,
body[data-panel="studio"] .rail-collapse,
body[data-panel="studio"] .rail-icon,
body[data-panel="studio"] .rail-wallet,
body[data-panel="studio"] .rail-account,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] .account-pill,
body[data-panel="studio"] .collapse-history-button,
body[data-panel="studio"] .recharge-header-button,
body[data-panel="studio"] .history-trash,
body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button {
  border-color: rgba(148, 163, 184, 0.3);
  color: #334155;
  background: #ffffff;
}

body[data-panel="studio"] .workspace {
  background: rgba(255, 255, 255, 0.94);
}

body[data-panel="studio"] .workspace-header {
  min-height: 58px;
  padding: 10px 16px;
  border-bottom-color: #e2e8f0;
}

body[data-panel="studio"] .workspace-title h1 {
  font-size: 21px;
  line-height: 1.2;
}

body[data-panel="studio"] .workspace-badge {
  min-height: 24px;
  border: 1px solid #c7e7ef;
  color: #0e7490;
  background: #ecfeff;
}

body[data-panel="studio"] .workspace-badge.wallet {
  color: #087f5b;
  background: #ecfdf5;
  border-color: #b7ebce;
}

body[data-panel="studio"] .workspace-content {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.2fr);
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px var(--composer-safe-space);
  background: #f8fafc;
}

body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread {
  min-width: 0;
  border: 1px solid #dbe7ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

body[data-panel="studio"] .intro-panel {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 16px;
  overflow: hidden;
}

body[data-panel="studio"] .spark-icon {
  display: none;
}

body[data-panel="studio"] .intro-panel::before {
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0e7490;
  background: #ecfeff;
  font-size: 11px;
  font-weight: 800;
  content: "Prompt Deck";
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 16ch;
  margin: 0 0 14px;
  color: #0f172a;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
  opacity: 1 !important;
  animation: none !important;
}

body[data-panel="studio"] .prompt-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

body[data-panel="studio"] .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 4px 10px;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 130px;
  padding: 8px;
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  color: #0f172a;
  background: #ffffff;
  box-shadow: none;
  opacity: 1 !important;
  animation: none !important;
  transform: none;
}

body[data-panel="studio"] .prompt-card:hover {
  transform: translateY(-2px);
  border-color: #8bd3dd;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

body[data-panel="studio"] .prompt-cover {
  grid-row: 1 / span 3;
  width: 72px;
  height: 100%;
  min-height: 112px;
  border: 0;
  border-radius: 8px;
}

body[data-panel="studio"] .prompt-card span {
  width: fit-content;
  margin: 0;
  padding: 3px 7px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 10px;
  line-height: 1.2;
}

body[data-panel="studio"] .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card strong {
  margin: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card p {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-panel="studio"] .prompt-card small,
body[data-panel="studio"].history-opened .prompt-card small {
  display: none;
}

body[data-panel="studio"] .result-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: none;
  margin: 0;
  padding: 14px;
}

body[data-panel="studio"] .result-thread.is-visible {
  margin-bottom: 0;
}

body[data-panel="studio"] .thread-head {
  min-height: 32px;
  margin-bottom: 10px;
}

body[data-panel="studio"] #previewMeta {
  min-height: 26px;
  padding: 5px 9px;
  color: #0e7490;
  background: #ecfeff;
}

body[data-panel="studio"] .preview {
  min-height: clamp(360px, calc(100vh - var(--composer-safe-space) - 150px), 640px);
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  background:
    linear-gradient(rgba(14, 116, 144, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 116, 144, 0.05) 1px, transparent 1px),
    #f8fafc;
  background-size: 30px 30px;
}

body[data-panel="studio"] .preview-empty {
  padding: 18px;
}

body[data-panel="studio"] .preview-empty img {
  width: min(360px, 70%);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

body[data-panel="studio"] .preview-empty h3 {
  color: #0f172a;
}

body[data-panel="studio"] .preview-empty p,
body[data-panel="studio"] .preview-footer {
  color: #64748b;
}

body[data-panel="studio"] .composer-card {
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 16;
  padding: 10px 14px 12px;
  border: 1px solid #cbdde7;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -14px 40px rgba(15, 23, 42, 0.1);
  opacity: 1 !important;
  animation: none !important;
}

body[data-panel="studio"] .composer-resize {
  width: 86px;
  height: 16px;
  border-color: #dbe7ef;
  background: #ffffff;
}

body[data-panel="studio"] .composer-resize::before {
  width: 34px;
  height: 3px;
  margin-top: 6px;
  background: #94a3b8;
}

body[data-panel="studio"] .mode-tabs,
body[data-panel="studio"] .layout-tabs {
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}

body[data-panel="studio"] .mode-tabs button,
body[data-panel="studio"] .layout-tabs button {
  min-height: 30px;
  color: #475569;
}

body[data-panel="studio"] .mode-tabs button.active,
body[data-panel="studio"] .layout-tabs button.active,
body[data-panel="studio"] .generate-button,
body[data-panel="studio"] .primary-button,
body[data-panel="studio"] .new-chat-button {
  color: #ffffff;
  background: #0f172a;
  box-shadow: none;
}

body[data-panel="studio"] .generate-button {
  min-width: 120px;
  min-height: 42px;
  background: linear-gradient(135deg, #0f172a 0%, #155e75 100%);
}

body[data-panel="studio"] #prompt {
  min-height: 112px;
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  color: #0f172a;
  background: #f8fafc;
}

body[data-panel="studio"] #prompt::placeholder {
  color: #94a3b8;
}

body[data-panel="studio"] .price-chip {
  color: #087f5b;
  background: #ecfdf5;
}

body[data-panel="studio"] .billing-chip {
  color: #475569;
  background: #f1f5f9;
}

body[data-panel="studio"] .upload-box,
body[data-panel="studio"] .reference-preview,
body[data-panel="studio"] .storyboard-draft {
  border-color: #dbe7ef;
  border-radius: 10px;
  background: #f8fafc;
}

body[data-panel="studio"].history-opened .workspace-content {
  grid-template-columns: minmax(220px, 0.54fr) minmax(480px, 1.46fr);
  gap: 12px;
}

body[data-panel="studio"].history-opened .intro-panel {
  padding: 14px;
}

body[data-panel="studio"].history-opened .intro-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

body[data-panel="studio"].history-opened .prompt-tools {
  grid-template-columns: 1fr;
  gap: 7px;
}

body[data-panel="studio"].history-opened .prompt-card {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 66px;
  padding: 7px;
}

body[data-panel="studio"].history-opened .prompt-cover {
  grid-row: 1 / span 2;
  width: 50px;
  min-height: 52px;
}

body[data-panel="studio"].history-opened .prompt-card span {
  display: none;
}

body[data-panel="studio"].history-opened .prompt-card p {
  -webkit-line-clamp: 1;
}

body[data-panel="studio"].history-opened .preview {
  min-height: clamp(320px, calc(100vh - var(--composer-safe-space) - 210px), 430px);
}

body[data-panel="studio"].history-opened .preview-empty img {
  width: min(320px, 62%);
}

body[data-panel="studio"].history-opened .preview-empty p {
  display: none;
}

@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .studio-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed:not(.history-opened) .studio-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  body[data-panel="studio"]:not(.history-opened) .history-panel {
    display: none;
  }

  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 204px var(--history-width, 304px) minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed.history-opened .studio-shell {
    grid-template-columns: 78px var(--history-width, 304px) minmax(0, 1fr);
  }

  body[data-panel="studio"] .workspace-content,
  body[data-panel="studio"].history-opened .workspace-content {
    padding-bottom: var(--composer-safe-space);
  }
}

@media (max-width: 1500px) and (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"] .workspace-content,
  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .community-publish-success {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .community-publish-success > div:last-child {
    display: grid;
    grid-template-columns: 1fr;
  }

  .community-publish-success button {
    width: 100%;
  }

  .community-card-primary-actions,
  .community-card-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .community-card-secondary-actions {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .studio-shell {
    padding: 8px;
  }

  body[data-panel="studio"] .studio-rail {
    top: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .workspace-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  body[data-panel="studio"] .intro-panel,
  body[data-panel="studio"] .result-thread {
    padding: 12px;
    border-radius: 12px;
  }

  body[data-panel="studio"] .intro-panel h2 {
    max-width: none;
    font-size: 21px;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 66px minmax(0, 1fr);
    min-height: 94px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    grid-row: 1 / span 3;
    width: 66px;
    min-height: 78px;
  }

  body[data-panel="studio"] .prompt-card span {
    display: inline-flex;
  }

  body[data-panel="studio"] .prompt-card strong,
  body[data-panel="studio"].history-opened .prompt-card strong {
    white-space: normal;
  }

  body[data-panel="studio"] .preview {
    min-height: 320px;
  }

  body[data-panel="studio"] .composer-card {
    position: static;
    width: 100%;
    margin: 8px 0 0;
    padding: 18px 12px 12px;
    border-radius: 12px;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body[data-panel="studio"] .toolbar-top-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-panel="studio"] .toolbar-bottom-row {
    display: flex;
  }

  body[data-panel="studio"] .size-select {
    grid-column: 1 / -1;
  }

  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] #prompt {
    min-height: 114px;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  body[data-panel="studio"] .generate-button {
    width: 100%;
  }
}

/* 2026-06-16 community density correction: keep cards scan-friendly. */
body[data-panel="prompts"] .community-card {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 500px !important;
}

body[data-panel="prompts"] .community-cover {
  height: 148px !important;
  min-height: 148px !important;
  max-height: 148px !important;
}

body[data-panel="prompts"] .community-card > div:not(.library-card-actions) {
  min-height: 0 !important;
  overflow: hidden !important;
}

body[data-panel="prompts"] .community-card > div:not(.library-card-actions) > span:first-child {
  width: fit-content !important;
  max-width: 100% !important;
}

body[data-panel="prompts"] .community-card h3 {
  display: -webkit-box !important;
  overflow: hidden !important;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
}

body[data-panel="prompts"] .community-card p {
  -webkit-line-clamp: 2 !important;
}

body[data-panel="prompts"] .community-feedback-question {
  display: -webkit-box !important;
  max-height: 46px !important;
  overflow: hidden !important;
  padding: 8px 10px !important;
  line-height: 1.35 !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

body[data-panel="prompts"] .community-feedback-question span {
  display: none !important;
}

body[data-panel="prompts"] .community-card-metrics {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
}

body[data-panel="prompts"] .community-card-metrics.secondary {
  display: none !important;
}

body[data-panel="prompts"] .community-first-comment-hint,
body[data-panel="prompts"] .community-card-reuse-link,
body[data-panel="prompts"] .creator-reuse-insight {
  display: none !important;
}

body[data-panel="prompts"] .creator-card-insight {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  max-height: 52px !important;
  overflow: hidden !important;
  padding: 8px 10px !important;
}

body[data-panel="prompts"] .creator-card-insight span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-panel="prompts"] .library-card-tags {
  display: flex !important;
  flex-wrap: nowrap !important;
  min-height: 26px !important;
  overflow: hidden !important;
}

body[data-panel="prompts"] .library-card-tags em {
  min-height: 24px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

body[data-panel="prompts"] .community-card-actions {
  padding: 10px 12px 12px !important;
  border-top: 1px solid rgba(72, 84, 104, 0.10) !important;
}

body[data-panel="prompts"] .community-card-primary-actions,
body[data-panel="prompts"] .community-card-secondary-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body[data-panel="prompts"] .community-card-secondary-actions {
  display: none !important;
}

body[data-panel="prompts"] .community-card-actions button,
body[data-panel="prompts"] .community-own-work-pill {
  min-width: 0 !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  overflow: hidden !important;
  font-size: 11.5px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Visual refresh layer: clearer hierarchy, calmer surfaces, stronger image-first pages. */
:root {
  --studio-bg: #eef3f8;
  --studio-panel: #ffffff;
  --studio-panel-soft: #f6f8fb;
  --studio-soft: #f3f6fa;
  --studio-border: #dce3ea;
  --studio-border-strong: #c4ced9;
  --studio-text: #111827;
  --studio-muted: #637083;
  --studio-faint: #94a3b8;
  --studio-black: #101828;
  --studio-green: #12805c;
  --studio-blue: #2563eb;
  --composer-safe-space: 340px;
}

body {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09) 0%, rgba(18, 128, 92, 0.06) 34%, transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, var(--studio-bg) 100%);
}

.studio-shell {
  max-width: 1760px;
  gap: 14px;
  padding: 14px;
}

.studio-rail,
.history-panel,
.workspace,
.composer-card,
.result-thread,
.feature-panel {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.studio-rail {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
}

.rail-logo,
.rail-collapse,
.rail-icon {
  border-color: rgba(148, 163, 184, 0.24);
  background: #f7f9fc;
}

.rail-action {
  min-height: 52px;
  border-radius: 14px;
}

.rail-action:hover {
  background: #f7f9fc;
}

.rail-action.rail-active,
.rail-action.active {
  background: #101828;
  color: #fff;
  box-shadow: 0 14px 28px rgba(16, 24, 40, 0.16);
}

.rail-action.rail-active .rail-icon,
.rail-action.active .rail-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.rail-action.rail-active .rail-copy small,
.rail-action.active .rail-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.workspace {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
}

.workspace-header {
  min-height: 68px;
  padding: 14px 22px;
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

.workspace-title h1 {
  font-size: 25px;
  letter-spacing: 0;
}

.workspace-badge {
  min-height: 26px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1d4ed8;
}

.workspace-badge.wallet {
  background: #e9f8f0;
  color: #087443;
}

.ready-pill,
.account-pill,
.collapse-history-button,
.secondary-button,
.secondary-link {
  border-color: rgba(148, 163, 184, 0.32);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

body[data-panel="studio"] .workspace-content {
  padding-top: 30px;
}

body[data-panel="studio"] .intro-panel {
  max-width: 1180px;
}

body[data-panel="studio"] .spark-icon {
  display: none;
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 820px;
  margin-bottom: 26px;
  font-size: clamp(36px, 3.25vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

body[data-panel="studio"] .prompt-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
}

body[data-panel="studio"] .prompt-card {
  width: 100%;
  max-width: none;
  height: 216px;
  min-width: 0;
  border-color: rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

body[data-panel="studio"] .prompt-card:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

body[data-panel="studio"] .prompt-cover {
  flex-basis: 76px;
  height: 76px;
}

body[data-panel="studio"] .prompt-card span {
  background: #f1f5f9;
  color: #64748b;
}

body[data-panel="studio"] .prompt-card strong {
  color: #111827;
}

body[data-panel="studio"] .prompt-card p {
  color: #5f6b7a;
}

body[data-panel="studio"] .composer-card {
  bottom: 16px;
  border-radius: 24px;
  border-color: rgba(148, 163, 184, 0.26);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
}

.mode-tabs,
.layout-tabs {
  background: #eef2f6;
}

.mode-tabs button.active,
.layout-tabs button.active,
.generate-button,
.primary-button {
  background: #101828;
  color: #fff;
}

.select-pill,
.help-pill,
.price-chip,
.billing-chip {
  border-color: rgba(148, 163, 184, 0.3);
  background: #fff;
}

.price-chip {
  color: #087443;
  background: #e9f8f0;
}

.billing-chip {
  color: #475467;
  background: #f2f4f7;
}

textarea,
input,
select {
  border-color: rgba(148, 163, 184, 0.32);
}

.history-panel {
  border-radius: 24px;
}

.history-panel-head h2 {
  font-size: 22px;
}

.new-chat-button {
  border-radius: 14px;
  background: #101828;
}

.history-filters input {
  border-color: rgba(148, 163, 184, 0.3);
  background: #fff;
}

.feature-panel {
  max-width: none;
  border-radius: 24px;
  padding: 24px;
}

.feature-head {
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.feature-head h2 {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1.1;
}

.feature-head p {
  max-width: 760px;
  color: #536174;
  line-height: 1.7;
}

.feature-kicker {
  background: #eef2f6;
  color: #475467;
}

.prompt-library-panel {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.04), transparent 220px),
    rgba(255, 255, 255, 0.94);
}

.community-explainer {
  gap: 12px;
  margin-bottom: 16px;
}

.community-explainer div {
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #fff;
}

.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.community-card {
  overflow: hidden;
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.community-cover {
  aspect-ratio: 4 / 3;
  min-height: 0;
  background: #eef2f6;
}

.admin-console-panel {
  border-radius: 24px;
  border-color: rgba(148, 163, 184, 0.28);
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.admin-console-sidebar {
  background: #f8fafc;
}

.admin-console-nav button {
  border-radius: 12px;
}

.admin-console-nav button.active {
  background: #101828;
  color: #fff;
}

.admin-console-topbar {
  background: #fff;
}

.admin-surface,
.admin-list-surface,
.admin-overview-grid article,
.settings-grid article,
.api-doc-block,
.api-key-panel {
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .workspace-content {
    padding-inline: 26px;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    max-width: 880px;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    width: 100%;
    height: 190px;
  }
}

@media screen and (max-width: 760px) {
  body {
    background: #eef3f8;
  }

  body[data-panel="studio"] .studio-rail {
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }

  body[data-panel="studio"] .rail-brand strong {
    font-size: 15px;
  }

  body[data-panel="studio"] .workspace-content {
    padding: 20px 14px 14px;
    border-radius: 22px 22px 0 0;
  }

  body[data-panel="studio"] .intro-panel h2 {
    font-size: 22px;
    line-height: 1.2;
  }

  body[data-panel="studio"] .prompt-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: none;
  }

  body[data-panel="studio"] .prompt-card {
    grid-template-columns: 70px minmax(0, 1fr);
    height: auto;
    min-height: 104px;
    padding: 10px;
    box-shadow: none;
  }

  body[data-panel="studio"] .prompt-cover {
    width: 70px;
    height: 82px;
    flex-basis: auto;
  }

  body[data-panel="studio"] .prompt-card span {
    padding: 4px 10px;
    font-size: 11px;
  }

  body[data-panel="studio"] .prompt-card strong {
    font-size: 14px;
  }

  body[data-panel="studio"] .prompt-card p {
    font-size: 12px;
  }

  body[data-panel="studio"] .composer-card {
    border-radius: 0 0 22px 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }

  .feature-panel {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .feature-head h2 {
    font-size: 26px;
  }

  .community-explainer,
  .library-grid {
    grid-template-columns: 1fr;
  }
}

/* Visual QA refinements after desktop history-expanded review. */
body[data-panel="studio"] .prompt-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-panel="studio"] .prompt-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"].history-opened .intro-panel h2 {
  font-size: clamp(30px, 2.8vw, 38px);
}

body[data-panel="studio"].history-opened .prompt-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 660px;
}

body[data-panel="studio"].history-opened .prompt-card {
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  height: 132px;
  padding: 10px;
}

body[data-panel="studio"].history-opened .prompt-cover {
  grid-row: 1 / 4;
  width: 104px;
  height: 112px;
  border-radius: 12px;
}

body[data-panel="studio"].history-opened .prompt-card span,
body[data-panel="studio"].history-opened .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card small {
  margin-inline: 12px 0;
}

body[data-panel="studio"].history-opened .prompt-card span {
  margin-top: 0;
}

body[data-panel="studio"].history-opened .prompt-card strong {
  font-size: 13px;
}

body[data-panel="studio"].history-opened .prompt-card p {
  font-size: 11px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

body[data-panel="studio"].history-opened .composer-toolbar {
  grid-template-columns: minmax(96px, 128px) minmax(0, 1fr);
  align-items: start;
}

body[data-panel="studio"].history-opened .toolbar-top-row {
  display: grid;
  grid-template-columns: minmax(188px, 1.35fr) 44px repeat(3, minmax(112px, 1fr)) minmax(128px, auto);
  gap: 9px;
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 760px) {
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 78px minmax(0, 1fr);
    height: auto;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    width: 78px;
    height: 92px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--studio-text);
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 119, 232, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, var(--studio-bg) 100%);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

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

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

body.resizing-history,
body.resizing-history * {
  cursor: col-resize !important;
  user-select: none;
}

body.resizing-composer,
body.resizing-composer * {
  cursor: ns-resize !important;
  user-select: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.studio-shell {
  display: grid;
  grid-template-columns: 228px var(--history-width, 320px) minmax(0, 1fr);
  gap: 16px;
  height: 100vh;
  min-width: 1120px;
  padding: 16px;
  background: transparent;
  max-width: 1680px;
  margin: 0 auto;
}

.studio-rail,
.history-panel,
.workspace {
  border: 1px solid var(--studio-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(18px);
}

.studio-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.rail-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rail-logo,
.rail-collapse {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  color: #625e56;
  background: #fff;
}

.rail-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 10px;
}

.rail-logo svg {
  width: 18px;
  height: 18px;
}

.rail-brand {
  display: block;
  min-width: 0;
  flex: 1;
  padding: 8px 8px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.rail-brand:hover {
  background: rgba(255, 255, 255, 0.68);
}

.rail-brand strong,
.rail-brand span,
.rail-copy strong,
.rail-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-brand strong {
  color: #111827;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: 0;
}

.rail-brand span {
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: 12px;
}

.rail-nav {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.rail-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #344054;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  text-align: left;
}

.rail-action:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.72);
}

.rail-action.rail-active,
.rail-action.active {
  color: #111827;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.rail-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 15px;
  color: #667085;
  background: #f2f4f7;
}

.rail-action.rail-active .rail-icon,
.rail-action.active .rail-icon {
  color: #fff;
  background: var(--studio-black);
}

.rail-copy {
  display: block;
  min-width: 0;
}

.rail-copy strong {
  color: inherit;
  font-size: 14px;
  font-weight: 760;
}

.rail-copy small {
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: 12px;
}

.rail-action.rail-active .rail-copy small,
.rail-action.active .rail-copy small {
  color: #667085;
}

.rail-bottom {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.rail-wallet,
.rail-account {
  display: grid;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--studio-border);
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.rail-wallet {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 16px;
}

.rail-wallet span {
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 720;
}

.rail-wallet strong {
  min-width: 0;
  overflow: hidden;
  color: var(--studio-green);
  font-size: 17px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-account {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 16px;
  color: #344054;
}

.rail-account svg {
  flex: 0 0 auto;
}

.rail-account span {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-collapsed .studio-shell {
  grid-template-columns: 92px var(--history-width, 320px) minmax(0, 1fr);
}

.rail-collapsed .studio-rail {
  align-items: center;
  padding: 12px 10px;
}

.rail-collapsed .rail-top {
  flex-direction: column;
}

.rail-collapsed .rail-brand,
.rail-collapsed .rail-copy,
.rail-collapsed .rail-wallet span,
.rail-collapsed .rail-wallet strong,
.rail-collapsed .rail-account span {
  display: none;
}

.rail-collapsed .rail-collapse svg {
  transform: rotate(180deg);
}

.rail-collapsed .rail-action {
  justify-content: center;
  width: 56px;
  min-height: 56px;
  padding: 10px;
}

.rail-collapsed .rail-wallet,
.rail-collapsed .rail-account {
  display: grid;
  place-items: center;
  width: 56px;
  min-height: 48px;
  padding: 0;
}

.rail-collapsed .rail-wallet::before {
  color: var(--studio-green);
  font-size: 12px;
  font-weight: 780;
  content: "充值";
}

.history-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  position: relative;
  overflow: hidden;
}

.history-resize {
  position: absolute;
  top: 44%;
  right: -10px;
  z-index: 16;
  width: 18px;
  height: 98px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  cursor: col-resize;
  touch-action: none;
}

.history-resize::before {
  display: block;
  width: 3px;
  height: 42px;
  margin: 27px auto;
  border-radius: 999px;
  background: #c8c5bd;
  content: "";
}

.history-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 14px;
}

.history-panel-head h2 {
  margin: 0;
  color: #171512;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
}

.history-panel-head span {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #77736d;
  background: #fff;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.history-actions {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  padding: 0 16px 12px;
}

.new-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 16px;
  color: #fff;
  background: var(--studio-black);
  font-size: 14px;
  font-weight: 760;
}

.history-trash {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  color: #858078;
  background: rgba(255, 255, 255, 0.75);
}

.history-trash.confirming {
  color: #9b2f24;
  background: #fff0ed;
  border-color: #efc9c1;
}

.history-filters {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
  border-bottom: 1px solid var(--studio-border);
  background: rgba(255, 255, 255, 0.72);
}

.history-filters input {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  color: #2b2823;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.history-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.history-filter-row::-webkit-scrollbar {
  display: none;
}

.history-filter-row button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #625d55;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.history-filter-row button.active {
  border-color: #171512;
  color: #fff;
  background: #171512;
}

.history-row-actions button:disabled {
  color: #a9a49b;
  cursor: not-allowed;
}

.history-empty-copy button {
  display: inline-flex;
  min-height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #171512;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.history {
  overflow: auto;
  padding: 24px 12px 16px;
}

.history .hint,
.history-loading,
.history-empty-copy {
  position: relative;
  margin: 0;
  color: #7f7b73;
  font-size: 15px;
  line-height: 1.6;
}

.history .hint,
.history-loading {
  padding-left: 30px;
}

.history-loading::before {
  position: absolute;
  left: 3px;
  top: 2px;
  width: 15px;
  height: 15px;
  border: 2px solid #b9b4ac;
  border-top-color: transparent;
  border-radius: 999px;
  content: "";
  animation: spin 1s linear infinite;
}

.history-empty-copy {
  padding: 4px 6px;
}

.history-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ece9e2;
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.history-item:hover,
.history-item:focus-visible {
  border-color: #d4d0c7;
  background: #fbfbf9;
  outline: none;
  transform: translateY(-1px);
}

.history-item img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #f2f1ed;
}

.history-body {
  min-width: 0;
  padding: 0;
}

.history-body p,
.history-item p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-meta {
  display: flex;
  gap: 8px;
  color: #4c4942;
  font-size: 12px;
  font-weight: 760;
}

.history-community-performance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.history-community-performance span {
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #344054;
  background: #f2f4f7;
  font-size: 11px;
  font-weight: 760;
}

.history-community-performance span:first-child {
  color: #1f5131;
  background: #ecfdf3;
}

.history-community-insight {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f7f6f2;
}

.history-community-insight.is-urgent {
  border: 1px solid #f2b8ad;
  background: #fffafa;
}

.history-community-insight span {
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
}

.history-community-insight button {
  justify-self: start;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #171512;
  border-radius: 999px;
  color: #fff;
  background: #171512;
  font-size: 12px;
  font-weight: 780;
}

.history-item a {
  display: inline-flex;
  margin-top: 5px;
  color: #111;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.history-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.history-row-actions a,
.history-row-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #111;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.history-row-actions button[data-confirm="1"] {
  color: #b42318;
}

.history-more-actions {
  display: inline-grid;
  min-width: 0;
}

.history-more-actions summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  color: #111;
  font-size: 12px;
  font-weight: 760;
  list-style: none;
  cursor: pointer;
}

.history-more-actions summary::-webkit-details-marker {
  display: none;
}

.history-more-actions summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.history-more-actions[open] summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.history-more-actions > div {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid #ece9e2;
  border-radius: 12px;
  background: #fbfaf7;
}

.history-more-actions > div a,
.history-more-actions > div button {
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #ece9e2;
  border-radius: 999px;
  background: #fff;
}

.empty-history {
  display: block;
  color: #7f7b73;
  font-size: 14px;
  line-height: 1.65;
}

.empty-history article {
  display: none;
}

.empty-history::before {
  content: "还没有历史记录。创建第一条图片任务后，会在这里保留缩略图和提示词摘要。";
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--studio-border);
}

.workspace-title,
.workspace-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-title h1 {
  margin: 0;
  color: #151411;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: 0;
}

.workspace-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--studio-blue);
  background: #eef7ff;
  font-size: 12px;
  font-weight: 760;
}

.workspace-badge.wallet {
  color: var(--studio-green);
  background: #e7f7ee;
}

.ready-pill,
.collapse-history-button,
.recharge-header-button,
.balance-nav,
.nav-link,
.account-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #59554d;
  background: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 720;
  box-shadow: none;
  white-space: nowrap;
}

.balance-nav {
  color: #16734a;
  background: #e8f7ee;
  border-color: #cfecd8;
  font-weight: 780;
}

.account-pill {
  color: #3f3b35;
  background: #f6f5f1;
  border-color: #e4e1d9;
  font-weight: 760;
}

.recharge-header-button {
  color: #16734a;
  background: #e8f7ee;
  border-color: #cfecd8;
  font-weight: 780;
}

.workspace-header .recharge-header-button {
  display: none;
}

.ready-pill.offline {
  color: #9b2f24;
  background: #fff0ed;
  border-color: #efc9c1;
}

.ready-pill.partial {
  color: #7a4c00;
  background: #fff7df;
  border-color: #efd899;
}

.account-pill span {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-content {
  display: block;
  overflow: auto;
  padding: 18px 24px var(--composer-safe-space);
  background: rgba(248, 250, 252, 0.86);
}

.intro-panel {
  min-width: 0;
}

body[data-panel="prompts"] .intro-panel,
body[data-panel="agent"] .intro-panel,
body[data-panel="developers"] .intro-panel,
body[data-panel="admin"] .intro-panel,
body[data-panel="settings"] .intro-panel,
body[data-panel="prompts"] .history-panel,
body[data-panel="agent"] .history-panel,
body[data-panel="developers"] .history-panel,
body[data-panel="admin"] .history-panel,
body[data-panel="settings"] .history-panel,
body[data-panel="prompts"] .admin-drawer,
body[data-panel="agent"] .admin-drawer,
body[data-panel="developers"] .admin-drawer,
body[data-panel="admin"] .admin-drawer,
body[data-panel="settings"] .admin-drawer {
  display: none;
}

body[data-panel="prompts"] .studio-shell,
body[data-panel="agent"] .studio-shell,
body[data-panel="developers"] .studio-shell,
body[data-panel="admin"] .studio-shell,
body[data-panel="settings"] .studio-shell {
  grid-template-columns: 228px minmax(0, 1fr);
}

.rail-collapsed[data-panel="prompts"] .studio-shell,
.rail-collapsed[data-panel="agent"] .studio-shell,
.rail-collapsed[data-panel="developers"] .studio-shell,
.rail-collapsed[data-panel="admin"] .studio-shell,
.rail-collapsed[data-panel="settings"] .studio-shell {
  grid-template-columns: 92px minmax(0, 1fr);
}

body[data-panel="prompts"] .composer-card,
body[data-panel="agent"] .composer-card,
body[data-panel="developers"] .composer-card,
body[data-panel="admin"] .composer-card,
body[data-panel="settings"] .composer-card,
body[data-panel="prompts"] .result-thread,
body[data-panel="agent"] .result-thread,
body[data-panel="developers"] .result-thread,
body[data-panel="admin"] .result-thread,
body[data-panel="settings"] .result-thread {
  display: none !important;
}

body[data-panel="prompts"] .workspace-content,
body[data-panel="agent"] .workspace-content,
body[data-panel="developers"] .workspace-content,
body[data-panel="settings"] .workspace-content {
  padding-bottom: 32px;
}

body[data-panel="admin"] .workspace {
  display: flex;
  flex-direction: column;
}

body[data-panel="admin"] .workspace-content {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}

.feature-panel {
  display: none;
  min-height: 0;
  max-width: none;
  border: 1px solid var(--studio-border);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

body[data-panel="prompts"] #promptLibraryPanel,
body[data-panel="agent"] #agentPanel,
body[data-panel="developers"] #apiDocsPanel,
body[data-panel="settings"] #settingsPanel {
  display: flex;
  flex-direction: column;
}

body[data-panel="admin"] #adminConsolePanel {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  margin: 14px;
  margin-top: 0;
}

.admin-console-panel {
  display: none;
  min-height: 0;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #f3f6fb;
  overflow: hidden;
}

.admin-console-panel,
.admin-console-main {
  min-width: 0;
}

.admin-console-panel {
  display: none;
  grid-template-columns: 220px minmax(0, 1fr);
}

.admin-console-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px 12px;
  border-right: 1px solid #d8e0ea;
  background: #eef3f9;
}

.admin-console-sidebar-head h2 {
  margin: 8px 0 8px;
  font-size: 22px;
}

.admin-console-sidebar-head p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

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

.admin-console-nav button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

.admin-console-nav button span,
.admin-console-nav button small {
  display: block;
}

.admin-console-nav button small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.admin-console-nav button.active {
  border-color: #cdd8e6;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.admin-console-sidebar-foot {
  margin-top: auto;
}

.admin-console-main {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  overflow: auto;
  background: #f8fafc;
}

.admin-console-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
}

.admin-console-topbar-copy h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.admin-console-breadcrumb {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-console-topbar-copy p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.admin-console-topbar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 760;
}

.admin-surface {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
}

.admin-surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-surface-head strong,
.admin-surface-head span {
  display: block;
}

.admin-surface-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 720;
}

.admin-console-section {
  display: none;
}

.admin-console-section.active {
  display: grid;
  gap: 14px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.admin-overview-grid article {
  padding: 16px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
}

.admin-overview-grid span,
.admin-overview-grid strong {
  display: block;
}

.admin-overview-grid span {
  color: #64748b;
  font-size: 12px;
  font-weight: 720;
}

.admin-overview-grid strong {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
}

.admin-overview-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-shortcuts button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

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

.admin-activity-list article {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-activity-list span,
.admin-activity-list strong {
  display: block;
}

.admin-activity-list span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.admin-activity-list strong {
  margin-top: 4px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 760;
}

.admin-inline-note {
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-toolbar-split {
  align-items: end;
}

.admin-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.admin-toolbar-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: center;
  width: 100%;
}

.admin-toolbar-actions {
  justify-content: flex-end;
}

.admin-toolbar input,
.admin-toolbar select {
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}

.admin-toolbar input::placeholder {
  color: #94a3b8;
}

.admin-stack-list {
  display: grid;
  gap: 14px;
}

.admin-list-surface {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-list-head strong,
.admin-list-head span {
  display: block;
}

.admin-list-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

body[data-panel="studio"] .workspace-content {
  display: block;
}

.feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--studio-border);
}

.feature-head h2 {
  margin: 8px 0 4px;
  color: #14120f;
  font-size: 24px;
  font-weight: 780;
}

.feature-head p {
  margin: 0;
  color: var(--studio-muted);
  font-size: 14px;
  line-height: 1.7;
}

.feature-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #615d55;
  background: #f2f1ed;
  font-size: 12px;
  font-weight: 760;
}

.feature-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 360px;
}

.feature-head-actions,
.api-doc-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(480px, 100%);
}

.feature-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: #9b968d;
  transform: translateY(-50%);
}

.feature-search input {
  padding-left: 40px;
}

.library-tags {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 20px 0;
}

.library-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.community-discovery-row span,
.community-filter-summary span {
  flex: 0 0 auto;
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 760;
}

.community-heat-note {
  margin: -1px 0 1px;
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 1.45;
}

.community-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 20px 0;
}

.community-explainer div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e1d8;
  border-radius: 14px;
  background: #fbfaf7;
}

.community-explainer strong {
  color: #171512;
  font-size: 13px;
  font-weight: 780;
}

.community-explainer span {
  color: #68635b;
  font-size: 12px;
  line-height: 1.5;
}

.community-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  padding: 2px 0 0;
}

.community-filter-summary button,
.community-filter-empty button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #dedbd3;
  border-radius: 999px;
  color: #2e2b26;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.library-tags button,
.library-card-tags em {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #625f58;
  background: #f2f1ed;
  font-size: 13px;
  font-weight: 720;
}

.library-tag-row button,
.library-card-tags em {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
}

.library-tags button:hover,
.library-tags button.active {
  color: #111;
  background: #e8e5df;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 20px;
}

.library-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #fff;
}

.library-card.featured {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}

.library-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0eee8;
}

.library-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.library-card:hover .library-cover img {
  transform: scale(1.03);
}

.library-cover span {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #3d3932;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.community-image-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.library-card > div:not(.prompt-cover):not(.library-cover):not(.library-card-actions) {
  padding: 14px 16px;
}

.library-card span {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  color: #77736d;
  background: #f2f1ed;
  font-size: 12px;
  font-weight: 700;
}

.library-card h3 {
  margin: 10px 0 8px;
  font-size: 16px;
}

.library-card p {
  display: -webkit-box;
  margin: 0;
  min-height: 42px;
  overflow: hidden;
  color: #77736d;
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-card small {
  display: block;
  margin-top: 8px;
  color: #9a948b;
  font-size: 11px;
  line-height: 1.5;
}

.community-first-comment-hint {
  width: fit-content;
  margin-top: 8px;
  color: #6f4e12;
  background: #fff8e7;
}

.community-feedback-question {
  display: grid;
  gap: 4px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #e7e4dc;
  border-radius: 12px;
  color: #3d3932;
  background: #fbfaf7;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
  text-align: left;
}

.community-feedback-question span {
  width: fit-content;
  padding: 0;
  color: #667085;
  background: transparent;
  font-size: 11px;
}

.community-feedback-question:hover,
.community-feedback-question:focus-visible {
  border-color: #d8d3c8;
  background: #fff;
}

.community-card-reuse-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  color: #667085;
  background: #f9fafb;
  font-size: 12px;
  font-weight: 720;
}

.community-card-reuse-link:hover,
.community-card-reuse-link:focus-visible {
  border-color: #cfd4dc;
  background: #f2f4f7;
}

.creator-dashboard-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #fff;
}

.creator-dashboard-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: #f7f6f2;
}

.creator-dashboard-summary .creator-dashboard-primary-metric {
  background: #ecfdf3;
}

.creator-dashboard-summary .creator-dashboard-primary-metric span,
.creator-dashboard-summary .creator-dashboard-primary-metric strong {
  color: #1f5131;
}

.creator-dashboard-summary .creator-dashboard-secondary-metric {
  background: #f2f4f7;
}

.creator-dashboard-summary .creator-dashboard-secondary-metric span,
.creator-dashboard-summary .creator-dashboard-secondary-metric strong {
  color: #667085;
}

.creator-dashboard-summary span,
.creator-card-insight,
.creator-detail-insight span {
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
}

.creator-dashboard-summary strong {
  overflow: hidden;
  color: #171512;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-support-summary {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid #e7e4dc;
  border-radius: 14px;
  color: #5f5a52;
  background: #fbfaf7;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.creator-dashboard-focus {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d8eadf;
  border-radius: 16px;
  background: #f4fbf7;
}

.creator-dashboard-focus.is-urgent {
  border-color: #f2b8ad;
  background: #fffafa;
}

.creator-dashboard-focus div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-dashboard-focus span {
  color: #047857;
  font-size: 12px;
  font-weight: 780;
}

.creator-dashboard-focus.is-urgent span {
  color: #b42318;
}

.creator-dashboard-focus strong {
  overflow: hidden;
  color: #171512;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-dashboard-focus p {
  margin: 0;
  color: #5f5a52;
  font-size: 13px;
  line-height: 1.5;
}

.creator-dashboard-focus button {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #171512;
  border-radius: 999px;
  color: #fff;
  background: #171512;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.creator-card-insight {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f7f6f2;
}

.creator-reuse-insight {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #d8eadf;
  border-radius: 12px;
  background: #f4fbf7;
}

.creator-reuse-insight span {
  color: #047857;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.creator-reuse-insight button {
  justify-self: start;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #047857;
  border-radius: 999px;
  color: #fff;
  background: #047857;
  font-size: 12px;
  font-weight: 780;
}

.creator-card-insight.is-urgent {
  border: 1px solid #f2b8ad;
  background: #fffafa;
}

.creator-card-insight button,
.creator-feedback-empty button {
  justify-self: start;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #171512;
  border-radius: 999px;
  color: #fff;
  background: #171512;
  font-size: 12px;
  font-weight: 780;
}

.creator-feedback-empty {
  display: grid;
  gap: 8px;
}

.creator-feedback-empty p {
  margin: 0;
}

.creator-feedback-inbox {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.creator-feedback-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #fff;
}

.creator-feedback-toolbar > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-feedback-toolbar strong {
  color: #171512;
  font-size: 15px;
}

.creator-feedback-toolbar span,
.creator-feedback-copy small {
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
}

.creator-feedback-actions,
.creator-feedback-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creator-feedback-actions button,
.creator-feedback-item-actions button {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #dedbd3;
  border-radius: 999px;
  color: #2e2b26;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
}

.creator-feedback-actions button.active,
.creator-feedback-item-actions .primary-button {
  border-color: #171512;
  color: #fff;
  background: #171512;
}

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

.creator-feedback-action-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d8eadf;
  border-radius: 16px;
  background: #f4fbf7;
}

.creator-feedback-action-plan.is-urgent {
  border-color: #f2b8ad;
  background: #fffafa;
}

.creator-feedback-action-plan div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.creator-feedback-action-plan span {
  color: #047857;
  font-size: 12px;
  font-weight: 780;
}

.creator-feedback-action-plan.is-urgent span {
  color: #b42318;
}

.creator-feedback-action-plan strong {
  color: #171512;
  font-size: 15px;
}

.creator-feedback-action-plan p {
  margin: 0;
  color: #5f5a52;
  font-size: 13px;
  line-height: 1.5;
}

.creator-feedback-action-plan button {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid #171512;
  border-radius: 999px;
  color: #fff;
  background: #171512;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.creator-feedback-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #fbfaf7;
}

.creator-feedback-group.is-urgent {
  border-color: #f2b8ad;
  background: #fffafa;
}

.creator-feedback-group > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.creator-feedback-group > header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creator-feedback-group > header strong {
  color: #171512;
  font-size: 14px;
}

.creator-feedback-group > header span {
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
}

.creator-feedback-group > header em {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  color: #2e2b26;
  background: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
}

.creator-feedback-group-list {
  display: grid;
  gap: 10px;
}

.creator-feedback-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(170px, 240px);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #fff;
}

.creator-feedback-item.reported {
  border-color: #f2b8ad;
  background: #fffafa;
}

.creator-feedback-item.handled {
  background: #f8f7f3;
}

.creator-feedback-item.handled .creator-feedback-copy {
  opacity: 0.68;
}

.creator-feedback-handled-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #087443;
  font-size: 12px;
  font-weight: 760;
}

.creator-feedback-thumb {
  width: 84px;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #77736d;
  background: #f2f1ed;
  font-size: 12px;
  font-weight: 800;
}

.creator-feedback-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-feedback-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.creator-feedback-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.creator-feedback-head strong {
  color: #171512;
  font-size: 13px;
}

.creator-feedback-head span,
.creator-feedback-head em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #12643f;
  background: #dcfae6;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.creator-feedback-head em {
  color: #7a2e27;
  background: #fff0ed;
}

.creator-feedback-head time {
  color: #9a948b;
  font-size: 12px;
}

.creator-feedback-copy p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.library-card-tags em {
  color: #77736d;
  font-style: normal;
}

.library-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 16px 16px;
}

.library-card-actions button {
  flex: 1 1 auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--studio-black);
  font-weight: 760;
}

.library-card-actions button + button {
  border: 1px solid #dedbd3;
  color: #2e2b26;
  background: #fff;
}

.community-card {
  min-height: 390px;
}

.community-cover {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 190px;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.community-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-prompt {
  display: -webkit-box;
  margin: 12px 0 0;
  overflow: hidden;
  color: #475467;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.community-card-actions button {
  flex: 1 1 78px;
  min-height: 34px;
  font-size: 12px;
}

.community-card-primary-actions,
.community-card-secondary-actions {
  display: flex;
  width: 100%;
  gap: 8px;
}

.community-card-primary-actions button {
  flex: 1 1 0;
}

.community-own-work-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d7eadf;
  border-radius: 999px;
  color: #25643f;
  background: #f0fbf4;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.community-card-secondary-actions button {
  flex: 1 1 78px;
}

.community-card-actions .community-card-primary {
  min-height: 40px;
  font-size: 13px;
}

.community-support-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #e7e4dc;
  border-radius: 999px;
  color: #5f5a52;
  background: #fbfaf7;
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.auth-dialog.community-detail-dialog {
  display: grid;
  width: min(1180px, calc(100vw - 36px));
  max-height: min(900px, calc(100vh - 36px));
  overflow: hidden;
}

.community-detail-body {
  display: grid;
  gap: 18px;
  min-height: 0;
  max-height: calc(min(900px, 100vh - 36px) - 54px);
  overflow: auto;
  padding-right: 4px;
}

.community-publish-success {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d7ecdc;
  border-radius: 8px;
  background: #f0fbf3;
  color: #1f5131;
}

.community-publish-success > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.community-publish-success > div:first-child {
  display: grid;
  justify-content: start;
  gap: 3px;
}

.community-publish-success strong {
  font-size: 14px;
}

.community-publish-success span {
  color: #4f735c;
  font-size: 12px;
  line-height: 1.5;
}

.community-publish-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.community-publish-steps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dcfae6;
  font-size: 12px;
  font-weight: 760;
}

.community-publish-steps li span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  color: #fff;
  background: #1f5131;
  font-size: 10px;
  line-height: 1;
}

.community-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(380px, 0.95fr);
  gap: 18px;
  min-width: 0;
}

.community-reuse-dialog {
  width: min(720px, calc(100vw - 32px));
}

.community-reuse-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.community-reuse-preview {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: #ece7df;
}

.community-reuse-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.community-reuse-preview span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--studio-muted);
  font-size: 13px;
}

.community-reuse-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.community-reuse-copy strong {
  color: #2b2823;
  font-size: 18px;
}

.community-reuse-copy small {
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 760;
}

.community-reuse-intents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-reuse-intents button {
  display: grid;
  gap: 3px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  color: #3f3b33;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.community-reuse-intents button strong {
  color: inherit;
  font-size: 13px;
}

.community-reuse-intents button span {
  color: var(--studio-muted);
  font-size: 11px;
  line-height: 1.35;
}

.community-reuse-intents button:hover,
.community-reuse-intents button:focus-visible,
.community-reuse-intents button.active {
  border-color: #9fd3ad;
  background: #f0fbf3;
  color: #1f5131;
}

.community-reuse-copy p {
  margin: 0;
  max-height: 8em;
  overflow: auto;
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.community-reuse-copy ul {
  margin: 0;
  padding-left: 16px;
  color: #5f5a52;
  font-size: 12px;
  line-height: 1.55;
}

.community-reuse-warning {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #efd8a4;
  border-radius: 12px;
  background: #fff8e7;
}

.community-reuse-warning strong {
  color: #6f4e12;
  font-size: 13px;
}

.community-reuse-warning span {
  color: #775f2b;
  font-size: 12px;
  line-height: 1.5;
}

.community-reuse-actions {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.community-reuse-actions .danger-button,
.community-reuse-actions .secondary-button,
.community-reuse-actions .primary-button {
  min-width: 0;
}

.community-detail-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.community-detail-copy {
  min-width: 0;
}

.community-detail-image {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.community-detail-preview img,
.community-empty-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #f2f4f7;
  object-fit: contain;
}

.community-detail-image button {
  min-height: 36px;
}

.community-empty-preview {
  display: grid;
  place-items: center;
  color: var(--studio-muted);
}

.community-detail-copy h2 {
  margin: 5px 0 8px;
  font-size: 28px;
  line-height: 1.16;
}

.community-detail-copy p {
  color: var(--studio-muted);
  line-height: 1.7;
}

.community-detail-meta,
.community-detail-metrics,
.community-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.community-detail-metrics {
  margin: 8px 0 0;
}

.community-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.community-card-metrics span,
.community-detail-metrics span {
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
}

.community-card-metrics.primary span,
.community-detail-metrics.primary span {
  color: #1f5131;
  background: #ecfdf3;
}

.community-card-metrics.secondary,
.community-detail-metrics.secondary {
  margin-top: 6px;
}

.community-card-metrics.secondary span,
.community-detail-metrics.secondary span {
  color: #667085;
  background: #f2f4f7;
}

.community-detail-actions button {
  flex: 1 1 132px;
  min-width: 0;
}

.community-detail-actions .community-detail-primary-action {
  flex: 1 1 160px;
}

.community-detail-actions .community-own-work-pill {
  flex: 1 1 160px;
}

.community-own-work-pill.detail {
  min-height: 38px;
}

.community-detail-actions .community-detail-secondary-action {
  flex: 1 1 120px;
}

.community-detail-actions .community-support-note {
  flex: 1 1 220px;
  border-radius: 12px;
  line-height: 1.45;
}

.community-download-note {
  flex: 1 1 100%;
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid #e7e4dc;
  border-radius: 12px;
  background: #fbfaf7;
  color: #5f5a52;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.5;
}

.community-detail-meta span {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #344054;
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 720;
}

.creator-detail-insight {
  display: grid;
  gap: 4px;
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid #e7e4dc;
  border-radius: 14px;
  background: #fbfaf7;
}

.creator-detail-insight strong {
  color: #171512;
  font-size: 13px;
}

.community-detail-prompt-box {
  display: grid;
  gap: 8px;
}

.community-detail-prompt-box > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.community-detail-prompt-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.community-detail-prompt-box strong {
  color: #2b2823;
  font-size: 13px;
}

.community-detail-prompt-box span {
  color: var(--studio-muted);
  font-size: 12px;
}

.community-detail-prompt-box button {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.community-detail-prompt {
  max-height: 180px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  color: #344054;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.community-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.community-section-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.community-section-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 780;
}

.community-section-head h3 {
  margin: 0;
  color: #171512;
  font-size: 16px;
}

.community-same-style {
  border-top: 1px solid var(--studio-border);
  padding-top: 16px;
}

.community-same-style-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.community-same-style-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  color: inherit;
  background: #fff;
  text-align: left;
}

.community-same-style-card img,
.community-same-style-card > span {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f2f4f7;
  object-fit: cover;
}

.community-same-style-card > span {
  display: grid;
  place-items: center;
  color: var(--studio-muted);
  font-size: 12px;
}

.community-same-style-card strong,
.community-same-style-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-same-style-card strong {
  color: #171512;
  font-size: 13px;
}

.community-same-style-card small {
  color: var(--studio-muted);
  font-size: 12px;
}

.community-same-style-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed #d8d3c8;
  border-radius: 12px;
  color: #6f6a61;
  background: #fbfaf7;
  font-size: 13px;
  line-height: 1.6;
}

.community-comments {
  border-top: 1px solid var(--studio-border);
  padding-top: 16px;
}

.community-comments h3 {
  margin: 0 0 12px;
}

.community-comment-brief {
  display: grid;
  gap: 4px;
  margin: -2px 0 12px;
  padding: 11px 12px;
  border: 1px solid #e7e4dc;
  border-radius: 14px;
  background: #fbfaf7;
}

.community-comment-brief strong {
  color: #171512;
  font-size: 13px;
}

.community-comment-brief span {
  color: #5f5a52;
  font-size: 13px;
  line-height: 1.55;
}

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

.community-pin-prompt {
  display: grid;
  gap: 3px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #fff;
}

.community-pin-prompt strong {
  color: #111827;
  font-size: 13px;
}

.community-pin-prompt span {
  color: var(--studio-muted);
  font-size: 12px;
  line-height: 1.45;
}

.community-comment-followup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #d8e8df;
  border-radius: 14px;
  background: #f2fbf6;
}

.community-comment-followup div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.community-comment-followup div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.community-comment-followup strong {
  color: #173b28;
  font-size: 13px;
}

.community-comment-followup span {
  color: #4d6d5a;
  font-size: 12px;
  line-height: 1.45;
}

.community-comment-followup button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.community-comment {
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #f8fafc;
}

.community-comment.pinned {
  border-color: #111827;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.community-comment.reply {
  margin-top: 8px;
  border-style: dashed;
  background: #fff;
}

.community-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.community-comment strong,
.community-comment span {
  font-size: 12px;
}

.community-comment span {
  color: var(--studio-muted);
}

.community-comment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #12643f;
  background: #dcfae6;
  font-size: 11px;
  font-weight: 800;
}

.community-comment-badge.pinned {
  color: #111827;
  background: #e5e7eb;
}

.community-comment-badge.report {
  color: #7a2e27;
  background: #fff0ed;
}

.community-comment-head button {
  padding: 4px 8px;
  border-radius: 999px;
  color: #7a2e27;
  background: #fff0ed;
  font-size: 12px;
  font-weight: 760;
}

.community-comment-head button:first-of-type {
  margin-left: auto;
}

.community-comment p {
  margin: 8px 0 0;
  color: #344054;
  line-height: 1.6;
}

.community-replies {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--studio-border);
}

.community-reply-target {
  margin: 12px 0 -4px;
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 760;
}

.community-comment-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.community-comment-suggestions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  background: #fff;
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 760;
}

.community-comment-suggestions button:hover,
.community-comment-suggestions button:focus-visible {
  border-color: #111827;
  color: #111827;
}

.community-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin-top: 14px;
}

.community-comment-form textarea,
.community-publish-dialog textarea {
  min-height: 90px;
  resize: vertical;
}

.community-publish-dialog {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  padding: 26px 26px 18px;
  overflow: hidden;
}

.community-publish-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

.community-publish-scroll::-webkit-scrollbar {
  width: 8px;
}

.community-publish-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d8d2c5;
}

.community-publish-status {
  margin: 10px 0 12px;
}

.community-publish-actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #ece8dd;
  background: #fffdf8;
}

.community-publish-templates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -6px 0 2px;
}

.community-publish-templates span {
  color: #77736d;
  font-size: 12px;
  font-weight: 760;
}

.community-publish-templates button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #e7e4dc;
  border-radius: 999px;
  background: #fbfaf7;
  color: #3f3a33;
  font-size: 12px;
  font-weight: 760;
}

.community-publish-templates button:hover {
  border-color: #d4cec2;
  background: #f6f3ed;
}

.community-publish-tip-note {
  margin: -4px 0 2px;
  color: #77736d;
  font-size: 12px;
  line-height: 1.45;
}

.community-publish-preview {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  background: #fbfaf7;
}

.community-publish-preview:empty {
  display: none;
}

.community-publish-preview-media {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: #ece7df;
}

.community-publish-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.community-publish-preview-media span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--studio-muted);
  font-size: 12px;
}

.community-publish-preview-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.community-publish-preview-copy strong {
  color: #2b2823;
  font-size: 14px;
}

.community-publish-preview-copy small {
  color: var(--studio-muted);
  font-size: 12px;
}

.community-publish-source {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(34, 111, 83, 0.18);
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.78);
}

.community-publish-source span {
  flex: 0 0 auto;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.community-publish-source strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-publish-preview-copy p {
  margin: 0;
  max-height: 4.8em;
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.community-publish-preview-copy ul {
  margin: 0;
  padding-left: 16px;
  color: #5f5a52;
  font-size: 12px;
  line-height: 1.55;
}

.community-publish-checklist {
  display: grid;
  gap: 7px;
  padding-left: 0 !important;
  list-style: none;
}

.community-publish-checklist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-width: 0;
}

.community-publish-checklist li > span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #087443;
  font-size: 11px;
  font-weight: 820;
}

.community-publish-selector {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.community-publish-selector > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-publish-selector > div:first-child strong {
  font-size: 13px;
}

.community-publish-selector > div:first-child span {
  color: var(--studio-muted);
  font-size: 12px;
}

.community-publish-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
}

.community-publish-thumb {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  text-align: left;
}

.community-publish-thumb.selected {
  border-color: #14110f;
  box-shadow: inset 0 0 0 2px #14110f;
}

.community-publish-thumb img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  object-fit: cover;
}

.community-publish-thumb span {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-docs-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.api-key-panel,
.api-doc-block {
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #fff;
}

.api-key-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.api-key-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.api-key-head strong,
.api-doc-block h3 {
  display: block;
  margin: 0;
}

.api-key-head span {
  display: block;
  margin-top: 3px;
  color: var(--studio-muted);
  font-size: 12px;
}

.api-key-create {
  display: grid;
  gap: 8px;
}

.api-new-key {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #b7d3ff;
  border-radius: 16px;
  background: #eef6ff;
}

.api-new-key[hidden] {
  display: none;
}

.api-new-key span {
  color: #175cd3;
  font-size: 12px;
  font-weight: 760;
}

.api-new-key code,
.api-doc-block code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.api-new-key code {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 12px;
}

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

.api-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #f8fafc;
}

.api-key-item span,
.api-key-item small {
  display: block;
  margin-top: 4px;
  color: var(--studio-muted);
  font-size: 12px;
}

.api-key-item.revoked {
  opacity: .62;
}

.api-key-empty {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px dashed var(--studio-border-strong);
  border-radius: 16px;
  color: var(--studio-muted);
  background: #f8fafc;
}

.api-reference {
  display: grid;
  gap: 14px;
}

.api-doc-block {
  overflow: hidden;
  padding: 16px;
}

.api-doc-block > span {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #175cd3;
  background: #eff8ff;
  font-size: 12px;
  font-weight: 760;
}

.api-doc-block h3 {
  font-size: 18px;
}

.api-doc-block pre {
  margin: 14px 0 0;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  color: #e5e7eb;
  background: #101828;
  font-size: 12px;
  line-height: 1.6;
}

.api-schema-block dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.api-schema-block div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--studio-border);
}

.api-schema-block dt {
  font-weight: 780;
}

.api-schema-block dd {
  margin: 0;
  color: var(--studio-muted);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #dedbd3;
  border-radius: 999px;
  color: #2e2b26;
  background: #fff;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.feature-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--studio-muted);
}

.community-filter-empty {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.community-filter-empty p {
  margin: 0;
}

.agent-panel {
  flex-direction: row;
  min-height: 640px;
}

.agent-sidebar {
  display: flex;
  flex: 0 0 300px;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--studio-border);
  background: #f6f6f4;
}

.agent-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.agent-sidebar-head strong {
  display: block;
  color: #181612;
  font-size: 14px;
}

.agent-sidebar-head span {
  display: block;
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: 12px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e1ddd4;
  border-radius: 999px;
  color: #26231e;
  background: #fff;
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.agent-conversation-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 0 8px 12px;
}

.agent-conversation {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #e2ded6;
  border-radius: 22px;
  color: #3a362f;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.agent-conversation.active {
  border-color: #181612;
  color: #fff;
  background: #181612;
}

.agent-conversation-top,
.agent-conversation-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-conversation-top strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-conversation-top small,
.agent-conversation-preview,
.agent-conversation-meta {
  color: #8a857c;
  font-size: 11px;
}

.agent-conversation.active .agent-conversation-top small,
.agent-conversation.active .agent-conversation-preview,
.agent-conversation.active .agent-conversation-meta {
  color: rgba(255, 255, 255, 0.68);
}

.agent-conversation-preview {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.agent-conversation-meta em {
  min-width: 0;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-conversation-meta span {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.agent-conversation-meta i {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f1efea;
  color: #524d45;
  font-style: normal;
  cursor: pointer;
}

.agent-conversation.active .agent-conversation-meta i {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.agent-main {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.agent-head {
  align-items: stretch;
}

.agent-controls {
  display: flex;
  min-width: min(360px, 100%);
  flex-direction: column;
  gap: 10px;
}

.agent-selects {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 8px;
}

.agent-selects select {
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #e0dcd3;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 720;
  outline: none;
}

.agent-head-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.agent-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 18px 20px;
  background: #fcfcfb;
}

.agent-empty {
  max-width: 720px;
  margin: auto;
  padding: 28px;
  border: 1px solid #e5e1d8;
  border-radius: 28px;
  background: #fff;
}

.agent-empty strong {
  display: block;
  color: #171511;
  font-size: 20px;
}

.agent-empty p {
  margin: 8px 0 0;
  color: var(--studio-muted);
  line-height: 1.7;
}

.agent-message {
  max-width: min(760px, 88%);
  padding: 14px 16px;
  border: 1px solid #e6e3dc;
  border-radius: 22px;
  background: #fff;
}

.agent-message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--studio-black);
}

.agent-message span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 780;
  opacity: 0.72;
}

.agent-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.8;
}

.agent-message-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  gap: 8px;
  margin-top: 10px;
}

.agent-message-images img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
}

.agent-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px;
}

.agent-attachment {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2ded6;
  border-radius: 16px;
  background: #f2f1ed;
}

.agent-attachment img {
  width: 78px;
  height: 78px;
  object-fit: cover;
}

.agent-attachment button {
  position: absolute;
  right: 5px;
  top: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  cursor: pointer;
}

.agent-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--studio-border);
}

.agent-attach-button {
  align-self: end;
}

.agent-attach-button input {
  display: none;
}

.agent-composer textarea {
  min-height: 82px;
  max-height: 160px;
  border: 1px solid var(--studio-border);
  border-radius: 20px;
  background: #fafaf8;
}

.agent-composer button {
  align-self: end;
  min-width: 92px;
}

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

.settings-grid article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid #e3e0d8;
  border-radius: 22px;
  background: #fcfcfb;
}

.settings-grid span {
  color: var(--studio-muted);
  font-size: 13px;
  font-weight: 760;
}

.settings-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 24px;
}

.settings-grid p {
  margin: 10px 0 0;
  color: var(--studio-muted);
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}

.spark-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #fff;
}

.spark-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.intro-panel h2 {
  max-width: 760px;
  margin: 0 0 24px;
  color: #080807;
  font-size: clamp(38px, 3.1vw, 48px);
  font-weight: 820;
  line-height: 1.06;
  letter-spacing: 0;
}

.prompt-tools {
  display: flex;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 1120px;
  overflow-x: auto;
  padding: 0 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.prompt-tools::-webkit-scrollbar {
  display: none;
}

.prompt-card {
  display: flex;
  flex: 0 0 220px;
  flex-direction: column;
  width: 220px;
  height: 235px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dedbd4;
  border-radius: 22px;
  background: #fff;
  text-align: left;
  box-shadow: none;
  scroll-snap-align: start;
}

.prompt-card:hover {
  transform: translateY(-2px);
  border-color: #cbc7bd;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.prompt-cover {
  flex: 0 0 78px;
  height: 78px;
  border-bottom: 1px solid #e5e1d8;
}

.prompt-purple .prompt-cover {
  background: linear-gradient(145deg, #231127 0%, #482740 48%, #c0a994 100%);
}

.prompt-blue .prompt-cover {
  background: linear-gradient(145deg, #1c4e83 0%, #3e78ac 54%, #d8d2c1 100%);
}

.prompt-rose .prompt-cover {
  background: linear-gradient(145deg, #5b091b 0%, #c80d46 48%, #f28b00 100%);
}

.prompt-cyan .prompt-cover {
  background: linear-gradient(145deg, #073142 0%, #0c5369 48%, #ff6b0a 100%);
}

.prompt-card span {
  width: max-content;
  margin: 14px 16px 8px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #77736d;
  background: #f2f1ed;
  font-size: 12px;
  font-weight: 650;
}

.prompt-card span::first-letter {
  text-transform: uppercase;
}

.prompt-card strong {
  display: block;
  margin: 0 16px 9px;
  color: #14120f;
  font-size: 15px;
  font-weight: 780;
}

.prompt-card p {
  display: -webkit-box;
  min-height: 40px;
  margin: 0 16px 10px;
  overflow: hidden;
  color: #625f58;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.prompt-card small {
  display: -webkit-box;
  margin: auto 16px 16px;
  padding-top: 10px;
  overflow: hidden;
  border-top: 1px solid #efede8;
  color: #77736d;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-thread,
.admin-drawer,
.composer-card {
  border: 1px solid var(--studio-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.result-thread {
  display: none;
  max-width: 1120px;
  margin-top: 18px;
  margin-bottom: 28px;
  padding: 18px;
}

.result-thread.is-visible,
.result-thread:has(.preview.loading),
.result-thread:has(.preview.has-result) {
  display: block;
}

.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.thread-head h2 {
  margin: 0;
  font-size: 18px;
}

#previewMeta {
  display: inline-flex;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #16734a;
  background: #e8f7ee;
  font-size: 12px;
  font-weight: 760;
}

.preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(360px, 46vh, 600px);
  height: auto;
  overflow: hidden;
  border: 1px solid #e4e1d9;
  border-radius: 18px;
  background: #f8f8f5;
}

.preview.has-result {
  align-items: start;
  min-height: clamp(420px, calc(100vh - var(--composer-safe-space) - 130px), 760px);
}

.preview-empty {
  display: grid;
  place-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 28px;
  text-align: center;
}

.preview-empty img {
  width: min(420px, 82%);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(31, 36, 32, 0.12);
}

.preview-empty h3 {
  margin: 0;
  font-size: 18px;
}

.preview-empty p {
  margin: 0;
  color: var(--studio-muted);
}

.preview-empty small {
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
}

.failed-preview .result-actions {
  margin-top: 4px;
}

.generating-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  width: 100%;
  height: 100%;
  padding: 32px;
}

.breathing-frame {
  position: relative;
  width: min(360px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(15, 15, 14, 0.12);
  border-radius: 20px;
  background: linear-gradient(135deg, #f7f7f4, #ededec 48%, #fbf7f0);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
  animation: breathe 2.1s ease-in-out infinite;
}

.breathing-image {
  position: absolute;
  inset: 13%;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.42), rgba(255,255,255,.88)),
    linear-gradient(135deg, rgba(44,82,130,.24), rgba(240,139,53,.24));
  animation: imagePulse 2.1s ease-in-out infinite;
}

.breathing-line {
  position: absolute;
  left: 20%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  animation: linePulse 1.9s ease-in-out infinite;
}

.line-one { top: 30%; width: 48%; }
.line-two { top: 38%; width: 62%; animation-delay: .18s; }
.line-three { top: 46%; width: 38%; animation-delay: .34s; }

.generating-copy {
  display: grid;
  gap: 10px;
  justify-items: start;
  color: #23211d;
}

.generating-copy strong {
  font-size: 24px;
  line-height: 1.2;
}

.generating-copy p {
  margin: 0;
  color: var(--studio-muted);
  font-size: 14px;
  line-height: 1.7;
}

.single-result,
.multi-result {
  display: grid;
  width: 100%;
  min-height: clamp(300px, calc(100vh - var(--composer-safe-space) - 190px), 560px);
  height: 100%;
  gap: 12px;
  padding: 10px;
}

.single-result {
  place-items: center;
}

.single-result .result-card {
  width: 100%;
  height: 100%;
}

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

.result-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.result-image-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}

.single-result img,
.multi-result img {
  width: 100%;
  height: 100%;
  max-height: min(76vh, calc(100vh - var(--composer-safe-space) - 150px), 820px);
  border-radius: 16px;
  object-fit: contain;
  background: #f8f8f5;
}

.single-result img {
  height: 100%;
}

.multi-result img {
  min-height: 0;
}

.result-meta {
  justify-self: center;
  max-width: 100%;
  min-height: 26px;
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 999px;
  color: #68635b;
  background: #f2f1ed;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
}

.result-publish-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 820px);
  margin: 0 auto 16px;
  padding: 12px 14px;
  border: 1px solid #d7ecdc;
  border-radius: 16px;
  background: #f0fbf3;
  color: #1f5131;
}

.result-publish-prompt div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-publish-prompt strong {
  font-size: 14px;
}

.result-publish-prompt span {
  color: #4f735c;
  font-size: 12px;
  line-height: 1.5;
}

.result-publish-prompt button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
}

.result-publish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.result-actions a,
.result-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dedbd3;
  border-radius: 999px;
  color: #23211d;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.result-actions a:hover,
.result-actions button:hover {
  border-color: #cfc9bd;
  background: #f8f7f3;
}

.result-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.result-actions .result-action-primary {
  border-color: #a8dcc0;
  color: #1f5131;
  background: #ecfdf3;
}

.result-actions .result-action-primary:hover {
  border-color: #78c79b;
  background: #dcfae6;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--studio-muted);
  font-size: 14px;
}

.download-link {
  display: none;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--studio-black);
  text-decoration: none;
  font-weight: 760;
}

.admin-drawer {
  display: none;
  max-width: 760px;
  margin-top: 18px;
  padding: 18px;
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 10px;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  background: #fff;
  color: var(--studio-text);
}

.admin-form button {
  min-width: 100px;
  border-radius: 999px;
  color: #fff;
  background: var(--studio-black);
  font-weight: 760;
}

.admin-billing {
  background: #fbfaf7;
}

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

.admin-billing strong,
.admin-billing span,
.admin-card-head strong,
.admin-card-head span {
  display: block;
}

.admin-billing span,
.admin-card-head span {
  margin-top: 4px;
  color: var(--studio-muted);
  font-size: 12px;
  font-weight: 720;
}

.admin-billing-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.admin-billing-form label {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 760;
}

.admin-billing-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  background: #fff;
}

.admin-billing-form button {
  min-height: 38px;
  white-space: nowrap;
}

.admin-upstream-form {
  grid-template-columns: minmax(220px, 1.4fr) minmax(210px, 1fr) minmax(160px, 0.8fr);
}

.admin-upstream-form label {
  min-width: 0;
}

.admin-upstream-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

.admin-redeem-form {
  grid-template-columns: 140px 120px 1fr auto;
}

.admin-create-user-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.admin-topup-form {
  grid-template-columns: 1fr 180px auto;
}

.admin-compact-list {
  display: grid;
  gap: 8px;
}

.admin-table-shell {
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.admin-table {
  overflow: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.admin-table th {
  color: #64748b;
  background: #f8fafc;
  font-weight: 760;
}

.admin-table td code {
  font-size: 12px;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
}

.admin-status-pill.active {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.admin-status-pill.used {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-status-pill.revoked,
.admin-status-pill.disabled,
.admin-status-pill.deleted {
  color: #7c2d12;
  border-color: #fed7aa;
  background: #fff7ed;
}

.admin-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-inline-check input {
  margin: 0;
}

.admin-compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  background: #fff;
}

.admin-compact-item.muted {
  opacity: 0.62;
}

.admin-compact-item > div:first-child {
  min-width: 0;
  flex: 1;
}

.admin-compact-item strong,
.admin-compact-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-compact-item strong {
  font-size: 13px;
}

.admin-compact-item strong em {
  margin-left: 6px;
  color: var(--studio-muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 720;
}

.admin-compact-item span {
  margin-top: 4px;
  color: var(--studio-muted);
  font-size: 12px;
}

.admin-compact-item button,
.admin-row-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .admin-console-panel {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .admin-overview-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .admin-overview-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .admin-console-panel {
    grid-template-columns: 1fr;
  }

  .admin-console-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8e0ea;
  }

  .admin-console-topbar {
    flex-direction: column;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-toolbar-actions {
    justify-content: flex-start;
  }
}

.admin-community-head,
.admin-community-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-community-head {
  justify-content: space-between;
}

.admin-community-head strong,
.admin-community-head span,
.admin-community-item strong,
.admin-community-item span,
.admin-community-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-community-head span {
  margin-top: 4px;
  color: var(--studio-muted);
  font-size: 12px;
}

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

.admin-community-item {
  padding: 10px;
  border: 1px solid #d8e0ea;
  border-radius: 10px;
  background: #fff;
}

.admin-community-item img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
  background: #eef2f7;
}

.admin-community-item > div {
  min-width: 0;
  flex: 1;
}

.admin-community-item span,
.admin-community-item small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.admin-community-item.comment {
  align-items: flex-start;
}

.admin-community-item button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #111827;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  font-size: 12px;
  font-weight: 780;
}

.composer-card {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 10px;
  z-index: 12;
  padding: 8px 16px 10px;
  border-radius: 28px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.055);
}

.generation-banner {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 2px 0 10px;
  padding: 8px 12px;
  border: 1px solid #cfead9;
  border-radius: 18px;
  color: #14643f;
  background: #eaf8ef;
  font-size: 13px;
}

body.generating-active .generation-banner {
  display: flex;
}

.generation-banner span {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #18a45b;
  box-shadow: 0 0 0 0 rgba(24, 164, 91, 0.35);
  animation: pulseDot 1.35s ease-out infinite;
}

.generation-banner strong {
  font-size: 13px;
}

.generation-banner em {
  margin-left: auto;
  color: #3f7f5f;
  font-style: normal;
}

.composer-resize {
  position: absolute;
  left: 50%;
  top: 0;
  width: 112px;
  height: 20px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.composer-resize:hover,
.composer-resize:active {
  transform: translate(-50%, -50%);
}

.composer-resize::before {
  display: block;
  width: 42px;
  height: 4px;
  margin: 7px auto;
  border-radius: 999px;
  background: #c8c5bd;
  content: "";
}

.composer-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "mode selects";
  align-items: center;
  gap: 10px 14px;
  height: auto;
  margin-bottom: 8px;
  padding-top: 10px;
}

.toolbar-top-row,
.toolbar-bottom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-top-row {
  grid-area: selects;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
}

.toolbar-bottom-row {
  grid-area: mode;
  justify-content: flex-start;
}

.toolbar-billing-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.mode-tabs,
.layout-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f2f1ed;
}

.composer-card .mode-tabs button:hover,
.composer-card .mode-tabs button:active,
.composer-card .layout-tabs button:hover,
.composer-card .layout-tabs button:active,
.composer-card .select-pill button:hover,
.composer-card .select-pill button:active,
.composer-card .help-pill:hover,
.composer-card .help-pill:active,
.composer-card .billing-chip:hover,
.composer-card .billing-chip:active {
  transform: none;
}

.mode-tabs button,
.layout-tabs button {
  min-height: 32px;
  padding: 6px 15px;
  border-radius: 999px;
  color: #4f4b44;
  background: transparent;
  font-size: 14px;
  font-weight: 760;
  box-shadow: none;
}

.mode-tabs button.active,
.layout-tabs button.active {
  color: #fff;
  background: var(--studio-black);
}

.select-pill,
.help-pill,
.price-chip,
.billing-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #4d493f;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: none;
}

.select-pill {
  min-width: 108px;
}

.select-pill[data-select="size"],
.size-select {
  min-width: 246px;
}

.select-pill[data-select="quality"] {
  min-width: 136px;
}

.select-pill[data-select="format"] {
  min-width: 132px;
}

.count-select {
  min-width: 110px;
}

.help-pill {
  min-width: 40px;
  width: 40px;
  padding-inline: 0;
}

.select-pill svg,
.help-pill svg {
  width: 16px;
  height: 16px;
  color: #8d887e;
}

.pill-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  z-index: 50;
  display: none;
  min-width: 100%;
  max-height: min(360px, calc(100vh - 180px));
  padding: 6px;
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  overflow-y: auto;
}

.pill-menu::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  content: "";
}

.select-pill.open .pill-menu {
  display: grid;
  gap: 4px;
}

.pill-menu button {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 12px;
  color: #57524b;
  background: transparent;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.pill-menu button.active,
.pill-menu button:hover {
  color: #111;
  background: #f2f1ed;
}

.composer-row-break {
  display: none;
}

.price-chip {
  display: inline-flex;
  color: #16734a;
  background: #e8f7ee;
  border-color: transparent;
  font-size: 13px;
  font-weight: 760;
}

.billing-chip {
  color: #6c675e;
  background: #f2f1ed;
  border-color: transparent;
  font-size: 13px;
  min-width: 92px;
  cursor: default;
  user-select: none;
}

@media (max-width: 1320px) {
  .composer-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mode"
      "selects";
  }

  .toolbar-top-row {
    justify-content: flex-start;
  }
}

.upload-box {
  display: none;
  min-height: 82px;
  margin-bottom: 12px;
  place-items: center;
  gap: 6px;
  border: 1px dashed #d4d0c7;
  border-radius: 18px;
  color: #4f4b44;
  background: #fafaf8;
  text-align: center;
  cursor: pointer;
}

.upload-box.visible {
  display: grid;
}

.upload-box input {
  display: none;
}

.reference-preview {
  display: none;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #fafaf8;
}

.reference-preview.visible {
  display: grid;
}

.reference-head,
.reference-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-head {
  justify-content: space-between;
}

.reference-head strong {
  color: #23211d;
  font-size: 13px;
}

.reference-head span {
  margin-right: auto;
  color: var(--studio-muted);
  font-size: 12px;
}

.source-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.source-strip::-webkit-scrollbar {
  display: none;
}

.source-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(86px, 1fr) 24px;
  align-items: center;
  gap: 8px;
  min-width: 178px;
  padding: 6px;
  border: 1px solid #e4e0d7;
  border-radius: 16px;
  background: #fff;
}

.source-card.active {
  border-color: #1f1f1d;
  box-shadow: inset 0 0 0 1px #1f1f1d;
}

.source-thumb {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #efede8;
  cursor: pointer;
}

.source-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-thumb em {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 1px 4px;
  border-radius: 999px;
  color: #fff;
  background: rgba(31, 31, 29, .82);
  font-style: normal;
  font-size: 10px;
}

.source-card div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.source-card strong {
  overflow: hidden;
  color: #23211d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card span {
  color: var(--studio-muted);
  font-size: 11px;
}

.source-remove {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #e1ddd4;
  border-radius: 999px;
  color: #68625a;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

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

.storyboard-draft {
  display: none;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #ece8dd;
  border-radius: 18px;
  background: #fbfaf7;
}

.storyboard-draft.visible {
  display: block;
}

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

.storyboard-draft-head span {
  color: #3f3b34;
  font-size: 13px;
  font-weight: 780;
}

.storyboard-draft button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dedbd3;
  border-radius: 999px;
  color: #23211d;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.storyboard-draft button:disabled {
  opacity: .6;
  cursor: wait;
}

.storyboard-scenes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.storyboard-scenes article {
  min-width: 0;
  padding: 10px;
  border: 1px solid #eeeae0;
  border-radius: 14px;
  background: #fff;
}

.storyboard-scenes strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: #1f1f1d;
  font-size: 12px;
}

.storyboard-scenes p {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #5d5850;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

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

textarea {
  display: block;
  width: 100%;
  height: var(--composer-textarea-height, 128px);
  min-height: 104px;
  max-height: 260px;
  padding: 10px 18px 6px;
  border: 0;
  border-radius: 0;
  color: #25231f;
  background: transparent;
  resize: none;
  outline: none;
  box-shadow: none;
  font-size: 15px;
  line-height: 1.75;
}

textarea::placeholder {
  color: #aaa59d;
}

.composer-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.composer-left-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-trigger,
.clarity-mode-button,
.prompt-optimize-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #3f3b35;
  background: #fff;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.clarity-mode-button {
  min-width: 74px;
  justify-content: center;
  color: #676158;
  background: #fff;
}

.clarity-mode-button.active {
  border-color: #15130f;
  color: #fff;
  background: #15130f;
}

.prompt-optimize-button {
  min-width: 104px;
  justify-content: center;
  color: #23211d;
  background: #f7f6f2;
  font-size: 12px;
}

body:not(.has-prompt-text) #promptCount {
  display: none;
}

.upload-trigger svg {
  width: 15px;
  height: 15px;
}

#promptCount,
.status {
  color: #77736d;
  font-size: 13px;
}

.status {
  min-height: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-reuse-nudge,
.community-download-nudge {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8e8df;
  border-radius: 16px;
  background: #f2fbf6;
}

.community-download-nudge {
  border-color: #d8e0f0;
  background: #f5f8ff;
}

.community-reuse-nudge.visible,
.community-download-nudge.visible {
  display: flex;
}

.community-reuse-source-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dde7db;
  border-radius: 16px;
  background: #fbfdf8;
}

.community-reuse-source-bar[hidden] {
  display: none;
}

.community-reuse-source-bar > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  min-width: 0;
}

.community-reuse-source-bar span {
  color: #5f7b5d;
  font-size: 12px;
  font-weight: 780;
}

.community-reuse-source-bar strong {
  overflow: hidden;
  color: #173b28;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-reuse-source-bar small {
  grid-column: 1 / -1;
  color: #5f6f5b;
  font-size: 12px;
  line-height: 1.45;
}

.community-reuse-source-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.community-reuse-source-actions button {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
}

.community-reuse-nudge div,
.community-download-nudge div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.community-download-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px !important;
  min-width: 0;
}

.community-download-actions button {
  min-width: 108px;
}

.community-download-secondary-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px !important;
  min-width: 0;
}

.community-download-secondary-actions button {
  min-height: 28px;
  padding: 4px 6px;
  color: #667085;
  font-size: 12px;
}

.community-reuse-nudge strong,
.community-download-nudge strong {
  color: #173b28;
  font-size: 13px;
}

.community-download-nudge strong {
  color: #1f315f;
}

.community-reuse-nudge span,
.community-download-nudge span {
  color: #4d6d5a;
  font-size: 12px;
}

.community-download-nudge span {
  color: #5d6683;
}

.community-reuse-nudge button,
.community-download-nudge button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

.error-text {
  color: #b13a30 !important;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 118px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--studio-black);
  font-size: 14px;
  font-weight: 820;
}

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

.generate-button span {
  white-space: nowrap;
}

.composer-expanded .workspace-content {
  padding-bottom: var(--composer-safe-space);
}

.history-collapsed .studio-shell {
  grid-template-columns: 228px minmax(0, 1fr);
}

.rail-collapsed.history-collapsed .studio-shell {
  grid-template-columns: 92px minmax(0, 1fr);
}

.history-collapsed .history-panel {
  display: none;
}

.history-collapsed .history-resize {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(31, 36, 32, 0.24);
  backdrop-filter: blur(10px);
}

.modal-backdrop.open {
  display: grid;
}

.selection-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.selection-modal.open {
  display: grid;
  place-items: center;
}

.original-viewer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  padding: 18px;
  background: rgba(18, 20, 19, 0.82);
  backdrop-filter: blur(10px);
}

.original-viewer.open {
  display: grid;
  place-items: center;
}

.original-viewer-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1480px, 100%);
  height: min(920px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: #111;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.original-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.original-viewer-head h2 {
  margin: 0;
  font-size: 18px;
}

.original-viewer-head span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 720;
}

.original-viewer-body {
  overflow: auto;
  background:
    linear-gradient(45deg, #151515 25%, transparent 25%),
    linear-gradient(-45deg, #151515 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #151515 75%),
    linear-gradient(-45deg, transparent 75%, #151515 75%);
  background-color: #0c0c0c;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.original-viewer-body img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}

.selection-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--studio-border);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.selection-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--studio-border);
}

.selection-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 780;
}

.selection-head span {
  display: block;
  margin-top: 6px;
  color: var(--studio-muted);
  font-size: 13px;
}

.selection-body {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 220px;
  gap: 14px;
  min-height: 0;
  padding: 16px;
}

.selection-canvas-wrap {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--studio-border);
  border-radius: 22px;
  background: #f6f5f1;
}

#selectionCanvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.selection-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.selection-tools label {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  color: #403d36;
  background: #fafaf8;
  font-size: 13px;
  font-weight: 760;
}

.selection-tools input[type="range"] {
  height: 28px;
  padding: 0;
}

.auth-dialog {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid var(--studio-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.16);
}

.auth-dialog h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 780;
}

.auth-dialog p:not(.eyebrow) {
  color: var(--studio-muted);
  line-height: 1.65;
}

.auth-dialog label,
.redeem-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #403d36;
  font-size: 14px;
  font-weight: 760;
}

.auth-register-only {
  display: none !important;
}

.auth-register-only.visible {
  display: grid !important;
}

input,
select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  color: var(--studio-text);
  background: #fff;
  outline: none;
}

input:focus,
select:focus {
  border-color: #c7c2b7;
  box-shadow: 0 0 0 4px rgba(15, 15, 14, 0.06);
}

.auth-status,
.recharge-note {
  min-height: 22px;
  margin: -2px 0 14px;
  color: var(--studio-muted);
  font-size: 13px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-summary {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #f8f8f6;
}

.account-summary span {
  color: var(--studio-muted);
  font-size: 13px;
}

.account-summary strong {
  color: #16734a;
  font-size: 22px;
}

.account-actions {
  display: grid;
  gap: 10px;
}

.community-tip-dialog {
  width: min(460px, 100%);
}

.community-tip-work {
  margin-bottom: 16px;
}

.community-tip-balance {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  background: #f8f8f6;
}

.community-tip-balance span {
  color: var(--studio-muted);
  font-size: 13px;
  font-weight: 720;
}

.community-tip-balance strong {
  color: #16734a;
  font-size: 22px;
}

.community-tip-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -2px 0 14px;
}

.community-tip-quick button {
  min-height: 40px;
  border: 1px solid var(--studio-border);
  border-radius: 999px;
  color: #403d36;
  background: #fff;
  font-weight: 780;
}

.community-tip-quick button:hover,
.community-tip-quick button:focus-visible {
  border-color: #c9e9d4;
  background: #e8f7ee;
}

.recharge-dialog.user-recharge .auth-actions {
  grid-template-columns: 1fr;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 780;
}

.primary-button {
  color: #fff;
  background: var(--studio-black);
}

.secondary-button {
  color: #4f4b44;
  background: #f2f1ed;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #9f2418;
  background: #fff0ed;
  font-weight: 780;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #77736d;
  background: #f2f1ed;
  font-size: 20px;
}

.purchase-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 14px 0;
  border-radius: 999px;
  color: #fff;
  background: var(--studio-black);
  font-weight: 780;
  text-decoration: none;
}

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

.recharge-plan {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--studio-border);
  border-radius: 18px;
  color: var(--studio-text);
  background: #fff;
  text-align: left;
}

.recharge-plan.active {
  border-color: #c9e9d4;
  background: #e8f7ee;
}

.recharge-plan strong {
  font-size: 23px;
}

.recharge-plan span {
  color: var(--studio-muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #16734a;
  font-size: 12px;
  font-weight: 780;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head span {
  color: var(--studio-muted);
  font-size: 13px;
}

.text-button {
  color: #3f3b35;
}

.sidebar-scrollable {
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
}

.sidebar-scrollable::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.theme-dark {
  --studio-bg: #090909;
  --studio-panel: #171717;
  --studio-panel-soft: #20201e;
  --studio-soft: #20201e;
  --studio-border: rgba(255, 255, 255, 0.12);
  --studio-text: #f5f5f5;
  --studio-muted: #aaa59a;
  --studio-accent-strong: #f3f2ee;
  --studio-accent-foreground: #080807;
  color: var(--studio-text);
  background: var(--studio-bg);
}

.theme-dark .studio-shell,
.theme-dark .workspace-content {
  background: var(--studio-bg);
}

.theme-dark .studio-rail,
.theme-dark .history-panel,
.theme-dark .workspace,
.theme-dark .composer-card,
.theme-dark .result-thread,
.theme-dark .admin-drawer,
.theme-dark .auth-dialog {
  border-color: var(--studio-border);
  background: #171717;
}

.theme-dark .rail-action,
.theme-dark .rail-logo,
.theme-dark .rail-collapse,
.theme-dark .rail-wallet,
.theme-dark .rail-account,
.theme-dark .ready-pill,
.theme-dark .collapse-history-button,
.theme-dark .recharge-header-button,
.theme-dark .nav-link,
.theme-dark .select-pill,
.theme-dark .help-pill,
.theme-dark .upload-trigger,
.theme-dark .clarity-mode-button,
.theme-dark .prompt-optimize-button,
.theme-dark .history-trash,
.theme-dark .history-filter-row button,
.theme-dark .history-empty-copy button,
.theme-dark .community-filter-summary button,
.theme-dark .community-filter-empty button {
  border-color: var(--studio-border);
  color: #f5f5f5;
  background: #20201e;
}

.theme-dark .rail-active,
.theme-dark .mode-tabs button.active,
.theme-dark .layout-tabs button.active,
.theme-dark .generate-button,
.theme-dark .primary-button,
.theme-dark .new-chat-button,
.theme-dark .purchase-link {
  color: #080807;
  background: #f3f2ee;
}

.theme-dark .clarity-mode-button.active {
  border-color: #f3f2ee;
  color: #080807;
  background: #f3f2ee;
}

.theme-dark .prompt-card,
.theme-dark .pill-menu,
.theme-dark input,
.theme-dark select,
.theme-dark .modal-close,
.theme-dark .secondary-button,
.theme-dark .community-tip-balance,
.theme-dark .community-tip-quick button,
.theme-dark .community-comment-suggestions button,
.theme-dark .mode-tabs,
.theme-dark .layout-tabs {
  border-color: var(--studio-border);
  color: #f5f5f5;
  background: #20201e;
}

.theme-dark .history-filter-row button.active {
  border-color: #f3f2ee;
  color: #080807;
  background: #f3f2ee;
}

.theme-dark .history-filters {
  background: rgba(23, 23, 23, 0.74);
}

.theme-dark .intro-panel h2,
.theme-dark .workspace-title h1,
.theme-dark .history-panel-head h2,
.theme-dark .rail-brand strong,
.theme-dark .prompt-card strong,
.theme-dark textarea {
  color: #f5f5f5;
}

.theme-dark .prompt-card p,
.theme-dark .prompt-card small,
.theme-dark .rail-brand span,
.theme-dark .rail-copy small,
.theme-dark .history .hint,
.theme-dark .status {
  color: #aaa59a;
}

.theme-dark .creator-dashboard-summary,
.theme-dark .creator-dashboard-focus,
.theme-dark .creator-detail-insight,
.theme-dark .creator-feedback-toolbar,
.theme-dark .creator-feedback-item {
  border-color: var(--studio-border);
  background: #171717;
}

.theme-dark .creator-dashboard-summary div,
.theme-dark .creator-card-insight,
.theme-dark .creator-reuse-insight,
.theme-dark .creator-support-summary,
.theme-dark .community-support-note,
.theme-dark .community-publish-source {
  background: #20201e;
}

.theme-dark .creator-dashboard-summary .creator-dashboard-primary-metric {
  background: rgba(34, 197, 94, .14);
}

.theme-dark .creator-dashboard-summary .creator-dashboard-primary-metric span,
.theme-dark .creator-dashboard-summary .creator-dashboard-primary-metric strong {
  color: #a7f3d0;
}

.theme-dark .creator-dashboard-summary .creator-dashboard-secondary-metric {
  background: #24262a;
}

.theme-dark .creator-dashboard-summary .creator-dashboard-secondary-metric span,
.theme-dark .creator-dashboard-summary .creator-dashboard-secondary-metric strong {
  color: #a3a8b3;
}

.theme-dark .creator-support-summary,
.theme-dark .community-support-note,
.theme-dark .community-publish-source {
  border-color: var(--studio-border);
  color: #aaa59a;
}

.theme-dark .creator-dashboard-focus span {
  color: #7dd3a8;
}

.theme-dark .creator-dashboard-focus.is-urgent span {
  color: #fda29b;
}

.theme-dark .creator-reuse-insight span {
  color: #7dd3a8;
}

.theme-dark .creator-dashboard-focus p {
  color: #aaa59a;
}

.theme-dark .creator-card-insight button,
.theme-dark .creator-reuse-insight button,
.theme-dark .creator-feedback-empty button,
.theme-dark .creator-dashboard-focus button {
  border-color: #f5f5f5;
  color: #171717;
  background: #f5f5f5;
}

.theme-dark .creator-dashboard-summary strong,
.theme-dark .creator-dashboard-focus strong,
.theme-dark .creator-detail-insight strong,
.theme-dark .community-detail-prompt-box strong,
.theme-dark .creator-feedback-toolbar strong,
.theme-dark .creator-feedback-head strong {
  color: #f5f5f5;
}

.theme-dark .community-detail-prompt-box span {
  color: #aaa59a;
}

.theme-dark .community-publish-source span {
  color: #7dd3a8;
}

.theme-dark .community-publish-source strong {
  color: #f5f5f5;
}

.theme-dark .community-detail-prompt {
  border-color: var(--studio-border);
  color: #d7d2c8;
  background: #20201e;
}

.theme-dark .creator-feedback-item.reported {
  border-color: #7a2e27;
  background: #241b19;
}

.theme-dark .creator-feedback-item.handled {
  background: #1d1d1b;
}

.theme-dark .creator-feedback-thumb {
  background: #171717;
}

.theme-dark .community-reuse-nudge {
  border-color: rgba(112, 176, 129, 0.28);
  background: rgba(72, 120, 84, 0.16);
}

.theme-dark .community-reuse-source-bar {
  border-color: rgba(112, 176, 129, 0.24);
  background: rgba(72, 120, 84, 0.12);
}

.theme-dark .community-download-nudge {
  border-color: rgba(108, 135, 190, 0.32);
  background: rgba(54, 74, 118, 0.2);
}

.theme-dark .community-reuse-nudge strong {
  color: #d8f1df;
}

.theme-dark .community-reuse-source-bar strong {
  color: #d8f1df;
}

.theme-dark .community-reuse-source-bar span,
.theme-dark .community-reuse-source-bar small {
  color: #a8c8b0;
}

.theme-dark .community-download-nudge strong {
  color: #dce6ff;
}

.theme-dark .community-reuse-nudge span {
  color: #a8c8b0;
}

.theme-dark .community-download-nudge span {
  color: #b5c2e0;
}

.theme-dark .community-comment-followup {
  border-color: rgba(112, 176, 129, 0.28);
  background: rgba(72, 120, 84, 0.16);
}

.theme-dark .community-comment-followup strong {
  color: #d8f1df;
}

.theme-dark .community-comment-followup span {
  color: #a8c8b0;
}

.theme-dark .community-reuse-copy strong {
  color: #f5f5f5;
}

.theme-dark .community-reuse-copy p,
.theme-dark .community-reuse-copy ul {
  color: #c9c4bb;
}

.theme-dark .community-reuse-intents button {
  border-color: var(--studio-border);
  color: var(--studio-text);
  background: var(--studio-panel);
}

.theme-dark .community-reuse-intents button span {
  color: #b7b0a4;
}

.theme-dark .community-reuse-intents button:hover,
.theme-dark .community-reuse-intents button:focus-visible,
.theme-dark .community-reuse-intents button.active {
  border-color: #4f8b62;
  background: #173323;
  color: #ddf8e5;
}

.theme-dark .community-reuse-preview {
  background: #26231f;
}

.theme-dark .community-reuse-warning {
  border-color: rgba(198, 143, 45, 0.42);
  background: rgba(121, 84, 20, 0.22);
}

.theme-dark .community-reuse-warning strong {
  color: #ffd889;
}

.theme-dark .community-reuse-warning span {
  color: #e4c987;
}

.theme-dark .agent-sidebar,
.theme-dark .agent-messages {
  background: var(--studio-panel-soft);
}

.theme-dark .agent-conversation,
.theme-dark .agent-empty,
.theme-dark .agent-message,
.theme-dark .agent-selects select,
.theme-dark .agent-attachment,
.theme-dark .icon-button {
  border-color: var(--studio-border);
  color: var(--studio-text);
  background: var(--studio-panel);
}

.theme-dark .agent-conversation.active {
  color: var(--studio-accent-foreground);
  background: var(--studio-accent-strong);
}

@keyframes breathe {
  50% { transform: scale(1.018); opacity: .86; }
}

@keyframes imagePulse {
  50% { filter: brightness(1.08); transform: scale(1.02); }
}

@keyframes linePulse {
  50% { opacity: .5; transform: translateX(8px); }
}

@keyframes pulseDot {
  70% { box-shadow: 0 0 0 10px rgba(24, 164, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(24, 164, 91, 0); }
}

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

@media (min-width: 1536px) {
  .library-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1181px) and (max-width: 1439px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-explainer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  html,
  body {
    overflow: auto;
  }

  .studio-shell {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-width: 0;
    height: auto;
    min-height: 100vh;
    max-width: none;
  }

  .composer-card {
    left: 24px;
    right: 24px;
  }

  .history-panel {
    display: none;
  }

  .history-mobile-open .history-panel {
    position: fixed;
    inset: 92px 12px 12px;
    z-index: 35;
    display: grid;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
  }

  body[data-panel="prompts"].history-mobile-open .history-panel,
  body[data-panel="agent"].history-mobile-open .history-panel,
  body[data-panel="developers"].history-mobile-open .history-panel,
  body[data-panel="settings"].history-mobile-open .history-panel {
    display: grid;
  }

  .selection-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 1fr) auto;
  }

  .selection-tools {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, auto);
    align-items: center;
  }

	  .selection-tools label {
	    min-width: 180px;
	  }

  .rail-collapsed .studio-shell,
  .history-collapsed .studio-shell,
  .rail-collapsed.history-collapsed .studio-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .api-docs-layout,
  .community-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .creator-dashboard-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .creator-dashboard-focus {
    grid-template-columns: 1fr;
  }

  .creator-dashboard-focus button,
  .creator-feedback-action-plan button {
    justify-self: start;
  }

  .creator-feedback-action-plan,
  .creator-feedback-toolbar,
  .creator-feedback-item {
    grid-column: 1 / -1;
  }

  .creator-feedback-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .creator-feedback-thumb {
    width: 72px;
  }

  .creator-feedback-item-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .auth-dialog {
    width: min(100%, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    padding: 20px;
    border-radius: 18px;
  }

  .auth-dialog.community-detail-dialog {
    width: min(100%, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .community-publish-preview {
    grid-template-columns: 1fr;
  }

  .community-reuse-body {
    grid-template-columns: 1fr;
  }

  .community-reuse-preview {
    max-height: 280px;
  }

  .community-reuse-source-bar,
  .community-reuse-source-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-publish-prompt {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .result-publish-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-publish-prompt button {
    width: 100%;
  }

  .community-detail-body {
    max-height: calc(100vh - 74px);
    padding-right: 0;
  }

  .community-publish-success {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .community-publish-success > div {
    justify-content: stretch;
  }

  .community-publish-success > div:last-child {
    display: grid;
    grid-template-columns: 1fr;
  }

  .community-publish-success button {
    width: 100%;
  }

  .community-publish-steps {
    display: grid;
    grid-template-columns: 1fr;
  }

  .community-card-primary-actions,
  .community-card-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .community-card-secondary-actions {
    grid-template-columns: 1fr;
  }

  .studio-shell {
    display: block;
    padding: 10px;
    width: 100%;
    overflow-x: hidden;
  }

  .studio-rail {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .rail-top,
  .rail-nav {
    display: contents;
  }

  .rail-bottom {
    display: contents;
  }

  .rail-brand,
  .rail-collapse,
  .rail-wallet {
    display: none;
  }

  .rail-action,
  .rail-action.rail-active,
  .rail-logo,
  .rail-account {
    width: 100%;
    min-height: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    border-radius: 15px;
  }

  .rail-copy,
  .rail-account span {
    display: none;
  }

  .workspace {
    min-height: calc(100vh - 88px);
    border-radius: 18px;
    width: 100%;
    min-width: 0;
  }

  .workspace-header,
  .workspace-account {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-header {
    padding: 12px 14px;
  }

  .workspace-title {
    flex-wrap: wrap;
    min-width: 0;
  }

  .composer-toolbar,
  .composer-footer,
  .composer-left-tools {
    display: flex;
  }

  .composer-toolbar {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: wrap;
    height: auto;
  }

  .toolbar-top-row,
  .toolbar-bottom-row {
    position: static;
    flex-wrap: wrap;
    width: 100%;
  }

  .toolbar-billing-group {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .composer-footer {
    grid-template-columns: none;
    flex-wrap: wrap;
  }

  .composer-left-tools {
    flex: 1 1 100%;
  }

  .workspace-content {
    padding: 22px 14px 22px;
  }

  .intro-panel h2 {
    max-width: 100%;
    width: 100%;
    font-size: 32px;
    line-height: 1.06;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .prompt-tools {
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .feature-head,
  .feature-head-actions,
  .api-doc-actions,
  .settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-panel {
    flex-direction: column;
  }

  .agent-sidebar {
    flex: 0 0 auto;
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--studio-border);
  }

  .agent-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-controls {
    min-width: 0;
  }

  .agent-selects,
  .agent-composer {
    grid-template-columns: 1fr;
  }

  .agent-head-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .agent-head-actions button {
    flex: 1;
  }

  .agent-attach-button {
    width: 100%;
  }

  .library-grid,
  .community-explainer,
  .creator-dashboard-summary,
  .creator-feedback-action-plan,
  .creator-feedback-item,
  .settings-grid,
  .api-docs-layout,
  .community-detail-grid,
  .community-comment-form,
  .api-schema-block div {
    grid-template-columns: 1fr;
  }

  .creator-feedback-toolbar {
    display: grid;
  }

  .creator-feedback-thumb {
    width: 100%;
    max-width: 160px;
  }

  .feature-search {
    max-width: none;
  }

  .prompt-card {
    height: 210px;
    flex-basis: min(78vw, 260px);
    width: min(78vw, 260px);
    min-width: 0;
  }

  .prompt-card strong,
  .prompt-card p,
  .prompt-card small {
    overflow-wrap: anywhere;
  }

  .composer-card {
    position: static;
    margin: 10px 0 0;
    padding: 26px 14px 14px;
  }

  .select-pill,
  .select-pill[data-select="size"],
  .size-select {
    width: auto;
    flex: 1 1 148px;
    min-width: 0;
  }

  .mode-tabs,
  .layout-tabs {
    width: 100%;
    flex: 1 1 100%;
  }

  .mode-tabs button,
  .layout-tabs button {
    flex: 1;
    padding-inline: 12px;
  }

  .price-chip,
  .billing-chip {
    flex: 1 1 150px;
    min-width: 0;
    white-space: normal;
  }

  .generate-button {
    margin-left: auto;
  }

  .preview {
    min-height: clamp(280px, 54vh, 520px);
  }

  .single-result,
  .multi-result {
    min-height: clamp(280px, 54vh, 520px);
  }

  .generating-stage {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .generating-copy {
    justify-items: center;
    text-align: center;
  }

  .generating-copy strong {
    font-size: 20px;
  }

  .single-result img,
  .multi-result img {
    max-height: min(64vh, 620px);
  }

  .storyboard-scenes {
    grid-template-columns: 1fr;
  }

  .storyboard-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .storyboard-actions button {
    flex: 1;
  }

  .selection-modal {
    padding: 10px;
  }

  .selection-shell {
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .selection-head {
    padding: 14px 16px;
  }

  .selection-head h2 {
    font-size: 18px;
  }

  .selection-body {
    grid-template-rows: minmax(280px, 1fr) auto;
    padding: 10px;
  }

  .selection-canvas-wrap {
    min-height: 280px;
  }

  .selection-tools {
    grid-template-columns: 1fr;
  }
}

/* 2026-05-31: production polish for faster first-use and mobile fit. */
@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .studio-shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed:not(.history-opened) .studio-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  body[data-panel="studio"]:not(.history-opened) .history-panel {
    display: none;
  }

  body[data-panel="studio"]:not(.history-opened) .collapse-history-button span {
    font-size: 0;
  }

  body[data-panel="studio"]:not(.history-opened) .collapse-history-button span::after {
    content: "展开历史";
    font-size: 14px;
  }

  body[data-panel="studio"].history-opened .workspace-content {
    padding-inline: 20px;
  }

  body[data-panel="studio"].history-opened .intro-panel {
    max-width: 860px;
  }

  body[data-panel="studio"].history-opened .spark-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
    border-radius: 13px;
  }

  body[data-panel="studio"].history-opened .spark-icon img {
    width: 28px;
    height: 28px;
  }

  body[data-panel="studio"].history-opened .intro-panel h2 {
    max-width: 640px;
    margin-bottom: 18px;
    font-size: clamp(30px, 2.6vw, 38px);
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    justify-content: flex-start;
    overflow-x: auto;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    flex-basis: 168px;
    width: 168px;
    height: 184px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    flex-basis: 52px;
    height: 52px;
  }

  body[data-panel="studio"].history-opened .prompt-card span {
    margin: 10px 12px 6px;
    font-size: 11px;
  }

  body[data-panel="studio"].history-opened .prompt-card strong,
  body[data-panel="studio"].history-opened .prompt-card p,
  body[data-panel="studio"].history-opened .prompt-card small {
    margin-inline: 12px;
  }

  body[data-panel="studio"].history-opened .prompt-card strong {
    font-size: 13px;
  }

  body[data-panel="studio"].history-opened .prompt-card p {
    font-size: 11px;
    line-height: 1.45;
  }

  body[data-panel="studio"].history-opened .prompt-card small {
    display: none;
  }

  body[data-panel="studio"].history-opened .composer-card {
    left: 20px;
    right: 20px;
    max-width: 860px;
    padding-inline: 14px;
  }

  body[data-panel="studio"].history-opened .history-empty-copy {
    max-width: 210px;
    margin: 18px auto 0;
    text-align: left;
    line-height: 1.7;
  }

  body[data-panel="studio"].history-opened .history {
    padding-inline: 10px;
  }

  body[data-panel="studio"].history-opened .history-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 9px;
    margin-bottom: 8px;
    padding: 9px;
    border-radius: 14px;
  }

  body[data-panel="studio"].history-opened .history-meta {
    display: grid;
    gap: 3px;
    font-size: 11px;
  }

  body[data-panel="studio"].history-opened .history-community-performance {
    gap: 4px;
    margin-top: 5px;
  }

  body[data-panel="studio"].history-opened .history-community-performance span {
    min-height: 20px;
    padding: 3px 7px;
    font-size: 10px;
  }

  body[data-panel="studio"].history-opened .history-community-insight {
    margin-top: 5px;
    padding: 7px 8px;
    border-radius: 10px;
  }

  body[data-panel="studio"].history-opened .history-item p,
  body[data-panel="studio"].history-opened .history-community-insight span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"].history-opened .history-item img {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
  }

  body[data-panel="studio"].history-opened .history-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-panel="studio"].history-opened .history-row-actions a,
  body[data-panel="studio"].history-opened .history-row-actions button,
  body[data-panel="studio"].history-opened .history-more-actions summary {
    justify-content: center;
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid #ece9e2;
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    white-space: nowrap;
  }

  body[data-panel="studio"].history-opened .history-more-actions {
    width: 100%;
  }

  body[data-panel="studio"].history-opened .history-more-actions > div {
    grid-column: 1 / -1;
    gap: 5px;
  }
}

@media (min-width: 1181px) and (max-width: 1320px) {
  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 172px minmax(270px, 316px) minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 12px;
  }

  body[data-panel="studio"].history-opened .studio-rail,
  body[data-panel="studio"].history-opened .history-panel,
  body[data-panel="studio"].history-opened .workspace {
    border-radius: 22px;
  }

  body[data-panel="studio"].history-opened .rail-label {
    font-size: 12px;
  }

  body[data-panel="studio"].history-opened .workspace-content {
    padding-inline: 14px;
  }

  body[data-panel="studio"].history-opened .composer-card {
    left: 14px;
    right: 14px;
  }
}

body[data-panel="studio"] .workspace {
  position: relative;
  overflow: hidden;
}

body[data-panel="studio"] .workspace-content {
  padding-bottom: 360px;
}

body[data-panel="studio"] .intro-panel {
  display: block;
  max-width: 1160px;
  margin: 0 auto;
}

body[data-panel="studio"] .spark-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 15px;
}

body[data-panel="studio"] .spark-icon img {
  width: 32px;
  height: 32px;
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(34px, 3vw, 44px);
}

body[data-panel="studio"] .prompt-tools {
  justify-content: center;
  max-width: none;
  overflow-x: hidden;
}

body[data-panel="studio"] .prompt-card {
  flex-basis: 190px;
  width: 190px;
  height: 204px;
  border-radius: 18px;
}

body[data-panel="studio"] .prompt-cover {
  flex-basis: 62px;
  height: 62px;
}

body[data-panel="studio"] .prompt-card span {
  margin: 12px 14px 7px;
}

body[data-panel="studio"] .prompt-card strong {
  margin-inline: 14px;
  font-size: 14px;
}

body[data-panel="studio"] .prompt-card p {
  margin-inline: 14px;
  font-size: 12px;
}

body[data-panel="studio"] .prompt-card small {
  margin: auto 14px 14px;
  font-size: 11px;
}

body[data-panel="studio"] .composer-card {
  left: 24px;
  right: 24px;
  bottom: 14px;
  max-width: 1160px;
  margin: 0 auto;
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"] .prompt-tools {
    justify-content: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"] .workspace-content {
    padding-bottom: 24px;
  }

  body[data-panel="studio"] .intro-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 0;
  }

  body[data-panel="studio"] .composer-card {
    max-width: none;
  }
}

@media (max-width: 760px) {
  html,
  body,
  .studio-shell,
  .workspace {
    max-width: 100%;
  }

  .studio-shell {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .rail-collapsed .studio-shell,
  .rail-collapsed.history-collapsed .studio-shell {
    grid-template-columns: 1fr;
  }

  .studio-rail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
  }

  .rail-collapsed .studio-rail {
    align-items: stretch;
    padding: 10px;
  }

  .rail-top {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .rail-collapsed .rail-top {
    flex-direction: row;
  }

  .rail-logo {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .rail-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .rail-collapsed .rail-brand,
  .rail-collapsed .rail-copy,
  .rail-collapsed .rail-wallet span,
  .rail-collapsed .rail-wallet strong,
  .rail-collapsed .rail-account span {
    display: block;
  }

  .rail-brand strong,
  .rail-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rail-collapse {
    flex: 0 0 40px;
  }

  .rail-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-action,
  .rail-action.rail-active {
    width: auto;
    min-width: 96px;
    min-height: 44px;
    height: auto;
    justify-content: flex-start;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .rail-collapsed .rail-action,
  .rail-collapsed .rail-action.rail-active {
    width: auto;
    min-width: 96px;
    min-height: 44px;
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .rail-copy {
    display: block;
  }

  .rail-copy small {
    font-size: 11px;
  }

  .rail-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .rail-wallet {
    min-height: 48px;
    border-radius: 14px;
  }

  .rail-account {
    min-width: 52px;
    min-height: 48px;
    border-radius: 14px;
  }

  .rail-collapsed .rail-wallet,
  .rail-collapsed .rail-account {
    display: inline-flex;
    place-items: initial;
    width: auto;
    min-width: 52px;
    min-height: 48px;
    padding: 0 14px;
  }

  .rail-collapsed .rail-wallet::before {
    content: none;
  }

  .workspace-header {
    gap: 10px;
  }

  .workspace-title h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .workspace-account {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ready-pill,
  .account-pill,
  .collapse-history-button {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="admin"] .admin-console-panel {
    grid-template-columns: 1fr;
  }

  body[data-panel="admin"] .admin-console-sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8e0ea;
  }

  body[data-panel="admin"] .admin-console-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-panel="admin"] .admin-console-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-panel="admin"] .admin-console-nav button {
    min-width: 108px;
    flex: 0 0 auto;
  }

  body[data-panel="admin"] .admin-console-sidebar-foot {
    margin-top: 0;
  }

  body[data-panel="admin"] .admin-overview-grid,
  body[data-panel="admin"] .admin-overview-panels {
    grid-template-columns: 1fr;
  }

  body[data-panel="admin"] .admin-shortcuts {
    grid-template-columns: 1fr;
  }

  body[data-panel="admin"] .admin-console-topbar {
    padding: 14px;
  }

  body[data-panel="admin"] .admin-surface,
  body[data-panel="admin"] .admin-list-surface {
    padding: 14px;
  }

  body[data-panel="admin"] .admin-toolbar-fields {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .workspace-content {
    padding: 16px 12px 18px;
    overflow-x: hidden;
  }

  body[data-panel="studio"] .workspace {
    display: flex;
    flex-direction: column;
  }

  body[data-panel="studio"] .composer-card {
    order: 1;
    margin: 0 12px 12px;
    padding: 14px 12px 12px;
  }

  body[data-panel="studio"] .workspace-content {
    order: 2;
  }

  body[data-panel="studio"] .spark-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
  }

  body[data-panel="studio"] .intro-panel h2 {
    max-width: 100%;
    width: min(100%, calc(100vw - 40px));
    font-size: clamp(25px, 7.2vw, 30px);
    line-height: 1.08;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
    overflow: visible;
  }

  body[data-panel="studio"] .prompt-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  body[data-panel="studio"] .prompt-card {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    width: 100%;
    height: auto;
    min-height: 108px;
    flex-basis: auto;
    padding: 10px;
  }

  body[data-panel="studio"] .prompt-cover {
    grid-row: 1 / span 3;
    width: 68px;
    height: 88px;
    border: 0;
    border-radius: 14px;
  }

  body[data-panel="studio"] .prompt-card span {
    margin: 0 0 5px;
  }

  body[data-panel="studio"] .prompt-card strong {
    margin: 0 0 5px;
    font-size: 14px;
  }

  body[data-panel="studio"] .prompt-card p {
    margin: 0;
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"] .prompt-card small {
    display: none;
  }

  .composer-resize {
    display: none;
  }

  .composer-toolbar {
    gap: 8px;
  }

  .toolbar-top-row,
  .toolbar-bottom-row,
  .composer-left-tools {
    gap: 8px;
  }

  textarea {
    min-height: 88px;
    height: 88px;
    padding-inline: 4px;
    font-size: 14px;
  }

  .composer-footer {
    gap: 8px;
    margin-top: 8px;
  }

  .upload-trigger,
  .clarity-mode-button,
  .prompt-optimize-button {
    min-height: 34px;
  }

  .price-chip,
  .billing-chip,
  .status {
    flex: 1 1 100%;
  }

  .status {
    white-space: normal;
  }

  .generate-button {
    width: 100%;
    min-height: 44px;
    margin-left: 0;
  }

  body[data-panel="studio"] .studio-shell {
    padding: 8px;
    background: #f4f6fb;
  }

  body[data-panel="studio"] .studio-rail {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 18px;
  }

  body[data-panel="studio"] .rail-top {
    display: flex;
    min-height: 42px;
  }

  body[data-panel="studio"] .rail-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .rail-logo img {
    width: 28px;
    height: 28px;
  }

  body[data-panel="studio"] .rail-brand {
    display: block;
    padding: 5px 2px;
  }

  body[data-panel="studio"] .rail-brand strong {
    font-size: 14px;
  }

  body[data-panel="studio"] .rail-brand span {
    font-size: 11px;
  }

  body[data-panel="studio"] .rail-collapse {
    display: none;
  }

  body[data-panel="studio"] .rail-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    justify-content: space-between;
    padding: 0 0 2px;
  }

  body[data-panel="studio"] .rail-action,
  body[data-panel="studio"] .rail-action.rail-active {
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    justify-content: center;
    gap: 0;
  }

  body[data-panel="studio"] .rail-icon {
    width: 28px;
    height: 28px;
    border-radius: 11px;
  }

  body[data-panel="studio"] .rail-icon svg {
    width: 16px;
    height: 16px;
  }

  body[data-panel="studio"] .rail-copy strong {
    display: none;
  }

  body[data-panel="studio"] .rail-copy,
  body[data-panel="studio"] .rail-copy small {
    display: none;
  }

  body[data-panel="studio"] .rail-bottom {
    display: none;
  }

  body[data-panel="studio"] .workspace {
    display: flex;
    min-height: auto;
    overflow: visible;
    border-radius: 20px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body[data-panel="studio"] .workspace-header {
    display: none;
  }

  body[data-panel="studio"] .workspace-content {
    order: 1;
    padding: 18px 14px 12px;
    border: 1px solid var(--studio-border);
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, 0.82);
  }

  body[data-panel="studio"] .intro-panel {
    gap: 14px;
  }

  body[data-panel="studio"] .spark-icon {
    width: 38px;
    height: 38px;
    margin-bottom: 8px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .spark-icon img {
    width: 28px;
    height: 28px;
  }

  body[data-panel="studio"] .intro-panel h2 {
    width: 100%;
    margin-bottom: 4px;
    font-size: 22px;
    line-height: 1.22;
  }

  body[data-panel="studio"] .prompt-tools {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 4px;
  }

  body[data-panel="studio"] .prompt-card {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 106px;
    padding: 10px;
    border-radius: 16px;
  }

  body[data-panel="studio"] .prompt-cover {
    width: 70px;
    height: 86px;
    border-radius: 13px;
  }

  body[data-panel="studio"] .prompt-card span {
    margin-bottom: 6px;
    font-size: 11px;
  }

  body[data-panel="studio"] .prompt-card strong {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.25;
  }

  body[data-panel="studio"] .prompt-card p {
    font-size: 12px;
    line-height: 1.55;
  }

  body[data-panel="studio"] .composer-card {
    order: 2;
    margin: 0;
    padding: 14px;
    border-radius: 0 0 20px 20px;
    border-top: 0;
    background: #fff;
  }

  body[data-panel="studio"] .composer-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 12px;
    padding-top: 0;
  }

  body[data-panel="studio"] .toolbar-bottom-row,
  body[data-panel="studio"] .toolbar-top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }

  body[data-panel="studio"] .toolbar-top-row {
    align-items: stretch;
  }

  body[data-panel="studio"] .select-pill[data-select="size"],
  body[data-panel="studio"] .size-select {
    flex: 1 1 calc(100% - 54px);
    width: calc(100% - 54px);
    min-width: 0;
  }

  body[data-panel="studio"] .help-pill {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
  }

  body[data-panel="studio"] .select-pill[data-select="quality"],
  body[data-panel="studio"] .select-pill[data-select="format"],
  body[data-panel="studio"] .count-select {
    flex: 1 1 calc(50% - 5px);
    width: calc(50% - 5px);
    min-width: 0;
  }

  body[data-panel="studio"] .layout-tabs {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  body[data-panel="studio"] .toolbar-billing-group {
    display: grid;
    flex: 1 1 100%;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  body[data-panel="studio"] .mode-tabs,
  body[data-panel="studio"] .layout-tabs {
    width: 100%;
  }

  body[data-panel="studio"] .mode-tabs button,
  body[data-panel="studio"] .layout-tabs button {
    min-height: 42px;
  }

  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    min-height: 44px;
    border-radius: 16px;
  }

  body[data-panel="studio"] textarea {
    min-height: 128px;
    height: 128px;
    padding: 4px 2px;
    line-height: 1.65;
  }

  body[data-panel="studio"] .composer-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  body[data-panel="studio"] .composer-left-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-panel="studio"] .upload-trigger,
  body[data-panel="studio"] .clarity-mode-button,
  body[data-panel="studio"] .prompt-optimize-button {
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 12px;
  }

  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip,
  body[data-panel="studio"] .status {
    width: 100%;
  }

  body[data-panel="studio"] .generate-button {
    min-height: 48px;
    border-radius: 16px;
  }
}

/* Frontend-design skill refactor: atelier-grade creator workbench. */
:root {
  --studio-bg: #eef1ef;
  --studio-panel: #fffdf8;
  --studio-panel-soft: #f7f4eb;
  --studio-soft: #f1eee5;
  --studio-border: #ded9cb;
  --studio-border-strong: #c8beab;
  --studio-text: #12120f;
  --studio-muted: #6d6a61;
  --studio-faint: #99958b;
  --studio-black: #11130f;
  --studio-green: #0f7d5a;
  --studio-blue: #285e8e;
  --studio-accent-strong: #151713;
  --studio-accent-foreground: #fffaf0;
  --atelier-ink: #11130f;
  --atelier-paper: #fffdf8;
  --atelier-paper-2: #f7f4eb;
  --atelier-gold: #b8872b;
  --atelier-red: #9f3845;
  --atelier-line: rgba(42, 38, 30, 0.13);
  --atelier-shadow: 0 24px 60px rgba(37, 33, 26, 0.13);
  --atelier-shadow-soft: 0 12px 34px rgba(37, 33, 26, 0.08);
}

body {
  color: var(--studio-text);
  background:
    linear-gradient(90deg, rgba(17, 19, 15, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 19, 15, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, #ecefe9 0%, #f8f5ee 48%, #e7ece7 100%);
  background-size: 36px 36px, 36px 36px, auto;
  font-family: "Avenir Next", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.studio-shell {
  grid-template-columns: 236px var(--history-width, 320px) minmax(0, 1fr);
  gap: 12px;
  max-width: none;
  padding: 12px;
}

.studio-rail,
.history-panel,
.workspace,
.feature-panel,
.composer-card,
.result-thread {
  border-color: var(--atelier-line);
  box-shadow: var(--atelier-shadow-soft);
  backdrop-filter: blur(18px);
}

.studio-rail {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(245, 242, 234, 0.9)),
    var(--studio-panel);
}

.rail-logo,
.rail-collapse,
.rail-icon {
  border-color: rgba(17, 19, 15, 0.1);
  background: rgba(255, 253, 248, 0.82);
}

.rail-action {
  min-height: 54px;
  border-radius: 15px;
}

.rail-action:hover {
  background: rgba(255, 253, 248, 0.78);
}

.rail-action.rail-active,
.rail-action.active {
  color: #fffaf0;
  background:
    linear-gradient(135deg, #11130f 0%, #24251f 100%);
  box-shadow: 0 16px 34px rgba(17, 19, 15, 0.22);
}

.rail-action.rail-active .rail-icon,
.rail-action.active .rail-icon {
  color: #11130f;
  background: #fffaf0;
}

.rail-action.rail-active .rail-copy small,
.rail-action.active .rail-copy small {
  color: rgba(255, 250, 240, 0.7);
}

.rail-wallet,
.rail-account {
  border-color: var(--atelier-line);
  background: rgba(255, 253, 248, 0.9);
}

.workspace {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(249, 247, 240, 0.94));
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 78px 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(17, 19, 15, 0.12), transparent);
  pointer-events: none;
}

.workspace-header {
  min-height: 68px;
  padding: 14px 22px;
  border-bottom-color: rgba(17, 19, 15, 0.08);
  background: rgba(255, 253, 248, 0.72);
}

.workspace-title h1 {
  font-size: 25px;
  font-weight: 860;
}

.workspace-badge {
  min-height: 25px;
  color: #285e8e;
  background: #e8f0f6;
}

.workspace-badge.wallet,
.price-chip {
  color: #0f7d5a;
  background: #e4f3eb;
}

.ready-pill,
.account-pill,
.collapse-history-button,
.secondary-button,
.secondary-link,
.text-button {
  border-color: var(--atelier-line);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: none;
}

.primary-button,
.generate-button,
.new-chat-button,
.mode-tabs button.active,
.layout-tabs button.active {
  color: #fffaf0;
  background: #11130f;
  box-shadow: 0 12px 28px rgba(17, 19, 15, 0.18);
}

body[data-panel="studio"] .workspace-content {
  position: relative;
  padding: 34px 26px 330px;
  background:
    linear-gradient(90deg, rgba(17, 19, 15, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 19, 15, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
}

body[data-panel="studio"] .intro-panel {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
}

body[data-panel="studio"] .spark-icon {
  display: none;
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 780px;
  margin: 0 0 24px;
  font-size: clamp(38px, 3.8vw, 56px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
}

body[data-panel="studio"] .prompt-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(172px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 1120px;
  overflow: visible;
}

body[data-panel="studio"] .prompt-card {
  display: grid;
  grid-template-rows: 92px auto auto 1fr auto;
  width: auto;
  height: 236px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(17, 19, 15, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 36px rgba(37, 33, 26, 0.1);
}

body[data-panel="studio"] .prompt-card:hover {
  border-color: rgba(184, 135, 43, 0.42);
  box-shadow: 0 24px 52px rgba(37, 33, 26, 0.16);
}

body[data-panel="studio"] .prompt-cover {
  width: 100%;
  height: 92px;
  border-radius: 0;
}

body[data-panel="studio"] .prompt-card span {
  width: fit-content;
  margin: 14px 14px 8px;
  color: #6e5b27;
  background: #f2ead8;
}

body[data-panel="studio"] .prompt-card strong,
body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"] .prompt-card small {
  margin-inline: 14px;
}

body[data-panel="studio"] .prompt-card strong {
  color: #151713;
  font-size: 14px;
  line-height: 1.35;
}

body[data-panel="studio"] .prompt-card p {
  color: #68645b;
  font-size: 12px;
  line-height: 1.55;
}

body[data-panel="studio"] .prompt-card small {
  margin-bottom: 14px;
  color: #938d80;
}

body[data-panel="studio"] .composer-card {
  left: 24px;
  right: 24px;
  bottom: 14px;
  max-width: 1160px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 26px 70px rgba(37, 33, 26, 0.18);
}

.composer-toolbar {
  gap: 12px;
}

.toolbar-top-row,
.toolbar-bottom-row {
  gap: 10px;
}

.mode-tabs,
.layout-tabs {
  background: #ece7dd;
}

.mode-tabs button,
.layout-tabs button {
  border-radius: 999px;
}

.select-pill,
.help-pill,
.billing-chip {
  border-color: var(--atelier-line);
  background: rgba(255, 253, 248, 0.92);
}

body[data-panel="studio"] textarea {
  min-height: 118px;
  padding: 12px 10px;
  color: #151713;
  background: rgba(255, 253, 248, 0.68);
}

.composer-footer {
  align-items: center;
  gap: 12px;
}

.composer-left-tools {
  min-width: 0;
}

.upload-trigger,
.clarity-mode-button,
.prompt-optimize-button {
  border-color: var(--atelier-line);
  background: #f7f4eb;
}

.generate-button {
  min-width: 142px;
  border-radius: 16px;
}

.history-panel {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(246, 243, 235, 0.92));
}

.history-panel-head h2 {
  font-size: 24px;
  font-weight: 880;
}

.history-actions {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.history-filters input {
  border-color: var(--atelier-line);
  background: rgba(255, 253, 248, 0.92);
}

.history-filter-row button.active {
  color: #fffaf0;
  background: #11130f;
}

.history-item {
  border-color: rgba(17, 19, 15, 0.1);
  background: rgba(255, 253, 248, 0.92);
}

.history-empty-copy {
  color: #6d6a61;
}

body[data-panel="studio"].history-opened .studio-shell {
  grid-template-columns: 220px clamp(288px, 23vw, 340px) minmax(0, 1fr);
}

body[data-panel="studio"].history-opened .workspace-content {
  padding: 28px 20px 314px;
}

body[data-panel="studio"].history-opened .intro-panel {
  max-width: 860px;
  margin: 0;
}

body[data-panel="studio"].history-opened .intro-panel h2 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: clamp(32px, 3vw, 42px);
}

body[data-panel="studio"].history-opened .prompt-tools {
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  gap: 12px;
  max-width: 900px;
}

body[data-panel="studio"].history-opened .prompt-card {
  grid-template-rows: 68px auto auto 1fr;
  height: 176px;
  min-width: 0;
}

body[data-panel="studio"].history-opened .prompt-cover {
  height: 68px;
}

body[data-panel="studio"].history-opened .prompt-card span {
  margin: 10px 10px 6px;
  padding: 3px 8px;
  font-size: 10px;
}

body[data-panel="studio"].history-opened .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card small {
  margin-inline: 10px;
}

body[data-panel="studio"].history-opened .prompt-card strong {
  font-size: 12px;
}

body[data-panel="studio"].history-opened .prompt-card p {
  font-size: 11px;
  -webkit-line-clamp: 2;
}

body[data-panel="studio"].history-opened .prompt-card small {
  display: none;
}

body[data-panel="studio"].history-opened .composer-card {
  left: 20px;
  right: 20px;
  max-width: 900px;
}

body[data-panel="studio"].history-opened .composer-toolbar {
  grid-template-columns: 120px minmax(0, 1fr);
}

body[data-panel="studio"].history-opened .toolbar-top-row {
  justify-content: flex-end;
}

body[data-panel="studio"].history-opened .select-pill {
  min-width: 124px;
}

body[data-panel="studio"].history-opened .size-select {
  min-width: 220px;
}

.feature-panel {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(249, 247, 240, 0.95));
}

.feature-head {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(17, 19, 15, 0.08);
}

.feature-head h2 {
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 900;
}

.feature-kicker {
  color: #6e5b27;
  background: #f2ead8;
}

.feature-search {
  border-color: var(--atelier-line);
  background: rgba(255, 253, 248, 0.9);
}

.community-explainer {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.community-explainer div,
.community-download-nudge,
.api-doc-block,
.api-key-panel,
.settings-grid article {
  border-color: rgba(17, 19, 15, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.92);
}

.library-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.community-card {
  border-color: rgba(17, 19, 15, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 16px 38px rgba(37, 33, 26, 0.11);
}

.community-cover {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(17, 19, 15, 0.08), transparent),
    #ece7dd;
}

body[data-panel="admin"] .workspace {
  background: #f1eee5;
}

body[data-panel="admin"] #adminConsolePanel {
  margin: 12px;
}

.admin-console-panel {
  grid-template-columns: 230px minmax(0, 1fr);
  border-color: rgba(17, 19, 15, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--atelier-shadow);
}

.admin-console-sidebar {
  border-right-color: rgba(255, 250, 240, 0.12);
  background:
    linear-gradient(180deg, #151713 0%, #26241d 100%);
  color: #fffaf0;
}

.admin-console-sidebar-head h2 {
  color: #fffaf0;
  font-size: 26px;
}

.admin-console-sidebar-head p,
.admin-console-nav button small {
  color: rgba(255, 250, 240, 0.62);
}

.admin-console-nav button {
  min-height: 48px;
  border-radius: 12px;
  color: rgba(255, 250, 240, 0.82);
}

.admin-console-nav button.active {
  border-color: rgba(255, 250, 240, 0.16);
  color: #151713;
  background: #fffaf0;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.admin-console-nav button.active small {
  color: #6d6a61;
}

.admin-console-main {
  gap: 14px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(17, 19, 15, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 19, 15, 0.03) 1px, transparent 1px),
    #f7f4eb;
  background-size: 34px 34px;
}

.admin-console-topbar {
  min-height: 92px;
  padding: 18px;
  border: 1px solid rgba(17, 19, 15, 0.1);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.94);
}

.admin-console-topbar-copy h3 {
  font-size: 24px;
  font-weight: 900;
}

.admin-surface,
.admin-list-surface,
.admin-overview-grid article {
  border-color: rgba(17, 19, 15, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 12px 28px rgba(37, 33, 26, 0.08);
}

.admin-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-toolbar,
.admin-table-shell {
  border-color: rgba(17, 19, 15, 0.1);
  background: rgba(255, 253, 248, 0.72);
}

.modal-backdrop {
  background: rgba(17, 19, 15, 0.32);
  backdrop-filter: blur(18px);
}

.auth-dialog {
  border: 1px solid rgba(17, 19, 15, 0.1);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 28px 80px rgba(17, 19, 15, 0.24);
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 190px minmax(280px, 318px) minmax(0, 1fr);
  }

  body[data-panel="studio"].history-opened .rail-copy small,
  body[data-panel="studio"].history-opened .rail-brand span {
    display: none;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  body[data-panel="studio"].history-opened .prompt-card {
    height: 156px;
  }
}

@media (max-width: 1180px) {
  .studio-shell {
    min-width: 0;
    padding: 10px;
  }

  body[data-panel="studio"] .workspace-content {
    padding-bottom: 22px;
  }

  body[data-panel="studio"] .composer-card {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    margin-top: 10px;
  }

  body[data-panel="studio"] .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-explainer,
  .admin-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 760px) {
  body {
    background:
      linear-gradient(90deg, rgba(17, 19, 15, 0.035) 1px, transparent 1px),
      linear-gradient(180deg, rgba(17, 19, 15, 0.03) 1px, transparent 1px),
      #eef1ef;
    background-size: 30px 30px, 30px 30px, auto;
  }

  .studio-shell {
    gap: 8px;
    padding: 8px;
  }

  .studio-rail {
    border-radius: 18px;
  }

  body[data-panel="studio"] .workspace-content {
    padding: 18px 14px 0;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 253, 248, 0.9);
  }

  body[data-panel="studio"] .intro-panel h2 {
    margin-bottom: 14px;
    font-size: 24px;
    line-height: 1.14;
  }

  body[data-panel="studio"] .prompt-tools {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-panel="studio"] .prompt-card {
    grid-template-columns: 78px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    min-height: 112px;
    height: auto;
    padding: 10px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .prompt-cover {
    grid-row: 1 / 4;
    width: 78px;
    height: 92px;
    border-radius: 12px;
  }

  body[data-panel="studio"] .prompt-card span,
  body[data-panel="studio"] .prompt-card strong,
  body[data-panel="studio"] .prompt-card p,
  body[data-panel="studio"] .prompt-card small {
    margin-inline: 10px 0;
  }

  body[data-panel="studio"] .prompt-card span {
    margin-top: 0;
  }

  body[data-panel="studio"] .prompt-card small {
    display: none;
  }

  body[data-panel="studio"] .composer-card {
    margin: 0 -14px;
    padding: 14px;
    border-radius: 0 0 18px 18px;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .toolbar-top-row,
  body[data-panel="studio"] .toolbar-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .mode-tabs,
  body[data-panel="studio"] .size-select,
  body[data-panel="studio"] .toolbar-billing-group,
  body[data-panel="studio"] .generate-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-panel="studio"] .help-pill {
    width: 100%;
  }

  body[data-panel="studio"] textarea {
    min-height: 132px;
  }

  .feature-panel {
    padding: 16px 12px;
    border-radius: 18px;
  }

  .feature-head {
    display: grid;
  }

  .feature-head h2 {
    font-size: 28px;
  }

  .community-explainer,
  .library-grid,
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  body[data-panel="admin"] .admin-console-panel {
    grid-template-columns: 1fr;
  }

  body[data-panel="admin"] .admin-console-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 250, 240, 0.12);
  }

  body[data-panel="admin"] .admin-console-nav {
    display: flex;
    overflow-x: auto;
  }

  body[data-panel="admin"] .admin-console-nav button {
    flex: 0 0 132px;
  }

  body[data-panel="admin"] .admin-console-topbar {
    min-height: 0;
  }
}

/* Final visual QA overrides. Keep last so older production polish cannot win. */
body[data-panel="studio"] .prompt-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-panel="studio"] .prompt-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1181px) {
  body[data-panel="studio"].history-opened .intro-panel h2 {
    max-width: 680px;
    font-size: clamp(30px, 2.8vw, 38px);
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 660px;
    overflow: visible;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    width: auto;
    height: 132px;
    min-width: 0;
    padding: 10px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    grid-row: 1 / 4;
    width: 104px;
    height: 112px;
    flex-basis: auto;
    border-radius: 12px;
  }

  body[data-panel="studio"].history-opened .prompt-card span,
  body[data-panel="studio"].history-opened .prompt-card strong,
  body[data-panel="studio"].history-opened .prompt-card p,
  body[data-panel="studio"].history-opened .prompt-card small {
    margin-inline: 12px 0;
  }

  body[data-panel="studio"].history-opened .prompt-card span {
    margin-top: 0;
  }

  body[data-panel="studio"].history-opened .prompt-card strong {
    font-size: 13px;
  }

  body[data-panel="studio"].history-opened .prompt-card p {
    font-size: 11px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"].history-opened .prompt-card small {
    display: none;
  }

  body[data-panel="studio"].history-opened .composer-toolbar {
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    align-items: start;
  }

  body[data-panel="studio"].history-opened .toolbar-bottom-row {
    min-width: 0;
  }

  body[data-panel="studio"].history-opened .toolbar-top-row {
    display: grid;
    grid-template-columns: minmax(188px, 1.35fr) 44px repeat(3, minmax(112px, 1fr)) minmax(128px, auto);
    gap: 9px;
  }

  body[data-panel="studio"].history-opened .mode-tabs {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"].history-opened .mode-tabs button {
    min-width: 0;
    padding-inline: 12px;
  }
}

@media screen and (max-width: 760px) {
  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 78px minmax(0, 1fr);
    height: auto;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    width: 78px;
    height: 92px;
  }
}

/* Motion layer: make the studio feel alive without distracting from creation. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(184, 135, 43, 0.13), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(40, 94, 142, 0.11), transparent 32%),
    radial-gradient(circle at 62% 88%, rgba(15, 125, 90, 0.09), transparent 34%);
  opacity: 0.82;
  animation: studioAmbientDrift 18s ease-in-out infinite alternate;
}

.workspace,
.history-panel,
.studio-rail {
  animation: studioPanelIn 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.history-panel {
  animation-delay: 70ms;
}

.workspace {
  animation-delay: 120ms;
}

body[data-panel="studio"] .intro-panel h2 {
  animation: studioTitleIn 640ms cubic-bezier(.18, .86, .26, 1) both;
}

body[data-panel="studio"] .prompt-card {
  position: relative;
  transform: translateY(0) rotate(0.001deg);
  transform-origin: 50% 80%;
  transition:
    transform 260ms cubic-bezier(.2, .8, .2, 1),
    box-shadow 260ms ease,
    border-color 260ms ease,
    filter 260ms ease;
  animation: promptCardIn 560ms cubic-bezier(.18, .86, .26, 1) both;
}

body[data-panel="studio"] .prompt-card:nth-child(1) { animation-delay: 80ms; }
body[data-panel="studio"] .prompt-card:nth-child(2) { animation-delay: 150ms; }
body[data-panel="studio"] .prompt-card:nth-child(3) { animation-delay: 220ms; }
body[data-panel="studio"] .prompt-card:nth-child(4) { animation-delay: 290ms; }

body[data-panel="studio"] .prompt-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.42) 36%, transparent 56%);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity 220ms ease, transform 520ms ease;
}

body[data-panel="studio"] .prompt-card:hover {
  transform: translateY(-7px) rotate(-0.35deg);
  filter: saturate(1.04);
}

body[data-panel="studio"] .prompt-card:hover::after {
  opacity: 1;
  transform: translateX(55%);
}

body[data-panel="studio"] .prompt-card:nth-child(even):hover {
  transform: translateY(-7px) rotate(0.35deg);
}

body[data-panel="studio"] .prompt-cover {
  position: relative;
  overflow: hidden;
}

body[data-panel="studio"] .prompt-cover::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 26% 28%, rgba(255, 255, 255, 0.44), transparent 28%),
    linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.2), transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.58;
  transform: rotate(8deg);
  animation: coverLightSweep 7s ease-in-out infinite alternate;
}

body[data-panel="studio"] .composer-card {
  transform: translateY(0);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease,
    border-color 240ms ease,
    background 240ms ease;
  animation: composerRise 680ms cubic-bezier(.18, .86, .26, 1) 180ms both;
}

body[data-panel="studio"] .composer-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(184, 135, 43, 0.32);
  box-shadow: 0 30px 86px rgba(37, 33, 26, 0.22);
}

body[data-panel="studio"] textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(184, 135, 43, 0.44);
  box-shadow: 0 0 0 4px rgba(184, 135, 43, 0.12);
}

.rail-action,
.history-item,
.community-card,
.admin-surface,
.admin-overview-grid article {
  transition:
    transform 220ms cubic-bezier(.2, .8, .2, 1),
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
}

.rail-action:hover,
.history-item:hover,
.community-card:hover,
.admin-surface:hover,
.admin-overview-grid article:hover {
  transform: translateY(-3px);
}

.primary-button,
.generate-button,
.new-chat-button,
.mode-tabs button.active,
.layout-tabs button.active {
  position: relative;
  overflow: hidden;
}

.primary-button::after,
.generate-button::after,
.new-chat-button::after,
.mode-tabs button.active::after,
.layout-tabs button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 250, 240, 0.32) 42%, transparent 58%);
  opacity: 0;
  transform: translateX(-80%);
  transition: opacity 180ms ease, transform 420ms ease;
}

.primary-button:hover::after,
.generate-button:hover::after,
.new-chat-button:hover::after,
.mode-tabs button.active:hover::after,
.layout-tabs button.active:hover::after {
  opacity: 1;
  transform: translateX(80%);
}

.ready-pill svg {
  animation: readyTick 2.8s ease-in-out infinite;
}

.price-chip {
  animation: softPulse 3.8s ease-in-out infinite;
}

.composer-resize {
  animation: resizeHandleBreath 2.2s ease-in-out infinite;
}

@keyframes studioAmbientDrift {
  0% {
    transform: translate3d(-1%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(1.6%, 1%, 0) scale(1.04);
  }
}

@keyframes studioPanelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes studioTitleIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes promptCardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes composerRise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes coverLightSweep {
  0% {
    transform: translateX(-8%) rotate(8deg);
  }
  100% {
    transform: translateX(8%) rotate(8deg);
  }
}

@keyframes readyTick {
  0%, 100% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(12deg);
  }
  60% {
    transform: rotate(-6deg);
  }
}

@keyframes softPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(15, 125, 90, 0);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(15, 125, 90, 0.08);
  }
}

@keyframes resizeHandleBreath {
  0%, 100% {
    opacity: 0.72;
    transform: translateX(-50%) scaleX(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.12);
  }
}

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

/* Login/register campaign modal inspired by large creator-platform sign-in dialogs. */
#authModal {
  padding: 26px;
  background: rgba(8, 10, 12, 0.68);
  backdrop-filter: blur(8px);
}

#authModal .login-campaign-dialog {
  position: relative;
  display: grid;
  grid-template-rows: 250px auto 74px;
  width: min(1160px, calc(100vw - 48px));
  max-height: min(860px, calc(100vh - 48px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.32);
}

.login-campaign-close {
  top: 24px;
  right: 24px;
  z-index: 4;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.login-campaign-close:hover {
  background: rgba(255, 255, 255, 0.34);
}

.login-campaign-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.38), transparent 18%),
    radial-gradient(circle at 42% 86%, rgba(255, 255, 255, 0.28), transparent 18%),
    linear-gradient(135deg, #9eeaff 0%, #4ab7f3 48%, #b5f5f1 100%);
}

.login-campaign-hero::before,
.login-campaign-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 3px dashed rgba(255, 255, 255, 0.72);
  opacity: 0.9;
}

.login-campaign-hero::before {
  left: -34px;
  top: -18px;
  width: 182px;
  height: 92px;
  border-radius: 999px;
  transform: rotate(-10deg);
}

.login-campaign-hero::after {
  right: 142px;
  top: 118px;
  width: 332px;
  height: 70px;
  border-radius: 999px;
  transform: rotate(4deg);
}

.login-free-stamp {
  position: absolute;
  left: 28px;
  top: 28px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.94);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: 1px;
  transform: rotate(-8deg);
}

.login-paper-plane {
  position: absolute;
  right: 202px;
  top: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(160deg, #5fd7ff, #2477f2);
  box-shadow: 0 18px 38px rgba(36, 119, 242, 0.28);
  animation: loginPlaneFloat 3.2s ease-in-out infinite;
}

.login-paper-plane svg {
  width: 44px;
  height: 44px;
  stroke-width: 2.3;
  transform: rotate(-8deg);
}

.login-hero-pill {
  position: absolute;
  left: 50%;
  top: 34px;
  z-index: 2;
  min-width: min(460px, 54vw);
  padding: 20px 56px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #33a9ff, #206cf4);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.24),
    0 12px 28px rgba(24, 104, 230, 0.28);
  font-size: 34px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.login-hero-ribbon {
  position: absolute;
  left: 118px;
  top: 132px;
  z-index: 2;
  padding: 17px 72px;
  border-radius: 999px;
  color: #1d74e8;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 26px rgba(49, 146, 219, 0.14);
  font-size: 25px;
  font-weight: 820;
  transform: rotate(-4deg);
}

.login-hero-dashed {
  position: absolute;
  right: 154px;
  top: 138px;
  z-index: 2;
  color: #fff;
  font-size: 20px;
  font-weight: 760;
}

.login-campaign-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  min-height: 0;
  background: #fff;
}

.login-form-panel,
.login-scan-panel {
  min-width: 0;
  padding: 48px 64px 42px;
}

.login-form-panel {
  border-right: 1px solid #eef0f4;
}

.login-form-panel .eyebrow {
  display: none;
}

.login-form-panel h2,
.login-scan-panel h3 {
  margin: 0 0 34px;
  color: #151515;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.login-form-panel #authIntro {
  min-height: 22px;
  margin: -22px 0 24px;
  color: #7b7f87;
  font-size: 14px;
  text-align: center;
}

.login-form-panel label {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  color: #1f2328;
  font-size: 0;
  font-weight: 760;
}

.login-form-panel .auth-register-only {
  display: none;
}

.login-form-panel .auth-register-only.visible {
  display: grid;
}

.login-form-panel input {
  width: 100%;
  min-height: 72px;
  border: 0;
  border-radius: 14px;
  background: #f5f6f8;
  color: #151515;
  font-size: 22px;
  font-weight: 650;
}

.login-form-panel input::placeholder {
  color: #a4a8af;
  font-weight: 520;
}

.login-form-panel #account {
  padding-left: 28px;
}

.login-form-panel #password,
.login-form-panel #displayName {
  padding-left: 28px;
}

.login-form-panel .auth-status {
  min-height: 24px;
  margin: 4px 0 18px;
  color: #d7463f;
  font-size: 14px;
  text-align: center;
}

.login-form-panel .auth-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
}

.login-form-panel #loginBtn,
.login-form-panel #registerBtn {
  min-height: 76px;
  border-radius: 12px;
  font-size: 24px;
  font-weight: 900;
}

.login-form-panel #loginBtn {
  background: linear-gradient(180deg, #2f82ff, #2468f2);
  box-shadow: 0 16px 32px rgba(36, 104, 242, 0.24);
}

.login-form-panel #registerBtn {
  border: 1px solid #e7e9ee;
  color: #2468f2;
  background: #fff;
  box-shadow: none;
}

.login-scan-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  text-align: center;
}

.login-qr-card {
  display: grid;
  place-items: center;
  width: 206px;
  height: 206px;
  margin: 24px 0 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 9px #f6f7f9;
}

.login-qr-fake {
  position: relative;
  width: 160px;
  height: 160px;
  overflow: hidden;
  border: 8px solid #fff;
  background:
    linear-gradient(90deg, transparent 47%, #111 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, #111 47% 53%, transparent 53%),
    repeating-linear-gradient(90deg, #111 0 8px, transparent 8px 16px, #111 16px 24px, transparent 24px 32px),
    repeating-linear-gradient(0deg, transparent 0 8px, #111 8px 16px, transparent 16px 24px, #111 24px 32px),
    #fff;
  background-blend-mode: normal, normal, multiply, multiply, normal;
}

.login-qr-fake::before,
.login-qr-fake::after,
.login-qr-fake i {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  border: 8px solid #111;
  background: #fff;
  box-shadow: inset 0 0 0 9px #111;
}

.login-qr-fake::before {
  left: 0;
  top: 0;
}

.login-qr-fake::after {
  right: 0;
  top: 0;
}

.login-qr-fake i:nth-child(1) {
  left: 0;
  bottom: 0;
}

.login-qr-fake i:nth-child(2),
.login-qr-fake i:nth-child(3) {
  width: 12px;
  height: 12px;
  border: 0;
  background: #111;
  box-shadow:
    22px 0 #111,
    44px 0 #111,
    0 22px #111,
    44px 22px #111,
    22px 44px #111,
    66px 44px #111;
}

.login-qr-fake i:nth-child(2) {
  left: 74px;
  top: 68px;
}

.login-qr-fake i:nth-child(3) {
  right: 26px;
  bottom: 30px;
}

.login-scan-panel p {
  margin: 18px 0 24px;
  color: #777b83;
  font-size: 18px;
}

.login-scan-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  width: min(320px, 100%);
  margin: 2px 0 24px;
  color: #b2b5bb;
  font-size: 18px;
}

.login-scan-divider::before,
.login-scan-divider::after {
  content: "";
  height: 1px;
  background: #eceef2;
}

.login-disabled-scan {
  min-width: 190px;
  min-height: 54px;
  border-radius: 12px;
  color: #a2a6ad;
  background: #fff;
}

.login-campaign-foot {
  display: grid;
  place-items: center;
  padding: 0 24px;
  color: #777b83;
  background: #f8f8f9;
  font-size: 17px;
  text-align: center;
}

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

@media (max-width: 920px) {
  #authModal {
    padding: 12px;
  }

  #authModal .login-campaign-dialog {
    grid-template-rows: 136px minmax(0, auto) auto;
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    border-radius: 22px;
  }

  .login-campaign-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    font-size: 34px;
  }

  .login-hero-pill {
    top: 30px;
    min-width: auto;
    width: calc(100% - 112px);
    padding: 11px 14px;
    font-size: 18px;
    line-height: 1.12;
  }

  .login-paper-plane {
    right: 58px;
    top: 82px;
    width: 44px;
    height: 44px;
  }

  .login-paper-plane svg {
    width: 24px;
    height: 24px;
  }

  .login-free-stamp {
    left: 20px;
    top: 24px;
    font-size: 19px;
  }

  .login-hero-ribbon {
    left: 28px;
    top: 90px;
    padding: 8px 20px;
    font-size: 15px;
  }

  .login-hero-dashed,
  .login-campaign-hero::after {
    display: none;
  }

  .login-campaign-body {
    grid-template-columns: 1fr;
  }

  .login-form-panel,
  .login-scan-panel {
    padding: 26px 22px;
  }

  .login-form-panel {
    border-right: 0;
    border-bottom: 1px solid #eef0f4;
  }

  .login-form-panel h2,
  .login-scan-panel h3 {
    margin-bottom: 18px;
    font-size: 24px;
  }

  .login-form-panel #authIntro {
    margin: -8px 0 22px;
  }

  .login-form-panel input {
    min-height: 58px;
    font-size: 18px;
  }

  .login-form-panel .auth-actions {
    grid-template-columns: 1fr;
  }

  .login-form-panel #loginBtn,
  .login-form-panel #registerBtn {
    min-height: 58px;
    font-size: 19px;
  }

  .login-qr-card {
    width: 148px;
    height: 148px;
    margin-top: 6px;
  }

  .login-qr-fake {
    width: 116px;
    height: 116px;
  }

  .login-scan-panel p,
  .login-campaign-foot {
    font-size: 14px;
  }
}

/* Fix template cards being clipped in the default desktop studio view. */
@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .prompt-card {
    grid-template-rows: 92px auto auto auto;
    height: auto;
    min-height: 284px;
    overflow: hidden;
  }

  body[data-panel="studio"]:not(.history-opened) .prompt-card p {
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"]:not(.history-opened) .prompt-card small {
    display: block;
    margin: auto 14px 16px;
    overflow: visible;
    color: #938d80;
    line-height: 1.45;
    text-overflow: clip;
    white-space: normal;
  }
}

/* Keep generated results clear of the floating composer after images render. */
@media (min-width: 1181px) {
  body[data-panel="studio"] .workspace-content,
  body[data-panel="studio"].history-opened .workspace-content {
    padding-bottom: var(--composer-safe-space);
  }

  body[data-panel="studio"] .result-thread.is-visible {
    margin-bottom: 28px;
  }

  .preview.has-result {
    align-items: start;
    min-height: clamp(420px, calc(100vh - var(--composer-safe-space) - 130px), 760px);
  }

  .preview.has-result .single-result,
  .preview.has-result .multi-result {
    min-height: clamp(300px, calc(100vh - var(--composer-safe-space) - 190px), 560px);
  }

  .preview.has-result .single-result img,
  .preview.has-result .multi-result img {
    max-height: min(76vh, calc(100vh - var(--composer-safe-space) - 150px), 820px);
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"] .workspace-content {
    padding-bottom: 24px;
  }

  .preview.has-result .single-result img,
  .preview.has-result .multi-result img {
    max-height: 70vh;
  }
}

/* Publish modal must keep its submit actions visible on every viewport. */
.auth-dialog.community-publish-dialog {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  overflow: hidden;
}

.community-publish-dialog .community-publish-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.community-publish-dialog .community-publish-actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #ece8dd;
  background: #fffdf8;
}

@media (max-width: 760px) {
  .auth-dialog.community-publish-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    padding: 18px 16px 14px;
  }

  .community-publish-dialog .community-publish-preview {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 10px;
  }
}

/* 2026-06-08 stable creator workspace final override. */
body[data-panel="studio"],
body[data-panel="studio"].theme-dark {
  --studio-bg: #edf3f8;
  --studio-panel: #ffffff;
  --studio-panel-soft: #f7fafc;
  --studio-soft: #eef4f7;
  --studio-border: #d6e1e8;
  --studio-border-strong: #b7c8d3;
  --studio-text: #111827;
  --studio-muted: #667085;
  --studio-faint: #98a2b3;
  --studio-black: #101828;
  --studio-green: #137a5a;
  --studio-blue: #126d87;
  --studio-accent-strong: #101828;
  --studio-accent-foreground: #ffffff;
  --composer-safe-space: 300px;
  color: var(--studio-text);
  background:
    linear-gradient(90deg, rgba(16, 24, 40, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 24, 40, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

body[data-panel="studio"]::before,
body[data-panel="studio"] .prompt-cover::before {
  content: none !important;
}

body[data-panel="studio"] .studio-shell {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 10px;
  padding: 10px;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace,
body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread,
body[data-panel="studio"] .composer-card {
  border: 1px solid rgba(119, 138, 153, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.07);
  backdrop-filter: blur(14px);
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace {
  border-radius: 16px;
}

body[data-panel="studio"] .studio-rail {
  padding: 10px;
}

body[data-panel="studio"] .rail-top {
  gap: 7px;
}

body[data-panel="studio"] .rail-logo,
body[data-panel="studio"] .rail-collapse {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #ffffff;
}

body[data-panel="studio"] .rail-logo img {
  width: 25px;
  height: 25px;
}

body[data-panel="studio"] .rail-brand {
  padding: 6px;
}

body[data-panel="studio"] .rail-brand strong {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

body[data-panel="studio"] .rail-brand span,
body[data-panel="studio"] .rail-copy small {
  color: #758195;
}

body[data-panel="studio"] .rail-nav {
  gap: 5px;
  margin-top: 4px;
}

body[data-panel="studio"] .rail-action {
  min-height: 48px;
  padding: 8px;
  border-radius: 12px;
  color: #344054;
}

body[data-panel="studio"] .rail-action:hover {
  transform: translateY(-1px);
  background: #f4f7fa;
}

body[data-panel="studio"] .rail-action.rail-active,
body[data-panel="studio"] .rail-action.active {
  color: #ffffff;
  background: #111827;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.17);
}

body[data-panel="studio"] .rail-action.rail-active .rail-icon,
body[data-panel="studio"] .rail-action.active .rail-icon {
  color: #111827;
  background: #d8f5ef;
}

body[data-panel="studio"] .rail-action.rail-active .rail-copy small,
body[data-panel="studio"] .rail-action.active .rail-copy small {
  color: rgba(255, 255, 255, 0.68);
}

body[data-panel="studio"] .rail-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #667085;
  background: #eef3f7;
}

body[data-panel="studio"] .rail-wallet,
body[data-panel="studio"] .rail-account,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] .account-pill,
body[data-panel="studio"] .collapse-history-button,
body[data-panel="studio"] .recharge-header-button,
body[data-panel="studio"] .history-trash,
body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button {
  border-color: rgba(119, 138, 153, 0.24);
  color: #344054;
  background: #ffffff;
  box-shadow: none;
}

body[data-panel="studio"] .workspace {
  position: relative;
  overflow: hidden;
}

body[data-panel="studio"] .workspace::before {
  content: none;
}

body[data-panel="studio"] .workspace-header {
  min-height: 56px;
  padding: 9px 14px;
  border-bottom: 1px solid #dde7ee;
  background: rgba(255, 255, 255, 0.82);
}

body[data-panel="studio"] .workspace-title {
  gap: 8px;
  min-width: 0;
}

body[data-panel="studio"] .workspace-title h1 {
  color: #111827;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.15;
}

body[data-panel="studio"] .workspace-badge {
  min-height: 22px;
  padding: 4px 8px;
  border: 1px solid #c6edf4;
  color: #126d87;
  background: #e9fbff;
  font-size: 11px;
}

body[data-panel="studio"] .workspace-badge.wallet,
body[data-panel="studio"] .price-chip {
  border-color: #c6ead7;
  color: #137a5a;
  background: #ecfdf4;
}

body[data-panel="studio"] .workspace-account {
  gap: 7px;
}

body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] .account-pill,
body[data-panel="studio"] .collapse-history-button,
body[data-panel="studio"] .recharge-header-button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

body[data-panel="studio"] .workspace-content {
  display: grid;
  grid-template-columns: minmax(300px, 0.62fr) minmax(520px, 1.38fr);
  align-items: stretch;
  gap: 12px;
  height: calc(100vh - 78px);
  min-height: 0;
  padding: 12px 14px min(var(--composer-safe-space, 300px), 300px);
  overflow-y: auto;
  background: #f7fafc;
  scrollbar-gutter: stable;
}

body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread {
  min-width: 0;
  margin: 0;
  border-radius: 12px;
  box-shadow: none;
}

body[data-panel="studio"] .intro-panel {
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 14px;
  overflow: hidden;
}

body[data-panel="studio"] .spark-icon {
  display: none;
}

body[data-panel="studio"] .intro-panel::before {
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #126d87;
  background: #e9fbff;
  font-size: 11px;
  font-weight: 850;
  content: "Prompt Deck";
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 16ch;
  margin: 0 0 12px;
  color: #111827;
  font-size: 23px;
  font-weight: 880;
  line-height: 1.16;
  letter-spacing: 0;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body[data-panel="studio"] .prompt-tools,
body[data-panel="studio"].history-opened .prompt-tools,
body[data-panel="studio"]:not(.history-opened) .prompt-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

body[data-panel="studio"] .prompt-card,
body[data-panel="studio"].history-opened .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 4px 9px;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 118px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  color: #111827;
  background: #ffffff;
  box-shadow: none;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body[data-panel="studio"] .prompt-card:hover {
  transform: translateY(-2px) !important;
  border-color: #9fdce4;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
}

body[data-panel="studio"] .prompt-card::after {
  content: none;
}

body[data-panel="studio"] .prompt-cover,
body[data-panel="studio"].history-opened .prompt-cover,
body[data-panel="studio"]:not(.history-opened) .prompt-cover {
  grid-row: 1 / span 3;
  width: 68px;
  height: 100%;
  min-height: 96px;
  border: 0;
  border-radius: 8px;
}

body[data-panel="studio"] .prompt-card span,
body[data-panel="studio"].history-opened .prompt-card span {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 3px 7px;
  border-radius: 999px;
  color: #126d87;
  background: #e9fbff;
  font-size: 10px;
  line-height: 1.2;
}

body[data-panel="studio"] .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card strong {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 820;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card p {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body[data-panel="studio"] .prompt-card small,
body[data-panel="studio"].history-opened .prompt-card small {
  display: none;
}

body[data-panel="studio"] .result-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: none;
  padding: 14px;
}

body[data-panel="studio"] .result-thread.is-visible {
  margin-bottom: 0;
}

body[data-panel="studio"] .thread-head {
  min-height: 32px;
  margin-bottom: 10px;
}

body[data-panel="studio"] .thread-head h2 {
  color: #111827;
  font-size: 17px;
  font-weight: 850;
}

body[data-panel="studio"] #previewMeta {
  min-height: 25px;
  padding: 5px 9px;
  color: #126d87;
  background: #e9fbff;
  font-size: 11px;
}

body[data-panel="studio"] .preview,
body[data-panel="studio"].history-opened .preview {
  min-height: clamp(380px, calc(100vh - var(--composer-safe-space, 300px) - 130px), 620px);
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  background:
    linear-gradient(rgba(18, 109, 135, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 109, 135, 0.05) 1px, transparent 1px),
    #f8fbfd;
  background-size: 30px 30px;
}

body[data-panel="studio"] .preview-empty {
  padding: 18px;
}

body[data-panel="studio"] .preview-empty img {
  width: min(360px, 70%);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.11);
}

body[data-panel="studio"] .preview-empty h3 {
  color: #111827;
  font-size: 18px;
}

body[data-panel="studio"] .preview-empty p,
body[data-panel="studio"] .preview-footer {
  color: #667085;
}

body[data-panel="studio"] .composer-card {
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 20;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 30px rgba(16, 24, 40, 0.1);
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body[data-panel="studio"] .composer-card:focus-within {
  transform: none !important;
  border-color: #a9d7df;
  box-shadow: 0 -12px 34px rgba(16, 24, 40, 0.12);
}

body[data-panel="studio"] .composer-resize {
  width: 78px;
  height: 14px;
  border-color: #dbe7ef;
  background: #ffffff;
  animation: none !important;
}

body[data-panel="studio"] .composer-resize::before {
  width: 30px;
  height: 3px;
  margin-top: 5px;
  background: #98a2b3;
}

body[data-panel="studio"] .composer-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "mode selects";
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 7px;
  padding-top: 8px;
}

body[data-panel="studio"] .toolbar-bottom-row {
  grid-area: mode;
}

body[data-panel="studio"] .toolbar-top-row {
  grid-area: selects;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-panel="studio"] .toolbar-top-row::-webkit-scrollbar {
  display: none;
}

body[data-panel="studio"] .mode-tabs,
body[data-panel="studio"] .layout-tabs {
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid #e0e8ee;
  border-radius: 999px;
  background: #eef4f7;
}

body[data-panel="studio"] .mode-tabs button,
body[data-panel="studio"] .layout-tabs button {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #475467;
  font-size: 13px;
}

body[data-panel="studio"] .mode-tabs button.active,
body[data-panel="studio"] .layout-tabs button.active,
body[data-panel="studio"] .generate-button,
body[data-panel="studio"] .primary-button,
body[data-panel="studio"] .new-chat-button {
  color: #ffffff;
  background: #111827;
  box-shadow: none;
}

body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .price-chip,
body[data-panel="studio"] .billing-chip {
  min-height: 36px;
  border-radius: 999px;
  font-size: 12px;
}

body[data-panel="studio"] .select-pill {
  min-width: 104px;
  padding: 7px 11px;
}

body[data-panel="studio"] .size-select,
body[data-panel="studio"] .select-pill[data-select="size"] {
  min-width: 206px;
}

body[data-panel="studio"] .select-pill[data-select="quality"] {
  min-width: 112px;
}

body[data-panel="studio"] .select-pill[data-select="format"] {
  min-width: 112px;
}

body[data-panel="studio"] .count-select {
  min-width: 86px;
}

body[data-panel="studio"] .help-pill {
  width: 36px;
  min-width: 36px;
}

body[data-panel="studio"] #prompt,
body[data-panel="studio"] textarea {
  height: var(--composer-textarea-height, 128px);
  min-height: 104px;
  max-height: 230px;
  padding: 10px 12px;
  border: 1px solid #dbe7ef;
  border-radius: 10px;
  color: #111827;
  background: #f8fbfd;
  font-size: 14px;
  line-height: 1.65;
}

body[data-panel="studio"] #prompt::placeholder {
  color: #98a2b3;
}

body[data-panel="studio"] .composer-footer {
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

body[data-panel="studio"] .composer-left-tools {
  gap: 7px;
  min-width: 0;
}

body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button {
  min-height: 31px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
}

body[data-panel="studio"] .clarity-mode-button.active {
  border-color: #111827;
  color: #ffffff;
  background: #111827;
}

body[data-panel="studio"] .status {
  color: #667085;
  font-size: 12px;
}

body[data-panel="studio"] .toolbar-billing-group {
  flex: 0 0 auto;
  gap: 7px;
}

body[data-panel="studio"] .billing-chip {
  color: #475467;
  background: #eef4f7;
}

body[data-panel="studio"] .generate-button {
  min-width: 118px;
  min-height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827 0%, #126d87 100%);
}

body[data-panel="studio"] .upload-box,
body[data-panel="studio"] .reference-preview,
body[data-panel="studio"] .storyboard-draft {
  border-color: #dbe7ef;
  border-radius: 10px;
  background: #f8fbfd;
}

body[data-panel="studio"] .history-panel {
  padding: 12px;
}

body[data-panel="studio"] .history-panel-head h2 {
  color: #111827;
  font-size: 20px;
  font-weight: 850;
}

body[data-panel="studio"] .history-actions {
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 7px;
}

body[data-panel="studio"] .new-chat-button {
  min-height: 38px;
  border-radius: 12px;
}

body[data-panel="studio"] .history-trash {
  min-height: 38px;
  border-radius: 12px;
}

body[data-panel="studio"] .history-filters input {
  border-color: #dbe7ef;
  background: #ffffff;
}

body[data-panel="studio"] .history-filter-row button {
  border-radius: 999px;
}

body[data-panel="studio"] .history-filter-row button.active {
  color: #ffffff;
  background: #111827;
}

body[data-panel="studio"] .history-item {
  border-color: #dbe7ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

body[data-panel="studio"].history-opened .workspace-content {
  grid-template-columns: minmax(210px, 0.45fr) minmax(500px, 1.55fr);
}

body[data-panel="studio"].history-opened .intro-panel {
  padding: 12px;
}

body[data-panel="studio"].history-opened .intro-panel h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

body[data-panel="studio"].history-opened .prompt-tools {
  grid-template-columns: 1fr;
  gap: 7px;
}

body[data-panel="studio"].history-opened .prompt-card {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 68px;
  padding: 7px;
}

body[data-panel="studio"].history-opened .prompt-cover {
  grid-row: 1 / span 2;
  width: 48px;
  min-height: 52px;
}

body[data-panel="studio"].history-opened .prompt-card span {
  display: none;
}

body[data-panel="studio"].history-opened .prompt-card p {
  -webkit-line-clamp: 1;
}

body[data-panel="studio"].history-opened .preview-empty p {
  display: none;
}

@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .studio-shell,
  body[data-panel="studio"].history-collapsed .studio-shell {
    grid-template-columns: 214px minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed:not(.history-opened) .studio-shell,
  body[data-panel="studio"].rail-collapsed.history-collapsed .studio-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body[data-panel="studio"]:not(.history-opened) .history-panel,
  body[data-panel="studio"].history-collapsed .history-panel {
    display: none;
  }

  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 214px clamp(286px, 21vw, 330px) minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed.history-opened .studio-shell {
    grid-template-columns: 76px clamp(286px, 21vw, 330px) minmax(0, 1fr);
  }
}

@media (max-width: 1500px) and (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .workspace-content {
    grid-template-columns: minmax(280px, 390px) minmax(500px, 1fr);
  }
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"].history-opened .intro-panel {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body[data-panel="studio"].history-opened .intro-panel::before {
    grid-column: 1;
  }

  body[data-panel="studio"].history-opened .intro-panel h2 {
    grid-column: 1;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .composer-toolbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mode"
      "selects";
  }

  body[data-panel="studio"] .toolbar-top-row {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"],
  body[data-panel="studio"].theme-dark {
    min-height: 100dvh;
    overflow: auto;
    background: #edf3f8;
  }

  body[data-panel="studio"] .studio-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 8px;
  }

  body[data-panel="studio"] .studio-rail {
    position: sticky;
    top: 8px;
    z-index: 25;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .workspace {
    min-height: 0;
    overflow: visible;
  }

  body[data-panel="studio"] .workspace-header {
    position: sticky;
    top: 72px;
    z-index: 18;
    border-radius: 14px 14px 0 0;
  }

  body[data-panel="studio"] .workspace-content {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    padding: 10px;
    overflow: visible;
  }

  body[data-panel="studio"] .composer-card {
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 18px 12px 12px;
    border-radius: 12px;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 8px;
  }

  body[data-panel="studio"] .toolbar-bottom-row,
  body[data-panel="studio"] .toolbar-top-row {
    grid-area: auto;
  }

  body[data-panel="studio"] .toolbar-top-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  body[data-panel="studio"] .size-select,
  body[data-panel="studio"] .layout-tabs,
  body[data-panel="studio"] .toolbar-billing-group,
  body[data-panel="studio"] .generate-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .workspace-header {
    top: 66px;
    display: grid;
    gap: 8px;
  }

  body[data-panel="studio"] .workspace-title h1 {
    font-size: 18px;
  }

  body[data-panel="studio"] .workspace-account {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .ready-pill,
  body[data-panel="studio"] .account-pill,
  body[data-panel="studio"] .collapse-history-button,
  body[data-panel="studio"] .recharge-header-button {
    justify-content: center;
    width: 100%;
  }

  body[data-panel="studio"] .intro-panel,
  body[data-panel="studio"] .result-thread {
    padding: 12px;
  }

  body[data-panel="studio"] .intro-panel h2 {
    max-width: none;
    font-size: 20px;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 94px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    grid-row: 1 / span 3;
    width: 64px;
    min-height: 78px;
  }

  body[data-panel="studio"].history-opened .prompt-card span {
    display: inline-flex;
  }

  body[data-panel="studio"] .prompt-card strong,
  body[data-panel="studio"].history-opened .prompt-card strong {
    white-space: normal;
  }

  body[data-panel="studio"] .preview,
  body[data-panel="studio"].history-opened .preview {
    min-height: 320px;
  }

  body[data-panel="studio"] #prompt,
  body[data-panel="studio"] textarea {
    min-height: 118px;
  }
}

body[data-panel="admin"] .studio-shell {
  max-width: none;
  min-width: 0;
  gap: 10px;
  padding: 10px;
}

body[data-panel="admin"] .workspace-header {
  min-height: 56px;
  padding: 9px 14px;
}

body[data-panel="admin"] #adminConsolePanel {
  margin: 10px;
}

body[data-panel="admin"] .admin-console-panel {
  min-height: calc(100vh - 88px);
  border-radius: 16px;
}

body[data-panel="admin"] .admin-console-main {
  gap: 12px;
  padding: 12px;
}

body[data-panel="admin"] .admin-console-topbar {
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 14px;
}

body[data-panel="admin"] .admin-console-topbar-copy h3 {
  font-size: 22px;
  line-height: 1.15;
}

body[data-panel="admin"] .admin-overview-grid {
  gap: 10px;
}

body[data-panel="admin"] .admin-surface,
body[data-panel="admin"] .admin-list-surface,
body[data-panel="admin"] .admin-overview-grid article {
  border-radius: 14px;
}

/* 2026-06-08 desktop QA corrections: keep the studio balanced with history open. */
@media (min-width: 1181px) {
  body[data-panel="studio"] .workspace-content {
    grid-template-columns: minmax(340px, 380px) minmax(560px, 1fr);
    padding-bottom: var(--composer-safe-space, 320px);
  }

  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: minmax(206px, 0.38fr) minmax(520px, 1.62fr);
  }

  body[data-panel="studio"] .intro-panel {
    align-self: start;
  }

  body[data-panel="studio"]:not(.history-opened) .intro-panel h2 {
    margin-bottom: 10px;
    font-size: 22px;
    line-height: 1.14;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto !important;
    align-content: center;
    height: 86px !important;
    min-height: 86px;
    max-height: 86px;
    padding: 7px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover {
    width: 56px;
    height: 70px !important;
    min-height: 70px;
  }

  body[data-panel="studio"] .prompt-card span,
  body[data-panel="studio"]:not(.history-opened) .prompt-card span {
    display: none;
  }

  body[data-panel="studio"]:not(.history-opened) .prompt-card small {
    display: none;
  }

  body[data-panel="studio"] .prompt-card p,
  body[data-panel="studio"]:not(.history-opened) .prompt-card p {
    -webkit-line-clamp: 1;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 64px;
    padding: 7px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    width: 46px;
    min-height: 50px;
  }

  body[data-panel="studio"].history-opened .prompt-card strong {
    font-size: 12px;
  }

  body[data-panel="studio"].history-opened .prompt-card p {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  body[data-panel="studio"] .result-thread {
    align-self: start;
  }

  body[data-panel="studio"] .preview,
  body[data-panel="studio"].history-opened .preview {
    min-height: clamp(320px, calc(100vh - var(--composer-safe-space, 320px) - 235px), 500px);
  }

  body[data-panel="studio"].history-opened .preview {
    min-height: clamp(300px, calc(100vh - var(--composer-safe-space, 320px) - 255px), 460px);
  }

  body[data-panel="studio"] .composer-toolbar {
    align-items: start;
  }

  body[data-panel="studio"] .toolbar-top-row {
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    height: auto !important;
    max-height: none;
    min-height: 94px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    grid-row: 1 / span 3;
    width: 66px;
    height: 78px !important;
    min-height: 78px;
  }

  body[data-panel="studio"] .prompt-card span,
  body[data-panel="studio"]:not(.history-opened) .prompt-card span,
  body[data-panel="studio"].history-opened .prompt-card span {
    display: none !important;
  }

  body[data-panel="studio"] .prompt-card p,
  body[data-panel="studio"]:not(.history-opened) .prompt-card p,
  body[data-panel="studio"].history-opened .prompt-card p {
    -webkit-line-clamp: 2;
  }
}

/* 2026-06-11 React Bits inspired creator workspace final layer. */
body[data-panel="studio"],
body[data-panel="studio"].theme-dark {
  --studio-bg: #eef4f6;
  --studio-panel: rgba(255, 255, 255, 0.9);
  --studio-panel-strong: rgba(255, 255, 255, 0.96);
  --studio-line: rgba(101, 119, 134, 0.22);
  --studio-line-strong: rgba(58, 86, 106, 0.34);
  --studio-ink: #101828;
  --studio-muted: #667085;
  --studio-cyan: #0e7490;
  --studio-green: #0f8a64;
  --studio-amber: #b7791f;
  --composer-safe-space: 330px;
  min-width: 0;
  color: var(--studio-ink);
  background:
    linear-gradient(125deg, rgba(14, 116, 144, 0.10) 0 18%, transparent 18% 64%, rgba(183, 121, 31, 0.09) 64% 100%),
    linear-gradient(90deg, rgba(16, 24, 40, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(16, 24, 40, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #fbfdff 0%, #eef4f6 54%, #e8f1f2 100%);
  background-size: auto, 36px 36px, 36px 36px, auto;
}

body[data-panel="studio"]::before {
  content: "" !important;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(104deg, transparent 0 32%, rgba(255, 255, 255, 0.54) 32% 33%, transparent 33% 100%),
    repeating-linear-gradient(100deg, rgba(14, 116, 144, 0.035) 0 1px, transparent 1px 34px);
  opacity: 0.9;
  animation: studioBeamDrift 20s ease-in-out infinite alternate;
}

body[data-panel="studio"] .studio-shell {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 10px;
  padding: 10px;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace {
  border: 1px solid var(--studio-line);
  border-radius: 18px;
  background: var(--studio-panel);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(18px);
}

body[data-panel="studio"] .workspace {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 253, 0.92)),
    var(--studio-panel);
}

body[data-panel="studio"] .workspace::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 170px;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(14, 116, 144, 0.12), transparent 36%, rgba(183, 121, 31, 0.10));
  opacity: 0.62;
}

body[data-panel="studio"] .workspace-header {
  position: relative;
  z-index: 2;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(101, 119, 134, 0.18);
  background: rgba(255, 255, 255, 0.76);
}

body[data-panel="studio"] .workspace-title h1 {
  color: transparent;
  background: linear-gradient(92deg, #101828 0%, #0e7490 56%, #9a670f 100%);
  background-clip: text;
  font-size: 21px;
  font-weight: 880;
  letter-spacing: 0;
}

body[data-panel="studio"] .workspace-badge,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] #previewMeta {
  border: 1px solid rgba(14, 116, 144, 0.18);
  color: #0e6176;
  background: linear-gradient(135deg, rgba(236, 253, 255, 0.96), rgba(255, 255, 255, 0.86));
}

body[data-panel="studio"] .workspace-badge.wallet,
body[data-panel="studio"] .price-chip {
  border-color: rgba(15, 138, 100, 0.22);
  color: #0f7658;
  background: linear-gradient(135deg, rgba(236, 253, 244, 0.96), rgba(255, 255, 255, 0.86));
}

body[data-panel="studio"] .workspace-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(330px, 380px) minmax(560px, 1fr);
  gap: 12px;
  height: calc(100vh - 78px);
  min-height: 0;
  padding: 12px 14px var(--composer-safe-space, 330px);
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  scrollbar-gutter: stable;
}

body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread,
body[data-panel="studio"] .composer-card {
  border: 1px solid rgba(101, 119, 134, 0.20);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 252, 0.88)),
    rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread {
  min-width: 0;
  margin: 0;
  border-radius: 14px;
}

body[data-panel="studio"] .intro-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
  max-width: none;
  padding: 14px;
  overflow: hidden;
}

body[data-panel="studio"] .intro-panel::before {
  width: fit-content;
  margin-bottom: 9px;
  padding: 5px 9px;
  border: 1px solid rgba(14, 116, 144, 0.16);
  border-radius: 999px;
  color: #0e6176;
  background: rgba(236, 253, 255, 0.8);
  font-size: 11px;
  font-weight: 880;
  content: "Prompt Deck";
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 17ch;
  margin: 0 0 12px;
  color: #101828;
  font-size: 23px;
  font-weight: 880;
  line-height: 1.14;
  letter-spacing: 0;
  opacity: 0;
  filter: blur(7px);
  transform: translateY(10px);
  animation: studioTextReveal 580ms cubic-bezier(.2, .8, .2, 1) 80ms forwards !important;
}

body[data-panel="studio"] .prompt-tools,
body[data-panel="studio"]:not(.history-opened) .prompt-tools,
body[data-panel="studio"].history-opened .prompt-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

body[data-panel="studio"] .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card,
body[data-panel="studio"].history-opened .prompt-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px 10px;
  width: auto;
  min-width: 0;
  height: 90px !important;
  min-height: 90px;
  max-height: 90px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(101, 119, 134, 0.20);
  border-radius: 12px;
  color: #101828;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(10px);
  animation: studioCardRise 520ms cubic-bezier(.2, .8, .2, 1) forwards !important;
}

body[data-panel="studio"] .prompt-card:nth-child(1) { animation-delay: 110ms !important; }
body[data-panel="studio"] .prompt-card:nth-child(2) { animation-delay: 170ms !important; }
body[data-panel="studio"] .prompt-card:nth-child(3) { animation-delay: 230ms !important; }
body[data-panel="studio"] .prompt-card:nth-child(4) { animation-delay: 290ms !important; }

body[data-panel="studio"] .prompt-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(14, 116, 144, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(244, 250, 251, 0.92));
  opacity: 0;
  transition: opacity 180ms ease;
}

body[data-panel="studio"] .prompt-card:hover,
body[data-panel="studio"] .prompt-card:focus-visible {
  border-color: rgba(14, 116, 144, 0.42);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.11);
  transform: translateY(-2px) !important;
}

body[data-panel="studio"] .prompt-card:hover::before,
body[data-panel="studio"] .prompt-card:focus-visible::before {
  opacity: 1;
}

body[data-panel="studio"] .prompt-cover,
body[data-panel="studio"]:not(.history-opened) .prompt-cover,
body[data-panel="studio"].history-opened .prompt-cover {
  position: relative;
  grid-row: 1 / span 2;
  width: 62px;
  height: 72px !important;
  min-height: 72px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

body[data-panel="studio"] .prompt-cover::before {
  content: "" !important;
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px 999px 14px 14px;
  background: rgba(255, 255, 255, 0.18);
}

body[data-panel="studio"] .prompt-cover::after {
  content: "";
  position: absolute;
  inset: auto 8px 8px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

body[data-panel="studio"] .prompt-purple .prompt-cover {
  background: linear-gradient(145deg, #2f3447, #8d4b70 52%, #d8a542);
}

body[data-panel="studio"] .prompt-blue .prompt-cover {
  background: linear-gradient(145deg, #f8fbfd, #3e8cb2 46%, #1d4e89);
}

body[data-panel="studio"] .prompt-rose .prompt-cover {
  background: linear-gradient(145deg, #7a1f2f, #d56b45 48%, #f0c05a);
}

body[data-panel="studio"] .prompt-cyan .prompt-cover {
  background: linear-gradient(145deg, #0f5968, #33a7a1 45%, #f59e0b);
}

body[data-panel="studio"] .prompt-card span,
body[data-panel="studio"]:not(.history-opened) .prompt-card span,
body[data-panel="studio"].history-opened .prompt-card span,
body[data-panel="studio"] .prompt-card small,
body[data-panel="studio"]:not(.history-opened) .prompt-card small,
body[data-panel="studio"].history-opened .prompt-card small {
  display: none !important;
}

body[data-panel="studio"] .prompt-card strong,
body[data-panel="studio"]:not(.history-opened) .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card strong {
  margin: 0;
  overflow: hidden;
  color: #101828;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"]:not(.history-opened) .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card p {
  display: -webkit-box;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-panel="studio"] .result-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-self: start;
  max-width: none;
  padding: 14px;
}

body[data-panel="studio"] .thread-head {
  min-height: 34px;
  margin-bottom: 10px;
}

body[data-panel="studio"] .thread-head h2 {
  color: #101828;
  font-size: 17px;
  font-weight: 860;
}

body[data-panel="studio"] #previewMeta,
body[data-panel="studio"] .ready-pill {
  position: relative;
  overflow: hidden;
}

body[data-panel="studio"] #previewMeta::after,
body[data-panel="studio"] .ready-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 30%, rgba(255, 255, 255, 0.82) 46%, transparent 62% 100%);
  transform: translateX(-120%);
  animation: studioShine 4.6s ease-in-out infinite;
}

body[data-panel="studio"] .preview,
body[data-panel="studio"].history-opened .preview {
  min-height: clamp(330px, calc(100vh - var(--composer-safe-space, 330px) - 220px), 540px);
  overflow: hidden;
  border: 1px solid rgba(101, 119, 134, 0.22);
  border-radius: 13px;
  background:
    linear-gradient(rgba(14, 116, 144, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 116, 144, 0.045) 1px, transparent 1px),
    linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(240, 248, 250, 0.88));
  background-size: 32px 32px, 32px 32px, auto;
}

body[data-panel="studio"] .preview.loading::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(14, 116, 144, 0.18) 49%, rgba(255, 255, 255, 0.75) 50%, transparent 58%);
  animation: studioScan 1.8s linear infinite;
}

body[data-panel="studio"] .preview-empty {
  gap: 12px;
  padding: 20px;
}

body[data-panel="studio"] .preview-empty img {
  display: none;
}

body[data-panel="studio"] .preview-empty::before {
  content: "";
  width: min(340px, 66%);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(101, 119, 134, 0.20);
  border-radius: 14px;
  background:
    radial-gradient(circle at 32% 34%, rgba(14, 116, 144, 0.30), transparent 16%),
    radial-gradient(circle at 70% 62%, rgba(183, 121, 31, 0.22), transparent 18%),
    linear-gradient(110deg, rgba(255, 255, 255, 0.86), rgba(235, 245, 247, 0.72)),
    repeating-linear-gradient(90deg, rgba(16, 24, 40, 0.055) 0 1px, transparent 1px 22px);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.13);
  animation: previewTileFloat 5.8s ease-in-out infinite alternate;
}

body[data-panel="studio"] .preview-empty h3 {
  color: #101828;
  font-size: 18px;
  font-weight: 850;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(8px);
  animation: studioTextReveal 560ms cubic-bezier(.2, .8, .2, 1) 180ms forwards;
}

body[data-panel="studio"] .preview-empty p,
body[data-panel="studio"] .preview-footer {
  color: #667085;
}

body[data-panel="studio"] .single-result,
body[data-panel="studio"] .multi-result {
  min-height: clamp(300px, calc(100vh - var(--composer-safe-space, 330px) - 230px), 560px);
}

body[data-panel="studio"] .single-result img,
body[data-panel="studio"] .multi-result img {
  border-radius: 13px;
  background: #f8fbfd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  object-fit: contain;
}

body[data-panel="studio"] .result-actions a,
body[data-panel="studio"] .result-actions button,
body[data-panel="studio"] .result-publish-prompt {
  border-color: rgba(101, 119, 134, 0.22);
}

body[data-panel="studio"] .composer-card {
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 24;
  padding: 11px 12px 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 252, 0.94)),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 -14px 36px rgba(15, 23, 42, 0.12);
  transform: translateY(0);
  animation: studioComposerRise 540ms cubic-bezier(.2, .8, .2, 1) 220ms both !important;
}

body[data-panel="studio"] .composer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(100deg, rgba(14, 116, 144, 0.12), transparent 38%, rgba(183, 121, 31, 0.10));
  opacity: 0.7;
}

body[data-panel="studio"] .composer-card > * {
  position: relative;
  z-index: 1;
}

body[data-panel="studio"] .composer-card:focus-within {
  border-color: rgba(14, 116, 144, 0.38);
  box-shadow: 0 -16px 42px rgba(15, 23, 42, 0.15);
  transform: none !important;
}

body[data-panel="studio"] .composer-resize {
  width: 86px;
  height: 15px;
  border-color: rgba(101, 119, 134, 0.24);
  background: rgba(255, 255, 255, 0.96);
}

body[data-panel="studio"] .composer-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "mode selects";
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding-top: 8px;
}

body[data-panel="studio"] .toolbar-bottom-row {
  grid-area: mode;
}

body[data-panel="studio"] .toolbar-top-row {
  grid-area: selects;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  overflow: visible;
}

body[data-panel="studio"] .mode-tabs,
body[data-panel="studio"] .layout-tabs {
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(101, 119, 134, 0.18);
  border-radius: 999px;
  background: rgba(235, 242, 245, 0.92);
}

body[data-panel="studio"] .mode-tabs button,
body[data-panel="studio"] .layout-tabs button {
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #475467;
  font-size: 13px;
}

body[data-panel="studio"] .mode-tabs button.active,
body[data-panel="studio"] .layout-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #101828, #0e7490);
  box-shadow: 0 8px 18px rgba(14, 116, 144, 0.18);
}

body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button,
body[data-panel="studio"] .billing-chip,
body[data-panel="studio"] .price-chip {
  border-color: rgba(101, 119, 134, 0.20);
  border-radius: 999px;
  color: #344054;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body[data-panel="studio"] .select-pill:hover,
body[data-panel="studio"] .help-pill:hover,
body[data-panel="studio"] .upload-trigger:hover,
body[data-panel="studio"] .clarity-mode-button:hover,
body[data-panel="studio"] .prompt-optimize-button:hover,
body[data-panel="studio"] .motion-neighbor {
  border-color: rgba(14, 116, 144, 0.34);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px) scale(1.015);
}

body[data-panel="studio"] .select-pill {
  min-width: 106px;
  min-height: 36px;
  padding: 7px 11px;
}

body[data-panel="studio"] .select-pill[data-select="size"] {
  min-width: 204px;
}

body[data-panel="studio"] .select-pill[data-select="quality"],
body[data-panel="studio"] .select-pill[data-select="format"] {
  min-width: 112px;
}

body[data-panel="studio"] .count-select {
  min-width: 86px;
}

body[data-panel="studio"] .help-pill {
  width: 36px;
  min-width: 36px;
}

body[data-panel="studio"] .pill-menu {
  z-index: 80;
  border-color: rgba(101, 119, 134, 0.24);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

body[data-panel="studio"] #prompt,
body[data-panel="studio"] textarea {
  height: var(--composer-textarea-height, 128px);
  min-height: 108px;
  max-height: 240px;
  padding: 11px 12px;
  border: 1px solid rgba(101, 119, 134, 0.22);
  border-radius: 12px;
  color: #101828;
  background: rgba(248, 251, 253, 0.92);
  font-size: 14px;
  line-height: 1.62;
}

body[data-panel="studio"] #prompt:focus {
  border-color: rgba(14, 116, 144, 0.44);
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.09);
}

body[data-panel="studio"] .composer-footer {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
}

body[data-panel="studio"] .composer-left-tools {
  gap: 7px;
  min-width: 0;
}

body[data-panel="studio"] .status {
  min-width: 0;
  color: #667085;
  font-size: 12px;
}

body[data-panel="studio"] .toolbar-billing-group {
  flex: 0 0 auto;
  gap: 7px;
}

body[data-panel="studio"] .clarity-mode-button.active,
body[data-panel="studio"] .generate-button,
body[data-panel="studio"] .primary-button,
body[data-panel="studio"] .new-chat-button {
  color: #fff;
  background: linear-gradient(135deg, #101828 0%, #0e7490 68%, #b7791f 140%);
}

body[data-panel="studio"] .generate-button {
  --mx: 0px;
  --my: 0px;
  min-width: 122px;
  min-height: 42px;
  overflow: hidden;
  border-radius: 999px;
  box-shadow: 0 12px 26px rgba(14, 116, 144, 0.22);
  transform: translate(var(--mx), var(--my)) scale(var(--magnet-scale, 1));
}

body[data-panel="studio"] .generate-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 26%, rgba(255, 255, 255, 0.72) 45%, transparent 62% 100%);
  transform: translateX(-120%);
}

body[data-panel="studio"] .generate-button:hover::after,
body[data-panel="studio"] .generate-button.is-magnetized::after,
body[data-panel="studio"].generating-active .generate-button::after {
  animation: studioShine 1.3s ease;
}

body[data-panel="studio"] .upload-box,
body[data-panel="studio"] .reference-preview,
body[data-panel="studio"] .storyboard-draft {
  border-color: rgba(101, 119, 134, 0.22);
  border-radius: 12px;
  background: rgba(248, 251, 253, 0.92);
}

body[data-panel="studio"] .generation-banner {
  border-color: rgba(15, 138, 100, 0.25);
  color: #0f7658;
  background: linear-gradient(135deg, rgba(236, 253, 244, 0.96), rgba(255, 255, 255, 0.9));
}

body[data-panel="studio"] .history-panel {
  padding: 12px;
}

body[data-panel="studio"] .history-panel-head h2 {
  color: #101828;
  font-size: 20px;
  font-weight: 860;
}

body[data-panel="studio"] .history-item,
body[data-panel="studio"] .history-filters input,
body[data-panel="studio"] .history-more-actions > div {
  border-color: rgba(101, 119, 134, 0.20);
  background: rgba(255, 255, 255, 0.86);
}

body[data-panel="studio"] .history-filter-row button.active {
  color: #fff;
  background: linear-gradient(135deg, #101828, #0e7490);
}

@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.history-opened) .studio-shell,
  body[data-panel="studio"].history-collapsed .studio-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed:not(.history-opened) .studio-shell,
  body[data-panel="studio"].rail-collapsed.history-collapsed .studio-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body[data-panel="studio"]:not(.history-opened) .history-panel,
  body[data-panel="studio"].history-collapsed .history-panel {
    display: none;
  }

  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 216px clamp(286px, var(--history-width, 320px), 460px) minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed.history-opened .studio-shell {
    grid-template-columns: 76px clamp(286px, var(--history-width, 320px), 460px) minmax(0, 1fr);
  }

  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: minmax(196px, 0.36fr) minmax(500px, 1.64fr);
  }

  body[data-panel="studio"].history-opened .intro-panel {
    padding: 12px;
  }

  body[data-panel="studio"].history-opened .intro-panel h2 {
    margin-bottom: 10px;
    font-size: 18px;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 48px minmax(0, 1fr);
    height: 68px !important;
    min-height: 68px;
    max-height: 68px;
    padding: 7px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    width: 48px;
    height: 52px !important;
    min-height: 52px;
  }

  body[data-panel="studio"].history-opened .prompt-card strong {
    font-size: 12px;
  }

  body[data-panel="studio"].history-opened .prompt-card p {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 1380px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"].history-opened .intro-panel {
    display: grid;
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  body[data-panel="studio"].history-opened .intro-panel::before,
  body[data-panel="studio"].history-opened .intro-panel h2 {
    grid-column: 1;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) and (min-width: 1181px) {
  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"].history-opened .composer-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "mode"
      "selects";
  }

  body[data-panel="studio"] .toolbar-top-row,
  body[data-panel="studio"].history-opened .toolbar-top-row {
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    width: 100%;
  }

  body[data-panel="studio"] .select-pill[data-select="size"] {
    min-width: 188px;
  }

  body[data-panel="studio"] .select-pill[data-select="quality"],
  body[data-panel="studio"] .select-pill[data-select="format"] {
    min-width: 108px;
  }

  body[data-panel="studio"] .composer-card {
    padding-top: 10px;
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"],
  body[data-panel="studio"].theme-dark {
    min-height: 100dvh;
    overflow: auto;
  }

  body[data-panel="studio"] .studio-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 8px;
  }

  body[data-panel="studio"] .studio-rail {
    position: sticky;
    top: 8px;
    z-index: 32;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 16px;
  }

  body[data-panel="studio"] .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }

  body[data-panel="studio"] .workspace-header {
    order: 0;
    position: sticky;
    top: 72px;
    z-index: 26;
    border-radius: 16px 16px 0 0;
  }

  body[data-panel="studio"] .workspace-content {
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    padding: 10px;
    overflow: visible;
  }

  body[data-panel="studio"] .intro-panel h2 {
    max-width: none;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 62px minmax(0, 1fr) !important;
    height: auto !important;
    min-height: 92px;
    max-height: none;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    grid-row: 1 / span 2;
    width: 62px;
    height: 76px !important;
    min-height: 76px;
  }

  body[data-panel="studio"] .composer-card {
    position: static;
    order: 1;
    width: calc(100% - 16px);
    max-width: none;
    margin: 8px auto 0;
    padding: 18px 12px 12px;
    border-radius: 14px;
    animation-delay: 0ms !important;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 8px;
  }

  body[data-panel="studio"] .toolbar-bottom-row,
  body[data-panel="studio"] .toolbar-top-row {
    grid-area: auto;
  }

  body[data-panel="studio"] .toolbar-top-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] .select-pill[data-select="size"],
  body[data-panel="studio"] .layout-tabs,
  body[data-panel="studio"] .toolbar-billing-group,
  body[data-panel="studio"] .generate-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .workspace-header {
    top: 66px;
    display: grid;
    gap: 8px;
  }

  body[data-panel="studio"] .workspace-title h1 {
    font-size: 18px;
  }

  body[data-panel="studio"] .workspace-account {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .ready-pill,
  body[data-panel="studio"] .account-pill,
  body[data-panel="studio"] .collapse-history-button,
  body[data-panel="studio"] .recharge-header-button {
    justify-content: center;
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] .intro-panel,
  body[data-panel="studio"] .result-thread {
    padding: 12px;
  }

  body[data-panel="studio"] .intro-panel h2 {
    font-size: 20px;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    min-height: 96px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    width: 64px;
    height: 78px !important;
    min-height: 78px;
  }

  body[data-panel="studio"] .prompt-card strong,
  body[data-panel="studio"].history-opened .prompt-card strong {
    white-space: normal;
  }

  body[data-panel="studio"] .prompt-card p,
  body[data-panel="studio"]:not(.history-opened) .prompt-card p,
  body[data-panel="studio"].history-opened .prompt-card p {
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"] .preview,
  body[data-panel="studio"].history-opened .preview {
    min-height: 320px;
  }

  body[data-panel="studio"] .preview-empty img {
    width: min(280px, 76%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-panel="studio"]::before,
  body[data-panel="studio"] .intro-panel h2,
  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"] .composer-card,
  body[data-panel="studio"] .preview-empty h3,
  body[data-panel="studio"] #previewMeta::after,
  body[data-panel="studio"] .ready-pill::after,
  body[data-panel="studio"] .preview.loading::after {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@keyframes studioBeamDrift {
  from { transform: translateX(-16px); }
  to { transform: translateX(16px); }
}

@keyframes studioTextReveal {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes studioCardRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes studioComposerRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes studioShine {
  to { transform: translateX(120%); }
}

@keyframes studioScan {
  from { transform: translateX(-28%); }
  to { transform: translateX(28%); }
}

@keyframes previewTileFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}

/* 2026-06-11 narrow desktop history fix: keep panels stacked and avoid composer overlap. */
@media (max-width: 1380px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .workspace-content {
    display: flex !important;
    flex-direction: column;
    align-content: start;
    gap: 10px;
    height: auto;
    padding-bottom: 10px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body[data-panel="studio"].history-opened .intro-panel,
  body[data-panel="studio"].history-opened .result-thread {
    flex: 0 0 auto;
    width: 100%;
  }

  body[data-panel="studio"].history-opened .intro-panel {
    display: grid;
    grid-template-columns: minmax(140px, 168px) minmax(0, 1fr);
    min-height: 0;
    padding: 9px;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    display: flex !important;
    grid-column: 2;
    grid-row: 1 / span 2;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body[data-panel="studio"].history-opened .prompt-tools::-webkit-scrollbar {
    display: none;
  }

  body[data-panel="studio"].history-opened .intro-panel::before {
    margin-bottom: 6px;
    padding: 4px 8px;
  }

  body[data-panel="studio"].history-opened .intro-panel h2 {
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.13;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    flex: 0 0 152px;
    grid-template-columns: 38px minmax(0, 1fr);
    height: 58px !important;
    min-height: 58px;
    max-height: 58px;
    padding: 6px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    width: 38px;
    height: 44px !important;
    min-height: 44px;
  }

  body[data-panel="studio"].history-opened .prompt-card p {
    display: none;
  }

  body[data-panel="studio"].history-opened .prompt-card strong {
    align-self: center;
    font-size: 11.5px;
    white-space: normal;
    -webkit-line-clamp: 2;
  }

  body[data-panel="studio"].history-opened .result-thread {
    margin-top: 0;
    padding: 10px;
  }

  body[data-panel="studio"].history-opened .thread-head {
    min-height: 28px;
    margin-bottom: 8px;
  }

  body[data-panel="studio"].history-opened .preview,
  body[data-panel="studio"].history-opened .preview.has-result {
    min-height: clamp(210px, calc(100vh - var(--composer-safe-space, 330px) - 230px), 300px);
  }

  body[data-panel="studio"].history-opened .preview-empty img {
    display: none;
  }

  body[data-panel="studio"].history-opened .preview-empty::before {
    width: min(240px, 52%);
  }

  body[data-panel="studio"].history-opened .preview-empty p {
    display: none;
  }

  body[data-panel="studio"].history-opened .composer-card {
    position: static;
    width: auto;
    margin: 0 14px 10px;
    padding: 9px 10px 10px;
  }

  body[data-panel="studio"].history-opened .composer-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "mode"
      "selects";
    gap: 6px;
    margin-bottom: 6px;
  }

  body[data-panel="studio"].history-opened .toolbar-top-row {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 6px;
  }

  body[data-panel="studio"].history-opened .select-pill,
  body[data-panel="studio"].history-opened .help-pill,
  body[data-panel="studio"].history-opened .price-chip,
  body[data-panel="studio"].history-opened .billing-chip {
    min-height: 32px;
    padding-block: 5px;
    font-size: 11px;
  }

  body[data-panel="studio"].history-opened .select-pill[data-select="size"] {
    min-width: 174px;
  }

  body[data-panel="studio"].history-opened .select-pill[data-select="quality"],
  body[data-panel="studio"].history-opened .select-pill[data-select="format"] {
    min-width: 104px;
  }

  body[data-panel="studio"].history-opened .count-select {
    min-width: 78px;
  }

  body[data-panel="studio"].history-opened #prompt,
  body[data-panel="studio"].history-opened textarea {
    height: min(var(--composer-textarea-height, 128px), 104px);
    min-height: 96px;
    line-height: 1.5;
  }

  body[data-panel="studio"].history-opened .composer-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin-top: 7px;
  }

  body[data-panel="studio"].history-opened .composer-left-tools {
    display: flex;
    flex-wrap: wrap;
  }

  body[data-panel="studio"].history-opened .status {
    display: none;
  }

  body[data-panel="studio"].history-opened .toolbar-billing-group {
    display: none;
  }

  body[data-panel="studio"].history-opened .generate-button {
    min-width: 116px;
    min-height: 38px;
  }
}

/* 2026-06-11 Stitch iOS polish final layer. */
body[data-panel="studio"],
body[data-panel="studio"].theme-dark {
  --studio-bg: #f5f7fa;
  --studio-panel: rgba(255, 255, 255, 0.86);
  --studio-panel-strong: rgba(255, 255, 255, 0.94);
  --studio-line: rgba(60, 60, 67, 0.14);
  --studio-line-strong: rgba(60, 60, 67, 0.22);
  --studio-ink: #1d1d1f;
  --studio-muted: #6e6e73;
  --studio-faint: #8e8e93;
  --studio-blue: #007aff;
  --studio-cyan: #007aff;
  --studio-green: #34c759;
  --studio-amber: #ff9500;
  --composer-safe-space: 320px;
  color: var(--studio-ink);
  background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 44%, #f2f2f7 100%);
}

body[data-panel="studio"]::before,
body[data-panel="studio"] .workspace::before,
body[data-panel="studio"] .composer-card::before {
  display: none !important;
  content: none !important;
}

body[data-panel="studio"] .studio-shell {
  gap: 8px;
  padding: 8px;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace,
body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread,
body[data-panel="studio"] .composer-card {
  border: 1px solid var(--studio-line);
  background: var(--studio-panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.045);
  backdrop-filter: blur(20px);
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace {
  border-radius: 16px;
}

body[data-panel="studio"] .workspace {
  background: rgba(255, 255, 255, 0.82);
}

body[data-panel="studio"] .workspace-header {
  min-height: 52px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--studio-line);
  background: rgba(255, 255, 255, 0.72);
}

body[data-panel="studio"] .workspace-title h1,
body[data-panel="studio"] .thread-head h2,
body[data-panel="studio"] .history-panel-head h2,
body[data-panel="studio"] .intro-panel h2 {
  color: var(--studio-ink);
  background: none;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
  letter-spacing: 0;
}

body[data-panel="studio"] .workspace-title h1 {
  font-size: 20px;
  font-weight: 780;
}

body[data-panel="studio"] .workspace-badge,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] #previewMeta,
body[data-panel="studio"] .workspace-badge.wallet,
body[data-panel="studio"] .price-chip,
body[data-panel="studio"] .billing-chip {
  border-color: var(--studio-line);
  color: var(--studio-muted);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

body[data-panel="studio"] .ready-pill {
  color: #0a7f37;
  background: rgba(52, 199, 89, 0.12);
}

body[data-panel="studio"] #previewMeta::after,
body[data-panel="studio"] .ready-pill::after {
  display: none;
}

body[data-panel="studio"].generating-active #previewMeta::after,
body[data-panel="studio"].generating-active .ready-pill::after {
  display: block;
  opacity: 0.56;
  animation: studioShine 2.2s ease-in-out infinite;
}

body[data-panel="studio"] .workspace-content {
  grid-template-columns: minmax(270px, 320px) minmax(560px, 1fr);
  gap: 10px;
  height: calc(100vh - 68px);
  padding: 10px 12px var(--composer-safe-space, 268px);
}

body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread {
  border-radius: 14px;
  box-shadow: none;
}

body[data-panel="studio"] .intro-panel {
  padding: 12px;
}

body[data-panel="studio"] .intro-panel::before {
  margin-bottom: 8px;
  border-color: var(--studio-line);
  color: var(--studio-muted);
  background: rgba(242, 242, 247, 0.72);
  content: "灵感模板";
}

body[data-panel="studio"] .intro-panel h2 {
  max-width: 15ch;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.18;
}

body[data-panel="studio"] .prompt-tools,
body[data-panel="studio"]:not(.history-opened) .prompt-tools,
body[data-panel="studio"].history-opened .prompt-tools {
  gap: 8px;
}

body[data-panel="studio"] .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card,
body[data-panel="studio"].history-opened .prompt-card {
  grid-template-columns: 46px minmax(0, 1fr);
  height: 68px !important;
  min-height: 68px;
  max-height: 68px;
  padding: 7px;
  border-color: var(--studio-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

body[data-panel="studio"] .prompt-card::before {
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(0, 122, 255, 0.14), transparent 34%),
    rgba(255, 255, 255, 0.72);
}

body[data-panel="studio"] .prompt-card:hover,
body[data-panel="studio"] .prompt-card:focus-visible {
  border-color: rgba(0, 122, 255, 0.34);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px) !important;
}

body[data-panel="studio"] .prompt-cover,
body[data-panel="studio"]:not(.history-opened) .prompt-cover,
body[data-panel="studio"].history-opened .prompt-cover {
  width: 46px;
  height: 52px !important;
  min-height: 52px;
  border: 1px solid rgba(0, 122, 255, 0.12);
  border-radius: 10px;
  box-shadow: none;
}

body[data-panel="studio"] .prompt-cover::before {
  inset: 11px 10px auto;
  height: 16px;
  border-color: rgba(0, 122, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

body[data-panel="studio"] .prompt-cover::after {
  inset: auto 10px 10px;
  height: 8px;
  background: rgba(0, 122, 255, 0.18);
}

body[data-panel="studio"] .prompt-purple .prompt-cover,
body[data-panel="studio"] .prompt-blue .prompt-cover,
body[data-panel="studio"] .prompt-rose .prompt-cover,
body[data-panel="studio"] .prompt-cyan .prompt-cover {
  background: linear-gradient(145deg, #ffffff, #eef5ff);
}

body[data-panel="studio"] .prompt-card strong,
body[data-panel="studio"]:not(.history-opened) .prompt-card strong,
body[data-panel="studio"].history-opened .prompt-card strong {
  color: var(--studio-ink);
  font-size: 12.5px;
  font-weight: 720;
}

body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"]:not(.history-opened) .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card p {
  color: var(--studio-muted);
  font-size: 11px;
  line-height: 1.34;
  -webkit-line-clamp: 1;
}

body[data-panel="studio"] .result-thread {
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 12px;
}

body[data-panel="studio"] .thread-head {
  min-height: 30px;
  margin-bottom: 8px;
}

body[data-panel="studio"] .thread-head h2 {
  font-size: 16px;
  font-weight: 760;
}

body[data-panel="studio"] .preview,
body[data-panel="studio"].history-opened .preview {
  min-height: clamp(340px, calc(100vh - var(--composer-safe-space, 268px) - 176px), 620px);
  border-color: var(--studio-line);
  border-radius: 14px;
  background: #f7f8fb;
  background-image: none;
}

body[data-panel="studio"] .preview.has-result,
body[data-panel="studio"].history-opened .preview.has-result {
  min-height: clamp(360px, calc(100vh - var(--composer-safe-space, 268px) - 158px), 680px);
}

body[data-panel="studio"] .preview-empty {
  gap: 10px;
  padding: 18px;
}

body[data-panel="studio"] .preview-empty::before {
  width: min(320px, 64%);
  border-color: var(--studio-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(242, 242, 247, 0.88)),
    url("/assets/showcase/hero-studio.svg") center / cover no-repeat;
  box-shadow: none;
  animation: none;
}

body[data-panel="studio"] .preview-empty h3 {
  color: var(--studio-ink);
  font-size: 17px;
  font-weight: 740;
}

body[data-panel="studio"] .preview-empty p,
body[data-panel="studio"] .preview-footer {
  color: var(--studio-muted);
}

body[data-panel="studio"] .single-result,
body[data-panel="studio"] .multi-result {
  min-height: clamp(300px, calc(100vh - var(--composer-safe-space, 268px) - 210px), 620px);
}

body[data-panel="studio"] .single-result img,
body[data-panel="studio"] .multi-result img {
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: #f8f8fb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.055);
}

body[data-panel="studio"] .result-actions {
  gap: 7px;
}

body[data-panel="studio"] .result-actions a,
body[data-panel="studio"] .result-actions button {
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

body[data-panel="studio"] .result-actions .result-action-primary,
body[data-panel="studio"] .result-publish-prompt .primary-button {
  border-color: #007aff;
  color: #fff;
  background: #007aff;
}

body[data-panel="studio"] .result-publish-prompt {
  width: min(100%, 860px);
  margin-bottom: 10px;
  border-color: rgba(0, 122, 255, 0.18);
  border-radius: 14px;
  color: #064a9f;
  background: rgba(0, 122, 255, 0.08);
}

body[data-panel="studio"] .result-publish-prompt span {
  color: #386895;
}

body[data-panel="studio"] .composer-card {
  left: 12px;
  right: 12px;
  bottom: 8px;
  padding: 8px 10px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.06);
  transform: none;
}

body[data-panel="studio"] .composer-card:focus-within {
  border-color: rgba(0, 122, 255, 0.34);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(0, 122, 255, 0.08);
}

body[data-panel="studio"] .composer-resize {
  width: 76px;
  height: 13px;
  border-color: var(--studio-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

body[data-panel="studio"] .composer-resize::before {
  width: 32px;
  height: 3px;
  margin-top: 4px;
  background: #c7c7cc;
}

body[data-panel="studio"] .composer-toolbar {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "mode selects";
  gap: 7px 10px;
  margin-bottom: 7px;
  padding-top: 5px;
}

body[data-panel="studio"] .toolbar-top-row {
  gap: 6px;
}

body[data-panel="studio"] .mode-tabs,
body[data-panel="studio"] .layout-tabs {
  padding: 3px;
  border: 1px solid var(--studio-line);
  background: rgba(242, 242, 247, 0.82);
}

body[data-panel="studio"] .mode-tabs button,
body[data-panel="studio"] .layout-tabs button {
  min-height: 28px;
  padding: 4px 11px;
  color: var(--studio-muted);
  font-size: 12.5px;
  font-weight: 700;
}

body[data-panel="studio"] .mode-tabs button.active,
body[data-panel="studio"] .layout-tabs button.active {
  color: #fff;
  background: #007aff;
  box-shadow: none;
}

body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button,
body[data-panel="studio"] .billing-chip,
body[data-panel="studio"] .price-chip {
  min-height: 32px;
  border-color: var(--studio-line);
  color: var(--studio-ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  font-size: 12px;
}

body[data-panel="studio"] .select-pill:hover,
body[data-panel="studio"] .help-pill:hover,
body[data-panel="studio"] .upload-trigger:hover,
body[data-panel="studio"] .clarity-mode-button:hover,
body[data-panel="studio"] .prompt-optimize-button:hover,
body[data-panel="studio"] .motion-neighbor {
  border-color: rgba(0, 122, 255, 0.28);
  box-shadow: none;
  transform: translateY(-1px) scale(1.006);
}

body[data-panel="studio"] .select-pill {
  min-width: 96px;
  padding: 5px 9px;
}

body[data-panel="studio"] .select-pill[data-select="size"] {
  min-width: 174px;
}

body[data-panel="studio"] .select-pill[data-select="quality"],
body[data-panel="studio"] .select-pill[data-select="format"] {
  min-width: 96px;
}

body[data-panel="studio"] .count-select {
  min-width: 78px;
}

body[data-panel="studio"] .help-pill {
  width: 32px;
  min-width: 32px;
}

body[data-panel="studio"] .pill-menu {
  border-color: var(--studio-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.11);
}

body[data-panel="studio"] .pill-menu button.active,
body[data-panel="studio"] .pill-menu button:hover {
  color: #005bc3;
  background: rgba(0, 122, 255, 0.1);
}

body[data-panel="studio"] #prompt,
body[data-panel="studio"] textarea {
  height: min(var(--composer-textarea-height, 112px), 150px);
  min-height: 86px;
  max-height: 180px;
  padding: 10px 12px;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  color: var(--studio-ink);
  background: rgba(242, 242, 247, 0.48);
  font-size: 14px;
  line-height: 1.54;
}

body[data-panel="studio"] #prompt:focus {
  border-color: rgba(0, 122, 255, 0.44);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

body[data-panel="studio"] .upload-box,
body[data-panel="studio"] .reference-preview,
body[data-panel="studio"] .storyboard-draft {
  border-color: var(--studio-line);
  border-radius: 12px;
  background: rgba(242, 242, 247, 0.5);
}

body[data-panel="studio"] .upload-box {
  min-height: 74px;
  margin-bottom: 8px;
}

body[data-panel="studio"] .reference-preview {
  margin-bottom: 8px;
}

body[data-panel="studio"] .composer-footer {
  grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr) auto auto;
  gap: 7px;
  margin-top: 7px;
}

body[data-panel="studio"] .composer-left-tools {
  gap: 6px;
}

body[data-panel="studio"] .status {
  color: var(--studio-muted);
  font-size: 12px;
}

body[data-panel="studio"] .toolbar-billing-group {
  gap: 6px;
}

body[data-panel="studio"] .price-chip {
  max-width: min(320px, 34vw);
  overflow: hidden;
  color: #0a7f37;
  background: rgba(52, 199, 89, 0.12);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"] .billing-chip {
  color: var(--studio-muted);
  background: rgba(242, 242, 247, 0.82);
}

body[data-panel="studio"] .clarity-mode-button.active,
body[data-panel="studio"] .generate-button,
body[data-panel="studio"] .primary-button,
body[data-panel="studio"] .new-chat-button {
  color: #fff;
  background: #007aff;
}

body[data-panel="studio"] .generate-button {
  min-width: 116px;
  min-height: 38px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.22);
}

body[data-panel="studio"] .generate-button:hover::after,
body[data-panel="studio"] .generate-button.is-magnetized::after {
  animation: none;
}

body[data-panel="studio"].generating-active .generate-button::after {
  animation: studioShine 1.4s ease-in-out infinite;
}

body[data-panel="studio"] .history-panel {
  padding: 10px;
}

body[data-panel="studio"] .history-item,
body[data-panel="studio"] .history-filters input,
body[data-panel="studio"] .history-more-actions > div {
  border-color: var(--studio-line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

body[data-panel="studio"] .history-filter-row button.active {
  color: #fff;
  background: #007aff;
}

body[data-panel="studio"] .generation-banner {
  border-color: rgba(0, 122, 255, 0.18);
  color: #005bc3;
  background: rgba(0, 122, 255, 0.08);
}

body[data-panel="studio"] .generating-stage {
  gap: 20px;
  padding: 22px;
}

body[data-panel="studio"] .breathing-frame {
  border-color: var(--studio-line);
  background: linear-gradient(135deg, #ffffff, #f2f2f7);
  box-shadow: none;
}

body[data-panel="studio"] .breathing-image {
  background:
    linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.45), rgba(255,255,255,.88)),
    linear-gradient(135deg, rgba(0,122,255,.20), rgba(142,142,147,.12));
}

@media (min-width: 1181px) {
  body[data-panel="studio"].history-opened .studio-shell {
    grid-template-columns: 216px clamp(268px, var(--history-width, 300px), 380px) minmax(0, 1fr);
  }

  body[data-panel="studio"].rail-collapsed.history-opened .studio-shell {
    grid-template-columns: 76px clamp(268px, var(--history-width, 300px), 380px) minmax(0, 1fr);
  }

  body[data-panel="studio"].history-opened .workspace-content {
    grid-template-columns: 1fr;
    height: calc(100vh - 68px);
    padding-bottom: var(--composer-safe-space, 268px);
  }

  body[data-panel="studio"].history-opened .intro-panel {
    display: grid;
    grid-template-columns: minmax(118px, 156px) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  body[data-panel="studio"].history-opened .intro-panel::before,
  body[data-panel="studio"].history-opened .intro-panel h2 {
    grid-column: 1;
  }

  body[data-panel="studio"].history-opened .prompt-tools {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body[data-panel="studio"].history-opened .prompt-card {
    flex: 0 0 148px;
    grid-template-columns: 34px minmax(0, 1fr);
    height: 52px !important;
    min-height: 52px;
    max-height: 52px;
  }

  body[data-panel="studio"].history-opened .prompt-cover {
    width: 34px;
    height: 38px !important;
    min-height: 38px;
  }

  body[data-panel="studio"].history-opened .result-thread {
    padding: 10px;
  }

  body[data-panel="studio"].history-opened .preview,
  body[data-panel="studio"].history-opened .preview.has-result {
    min-height: clamp(300px, calc(100vh - var(--composer-safe-space, 268px) - 250px), 480px);
  }
}

@media (max-width: 1380px) and (min-width: 1181px) {
  body[data-panel="studio"].history-opened .workspace {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  body[data-panel="studio"].history-opened .workspace-content {
    flex: 0 0 auto;
    height: calc(100vh - 68px);
    padding-bottom: 10px;
    overflow: visible;
  }

  body[data-panel="studio"].history-opened .composer-card {
    position: static;
    margin: 0 12px 8px;
    padding: 8px 10px 10px;
  }

  body[data-panel="studio"].history-opened .toolbar-billing-group {
    display: inline-flex;
  }

  body[data-panel="studio"].history-opened .status {
    display: block;
  }

  body[data-panel="studio"].history-opened .composer-footer {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  body[data-panel="studio"].history-opened .composer-footer .status {
    grid-column: 1 / -1;
    order: -1;
  }

  body[data-panel="studio"].history-opened #prompt,
  body[data-panel="studio"].history-opened textarea {
    height: 94px;
    min-height: 84px;
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"],
  body[data-panel="studio"].theme-dark {
    background: #f5f7fa;
  }

  body[data-panel="studio"] .studio-shell {
    padding: 8px;
  }

  body[data-panel="studio"] .workspace-header {
    top: 68px;
    border-radius: 16px 16px 0 0;
  }

  body[data-panel="studio"] .workspace-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }

  body[data-panel="studio"] .result-thread {
    order: 2;
  }

  body[data-panel="studio"] .composer-card {
    order: 1;
    position: static;
    width: calc(100% - 16px);
    margin: 8px auto 0;
    padding: 12px 10px 10px;
  }

  body[data-panel="studio"] .intro-panel {
    order: 3;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mode"
      "selects";
    gap: 7px;
  }

  body[data-panel="studio"] .toolbar-bottom-row,
  body[data-panel="studio"] .toolbar-top-row {
    grid-area: auto;
  }

  body[data-panel="studio"] .toolbar-top-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-panel="studio"] .mode-tabs,
  body[data-panel="studio"] .layout-tabs,
  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip,
  body[data-panel="studio"] .upload-trigger,
  body[data-panel="studio"] .clarity-mode-button,
  body[data-panel="studio"] .prompt-optimize-button,
  body[data-panel="studio"] .generate-button {
    width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] .select-pill[data-select="size"],
  body[data-panel="studio"] .layout-tabs,
  body[data-panel="studio"] .toolbar-billing-group,
  body[data-panel="studio"] .generate-button {
    grid-column: 1 / -1;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  body[data-panel="studio"] .status {
    white-space: normal;
  }

  body[data-panel="studio"] #prompt,
  body[data-panel="studio"] textarea {
    height: 112px;
    min-height: 106px;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .workspace-header {
    top: 64px;
  }

  body[data-panel="studio"] .workspace-title h1 {
    font-size: 18px;
  }

  body[data-panel="studio"] .workspace-account {
    grid-template-columns: 1fr 1fr;
  }

  body[data-panel="studio"] .preview,
  body[data-panel="studio"].history-opened .preview {
    min-height: 300px;
  }

  body[data-panel="studio"] .preview-empty::before {
    width: min(250px, 74%);
  }

  body[data-panel="studio"] .toolbar-top-row,
  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    min-height: 64px;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    width: 44px;
    height: 48px !important;
    min-height: 48px;
  }

  body[data-panel="studio"] .result-publish-prompt {
    display: grid;
    gap: 10px;
  }

  body[data-panel="studio"] .result-publish-prompt button,
  body[data-panel="studio"] .result-publish-actions {
    width: 100%;
  }
}

@media (pointer: coarse) {
  body[data-panel="studio"] .generate-button {
    transform: none !important;
  }

  body[data-panel="studio"] .prompt-card:hover,
  body[data-panel="studio"] .prompt-card:focus-visible,
  body[data-panel="studio"] .motion-neighbor {
    transform: none !important;
  }
}

/* 2026-06-11 iOS motion restraint: keep React Bits influence subtle and state-driven. */
body::before,
body[data-panel="studio"]::before,
body[data-panel="studio"] .workspace::before,
body[data-panel="studio"] .composer-card::before {
  display: none !important;
  content: none !important;
  animation: none !important;
}

body[data-panel="studio"] .intro-panel h2,
body[data-panel="studio"] .preview-empty h3 {
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body[data-panel="studio"] .preview.loading::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

body[data-panel="studio"] #previewMeta::after,
body[data-panel="studio"] .ready-pill::after,
body[data-panel="studio"] .generate-button::after {
  animation: none;
}

body[data-panel="studio"].generating-active .generate-button::after {
  animation: studioShine 1.55s ease-in-out infinite;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .composer-card {
  backdrop-filter: blur(12px);
}

body[data-panel="studio"] .workspace,
body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread {
  backdrop-filter: none;
}

body[data-panel="studio"] .workspace-content {
  padding-bottom: var(--composer-safe-space, 320px);
}

body[data-panel="studio"] .preview,
body[data-panel="studio"].history-opened .preview {
  min-height: clamp(320px, calc(100vh - var(--composer-safe-space, 320px) - 190px), 560px);
}

body[data-panel="studio"].history-opened .preview,
body[data-panel="studio"].history-opened .preview.has-result {
  min-height: clamp(300px, calc(100vh - var(--composer-safe-space, 320px) - 260px), 460px);
}

@media (max-width: 760px) {
  body[data-panel="studio"] .composer-card {
    padding: 10px 10px 10px;
  }

  body[data-panel="studio"] .composer-toolbar {
    gap: 6px;
    margin-bottom: 6px;
  }

  body[data-panel="studio"] .toolbar-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body[data-panel="studio"] .select-pill[data-select="size"],
  body[data-panel="studio"] .layout-tabs {
    grid-column: 1 / -1;
  }

  body[data-panel="studio"] #prompt,
  body[data-panel="studio"] textarea {
    height: 92px;
    min-height: 88px;
    line-height: 1.45;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body[data-panel="studio"] .upload-trigger {
    grid-column: 1 / -1;
  }

  body[data-panel="studio"].edit-mode-active .upload-trigger {
    display: none;
  }

  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    max-width: none;
    justify-content: center;
    padding-inline: 8px;
  }

  body[data-panel="studio"] .generate-button {
    min-height: 40px;
  }
}

/* 2026-06-12 screenshot audit polish: remove old template gradients and force mobile creator-first flow. */
body[data-panel="studio"] .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card,
body[data-panel="studio"].history-opened .prompt-card {
  grid-template-columns: 48px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  height: 76px !important;
  min-height: 76px !important;
  max-height: 76px !important;
  padding: 8px !important;
  align-content: center;
}

body[data-panel="studio"] .prompt-cover,
body[data-panel="studio"]:not(.history-opened) .prompt-cover,
body[data-panel="studio"].history-opened .prompt-cover,
body[data-panel="studio"] .prompt-purple .prompt-cover,
body[data-panel="studio"] .prompt-blue .prompt-cover,
body[data-panel="studio"] .prompt-rose .prompt-cover,
body[data-panel="studio"] .prompt-cyan .prompt-cover {
  grid-row: 1 / span 2 !important;
  width: 48px !important;
  height: 52px !important;
  min-height: 52px !important;
  border: 1px solid rgba(0, 122, 255, 0.16) !important;
  border-radius: 12px !important;
  background:
    radial-gradient(circle at 50% 38%, rgba(0, 122, 255, 0.22) 0 8px, transparent 9px),
    linear-gradient(180deg, #ffffff 0%, #eef5ff 100%) !important;
  box-shadow: none !important;
}

body[data-panel="studio"] .prompt-cover::before {
  inset: auto 10px 13px !important;
  width: auto !important;
  height: 5px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(0, 122, 255, 0.18) !important;
}

body[data-panel="studio"] .prompt-cover::after {
  inset: auto 14px 9px !important;
  height: 4px !important;
  border-radius: 999px !important;
  background: rgba(0, 122, 255, 0.12) !important;
}

body[data-panel="studio"] .prompt-card span,
body[data-panel="studio"] .prompt-card small {
  display: none !important;
}

body[data-panel="studio"] .prompt-card p,
body[data-panel="studio"]:not(.history-opened) .prompt-card p,
body[data-panel="studio"].history-opened .prompt-card p {
  -webkit-line-clamp: 1 !important;
}

@media (max-width: 760px) {
  html,
  body[data-panel="studio"] {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-panel="studio"] .studio-shell,
  body[data-panel="studio"] .studio-rail,
  body[data-panel="studio"] .workspace,
  body[data-panel="studio"] .workspace-header,
  body[data-panel="studio"] .workspace-content,
  body[data-panel="studio"] .composer-card,
  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer {
    max-width: 100%;
    min-width: 0;
  }

  body[data-panel="studio"] .workspace {
    display: flex !important;
    flex-direction: column !important;
  }

  body[data-panel="studio"] .workspace-header {
    order: 0 !important;
  }

  body[data-panel="studio"] .composer-card {
    order: 1 !important;
    width: calc(100% - 8px) !important;
    margin-inline: 4px !important;
  }

  body[data-panel="studio"] .workspace-content {
    order: 2 !important;
  }

  body[data-panel="studio"] .workspace-account {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-panel="studio"] .ready-pill {
    grid-column: 1 / -1 !important;
  }

  body[data-panel="studio"] .account-pill,
  body[data-panel="studio"] .collapse-history-button,
  body[data-panel="studio"] .recharge-header-button,
  body[data-panel="studio"] .ready-pill {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-panel="studio"] .result-thread {
    order: 1 !important;
  }

  body[data-panel="studio"] .intro-panel {
    order: 2 !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    width: 44px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  body[data-panel="studio"] .composer-left-tools,
  body[data-panel="studio"] .toolbar-billing-group {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-panel="studio"] .clarity-mode-button,
  body[data-panel="studio"] .prompt-optimize-button,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip,
  body[data-panel="studio"] .generate-button {
    width: calc(100% - 2px) !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body[data-panel="studio"] .prompt-optimize-button {
    display: none !important;
  }
}

/* 2026-06-12 Stitch MCP final responsive pass: compact creator-first mobile and cleaner desktop rail. */
@media (min-width: 1181px) {
  body[data-panel="studio"]:not(.rail-collapsed) .studio-shell {
    grid-template-columns: 224px minmax(0, 1fr) !important;
  }

  body[data-panel="studio"].history-opened:not(.rail-collapsed) .studio-shell {
    grid-template-columns: 224px clamp(268px, var(--history-width, 300px), 360px) minmax(0, 1fr) !important;
  }

  body[data-panel="studio"]:not(.rail-collapsed) .rail-brand strong {
    font-size: 13px !important;
    line-height: 1.12 !important;
  }

  body[data-panel="studio"]:not(.rail-collapsed) .rail-brand span {
    font-size: 11px !important;
  }

  body[data-panel="studio"]:not(.rail-collapsed) .rail-collapse {
    width: 34px !important;
    height: 34px !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .studio-shell {
    gap: 6px !important;
    padding: 6px !important;
  }

  body[data-panel="studio"] .studio-rail {
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 14px !important;
  }

  body[data-panel="studio"] .rail-top {
    gap: 8px !important;
  }

  body[data-panel="studio"] .rail-logo {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  body[data-panel="studio"] .rail-brand {
    padding: 4px 2px !important;
  }

  body[data-panel="studio"] .rail-brand strong {
    font-size: 13px !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }

  body[data-panel="studio"] .rail-brand span {
    margin-top: 3px !important;
    font-size: 11px !important;
  }

  body[data-panel="studio"] .rail-collapse {
    display: none !important;
  }

  body[data-panel="studio"] .rail-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }

  body[data-panel="studio"] .rail-action {
    min-height: 48px !important;
    padding: 6px !important;
  }

  body[data-panel="studio"] .rail-icon {
    width: 36px !important;
    height: 36px !important;
  }

  body[data-panel="studio"] .rail-copy {
    display: none !important;
  }

  body[data-panel="studio"] .rail-bottom {
    display: none !important;
  }

  body[data-panel="studio"] .workspace {
    border-radius: 14px !important;
  }

  body[data-panel="studio"] .workspace-header {
    top: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    min-height: 0 !important;
    padding: 9px 12px 8px !important;
    border-radius: 14px 14px 0 0 !important;
  }

  body[data-panel="studio"] .workspace-title {
    display: flex !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body[data-panel="studio"] .workspace-title h1 {
    flex: 0 0 auto !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
  }

  body[data-panel="studio"] .workspace-badge {
    min-height: 20px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
  }

  body[data-panel="studio"] .workspace-account {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  body[data-panel="studio"] .ready-pill,
  body[data-panel="studio"] .account-pill,
  body[data-panel="studio"] .collapse-history-button {
    min-height: 32px !important;
    padding: 6px 8px !important;
    justify-content: center !important;
    border-radius: 999px !important;
    font-size: 11px !important;
  }

  body[data-panel="studio"] .recharge-header-button {
    display: none !important;
  }

  body[data-panel="studio"] .ready-pill {
    grid-column: 1 / -1 !important;
  }

  body[data-panel="studio"] .ready-pill svg,
  body[data-panel="studio"] .collapse-history-button svg {
    width: 14px !important;
    height: 14px !important;
  }

  body[data-panel="studio"] .collapse-history-button {
    gap: 4px !important;
  }

  body[data-panel="studio"] .collapse-history-button span,
  body[data-panel="studio"] .billing-chip {
    font-size: 0 !important;
  }

  body[data-panel="studio"] .collapse-history-button span::after {
    content: "历史";
    font-size: 11px;
  }

  body[data-panel="studio"] .billing-chip::after {
    content: "余额";
    font-size: 11.5px;
  }

  body[data-panel="studio"] .composer-card {
    padding: 8px !important;
    border-radius: 14px !important;
  }

  body[data-panel="studio"] .composer-resize {
    display: none !important;
  }

  body[data-panel="studio"] .composer-toolbar {
    gap: 6px !important;
    margin-bottom: 6px !important;
    padding-top: 0 !important;
  }

  body[data-panel="studio"] .toolbar-top-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  body[data-panel="studio"] .mode-tabs button,
  body[data-panel="studio"] .layout-tabs button,
  body[data-panel="studio"] .select-pill,
  body[data-panel="studio"] .help-pill,
  body[data-panel="studio"] .upload-trigger,
  body[data-panel="studio"] .clarity-mode-button,
  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    min-height: 30px !important;
    font-size: 11.5px !important;
  }

  body[data-panel="studio"] #prompt,
  body[data-panel="studio"] textarea {
    height: 82px !important;
    min-height: 82px !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
  }

  body[data-panel="studio"] .composer-footer {
    gap: 6px !important;
    margin-top: 6px !important;
  }

  body[data-panel="studio"] .composer-left-tools {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  body[data-panel="studio"] .upload-trigger {
    grid-column: 1 / -1 !important;
  }

  body[data-panel="studio"] .toolbar-billing-group {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  body[data-panel="studio"] .price-chip,
  body[data-panel="studio"] .billing-chip {
    width: 100% !important;
  }

  body[data-panel="studio"] .generate-button {
    min-height: 40px !important;
    width: 100% !important;
    border-radius: 12px !important;
  }

  body[data-panel="studio"] .workspace-content {
    gap: 8px !important;
    padding: 8px !important;
  }
}

/* 2026-06-16 result workspace alignment pass. Keep this layer last. */
body[data-panel="studio"] .result-thread {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 16px;
  border-radius: 16px;
}

body[data-panel="studio"] .result-thread.is-visible + .intro-panel,
body[data-panel="studio"] .result-thread:has(.preview.has-result) + .intro-panel {
  grid-column: 1 / -1;
}

body[data-panel="studio"] .thread-head {
  min-height: 32px;
  margin: 0 0 12px;
}

body[data-panel="studio"] #previewMeta {
  max-width: min(100%, 560px);
  min-height: 28px;
  padding: 5px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-panel="studio"] .preview.has-result,
body[data-panel="studio"].history-opened .preview.has-result {
  display: block;
  min-height: auto;
  padding: 14px;
  overflow: visible;
  border-radius: 16px;
  background: #f7f8fb;
}

body[data-panel="studio"] .preview.has-result .single-result,
body[data-panel="studio"] .preview.has-result .multi-result {
  align-items: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  gap: 14px;
}

body[data-panel="studio"] .preview.has-result .single-result {
  display: grid;
  place-items: center;
}

body[data-panel="studio"] .preview.has-result .multi-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-panel="studio"] .result-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

body[data-panel="studio"] .single-result .result-card {
  max-width: min(100%, 900px);
}

body[data-panel="studio"] .result-image-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: clamp(320px, calc(100vh - var(--composer-safe-space, 320px) - 250px), 680px);
  overflow: hidden;
  border: 1px solid var(--studio-line, rgba(101, 119, 134, 0.22));
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(15, 23, 42, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(15, 23, 42, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(15, 23, 42, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(15, 23, 42, 0.035) 75%),
    #f8fafc;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

body[data-panel="studio"] .single-result .result-image-frame {
  aspect-ratio: 1 / 1;
}

body[data-panel="studio"] .multi-result .result-image-frame {
  aspect-ratio: 1 / 1;
  min-height: 260px;
}

body[data-panel="studio"] .result-image-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  box-shadow: none;
}

body[data-panel="studio"] .result-image-frame.is-broken img {
  opacity: 0;
  visibility: hidden;
}

body[data-panel="studio"] .result-image-frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.7) 50%, transparent 58%);
  animation: studioShine 1.5s ease-in-out infinite;
}

body[data-panel="studio"] .result-image-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #334155;
  background: #f8fafc;
}

body[data-panel="studio"] .result-image-frame.is-broken .result-image-error {
  display: grid;
}

body[data-panel="studio"] .result-image-error strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 760;
}

body[data-panel="studio"] .result-image-error span {
  max-width: 340px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

body[data-panel="studio"] .result-image-error div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

body[data-panel="studio"] .result-image-error button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--studio-line, #d8dee8);
  border-radius: 999px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

body[data-panel="studio"] .result-meta {
  justify-self: center;
  max-width: 100%;
  min-height: 28px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #5f5b53;
  background: rgba(242, 241, 237, 0.95);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

body[data-panel="studio"] .result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
}

body[data-panel="studio"] .result-actions a,
body[data-panel="studio"] .result-actions button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  body[data-panel="studio"] .preview.has-result,
  body[data-panel="studio"].history-opened .preview.has-result {
    padding: 10px;
  }

  body[data-panel="studio"] .preview.has-result .multi-result {
    grid-template-columns: 1fr;
  }

  body[data-panel="studio"] .result-image-frame,
  body[data-panel="studio"] .multi-result .result-image-frame {
    min-height: 280px;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .result-thread {
    padding: 10px;
    border-radius: 14px;
  }

  body[data-panel="studio"] .thread-head {
    display: grid;
    justify-items: start;
    gap: 6px;
  }

  body[data-panel="studio"] .preview.has-result,
  body[data-panel="studio"].history-opened .preview.has-result {
    padding: 8px;
  }

  body[data-panel="studio"] .result-image-frame,
  body[data-panel="studio"] .single-result .result-image-frame,
  body[data-panel="studio"] .multi-result .result-image-frame {
    min-height: 240px;
  }

  body[data-panel="studio"] .result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body[data-panel="studio"] .result-actions a,
  body[data-panel="studio"] .result-actions button {
    width: 100%;
    padding-inline: 8px;
    font-size: 11.5px;
  }
}

/* 2026-06-16 Chrome audit glass pass: iOS-style hierarchy, no overlap. */
body[data-panel="studio"] {
  --ios-glass: rgba(255, 255, 255, 0.68);
  --ios-glass-strong: rgba(255, 255, 255, 0.82);
  --ios-glass-line: rgba(72, 84, 104, 0.16);
  --ios-shadow-soft: 0 22px 60px rgba(42, 54, 71, 0.12);
  --ios-shadow-float: 0 30px 90px rgba(26, 39, 58, 0.18);
  --ios-blue: #0a84ff;
  --ios-ink: #111827;
  --ios-muted: #667085;
  --studio-work-width: 1120px;
  --studio-template-width: 1520px;
  --studio-work-gutter: 20px;
  --composer-safe-space: clamp(296px, 30vh, 340px);
  background:
    radial-gradient(circle at 18% 16%, rgba(10, 132, 255, 0.15), transparent 28%),
    radial-gradient(circle at 82% 8%, rgba(52, 199, 89, 0.12), transparent 30%),
    radial-gradient(circle at 54% 92%, rgba(175, 82, 222, 0.10), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f2f5f9 48%, #eef2f7 100%) !important;
}

body[data-panel="studio"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 36%, rgba(255, 255, 255, 0.42) 48%, transparent 62% 100%);
  opacity: 0.7;
  animation: studioAmbientSweep 12s ease-in-out infinite alternate;
}

@keyframes studioAmbientSweep {
  from { transform: translate3d(-6%, -3%, 0) scale(1.02); }
  to { transform: translate3d(5%, 3%, 0) scale(1.04); }
}

body[data-panel="studio"] .studio-shell {
  align-items: stretch;
  gap: 10px !important;
  padding: 8px !important;
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace,
body[data-panel="studio"] .workspace-header,
body[data-panel="studio"] .intro-panel,
body[data-panel="studio"] .result-thread,
body[data-panel="studio"] .composer-card,
body[data-panel="studio"] .prompt-card,
body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .mode-tabs,
body[data-panel="studio"] .layout-tabs,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] .account-pill,
body[data-panel="studio"] .collapse-history-button,
body[data-panel="studio"] .price-chip,
body[data-panel="studio"] .billing-chip {
  border-color: var(--ios-glass-line) !important;
  background-color: var(--ios-glass) !important;
  box-shadow: none;
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .workspace {
  border-radius: 20px !important;
  box-shadow: var(--ios-shadow-soft) !important;
}

body[data-panel="studio"] .studio-rail {
  width: 224px;
  padding: 12px !important;
}

body[data-panel="studio"] .rail-action {
  min-height: 58px;
  border-radius: 14px !important;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

body[data-panel="studio"] .rail-action:hover,
body[data-panel="studio"] .rail-action:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.78) !important;
}

body[data-panel="studio"] .rail-action.rail-active,
body[data-panel="studio"] .rail-action.active {
  background: rgba(17, 24, 39, 0.94) !important;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.20);
}

body[data-panel="studio"] .workspace {
  overflow: hidden !important;
}

body[data-panel="studio"] .workspace-header {
  min-height: 54px;
  padding: 8px 18px !important;
  border-radius: 20px 20px 0 0 !important;
  background: rgba(255, 255, 255, 0.62) !important;
}

body[data-panel="studio"] .workspace-title h1 {
  font-size: 22px !important;
  letter-spacing: 0 !important;
}

body[data-panel="studio"] .workspace-badge,
body[data-panel="studio"] .ready-pill,
body[data-panel="studio"] .account-pill,
body[data-panel="studio"] .collapse-history-button {
  min-height: 34px;
  border-radius: 999px !important;
}

body[data-panel="studio"] .workspace-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  gap: 14px !important;
  height: calc(100vh - 80px) !important;
  padding: 14px var(--studio-work-gutter, 20px) calc(var(--composer-safe-space, 320px) + 48px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scroll-padding-bottom: var(--composer-safe-space, 320px);
}

body[data-panel="studio"] .result-thread {
  grid-column: 1 !important;
  grid-row: 2 !important;
  justify-self: center !important;
  width: min(100%, var(--studio-work-width, 1120px)) !important;
  max-width: var(--studio-work-width, 1120px) !important;
  margin: 0 auto !important;
  padding: 16px !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: var(--ios-shadow-soft) !important;
  overflow: visible !important;
}

body[data-panel="studio"] .thread-head {
  min-height: 34px !important;
  margin-bottom: 12px !important;
}

body[data-panel="studio"] #previewMeta {
  border: 1px solid rgba(10, 132, 255, 0.14);
  color: #315072;
  background: rgba(245, 249, 255, 0.78) !important;
  backdrop-filter: blur(16px);
}

body[data-panel="studio"] .preview,
body[data-panel="studio"].history-opened .preview {
  min-height: clamp(400px, calc(100vh - var(--composer-safe-space, 320px) - 285px), 590px) !important;
  border: 1px solid rgba(91, 108, 132, 0.18) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 249, 253, 0.82)),
    radial-gradient(circle at 50% 0%, rgba(10, 132, 255, 0.10), transparent 40%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-panel="studio"] .preview-empty::before {
  width: min(330px, 48%) !important;
  opacity: 0.9;
  box-shadow: 0 22px 54px rgba(54, 73, 97, 0.10) !important;
}

body[data-panel="studio"] .preview-empty h3 {
  margin-top: 8px;
  font-size: 18px !important;
}

body[data-panel="studio"] .preview-empty p {
  max-width: 620px;
  font-size: 14px;
  line-height: 1.7;
}

body[data-panel="studio"] .intro-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: center !important;
  display: grid !important;
  grid-template-columns: 170px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px 16px !important;
  width: min(100%, var(--studio-work-width, 1120px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 12px 14px !important;
  overflow: hidden !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.58) !important;
}

body[data-panel="studio"].studio-session-active .intro-panel,
body[data-panel="studio"]:has(.result-thread.is-visible) .intro-panel,
body[data-panel="studio"]:has(.preview.has-result) .intro-panel,
body[data-panel="studio"]:has(.preview.loading) .intro-panel {
  display: none !important;
}

body[data-panel="studio"].studio-session-active .result-thread,
body[data-panel="studio"]:has(.result-thread.is-visible) .result-thread,
body[data-panel="studio"]:has(.preview.has-result) .result-thread,
body[data-panel="studio"]:has(.preview.loading) .result-thread {
  grid-row: 1 !important;
}

body[data-panel="studio"] .intro-panel::before {
  display: none !important;
}

body[data-panel="studio"] .spark-icon {
  display: none !important;
}

body[data-panel="studio"] .intro-panel .spark-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
}

body[data-panel="studio"] .intro-panel h2 {
  grid-column: 1 !important;
  align-self: center !important;
  margin: 0 !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  white-space: normal;
}

body[data-panel="studio"] .prompt-tools,
body[data-panel="studio"]:not(.history-opened) .prompt-tools,
body[data-panel="studio"].history-opened .prompt-tools {
  grid-column: 2 !important;
  display: flex !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 2px 2px 4px !important;
  scrollbar-width: none;
}

body[data-panel="studio"] .prompt-tools::-webkit-scrollbar {
  display: none;
}

body[data-panel="studio"] .prompt-card,
body[data-panel="studio"]:not(.history-opened) .prompt-card,
body[data-panel="studio"].history-opened .prompt-card {
  flex: 0 0 250px !important;
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  gap: 5px 10px !important;
  width: 250px !important;
  min-height: 68px !important;
  max-height: 74px !important;
  padding: 9px !important;
  border-radius: 16px !important;
  text-align: left !important;
  transform: none !important;
}

body[data-panel="studio"] .prompt-cover,
body[data-panel="studio"]:not(.history-opened) .prompt-cover,
body[data-panel="studio"].history-opened .prompt-cover {
  grid-row: 1 / span 2;
  width: 46px !important;
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 13px !important;
}

body[data-panel="studio"] .prompt-card span,
body[data-panel="studio"] .prompt-card small {
  display: none !important;
}

body[data-panel="studio"] .prompt-card strong {
  align-self: end;
  font-size: 12.5px !important;
  line-height: 1.2 !important;
}

body[data-panel="studio"] .prompt-card p {
  align-self: start;
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  -webkit-line-clamp: 2 !important;
}

@media (min-width: 1181px) {
  body[data-panel="studio"] .intro-panel {
    grid-template-columns: minmax(172px, 220px) minmax(0, 1fr) !important;
    width: min(100%, var(--studio-template-width, 1520px)) !important;
    padding: 12px 16px !important;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    min-height: 66px !important;
    max-height: 72px !important;
    padding: 9px !important;
  }

  body[data-panel="studio"] .prompt-cover,
  body[data-panel="studio"]:not(.history-opened) .prompt-cover,
  body[data-panel="studio"].history-opened .prompt-cover {
    width: 42px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  body[data-panel="studio"] .prompt-card strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (min-width: 1181px) and (max-width: 1420px) {
  body[data-panel="studio"] .intro-panel {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="studio"] .intro-panel h2 {
    display: block !important;
    max-width: none !important;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    grid-column: 1 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

body[data-panel="studio"] .composer-card {
  left: 50% !important;
  right: auto !important;
  bottom: 16px !important;
  width: min(calc(100% - (var(--studio-work-gutter, 20px) * 2)), var(--studio-work-width, 1120px)) !important;
  max-width: var(--studio-work-width, 1120px) !important;
  margin: 0 !important;
  padding: 12px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.76) !important;
  box-shadow: var(--ios-shadow-float) !important;
  transform: translateX(-50%) !important;
  -webkit-backdrop-filter: saturate(190%) blur(30px);
  backdrop-filter: saturate(190%) blur(30px);
}

body[data-panel="studio"] .composer-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  pointer-events: none;
  border-radius: 23px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.36));
}

body[data-panel="studio"] .composer-card.composer-cue {
  border-color: rgba(10, 132, 255, 0.36) !important;
  box-shadow:
    0 30px 90px rgba(26, 39, 58, 0.18),
    0 0 0 5px rgba(10, 132, 255, 0.10) !important;
}

@media (min-width: 1181px) {
  body[data-panel="studio"] .composer-card:focus-within,
  body[data-panel="studio"] .composer-card.composer-cue {
    transform: translateX(-50%) !important;
  }
}

body[data-panel="studio"] .composer-resize {
  top: 8px !important;
  opacity: 0.55;
}

body[data-panel="studio"] .composer-toolbar {
  margin-bottom: 8px !important;
}

body[data-panel="studio"] .toolbar-top-row {
  gap: 7px !important;
}

body[data-panel="studio"] #prompt,
body[data-panel="studio"] textarea {
  height: 98px !important;
  min-height: 98px !important;
  border-radius: 16px !important;
  background: rgba(247, 249, 252, 0.82) !important;
}

body[data-panel="studio"] .composer-footer {
  align-items: center !important;
  gap: 8px !important;
  margin-top: 8px !important;
}

body[data-panel="studio"] .composer-left-tools,
body[data-panel="studio"] .toolbar-billing-group {
  gap: 7px !important;
}

body[data-panel="studio"] .generate-button {
  min-height: 40px !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, rgba(42, 143, 255, 1), rgba(0, 104, 235, 1)) !important;
  box-shadow: 0 14px 30px rgba(10, 132, 255, 0.30) !important;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

body[data-panel="studio"] .generate-button:hover,
body[data-panel="studio"] .generate-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(10, 132, 255, 0.34) !important;
}

body[data-panel="studio"] .select-pill,
body[data-panel="studio"] .help-pill,
body[data-panel="studio"] .upload-trigger,
body[data-panel="studio"] .clarity-mode-button,
body[data-panel="studio"] .prompt-optimize-button,
body[data-panel="studio"] .price-chip,
body[data-panel="studio"] .billing-chip {
  border-radius: 999px !important;
}

@media (min-width: 1181px) {
  body[data-panel="studio"].rail-collapsed .composer-card {
    left: 50% !important;
    right: auto !important;
    width: min(calc(100% - (var(--studio-work-gutter, 20px) * 2)), var(--studio-work-width, 1120px)) !important;
    transform: translateX(-50%) !important;
  }

  body[data-panel="studio"].history-opened .composer-card {
    left: 50% !important;
    right: auto !important;
    width: min(calc(100% - (var(--studio-work-gutter, 20px) * 2)), var(--studio-work-width, 1120px)) !important;
    transform: translateX(-50%) !important;
  }
}

@media (max-width: 1180px) {
  body[data-panel="studio"] {
    --composer-safe-space: 24px;
  }

  body[data-panel="studio"] .workspace-content {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 88px) !important;
    padding: 10px !important;
  }

  body[data-panel="studio"] .composer-card {
    position: static !important;
    order: 1 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }

  body[data-panel="studio"] .result-thread {
    order: 2 !important;
    width: 100% !important;
    max-width: none !important;
  }

  body[data-panel="studio"] .intro-panel {
    order: 3 !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
  }

  body[data-panel="studio"].studio-session-active .intro-panel,
  body[data-panel="studio"]:has(.result-thread.is-visible) .intro-panel,
  body[data-panel="studio"]:has(.preview.has-result) .intro-panel,
  body[data-panel="studio"]:has(.preview.loading) .intro-panel {
    display: none !important;
  }

  body[data-panel="studio"] .spark-icon,
  body[data-panel="studio"] .intro-panel h2 {
    display: none !important;
  }

  body[data-panel="studio"] .prompt-tools {
    grid-column: 1 !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto !important;
  }
}

@media (max-width: 760px) {
  body[data-panel="studio"] .workspace-header {
    padding: 9px 12px !important;
  }

  body[data-panel="studio"] .result-thread,
  body[data-panel="studio"] .intro-panel,
  body[data-panel="studio"] .composer-card {
    border-radius: 18px !important;
  }

  body[data-panel="studio"] .preview,
  body[data-panel="studio"].history-opened .preview {
    min-height: 320px !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card {
    flex-basis: 224px !important;
    width: 224px !important;
  }
}

/* 2026-06-16 cross-panel feature glass pass. */
body[data-panel="prompts"],
body[data-panel="agent"],
body[data-panel="developers"],
body[data-panel="settings"],
body[data-panel="admin"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(10, 132, 255, 0.13), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(52, 199, 89, 0.10), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #f2f5f9 54%, #eef2f7 100%) !important;
}

body[data-panel="prompts"] .workspace,
body[data-panel="agent"] .workspace,
body[data-panel="developers"] .workspace,
body[data-panel="settings"] .workspace,
body[data-panel="admin"] .workspace {
  background: rgba(255, 255, 255, 0.62) !important;
  border-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 20px !important;
  box-shadow: var(--ios-shadow-soft, 0 22px 60px rgba(42, 54, 71, 0.12)) !important;
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

body[data-panel="prompts"] .workspace-content,
body[data-panel="agent"] .workspace-content,
body[data-panel="developers"] .workspace-content,
body[data-panel="settings"] .workspace-content {
  display: block !important;
  height: calc(100vh - 80px) !important;
  padding: 18px 24px 24px !important;
  overflow: auto !important;
  background: rgba(248, 250, 252, 0.54) !important;
}

body[data-panel="admin"] .workspace {
  background: rgba(255, 255, 255, 0.62) !important;
}

body[data-panel="admin"] .workspace-header {
  background: rgba(255, 255, 255, 0.64) !important;
  border-bottom-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
}

body[data-panel="prompts"] .feature-panel,
body[data-panel="agent"] .feature-panel,
body[data-panel="developers"] .feature-panel,
body[data-panel="settings"] .feature-panel {
  width: min(100%, 1420px) !important;
  min-height: auto !important;
  margin: 0 auto !important;
  border: 1px solid var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.66) !important;
  box-shadow: var(--ios-shadow-soft, 0 22px 60px rgba(42, 54, 71, 0.12)) !important;
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  backdrop-filter: saturate(180%) blur(26px);
}

body[data-panel="prompts"] .feature-head,
body[data-panel="agent"] .feature-head,
body[data-panel="developers"] .feature-head,
body[data-panel="settings"] .feature-head {
  padding: 20px 22px 16px !important;
  border-bottom-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
}

body[data-panel="prompts"] .feature-head h2,
body[data-panel="agent"] .feature-head h2,
body[data-panel="developers"] .feature-head h2,
body[data-panel="settings"] .feature-head h2 {
  color: var(--ios-ink, #111827) !important;
  font-size: clamp(26px, 2vw, 34px) !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
}

body[data-panel="prompts"] .feature-head p,
body[data-panel="agent"] .feature-head p,
body[data-panel="developers"] .feature-head p,
body[data-panel="settings"] .feature-head p {
  color: var(--ios-muted, #667085) !important;
}

body[data-panel="prompts"] .feature-kicker,
body[data-panel="agent"] .feature-kicker,
body[data-panel="developers"] .feature-kicker,
body[data-panel="settings"] .feature-kicker {
  color: #315072 !important;
  background: rgba(245, 249, 255, 0.82) !important;
  border: 1px solid rgba(10, 132, 255, 0.12);
}

body[data-panel="prompts"] .feature-head-actions button,
body[data-panel="developers"] .api-doc-actions button,
body[data-panel="settings"] .settings-actions button,
body[data-panel="agent"] .agent-head-actions button,
body[data-panel="agent"] .agent-composer button,
body[data-panel="prompts"] .library-tags button,
body[data-panel="prompts"] .community-filter-summary button {
  border-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--ios-ink, #111827) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

body[data-panel="prompts"] .feature-head-actions .primary-button,
body[data-panel="agent"] .agent-composer button,
body[data-panel="developers"] .api-doc-actions .primary-button,
body[data-panel="settings"] .settings-actions .primary-button {
  color: #fff !important;
  background: linear-gradient(180deg, #2a8fff, #0068eb) !important;
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.25) !important;
}

body[data-panel="prompts"] .community-explainer {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 14px 22px 0 !important;
}

body[data-panel="prompts"] .community-explainer div,
body[data-panel="developers"] .api-doc-block,
body[data-panel="developers"] .api-key-panel,
body[data-panel="settings"] .settings-grid article,
body[data-panel="agent"] .agent-sidebar,
body[data-panel="agent"] .agent-messages,
body[data-panel="agent"] .agent-conversation,
body[data-panel="agent"] .agent-empty,
body[data-panel="agent"] .agent-message,
body[data-panel="agent"] .agent-composer,
body[data-panel="agent"] .agent-selects select {
  border-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  background: rgba(255, 255, 255, 0.66) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
}

body[data-panel="prompts"] .library-tags {
  gap: 9px !important;
  padding: 14px 22px 0 !important;
}

body[data-panel="prompts"] .library-filter-row {
  gap: 8px !important;
  padding-bottom: 2px !important;
}

body[data-panel="prompts"] .library-tags button.active,
body[data-panel="prompts"] .library-tags button:hover {
  color: #fff !important;
  background: linear-gradient(180deg, #2a8fff, #0068eb) !important;
}

body[data-panel="prompts"] .library-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 14px !important;
  padding: 16px 22px 22px !important;
}

body[data-panel="prompts"] .library-card,
body[data-panel="prompts"] .community-card {
  min-height: 0 !important;
  max-height: none !important;
  border: 1px solid var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 16px 44px rgba(42, 54, 71, 0.10) !important;
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
}

body[data-panel="prompts"] .community-cover {
  min-height: 168px !important;
  aspect-ratio: 4 / 3 !important;
  border-radius: 0 !important;
}

body[data-panel="prompts"] .library-card > div:not(.prompt-cover):not(.library-cover):not(.library-card-actions) {
  display: grid !important;
  gap: 8px !important;
  padding: 12px 14px !important;
}

body[data-panel="prompts"] .library-card h3 {
  margin: 0 !important;
  color: var(--ios-ink, #111827) !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
}

body[data-panel="prompts"] .library-card p {
  min-height: 0 !important;
  color: var(--ios-muted, #667085) !important;
  font-size: 12.5px !important;
  line-height: 1.48 !important;
  -webkit-line-clamp: 2 !important;
}

body[data-panel="prompts"] .community-feedback-question,
body[data-panel="prompts"] .creator-card-insight,
body[data-panel="prompts"] .creator-reuse-insight {
  margin-top: 0 !important;
  border-color: rgba(10, 132, 255, 0.12) !important;
  border-radius: 14px !important;
  background: rgba(245, 249, 255, 0.72) !important;
}

body[data-panel="prompts"] .community-card-metrics {
  gap: 6px !important;
}

body[data-panel="prompts"] .community-card-metrics span {
  min-height: 26px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
}

body[data-panel="prompts"] .community-card-actions,
body[data-panel="prompts"] .community-card-primary-actions,
body[data-panel="prompts"] .community-card-secondary-actions {
  gap: 7px !important;
}

body[data-panel="prompts"] .community-card-actions button,
body[data-panel="prompts"] .library-card-actions button {
  min-height: 32px !important;
  border-radius: 999px !important;
}

body[data-panel="agent"] .agent-panel {
  min-height: calc(100vh - 126px) !important;
}

body[data-panel="agent"] .agent-sidebar {
  flex-basis: 312px !important;
  margin: 14px 0 14px 14px;
  border-right: 0 !important;
}

body[data-panel="agent"] .agent-messages {
  margin: 14px 14px 0;
}

body[data-panel="agent"] .agent-composer {
  margin: 0 14px 14px;
  padding: 12px !important;
}

body[data-panel="agent"] .agent-composer textarea {
  border-radius: 16px !important;
  background: rgba(248, 250, 252, 0.82) !important;
}

body[data-panel="developers"] .api-docs-layout {
  gap: 14px !important;
  padding: 18px 22px 22px !important;
}

body[data-panel="developers"] pre {
  border-radius: 16px !important;
  background: rgba(15, 23, 42, 0.92) !important;
}

body[data-panel="settings"] .settings-grid {
  gap: 14px !important;
  padding: 18px 22px 0 !important;
}

body[data-panel="settings"] .settings-actions {
  padding: 18px 22px 22px !important;
}

body[data-panel="admin"] .admin-console-panel {
  margin: 12px !important;
  min-height: calc(100vh - 92px) !important;
  border: 1px solid var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.66) !important;
  box-shadow: var(--ios-shadow-soft, 0 22px 60px rgba(42, 54, 71, 0.12)) !important;
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  backdrop-filter: saturate(180%) blur(26px);
}

body[data-panel="admin"] .admin-console-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(10, 132, 255, 0.22), transparent 38%),
    linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(31, 41, 55, 0.96)) !important;
}

body[data-panel="admin"] .admin-console-main {
  background:
    radial-gradient(circle at 78% 0%, rgba(10, 132, 255, 0.09), transparent 36%),
    rgba(248, 250, 252, 0.62) !important;
}

body[data-panel="admin"] .admin-console-topbar,
body[data-panel="admin"] .admin-surface,
body[data-panel="admin"] .admin-list-surface,
body[data-panel="admin"] .admin-overview-grid article {
  border-color: var(--ios-glass-line, rgba(72, 84, 104, 0.16)) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.70) !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
}

@media (max-width: 1180px) {
  body[data-panel="prompts"] .workspace-content,
  body[data-panel="agent"] .workspace-content,
  body[data-panel="developers"] .workspace-content,
  body[data-panel="settings"] .workspace-content {
    height: auto !important;
    min-height: calc(100vh - 88px) !important;
    padding: 10px !important;
  }

  body[data-panel="prompts"] .community-explainer,
  body[data-panel="developers"] .api-docs-layout,
  body[data-panel="settings"] .settings-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="prompts"] .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    padding: 12px !important;
  }

  body[data-panel="agent"] .agent-panel {
    flex-direction: column !important;
  }

  body[data-panel="agent"] .agent-sidebar,
  body[data-panel="agent"] .agent-messages,
  body[data-panel="agent"] .agent-composer {
    margin: 10px !important;
  }
}

@media (max-width: 760px) {
  body[data-panel="prompts"] .feature-head,
  body[data-panel="agent"] .feature-head,
  body[data-panel="developers"] .feature-head,
  body[data-panel="settings"] .feature-head {
    display: grid !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  body[data-panel="prompts"] .feature-head-actions,
  body[data-panel="developers"] .api-doc-actions,
  body[data-panel="settings"] .settings-actions {
    justify-content: stretch !important;
    width: 100% !important;
  }

  body[data-panel="prompts"] .feature-head-actions button,
  body[data-panel="developers"] .api-doc-actions button,
  body[data-panel="settings"] .settings-actions button {
    flex: 1 1 0 !important;
  }

  body[data-panel="prompts"] .community-explainer {
    padding: 12px !important;
  }

  body[data-panel="prompts"] .library-tags {
    padding: 12px !important;
  }

  body[data-panel="prompts"] .library-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="admin"] .admin-console-panel {
    margin: 8px !important;
    border-radius: 18px !important;
  }
}

/* 2026-06-16 image failure polish: never expose native broken-image chrome. */
body[data-panel="studio"] .result-image-frame {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 248, 253, 0.86)),
    radial-gradient(circle at 50% 0%, rgba(10, 132, 255, 0.11), transparent 42%) !important;
}

body[data-panel="studio"] .result-image-frame::before {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 0;
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(99, 115, 129, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(99, 115, 129, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(99, 115, 129, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(99, 115, 129, 0.06) 75%);
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
  opacity: 0.7;
  pointer-events: none;
}

body[data-panel="studio"] .result-image-frame img {
  z-index: 1;
}

body[data-panel="studio"] .result-image-frame.is-broken img,
body[data-panel="studio"] .result-image-frame img[data-load-state="broken"] {
  opacity: 0 !important;
  visibility: hidden !important;
}

body[data-panel="studio"] .result-image-error {
  inset: 14px !important;
  z-index: 3 !important;
  width: auto;
  min-width: min(360px, calc(100% - 28px));
  min-height: min(260px, calc(100% - 28px));
  margin: auto;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(10, 132, 255, 0.13), transparent 44%),
    rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 24px 70px rgba(38, 56, 77, 0.14);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

body[data-panel="studio"] .result-image-frame.is-broken .result-image-error {
  display: grid !important;
}

body[data-panel="studio"] .result-image-error button {
  min-width: 92px;
  color: #0b1220 !important;
  background: rgba(255, 255, 255, 0.86) !important;
}

body[data-panel="studio"] .result-image-error button:first-child {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(180deg, #2a8fff, #0068eb) !important;
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.22);
}

.original-viewer {
  background:
    radial-gradient(circle at 18% 12%, rgba(10, 132, 255, 0.26), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(52, 199, 89, 0.16), transparent 28%),
    rgba(10, 12, 16, 0.84) !important;
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
}

.original-viewer-shell {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(12, 15, 20, 0.76) !important;
  -webkit-backdrop-filter: saturate(160%) blur(26px);
  backdrop-filter: saturate(160%) blur(26px);
}

.original-viewer-body {
  position: relative;
  display: grid;
  place-items: center;
}

.original-viewer-body img {
  position: relative;
  z-index: 1;
  max-width: none;
  max-height: none;
}

.original-viewer.is-loading .original-viewer-body img,
.original-viewer.is-broken .original-viewer-body img {
  opacity: 0;
  visibility: hidden;
}

.original-viewer-status {
  position: absolute;
  inset: auto;
  z-index: 2;
  display: none;
  width: min(420px, calc(100% - 36px));
  padding: 22px;
  justify-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.original-viewer.is-loading .original-viewer-loading,
.original-viewer.is-broken .original-viewer-error {
  display: grid;
}

.original-viewer-status strong {
  color: #fff;
  font-size: 18px;
  font-weight: 780;
}

.original-viewer-status span {
  max-width: 330px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.6;
}

.original-viewer-status div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.original-viewer-status button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.original-viewer-status button:first-child {
  border-color: transparent;
  background: linear-gradient(180deg, #2a8fff, #0068eb);
  box-shadow: 0 14px 30px rgba(10, 132, 255, 0.30);
}

@media (max-width: 760px) {
  .studio-shell {
    overflow-x: hidden !important;
  }

  .studio-rail {
    max-width: calc(100vw - 16px) !important;
    overflow: hidden !important;
  }

  .rail-nav {
    display: flex !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .rail-nav::-webkit-scrollbar {
    display: none;
  }

  .rail-nav .rail-action {
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    padding: 8px !important;
    justify-content: center !important;
  }

  .rail-nav .rail-copy {
    display: none !important;
  }

  body[data-panel="studio"] .result-image-error {
    inset: 10px !important;
    min-width: 0;
    min-height: 210px;
    padding: 18px !important;
  }

  .original-viewer {
    padding: 10px !important;
  }

  .original-viewer-shell {
    height: calc(100vh - 20px) !important;
    border-radius: 20px !important;
  }

  .original-viewer-status {
    width: min(360px, calc(100% - 24px));
    padding: 18px;
  }

  body[data-panel="developers"] pre {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
  }

  body[data-panel="developers"] pre code {
    display: inline-block !important;
    min-width: max-content !important;
    white-space: pre !important;
  }

  body[data-panel="prompts"] .library-tags,
  body[data-panel="prompts"] .library-filter-row,
  body[data-panel="prompts"] .community-card-metrics {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  body[data-panel="prompts"] .library-tags::-webkit-scrollbar,
  body[data-panel="prompts"] .library-filter-row::-webkit-scrollbar,
  body[data-panel="prompts"] .community-card-metrics::-webkit-scrollbar {
    display: none;
  }
}

/* 2026-06-16 desktop polish pass: denser glass work surfaces. */
@media (min-width: 1181px) {
  body[data-panel="prompts"] .workspace-content,
  body[data-panel="agent"] .workspace-content,
  body[data-panel="developers"] .workspace-content,
  body[data-panel="settings"] .workspace-content {
    padding: 14px 20px 20px !important;
  }

  body[data-panel="prompts"] .feature-panel,
  body[data-panel="developers"] .feature-panel,
  body[data-panel="settings"] .feature-panel {
    border-radius: 22px !important;
  }

  body[data-panel="prompts"] .feature-head,
  body[data-panel="developers"] .feature-head,
  body[data-panel="settings"] .feature-head {
    padding: 16px 20px 12px !important;
  }

  body[data-panel="prompts"] .feature-head h2,
  body[data-panel="developers"] .feature-head h2,
  body[data-panel="settings"] .feature-head h2 {
    font-size: 30px !important;
    line-height: 1.08 !important;
  }

  body[data-panel="prompts"] .community-explainer {
    padding: 12px 20px 0 !important;
  }

  body[data-panel="prompts"] .community-explainer div {
    min-height: 78px !important;
    padding: 14px !important;
  }

  body[data-panel="prompts"] .library-tags {
    padding: 12px 20px 0 !important;
  }

  body[data-panel="prompts"] .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)) !important;
    gap: 12px !important;
    padding: 14px 20px 20px !important;
  }

  body[data-panel="prompts"] .community-card {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  body[data-panel="prompts"] .community-cover {
    min-height: 132px !important;
    aspect-ratio: 16 / 10 !important;
  }

  body[data-panel="prompts"] .community-cover img {
    object-fit: cover !important;
  }

  body[data-panel="prompts"] .community-card > div:not(.library-card-actions) {
    gap: 6px !important;
    padding: 10px 12px !important;
  }

  body[data-panel="prompts"] .community-card h3 {
    min-height: 38px !important;
    font-size: 14px !important;
    line-height: 1.28 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  body[data-panel="prompts"] .community-card p {
    font-size: 12px !important;
    line-height: 1.42 !important;
    -webkit-line-clamp: 2 !important;
  }

  body[data-panel="prompts"] .community-feedback-question {
    display: none !important;
  }

  body[data-panel="prompts"] .community-card-metrics.secondary {
    display: none !important;
  }

  body[data-panel="prompts"] .community-card-actions {
    padding: 0 12px 12px !important;
  }

  body[data-panel="prompts"] .community-card-actions button {
    min-height: 30px !important;
    padding-inline: 10px !important;
    font-size: 11.5px !important;
  }

  body[data-panel="agent"] .feature-panel.agent-panel {
    display: grid !important;
    grid-template-columns: 320px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    gap: 12px !important;
    min-height: calc(100vh - 128px) !important;
    height: calc(100vh - 128px) !important;
    padding: 12px !important;
    overflow: hidden !important;
    border-radius: 22px !important;
  }

  body[data-panel="agent"] .agent-sidebar {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body[data-panel="agent"] .agent-conversation-list {
    max-height: calc(100vh - 300px) !important;
    overflow: auto !important;
  }

  body[data-panel="agent"] .agent-messages {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: auto !important;
    border-radius: 20px !important;
  }

  body[data-panel="agent"] .agent-composer {
    grid-column: 2 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    padding: 10px !important;
    border-radius: 20px !important;
  }

  body[data-panel="agent"] .agent-composer textarea {
    min-height: 76px !important;
    height: 76px !important;
  }

  body[data-panel="agent"] .agent-empty {
    width: min(440px, 72%) !important;
    padding: 22px !important;
  }

  body[data-panel="developers"] .api-docs-layout {
    grid-template-columns: 340px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    padding: 14px 20px 20px !important;
  }

  body[data-panel="developers"] .api-key-panel {
    position: sticky !important;
    top: 12px !important;
    min-height: 420px !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }

  body[data-panel="developers"] .api-doc-block {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  body[data-panel="developers"] pre {
    max-height: 224px !important;
    overflow: auto !important;
    border-radius: 14px !important;
  }

  body[data-panel="developers"] code {
    font-size: 12px !important;
    line-height: 1.52 !important;
  }
}

/* 2026-06-16 cross-panel workspace alignment repair. Keep rail navigation on the original style. */
body[data-panel="prompts"],
body[data-panel="agent"],
body[data-panel="developers"],
body[data-panel="settings"],
body[data-panel="admin"] {
  --panel-bg: #f8fafc;
  --panel-border: #dbe7ef;
  --panel-border-strong: #b8d1df;
  --panel-ink: #0f172a;
  --panel-muted: #64748b;
  --panel-blue: #0e7490;
  --panel-blue-soft: #ecfeff;
  color: var(--panel-ink) !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(14, 116, 144, 0.10), transparent 30%),
    radial-gradient(circle at 82% 6%, rgba(245, 158, 11, 0.09), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f4f7fb 100%) !important;
}

body[data-panel="prompts"] .workspace,
body[data-panel="agent"] .workspace,
body[data-panel="developers"] .workspace,
body[data-panel="settings"] .workspace,
body[data-panel="admin"] .workspace {
  border-color: rgba(148, 163, 184, 0.28) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(16px);
}

body[data-panel="prompts"] .workspace::before,
body[data-panel="agent"] .workspace::before,
body[data-panel="developers"] .workspace::before,
body[data-panel="settings"] .workspace::before,
body[data-panel="admin"] .workspace::before {
  display: none !important;
}

body[data-panel="prompts"] .workspace-header,
body[data-panel="agent"] .workspace-header,
body[data-panel="developers"] .workspace-header,
body[data-panel="settings"] .workspace-header,
body[data-panel="admin"] .workspace-header {
  min-height: 58px !important;
  padding: 10px 16px !important;
  border-bottom-color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.82) !important;
}

body[data-panel="prompts"] .workspace-title h1,
body[data-panel="agent"] .workspace-title h1,
body[data-panel="developers"] .workspace-title h1,
body[data-panel="settings"] .workspace-title h1,
body[data-panel="admin"] .workspace-title h1 {
  color: var(--panel-ink) !important;
  font-size: 21px !important;
  line-height: 1.2 !important;
  font-weight: 860 !important;
  letter-spacing: 0 !important;
}

body[data-panel="prompts"] .workspace-content,
body[data-panel="agent"] .workspace-content,
body[data-panel="developers"] .workspace-content,
body[data-panel="settings"] .workspace-content {
  height: calc(100vh - 82px) !important;
  padding: 14px 16px 16px !important;
  overflow: auto !important;
  background: var(--panel-bg) !important;
}

body[data-panel="prompts"] .feature-panel,
body[data-panel="agent"] .feature-panel,
body[data-panel="developers"] .feature-panel,
body[data-panel="settings"] .feature-panel {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body[data-panel="prompts"] .feature-head,
body[data-panel="agent"] .feature-head,
body[data-panel="developers"] .feature-head,
body[data-panel="settings"] .feature-head {
  gap: 14px !important;
  min-height: 74px !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--panel-border) !important;
  background: rgba(255, 255, 255, 0.88) !important;
}

body[data-panel="prompts"] .feature-head h2,
body[data-panel="agent"] .feature-head h2,
body[data-panel="developers"] .feature-head h2,
body[data-panel="settings"] .feature-head h2 {
  margin: 5px 0 3px !important;
  color: var(--panel-ink) !important;
  font-size: 24px !important;
  line-height: 1.12 !important;
  font-weight: 860 !important;
  letter-spacing: 0 !important;
}

body[data-panel="prompts"] .feature-head p,
body[data-panel="agent"] .feature-head p,
body[data-panel="developers"] .feature-head p,
body[data-panel="settings"] .feature-head p {
  max-width: 68ch !important;
  color: var(--panel-muted) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

body[data-panel="prompts"] .feature-kicker,
body[data-panel="agent"] .feature-kicker,
body[data-panel="developers"] .feature-kicker,
body[data-panel="settings"] .feature-kicker {
  min-height: 24px !important;
  padding: 4px 8px !important;
  border: 1px solid #c7e7ef !important;
  border-radius: 999px !important;
  color: var(--panel-blue) !important;
  background: var(--panel-blue-soft) !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

body[data-panel="prompts"] .feature-head-actions,
body[data-panel="agent"] .agent-head-actions,
body[data-panel="developers"] .api-doc-actions,
body[data-panel="settings"] .settings-actions {
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body[data-panel="prompts"] .community-explainer div,
body[data-panel="developers"] .api-doc-block,
body[data-panel="developers"] .api-key-panel,
body[data-panel="settings"] .settings-grid article,
body[data-panel="agent"] .agent-sidebar,
body[data-panel="agent"] .agent-messages,
body[data-panel="agent"] .agent-composer,
body[data-panel="agent"] .agent-empty,
body[data-panel="agent"] .agent-conversation,
body[data-panel="agent"] .agent-selects select {
  border-color: var(--panel-border) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body[data-panel="prompts"] .library-tags {
  padding: 12px 16px 0 !important;
}

body[data-panel="prompts"] .library-grid {
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)) !important;
  gap: 12px !important;
  padding: 14px 16px 16px !important;
}

body[data-panel="prompts"] .community-card,
body[data-panel="prompts"] .library-card {
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-panel="developers"] .api-docs-layout {
  gap: 12px !important;
  padding: 14px 16px 16px !important;
}

body[data-panel="settings"] .settings-grid {
  gap: 12px !important;
  padding: 14px 16px 0 !important;
}

body[data-panel="settings"] .settings-actions {
  padding: 14px 16px 16px !important;
}

body[data-panel="agent"] .feature-panel.agent-panel {
  display: grid !important;
  grid-template-columns: 300px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 12px !important;
  height: calc(100vh - 112px) !important;
  min-height: 560px !important;
  padding: 12px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

body[data-panel="agent"] .agent-sidebar {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
}

body[data-panel="agent"] .agent-sidebar-head {
  min-height: 58px !important;
  padding: 12px !important;
  border-bottom: 1px solid var(--panel-border) !important;
}

body[data-panel="agent"] .agent-sidebar-head strong {
  color: var(--panel-ink) !important;
  font-size: 14px !important;
}

body[data-panel="agent"] .agent-sidebar-head span {
  color: var(--panel-muted) !important;
}

body[data-panel="agent"] .agent-conversation-list {
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
  padding: 10px !important;
}

body[data-panel="agent"] .agent-conversation {
  margin: 0 0 8px !important;
  padding: 11px !important;
  border-radius: 12px !important;
}

body[data-panel="agent"] .agent-conversation.active {
  border-color: #0f172a !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0f172a 0%, #164e63 100%) !important;
}

body[data-panel="agent"] .agent-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body[data-panel="agent"] .agent-head {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-items: flex-start !important;
  min-height: auto !important;
  padding: 12px 14px !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
}

body[data-panel="agent"] .agent-controls {
  display: grid !important;
  justify-items: stretch !important;
  width: min(420px, 100%) !important;
  min-width: 0 !important;
  gap: 8px !important;
}

body[data-panel="agent"] .agent-selects {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 120px) !important;
  gap: 8px !important;
}

body[data-panel="agent"] .agent-selects select {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 10px !important;
  color: var(--panel-ink) !important;
}

body[data-panel="agent"] .agent-head-actions button {
  min-height: 36px !important;
  border-radius: 10px !important;
}

body[data-panel="agent"] .agent-messages {
  grid-column: 1 !important;
  grid-row: 2 !important;
  width: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 12px 0 !important;
  overflow: auto !important;
  padding: 16px !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
}

body[data-panel="agent"] .agent-empty {
  width: min(440px, 82%) !important;
  max-width: none !important;
  padding: 22px !important;
  border-radius: 12px !important;
}

body[data-panel="agent"] .agent-message {
  border-radius: 14px !important;
}

body[data-panel="agent"] .agent-message.user {
  border-color: #0f172a !important;
  color: #ffffff !important;
  background: #0f172a !important;
}

body[data-panel="agent"] .agent-attachments {
  grid-column: 1 !important;
  grid-row: 3 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

body[data-panel="agent"] .agent-attachments:empty {
  display: none !important;
}

body[data-panel="agent"] .agent-composer {
  display: grid !important;
  grid-column: 1 !important;
  grid-row: 4 !important;
  grid-template-columns: 42px minmax(0, 1fr) 84px !important;
  grid-template-rows: auto !important;
  align-items: end !important;
  gap: 10px !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
}

body[data-panel="agent"] .agent-composer textarea {
  min-height: 74px !important;
  height: 74px !important;
  max-height: 120px !important;
  padding: 10px 12px !important;
  border-color: var(--panel-border) !important;
  border-radius: 10px !important;
  color: var(--panel-ink) !important;
  background: #ffffff !important;
  resize: vertical !important;
}

body[data-panel="agent"] .agent-composer button {
  min-width: 0 !important;
  min-height: 42px !important;
  border-radius: 10px !important;
}

body[data-panel="agent"] .agent-attach-button {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
}

body[data-panel="admin"] #adminConsolePanel {
  margin: 14px 16px 16px !important;
}

body[data-panel="admin"] .admin-console-panel {
  min-height: calc(100vh - 112px) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

body[data-panel="admin"] .admin-console-sidebar {
  border-right: 1px solid var(--panel-border) !important;
  color: var(--panel-ink) !important;
  background: #f8fafc !important;
}

body[data-panel="admin"] .admin-console-sidebar-head h2,
body[data-panel="admin"] .admin-console-nav button {
  color: var(--panel-ink) !important;
}

body[data-panel="admin"] .admin-console-sidebar-head p,
body[data-panel="admin"] .admin-console-nav button small {
  color: var(--panel-muted) !important;
}

body[data-panel="admin"] .admin-console-nav button.active {
  border-color: #0f172a !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0f172a 0%, #164e63 100%) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14) !important;
}

body[data-panel="admin"] .admin-console-nav button.active small {
  color: rgba(255, 255, 255, 0.72) !important;
}

body[data-panel="admin"] .admin-console-main {
  background: #f8fafc !important;
}

body[data-panel="admin"] .admin-console-topbar,
body[data-panel="admin"] .admin-surface,
body[data-panel="admin"] .admin-list-surface,
body[data-panel="admin"] .admin-overview-grid article {
  border-color: var(--panel-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

@media (min-width: 1181px) {
  body[data-panel="developers"] .api-docs-layout {
    grid-template-columns: 320px minmax(0, 1fr) !important;
  }

  body[data-panel="developers"] .api-key-panel {
    position: sticky !important;
    top: 0 !important;
  }
}

@media (max-width: 1180px) {
  body[data-panel="prompts"] .workspace-content,
  body[data-panel="agent"] .workspace-content,
  body[data-panel="developers"] .workspace-content,
  body[data-panel="settings"] .workspace-content {
    height: auto !important;
    min-height: calc(100vh - 86px) !important;
    padding: 10px !important;
  }

  body[data-panel="agent"] .feature-panel.agent-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    height: auto !important;
    min-height: calc(100vh - 110px) !important;
  }

  body[data-panel="agent"] .agent-sidebar {
    max-height: 230px !important;
  }

  body[data-panel="agent"] .agent-head {
    display: grid !important;
  }

  body[data-panel="agent"] .agent-controls {
    width: 100% !important;
  }

  body[data-panel="developers"] .api-docs-layout,
  body[data-panel="settings"] .settings-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="admin"] .admin-console-panel {
    grid-template-columns: 1fr !important;
    min-height: calc(100vh - 104px) !important;
  }

  body[data-panel="admin"] .admin-console-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid var(--panel-border) !important;
  }

  body[data-panel="admin"] .admin-console-nav {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-panel="prompts"] .feature-head,
  body[data-panel="agent"] .feature-head,
  body[data-panel="developers"] .feature-head,
  body[data-panel="settings"] .feature-head {
    display: grid !important;
    padding: 12px !important;
  }

  body[data-panel="prompts"] .feature-head h2,
  body[data-panel="agent"] .feature-head h2,
  body[data-panel="developers"] .feature-head h2,
  body[data-panel="settings"] .feature-head h2 {
    font-size: 21px !important;
  }

  body[data-panel="prompts"] .library-grid {
    grid-template-columns: 1fr !important;
    padding: 12px !important;
  }

  body[data-panel="agent"] .feature-panel.agent-panel {
    gap: 10px !important;
    min-height: 0 !important;
    padding: 10px !important;
  }

  body[data-panel="agent"] .agent-sidebar {
    max-height: 210px !important;
  }

  body[data-panel="agent"] .agent-selects {
    grid-template-columns: 1fr !important;
  }

  body[data-panel="agent"] .agent-head-actions {
    justify-content: stretch !important;
  }

  body[data-panel="agent"] .agent-head-actions button {
    flex: 1 1 0 !important;
  }

  body[data-panel="agent"] .agent-messages {
    min-height: 360px !important;
    padding: 12px !important;
  }

  body[data-panel="agent"] .agent-composer {
    grid-template-columns: 42px minmax(0, 1fr) !important;
  }

  body[data-panel="agent"] .agent-composer button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

/* 2026-06-16 visibility repair: keep the image studio rail/workspace visible if panel intro animations stall. */
body[data-panel="studio"] .studio-rail,
body[data-panel="studio"] .history-panel,
body[data-panel="studio"] .workspace {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* 2026-06-16 unified Youyu rail: keep the left navigation visually identical on every tab. */
.studio-rail {
  width: 224px !important;
  padding: 12px !important;
  border: 1px solid rgba(72, 84, 104, 0.16) !important;
  border-radius: 20px !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 22px 60px rgba(42, 54, 71, 0.12) !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}

.rail-top {
  gap: 8px !important;
  min-height: 44px !important;
}

.rail-logo {
  width: 40px !important;
  height: 40px !important;
  border: 1px solid rgba(148, 163, 184, 0.30) !important;
  border-radius: 14px !important;
  color: #334155 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.rail-logo img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
}

.rail-brand {
  padding: 4px 2px !important;
  color: inherit !important;
}

.rail-brand strong {
  color: #111827 !important;
  font-size: 13px !important;
  line-height: 1.12 !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
}

.rail-brand span {
  margin-top: 3px !important;
  color: #748196 !important;
  font-size: 11px !important;
  line-height: 1.24 !important;
}

.rail-collapse {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(148, 163, 184, 0.30) !important;
  border-radius: 12px !important;
  color: #334155 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.rail-nav {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
  margin-top: 6px !important;
}

.rail-action {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  color: #344054 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
  transform: none !important;
}

.rail-action:hover,
.rail-action:focus-visible {
  color: #111827 !important;
  background: rgba(255, 255, 255, 0.78) !important;
  transform: none !important;
}

.rail-action.rail-active,
.rail-action.active {
  color: #ffffff !important;
  background: rgba(17, 24, 39, 0.94) !important;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.20) !important;
}

.rail-icon {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(148, 163, 184, 0.30) !important;
  border-radius: 12px !important;
  color: #667085 !important;
  background: #eef3f7 !important;
  box-shadow: none !important;
}

.rail-action.rail-active .rail-icon,
.rail-action.active .rail-icon {
  color: #111827 !important;
  background: #d8f5ef !important;
  border-color: rgba(216, 245, 239, 0.72) !important;
}

.rail-copy strong {
  color: inherit !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  font-weight: 820 !important;
  letter-spacing: 0 !important;
}

.rail-copy small {
  margin-top: 2px !important;
  color: #748196 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

.rail-action.rail-active .rail-copy small,
.rail-action.active .rail-copy small {
  color: rgba(255, 255, 255, 0.68) !important;
}

.rail-wallet,
.rail-account {
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: #344054 !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: none !important;
}

.rail-wallet {
  border-radius: 16px !important;
}

.rail-wallet span {
  color: #667085 !important;
}

.rail-wallet strong {
  color: #34c759 !important;
}

.rail-account {
  border-radius: 16px !important;
}

.rail-collapsed .studio-rail {
  align-items: center !important;
  width: auto !important;
  padding: 12px 10px !important;
}

.rail-collapsed .rail-top {
  flex-direction: column !important;
}

.rail-collapsed .rail-brand,
.rail-collapsed .rail-copy,
.rail-collapsed .rail-wallet span,
.rail-collapsed .rail-wallet strong,
.rail-collapsed .rail-account span {
  display: none !important;
}

.rail-collapsed .rail-action {
  justify-content: center !important;
  width: 56px !important;
  min-height: 56px !important;
  padding: 10px !important;
}

.rail-collapsed .rail-wallet,
.rail-collapsed .rail-account {
  display: grid !important;
  place-items: center !important;
  width: 56px !important;
  min-height: 48px !important;
  padding: 0 !important;
}

@media (min-width: 761px) {
  body[data-panel] .studio-shell {
    gap: 10px !important;
    padding: 8px !important;
  }

  body[data-panel="prompts"] .studio-shell,
  body[data-panel="agent"] .studio-shell,
  body[data-panel="developers"] .studio-shell,
  body[data-panel="settings"] .studio-shell,
  body[data-panel="admin"] .studio-shell {
    grid-template-columns: 224px minmax(0, 1fr) !important;
  }
}

body[data-panel] .studio-rail .rail-action:not(.rail-active):not(.active) {
  color: #344054 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body[data-panel] .studio-rail .rail-action.rail-active,
body[data-panel] .studio-rail .rail-action.active {
  color: #ffffff !important;
  background: rgba(17, 24, 39, 0.94) !important;
  background-color: rgba(17, 24, 39, 0.94) !important;
  background-image: none !important;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.20) !important;
}

body[data-panel] .studio-rail .rail-action.rail-active .rail-icon,
body[data-panel] .studio-rail .rail-action.active .rail-icon {
  color: #111827 !important;
  background: #d8f5ef !important;
  background-color: #d8f5ef !important;
  background-image: none !important;
  border-color: rgba(216, 245, 239, 0.72) !important;
}

body[data-panel] .studio-rail .rail-action.rail-active .rail-copy small,
body[data-panel] .studio-rail .rail-action.active .rail-copy small {
  color: rgba(255, 255, 255, 0.68) !important;
}

/* 2026-06-19 mobile responsive repair: override the unified rail without rewriting layout. */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body[data-panel] {
    overflow-x: hidden !important;
  }

  body[data-panel] .studio-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 100dvh !important;
    margin: 0 auto !important;
    padding: 8px !important;
    overflow-x: hidden !important;
  }

  body[data-panel] .studio-shell > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  body[data-panel] .studio-rail {
    position: sticky !important;
    top: 8px !important;
    z-index: 40 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-self: start !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: calc(100vw - 16px) !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px !important;
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  body[data-panel] .studio-rail .rail-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    min-height: 40px !important;
    gap: 8px !important;
  }

  body[data-panel] .studio-rail .rail-brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body[data-panel] .studio-rail .rail-collapse {
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }

  body[data-panel] .studio-rail .rail-bottom {
    display: none !important;
  }

  body[data-panel] .studio-rail .rail-nav {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 2px 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  body[data-panel] .studio-rail .rail-nav::-webkit-scrollbar {
    display: none;
  }

  body[data-panel] .studio-rail .rail-nav .rail-action {
    flex: 0 0 52px !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    min-height: 52px !important;
    padding: 8px !important;
    text-align: center !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy {
    display: none !important;
  }

  body[data-panel] .workspace {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  body[data-panel] .workspace-header {
    position: static !important;
    top: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 12px !important;
  }

  body[data-panel] .workspace-title,
  body[data-panel] .workspace-account {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-panel] .workspace-title h1,
  body[data-panel] .workspace-account > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body[data-panel="prompts"] .workspace-content,
  body[data-panel="agent"] .workspace-content,
  body[data-panel="developers"] .workspace-content,
  body[data-panel="settings"] .workspace-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px !important;
    overflow: visible !important;
  }

  body[data-panel="studio"] .workspace-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    scrollbar-gutter: auto !important;
  }

  body[data-panel="studio"] .intro-panel,
  body[data-panel="studio"] .result-thread {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    overflow: hidden !important;
  }

  body[data-panel="studio"] .prompt-tools,
  body[data-panel="studio"].history-opened .prompt-tools,
  body[data-panel="studio"]:not(.history-opened) .prompt-tools {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  body[data-panel="studio"] .prompt-card,
  body[data-panel="studio"].history-opened .prompt-card,
  body[data-panel="studio"]:not(.history-opened) .prompt-card {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 94px !important;
    transform: none !important;
    scroll-snap-align: none !important;
  }

  body[data-panel="studio"] .prompt-card:hover,
  body[data-panel="studio"].history-opened .prompt-card:hover,
  body[data-panel="studio"]:not(.history-opened) .prompt-card:hover {
    transform: none !important;
  }

  body[data-panel="studio"] .prompt-card span,
  body[data-panel="studio"] .prompt-card strong,
  body[data-panel="studio"] .prompt-card p {
    max-width: 100% !important;
  }

  body[data-panel="studio"] .composer-card {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 8px 0 0 !important;
    overflow: hidden !important;
    transform: none !important;
  }

  body[data-panel="studio"] .composer-toolbar,
  body[data-panel="studio"] .composer-footer,
  body[data-panel="studio"] .toolbar-top-row,
  body[data-panel="studio"] .toolbar-bottom-row {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body[data-panel="prompts"] .feature-panel,
  body[data-panel="prompts"] .library-grid,
  body[data-panel="prompts"] .library-card,
  body[data-panel="prompts"] .community-card {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body[data-panel="prompts"] .library-tags {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  body[data-panel="prompts"] .library-tags > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body[data-panel="prompts"] .library-filter-row,
  body[data-panel="prompts"] .community-filter-summary {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body[data-panel="prompts"] .library-tags button,
  body[data-panel="prompts"] .library-filter-row button,
  body[data-panel="prompts"] .community-filter-summary button {
    flex: 0 1 auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}


/* 2026-06-19 mobile rail one-line tightening */
@media (max-width: 760px) {
  body[data-panel] .studio-rail {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 0 !important;
    padding: 8px !important;
  }

  body[data-panel] .studio-rail .rail-top {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    gap: 0 !important;
  }

  body[data-panel] .studio-rail .rail-logo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }

  body[data-panel] .studio-rail .rail-brand,
  body[data-panel] .studio-rail .rail-collapse,
  body[data-panel] .studio-rail .rail-bottom {
    display: none !important;
  }

  body[data-panel] .studio-rail .rail-nav {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 48px !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 2px !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-action {
    flex: 0 0 46px !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    min-height: 46px !important;
    height: 46px !important;
    padding: 7px !important;
    border-radius: 14px !important;
  }

  body[data-panel] .studio-rail .rail-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 11px !important;
  }
}


/* 2026-06-19 mobile rail labels */
@media (max-width: 760px) {
  body[data-panel] .studio-rail {
    height: auto !important;
    padding: 8px !important;
  }

  body[data-panel] .studio-rail .rail-nav {
    height: 62px !important;
    gap: 8px !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-action {
    flex: 0 0 68px !important;
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 6px 6px 5px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    border-radius: 16px !important;
  }

  body[data-panel] .studio-rail .rail-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: center !important;
    line-height: 1 !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy small {
    display: none !important;
  }
}


/* 2026-06-19 mobile rail labels compact fit */
@media (max-width: 760px) {
  body[data-panel] .studio-rail {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 8px !important;
  }

  body[data-panel] .studio-rail .rail-top,
  body[data-panel] .studio-rail .rail-brand,
  body[data-panel] .studio-rail .rail-collapse,
  body[data-panel] .studio-rail .rail-bottom {
    display: none !important;
  }

  body[data-panel] .studio-rail .rail-nav {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 58px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-action {
    flex: 0 0 54px !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 5px 4px 4px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    border-radius: 15px !important;
  }

  body[data-panel] .studio-rail .rail-icon {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    border-radius: 10px !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: center !important;
    line-height: 1 !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 9.5px !important;
    line-height: 1.05 !important;
    letter-spacing: -0.4px !important;
    font-weight: 800 !important;
  }

  body[data-panel] .studio-rail .rail-nav .rail-copy small {
    display: none !important;
  }
}

@media (max-width: 370px) {
  body[data-panel] .studio-rail .rail-nav {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    scrollbar-width: none;
  }

  body[data-panel] .studio-rail .rail-nav::-webkit-scrollbar {
    display: none;
  }
}


/* 2026-06-19 mobile non-studio header cleanup */
@media (max-width: 760px) {
  body[data-panel="prompts"] .workspace-header,
  body[data-panel="agent"] .workspace-header,
  body[data-panel="developers"] .workspace-header,
  body[data-panel="settings"] .workspace-header,
  body[data-panel="admin"] .workspace-header {
    display: none !important;
  }

  body[data-panel="prompts"] .workspace,
  body[data-panel="agent"] .workspace,
  body[data-panel="developers"] .workspace,
  body[data-panel="settings"] .workspace,
  body[data-panel="admin"] .workspace {
    display: block !important;
    min-height: 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: saturate(180%) blur(18px) !important;
  }

  body[data-panel="prompts"] .workspace-content,
  body[data-panel="agent"] .workspace-content,
  body[data-panel="developers"] .workspace-content,
  body[data-panel="settings"] .workspace-content,
  body[data-panel="admin"] .workspace-content {
    padding: 10px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-panel="prompts"] .feature-panel,
  body[data-panel="agent"] .feature-panel,
  body[data-panel="developers"] .feature-panel,
  body[data-panel="settings"] .feature-panel,
  body[data-panel="admin"] .feature-panel {
    margin: 0 !important;
    border-radius: 18px !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: none !important;
  }

  body[data-panel="prompts"] .feature-head,
  body[data-panel="agent"] .feature-head,
  body[data-panel="developers"] .feature-head,
  body[data-panel="settings"] .feature-head,
  body[data-panel="admin"] .feature-head {
    padding: 16px !important;
    gap: 12px !important;
  }

  body[data-panel="prompts"] .feature-head h2,
  body[data-panel="agent"] .feature-head h2,
  body[data-panel="developers"] .feature-head h2,
  body[data-panel="settings"] .feature-head h2,
  body[data-panel="admin"] .feature-head h2 {
    font-size: 24px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
  }
}


/* 2026-06-19 non-studio workspace header cleanup */
body[data-panel="prompts"] .workspace-header,
body[data-panel="agent"] .workspace-header,
body[data-panel="developers"] .workspace-header,
body[data-panel="settings"] .workspace-header,
body[data-panel="admin"] .workspace-header {
  display: none !important;
}

body[data-panel="prompts"] .workspace,
body[data-panel="agent"] .workspace,
body[data-panel="developers"] .workspace,
body[data-panel="settings"] .workspace,
body[data-panel="admin"] .workspace {
  grid-template-rows: minmax(0, 1fr) !important;
}

body[data-panel="prompts"] .workspace-content,
body[data-panel="agent"] .workspace-content,
body[data-panel="developers"] .workspace-content,
body[data-panel="settings"] .workspace-content {
  height: calc(100vh - 36px) !important;
  padding-top: 18px !important;
}

body[data-panel="prompts"] .feature-panel,
body[data-panel="agent"] .feature-panel,
body[data-panel="developers"] .feature-panel,
body[data-panel="settings"] .feature-panel {
  margin-top: 0 !important;
}

body[data-panel="agent"] .agent-panel {
  min-height: calc(100vh - 72px) !important;
}
