.create-workbench-summary {
  margin: 13px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.create-workbench-submit {
  min-width: 184px;
  min-height: 48px;
  flex-direction: column;
  gap: 2px;
}

.create-workbench-submit span {
  font-size: 11px;
  opacity: 0.78;
}

.create-workbench-prompt-card {
  padding: 20px;
}

.create-workbench-studio {
  display: grid;
  gap: 16px;
}

.create-workbench-studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.create-workbench-studio-head h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.18;
  font-weight: 980;
}

.create-workbench-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.create-workbench-composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: 12px;
  align-items: stretch;
}

.create-workbench-page.is-image-mode .create-workbench-composer-grid {
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
}

.create-workbench-reference-pane-primary .create-workbench-upload-empty {
  min-height: 260px;
}

.create-workbench-prompt-pane,
.create-workbench-reference-pane {
  min-width: 0;
}

.create-workbench-pane-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 950;
}

.create-workbench-pane-head .button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.create-workbench-prompt-head {
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.create-workbench-prompt-head .button {
  flex: 0 0 auto;
}

.create-workbench-mode-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 36%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 900;
}

.create-workbench-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.65;
}

.create-workbench-textarea:focus {
  border-color: color-mix(in srgb, var(--brand) 62%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 17%, transparent);
}

.create-workbench-prompt-meta {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.create-workbench-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-strong) 52%, transparent);
}

.create-workbench-submit-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.create-workbench-submit-copy strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 950;
}

.create-workbench-submit-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.create-workbench-results-card {
  padding: 18px;
}

.create-workbench-results-head {
  margin-bottom: 12px;
}

.create-workbench-results-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.create-workbench-collapse-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.create-workbench-collapse-button:hover,
.create-workbench-collapse-button:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
}

.create-workbench-collapse-button .icon {
  width: 17px;
  height: 17px;
}

.create-workbench-collapse-button.collapsed .icon {
  transform: rotate(-90deg);
}

.create-workbench-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.create-workbench-results-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.create-workbench-results-grid .image-tile {
  min-height: 220px;
  border-radius: 14px;
}

.create-workbench-results-grid .tile-state--loading > div {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.create-workbench-result-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 920px) {
  .create-workbench-page {
    grid-template-columns: 1fr;
  }

  .create-workbench-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .create-workbench-composer-grid {
    grid-template-columns: 1fr;
  }

  .create-workbench-page.is-image-mode .create-workbench-composer-grid {
    grid-template-columns: 1fr;
  }

  .create-workbench-upload-empty {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .create-workbench-page {
    gap: 12px;
  }

  .create-workbench-side {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .create-workbench-card,
  .create-workbench-prompt-card,
  .create-workbench-results-card {
    padding: 13px;
    border-radius: 14px;
  }

  .create-workbench-card-head h2,
  .create-workbench-results-head h2,
  .create-workbench-prompt-head h1 {
    font-size: 15px;
  }

  .create-workbench-ratios {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .create-workbench-ratio {
    min-height: 34px;
    border-radius: 10px;
    font-size: 11px;
  }

  .create-workbench-style-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .create-workbench-style-grid button {
    min-height: 34px;
    font-size: 11px;
  }

  .create-workbench-prompt-head {
    align-items: center;
  }

  .create-workbench-prompt-head .button {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .create-workbench-textarea {
    min-height: 178px;
    font-size: 13px;
  }

  .create-workbench-studio-head,
  .create-workbench-submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .create-workbench-studio-head h1 {
    font-size: 22px;
  }

  .create-workbench-mode-pill {
    width: fit-content;
  }

  .create-workbench-submit {
    width: 100%;
  }

  .create-workbench-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .create-workbench-results-grid[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .create-workbench-results-grid .image-tile {
    min-height: 0;
    aspect-ratio: 1;
  }

  .create-workbench-result-actions .button {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 12px;
  }
}

/* Create page layout: keep the dark product theme, but match the reference
   workbench structure with a fixed parameter rail and a large result canvas. */
.page-create {
  width: min(1480px, calc(100% - 48px));
  padding-top: 24px;
}

.page-create + .page-footer {
  display: none;
}

.create-workbench-page {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 24px;
}

.create-workbench-side {
  gap: 16px;
}

.create-workbench-card,
.create-workbench-prompt-card,
.create-workbench-results-card {
  border-radius: 18px;
}

.create-workbench-card {
  padding: 24px;
}

.create-workbench-card-head {
  margin-bottom: 20px;
}

.create-workbench-card-head h2,
.create-workbench-results-head h2 {
  font-size: 18px;
}

.create-workbench-label {
  margin-top: 22px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.create-workbench-select {
  min-height: 52px;
  border-radius: 12px;
  font-size: 14px;
}

.create-workbench-ratios {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.create-workbench-ratio {
  min-height: 50px;
  border-radius: 11px;
  font-size: 12px;
}

.create-workbench-ratio .ratio-icon {
  display: block;
  color: currentColor;
}

.create-workbench-ratio .ratio-icon-auto {
  width: 22px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1.6px solid currentColor;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 950;
  line-height: 1;
}

.create-workbench-ratio .ratio-icon-auto .icon {
  width: 10px;
  height: 10px;
}

.create-workbench-upload {
  margin-top: 26px;
}

.create-workbench-upload-empty {
  min-height: 170px;
  aspect-ratio: 16 / 9;
}

.create-workbench-ref-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.create-workbench-ref {
  aspect-ratio: 1;
}

.create-workbench-change-image {
  min-height: 48px;
}

.create-workbench-strength {
  margin-top: 26px;
}

.create-workbench-strength-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 900;
}

.create-workbench-strength-head strong {
  min-width: 62px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  font-size: 14px;
}

.create-workbench-strength-track {
  position: relative;
  height: 8px;
  margin: 16px 76px 12px 0;
  overflow: visible;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-strong) 80%, transparent);
}

.create-workbench-strength-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 70%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #8b5cf6);
}

.create-workbench-strength-track span::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #8b5cf6;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.38);
  transform: translateY(-50%);
}

.create-workbench-strength p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.create-workbench-submit {
  width: 100%;
  min-height: 70px;
  margin-top: 18px;
  border-radius: 12px;
  font-size: 16px;
}

.create-workbench-main {
  gap: 0;
}

.create-workbench-prompt-card {
  padding: 28px 28px 0;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: none;
}

.create-workbench-composer-grid,
.create-workbench-page.is-image-mode .create-workbench-composer-grid {
  grid-template-columns: minmax(0, 1fr);
}

.create-workbench-reference-pane {
  display: none;
}

.create-workbench-pane-head {
  min-height: 30px;
  margin-bottom: 12px;
  font-size: 16px;
}

.create-workbench-pane-head .button {
  min-height: 40px;
  border-radius: 10px;
}

.create-workbench-prompt-input-box {
  position: relative;
}

.create-workbench-textarea {
  height: 112px;
  min-height: 112px;
  max-height: 112px;
  border-radius: 12px;
  font-size: 15px;
  resize: none;
}

.create-workbench-prompt-hint {
  left: 14px;
  right: 14px;
  top: 14px;
  color: color-mix(in srgb, var(--muted) 78%, var(--ink) 22%);
  font-size: 15px;
  font-weight: 760;
  line-height: 1.65;
}

.create-workbench-prompt-meta {
  margin-top: 10px;
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.create-workbench-prompt-meta .button {
  min-height: 40px;
  border-radius: 10px;
}

.create-workbench-mode-pill {
  width: fit-content;
  margin-left: auto;
}

.create-workbench-results-card {
  padding: 24px 28px 28px;
  border-top: 0;
  border-radius: 0 0 18px 18px;
}

.create-workbench-results-grid,
.create-workbench-results-grid[data-count="1"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  grid-auto-rows: minmax(0, 1fr);
}

.create-workbench-results-grid .image-tile {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.create-workbench-results-grid .image-tile img,
.create-workbench-results-grid .history-image-preview {
  width: 100%;
  height: 100%;
}

.create-workbench-results-grid .image-tile .tile-state {
  border: 0;
  background: transparent;
}

.create-workbench-result-actions {
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

.create-workbench-result-actions .button {
  min-width: 132px;
  min-height: 44px;
  border-radius: 12px;
}

@media (max-width: 920px) {
  .page-create {
    width: min(100% - 24px, 720px);
    padding-top: 14px;
  }

  .create-workbench-page {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .create-workbench-side {
    grid-template-columns: 1fr;
  }

  .create-workbench-card {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .create-workbench-results-grid,
  .create-workbench-results-grid[data-count="1"] {
    grid-template-columns: 1fr;
  }

  .create-workbench-prompt-card,
  .create-workbench-results-card {
    padding-inline: 14px;
  }

  .create-workbench-result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .create-workbench-result-actions .button {
    width: 100%;
  }
}

/* Create workspace layout inspired by the provided image editor reference. */
body[data-view="create"] {
  background: var(--bg);
}

body[data-view="create"] {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-view="create"] .app-shell {
  background: var(--shell-bg);
}

body[data-view="create"] .workspace {
  min-height: 100vh;
}

.create-chat-workbench {
  width: 100%;
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
  gap: 0;
  color: var(--ink);
  background: var(--page);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.create-chat-workbench.is-logged-out {
  --logged-out-band: rgba(255, 255, 255, 0.045);
  --logged-out-band-soft: rgba(139, 116, 255, 0.06);
  --logged-out-edge: rgba(7, 9, 22, 0.54);
  --logged-out-floor: rgba(7, 9, 22, 0.9);
  --logged-out-watermark: rgba(255, 255, 255, 0.09);
  grid-template-columns: minmax(0, 1fr);
  border-color: transparent;
  background:
    linear-gradient(145deg, rgba(122, 98, 255, 0.08) 0%, transparent 38%),
    linear-gradient(180deg, #10131f 0%, #070916 100%);
  box-shadow: none;
}

:root[data-theme="light"] .create-chat-workbench.is-logged-out {
  --logged-out-band: rgba(255, 255, 255, 0.72);
  --logged-out-band-soft: rgba(109, 93, 252, 0.075);
  --logged-out-edge: rgba(238, 242, 251, 0.58);
  --logged-out-floor: rgba(238, 242, 251, 0.88);
  --logged-out-watermark: rgba(76, 82, 110, 0.075);
  background:
    linear-gradient(145deg, rgba(109, 93, 252, 0.06) 0%, transparent 42%),
    linear-gradient(180deg, #fbfcff 0%, #edf1fa 100%);
}

body[data-view="create"] .create-chat-workbench.is-logged-out,
body[data-view="create"] .create-chat-workbench.is-logged-out .create-chat-main {
  overflow: hidden;
}

.create-chat-workbench.is-logged-out .create-chat-rail {
  display: none;
}

.create-chat-workbench.is-logged-out .create-chat-main {
  grid-column: 1 / -1;
  justify-content: flex-end;
  isolation: isolate;
  background: transparent;
}

:root[data-theme="light"] .create-chat-workbench.is-logged-out .create-chat-main {
  background: transparent;
}

.create-chat-workbench.is-logged-out .create-chat-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(148deg, transparent 0 16%, var(--logged-out-band) 16.2% 31%, transparent 31.2% 100%),
    linear-gradient(31deg, transparent 0 61%, var(--logged-out-band-soft) 61.2% 76%, transparent 76.2% 100%);
  pointer-events: none;
}

.create-chat-workbench.is-logged-out .create-chat-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, var(--logged-out-edge), transparent 24%, transparent 76%, var(--logged-out-edge)),
    linear-gradient(180deg, transparent 0%, transparent 42%, rgba(7, 9, 22, 0.38) 74%, var(--logged-out-floor) 100%);
  pointer-events: none;
}

:root[data-theme="light"] .create-chat-workbench.is-logged-out .create-chat-main::after {
  background:
    linear-gradient(90deg, var(--logged-out-edge), transparent 24%, transparent 76%, var(--logged-out-edge)),
    linear-gradient(180deg, transparent 0%, transparent 46%, rgba(238, 242, 251, 0.38) 74%, var(--logged-out-floor) 100%);
}

.create-logged-out-mark {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(70px, 13vh, 128px);
  color: var(--logged-out-watermark);
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.create-logged-out-mark strong {
  max-width: calc(100% - 48px);
  overflow: hidden;
  font-size: 88px;
  font-weight: 950;
  line-height: 0.96;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-logged-out-mark span {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.35;
  opacity: 0.72;
}

.create-chat-workbench.is-logged-out .create-stage {
  position: relative;
  z-index: 3;
}

.create-chat-workbench.is-logged-out .create-bottom-composer {
  z-index: 3;
}

@media (max-width: 760px) {
  .create-chat-workbench.is-logged-out .create-chat-main::before {
    background:
      linear-gradient(148deg, transparent 0 11%, var(--logged-out-band) 11.2% 28%, transparent 28.2% 100%),
      linear-gradient(31deg, transparent 0 60%, var(--logged-out-band-soft) 60.2% 78%, transparent 78.2% 100%);
  }

  .create-logged-out-mark {
    padding-top: clamp(62px, 13vh, 110px);
  }

  .create-logged-out-mark strong {
    max-width: calc(100% - 32px);
    font-size: 46px;
  }

  .create-logged-out-mark span {
    margin-top: 9px;
    font-size: 13px;
  }

  .create-chat-workbench.is-logged-out .create-chat-main::after {
    background:
      linear-gradient(90deg, var(--logged-out-edge), transparent 30%, transparent 70%, var(--logged-out-edge)),
      linear-gradient(180deg, transparent 0%, transparent 48%, rgba(7, 9, 22, 0.46) 82%, var(--logged-out-floor) 100%);
  }

  :root[data-theme="light"] .create-chat-workbench.is-logged-out .create-chat-main::after {
    background:
      linear-gradient(90deg, var(--logged-out-edge), transparent 30%, transparent 70%, var(--logged-out-edge)),
      linear-gradient(180deg, transparent 0%, transparent 50%, rgba(238, 242, 251, 0.5) 80%, var(--logged-out-floor) 100%);
  }
}

@media (max-width: 420px) {
  .create-logged-out-mark strong {
    font-size: 38px;
  }
}

.create-chat-rail {
  min-width: 0;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(17, 17, 17, 0.06);
  background: rgba(246, 242, 236, 0.78);
}

.create-chat-rail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  margin-bottom: 12px;
}

.create-chat-new,
.create-chat-trash {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(30, 27, 24, 0.06);
}

.create-chat-new {
  gap: 8px;
  color: #fff;
  background: #050505;
}

.create-chat-new .icon,
.create-chat-trash .icon {
  width: 15px;
  height: 15px;
}

.create-chat-trash {
  color: #222;
  background: #fff;
}

.create-chat-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 8px;
}

.create-chat-item {
  width: 100%;
  min-height: 58px;
  position: relative;
  display: block;
  padding: 9px 14px;
  border-left: 2px solid transparent;
  color: #111;
  background: transparent;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.create-chat-item.is-generating {
  min-height: 84px;
}

.create-chat-item-main {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  width: 100%;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
}

.create-chat-item.is-generating .create-chat-item-main {
  align-content: start;
}

.create-chat-item-actions {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 3px;
  border: 1px solid color-mix(in srgb, var(--brand, #8b6cff) 24%, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  opacity: 0;
  background: color-mix(in srgb, var(--panel-strong, #1b182e) 94%, #0f0d1c 6%);
  box-shadow: 0 4px 14px rgba(6, 5, 16, 0.42);
  backdrop-filter: blur(10px);
  transform: translate(6px, -50%);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.create-chat-item:not(.active):hover,
.create-chat-item:not(.active):focus-within {
  border-left-color: color-mix(in srgb, var(--brand) 38%, transparent);
  background: color-mix(in srgb, var(--panel-strong) 52%, transparent);
}

.create-chat-item:hover .create-chat-item-actions,
.create-chat-item:focus-within .create-chat-item-actions {
  opacity: 1;
  transform: translate(0, -50%);
  pointer-events: auto;
}

.create-chat-item-action {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.create-chat-item-action:hover {
  color: color-mix(in srgb, var(--brand) 78%, #fff 22%);
  background: rgba(255, 255, 255, 0.16);
}

.create-chat-item-action[data-action="delete-workbench-turn"]:hover {
  color: color-mix(in srgb, var(--danger) 88%, #fff 12%);
  background: rgba(255, 255, 255, 0.16);
}

.create-chat-item-action .icon {
  width: 15px;
  height: 15px;
}

.create-chat-item.active {
  border-left-color: #111;
  background: rgba(255, 255, 255, 0.45);
}

.create-chat-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-chat-title-input {
  width: min(100%, 182px);
  min-width: 0;
  padding: 0 2px 2px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 58%, var(--line));
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.create-chat-item.is-editing .create-chat-item-main {
  padding-right: 64px;
}

.create-chat-meta,
.create-chat-empty {
  color: #8d8a86;
  font-size: 12px;
  font-weight: 700;
}

.create-chat-progress-pill {
  width: fit-content;
  max-width: min(100%, 150px);
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  align-self: start;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, #ec4899 22%, transparent);
  border-radius: 999px;
  color: #db2777;
  background: color-mix(in srgb, #fff 78%, #fce7f3 22%);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-meta {
  min-width: 0;
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.work-card-meta > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card-meta b {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--ink) 76%, var(--muted));
  font-size: 10px;
  font-weight: 850;
}

.work-card-meta-val {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.works-manager-shell {
  position: relative;
  display: grid;
  gap: 16px;
}

.works-manager-filterbar,
.works-manager-actionbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.works-manager-filterbar {
  justify-content: flex-start;
  padding: 16px 0 12px;
}

.works-manager-actionbar {
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

.works-manager-actionbar .compact-status {
  flex: 1 1 260px;
  min-width: 0;
}

.works-manager-input,
.works-manager-date-trigger,
.works-manager-button,
.works-manager-query {
  min-height: 40px;
  border-radius: 12px;
  white-space: nowrap;
}

.works-manager-input {
  width: min(100%, 260px);
  padding: 0 20px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  color: var(--ink);
  background: color-mix(in srgb, #fff 86%, var(--panel) 14%);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  outline: 0;
}

.works-manager-date-field {
  position: relative;
  width: min(100%, 240px);
}

.works-manager-date-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #e7e5e4;
  color: #44403c;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.works-manager-date-trigger .icon {
  width: 16px;
  height: 16px;
  color: #a8a29e;
}

.works-manager-date-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.works-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: auto;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.works-date-popover::before {
  content: none;
  pointer-events: none;
}

.works-date-months,
.works-date-nav {
  position: relative;
  z-index: 1;
}

.works-date-months {
  display: grid;
  grid-template-columns: repeat(2, 252px);
  gap: 16px;
}

.works-date-month-title {
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  color: #292524;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.works-date-weekdays,
.works-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 36px);
  align-items: center;
  text-align: center;
}

.works-date-weekdays {
  margin: 8px 0 0;
  color: #a8a29e;
  font-size: 12px;
  font-weight: 400;
}

.works-date-grid {
  row-gap: 0;
}

.works-date-day {
  min-width: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  color: #292524;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.works-date-day:hover,
.works-date-day:focus-visible {
  background: #f5f5f4;
  outline: 0;
}

.works-date-day.is-outside {
  color: #d6d3d1;
}

.works-date-day.is-in-range {
  color: #fff;
  background: #0c0a09;
}

.works-date-day.is-start,
.works-date-day.is-end {
  color: #fff;
  background: #0c0a09;
}

.works-date-day.is-today:not(.is-start):not(.is-end):not(.is-in-range) {
  color: #0c0a09;
  font-weight: 700;
  box-shadow: none;
}

.works-date-nav {
  position: absolute;
  top: 22px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: #292524;
  background: transparent;
  cursor: pointer;
}

.works-date-nav:hover,
.works-date-nav:focus-visible {
  background: #f5f5f4;
  outline: 0;
}

.works-date-nav-prev {
  left: 18px;
}

.works-date-nav-next {
  right: 18px;
}

.works-date-nav .icon {
  width: 16px;
  height: 16px;
}

.works-manager-select {
  gap: 8px;
}

.works-manager-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, #ec4899 35%, var(--line));
  border-radius: 5px;
  background: color-mix(in srgb, #fff 86%, transparent);
}

.works-webdav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.32);
}

.works-webdav-dialog {
  width: min(720px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.works-webdav-dialog h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.works-webdav-enabled {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 82%, transparent);
  font-size: 13px;
  font-weight: 760;
}

.works-webdav-footer {
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .works-manager-date-field,
  .works-manager-input,
  .works-manager-button,
  .works-manager-query {
    width: 100%;
  }

  .works-date-popover {
    width: min(100%, calc(100vw - 32px));
    padding: 12px;
  }

  .works-date-months {
    grid-template-columns: 1fr;
    gap: 16px;
    justify-items: center;
  }
}

@media (max-width: 720px) {
  .works-manager-shell {
    gap: 8px;
  }

  .works-manager-filterbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
    justify-content: stretch;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  }

  .works-manager-filterbar .works-manager-date-field {
    grid-column: span 2;
  }

  .works-manager-filterbar .works-manager-input {
    grid-column: span 1;
  }

  .works-manager-filterbar .works-manager-button,
  .works-manager-filterbar .works-manager-query {
    grid-column: span 1;
  }

  .works-manager-input,
  .works-manager-date-trigger,
  .works-manager-button,
  .works-manager-query {
    min-height: 34px;
    border-radius: 10px;
    font-size: 12px;
  }

  .works-manager-input {
    padding: 0 10px;
    box-shadow: none;
  }

  .works-manager-button,
  .works-manager-query {
    justify-content: center;
    padding: 0 7px;
    gap: 5px;
    min-width: 0;
  }

  .works-manager-button .icon,
  .works-manager-query .icon {
    width: 14px;
    height: 14px;
  }

  .works-manager-actionbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
  }

  .works-manager-actionbar .compact-status {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .works-manager-actionbar .compact-status::-webkit-scrollbar {
    display: none;
  }

  .works-manager-actionbar .chip.small {
    flex: 0 0 auto;
    min-height: 26px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .works-batch-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .works-batch-toolbar .button {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    padding: 0 6px;
    gap: 5px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  .works-manager-checkbox {
    width: 14px;
    height: 14px;
    border-radius: 5px;
  }

  .works-date-popover {
    left: 50%;
    width: min(100%, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    transform: translateX(-50%);
  }
}

.create-chat-empty {
  padding: 16px 14px;
}

.create-chat-main {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 16px;
}

.create-mobile-history-toggle {
  display: none;
}

.create-stage {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  position: relative;
  overflow-y: auto;
  overflow-anchor: auto;
  padding: 28px 0 22px;
}

.create-dialog-flow {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.create-scroll-latest {
  position: sticky;
  bottom: 18px;
  z-index: 5;
  width: max-content;
  justify-self: center;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 10px auto 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(18, 22, 36, 0.86);
  color: #f6efe5;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.create-scroll-latest .icon {
  width: 15px;
  height: 15px;
}

body.create-away-from-latest[data-view="create"] .create-scroll-latest {
  display: inline-flex;
}

.create-message {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.create-message-user {
  width: 100%;
  margin-left: 0;
  padding-left: 0;
  justify-content: flex-end;
  gap: 12px;
}

.create-message-ai {
  justify-content: flex-start;
}

.create-message-content {
  min-width: 0;
  max-width: none;
}

.create-message-ai .create-message-content {
  flex: 0 1 min(680px, calc(100% - 98px));
  width: min(680px, calc(100% - 98px));
}

.create-message-user .create-message-content {
  order: 1;
  flex: 0 0 calc(100% - 110px);
  width: calc(100% - 110px);
  max-width: calc(100% - 110px);
  display: grid;
  justify-items: end;
}

.create-message-user .create-message-avatar {
  order: 2;
  margin-top: calc(12px * 1.2 + 6px);
}

.create-message-user .create-message-meta {
  text-align: right;
}

.create-message-meta {
  margin: 0 8px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
}

.create-message-bubble {
  border: 1px solid var(--line);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.create-user-bubble {
  --create-user-bubble-bg:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 255, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.105),
      rgba(255, 255, 255, 0.018) 38%,
      rgba(139, 92, 246, 0.075)
    ),
    color-mix(in srgb, var(--panel) 13%, transparent);
  --create-user-bubble-arrow: color-mix(in srgb, var(--panel) 32%, transparent);
  --create-user-bubble-line: color-mix(in srgb, var(--brand) 28%, var(--line));
  position: relative;
  width: fit-content;
  height: auto;
  max-width: 100%;
  padding: 14px 16px;
  border-color: var(--create-user-bubble-line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--create-user-bubble-bg);
  box-shadow:
    0 20px 54px rgba(99, 91, 255, 0.14),
    0 12px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px) saturate(1.18);
  line-height: 1.64;
  text-align: left;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
}

.create-user-bubble::after {
  content: "";
  position: absolute;
  top: calc((var(--create-avatar-size, 44px) - 16px) / 2);
  right: -8px;
  width: 12px;
  height: 16px;
  border-radius: 0;
  background: var(--create-user-bubble-bg);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  pointer-events: none;
}

body[data-view="create"] .create-user-prompt-panel {
  width: 100%;
  max-width: 100%;
  display: grid;
  justify-self: stretch;
  justify-items: end;
  gap: 9px;
}

body[data-view="create"] .create-user-prompt-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: color-mix(in srgb, var(--ink) 48%, transparent);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
  text-align: right;
}

body[data-view="create"] .create-user-prompt-text {
  text-align: left;
}

body[data-view="create"] .create-user-prompt-text::after {
  display: block;
}

body[data-view="create"] .create-user-prompt-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body[data-view="create"] .create-user-prompt-action {
  appearance: none;
  -webkit-appearance: none;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  background: color-mix(in srgb, #fff 8%, transparent);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

body[data-view="create"] .create-user-prompt-action-reuse {
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

body[data-view="create"] .create-user-prompt-action-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink) 42%, transparent);
  background: transparent;
  box-shadow: none;
}

body[data-view="create"] .create-user-prompt-action:hover,
body[data-view="create"] .create-user-prompt-action:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 58%, transparent);
  color: #fff;
  background: color-mix(in srgb, var(--brand) 30%, transparent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 18%, transparent);
}

body[data-view="create"] .create-user-prompt-action-icon:hover,
body[data-view="create"] .create-user-prompt-action-icon:focus-visible {
  border-color: color-mix(in srgb, #ef4444 52%, transparent);
  color: #fff;
  background: rgba(239, 68, 68, 0.86);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
}

body[data-view="create"] .create-user-prompt-action .icon {
  width: 13px;
  height: 13px;
}

body[data-view="create"] .create-ai-message-actions {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 0;
}

body[data-view="create"] .create-ai-message-actions .create-user-prompt-action-icon {
  min-width: 28px;
}

.create-ai-bubble {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.create-message-avatar {
  --create-avatar-size: 44px;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--line));
  border-radius: 999px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(139, 92, 246, 0.28)),
    color-mix(in srgb, var(--panel) 92%, transparent);
  font-size: 11px;
  font-weight: 900;
}

.create-message-avatar .icon {
  width: 18px;
  height: 18px;
}

.create-message-avatar img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.create-message-avatar-ai {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  background:
    url("/1779435627275_d.png?v=20260828-v0282") center / cover no-repeat,
    linear-gradient(135deg, rgba(56, 189, 248, 0.26), rgba(139, 92, 246, 0.34)),
    color-mix(in srgb, var(--panel) 92%, transparent);
}

.create-message-avatar-user {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.72), rgba(99, 102, 241, 0.68)),
    color-mix(in srgb, var(--panel) 92%, transparent);
}

.create-chat-image-list {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.create-chat-image-list[data-count="1"] {
  max-width: 680px;
  grid-template-columns: minmax(0, 1fr);
}

.create-chat-image-list[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-chat-image-list .image-tile {
  position: relative;
  width: 100%;
  min-height: 0;
  height: auto;
  max-height: none;
  aspect-ratio: var(--create-result-ratio, 1 / 1);
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.create-chat-image-list .history-image-preview {
  display: block;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
}

.create-chat-image-list .image-tile img,
.create-chat-image-list .history-image-preview {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: contain;
}

.create-chat-image-list .history-image-preview img {
  display: block;
  border-radius: inherit;
  transition: transform 0.22s ease;
  will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
  .create-chat-image-list .history-image-preview:hover img,
  .create-chat-image-list .history-image-preview:focus-visible img {
    transform: scale(1.045);
  }
}

.create-chat-image-list .tile-state {
  border-radius: 14px;
  background: transparent;
}

.create-stage-results,
.create-stage-results[data-count="1"] {
  width: min(644px, 100%);
  margin: 24px auto 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.create-stage-results[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
  width: min(322px, 100%);
}

.create-stage-results .image-tile {
  width: 100%;
  min-height: 210px;
  max-height: min(30vh, 360px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
}

.create-stage-results .image-tile img,
.create-stage-results .history-image-preview {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.create-stage-results .image-tile .tile-state {
  border: 0;
  background: transparent;
}

.create-bottom-composer {
  width: min(980px, 100%);
  min-height: 126px;
  flex: 0 0 auto;
  align-self: center;
  padding: 0;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 -8px 28px rgba(28, 26, 23, 0.04);
  margin-top: auto;
}

.create-reference-strip,
.create-bottom-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.create-reference-strip {
  flex-wrap: wrap;
  margin: 4px 0 12px;
}

.create-reference-thumb {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
  background: #f5f3ef;
}

.create-reference-thumb button:first-child {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.create-reference-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-reference-thumb span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

.create-reference-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
}

.create-reference-remove .icon {
  width: 10px;
  height: 10px;
}

.create-bottom-toolbar {
  min-height: 42px;
}

.create-upload-pill,
.create-dock-pill,
.create-balance-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  color: #111;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.create-upload-pill {
  padding: 0 14px;
}

.create-upload-pill .icon,
.create-dock-pill .icon {
  width: 15px;
  height: 15px;
}

.create-balance-pill {
  padding: 0 14px;
  color: #68758a;
  background: #f8f8f8;
}

.backend-quota-pill {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(250px, 42vw);
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  color: rgba(225, 241, 255, 0.92);
  background: rgba(15, 23, 42, 0.42);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backend-quota-pill.is-empty {
  color: rgba(255, 219, 170, 0.94);
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(120, 53, 15, 0.28);
}

.backend-quota-pill.is-error {
  color: rgba(255, 205, 210, 0.96);
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.32);
}

.backend-quota-pill.is-loading,
.backend-quota-pill.is-unknown {
  color: rgba(222, 229, 239, 0.78);
}

@media (max-width: 560px) {
  .backend-quota-pill {
    max-width: 128px;
    padding-inline: 8px;
    font-size: 10.5px;
  }
}

.create-count-pill {
  padding: 0 14px 0 17px;
}

.create-count-pill input.create-workbench-count-value {
  width: 44px;
  height: 34px;
  padding: 0;
  border: 0;
  color: #111;
  background: transparent;
  font-size: 16px;
}

.create-compact-ratio {
  position: relative;
}

.create-ratio-trigger {
  padding: 0 14px;
}

.create-ratio-trigger strong {
  font-weight: 900;
}

.create-ratio-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 212px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(26, 24, 22, 0.14);
}

.create-ratio-menu button {
  min-height: 34px;
  border-radius: 10px;
  color: #4c4a47;
  background: #f6f4f1;
  font-size: 12px;
  font-weight: 850;
}

.create-ratio-menu button.active {
  color: #fff;
  background: #111;
}

.create-send-button {
  width: 44px;
  height: 44px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #cfcfcf;
}

.create-send-button .icon {
  width: 18px;
  height: 18px;
}

.create-inspector {
  min-width: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 42px 54px 28px 24px;
  display: grid;
  align-content: start;
  gap: 18px;
  color: #111;
  text-align: right;
}

.create-inspector-status,
.create-inspector-specs {
  color: #9b9690;
  font-size: 12px;
  font-weight: 750;
}

.create-inspector h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 950;
}

.create-inspector-actions {
  display: flex;
  justify-content: flex-end;
}

.create-inspector-actions .button,
.create-inspector-edit,
.create-inspector-upload {
  min-height: 34px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  color: #57524d;
  background: #fff;
  box-shadow: 0 8px 20px rgba(28, 26, 23, 0.06);
  font-size: 12px;
  font-weight: 850;
}

.create-inspector-actions .button {
  padding: 0 13px;
}

.create-inspector-actions .button .icon,
.create-inspector-edit .icon,
.create-inspector-upload .icon {
  width: 14px;
  height: 14px;
}

.create-inspector-section {
  display: grid;
  justify-items: end;
  gap: 12px;
  margin-top: 16px;
}

.create-inspector-section > span {
  color: #77736d;
  font-size: 12px;
  font-weight: 850;
}

.create-inspector-ref-list {
  display: grid;
  gap: 8px;
}

.create-inspector-ref {
  width: 94px;
  overflow: hidden;
  border-radius: 3px;
}

.create-inspector-ref button {
  width: 94px;
  height: 94px;
  padding: 0;
  border: 0;
  background: transparent;
}

.create-inspector-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-inspector-edit,
.create-inspector-upload {
  justify-self: end;
  padding: 0 14px;
}

.create-inspector-specs {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .create-chat-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .create-inspector {
    display: none;
  }

  .create-chat-main {
    padding-inline: 34px;
  }
}

@media (max-width: 760px) {
  body[data-view="create"] .sidebar {
    display: block;
  }

  body[data-view="create"] .page.page-create {
    height: 100%;
    padding: 0;
  }

  .create-chat-workbench {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .create-chat-rail {
    position: fixed;
    top: calc(118px + env(safe-area-inset-top));
    left: 12px;
    z-index: 80;
    width: min(312px, calc(100vw - 24px));
    height: min(560px, calc(100dvh - 150px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease;
  }

  body.create-mobile-history-open .create-chat-rail {
    transform: translateX(0);
  }

  body.create-mobile-pull-refreshing .create-mobile-history-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
  }

  .create-chat-list {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 0;
  }

  .create-chat-item {
    width: 100%;
    flex: none;
    border-left: 0;
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
  }

  .create-chat-item.is-generating {
    min-height: 88px;
  }

  .create-chat-item.is-generating .create-chat-progress-pill {
    max-width: min(100%, 156px);
  }

  .create-chat-main {
    min-height: 0;
    padding: 60px 12px 0;
  }

  .create-mobile-history-toggle {
    position: fixed;
    top: calc(118px + env(safe-area-inset-top));
    left: 12px;
    z-index: 90;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  }

  .create-mobile-history-toggle .icon {
    width: 18px;
    height: 18px;
  }

  .create-stage {
    padding: 0 0 18px;
  }

  .create-dialog-flow {
    width: 100%;
    gap: 14px;
  }

  .create-message-user {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }

  .create-message-user .create-message-content {
    flex: 0 0 calc(100% - 98px);
    width: calc(100% - 98px);
  }

  .create-message-ai .create-message-content,
  .create-message-user .create-message-content {
    max-width: calc(100% - 52px);
  }

  .create-message-avatar {
    --create-avatar-size: 38px;
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 10px;
  }

  .create-message-user .create-message-avatar {
    align-self: flex-start;
    margin-top: calc(12px * 1.25 + 6px);
  }

  .create-ai-bubble {
    width: 100%;
  }

  .create-user-bubble,
  .create-ai-bubble {
    max-width: 100%;
  }

  .create-chat-image-list,
  .create-chat-image-list[data-count="1"] {
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .create-chat-image-list .image-tile {
    min-height: 210px;
    height: auto;
    max-height: none;
    aspect-ratio: var(--create-result-ratio, 1 / 1);
  }

  body[data-view="create"] .create-chat-image-list.is-loading {
    grid-template-columns: repeat(
      var(--create-result-columns, 1),
      minmax(0, 1fr)
    );
    gap: 8px;
  }

  body[data-view="create"] .create-chat-image-list.is-loading .image-tile {
    min-height: 0;
  }

  body[data-view="create"] .create-chat-image-list.is-loading .tile-state {
    padding: 8px;
    font-size: 12px;
  }

  .create-stage-results,
  .create-stage-results[data-count="1"] {
    width: 100%;
    margin: 10px 0 14px;
    grid-template-columns: 1fr;
  }

  .create-stage-results .image-tile {
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  .create-bottom-composer {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 120;
    width: auto;
    max-width: none;
    min-height: 0;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  }

  .create-bottom-composer .create-prompt-panel {
    padding: 12px;
  }

  .create-bottom-composer .create-prompt-actions {
    gap: 10px;
  }

  .create-bottom-toolbar {
    flex-wrap: wrap;
  }

  .create-balance-pill {
    display: none;
  }

  .create-send-button {
    margin-left: 0;
  }
}

/* Keep the create page aligned with the site's dark visual system. */
body[data-view="create"] {
  background: var(--bg);
}

body[data-view="create"] .app-shell {
  background: var(--shell-bg);
}

body[data-view="create"] .sidebar {
  display: flex;
  justify-content: center;
}

.page.page-create {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}

.create-chat-workbench {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--panel) 86%, transparent),
      color-mix(in srgb, var(--page) 92%, transparent)
    ),
    var(--page);
  box-shadow: none;
}

.create-chat-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-left: 0;
  background:
    radial-gradient(
      circle at 50% 0%,
      color-mix(in srgb, var(--brand) 8%, transparent),
      transparent 34%
    ),
    color-mix(in srgb, var(--page) 82%, transparent);
}

.create-chat-rail {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.create-chat-main {
  align-self: stretch;
}

.create-chat-new {
  color: #fff;
  border-color: color-mix(in srgb, var(--brand) 44%, var(--line));
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
}

.create-chat-trash,
.create-bottom-composer,
.create-upload-pill,
.create-dock-pill,
.create-balance-pill,
.create-ratio-menu,
.create-inspector-actions .button,
.create-inspector-edit,
.create-inspector-upload {
  color: var(--ink-soft);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
}

.create-chat-item {
  color: var(--ink-soft);
}

.create-chat-item.active {
  border-left-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 72%, transparent);
}

.create-chat-meta,
.create-chat-empty,
.create-inspector-status,
.create-inspector-specs {
  color: var(--muted);
}

.create-stage-results .image-tile {
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
}

.create-bottom-composer {
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.18);
  overflow: visible;
  position: relative;
  z-index: 30;
}

.create-bottom-composer .create-prompt-panel,
.create-bottom-composer .create-prompt-actions,
.create-bottom-composer .create-prompt-controls,
.create-bottom-composer .dock-control-strip,
.create-bottom-composer .ratio-picker {
  overflow: visible;
}

.create-bottom-composer .ratio-picker {
  z-index: 10001;
}

.create-count-pill input.create-workbench-count-value {
  color: var(--ink);
}

.create-balance-pill,
.create-inspector-section > span {
  color: var(--muted);
}

.create-reference-thumb {
  background: var(--panel-strong);
}

.create-ratio-menu {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
}

.create-ratio-menu button {
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

.create-ratio-menu button.active {
  color: #fff;
  background: var(--brand);
}

.works-status-chip {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.works-status-chip:disabled {
  cursor: wait;
}

.chip.works-status-chip--checking {
  color: #f5b301;
  background: color-mix(in srgb, #f5b301 14%, transparent);
  border-color: color-mix(in srgb, #f5b301 36%, var(--line));
}

.create-send-button {
  color: #fff;
  background: var(--brand);
}

.create-inspector {
  height: calc(100vh - 118px);
  color: var(--ink);
}

@media (min-width: 761px) {
  body[data-view="create"] .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body[data-view="create"] .workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body[data-view="create"] .page.page-create {
    width: min(1360px, calc(100% - 48px));
    max-width: 1360px;
    height: auto;
    min-height: 0;
    padding: 24px 0 180px;
    overflow: visible;
  }

  body[data-view="create"] .create-chat-workbench {
    height: auto;
    min-height: min(720px, calc(100dvh - 168px));
    overflow: visible;
  }

  body[data-view="create"] .create-chat-main {
    height: auto;
    min-height: min(680px, calc(100dvh - 208px));
    overflow: visible;
  }

  body[data-view="create"] .create-chat-rail {
    min-height: min(680px, calc(100dvh - 208px));
  }
}

@media (max-width: 760px) {
  body[data-view="create"] .page.page-create {
    width: 100%;
    padding: 0;
    height: 100%;
    overflow: hidden;
  }

  .page.page-create .page-footer {
    display: none;
  }

  .create-chat-workbench,
  .create-chat-rail,
  .create-inspector {
    min-height: 0;
  }

  body[data-view="create"] .create-chat-workbench {
    height: 100%;
    overflow: hidden;
  }

  body[data-view="create"] .create-chat-main {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding-bottom: 0;
  }

  .create-stage {
    padding-bottom: 18px;
  }

  body.create-prompt-dock-collapsed[data-view="create"] .create-stage {
    --create-stage-dock-spacer: 88px;
  }

  body.create-prompt-dock-expanded[data-view="create"] .create-stage {
    --create-stage-dock-spacer: 270px;
  }

  .create-chat-item {
    background: color-mix(in srgb, var(--panel-strong) 76%, transparent);
  }
}

/* Fixed create workspace: keep the page itself still while chat areas manage overflow. */
body[data-view="create"] {
  height: 100dvh;
  overflow: hidden;
}

body[data-view="create"] .app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body[data-view="create"] .workspace {
  height: calc(100dvh - 118px);
  min-height: 0;
  overflow: hidden;
}

body[data-view="create"] .page.page-create {
  width: min(1360px, calc(100% - 48px));
  max-width: 1360px;
  height: calc(100dvh - 118px);
  min-height: 0;
  padding: 16px 0;
  overflow: hidden;
}

body[data-view="create"] .create-chat-workbench {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-view="create"] .create-chat-main,
body[data-view="create"] .create-chat-rail {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-view="create"] .create-stage {
  --create-stage-dock-spacer: 132px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(
    var(--create-stage-dock-spacer) + env(safe-area-inset-bottom)
  );
}

body.create-prompt-dock-expanded[data-view="create"] .create-stage {
  --create-stage-dock-spacer: 300px;
}

body[data-view="create"] .create-stage::after {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: calc(
    var(--create-stage-dock-spacer) + env(safe-area-inset-bottom)
  );
  min-height: var(--create-stage-dock-spacer);
  pointer-events: none;
}

body[data-view="create"] .create-bottom-composer {
  flex: 0 0 auto;
}

/* AI replies should show the generated image itself, not a framed tile. */
.create-chat-image-list .history-image-tile {
  width: fit-content;
  max-width: 100%;
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 0;
}

.create-chat-image-list .history-image-preview {
  width: fit-content;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  line-height: 0;
}

.create-chat-image-list .history-image-preview img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(52dvh, 560px);
  border-radius: 14px;
  object-fit: contain;
}

.create-chat-image-list[data-count="1"] .history-image-tile,
.create-chat-image-list[data-count="1"] .history-image-preview {
  max-width: min(680px, 100%);
}

@media (max-width: 760px) {
  body[data-view="create"] .workspace,
  body[data-view="create"] .page.page-create {
    width: 100%;
    height: calc(100dvh - 118px);
    padding: 0;
  }

  .create-chat-image-list .history-image-preview img {
    max-height: min(42dvh, 420px);
  }
}

/* Single chat deletion confirm: simple dialog matching the create workspace. */
.admin-dialog.admin-dialog--confirm[open]:has(.history-delete-confirm) {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  border: 1px solid color-mix(in srgb, var(--line) 74%, #fff 26%);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #fff 9%, transparent),
    var(--shadow);
}

.admin-dialog.admin-dialog--confirm .history-delete-confirm {
  display: grid;
  gap: 18px;
  min-height: 148px !important;
  padding: 24px 24px 22px !important;
  overflow: visible;
  color: var(--ink);
  background: var(--panel);
}

.admin-dialog.admin-dialog--confirm .history-delete-confirm .admin-editor-head {
  display: none;
}

.admin-dialog.admin-dialog--confirm .history-delete-confirm .admin-confirm-copy {
  display: block;
  padding: 0;
}

.admin-dialog.admin-dialog--confirm[open] .admin-editor-actions .button.danger {
  color: #fff;
  border-color: #e11d48;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.28);
}

.admin-dialog.admin-dialog--confirm[open]
  .admin-editor-actions
  .button.danger:hover:not(:disabled),
.admin-dialog.admin-dialog--confirm[open]
  .admin-editor-actions
  .button.danger:focus-visible {
  color: #fff;
  border-color: #be123c;
  background: linear-gradient(180deg, #f43f5e, #be123c);
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.34);
}

body[data-view="create"] {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

body[data-view="create"] .app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

body[data-view="create"] .workspace {
  height: auto;
  min-height: calc(100dvh - 118px);
  overflow: visible;
}

body[data-view="create"] .page.page-create {
  height: auto;
  min-height: calc(100dvh - 118px);
  padding: 16px 0 0;
  overflow: visible;
}

body[data-view="create"] .create-chat-workbench {
  height: auto;
  min-height: calc(100dvh - 134px);
  overflow: visible;
}

body[data-view="create"] .create-chat-main {
  height: auto;
  min-height: inherit;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 0;
  scrollbar-gutter: auto;
}

body[data-view="create"] .create-stage {
  flex: 1 0 auto;
  overflow: visible;
  padding-bottom: 176px;
}

body[data-view="create"] .create-bottom-composer {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  width: 100%;
  align-self: stretch;
  margin-top: 0;
}

@media (max-width: 760px) {
  body[data-view="create"] .workspace,
  body[data-view="create"] .page.page-create {
    height: auto;
  }

  body[data-view="create"] .page.page-create {
    padding: 0;
  }
}

/* Keep a single AI reply image to one result slot instead of spanning two slots. */
body[data-view="create"] .create-chat-image-list[data-count="1"] {
  width: 100%;
  max-width: min(680px, 100%);
}

body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-tile,
body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-preview {
  max-width: min(680px, 100%);
}

body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-preview img {
  max-width: min(680px, 100%);
}

@media (max-width: 760px) {
  body[data-view="create"] .create-chat-image-list[data-count="1"],
  body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-tile,
  body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-preview,
  body[data-view="create"] .create-chat-image-list[data-count="1"] .history-image-preview img {
    max-width: min(100%, 360px);
  }
}

/* Keep failed/loading chat result placeholders as compact square status tiles. */
body[data-view="create"] .create-chat-image-list.is-loading {
  --create-status-placeholder-size: 112px;
  --create-status-placeholder-max-width: min(680px, 100%);
  --create-status-placeholder-max-height: min(52dvh, 560px);
  --create-status-placeholder-offset: 0px;
  --create-status-placeholder-height: min(
    var(--create-status-placeholder-max-height),
    calc(680px / var(--create-result-aspect, 1))
  );
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: start;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-view="create"] .create-chat-image-list.is-loading:has(.create-chat-result-card) {
  --create-status-placeholder-offset: 24px;
}

body[data-view="create"] .create-chat-image-list.is-loading .create-chat-result-card {
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(680px, 100%);
}

body[data-view="create"] .create-chat-image-list.is-loading::-webkit-scrollbar {
  display: none;
}

body[data-view="create"] .create-chat-result-placeholder {
  --create-status-placeholder-size: 112px;
  width: var(--create-status-placeholder-size);
  min-width: var(--create-status-placeholder-size);
  max-width: var(--create-status-placeholder-size);
  height: var(--create-status-placeholder-size);
  min-height: var(--create-status-placeholder-size);
  max-height: var(--create-status-placeholder-size);
  margin-top: var(--create-status-placeholder-offset, 0px);
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  justify-self: start;
  align-self: start;
  border-radius: 14px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--panel-strong) 78%, transparent),
      color-mix(in srgb, var(--panel) 84%, transparent)
    ),
    color-mix(in srgb, var(--panel-strong) 74%, transparent);
}

body[data-view="create"]
  .create-chat-image-list.is-loading:has(.create-chat-result-card)
  .create-chat-result-placeholder {
  margin-top: calc(
    var(--create-status-placeholder-offset, 0px) +
      max(
        0px,
        (
            var(--create-status-placeholder-height, var(--create-status-placeholder-size)) -
              var(--create-status-placeholder-size)
          ) / 2
      )
  );
}

body[data-view="create"] .create-chat-result-error-card {
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.035)),
    color-mix(in srgb, var(--panel-strong) 82%, transparent);
}

body[data-view="create"] .create-chat-result-error-wrap {
  width: min(520px, 100%);
  max-width: min(520px, 100%);
  min-width: min(260px, 100%);
  flex: 0 1 min(520px, 100%);
  display: grid;
  justify-items: start;
  gap: 8px;
}

body[data-view="create"] .create-chat-result-error-wrap .create-chat-result-error-card {
  width: var(--create-status-placeholder-size);
  min-width: var(--create-status-placeholder-size);
  max-width: var(--create-status-placeholder-size);
}

body[data-view="create"] .create-chat-result-error-full {
  width: 100%;
  max-width: min(520px, 100%);
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line));
  border-radius: 12px;
  color: color-mix(in srgb, var(--danger) 74%, var(--ink));
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body[data-view="create"] .create-chat-image-list.is-loading .create-chat-result-placeholder {
  min-height: var(--create-status-placeholder-size);
}

body[data-view="create"] .create-chat-result-error-state {
  padding: 10px;
  background: transparent;
}

body[data-view="create"] .create-chat-result-error-content {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  flex-wrap: wrap;
  writing-mode: horizontal-tb;
}

body[data-view="create"] .create-chat-result-error-controls {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

body[data-view="create"] .create-chat-result-error-label {
  color: var(--danger);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
}

body[data-view="create"] .create-chat-result-error-detail {
  width: min(100%, 180px);
  overflow: hidden;
  color: color-mix(in srgb, var(--danger) 72%, var(--muted));
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="create"] .create-chat-result-retry-button {
  min-height: 26px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

body[data-view="create"] .create-chat-result-error-controls .create-chat-result-action {
  color: color-mix(in srgb, var(--danger) 78%, #fff 22%);
  background: rgba(239, 68, 68, 0.12);
}

body[data-view="create"] .create-chat-result-loading-card .tile-state--loading > div {
  display: grid;
  justify-items: center;
  gap: 6px;
}

body[data-view="create"] .create-chat-result-stop-button {
  min-height: 20px;
  min-width: 46px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--danger) 76%, #fff 24%);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  box-shadow: none;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  transform: translateY(1px);
  white-space: nowrap;
}

body[data-view="create"] .create-chat-result-stop-button:hover,
body[data-view="create"] .create-chat-result-stop-button:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, var(--danger) 76%, transparent);
  background: color-mix(in srgb, var(--danger) 82%, #111827 18%);
}

body[data-view="create"] .create-chat-result-stop-button .icon {
  width: 10px;
  height: 10px;
}

body[data-view="create"] .create-generation-elapsed {
  color: color-mix(in srgb, var(--muted) 78%, var(--ink));
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

body[data-view="create"] .create-generation-duration {
  display: inline-flex;
  align-items: center;
  color: color-mix(in srgb, var(--ink) 56%, transparent);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

body[data-view="create"] .history-image-duration {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 2;
  max-width: calc(100% - 14px);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
}

body[data-view="create"] .history-image-duration .create-generation-duration {
  color: #fff;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.24);
}

@media (max-width: 760px) {
  body[data-view="create"] .create-chat-image-list.is-loading {
    --create-status-placeholder-size: 104px;
    --create-status-placeholder-max-width: min(360px, 100%);
    --create-status-placeholder-max-height: min(42dvh, 420px);
    --create-status-placeholder-offset: 0px;
    --create-status-placeholder-height: min(
      var(--create-status-placeholder-max-height),
      calc(360px / var(--create-result-aspect, 1))
    );
    gap: 8px;
  }

  body[data-view="create"] .create-chat-image-list.is-loading:has(.create-chat-result-card) {
    --create-status-placeholder-offset: 22px;
  }

  body[data-view="create"] .create-chat-result-placeholder {
    --create-status-placeholder-size: 104px;
    border-radius: 12px;
  }

  body[data-view="create"] .create-chat-result-loading-card .tile-state--loading {
    padding: 7px;
  }

  body[data-view="create"] .create-chat-result-loading-card .tile-state--loading > div {
    gap: 5px;
  }

  body[data-view="create"] .create-chat-result-stop-button {
    min-height: 24px;
    min-width: 56px;
    padding-inline: 8px;
    font-size: 11px;
    line-height: 1.1;
    transform: none;
  }

  body[data-view="create"] .create-chat-result-stop-button .icon {
    width: 11px;
    height: 11px;
  }

  body[data-view="create"] .create-chat-result-error-state {
    padding: 6px;
  }

  body[data-view="create"] .create-chat-result-error-content {
    gap: 6px;
  }

  body[data-view="create"] .create-chat-result-error-controls {
    gap: 4px;
  }

  body[data-view="create"] .create-chat-result-error-label,
  body[data-view="create"] .create-chat-result-retry-button {
    font-size: 11px;
  }

  body[data-view="create"] .create-chat-result-retry-button {
    min-height: 24px;
    min-width: 32px;
    padding-inline: 7px;
  }
}

/* Chat result block: status above, metadata and actions below the generated image. */
body[data-view="create"] .create-chat-result-card {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 6px;
  overflow: visible;
}

body[data-view="create"] .create-chat-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

body[data-view="create"] .create-chat-result-head span {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  background: transparent;
  font-size: 12px;
  font-weight: 620;
}

body[data-view="create"] .create-chat-result-preview {
  line-height: 0;
}

body[data-view="create"] .create-chat-result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-top: -3px;
  transform: none;
}

body[data-view="create"] .create-chat-result-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: color-mix(in srgb, var(--ink) 52%, transparent);
  font-size: 12px;
  font-weight: 620;
  white-space: nowrap;
}

body[data-view="create"] .create-chat-result-actions {
  position: static;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  opacity: 1;
  transform: none;
}

body[data-view="create"] .create-chat-result-action {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ink) 56%, transparent);
  background: transparent;
  box-shadow: none;
  font-size: 0;
  font-weight: 850;
  transition:
    color 0.16s ease,
    background 0.16s ease;
}

body[data-view="create"] .create-chat-result-action:hover,
body[data-view="create"] .create-chat-result-action:focus-visible {
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.16);
}

body[data-view="create"]
  .create-chat-result-action[data-action="edit-history-image"]:hover,
body[data-view="create"]
  .create-chat-result-action[data-action="edit-history-image"]:focus-visible,
body[data-view="create"]
  .create-chat-result-action[data-action="download-history-image"]:hover,
body[data-view="create"]
  .create-chat-result-action[data-action="download-history-image"]:focus-visible {
  color: #fff;
  background: rgba(59, 130, 246, 0.92);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.24);
}

body[data-view="create"] .create-chat-result-action-danger:hover,
body[data-view="create"] .create-chat-result-action-danger:focus-visible {
  color: #fff;
  background: rgba(239, 68, 68, 0.86);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.22);
}

body[data-view="create"] .create-chat-result-action .icon {
  width: 13px;
  height: 13px;
}

@media (max-width: 760px) {
  body[data-view="create"] .create-chat-result-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Create chat surface reset: keep the prompt box standard and the page frame light. */
body[data-view="create"] .create-bottom-composer {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-view="create"]
  .create-bottom-composer
  .create-prompt-dock:not(.desktop-collapsed) {
  position: static;
  left: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  transform: none;
  pointer-events: auto;
}

body[data-view="create"]
  .create-bottom-composer
  .create-prompt-dock.desktop-collapsed {
  position: static;
  left: auto;
  bottom: auto;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  transform: none;
  pointer-events: auto;
}

body[data-view="create"] .create-user-bubble {
  --create-user-bubble-bg: color-mix(in srgb, var(--brand-strong) 92%, var(--brand) 8%);
  --create-user-bubble-arrow: var(--create-user-bubble-bg);
  --create-user-bubble-line: color-mix(in srgb, var(--brand) 45%, #fff 16%);
  color: #fff;
  box-shadow: none;
  backdrop-filter: none;
  padding: 10px 16px;
  line-height: 1.42;
}

body[data-view="create"] .create-user-prompt-panel {
  width: 100%;
  max-width: 100%;
  display: grid;
  justify-self: stretch;
  justify-items: end;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-view="create"] .create-user-reference-strip {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 0;
}

body[data-view="create"] .create-user-reference-strip .dock-reference-item {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--pill-glass);
  box-shadow: none;
  line-height: 0;
  isolation: isolate;
}

body[data-view="create"] .create-user-reference-strip .dock-reference-thumb {
  overflow: hidden;
  border-radius: inherit;
  box-shadow: none;
  cursor: zoom-in;
}


body[data-view="create"] .create-user-reference-strip .dock-reference-thumb {
  background: color-mix(in srgb, var(--panel) 88%, #fff 8%);
}

body[data-view="create"] .create-user-reference-strip .dock-reference-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: cover !important;
  object-position: center center !important;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

body[data-view="create"] .create-user-reference-strip .dock-reference-thumb:hover img,
body[data-view="create"] .create-user-reference-strip .dock-reference-thumb:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.04) contrast(1.02);
}

body[data-view="create"] .create-user-prompt-panel .create-user-prompt-meta {
  justify-content: flex-end;
  padding: 0 2px;
  border-bottom: 0;
  color: color-mix(in srgb, var(--ink) 48%, transparent);
}

body[data-view="create"] .create-user-prompt-panel .create-user-bubble {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: flex-start;
  justify-self: end;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--create-user-bubble-line);
  border-radius: 14px;
  color: #fff;
  background: var(--create-user-bubble-bg);
  box-shadow: none;
  backdrop-filter: none;
  line-height: 1.58;
}

body[data-view="create"] .create-user-prompt-panel .create-user-prompt-text {
  min-width: 0;
  flex: 0 1 auto;
  text-align: left;
}

body[data-view="create"]
  .create-user-prompt-panel
  .create-user-bubble.has-references {
  display: flow-root;
  max-width: min(100%, 760px);
  white-space: normal;
}

body[data-view="create"]
  .create-user-prompt-panel
  .create-user-bubble.has-references
  .create-user-reference-strip {
  float: left;
  max-width: min(220px, 52vw);
  margin: 0 12px 6px 0;
  overflow: visible;
  padding: 0;
  shape-outside: inset(0);
}

body[data-view="create"]
  .create-user-prompt-panel
  .create-user-bubble.has-references
  .create-user-prompt-text {
  min-width: 0;
  display: block;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body[data-view="create"] .create-user-prompt-panel .create-user-bubble::after {
  content: "";
}

@media (max-width: 760px) {
  body[data-view="create"]
    .create-user-prompt-panel
    .create-user-bubble.has-references {
    width: 100%;
    display: flow-root;
    gap: 0;
  }

  body[data-view="create"]
    .create-user-prompt-panel
    .create-user-bubble.has-references
    .create-user-reference-strip {
    float: left;
    max-width: min(180px, 56vw);
    margin: 0 12px 6px 0;
    overflow: visible;
    padding: 0;
    shape-outside: inset(0);
  }

  body[data-view="create"]
    .create-user-prompt-panel
    .create-user-bubble.has-references
    .create-user-prompt-text {
    min-width: 0;
    display: block;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  body[data-view="create"] .create-user-prompt-panel .create-user-bubble::after {
    top: 11px;
    right: -8px;
    width: 12px;
    height: 16px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
}

body[data-view="create"] .create-user-prompt-panel .create-user-prompt-actions {
  justify-content: flex-end;
  padding: 0 2px;
}

@media (min-width: 761px) {
  body[data-view="create"] {
    --create-top-chrome-height: 91px;
  }

  body[data-view="create"] .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body[data-view="create"] .workspace {
    height: calc(100dvh - var(--create-top-chrome-height));
    min-height: 0;
    overflow: hidden;
  }

  body[data-view="create"] .page.page-create {
    height: calc(100dvh - var(--create-top-chrome-height));
    min-height: 0;
    padding: 16px 0 0;
    overflow: hidden;
  }

  body[data-view="create"] .create-chat-workbench {
    border: 1px solid color-mix(in srgb, var(--line) 78%, rgba(255, 255, 255, 0.14));
    border-radius: 14px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-view="create"] .create-chat-rail {
    position: relative;
    top: auto;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding-top: 12px;
    overflow: hidden;
    border-right-color: color-mix(in srgb, var(--line) 78%, rgba(255, 255, 255, 0.14));
  }

  body[data-view="create"] .create-chat-main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
  }

  body[data-view="create"] .create-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 14px;
    scrollbar-color: color-mix(in srgb, var(--brand) 58%, rgba(255, 255, 255, 0.22)) transparent;
    scrollbar-width: thin;
  }

  body[data-view="create"] .create-bottom-composer {
    position: relative;
    bottom: auto;
    flex: 0 0 auto;
    width: 100%;
    align-self: stretch;
    margin-top: 0;
    z-index: 40;
  }

  body[data-view="create"] .create-chat-list {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: color-mix(in srgb, var(--brand) 58%, rgba(255, 255, 255, 0.22)) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-view="create"] .create-chat-list::-webkit-scrollbar,
  body[data-view="create"] .create-stage::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  body[data-view="create"] .create-chat-list::-webkit-scrollbar-track,
  body[data-view="create"] .create-stage::-webkit-scrollbar-track {
    margin-block: 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel-strong) 34%, transparent);
  }

  body[data-view="create"] .create-chat-list::-webkit-scrollbar-thumb,
  body[data-view="create"] .create-stage::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background:
      linear-gradient(
          180deg,
          color-mix(in srgb, var(--brand-strong) 72%, #fff 28%),
          color-mix(in srgb, var(--brand) 68%, rgba(255, 255, 255, 0.22))
        )
        padding-box;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
  }

  body[data-view="create"] .create-chat-list::-webkit-scrollbar-thumb:hover,
  body[data-view="create"] .create-stage::-webkit-scrollbar-thumb:hover {
    background:
      linear-gradient(
          180deg,
          color-mix(in srgb, var(--brand-strong) 82%, #fff 18%),
          color-mix(in srgb, var(--brand) 78%, rgba(255, 255, 255, 0.22))
        )
        padding-box;
  }

  body[data-view="create"] .create-chat-list::-webkit-scrollbar-button,
  body[data-view="create"] .create-stage::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
  }

  body[data-view="create"] .create-message-user {
    padding-left: 0;
    justify-content: flex-end;
  }

  body[data-view="create"] .create-message-user .create-message-content {
    flex: 0 0 calc(100% - 110px);
    width: calc(100% - 110px);
    max-width: calc(100% - 110px);
    justify-items: end;
  }

}

.auth-dialog-close,
.admin-editor-head .icon-button[data-action^="close-"],
.admin-editor-head .icon-button[aria-label^="鍏抽棴"],
.points-ledger-modal .icon-button[data-action^="close-"],
.points-ledger-modal .icon-button[aria-label^="鍏抽棴"],
.preview-close-floating,
.preview-close-on-image,
.preview-close-on-work-image {
  color: color-mix(in srgb, var(--ink) 76%, transparent);
  border-color: color-mix(in srgb, var(--line) 88%, rgba(255, 255, 255, 0.16));
  background: color-mix(in srgb, var(--panel-strong) 72%, rgba(2, 6, 23, 0.64) 28%);
  box-shadow: none;
}

.auth-dialog-close:hover,
.auth-dialog-close:focus-visible,
.admin-editor-head .icon-button[data-action^="close-"]:hover,
.admin-editor-head .icon-button[data-action^="close-"]:focus-visible,
.admin-editor-head .icon-button[aria-label^="鍏抽棴"]:hover,
.admin-editor-head .icon-button[aria-label^="鍏抽棴"]:focus-visible,
.points-ledger-modal .icon-button[data-action^="close-"]:hover,
.points-ledger-modal .icon-button[data-action^="close-"]:focus-visible,
.points-ledger-modal .icon-button[aria-label^="鍏抽棴"]:hover,
.points-ledger-modal .icon-button[aria-label^="鍏抽棴"]:focus-visible,
.preview-close-floating:hover,
.preview-close-floating:focus-visible,
.preview-close-on-image:hover,
.preview-close-on-image:focus-visible,
.preview-close-on-work-image:hover,
.preview-close-on-work-image:focus-visible {
  color: #fff;
  border-color: rgba(220, 38, 38, 0.92);
  background: rgba(220, 38, 38, 0.92);
  box-shadow: none;
}

/* Unified large image preview: keep preview behavior, move info under image. */
.preview-dialog.preview-dialog-bottom-info {
  inset: 50% auto auto 50%;
  margin: 0;
  width: max-content;
  max-width: calc(100vw - 24px);
  height: auto;
  min-height: 0;
  max-height: none;
  transform: translate(-50%, -50%);
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.preview-shell--bottom-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  margin-inline: auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.preview-shell--bottom-info .preview-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin-inline: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  scrollbar-gutter: auto;
  padding: 0;
  background: transparent;
}

.preview-dialog .preview-art,
.preview-dialog .preview-art-media,
.preview-dialog .preview-image-frame,
.preview-dialog .preview-art img {
  cursor: default;
}

.preview-dialog.preview-dialog-image-only
  .preview-art.preview-art-image-only
  .preview-art-media-with-meta
  .preview-image-frame {
  width: var(--reference-preview-width, min(92vw, 1280px));
  height: var(--reference-preview-height, min(86vh, 920px));
  max-width: calc(100vw - 36px);
  max-height: calc(100dvh - 104px);
}

.preview-dialog.preview-dialog-image-only
  .preview-art.preview-art-image-only
  .preview-art-media-with-meta
  .preview-image-frame
  img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
}

.preview-dialog .preview-art.zoomed,
.preview-dialog .preview-art.zoomed .preview-art-media,
.preview-dialog .preview-art.zoomed .preview-image-frame,
.preview-dialog .preview-art.zoomed img {
  cursor: grab;
}

.preview-dialog .preview-art.zoomed.dragging,
.preview-dialog .preview-art.zoomed.dragging .preview-art-media,
.preview-dialog .preview-art.zoomed.dragging .preview-image-frame,
.preview-dialog .preview-art.zoomed.dragging img {
  cursor: grabbing;
}

.preview-shell--bottom-info .preview-art-media {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin-inline: auto;
  height: auto;
  max-height: none;
  align-items: center;
  justify-content: center;
}

.preview-shell--bottom-info .preview-art-media-with-meta {
  width: auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  gap: 0;
  max-height: none;
}

.preview-shell--bottom-info
  .preview-art-media-with-meta
  .preview-image-frame {
  flex: 0 1 auto;
  width: var(--preview-bottom-image-width, auto);
  max-width: none;
  box-sizing: border-box;
  min-height: 0;
  height: var(--preview-bottom-image-height, auto);
  max-height: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-bottom: 0;
}

.preview-shell--bottom-info .preview-art img {
  width: var(--preview-bottom-image-width, auto);
  height: var(--preview-bottom-image-height, auto);
  max-width: var(--preview-bottom-image-max-width, calc(100vw - 24px));
  max-height: var(--preview-bottom-image-height, none);
  border-radius: var(--radius);
  object-fit: contain;
}

.preview-frame-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 0 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s linear;
  background: transparent;
  border-radius: inherit;
}

.preview-image-frame:hover .preview-frame-overlay,
.preview-image-frame:focus-within .preview-frame-overlay {
  opacity: 1;
}

.preview-frame-overlay__top,
.preview-frame-overlay__bottom {
  width: min(100%, var(--preview-bottom-stack-width, 100%));
  max-width: min(100%, var(--preview-bottom-stack-width, 100%));
  pointer-events: none;
}

.preview-frame-overlay__top {
  display: flex;
  justify-content: flex-start;
  margin-inline: 14px;
  width: min(calc(100% - 28px), var(--preview-bottom-stack-width, 100%));
  max-width: min(calc(100% - 28px), var(--preview-bottom-stack-width, 100%));
}

.preview-frame-overlay__bottom {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.54);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.preview-overlay-summary {
  display: grid;
  gap: 4px;
  max-width: min(72%, 520px);
  padding: 10px 12px;
  color: #fff;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.preview-overlay-title {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
}

.preview-overlay-note {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.45;
}

.preview-frame-overlay .preview-image-meta,
.preview-frame-overlay .preview-media-actions,
.preview-frame-overlay .preview-generated-actions,
.preview-frame-overlay .preview-icon-button {
  pointer-events: auto;
}

.preview-frame-overlay .preview-image-meta,
.preview-frame-overlay .preview-media-actions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.preview-frame-overlay .preview-image-meta {
  min-height: 15px;
  padding: 8px 12px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10.5px;
  line-height: 1.18;
  user-select: text;
  cursor: text;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.preview-frame-overlay .preview-image-meta-items {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.preview-frame-overlay .preview-image-meta span,
.preview-frame-overlay .preview-image-meta strong {
  user-select: text;
  cursor: text;
}

.preview-frame-overlay .preview-image-meta strong {
  color: #fff;
}

.preview-frame-overlay .preview-image-meta-page {
  grid-column: 3;
  justify-self: end;
}

.preview-frame-overlay .preview-media-actions {
  padding: 8px 12px 10px;
  border-radius: 0;
}

.preview-frame-overlay .preview-icon-button,
.preview-frame-overlay .preview-generated-actions .preview-icon-button {
  color: rgba(255, 255, 255, 0.92);
  border-color: transparent;
}

.preview-frame-overlay .preview-icon-button:hover,
.preview-frame-overlay .preview-icon-button:focus-visible,
.preview-frame-overlay .preview-generated-actions .preview-icon-button:hover,
.preview-frame-overlay .preview-generated-actions .preview-icon-button:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, #fff 34%, transparent);
  background: rgba(255, 255, 255, 0.16);
}

.preview-shell--bottom-info .preview-info {
  width: min(100%, var(--preview-bottom-stack-width, 100%));
  max-width: min(100%, var(--preview-bottom-stack-width, 100%));
  box-sizing: border-box;
  margin-inline: auto;
}

.preview-shell--bottom-info .preview-image-meta,
.preview-shell--bottom-info .preview-media-actions {
  width: min(100%, var(--preview-bottom-stack-width, 100%));
  max-width: min(100%, var(--preview-bottom-stack-width, 100%));
  box-sizing: border-box;
}

.preview-shell--bottom-info .preview-image-meta {
  min-height: 15px;
  padding: 6px 14px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  border-radius: 0;
  background: color-mix(in srgb, var(--panel-strong) 88%, #020617 12%);
  font-size: 10.5px;
  line-height: 1.18;
  user-select: text;
  cursor: text;
}

.preview-shell--bottom-info .preview-image-meta-items {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.preview-shell--bottom-info .preview-image-meta span,
.preview-shell--bottom-info .preview-image-meta strong {
  user-select: text;
  cursor: text;
}

.preview-shell--bottom-info .preview-image-meta-page {
  grid-column: 3;
  justify-self: end;
}

.preview-shell--bottom-info .preview-image-meta span:hover,
.preview-shell--bottom-info .preview-image-meta span:focus-within {
  color: color-mix(in srgb, var(--ink) 66%, transparent);
}

.preview-shell--bottom-info .preview-image-meta span:hover strong,
.preview-shell--bottom-info .preview-image-meta span:focus-within strong {
  color: var(--ink);
}

.preview-media-actions {
  min-height: 27px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.preview-shell--bottom-info .preview-media-actions {
  padding: 3px 14px 2px;
  border-radius: 0;
  background: color-mix(in srgb, var(--panel-strong) 88%, #020617 12%);
}

.preview-shell--bottom-info .preview-frame-overlay .preview-image-meta,
.preview-shell--bottom-info .preview-frame-overlay .preview-media-actions {
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.preview-media-actions .preview-generated-actions {
  grid-column: 2;
  justify-content: center;
  min-width: 0;
  flex: 0 0 auto;
}

.preview-mobile-under-actions {
  display: none;
}

.preview-media-note {
  grid-column: 3;
  justify-self: end;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--ink) 52%, transparent);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.preview-shell--bottom-info .preview-info {
  display: block;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 0 0 8px;
  border-left: 0;
  border-top: 0;
  overflow: visible;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.preview-dialog.preview-dialog-bottom-info .preview-close-floating {
  position: fixed;
  top: 14px;
  right: 14px;
  transform: none;
  z-index: 40;
}

.preview-generated-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 4px 14px;
  width: 100%;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.preview-generated-summary {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  gap: 0;
}

.preview-generated-titleline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--ink) 54%, transparent);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  padding-inline: 14px;
  white-space: nowrap;
  overflow: hidden;
}

.preview-generated-titleline > * {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-generated-kicker {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--brand);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.preview-generated-title {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.preview-generated-note {
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}

.preview-generated-prompt {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.42;
  margin-top: 2px;
  padding: 0 14px;
  background: transparent;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.preview-generated-footer {
  justify-self: end;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 42%, transparent);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.preview-generated-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}

.preview-generated-actions .preview-icon-button {
  width: auto;
  min-width: 56px;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  gap: 4px;
  border-radius: 999px;
  border-color: transparent;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
  background: transparent;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  transition:
    color 0.08s linear,
    background 0.08s linear,
    border-color 0.08s linear;
}

.preview-generated-actions .preview-icon-button .icon {
  width: 13px;
  height: 13px;
}

.preview-generated-actions .preview-icon-button span {
  display: inline-block;
}

.preview-generated-actions .preview-icon-button:hover,
.preview-generated-actions .preview-icon-button:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, var(--brand) 46%, transparent);
  background: color-mix(in srgb, var(--brand) 72%, #fff 8%);
  box-shadow: none;
}

.preview-nav {
  border: 1px solid rgba(255, 255, 255, 0.34);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.preview-nav:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.78);
  background: #8b5cf6;
  opacity: 1;
  transform: translateY(-50%);
}

.preview-nav:focus-visible {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.78);
  background: #8b5cf6;
  opacity: 1;
  transform: translateY(-50%);
}

.preview-nav:active {
  transform: translateY(-50%);
}

.preview-nav:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 760px) {
  .preview-dialog .preview-close-floating {
    position: absolute;
    top: calc(-26px + env(safe-area-inset-top));
    right: 0;
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
    border: 0 !important;
    outline: 0;
    color: color-mix(in srgb, var(--ink) 76%, transparent);
    background: color-mix(in srgb, var(--panel-strong) 72%, rgba(2, 6, 23, 0.64) 28%);
    box-shadow: none;
    transform: none;
  }

  .preview-dialog.preview-dialog-bottom-info .preview-close-floating,
  .preview-dialog .preview-close-on-image,
  .preview-dialog .preview-close-on-work-image {
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.26) !important;
    background: rgba(15, 23, 42, 0.76) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.18);
    backdrop-filter: blur(14px) saturate(1.18);
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.2) !important;
  }

  .preview-dialog .preview-close-floating .icon {
    width: 14px;
    height: 14px;
  }

  .preview-dialog .preview-close-floating:hover,
  .preview-dialog .preview-close-floating:focus-visible,
  .preview-dialog .preview-close-on-image:hover,
  .preview-dialog .preview-close-on-image:focus-visible,
  .preview-dialog .preview-close-on-work-image:hover,
  .preview-dialog .preview-close-on-work-image:focus-visible {
    border-color: rgba(185, 28, 28, 0.98) !important;
    outline: 0;
    color: #fff;
    background: rgba(185, 28, 28, 0.98) !important;
    box-shadow: none;
  }

  .preview-dialog.preview-dialog-image-only .preview-close-on-image {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    transform: none;
  }

  .preview-dialog.preview-dialog-bottom-info {
    --preview-mobile-art-inline-space: 20px;
    inset: 50% auto auto 50%;
    width: min(100vw - 18px, 560px);
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 18px);
    transform: translate(
      -50%,
      calc(-50% + var(--preview-bottom-center-shift, 0px))
    );
  }

  .preview-shell--bottom-info {
    min-height: 0;
    grid-template-rows: auto max-content;
  }

  .preview-shell--bottom-info .preview-art {
    flex-direction: column;
    height: auto;
    padding: env(safe-area-inset-top) 10px 0;
  }

  .preview-shell--bottom-info .preview-art-media,
  .preview-shell--bottom-info .preview-art-media-with-meta {
    max-height: calc(100dvh - 18px);
  }

  .preview-shell--bottom-info
    .preview-art-media-with-meta
    .preview-image-frame {
    width: auto;
    max-width: calc(100vw - 18px);
    height: auto;
    max-height: calc(100dvh - 18px);
  }

  .preview-shell--bottom-info .preview-art img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    object-fit: contain;
  }

  .preview-image-frame .preview-frame-overlay {
    opacity: 1;
    padding: 10px 0 0;
    background: transparent;
  }

  .preview-frame-overlay__top {
    display: none;
  }

  .preview-frame-overlay__bottom {
    display: none;
  }

  .preview-overlay-summary {
    max-width: calc(100% - 40px);
    padding: 8px 10px;
    border-radius: 10px;
  }

  .preview-frame-overlay .preview-image-meta {
    display: none;
  }

  .preview-shell--bottom-info .preview-info {
    width: calc(100% - var(--preview-mobile-art-inline-space, 20px));
    max-width: calc(100% - var(--preview-mobile-art-inline-space, 20px));
    margin-inline: auto;
    max-height: 176px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .preview-generated-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .preview-generated-titleline {
    justify-content: center;
    flex-wrap: wrap;
    white-space: normal;
    text-align: center;
  }

  .preview-generated-prompt,
  .preview-generated-footer {
    text-align: center;
  }

  .preview-generated-footer {
    display: none;
  }

  .preview-generated-actions {
    width: auto;
    max-width: 100%;
    justify-content: center;
  }

  .preview-media-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 0;
    width: 100%;
  }

  .preview-mobile-under-actions {
    display: flex;
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 3;
    transform: translateX(-50%);
    justify-content: center;
    width: auto;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    pointer-events: auto;
  }

  .preview-mobile-under-actions .preview-generated-actions {
    display: flex;
    width: auto;
    max-width: 100%;
    justify-content: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .preview-mobile-under-actions .preview-icon-button,
  .preview-mobile-under-actions .preview-generated-actions .preview-icon-button {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(15, 23, 42, 0.66);
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }

  .preview-mobile-under-actions .preview-icon-button:hover,
  .preview-mobile-under-actions .preview-icon-button:focus-visible,
    .preview-mobile-under-actions .preview-generated-actions .preview-icon-button:hover,
  .preview-mobile-under-actions .preview-generated-actions .preview-icon-button:focus-visible {
    color: #fff;
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: none;
  }

  .preview-media-note {
    white-space: normal;
    text-align: center;
  }
}

:root[data-theme="light"] .preview-frame-overlay .preview-image-meta {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.52);
}

:root[data-theme="light"] .preview-frame-overlay .preview-image-meta strong {
  color: #fff;
}

:root[data-theme="light"] .preview-frame-overlay .preview-icon-button,
:root[data-theme="light"] .preview-frame-overlay .preview-generated-actions .preview-icon-button {
  color: rgba(255, 255, 255, 0.94);
}

:root[data-theme="light"] .preview-frame-overlay .preview-icon-button:hover,
:root[data-theme="light"] .preview-frame-overlay .preview-icon-button:focus-visible,
:root[data-theme="light"] .preview-frame-overlay .preview-generated-actions .preview-icon-button:hover,
:root[data-theme="light"] .preview-frame-overlay .preview-generated-actions .preview-icon-button:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, #fff 34%, transparent);
  background: rgba(255, 255, 255, 0.16);
}

:root[data-theme="light"] .preview-frame-overlay__bottom {
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

:root[data-theme="light"] .preview-frame-overlay .preview-image-meta,
:root[data-theme="light"] .preview-frame-overlay .preview-media-actions {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

:root[data-theme="light"] .preview-overlay-summary {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1c1917;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

:root[data-theme="light"] .preview-overlay-title {
  color: #1c1917;
}

:root[data-theme="light"] .preview-overlay-note {
  color: rgba(28, 25, 23, 0.72);
}

@media (max-width: 760px) {
  :root[data-theme="light"] .preview-mobile-under-actions .preview-icon-button,
  :root[data-theme="light"]
    .preview-mobile-under-actions
    .preview-generated-actions
    .preview-icon-button {
    color: rgba(255, 255, 255, 0.94);
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(255, 255, 255, 0.18);
  }
}

.same-style-cover .inspiration-card-label,
.work-preview-cover .work-cover-prompt {
  position: absolute;
  box-sizing: border-box;
  z-index: 4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: none;
  min-height: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff;
  background: rgba(5, 8, 18, 0.72);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  text-overflow: clip;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.12s linear,
    transform 0.12s ease;
}

.same-style-cover .inspiration-card-label {
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 64px;
  max-height: calc(100% - 78px);
  -webkit-line-clamp: 4;
}

.work-preview-cover .work-cover-prompt {
  left: 10px;
  right: 10px;
  bottom: 10px;
  max-height: calc(100% - 20px);
  -webkit-line-clamp: 5;
}

.same-style-cover:hover .inspiration-card-label,
.same-style-cover:focus-visible .inspiration-card-label,
.work-preview-cover:hover .work-cover-prompt,
.work-preview-cover:focus-visible .work-cover-prompt {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .same-style-cover .inspiration-card-label,
  .work-preview-cover .work-cover-prompt {
    opacity: 1;
    transform: translateY(0);
  }

  .same-style-cover .inspiration-card-label {
    bottom: 58px;
    -webkit-line-clamp: 3;
  }
}

.preview-dialog.preview-dialog-bottom-info .preview-close-floating,
.preview-dialog.preview-dialog-image-only .preview-close-on-image,
.preview-dialog .preview-close-on-work-image {
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.26) !important;
  background: rgba(15, 23, 42, 0.78) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.18) !important;
  backdrop-filter: blur(14px) saturate(1.18) !important;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.22) !important;
}

.preview-dialog.preview-dialog-bottom-info .preview-close-floating:hover,
.preview-dialog.preview-dialog-bottom-info .preview-close-floating:focus-visible,
.preview-dialog.preview-dialog-image-only .preview-close-on-image:hover,
.preview-dialog.preview-dialog-image-only .preview-close-on-image:focus-visible,
.preview-dialog .preview-close-on-work-image:hover,
.preview-dialog .preview-close-on-work-image:focus-visible {
  color: #fff !important;
  border-color: rgba(185, 28, 28, 0.98) !important;
  background: rgba(185, 28, 28, 0.98) !important;
}

@media (max-width: 760px) {
  body[data-view="create"] {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
  }

  body[data-view="create"] .app-shell,
  body[data-view="create"] .workspace,
  body[data-view="create"] .page.page-create,
  body[data-view="create"] .create-chat-workbench,
  body[data-view="create"] .create-chat-main {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body[data-view="create"] .workspace {
    min-height: calc(100dvh - 118px) !important;
  }

  body[data-view="create"] .page.page-create {
    padding-bottom: max(176px, calc(156px + env(safe-area-inset-bottom, 0px))) !important;
  }

  body[data-view="create"] .create-chat-workbench {
    min-height: calc(100dvh - 118px) !important;
  }

  body[data-view="create"] .create-stage {
    overflow: visible !important;
    padding-bottom: 24px !important;
  }
}

/* Keep the real textarea and caret above the animated hint layer. */
.prompt-input-box .prompt-input-floating {
  position: relative;
  z-index: 3;
  caret-color: #ffffff;
}

.prompt-input-box .prompt-input-hint {
  z-index: 1;
}

.prompt-input-box .prompt-input-floating:not(:placeholder-shown) + .prompt-input-hint,
.prompt-input-box .prompt-input-hint.is-hidden {
  visibility: hidden;
}

:root[data-theme="light"] .prompt-input-box .prompt-input-floating {
  caret-color: var(--ink);
}


body[data-view="create"] .create-stage,
body[data-view="create"] .create-chat-main,
body[data-view="create"] .create-dialog-flow,
body[data-view="create"] .create-message,
body[data-view="create"] .create-message-bubble,
body[data-view="create"] .create-chat-image-list,
body[data-view="create"] .create-chat-result-card,
body[data-view="create"] .create-chat-result-preview,
body[data-view="create"] .create-chat-result-preview img {
  overflow-anchor: none;
}

.admin-dialog.admin-dialog--example .admin-preview-card--image-only {
  align-self: start;
  justify-items: center;
}

.admin-dialog.admin-dialog--example .admin-preview-card--image-only img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(56dvh, 560px);
  aspect-ratio: auto;
  object-fit: contain;
}

@media (max-width: 760px) {
  .admin-dialog.admin-dialog--example {
    width: min(430px, calc(100vw - 20px));
    height: auto;
    max-height: calc(100dvh - 20px);
    overflow: hidden;
    border-radius: 22px;
  }

  .admin-dialog.admin-dialog--example .admin-editor--example {
    min-height: 0;
    max-height: calc(100dvh - 20px);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
    overflow: auto;
  }

  .admin-dialog.admin-dialog--example .admin-editor-head {
    position: sticky;
    top: 0;
    z-index: 5;
    align-items: center;
    padding: 0 0 10px;
    margin-bottom: 10px;
    background: var(--panel);
  }

  .admin-dialog.admin-dialog--example .section-title {
    font-size: 18px;
    line-height: 1.2;
  }

  .admin-dialog.admin-dialog--example .admin-editor-head .icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex: 0 0 34px;
  }

  .admin-dialog.admin-dialog--example .admin-editor-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-dialog.admin-dialog--example .form-grid {
    gap: 9px;
  }

  .admin-dialog.admin-dialog--example .field label {
    margin-bottom: 5px;
  }

  .admin-dialog.admin-dialog--example .field input {
    min-height: 38px;
  }

  .admin-dialog.admin-dialog--example .admin-textarea {
    min-height: 92px;
    max-height: 132px;
  }

  .admin-dialog.admin-dialog--example .admin-preview-card {
    gap: 6px;
    padding: 8px;
  }

  .admin-dialog.admin-dialog--example .admin-preview-card--image-only img {
    max-height: 24dvh;
    aspect-ratio: auto;
  }

  .admin-dialog.admin-dialog--example .admin-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    gap: 8px;
    padding-top: 10px;
    margin-top: 10px;
    background: var(--panel);
  }

  .admin-dialog.admin-dialog--example .admin-editor-actions .button {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ============================================================================
 * v0.2.115: Multi-turn Context Memory, LLM Config Panel, chat_only, Search & Dock Clearance
 * ========================================================================== */

/* Dynamic bottom clearance so floating composer never obscures generated images */
body[data-view="create"] .create-stage {
  padding-bottom: calc(var(--create-stage-dock-spacer, 180px) * 0.25) !important;
}

body[data-view="create"] .create-stage::after {
  height: calc(var(--create-stage-dock-spacer, 220px) + env(safe-area-inset-bottom)) !important;
  min-height: var(--create-stage-dock-spacer, 220px) !important;
}

/* Sidebar conversation search box */
.create-chat-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: 8px 0 6px;
}

.create-chat-search-icon {
  position: absolute;
  left: 10px;
  display: inline-flex;
  align-items: center;
  color: var(--muted, #8c95a6);
  pointer-events: none;
}

.create-chat-search-icon svg {
  width: 14px;
  height: 14px;
}

.create-chat-search-input {
  width: 100%;
  height: 32px;
  padding: 0 28px 0 30px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.14)) 85%, transparent);
  background: color-mix(in srgb, var(--panel, rgba(255, 255, 255, 0.04)) 82%, transparent);
  color: var(--ink, #fff);
  font-size: 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.create-chat-search-input:focus {
  border-color: var(--brand, #7c5cff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #7c5cff) 24%, transparent);
}

.create-chat-search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted, #8c95a6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.create-chat-search-clear:hover {
  color: var(--ink, #fff);
  background: rgba(125, 125, 125, 0.16);
}

.create-chat-search-clear svg {
  width: 12px;
  height: 12px;
}

.create-chat-item-action-smart-rename {
  color: var(--brand, #8b6cff);
}

.create-chat-item-action-smart-rename:hover:not(:disabled) {
  color: var(--brand-strong, #6d4aff);
  background: color-mix(in srgb, var(--brand, #7c5cff) 14%, transparent);
}

.create-chat-item-action-smart-rename.is-busy {
  opacity: 0.65;
  pointer-events: none;
  animation: llmSmartRenamePulse 0.9s ease-in-out infinite;
}

@keyframes llmSmartRenamePulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* Composer Context Memory & Interaction Mode Bar */
.create-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  padding: 5px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel, rgba(22, 24, 38, 0.82)) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.12)) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.create-context-bar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.create-memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.14)) 90%, transparent);
  background: color-mix(in srgb, var(--panel, rgba(255, 255, 255, 0.06)) 80%, transparent);
  color: var(--ink, #f4f6ff);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.create-memory-chip.is-on {
  border-color: color-mix(in srgb, var(--brand, #7c5cff) 55%, transparent);
  background: color-mix(in srgb, var(--brand, #7c5cff) 16%, transparent);
}

.create-memory-chip.is-off {
  opacity: 0.72;
}

.create-memory-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8c95a6;
}

.create-memory-chip.is-on .create-memory-dot {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}

.create-anchor-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand, #7c5cff) 45%, transparent);
  background: color-mix(in srgb, var(--brand, #7c5cff) 12%, transparent);
  color: var(--ink, #f4f6ff);
  font-size: 11px;
  max-width: 240px;
}

.create-anchor-pill.is-manual {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.16);
}

.create-anchor-pill.is-skipped {
  padding: 0 9px;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.25)) 90%, transparent);
  background: transparent;
  color: var(--muted, #9aa3b5);
  cursor: pointer;
}

.create-anchor-thumb {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.create-anchor-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
  padding: 0;
}

.create-anchor-clear:hover {
  opacity: 1;
  background: rgba(125, 125, 125, 0.2);
}

.create-anchor-clear svg {
  width: 10px;
  height: 10px;
}

.create-mode-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.1)) 60%, transparent);
}

.create-mode-pill {
  height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #9aa3b5);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.create-mode-pill:hover {
  color: var(--ink, #fff);
}

.create-mode-pill.active {
  background: var(--brand, #7c5cff);
  color: #fff;
  box-shadow: 0 1px 4px rgba(124, 92, 255, 0.35);
}

.create-mode-pill.is-unavailable {
  opacity: 0.55;
}

/* Anchored image card & button */
.create-chat-result-card.is-anchored .create-chat-result-preview {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.create-anchored-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.create-chat-result-action-anchor {
  width: auto !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--brand, #8b6cff) 32%, var(--line, rgba(255, 255, 255, 0.14))) !important;
  background: color-mix(in srgb, var(--brand, #8b6cff) 10%, transparent) !important;
  color: color-mix(in srgb, var(--brand, #9b82ff) 82%, var(--ink, #fff)) !important;
  font-size: 11px !important;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.create-chat-result-action-anchor:hover {
  border-color: color-mix(in srgb, var(--brand, #8b6cff) 65%, transparent) !important;
  background: color-mix(in srgb, var(--brand, #8b6cff) 20%, transparent) !important;
  color: var(--ink, #fff) !important;
}

:root[data-theme="light"] .create-chat-result-action-anchor {
  color: var(--brand-strong, #5b3df5) !important;
  background: rgba(109, 93, 252, 0.08) !important;
  border-color: rgba(109, 93, 252, 0.24) !important;
}

:root[data-theme="light"] .create-chat-result-action-anchor:hover {
  background: rgba(109, 93, 252, 0.15) !important;
  border-color: rgba(109, 93, 252, 0.45) !important;
  color: #4328d6 !important;
}

.create-chat-result-action-anchor.is-anchored {
  background: rgba(245, 158, 11, 0.22) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
  color: #f59e0b !important;
}

/* Pure-text chat mode visual consistency in prompt dock */
.create-prompt-dock.is-chat-mode .create-prompt-panel {
  border-color: color-mix(in srgb, var(--brand, #8b6cff) 46%, var(--line, rgba(255, 255, 255, 0.14)));
}

.create-prompt-dock.is-chat-mode .dock-control-strip {
  opacity: 0.48;
  transition: opacity 0.18s ease;
}

.create-prompt-dock.is-chat-mode .dock-control-strip:hover {
  opacity: 0.85;
}

.create-prompt-dock .create-context-bar {
  margin-bottom: 0;
}

.create-prompt-dock .create-context-bar + .prompt-input-resize-handle {
  height: 14px;
  min-height: 14px;
  margin: 0 auto;
}

.create-user-prompt-action-branch {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
}

.create-user-prompt-action-branch.is-active {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.14);
}

/* Collapsible AI Understanding strip inside AI image bubbles */
.create-llm-context-details {
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand, #7c5cff) 28%, var(--line, rgba(255, 255, 255, 0.12)));
  background: color-mix(in srgb, var(--brand, #7c5cff) 8%, var(--panel, rgba(255, 255, 255, 0.03)));
  overflow: hidden;
  max-width: 720px;
}

.create-llm-context-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--ink, #e8ecff);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.create-llm-context-summary::-webkit-details-marker {
  display: none;
}

.create-llm-context-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--brand, #9b82ff);
  flex-shrink: 0;
}

.create-llm-context-badge svg {
  width: 12px;
  height: 12px;
}

.create-llm-context-text {
  color: var(--ink, #e8ecff);
  opacity: 0.92;
}

.create-llm-context-pill {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.create-llm-context-model {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted, #8c95a6);
}

.create-llm-context-body {
  padding: 8px 10px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.1)) 80%, transparent);
  font-size: 12px;
}

.create-llm-context-body-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted, #9aa3b5);
}

.create-llm-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.16)) 90%, transparent);
  background: transparent;
  color: var(--ink, #fff);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
}

.create-llm-copy-btn svg {
  width: 11px;
  height: 11px;
}

.create-llm-context-prompt {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: var(--ink, #e8ecff);
  opacity: 0.9;
}

/* Pure Text Chat (chat_only) AI Reply Card */
.create-ai-chat-card {
  width: min(680px, 100%);
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.14)) 90%, transparent);
  background: color-mix(in srgb, var(--panel, rgba(28, 30, 46, 0.85)) 92%, transparent);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-ai-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.create-ai-chat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand, #9b82ff);
  font-weight: 600;
}

.create-ai-chat-tag svg {
  width: 13px;
  height: 13px;
}

.create-ai-chat-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink, #eef1ff);
  word-break: break-word;
}

.create-ai-chat-body p {
  margin: 0 0 8px;
}

.create-ai-chat-body p:last-child {
  margin-bottom: 0;
}

.create-ai-chat-body ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.create-ai-chat-body li {
  margin-bottom: 4px;
}

.create-ai-chat-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.12)) 75%, transparent);
  font-size: 12px;
}

.create-ai-chat-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--muted, #9aa3b5);
}

.create-ai-chat-error {
  color: #f87171;
  font-size: 12.5px;
  line-height: 1.5;
}

.create-ai-chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.1)) 75%, transparent);
}

.create-ai-chat-actions .button {
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* Admin LLM Multi-Provider Settings Panel */
.llm-global-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 1120px) {
  .llm-global-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .llm-global-grid {
    grid-template-columns: 1fr;
  }
}

.llm-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.05));
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.15));
  cursor: pointer;
  min-width: 0;
}

.llm-window-card {
  cursor: default;
}

.llm-switch-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.llm-switch-sub {
  font-size: 10.5px;
  color: var(--muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.llm-extra-prompt-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.llm-extra-prompt-row label {
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.llm-extra-prompt-row textarea {
  width: 100%;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.2));
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.04));
  color: var(--ink, #fff);
  resize: vertical;
}

.llm-provider-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, rgba(125, 125, 125, 0.16));
}

.llm-provider-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.llm-provider-section-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.llm-provider-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.llm-provider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.18));
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.04));
}

.llm-provider-card.is-primary {
  border-color: color-mix(in srgb, var(--brand, #7c5cff) 45%, transparent);
  background: color-mix(in srgb, var(--brand, #7c5cff) 6%, transparent);
}

.llm-provider-card.is-disabled {
  opacity: 0.6;
}

.llm-provider-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1 1 320px;
}

.llm-provider-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.llm-priority-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #9aa3b5);
}

.llm-role-primary {
  background: color-mix(in srgb, var(--brand, #7c5cff) 22%, transparent) !important;
  color: #b7a4ff !important;
  border-color: color-mix(in srgb, var(--brand, #7c5cff) 45%, transparent) !important;
}

.llm-role-fallback {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
}

.llm-vision-chip {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #4ade80 !important;
}

.llm-test-chip.is-ok {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ade80 !important;
}

.llm-test-chip.is-fail {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

.llm-provider-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.llm-provider-meta code {
  font-size: 11px;
  word-break: break-all;
}

.llm-provider-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

:root[data-theme="light"] .llm-role-primary {
  color: var(--brand-strong, #5b3df5) !important;
}

:root[data-theme="light"] .llm-vision-chip,
:root[data-theme="light"] .llm-test-chip.is-ok,
:root[data-theme="light"] .create-llm-context-pill {
  color: #15803d !important;
}

:root[data-theme="light"] .create-ai-chat-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .create-context-bar {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

/* LLM Provider Modal: compact 2/3-column layout + guaranteed visible footer */
.admin-dialog.admin-dialog--llm-editor[open] {
  width: min(680px, calc(100vw - 28px)) !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: min(90dvh, 720px) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.admin-editor--llm {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100%;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-height: 0 !important;
  height: auto !important;
  max-height: min(90dvh, 720px) !important;
  overflow: hidden !important;
  padding: 20px 22px 18px !important;
}

.admin-editor--llm .admin-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line, rgba(125, 125, 125, 0.2)) 80%, transparent);
}

.admin-editor--llm .admin-editor-head .icon-button {
  flex-shrink: 0;
}

.admin-editor--llm .section-kicker {
  color: var(--brand, #8b6cff) !important;
}

.admin-editor--llm .llm-editor-footer .button.primary {
  background: linear-gradient(135deg, var(--brand, #7c5cff), var(--brand-strong, #6344f5)) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand, #7c5cff) 34%, transparent) !important;
}

.admin-editor--llm .llm-editor-footer .button.primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.llm-editor-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding-right: 2px;
}

.llm-editor-grid {
  display: grid;
  gap: 12px;
}

.llm-editor-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.llm-editor-grid--3 {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 640px) {
  .llm-editor-grid--2,
  .llm-editor-grid--3 {
    grid-template-columns: 1fr;
  }
}

.llm-editor-body .field {
  margin: 0 !important;
  min-width: 0;
}

.llm-editor-body .field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
}

.llm-editor-body .field input:not([type="checkbox"]),
.llm-editor-body .field select {
  width: 100%;
  height: 38px !important;
  min-height: 38px !important;
  font-size: 13px;
}

.llm-editor-switch-item {
  cursor: pointer;
  margin: 0 !important;
}

.llm-editor-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  margin-top: 4px !important;
  padding-top: 12px !important;
  border-top: 1px solid color-mix(in srgb, var(--line, rgba(125, 125, 125, 0.2)) 80%, transparent);
}

.llm-editor-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .admin-dialog.admin-dialog--llm-editor[open],
  .admin-dialog.admin-dialog--payment-checkout[open] {
    width: min(680px, calc(100vw - 20px)) !important;
    height: fit-content !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 16px !important;
  }

  .admin-editor--llm {
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 10px !important;
  }

  .admin-editor--llm .admin-editor-head {
    padding-bottom: 8px;
  }

  .admin-editor--llm .section-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .llm-editor-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-top: 10px !important;
    margin-top: 2px !important;
  }

  .llm-editor-footer-right {
    margin-left: auto;
    flex-shrink: 0;
  }

  .llm-editor-footer .button {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

.llm-editor-test-banner {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.llm-editor-test-banner.is-testing {
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: var(--brand, #7c5cff);
}

.llm-editor-test-banner.is-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #15803d;
}

.llm-editor-test-banner.is-fail {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

:root[data-theme="dark"] .llm-editor-test-banner.is-ok {
  color: #4ade80;
}

:root[data-theme="dark"] .llm-editor-test-banner.is-fail {
  color: #f87171;
}

/* Light mode polish for LLM settings panel & create context bar */
:root[data-theme="light"] .llm-switch-title,
:root[data-theme="light"] .llm-extra-prompt-row textarea,
:root[data-theme="light"] .create-memory-chip,
:root[data-theme="light"] .create-anchor-pill,
:root[data-theme="light"] .create-llm-context-summary,
:root[data-theme="light"] .create-llm-context-text,
:root[data-theme="light"] .create-llm-context-prompt,
:root[data-theme="light"] .create-llm-copy-btn,
:root[data-theme="light"] .create-ai-chat-body,
:root[data-theme="light"] .create-chat-search-input {
  color: #1c1917;
}

:root[data-theme="light"] .create-llm-context-details {
  background: rgba(124, 92, 255, 0.05);
  border-color: rgba(124, 92, 255, 0.22);
}

:root[data-theme="light"] .create-chat-search-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
}

/* Remote MCP Gateway Badge & Row inside API Keys Panel */
.gateway-badge.mcp {
  background: color-mix(in srgb, var(--brand, #8b6cff) 20%, transparent);
  color: color-mix(in srgb, var(--brand, #9b82ff) 85%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand, #8b6cff) 38%, transparent);
}

:root[data-theme="light"] .gateway-badge.mcp {
  background: rgba(109, 93, 252, 0.12);
  color: var(--brand-strong, #5b3df5);
  border-color: rgba(109, 93, 252, 0.28);
}

.gateway-guide-header--mcp {
  padding-top: 10px;
  border-top: 1px dashed color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.12)) 85%, transparent);
}

.gateway-guide-header--mcp strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gateway-url-box {
  flex-wrap: wrap;
}

:root[data-theme="light"] .gateway-guide-card {
  background: rgba(109, 93, 252, 0.035);
  border-color: rgba(109, 93, 252, 0.14);
}

:root[data-theme="light"] .gateway-url-box code {
  background: rgba(109, 93, 252, 0.08);
  color: var(--brand-strong, #4f46e5);
  border: 1px solid rgba(109, 93, 252, 0.16);
}

:root[data-theme="light"] .gateway-endpoint-item {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* Native V免签 Payment Center & Pricing Checkout UI */
.pricing-monitor-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.pricing-monitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.14)) 90%, transparent);
  background: color-mix(in srgb, var(--panel, rgba(255, 255, 255, 0.05)) 85%, transparent);
  color: var(--ink, #eef1ff);
}

.pricing-monitor-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.pricing-monitor-pill.is-online {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.pricing-monitor-pill.is-online i {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.pricing-monitor-pill.is-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.pricing-monitor-pill.is-warn i {
  background: #f59e0b;
}

:root[data-theme="light"] .pricing-monitor-pill {
  color: #334155;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .pricing-monitor-pill.is-online {
  color: #15803d;
  background: rgba(34, 197, 94, 0.1);
}

:root[data-theme="light"] .pricing-monitor-pill.is-warn {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}

.pricing-redeem-card {
  margin: 22px auto 12px;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand, #8b6cff) 28%, var(--line, rgba(255, 255, 255, 0.12)));
  background: color-mix(in srgb, var(--brand, #8b6cff) 7%, var(--panel, rgba(255, 255, 255, 0.03)));
}

.pricing-redeem-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pricing-redeem-info strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  color: var(--ink, #fff);
}

.pricing-redeem-info strong svg {
  width: 15px;
  height: 15px;
  color: var(--brand, #8b6cff);
}

.pricing-redeem-info span {
  font-size: 12.5px;
  color: var(--muted, #9aa3b5);
}

.pricing-redeem-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
  max-width: 420px;
}

.pricing-redeem-input {
  flex: 1 1 auto;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.18)) 90%, transparent);
  background: color-mix(in srgb, var(--panel-strong, rgba(16, 15, 30, 0.8)) 88%, transparent);
  color: var(--ink, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.4px;
}

:root[data-theme="light"] .pricing-redeem-card {
  background: rgba(109, 93, 252, 0.05);
  border-color: rgba(109, 93, 252, 0.22);
}

:root[data-theme="light"] .pricing-redeem-info strong {
  color: #1c1917;
}

:root[data-theme="light"] .pricing-redeem-input {
  background: #ffffff;
  color: #1c1917;
  border-color: rgba(15, 23, 42, 0.16);
}

/* Checkout Dialog */
.admin-dialog.admin-dialog--payment-checkout[open] {
  width: min(500px, calc(100vw - 24px)) !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: min(92dvh, 720px) !important;
  border-radius: 18px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
}

.payment-select-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-select-summary > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.06));
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.18));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-select-summary span {
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.payment-select-summary strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink, #fff);
}

.payment-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-channel-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.2));
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.04));
  color: var(--ink, #fff);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.payment-channel-card.active {
  border-color: var(--brand, #8b6cff);
  background: color-mix(in srgb, var(--brand, #8b6cff) 14%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #8b6cff) 22%, transparent);
}

.payment-channel-card.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.payment-channel-card span {
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.payment-paying-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.payment-amount-callout {
  width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.payment-amount-label {
  font-size: 11.5px;
  color: var(--muted, #9aa3b5);
}

.payment-amount-value {
  font-size: 26px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.5px;
}

.payment-amount-warn,
.payment-amount-tip {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink, #e8ecff);
}

.payment-qr-frame {
  width: 232px;
  height: 232px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.payment-qr-frame img {
  display: block;
  width: 210px;
  height: 210px;
  object-fit: contain;
}

.payment-polling-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 5px 6px;
  overflow: hidden;
  line-height: 1.4;
  font-size: 12px;
  color: var(--muted, #9aa3b5);
}

.payment-polling-note .spinner {
  width: 16px;
  height: 16px;
  border-width: 2.5px;
  flex-shrink: 0;
  will-change: transform;
}

#paymentCheckoutCountdown {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 40px;
}

.payment-paid-box,
.payment-expired-box {
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.payment-paid-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}

.payment-balance-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand, #8b6cff) 16%, transparent);
  color: var(--ink, #fff);
  font-size: 12.5px;
}

:root[data-theme="light"] .payment-select-summary strong,
:root[data-theme="light"] .payment-channel-card,
:root[data-theme="light"] .payment-amount-warn,
:root[data-theme="light"] .payment-amount-tip,
:root[data-theme="light"] .payment-balance-pill {
  color: #1c1917;
}

/* Admin Payment Center */
.payment-subtab-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.payment-global-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 1080px) {
  .payment-global-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .payment-global-grid {
    grid-template-columns: 1fr !important;
  }
}

.payment-admin-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.payment-admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 980px) {
  .payment-admin-split {
    grid-template-columns: 1fr;
  }
}

.payment-admin-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color, rgba(125, 125, 125, 0.18));
  background: var(--bg-surface-subtle, rgba(125, 125, 125, 0.04));
}

.payment-admin-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13.5px;
}

.payment-vmq-bind-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.payment-vmq-bind-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.payment-vmq-bind-qr img {
  width: 118px;
  height: 118px;
  display: block;
}

.payment-vmq-bind-qr span {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.payment-vmq-meta {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  min-width: 0;
}

.payment-vmq-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted, #9aa3b5);
}

.payment-vmq-line code {
  word-break: break-all;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(125, 125, 125, 0.12);
  color: var(--ink, #fff);
}

:root[data-theme="light"] .payment-vmq-line code {
  color: #1c1917;
  background: rgba(109, 93, 252, 0.08);
}

.payment-qr-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-qr-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-qr-preview {
  width: 128px;
  height: 128px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.22)) 90%, transparent);
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
}

.payment-qr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-qr-preview span {
  font-size: 11.5px;
  color: #64748b;
  text-align: center;
}

.payment-redeem-gen-bar {
  display: grid;
  grid-template-columns: 120px 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

@media (max-width: 760px) {
  .payment-redeem-gen-bar {
    grid-template-columns: 1fr;
  }
}

.payment-redeem-gen-bar .field {
  margin: 0;
}

.payment-redeem-gen-bar .field label {
  display: block;
  font-size: 11.5px;
  margin-bottom: 4px;
  color: var(--muted, #9aa3b5);
}

.payment-redeem-gen-bar .field input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
}

.payment-generated-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.payment-generated-box pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.payment-notify-test-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed color-mix(in srgb, var(--line, rgba(255, 255, 255, 0.14)) 80%, transparent);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-notify-test-row select {
  height: 34px;
  font-size: 12px;
  border-radius: 8px;
  padding: 0 8px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: var(--bg, #0d111d);
  color: var(--ink, #fff);
}

.payment-notify-test-row input {
  flex: 1 1 220px;
  min-width: 0;
  height: 34px;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 0 10px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: var(--bg, #0d111d);
  color: var(--ink, #fff);
}

:root[data-theme="light"] .payment-notify-test-row select,
:root[data-theme="light"] .payment-notify-test-row input {
  background: #ffffff;
  color: #1c1917;
  border-color: rgba(109, 93, 252, 0.18);
}
