:root {
  font-family: var(--jxt-font-ui);
  --surface: rgba(255, 252, 247, 0.76);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-raised: rgba(255, 255, 255, 0.58);
  --line: rgba(31, 24, 18, 0.1);
  --line-strong: rgba(31, 24, 18, 0.18);
  --text: #1f1812;
  --muted: #6d645b;
  --accent: #c55d2e;
  --accent-dark: #8c3619;
  --accent-soft: rgba(197, 93, 46, 0.12);
  --teal: #0f7d78;
  --danger-soft: rgba(166, 63, 35, 0.08);
  --shadow: 0 28px 90px rgba(64, 42, 23, 0.14);
  --shadow-soft: var(--jxt-shadow-panel);
  --shadow-lift: 0 18px 42px rgba(64, 42, 23, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(197, 93, 46, 0.2), transparent 24%),
    radial-gradient(circle at 84% 14%, rgba(15, 125, 120, 0.14), transparent 18%),
    radial-gradient(circle at 58% 86%, rgba(213, 173, 73, 0.13), transparent 20%),
    linear-gradient(135deg, #ece1d1 0%, #f8f5ef 48%, #eee4d7 100%);
  background-attachment: fixed;
}

body.auth-modal-open {
  overflow: hidden;
}

html.image-preview-open,
body.image-preview-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body:not(.admin-page) jxt-image-preview#shared-web-preview .preview-modal {
  overscroll-behavior: contain;
}

/* Desktop's preview is a minimal image-first lightbox. Keep Web controls in
   the DOM for keyboard users and action contracts, but remove their visual
   chrome from the canvas and let the image use the full viewport. */
body:not(.admin-page) jxt-image-preview#shared-web-preview .preview-modal--minimal .preview-top {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 0;
  padding: 0;
  pointer-events: none;
}

body:not(.admin-page) jxt-image-preview#shared-web-preview .preview-modal--minimal .preview-top .icon-button {
  opacity: 0;
  pointer-events: none;
}

body:not(.admin-page) jxt-image-preview#shared-web-preview .preview-modal--minimal .preview-tools {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  min-height: 0;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

body:not(.admin-page) jxt-image-preview#shared-web-preview .preview-modal--minimal .preview-viewport img {
  max-width: 100vw;
  max-height: calc(100vh - 24px);
}

body.auth-locked .app-shell,
body.auth-locked .topbar {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.ambient-glow,
.grid-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-glow {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.44), transparent 28%),
    radial-gradient(circle at 85% 76%, rgba(255, 255, 255, 0.3), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1), transparent 48%);
}

.grid-noise {
  display: none;
}

button,
textarea,
select,
a,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 22px;
  max-width: 1540px;
  margin: 0 auto;
  padding: 22px 24px 26px;
}

.workspace-nav {
  position: sticky;
  top: 24px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 14px;
  min-height: calc(100vh - 128px);
}

.workspace-nav__item {
  display: grid;
  grid-template-rows: 24px auto;
  place-items: center;
  gap: 8px;
  min-height: 78px;
  padding: 12px 8px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.workspace-nav__item.is-active {
  background: rgba(19, 186, 134, 0.12);
  color: #0f7d78;
}

.workspace-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: currentColor;
}

.workspace-nav__icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-stage,
.workspace-panel {
  min-width: 0;
}

.workspace-panel {
  display: none;
}

.workspace-panel.is-active {
  display: block;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 18px;
  min-height: calc(100vh - 128px);
}

.mobile-tab-panel {
  min-width: 0;
}

.topbar {
  position: relative;
  z-index: 1;
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar__brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "mark eyebrow"
    "mark title"
    "mark hint";
  align-items: center;
  column-gap: 16px;
  gap: 4px;
}

.brand-mark {
  grid-area: mark;
  width: clamp(58px, 7vw, 72px);
  height: auto;
  display: block;
}

.topbar__brand .eyebrow {
  grid-area: eyebrow;
}

.topbar__brand strong {
  grid-area: title;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

.topbar__brand span {
  grid-area: hint;
  color: var(--muted);
  line-height: 1.6;
}

.topbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.topbar__actions > * {
  box-shadow: var(--shadow-soft);
}

.auth-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.auth-user-badge__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1e9d68;
  box-shadow: 0 0 0 6px rgba(30, 157, 104, 0.12);
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(203, 98, 49, 0.22);
  background: rgba(255, 250, 245, 0.94);
  box-shadow: var(--shadow-soft);
}

.credit-badge__label {
  color: var(--muted);
  font-size: 0.88rem;
}

.credit-badge strong {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1rem;
}

.credit-badge__meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 28px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.history-pane {
  position: sticky;
  top: 24px;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 128px);
  max-height: calc(100vh - 128px);
  padding: 22px;
  overflow: hidden;
}

.chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: calc(100vh - 128px);
  padding: 18px;
  gap: 16px;
}

.queue-pane,
.record-pane {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: calc(100vh - 128px);
  padding: 18px;
}

.queue-pane__toolbar,
.record-pane__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-pane__new-task {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.84);
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
}

.queue-card {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(15, 125, 120, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
}

.queue-card.is-active {
  border-color: rgba(15, 125, 120, 0.28);
  box-shadow: 0 0 0 4px rgba(15, 125, 120, 0.08);
}

.queue-card.is-prompt-open {
  z-index: 9;
}

.queue-card__preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(15, 125, 120, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(221, 247, 239, 0.8), rgba(255, 255, 255, 0.9));
  cursor: pointer;
  box-shadow: none;
}

.queue-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.queue-card__preview img[data-generated-image-src],
.record-card__thumb img[data-generated-image-src],
#result-image[data-generated-image-src] {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.queue-card__preview img[data-generated-image-src].is-loaded,
.record-card__thumb img[data-generated-image-src].is-loaded,
#result-image[data-generated-image-src].is-loaded {
  opacity: 1;
}

.queue-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.queue-card__placeholder--progress {
  gap: 8px;
  align-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--glow-a-x, 18%) var(--glow-a-y, 18%), rgba(58, 210, 130, 0.52), transparent 30%),
    radial-gradient(circle at var(--glow-b-x, 82%) var(--glow-b-y, 74%), rgba(26, 175, 153, 0.44), transparent 34%),
    linear-gradient(135deg, #f6fff8 0%, #dff4e8 46%, #f7fcf8 100%);
  background-size: 190% 190%, 180% 180%, 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(24, 160, 88, 0.14);
  animation: queue-generation-drift var(--drift-duration, 4.8s) ease-in-out infinite;
  animation-delay: var(--drift-delay, 0s);
}

.queue-card__placeholder--progress::before {
  content: "";
  position: absolute;
  inset: -42%;
  background:
    conic-gradient(
      from var(--sweep-angle, 120deg),
      transparent 0deg,
      rgba(255, 255, 255, 0.08) 48deg,
      rgba(255, 255, 255, 0.86) 92deg,
      rgba(36, 198, 128, 0.34) 142deg,
      transparent 218deg,
      transparent 360deg
    );
  filter: blur(1px);
  opacity: 0.95;
  animation: queue-generation-rotate var(--rotate-duration, 5.6s) linear infinite;
  animation-delay: var(--rotate-delay, 0s);
}

.queue-card__placeholder--progress::after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: var(--beam-y, 50%);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), rgba(62, 210, 137, 0.62), transparent);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.9),
    0 0 48px rgba(24, 160, 88, 0.36);
  transform: translateY(-50%);
  animation: queue-generation-breathe var(--beam-duration, 2s) ease-in-out infinite;
  animation-delay: var(--beam-delay, 0s);
}

.queue-card__progress-time {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
}

.queue-card__progress-label {
  position: relative;
  z-index: 1;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.queue-card__progress-stage {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.queue-card__status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.queue-card__status--pending {
  color: var(--accent-dark);
}

.queue-card__status--failed {
  color: #9b3522;
}

.queue-card__body {
  display: grid;
  gap: 10px;
}

.queue-card__title-row {
  position: relative;
  min-width: 0;
  padding-right: 34px;
}

.queue-card__title {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: none;
}

.queue-card__title:hover,
.queue-card__title:focus-visible {
  color: var(--accent);
}

.queue-card__title:focus-visible {
  outline: 2px solid rgba(24, 160, 88, 0.24);
  outline-offset: 3px;
}

.queue-card__prompt-copy {
  position: absolute;
  top: -4px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(24, 160, 88, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.queue-card__prompt-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.queue-card__prompt-copy:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.queue-card__prompt-copy:focus-visible {
  border-color: rgba(24, 160, 88, 0.32);
  background: rgba(240, 251, 245, 0.98);
}

.queue-card__prompt-copy:focus-visible {
  outline: 2px solid rgba(24, 160, 88, 0.28);
  outline-offset: 2px;
}

.queue-card__prompt-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 8;
  padding: 12px;
  border: 1px solid rgba(24, 160, 88, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.queue-card__prompt-popover[hidden] {
  display: none;
}

.queue-card__prompt-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.queue-card__prompt-popover-head strong {
  font-size: 0.86rem;
}

.queue-card__prompt-popover p {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.queue-card__prompt-popover-copy {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(24, 160, 88, 0.18);
  border-radius: 999px;
  background: rgba(240, 251, 245, 0.96);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.queue-card__prompt-popover-copy:hover,
.queue-card__prompt-popover-copy:focus-visible {
  border-color: rgba(24, 160, 88, 0.32);
  background: rgba(226, 247, 234, 0.98);
}

.queue-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.queue-card__download,
.queue-card__reference,
.queue-card__regenerate,
.queue-card__details-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.queue-card__download,
.queue-card__reference,
.queue-card__details-toggle {
  width: fit-content;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

.queue-card__download {
  text-decoration: none;
}

.queue-card__reference {
  border-color: rgba(24, 160, 88, 0.2);
  background: rgba(240, 251, 245, 0.96);
  color: var(--accent);
}

.queue-card__reference:hover:not(:disabled) {
  background: rgba(226, 247, 234, 0.98);
}

.queue-card__reference:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.queue-card__regenerate {
  width: fit-content;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(197, 93, 46, 0.22);
  border-radius: 14px;
  background: rgba(255, 247, 239, 0.96);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

.queue-card__regenerate:hover:not(:disabled) {
  background: rgba(255, 235, 219, 0.98);
}

.queue-card__regenerate:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.queue-card__download.is-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.queue-card__details-toggle {
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.queue-card__details-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.queue-card__details {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}

.queue-card__frontend-debug {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(31, 24, 18, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.queue-card__frontend-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.queue-card__debug-copy {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(24, 160, 88, 0.2);
  border-radius: 8px;
  background: rgba(240, 251, 245, 0.9);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.queue-card__debug-copy:hover,
.queue-card__debug-copy:focus-visible {
  border-color: rgba(24, 160, 88, 0.36);
  background: rgba(229, 247, 237, 0.98);
}

.queue-card__debug-copy:focus-visible {
  outline: 2px solid rgba(24, 160, 88, 0.28);
  outline-offset: 2px;
}

.queue-card__frontend-debug-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.queue-card__frontend-debug-list li {
  display: grid;
  grid-template-columns: 62px minmax(90px, 0.7fr) minmax(0, 1.3fr);
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.queue-card__frontend-debug-list span,
.queue-card__frontend-debug-list strong,
.queue-card__frontend-debug-list em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.queue-card__frontend-debug-list strong {
  color: var(--text);
  font-style: normal;
}

.queue-card__frontend-debug-list em {
  font-style: normal;
}

.queue-card__pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 24, 18, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

.queue-card__pill--request-id {
  gap: 6px;
  padding-right: 6px;
}

.queue-card__pill-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(24, 160, 88, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  cursor: pointer;
}

.queue-card__pill-copy svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.queue-card__pill-copy:hover,
.queue-card__pill-copy:focus-visible {
  border-color: rgba(24, 160, 88, 0.32);
  background: rgba(240, 251, 245, 0.98);
}

.queue-card__pill-copy:focus-visible {
  outline: 2px solid rgba(24, 160, 88, 0.28);
  outline-offset: 2px;
}

.queue-card__pill-copy:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.record-list {
  display: grid;
  gap: 14px;
}

.record-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(31, 24, 18, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.record-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.record-card__meta,
.record-card__summary {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  font-weight: 500;
}

.record-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 600;
}

.record-card--row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.record-card--header {
  padding: 10px 20px;
  border-style: dashed;
  background: rgba(247, 252, 249, 0.92);
  box-shadow: none;
  cursor: default;
}

.record-card__cell {
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
}

.record-card__cell--id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.record-card__id-trigger {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}

.record-card__id-trigger:focus-visible {
  outline: 2px solid rgba(24, 160, 88, 0.28);
  outline-offset: 2px;
  border-radius: 5px;
}

.record-card__cell--prompt {
  display: grid;
  gap: 8px;
  color: var(--text);
}

.record-card__content {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.record-card__prompt-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-card__prompt-text.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: initial;
}

.record-card__prompt-text.is-toggleable {
  cursor: pointer;
}

.record-card__prompt-line {
  display: block;
  align-items: start;
}

.record-card__prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-card__copy-button,
.record-card__prompt-action {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
}

.record-card__copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  vertical-align: -0.45em;
}

.record-card__copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.record-card__copy-button:hover,
.record-card__copy-button:focus-visible,
.record-card__prompt-action:hover,
.record-card__prompt-action:focus-visible {
  border-color: rgba(24, 160, 88, 0.26);
  background: rgba(240, 251, 245, 0.96);
  color: var(--accent);
}

.record-card__copy-button--id {
  flex: 0 0 auto;
}

.record-card__copy-button--prompt {
  margin-left: 6px;
}

.record-card__thumb {
  position: relative;
  align-self: start;
  width: 96px;
  aspect-ratio: 3 / 4;
  height: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.record-card__thumb > span:not(.queue-card__placeholder) {
  display: none;
}

.record-card__thumb .queue-card__placeholder--progress {
  gap: 5px;
  padding: 9px;
  border-radius: inherit;
}

.record-card__thumb .queue-card__progress-label {
  font-size: 0.76rem;
}

.record-card__thumb .queue-card__progress-stage {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.68rem;
  line-height: 1.25;
}

.record-card__thumb .queue-card__progress-time {
  font-size: 1.18rem;
}

.record-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.record-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-self: end;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.record-card__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.record-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

.record-card__action--primary {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.record-card__action:disabled,
.record-card__action.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.record-card__action.is-disabled {
  pointer-events: none;
}

.record-card__action:hover:not(:disabled):not(.is-disabled),
.record-card__action:focus-visible {
  border-color: rgba(24, 160, 88, 0.26);
  background: rgba(240, 251, 245, 0.96);
  color: var(--accent);
}

.record-card__action--primary:hover:not(.is-disabled),
.record-card__action--primary:focus-visible {
  border-color: transparent;
  background: var(--accent-dark);
  color: #fff;
}

.mobile-account-pane {
  display: none;
  padding: 22px;
  gap: 18px;
}

.mobile-account-pane__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.mobile-account-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-account-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
}

.mobile-account-card__label {
  color: var(--muted);
  font-size: 0.88rem;
}

.mobile-account-card strong {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.08rem;
  line-height: 1.2;
}

.mobile-account-card__meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.88rem;
}

.mobile-account-actions {
  display: grid;
  gap: 10px;
}

.mobile-bottom-nav {
  display: none;
}

.history-pane__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.history-pane__head h1 {
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  line-height: 1.15;
}

.history-pane__copy,
.history-empty p,
.history-card__prompt,
.empty-state p,
.empty-copy,
.status,
.attachment-preview__body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
}

.meta-pill,
.history-card__meta span,
.featured-details span,
.featured-detail-copy {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 0;
  background: rgba(31, 24, 18, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}

.featured-detail-copy {
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.featured-detail-copy:hover {
  transform: translateY(-1px);
  background: rgba(197, 93, 46, 0.12);
}

.featured-detail-copy:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.16);
}

.history-pane__quick,
.history-card__actions,
.history-card__meta,
.featured-details,
.conversation-actions,
.composer-tools,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(31, 24, 18, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.details-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.details-toggle.is-open::after {
  transform: translateY(2px) rotate(225deg);
}

.details-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(197, 93, 46, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.details-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.16);
  border-color: rgba(197, 93, 46, 0.34);
}

.diagnostic-actions {
  display: flex;
  justify-content: flex-end;
}

.history-pane__quick {
  display: grid;
  grid-template-columns: 1fr;
}

.history-pane__quick #new-task-button {
  width: 100%;
}

.history-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 18px;
  border-radius: 24px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.48);
  text-align: center;
}

.history-list {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  contain: layout paint;
}

.history-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  max-width: 100%;
  min-height: 128px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  overflow: hidden;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 128px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.history-card--completed,
.history-card--failed {
  padding-bottom: 54px;
}

.history-card:focus-visible {
  outline: none;
  border-color: rgba(197, 93, 46, 0.28);
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.12);
}

.history-card.is-active {
  border-color: rgba(197, 93, 46, 0.2);
  background: rgba(197, 93, 46, 0.08);
}

.history-card__top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.history-card__status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 72px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(31, 24, 18, 0.08);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card__status--pending {
  background: rgba(197, 93, 46, 0.12);
  color: var(--accent-dark);
}

.history-card__status--failed {
  background: rgba(166, 63, 35, 0.12);
  color: #9b3522;
}

.history-card__meta-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card__delete {
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(166, 63, 35, 0.18);
  border-radius: 999px;
  background: rgba(166, 63, 35, 0.08);
  color: #9b3522;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.history-card__actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
  padding-left: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 252, 247, 0.94) 28%);
}

.history-card__retry {
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(197, 93, 46, 0.22);
  border-radius: 999px;
  background: rgba(197, 93, 46, 0.08);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.history-card__retry:hover {
  background: rgba(197, 93, 46, 0.14);
}

.history-card__retry:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.14);
}

.history-card__delete:hover {
  background: rgba(166, 63, 35, 0.14);
}

.history-card__delete:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(166, 63, 35, 0.12);
}

.history-prompt-item {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  box-shadow: none;
  pointer-events: none;
}

.history-card--completed .history-prompt-item {
  padding-right: 76px;
}

.history-card--failed .history-prompt-item {
  padding-right: 156px;
}

.history-prompt-item__summary {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 3.2em;
  max-height: 3.2em;
  font-weight: 700;
  line-height: 1.6;
}

.history-prompt-item:focus-visible {
  outline: none;
  box-shadow: none;
}

.history-card:hover {
  transform: translateY(-2px);
  border-color: rgba(197, 93, 46, 0.16);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow-lift);
}

.history-prompt-item:hover {
  color: var(--accent-dark);
}

.ghost-button,
.primary-button,
.primary-link,
.inline-button,
.attach-trigger,
select,
input[type="number"] {
  border-radius: 18px;
  border: 1px solid rgba(31, 24, 18, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.ghost-button,
.primary-button,
.primary-link,
.inline-button,
.attach-trigger {
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ghost-button:focus-visible,
.primary-button:focus-visible,
.primary-link:focus-visible,
.inline-button:focus-visible,
.attach-trigger:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.16);
  border-color: rgba(197, 93, 46, 0.34);
}

textarea:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(31, 24, 18, 0.08);
}

.ghost-button:hover,
.primary-button:hover,
.primary-link:hover:not(.disabled),
.inline-button:hover,
.attach-trigger:hover {
  transform: translateY(-1px);
}

.ghost-button--danger {
  background: var(--danger-soft);
}

.primary-button,
.primary-link {
  border: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff8f2;
  box-shadow: 0 18px 34px rgba(142, 58, 27, 0.24);
}

.primary-button:hover,
.primary-link:hover:not(.disabled) {
  box-shadow: 0 22px 42px rgba(142, 58, 27, 0.28);
}

.primary-link.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.purchase-link {
  white-space: nowrap;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 6px;
}

.empty-state {
  margin: auto;
  max-width: 520px;
  padding: 28px;
  border-radius: 26px;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--line-strong);
}

.chat-bubble {
  max-width: min(860px, 92%);
  padding: 18px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.chat-bubble--user {
  position: relative;
  align-self: flex-end;
  background: rgba(203, 98, 49, 0.12);
  border: 1px solid rgba(203, 98, 49, 0.18);
  padding-bottom: 52px;
}

.chat-bubble--user p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.user-prompt-copy-button {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(203, 98, 49, 0.24);
  background: rgba(255, 255, 255, 0.92);
  color: #8f3418;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.chat-bubble--user:hover .user-prompt-copy-button,
.chat-bubble--user:focus-within .user-prompt-copy-button {
  opacity: 1;
  pointer-events: auto;
}

.user-prompt-copy-button:hover {
  background: rgba(255, 255, 255, 1);
}

.user-prompt-copy-button:focus-visible {
  outline: 2px solid rgba(203, 98, 49, 0.42);
  outline-offset: 2px;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid rgba(24, 160, 88, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.3;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
}

.assistant-card__top {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.chat-bubble__label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}

.featured-shell {
  position: relative;
  min-height: 260px;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(31, 24, 18, 0.12);
  background:
    radial-gradient(circle at 50% 14%, rgba(197, 93, 46, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 229, 0.98));
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  contain: layout paint;
}

.featured-shell img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  cursor: zoom-in;
}

.result-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 520px;
}

.result-variant {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.result-variant.is-active {
  border-color: var(--accent);
}

.result-variant img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-details {
  display: none;
  padding: 0;
  max-width: 100%;
}

.featured-details.is-expanded {
  display: flex;
}

.conversation-actions {
  justify-content: flex-end;
  max-width: 520px;
}

.info-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(197, 93, 46, 0.14);
  background: rgba(197, 93, 46, 0.08);
  color: var(--accent-dark);
  line-height: 1.7;
}

.info-card--subtle {
  border-color: rgba(31, 24, 18, 0.08);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

.composer-bar {
  display: grid;
  gap: 10px;
}

.composer-shell {
  position: relative;
  padding: 16px;
  border-radius: 28px;
  border: 1px solid rgba(31, 24, 18, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 252, 247, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 16px 36px rgba(64, 42, 23, 0.08);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.composer-shell.is-attachment-dragging {
  border-color: rgba(37, 99, 235, 0.42);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 252, 247, 0.94));
  box-shadow:
    inset 0 0 0 2px rgba(37, 99, 235, 0.16),
    0 18px 40px rgba(37, 99, 235, 0.14);
}

.composer-shell--create {
  display: grid;
  gap: 18px;
  padding: 18px 18px 14px;
  border-color: rgba(16, 157, 111, 0.18);
  background:
    radial-gradient(circle at top left, rgba(16, 157, 111, 0.05), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 249, 0.96));
}

.create-toolbar {
  display: flex;
  justify-content: flex-end;
}

.ghost-button--compact {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 500;
  box-shadow: none;
}

.create-section {
  display: grid;
  gap: 12px;
}

.create-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.create-section__title-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.create-section__index,
.create-section__title,
.section-link-button,
.style-card__label,
.recent-ratio-card__label,
.ratio-option__name,
.ratio-option__detail,
.generation-cost-summary,
#clarity {
  font-weight: 500;
}

.create-section__index {
  color: #0b8a63;
}

.create-section__title {
  margin: 0;
  font-size: 1.02rem;
}

.section-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0d7d6f;
  cursor: pointer;
}

.style-grid {
  display: grid;
  gap: 12px;
}

.style-grid--recent {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.style-grid--modal {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.style-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0;
  border: 1px solid rgba(20, 37, 63, 0.08);
  background: transparent;
  cursor: pointer;
}

.style-card__preview {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 1px solid rgba(20, 37, 63, 0.08);
  background: #f7f2e7;
  overflow: hidden;
}

.style-card__preview--image {
  position: relative;
  background: #f7f2e7;
}

.style-card .style-card__preview.style-card__preview--image::before,
.style-card .style-card__preview.style-card__preview--image::after {
  content: none;
}

.style-card__preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-card__preview picture {
  display: block;
  width: 100%;
  height: 100%;
}

.style-card--student .style-card__preview {
  background:
    radial-gradient(circle at 78% 22%, rgba(225, 164, 26, 0.84), transparent 20%),
    linear-gradient(145deg, #3f2014 0%, #201e31 100%);
}

.style-card--student .style-card__preview::before {
  content: "";
  position: absolute;
  inset: 8% 62% 72% 0;
  background: linear-gradient(135deg, rgba(255, 196, 93, 0.92), transparent);
  transform: rotate(-18deg);
}

.style-card--student .style-card__preview::after {
  content: "";
  position: absolute;
  inset: 18% 8% 52% -8%;
  background: linear-gradient(135deg, rgba(255, 241, 216, 0.95), rgba(197, 174, 132, 0.55));
  transform: rotate(-18deg);
}

.style-card--cartoon .style-card__preview {
  background:
    radial-gradient(circle at 34% 34%, #ffe08f 0 14%, transparent 15%),
    radial-gradient(circle at 66% 24%, #6dbef0 0 12%, transparent 13%),
    radial-gradient(circle at 52% 58%, #f69ac4 0 11%, transparent 12%),
    linear-gradient(145deg, #e1f1fb 0%, #fff1b8 100%);
}

.style-card--handwritten .style-card__preview {
  background:
    radial-gradient(circle at 54% 34%, rgba(157, 239, 199, 0.58), transparent 18%),
    linear-gradient(170deg, transparent 40%, rgba(158, 170, 177, 0.7) 42%, transparent 44%),
    linear-gradient(10deg, transparent 56%, rgba(177, 196, 183, 0.7) 58%, transparent 60%),
    #fcf6ea;
}

.style-card--chalkboard .style-card__preview {
  background:
    radial-gradient(circle at 50% 42%, rgba(233, 190, 38, 0.92), transparent 12%),
    radial-gradient(circle at 50% 42%, transparent 0 18%, rgba(156, 128, 29, 0.84) 19% 27%, transparent 28%),
    linear-gradient(180deg, #112628 0%, #172332 100%);
}

.style-card--paper .style-card__preview {
  background:
    radial-gradient(circle at 62% 28%, rgba(255, 199, 44, 0.8), transparent 16%),
    linear-gradient(145deg, rgba(255, 232, 203, 0.68), transparent 48%),
    linear-gradient(135deg, #fff9ef 0%, #fff0b7 100%);
}

.style-card--mint .style-card__preview {
  background:
    radial-gradient(circle at 28% 32%, rgba(106, 224, 190, 0.56), transparent 20%),
    radial-gradient(circle at 72% 66%, rgba(106, 224, 190, 0.38), transparent 18%),
    linear-gradient(135deg, #dff8ee 0%, #c8f3e6 100%);
}

.style-card--marker .style-card__preview {
  background:
    linear-gradient(170deg, transparent 34%, rgba(161, 191, 248, 0.72) 35% 43%, transparent 44%),
    linear-gradient(12deg, transparent 52%, rgba(255, 184, 120, 0.8) 53% 61%, transparent 62%),
    #fff0da;
}

.style-card--blueprint .style-card__preview {
  background:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(180deg, #20398a 0%, #2a4dc8 100%);
  background-size: 16px 16px, 16px 16px, 100% 100%;
}

.style-card--warm .style-card__preview {
  background:
    radial-gradient(circle at 28% 26%, rgba(251, 219, 90, 0.68), transparent 14%),
    radial-gradient(circle at 72% 64%, rgba(255, 190, 142, 0.42), transparent 18%),
    linear-gradient(135deg, #fff5e7 0%, #ffe8d6 100%);
}

.style-card__label {
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.style-card__check {
  position: absolute;
  top: 10px;
  left: 10px;
  display: none;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #10a56b;
  color: #fff;
  font-size: 0.92rem;
}

.style-card__zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(17, 24, 39, 0.88);
  cursor: pointer;
  opacity: 0;
  transform: translateY(2px) scale(0.94);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.style-card__zoom svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.style-card:hover .style-card__zoom,
.style-card:focus-within .style-card__zoom,
.style-card__zoom:hover,
.style-card__zoom:focus-visible {
  color: rgba(12, 18, 28, 0.96);
  background: rgba(255, 255, 255, 0.92);
  opacity: 1;
  box-shadow:
    0 16px 28px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: translateY(0) scale(1);
}

.style-card__zoom:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.78);
  outline-offset: 2px;
}

.style-card:focus-visible .style-card__preview {
  outline: 2px solid rgba(16, 165, 107, 0.26);
  outline-offset: 3px;
}

.style-card[aria-pressed="true"] .style-card__preview {
  border: 2px solid #10a56b;
}

.style-card[aria-pressed="true"] .style-card__check {
  display: grid;
}

.prompt-surface {
  position: relative;
  min-height: 144px;
  padding: 16px 16px 78px;
  border-radius: 18px;
  border: 1px solid rgba(20, 37, 63, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.prompt-surface textarea {
  min-height: 120px;
}

.prompt-surface__floating {
  position: absolute;
  left: 14px;
  right: 104px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.prompt-surface__count {
  color: var(--muted);
}

.prompt-surface__meta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prompt-surface__clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.prompt-surface__clear:hover:not(:disabled),
.prompt-surface__clear:focus-visible {
  color: var(--accent-dark);
}

.prompt-surface__clear:focus-visible {
  outline: 2px solid rgba(197, 93, 46, 0.28);
  outline-offset: 3px;
}

.prompt-surface__clear:disabled {
  cursor: default;
  opacity: 0.45;
}

.attach-trigger--inline {
  width: 54px;
  height: 54px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed rgba(70, 212, 169, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
}

.attach-trigger__label {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.attach-trigger__icon {
  font-size: 1rem;
}

.attachment-strip {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.attachment-strip--inline .attachment-strip__list {
  display: flex;
  gap: 10px;
}

.attachment-preview-item {
  position: relative;
}

.attachment-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  cursor: zoom-in;
}

.attachment-thumb--inline {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}

.attachment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb__upload-state {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
}

.attachment-preview-item[data-reference-upload-state="ready"] .attachment-thumb__upload-state {
  background: #16a34a;
}

.attachment-preview-item[data-reference-upload-state="uploading"] .attachment-thumb__upload-state {
  background: #2563eb;
  animation: reference-upload-pulse 1.1s ease-in-out infinite;
}

.attachment-preview-item[data-reference-upload-state="failed"] .attachment-thumb__upload-state {
  background: #dc2626;
}

.attachment-thumb__retry {
  position: absolute;
  left: 50%;
  bottom: 5px;
  z-index: 2;
  transform: translateX(-50%);
  min-height: 22px;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.9);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}

.attachment-thumb__retry:hover,
.attachment-thumb__retry:focus-visible {
  background: #991b1b;
}

@keyframes reference-upload-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.attachment-thumb__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 24, 18, 0.72);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.attachment-preview-item:hover .attachment-thumb__remove,
.attachment-preview-item:focus-within .attachment-thumb__remove {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.attachment-thumb__remove:hover,
.attachment-thumb__remove:focus-visible {
  background: rgba(31, 24, 18, 0.9);
}

.image-preview-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(18, 14, 11, 0.66);
  box-shadow: none;
  overflow: hidden;
  contain: layout paint size;
}

.image-preview-dialog::backdrop {
  background: var(--jxt-color-overlay);
}

.image-preview-dialog__toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 20px;
  height: 54px;
  padding: 6px 16px;
  border-radius: var(--jxt-radius-pill);
  background: var(--jxt-color-preview);
  border: 1px solid var(--jxt-color-border-inverse);
  box-shadow: var(--jxt-shadow-preview);
  z-index: 2;
  backdrop-filter: blur(16px);
}

.image-preview-dialog__tool,
.image-preview-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.image-preview-dialog__tool:hover,
.image-preview-dialog__close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.image-preview-dialog__tool svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#download-preview-button,
#admin-preview-download {
  width: 42px;
  min-width: 42px;
  background: transparent;
}

#download-preview-button:hover,
#admin-preview-download:hover {
  background: rgba(255, 255, 255, 0.1);
}

.image-preview-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 42px;
  padding: 0;
  font-size: 1.05rem;
  z-index: 2;
}

#reset-preview-button,
#admin-preview-reset {
  display: none;
}

.image-preview-dialog__resolution {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(26, 27, 26, 0.86);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.88rem;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(14px);
}

.image-preview-dialog__resolution:empty {
  display: none;
}

.image-preview-dialog__viewport {
  overflow: hidden;
  width: 100%;
  height: 100%;
  cursor: default;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
  contain: layout paint;
}

.image-preview-dialog__viewport.is-dragging {
  cursor: grabbing;
}

.image-preview-dialog img {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
}

textarea {
  width: 100%;
  min-height: 116px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  resize: none;
  outline: none;
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.composer-tools {
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.composer-tools select {
  min-width: 118px;
  min-height: 46px;
  padding: 0 42px 0 14px;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 2px),
    calc(100% - 16px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.composer-tools input[type="number"] {
  min-width: 118px;
  min-height: 46px;
  padding: 0 14px;
  appearance: textfield;
  -moz-appearance: textfield;
  box-shadow: none;
}

.composer-tools input[type="number"]::-webkit-outer-spin-button,
.composer-tools input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#clarity {
  min-width: 112px;
}

#api-channel {
  min-width: 150px;
}

#quality {
  min-width: 128px;
}

#image-count {
  min-width: 0;
  width: 38px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
  box-shadow: none;
}

.image-count-control {
  min-width: 128px;
  min-height: 46px;
  padding: 0 10px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid rgba(31, 24, 18, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.image-count-control:focus-within {
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.16);
  border-color: rgba(197, 93, 46, 0.34);
}

.image-count-control__label {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9rem;
}

.image-count-control__stepper {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.image-count-step {
  width: 14px;
  height: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.image-count-step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.image-count-step--up::before {
  border-bottom: 6px solid var(--muted);
}

.image-count-step--down::before {
  border-top: 6px solid var(--muted);
}

.image-count-step:hover::before {
  border-bottom-color: var(--text);
  border-top-color: var(--text);
}

.ratio-picker {
  position: relative;
  flex: 0 0 auto;
}

.ratio-picker__panel {
  position: absolute;
  box-sizing: border-box;
  left: 50%;
  top: calc(100% + 10px);
  bottom: auto;
  z-index: 20;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-50%);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.55);
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: 0 22px 60px rgba(30, 41, 59, 0.18);
}

.ratio-picker__panel[data-placement="above"] {
  top: auto;
  bottom: calc(100% + 10px);
}

.ratio-picker__panel[data-placement="below"] {
  top: calc(100% + 10px);
  bottom: auto;
}

.ratio-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  color: #243447;
  font-size: 0.9rem;
  font-weight: 800;
}

.ratio-picker__head strong {
  color: #2f7cff;
}

.ratio-picker__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ratio-option {
  display: grid;
  grid-template-rows: 32px 16px 14px;
  justify-items: center;
  align-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 92px;
  padding: 10px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.ratio-option:hover,
.ratio-option:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(82, 145, 255, 0.42);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
}

.ratio-option[aria-pressed="true"] {
  border-color: #4d97ff;
  background: #eef6ff;
  color: #2f7cff;
  box-shadow: inset 0 0 0 1px rgba(77, 151, 255, 0.25);
}

.ratio-option__shape {
  display: block;
  align-self: center;
  width: var(--ratio-preview-width, 18px);
  height: var(--ratio-preview-height, 18px);
  border-radius: 2px;
  background: #dbe3ee;
}

.ratio-option[aria-pressed="true"] .ratio-option__shape {
  background: #5a9dff;
}

.ratio-option__name {
  color: #53657d;
  font-size: 0.78rem;
  line-height: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratio-option[aria-pressed="true"] .ratio-option__name {
  color: #2f7cff;
}

.ratio-option__detail {
  color: #86a0bd;
  font-size: 0.68rem;
  line-height: 14px;
  text-align: center;
}

.composer-actions {
  align-items: center;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 220px;
}

.composer-footer--create {
  flex-direction: column;
  align-items: stretch;
}

.composer-tools--create {
  justify-content: flex-start;
}

.composer-actions--create {
  align-items: stretch;
  min-width: 0;
}

.composer-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.generation-cost-summary {
  flex-basis: auto;
  text-align: left;
  color: var(--accent-dark);
  font-size: 0.88rem;
  line-height: 1.35;
}

.recent-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recent-ratio-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 96px;
  padding: 14px 10px 12px;
  border: 1px solid rgba(20, 37, 63, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.recent-ratio-card__shape {
  display: block;
  width: var(--ratio-preview-width, 18px);
  height: var(--ratio-preview-height, 18px);
  border-radius: 3px;
  border: 2px solid #7a869a;
}

.recent-ratio-card__label {
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.recent-ratio-card[aria-pressed="true"] {
  border-color: rgba(16, 157, 111, 0.34);
  box-shadow: 0 0 0 1px rgba(16, 157, 111, 0.2);
}

.style-modal {
  width: min(1040px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.24);
}

.style-modal::backdrop {
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(6px);
}

.style-modal__shell {
  padding: 22px;
}

.style-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.style-modal__title {
  font-size: 2rem;
}

.status {
  padding: 0 8px;
}

.status--subtle {
  display: none;
}

.status--subtle:not([hidden]) {
  display: block;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 13, 0.5);
  backdrop-filter: blur(10px);
}

.auth-modal__dialog {
  position: relative;
  width: min(620px, calc(100% - 32px));
  max-width: 100%;
  padding: 24px;
  display: grid;
  gap: 16px;
  overflow-x: hidden;
}

.auth-modal__dialog--account {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-modal__dialog--account > .auth-modal__head,
.auth-modal__dialog--account > .auth-message,
.auth-modal__dialog--account > .auth-panel {
  grid-column: 1 / -1;
}

.auth-modal__dialog,
.admin-panel,
.history-pane,
.chat-pane,
.mobile-account-pane {
  box-shadow: var(--shadow);
}

.auth-modal__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
}

.auth-modal__title-block {
  min-width: 0;
}

.auth-modal__title-block h2 {
  margin: 0;
  white-space: nowrap;
}

.credit-alert-panel {
  width: min(520px, calc(100vw - 32px));
}

.reset-password-panel {
  width: min(520px, calc(100vw - 32px));
}

.reset-password-panel__head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: flex-start;
}

.reset-password-panel__head .ghost-button {
  min-height: 40px;
  padding: 0 14px;
}

.credit-alert-panel__head {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.credit-alert-panel__message {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(203, 98, 49, 0.24);
  border-radius: 12px;
  background: rgba(255, 247, 242, 0.94);
  color: #9f3415;
  line-height: 1.7;
}

.credit-alert-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.credit-alert-panel__actions .ghost-button,
.credit-alert-panel__actions .purchase-link {
  width: 100%;
  justify-content: center;
}

.short-prompt-panel {
  width: min(500px, calc(100vw - 32px));
  gap: 18px;
}

.short-prompt-panel #short-prompt-title {
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.35;
  white-space: normal;
}

.short-prompt-panel__lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.short-prompt-panel__body {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.65;
}

.short-prompt-panel__body p {
  margin: 0;
  color: var(--text);
}

.short-prompt-panel__body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.short-prompt-panel__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.short-prompt-panel__actions .primary-button,
.short-prompt-panel__actions .ghost-button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

@media (max-width: 520px) {
  .short-prompt-panel__actions {
    grid-template-columns: 1fr;
  }

  .short-prompt-panel #short-prompt-title {
    font-size: 1.22rem;
  }
}

.auth-account-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.auth-tabs .ghost-button {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.auth-tabs .ghost-button:hover {
  transform: none;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.36);
}

.auth-tabs .is-active {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(64, 42, 23, 0.1);
}

.auth-tab-button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(31, 24, 18, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  color: var(--muted);
}

.auth-tab-button:hover {
  transform: none;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.36);
}

.auth-tab-button.is-active {
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(64, 42, 23, 0.1);
}

.auth-panel {
  display: grid;
  gap: 12px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form--subtle {
  padding: 14px;
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.48);
}

.auth-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

.auth-text-button:hover,
.auth-text-button:focus-visible {
  color: #0b645f;
  text-decoration: underline;
}

.auth-text-button:focus-visible {
  outline: none;
}

.redeem-panel .auth-form {
  gap: 14px;
}

.redeem-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.redeem-tip {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-field input {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(197, 93, 46, 0.44);
  box-shadow: 0 0 0 4px rgba(197, 93, 46, 0.12);
}

.auth-field input[readonly] {
  border-color: rgba(64, 42, 23, 0.12);
  background: rgba(241, 234, 224, 0.82);
  color: var(--muted);
  cursor: not-allowed;
}

.auth-field input[readonly]:focus {
  border-color: rgba(64, 42, 23, 0.12);
  box-shadow: none;
}

.auth-switch {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 700;
}

.auth-message[data-type="error"] {
  border-color: rgba(166, 63, 35, 0.22);
  background: rgba(166, 63, 35, 0.1);
  color: #8f3418;
}

.generation-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.generation-overlay::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    conic-gradient(
      from 120deg,
      rgba(203, 98, 49, 0.08),
      rgba(16, 115, 116, 0.12),
      rgba(213, 173, 73, 0.08),
      rgba(203, 98, 49, 0.08)
    );
  animation: generation-rotate 10s linear infinite;
}

.generation-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.74) 42%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 74%);
  transform: translateX(-120%);
  animation: generation-sweep 2.9s ease-in-out infinite;
}

.generation-orb {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 34% 34%,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.16) 28%,
      rgba(203, 98, 49, 0.24) 52%,
      rgba(16, 115, 116, 0.16) 72%,
      transparent 100%
    );
  filter: blur(5px);
  animation: generation-pulse 3s ease-in-out infinite;
}

.generation-beam {
  position: absolute;
  width: min(84%, 560px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.98), transparent);
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.72),
    0 0 70px rgba(203, 98, 49, 0.2);
  animation: generation-breathe 2.4s ease-in-out infinite;
}

.generation-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 20px 24px;
  border-radius: 26px;
  background: rgba(255, 250, 245, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 44px rgba(64, 42, 23, 0.12);
  text-align: center;
}

.generation-label {
  color: var(--accent-dark);
}

.is-generating .featured-shell {
  max-width: 520px;
}

.generation-label,
.generation-stage,
.generation-timer {
  margin: 0;
}

.generation-label {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.generation-timer {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
}

@keyframes generation-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes generation-sweep {
  0% {
    transform: translateX(-120%);
  }

  55%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes generation-pulse {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.74;
  }

  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes generation-breathe {
  0%,
  100% {
    opacity: 0.42;
    transform: scaleX(0.88);
  }

  50% {
    opacity: 0.96;
    transform: scaleX(1);
  }
}

@keyframes queue-generation-drift {
  0%,
  100% {
    background-position: var(--drift-start-a, 0% 0%), var(--drift-start-b, 100% 100%), center;
  }

  50% {
    background-position: var(--drift-end-a, 100% 58%), var(--drift-end-b, 0% 12%), center;
  }
}

@keyframes queue-generation-rotate {
  from {
    transform: rotate(0deg) scale(1);
  }

  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes queue-generation-breathe {
  0%,
  100% {
    opacity: 0.46;
    transform: translateY(-50%) scaleX(0.68);
  }

  50% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1.08);
  }
}

.admin-page {
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-raised: #f8fafc;
  --line: #d9e2ec;
  --line-strong: #b8c5d4;
  --text: #152033;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1746a2;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --danger-soft: rgba(220, 38, 38, 0.08);
  --shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-lift: 0 14px 30px rgba(15, 23, 42, 0.09);
  background:
    linear-gradient(180deg, rgba(232, 240, 255, 0.76), rgba(248, 250, 252, 0.96) 280px),
    #f6f8fb;
  overflow-x: hidden;
}

.admin-page .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.admin-page .eyebrow {
  margin-bottom: 6px;
  color: #64748b;
  letter-spacing: 0.12em;
}

.admin-page h1 {
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
}

.admin-page h2 {
  font-size: 1.05rem;
  line-height: 1.25;
}

.admin-page .ghost-button,
.admin-page .primary-button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: none;
}

.admin-page .ghost-button {
  background: #ffffff;
  border-color: var(--line);
}

.admin-page .ghost-button:hover {
  background: #f8fafc;
  border-color: #b8c5d4;
}

.admin-page .primary-button {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.admin-page .primary-button:hover {
  background: #1746a2;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.admin-page .ghost-button:disabled,
.admin-page .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.admin-brand .brand-mark {
  width: 42px;
}

.admin-brand strong {
  display: block;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.14rem;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 28px 32px;
  display: grid;
  gap: 18px;
}

.admin-version-footer {
  display: flex;
  justify-content: flex-end;
  color: var(--admin-muted);
  font-size: 0.82rem;
  padding: 2px 4px 0;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.admin-hero__meta,
.admin-button-row,
.admin-card-meta,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-hero__meta {
  justify-content: flex-end;
}

.admin-function-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.admin-function-tab {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.admin-function-tab span {
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
}

.admin-function-tab small {
  color: inherit;
  line-height: 1.45;
}

.admin-function-tab:hover {
  background: #f8fafc;
  border-color: #dbe4ef;
}

.admin-function-tab.is-active {
  background: #eef4ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.admin-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.admin-feature-group {
  min-width: 0;
}

.admin-feature-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-feature-layout--logs {
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.admin-section-head,
.admin-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.admin-message,
.admin-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-message {
  margin-top: 10px;
}

.admin-code-list,
.admin-channel-list,
.admin-style-list,
.admin-table,
.admin-log-detail {
  display: grid;
  gap: 10px;
}

.admin-table-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-table {
  min-width: 980px;
}

.admin-log-card,
.admin-channel-card,
.admin-code-card {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-code-card strong,
.admin-channel-card strong,
.admin-log-card strong,
.admin-mono {
  font-family: "Space Grotesk", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.admin-channel-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #ffffff;
}

.admin-channel-card__main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.admin-channel-card__actions {
  display: flex;
  justify-content: flex-end;
}

.admin-channel-card__url {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-style-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-style-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-style-card--common {
  grid-column: 1 / -1;
  background: #f8fafc;
}

.admin-style-card__head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.admin-style-card__preview {
  position: relative;
  display: block;
  width: 54px;
}

.admin-style-card__preview .style-card__preview {
  border-radius: 8px;
}

.admin-style-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.admin-style-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-style-card__description {
  margin-top: 0;
}

.admin-style-card__prompt {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
}

.admin-code-card strong {
  letter-spacing: 0.06em;
}

.admin-log-card pre {
  margin: 0;
  max-height: 420px;
  padding: 12px 14px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.admin-log-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.admin-task-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-border-soft);
}

.admin-task-summary div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.admin-task-summary dt,
.admin-task-summary dd {
  margin: 0;
  line-height: 1.55;
}

.admin-task-summary dt {
  color: var(--admin-muted);
  font-weight: 600;
}

.admin-task-summary dd {
  min-width: 0;
  color: var(--admin-text);
  overflow-wrap: anywhere;
}

.admin-task-images {
  display: grid;
  gap: 12px;
}

.admin-task-images h3 {
  margin: 0;
  font-size: 0.96rem;
}

.admin-task-revised-prompt {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-task-revised-prompt h3 {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.admin-task-revised-prompt p {
  margin: 0;
  color: var(--admin-text);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.admin-task-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-task-image-grid a,
.admin-task-image-thumb {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #ffffff;
  cursor: zoom-in;
}

.admin-task-image-grid img,
.admin-task-image-thumb img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f8fafc;
}

.admin-task-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 16px;
  color: var(--admin-muted);
  font-weight: 700;
  background: #f8fafc;
}

.admin-image-preview-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.64);
  color: #ffffff;
  box-shadow: none;
  overflow: hidden;
  contain: layout paint size;
}

.admin-image-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
}

.admin-image-preview-dialog__head {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
}

.admin-image-preview-dialog__head h2 {
  display: none;
}

.admin-image-preview-dialog__head .ghost-button {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  background: rgba(26, 27, 26, 0.9);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0;
}

.admin-image-preview-dialog__head .ghost-button::before {
  content: "×";
  font-size: 1.05rem;
  line-height: 1;
}

.admin-image-preview-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-image-preview-dialog__actions .ghost-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
}

.admin-image-preview-dialog__body {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  cursor: default;
  touch-action: none;
  contain: layout paint;
}

.admin-image-preview-dialog__body.is-dragging {
  cursor: grabbing;
}

.admin-image-preview-dialog__body img {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  user-select: none;
  -webkit-user-drag: none;
}

.admin-image-preview-dialog .admin-preview-reset {
  width: 46px;
  min-width: 46px;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.8rem;
}

.admin-task-timeline {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.admin-task-timeline p {
  font-family: "Space Grotesk", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  color: var(--muted);
}

.admin-table__row {
  display: grid;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-table__row.is-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 42px;
  background: #eef4ff;
  color: #334155;
  font-weight: 800;
  box-shadow: none;
}

.admin-table__row > span,
.admin-table__row > div {
  min-width: 0;
}

.admin-table__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table__row--codes {
  grid-template-columns: 1.7fr 0.55fr 0.85fr 0.85fr 0.9fr 1.45fr 1.5fr;
}

.admin-table__row--logs {
  grid-template-columns: 1.55fr 0.9fr 0.55fr 1.1fr 1.15fr 1.15fr 0.72fr 1.8fr;
}

.admin-table__row--logs-legacy {
  grid-template-columns: 1.4fr 0.72fr 0.95fr 0.9fr 0.75fr 0.62fr 1fr 0.9fr 1.35fr;
}

.admin-table__row--logs-v2 {
  grid-template-columns: minmax(210px, 1.35fr) 0.66fr 0.85fr 1fr 0.58fr 0.75fr 0.62fr 0.58fr 0.78fr 0.82fr 1.25fr;
}

.admin-table__row--users {
  grid-template-columns: 54px minmax(110px, 0.8fr) minmax(180px, 1.2fr) minmax(190px, 1.2fr) 0.5fr 0.58fr 0.58fr 0.88fr 0.82fr;
  min-width: 1100px;
}

.admin-task-client-diagnostics {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #b8d5cf;
  border-radius: 8px;
  background: #f4fbf9;
}

.admin-task-client-diagnostics__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-task-client-diagnostics__header h3 {
  margin: 0;
  font-size: 0.96rem;
}

.admin-task-client-diagnostics__header span {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.admin-task-timeline--client {
  max-height: 320px;
  overflow: auto;
  background: #ffffff;
}

.admin-table__row--user-history {
  grid-template-columns: 58px minmax(180px, 1fr) 0.62fr minmax(220px, 1.28fr) 0.7fr 0.72fr 0.52fr 0.78fr;
}

.admin-table__row--credit-records {
  grid-template-columns: 0.95fr 0.5fr 0.48fr 0.5fr 0.5fr minmax(180px, 1.1fr);
}

.admin-actions {
  align-items: center;
}

.admin-actions .ghost-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.86rem;
  font-weight: 400;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #d8e0eb;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-status-pill--success {
  border-color: #badbcc;
  background: #ecfdf3;
  color: #166534;
}

.admin-status-pill--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.admin-status-pill--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-page .meta-pill {
  min-height: 32px;
  border: 1px solid #dbe4ef;
  background: #f8fafc;
  color: #334155;
}

.admin-page .auth-user-badge {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: none;
}

.admin-page .auth-modal__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.admin-page .auth-modal {
  width: 100vw;
  min-width: 0;
  overflow: hidden;
}

.admin-page .auth-modal__dialog {
  position: fixed;
  left: 50vw;
  top: 50vh;
  transform: translate(-50%, -50%);
  width: min(620px, 92vw);
  max-width: 92vw;
  min-width: 0;
  box-sizing: border-box;
}

.admin-page .auth-modal__dialog *,
.admin-page .auth-tabs,
.admin-page .auth-field input {
  min-width: 0;
}

.admin-page .auth-panel,
.admin-page .auth-form,
.admin-page .auth-field,
.admin-page .auth-tabs {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-page .auth-field input,
.admin-page .auth-form .primary-button {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.admin-page .auth-modal__head .ghost-button {
  width: auto;
  min-width: 72px;
}

@media (max-width: 1120px) {
  .topbar {
    padding: 20px 20px 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace-nav {
    display: none;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .chat-pane,
  .queue-pane,
  .record-pane {
    min-height: auto;
  }

  .admin-grid,
  .admin-feature-layout,
  .admin-feature-layout--logs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    background-attachment: scroll;
  }

  .topbar {
    padding: 16px 16px 0;
    display: grid;
    justify-content: stretch;
  }

  .topbar__brand {
    column-gap: 12px;
    padding: 14px 14px 12px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.56);
    background: rgba(255, 251, 245, 0.8);
    box-shadow: 0 16px 32px rgba(64, 42, 23, 0.08);
  }

  .brand-mark {
    width: 52px;
  }

  .topbar__brand strong {
    font-size: clamp(1.3rem, 5vw, 1.65rem);
  }

  .topbar__brand span {
    font-size: 0.9rem;
  }

  .topbar__actions {
    justify-content: stretch;
  }

  .topbar__actions {
    display: none;
  }

  .app-shell {
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chat-pane,
  .queue-pane,
  .record-pane,
  .mobile-account-pane {
    padding: 14px;
    border-radius: 26px;
  }

  .chat-pane,
  .queue-pane,
  .record-pane {
    min-height: calc(100vh - 196px);
  }

  .mobile-account-pane {
    min-height: calc(100vh - 196px);
    display: grid;
  }

  .mobile-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(12px);
  }

  .mobile-tab-panel.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: mobile-panel-enter 220ms ease;
  }

  .mobile-account-pane.mobile-tab-panel.is-active {
    display: grid;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .queue-grid {
    grid-template-columns: 1fr;
  }

  .record-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-pane__quick,
  .composer-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .history-pane__quick {
    gap: 8px;
  }

  .composer-tools,
  .composer-actions,
  .conversation-actions,
  .redeem-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .conversation-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: none;
  }

  .conversation-actions .ghost-button,
  .conversation-actions .primary-link {
    min-width: 0;
    padding: 10px 6px;
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .composer-shell {
    padding: 14px;
    border-radius: 24px;
  }

  textarea {
    min-height: 124px;
    font-size: 16px;
    padding-bottom: 12px;
  }

  .composer-tools {
    gap: 8px;
  }

  .composer-tools select,
  .composer-tools input[type="number"],
  .image-count-control,
  .ratio-picker__button,
  .attach-trigger {
    min-height: 46px;
  }

  .composer-tools .attach-trigger {
    justify-self: start;
    width: 46px;
  }

  .composer-actions {
    gap: 8px;
  }

  .attachment-strip__list {
    grid-template-columns: 1fr;
  }

  .generation-cost-summary {
    text-align: left;
  }

  .ratio-picker,
  .ratio-picker__button {
    width: 100%;
  }

  .ratio-picker__panel {
    left: 0;
    right: auto;
    top: calc(100% + 8px);
    bottom: auto;
    width: min(100%, calc(100vw - 28px));
    transform: none;
  }

  .ratio-picker__panel[data-placement="above"] {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .ratio-picker__panel[data-placement="below"] {
    top: calc(100% + 8px);
    bottom: auto;
  }

  .ratio-picker__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ratio-option {
    min-height: 88px;
  }

  .composer-hint {
    font-size: 0.84rem;
  }

  .assistant-card__top {
    display: grid;
  }

  .chat-thread {
    gap: 12px;
    padding: 2px;
  }

  .chat-bubble {
    max-width: 100%;
    padding: 14px;
    border-radius: 22px;
  }

  .featured-shell {
    min-height: 220px;
    border-radius: 22px;
  }

  .generation-copy {
    padding: 16px 18px;
    border-radius: 22px;
  }

  .image-preview-dialog__toolbar {
    bottom: 14px;
    gap: 14px;
    height: 54px;
    padding: 6px 14px;
  }

  .image-preview-dialog__tool,
  .image-preview-dialog__close {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }

  .ghost-button,
  .primary-button,
  .primary-link,
  .inline-button,
  .attach-trigger,
  .credit-badge,
  .ratio-picker__button,
  .composer-tools select,
  .topbar__actions > *,
  .auth-tabs .ghost-button,
  .auth-tab-button {
    width: 100%;
  }

  .auth-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell {
    padding: 14px;
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-topbar {
    position: static;
    display: grid;
    padding: 12px 14px;
  }

  .admin-topbar__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .admin-page .auth-user-badge {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .admin-hero {
    display: grid;
    padding: 18px 16px;
  }

  .admin-hero__meta {
    justify-content: flex-start;
  }

  .admin-function-nav {
    grid-template-columns: 1fr;
  }

  .admin-function-tab {
    min-height: 0;
  }

  .admin-section-head,
  .admin-card-row {
    display: grid;
  }

  .admin-section-head .ghost-button,
  .admin-card-row .ghost-button {
    width: auto;
    justify-self: start;
  }

  .admin-button-row,
  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-table {
    min-width: 820px;
  }

  .admin-page .ghost-button,
  .admin-page .primary-button {
    width: 100%;
  }

  .admin-page .auth-modal__head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-page .auth-modal__dialog {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: translateY(-50%);
    padding: 20px;
  }

  .admin-page .auth-modal__head .ghost-button {
    width: auto;
  }

  .mobile-account-summary {
    grid-template-columns: 1fr;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 250, 245, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 22px 48px rgba(64, 42, 23, 0.18);
  }

  .mobile-bottom-nav__item {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: #8a9290;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition:
      transform 160ms ease,
      background 160ms ease,
      color 160ms ease,
      box-shadow 160ms ease;
  }

  .mobile-bottom-nav__item:not(.is-active):hover {
    color: var(--accent-dark);
    background: rgba(197, 93, 46, 0.08);
  }

  .mobile-bottom-nav__item[data-mobile-tab-target="create"] {
    position: relative;
  }

  .mobile-bottom-nav__item[data-mobile-tab-target="create"]::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(197, 93, 46, 0.08), rgba(142, 58, 27, 0.03));
    opacity: 1;
  }

  .mobile-bottom-nav__item.is-active {
    color: #fff8f2;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: 0 12px 26px rgba(142, 58, 27, 0.24);
    transform: translateY(-1px);
  }

  .mobile-bottom-nav__item.is-active::before {
    opacity: 0;
  }

  .mobile-bottom-nav__label {
    position: relative;
    z-index: 1;
  }

  .admin-table__row {
    grid-template-columns: 1fr;
  }
}

@keyframes mobile-panel-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Admin dashboard: light sidebar + operational workbench. */
.admin-page {
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-raised: #f8fafc;
  --line: #dde4ee;
  --line-strong: #c7d1df;
  --text: #0f2741;
  --muted: #5f7086;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eaf2ff;
  --danger-soft: #fff1f2;
  --shadow: none;
  --shadow-soft: none;
  --shadow-lift: none;
  min-height: 100vh;
  background: #f7f9fc;
  color: var(--text);
}

.admin-dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.admin-sidebar__brand {
  display: grid;
  gap: 8px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-sidebar__brand strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.admin-sidebar__brand span {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-sidebar__account {
  display: grid;
  gap: 10px;
  padding: 14px 12px 18px;
  border-top: 1px solid var(--line);
}

.admin-sidebar__account .ghost-button,
.admin-back-link {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.admin-page .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-page .eyebrow {
  margin-bottom: 6px;
  color: #7a8aa0;
  letter-spacing: 0.1em;
}

.admin-page h1 {
  font-size: 1.55rem;
  line-height: 1.25;
}

.admin-page h2 {
  font-size: 1.05rem;
  line-height: 1.3;
}

.admin-page .ghost-button,
.admin-page .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: none;
}

.admin-page .ghost-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

.admin-page .ghost-button:hover {
  border-color: #b9c6d8;
  background: #f8fafc;
  transform: none;
}

.admin-page .primary-button {
  border: 0;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.admin-page .primary-button:hover {
  background: #1d4ed8;
  transform: none;
}

.admin-page .ghost-button:disabled,
.admin-page .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
}

.admin-topbar {
  display: none;
}

.admin-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 34px 32px 48px;
  display: grid;
  gap: 28px;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-message,
.admin-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.admin-message {
  margin-top: 8px;
}

.admin-hero__meta,
.admin-button-row,
.admin-card-meta,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-hero__meta {
  justify-content: flex-end;
}

.admin-function-nav {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-function-tab {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.admin-function-tab span {
  color: inherit;
  font-weight: 700;
  line-height: 1.25;
}

.admin-function-tab small {
  display: none;
}

.admin-function-tab:hover {
  background: #f6f8fb;
  border-color: transparent;
}

.admin-function-tab.is-active {
  background: #eef5ff;
  border-color: transparent;
  color: #2563eb;
  box-shadow: none;
}

.admin-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: currentColor;
  font-size: 0.95rem;
  line-height: 1;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 24px;
}

.admin-overview-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 154px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.admin-overview-card:hover {
  border-color: #c4d1e2;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
}

.admin-overview-card strong {
  font-size: 1.08rem;
  line-height: 1.3;
}

.admin-overview-card span:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.admin-overview-card__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-overview-card__icon--blue {
  background: #dbeafe;
  color: #2563eb;
}

.admin-overview-card__icon--rose {
  background: #ffe4e9;
  color: #e11d48;
}

.admin-overview-card__icon--amber {
  background: #fef3c7;
  color: #d97706;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
}

.admin-feature-group {
  min-width: 0;
}

.admin-feature-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-feature-layout--logs {
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
}

.admin-stack {
  display: grid;
  gap: 18px;
}

.admin-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.admin-section-head,
.admin-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.admin-code-list,
.admin-channel-list,
.admin-table,
.admin-log-detail {
  display: grid;
  gap: 10px;
}

.admin-table-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-table {
  min-width: 980px;
}

.admin-log-card,
.admin-channel-card,
.admin-code-card {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-channel-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: #ffffff;
}

.admin-channel-card__main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.admin-channel-card__actions {
  display: flex;
  justify-content: flex-end;
}

.admin-channel-card__url {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-code-card strong,
.admin-channel-card strong,
.admin-log-card strong,
.admin-mono {
  font-family: "Space Grotesk", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.admin-code-card strong {
  letter-spacing: 0.04em;
}

.admin-log-card pre {
  margin: 0;
  max-height: 420px;
  padding: 12px 14px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.admin-log-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.admin-task-timeline {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #ffffff;
}

.admin-task-timeline p {
  font-family: "Space Grotesk", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  color: var(--muted);
}

.admin-table__row {
  display: grid;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-table__row.is-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 42px;
  background: #eef5ff;
  color: #334155;
  font-weight: 800;
  box-shadow: none;
}

.admin-table__row > span,
.admin-table__row > div {
  min-width: 0;
}

.admin-table__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table__row--codes {
  grid-template-columns: 1.7fr 0.55fr 0.85fr 0.85fr 0.9fr 1.45fr 1.5fr;
}

.admin-table__row--logs {
  grid-template-columns: 1.55fr 0.9fr 0.55fr 1.1fr 1.15fr 1.15fr 0.72fr 1.8fr;
}

.admin-table__row--logs-legacy {
  grid-template-columns: 1.4fr 0.72fr 0.95fr 0.9fr 0.75fr 0.62fr 1fr 0.9fr 1.35fr;
}

.admin-table__row--logs-v2 {
  grid-template-columns: minmax(210px, 1.35fr) 0.66fr 0.85fr 1fr 0.58fr 0.75fr 0.62fr 0.58fr 0.78fr 0.82fr 1.25fr;
}

.admin-actions {
  align-items: center;
}

.admin-actions .ghost-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.86rem;
  font-weight: 400;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #d8e0eb;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-status-pill--success {
  border-color: #badbcc;
  background: #ecfdf3;
  color: #166534;
}

.admin-status-pill--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.admin-status-pill--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-page .meta-pill {
  min-height: 32px;
  border: 1px solid #dbe4ef;
  background: #ffffff;
  color: #334155;
}

.admin-page .auth-user-badge {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: none;
}

@media (max-width: 1120px) {
  .admin-dashboard-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-function-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-sidebar__account {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-page .auth-user-badge {
    grid-column: 1 / -1;
  }

  .admin-overview-grid,
  .admin-feature-layout,
  .admin-feature-layout--logs {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-page {
    padding-bottom: 0;
  }

  .admin-shell {
    padding: 22px 14px 32px;
    gap: 20px;
  }

  .admin-sidebar__brand {
    padding: 18px 14px 14px;
  }

  .admin-function-nav,
  .admin-sidebar__account {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .admin-hero,
  .admin-section-head,
  .admin-card-row {
    display: grid;
  }

  .admin-hero__meta {
    justify-content: flex-start;
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-overview-card {
    min-height: 132px;
    padding: 18px;
  }

  .admin-button-row,
  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-table {
    min-width: 820px;
  }

  .admin-table__row {
    grid-template-columns: 1fr;
  }

  .admin-page .ghost-button,
  .admin-page .primary-button {
    width: 100%;
  }

  .admin-page .auth-modal__dialog {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: translateY(-50%);
    padding: 20px;
  }

  .admin-page .auth-modal__head .ghost-button {
    width: auto;
  }
}

/* Admin dashboard polish v2: final overrides for a denser, calmer console. */
.admin-page {
  --admin-bg: #f4f7fb;
  --admin-sidebar: #0f172a;
  --admin-sidebar-muted: #94a3b8;
  --admin-sidebar-active: rgba(59, 130, 246, 0.16);
  --admin-card: #ffffff;
  --admin-card-muted: #f8fafc;
  --admin-border: #d9e2ee;
  --admin-border-soft: #edf2f7;
  --admin-text: #102033;
  --admin-muted: #64748b;
  --admin-blue: #2563eb;
  --admin-green: #15803d;
  --admin-amber: #b45309;
  --admin-red: #be123c;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 15px;
}

.admin-dashboard-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(244, 247, 251, 0)) 264px 0 / calc(100% - 264px) 260px no-repeat,
    var(--admin-bg);
}

.admin-sidebar {
  border-right: 0;
  background: var(--admin-sidebar);
  color: #e2e8f0;
}

.admin-sidebar__brand {
  padding: 24px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-sidebar__brand strong {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
}

.admin-sidebar__brand span,
.admin-sidebar__account .auth-user-badge {
  color: var(--admin-sidebar-muted);
}

.admin-function-nav {
  gap: 6px;
  padding: 14px;
}

.admin-function-tab {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cbd5e1;
}

.admin-function-tab span {
  font-weight: 600;
}

.admin-function-tab:hover {
  background: rgba(148, 163, 184, 0.1);
}

.admin-function-tab.is-active {
  background: var(--admin-sidebar-active);
  color: #ffffff;
}

.admin-nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  font-weight: 800;
}

.admin-function-tab.is-active .admin-nav-icon {
  background: #2563eb;
}

.admin-sidebar__account {
  padding: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.admin-sidebar__account .ghost-button,
.admin-back-link {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.admin-sidebar__account .ghost-button:hover,
.admin-back-link:hover {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.1);
}

.admin-page .auth-user-badge {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.admin-shell {
  max-width: 1500px;
  padding: 30px clamp(20px, 3vw, 38px) 44px;
  gap: 22px;
}

.admin-hero {
  align-items: center;
  min-height: 74px;
}

.admin-page .eyebrow {
  margin-bottom: 7px;
  color: var(--admin-muted);
  letter-spacing: 0.08em;
}

.admin-page h1 {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.3rem, 1.7vw, 1.62rem);
  font-weight: 700;
}

.admin-page h2 {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 0.96rem;
  font-weight: 650;
}

.admin-message,
.admin-empty {
  color: var(--admin-muted);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-metric {
  display: grid;
  gap: 5px;
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-card);
}

.admin-metric span,
.admin-metric small {
  color: var(--admin-muted);
  font-size: 0.86rem;
}

.admin-metric strong {
  color: var(--admin-text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.72rem;
  font-weight: 700;
  line-height: 1;
}

.admin-page .panel,
.admin-panel {
  border-color: var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-card);
}

.admin-panel {
  gap: 15px;
  padding: 18px;
}

.admin-section-head {
  align-items: center;
  min-height: 54px;
  padding-bottom: 14px;
  border-bottom-color: var(--admin-border-soft);
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-selection-count {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-feature-layout {
  grid-template-columns: minmax(286px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.admin-feature-layout--logs {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.admin-log-workspace {
  min-height: 0;
}

.admin-log-toolbar {
  align-items: end;
}

.admin-sync-indicator {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--admin-muted);
}

.admin-sync-indicator::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
  background: #94a3b8;
  vertical-align: -1px;
}

.admin-sync-indicator[data-state="cache"]::before {
  background: #f59e0b;
}

.admin-sync-indicator[data-state="syncing"]::before {
  background: #3b82f6;
}

.admin-sync-indicator[data-state="ok"]::before {
  background: #16a34a;
}

.admin-sync-indicator[data-state="error"]::before {
  background: #ef4444;
}

.admin-request-id-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-request-id-cell::before {
  content: "☁";
  color: #3b82f6;
  font-size: 11px;
  line-height: 1;
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.admin-request-id-cell[data-sync-state="local"]::before {
  content: "●";
  color: #16a34a;
}

.admin-request-id-cell[data-sync-state="cloud"]::before {
  content: "☁";
  color: #3b82f6;
}

.admin-request-id-cell[data-sync-state="syncing"]::before {
  content: "";
  background: transparent;
  border: 2px solid #93c5fd;
  border-top-color: #2563eb;
  box-shadow: none;
  animation: adminSpin 0.9s linear infinite;
}

@keyframes adminSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.admin-log-search {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-log-search input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--admin-text);
  font-size: 0.9rem;
  outline: none;
}

.admin-log-search input:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-log-filters {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(220px, 320px) auto;
  gap: 10px;
  align-items: center;
}

.admin-log-filters input,
.admin-log-filters select {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  background: #fff;
  color: var(--admin-text);
  font-size: 0.9rem;
  outline: none;
}

.admin-log-filters input:focus,
.admin-log-filters select:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-user-workspace {
  gap: 16px;
}

.admin-user-toolbar {
  align-items: end;
}

.admin-user-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 2px;
  color: var(--admin-muted);
  font-size: 0.86rem;
}

.admin-user-pagination__controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-user-pagination__indicator {
  min-width: 82px;
  text-align: center;
}

.admin-section-head--compact {
  min-height: 42px;
  padding-bottom: 10px;
}

.admin-section-head--compact h2 {
  font-size: 1rem;
}

.admin-user-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.admin-user-layout {
  display: grid;
  gap: 12px;
}

.admin-user-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-user-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--admin-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-user-tab.is-active {
  background: #ffffff;
  color: var(--admin-blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.admin-user-pane[hidden] {
  display: none;
}

.admin-user-pane,
.admin-user-detail-panel,
.admin-user-detail,
.admin-user-detail-grid > section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-user-detail-grid h3 {
  margin: 0;
  color: var(--admin-text);
  font-size: 0.96rem;
}

.admin-user-subtable {
  min-width: 780px;
}

.admin-user-detail-drawer .admin-log-drawer__panel {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(86vw, 1360px);
  overflow: hidden;
}

.admin-user-detail-drawer .admin-user-detail {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-user-detail-drawer .admin-user-detail-grid {
  grid-template-columns: 1fr;
}

.admin-user-detail-drawer .admin-user-subtable {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
}

.admin-user-detail-drawer .admin-table__row--user-history {
  grid-template-columns: 58px minmax(180px, 1fr) 0.62fr minmax(220px, 1.28fr) 0.7fr 0.72fr 0.52fr 0.78fr;
  min-width: 1120px;
}

.admin-user-detail-drawer .admin-table__row--credit-records {
  grid-template-columns: 0.95fr 0.5fr 0.48fr 0.5fr 0.5fr minmax(180px, 1.1fr);
  min-width: 760px;
}

.admin-user-detail-drawer .admin-table__row--user-records {
  grid-template-columns:
    0.9fr
    0.62fr
    minmax(190px, 1.2fr)
    0.62fr
    minmax(180px, 1.25fr)
    0.56fr
    0.42fr
    0.42fr
    0.62fr;
  min-width: 1120px;
}

.admin-user-row.is-selected {
  background: #eff6ff;
}

.admin-table__row--users {
  grid-template-columns: 54px minmax(110px, 0.8fr) minmax(180px, 1.2fr) minmax(190px, 1.2fr) 0.5fr 0.58fr 0.58fr 0.88fr 0.82fr;
  min-width: 1100px;
}

.admin-table__row--leaderboard {
  grid-template-columns: 0.45fr minmax(110px, 0.85fr) minmax(180px, 1.18fr) minmax(190px, 1.18fr) 0.5fr 0.58fr 0.58fr 0.88fr 0.5fr;
  min-width: 1040px;
}

.admin-table__row--user-history {
  grid-template-columns: 58px minmax(180px, 1fr) 0.62fr minmax(220px, 1.28fr) 0.7fr 0.72fr 0.52fr 0.78fr;
}

.admin-table__row--credit-records {
  grid-template-columns: 0.95fr 0.54fr 0.5fr 0.52fr 0.55fr minmax(180px, 1.2fr);
}

.admin-table__row--users strong,
.admin-table__row--leaderboard strong {
  display: block;
  color: var(--admin-text);
  font-size: 0.9rem;
}

.admin-table__row--users small,
.admin-table__row--leaderboard small {
  display: block;
  max-width: 260px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-credit-positive {
  color: var(--admin-green);
  font-weight: 700;
}

.admin-credit-negative {
  color: var(--admin-red);
  font-weight: 700;
}

.admin-credit-record-list {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.admin-credit-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.admin-credit-record__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-credit-record__title {
  color: var(--admin-text);
  font-size: 0.96rem;
  line-height: 1.35;
}

.admin-credit-record__target {
  color: var(--admin-muted);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-credit-record__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--admin-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-credit-record__delta {
  justify-self: end;
  min-width: 64px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--admin-text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.admin-credit-record__delta.is-positive {
  background: rgba(22, 163, 74, 0.1);
  color: var(--admin-green);
}

.admin-credit-record__delta.is-negative {
  background: rgba(220, 38, 38, 0.1);
  color: var(--admin-red);
}

.admin-credit-record-list__empty {
  padding: 14px;
  border: 1px dashed var(--admin-border);
  border-radius: 10px;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .admin-credit-record {
    grid-template-columns: 1fr;
  }

  .admin-credit-record__delta {
    justify-self: start;
  }
}

.admin-form {
  gap: 13px;
}

.admin-form label {
  color: var(--admin-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-form input,
.admin-form select {
  min-height: 44px;
  border-color: var(--admin-border);
  color: var(--admin-text);
  font-size: 0.92rem;
  font-weight: 500;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-page .ghost-button,
.admin-page .primary-button {
  min-height: 38px;
  border-radius: 7px;
  font-size: 0.88rem;
}

.admin-page .ghost-button {
  font-weight: 400;
}

.admin-page .primary-button {
  font-weight: 600;
}

.admin-page .primary-button {
  background: var(--admin-blue);
  box-shadow: none;
}

.admin-page .primary-button:hover {
  background: #1d4ed8;
}

.admin-page .ghost-button {
  border-color: var(--admin-border);
  background: #ffffff;
}

.admin-page .ghost-button:hover {
  border-color: #b7c4d6;
  background: #f8fafc;
}

.admin-page .ghost-button--danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--admin-red);
}

.admin-page .admin-table .admin-actions .ghost-button {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

.admin-table-wrap {
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #ffffff;
  overflow: auto;
}

.admin-table {
  gap: 0;
  min-width: 1280px;
}

.admin-table__row {
  min-height: 52px;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--admin-border-soft);
  border-radius: 0;
}

.admin-table__row:last-child {
  border-bottom: 0;
}

.admin-table__row.is-head {
  min-height: 44px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 650;
}

.admin-table__row:not(.is-head) {
  font-size: 0.9rem;
  font-weight: 400;
}

.admin-table__row--codes {
  grid-template-columns: 0.45fr 1.65fr 0.52fr 0.82fr 0.82fr 0.82fr 1.28fr 1.55fr;
}

.admin-select-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--admin-blue);
}

.admin-table__row--logs {
  grid-template-columns: 1.45fr 0.72fr 0.9fr 1fr 0.62fr 0.76fr 0.66fr 0.92fr 0.62fr 0.88fr 1.35fr;
}

.admin-table__row--logs-legacy {
  grid-template-columns: 1.45fr 0.72fr 0.9fr 0.85fr 0.72fr 1fr 0.62fr 0.88fr 1.35fr;
}

.admin-table__row--logs-legacy {
  grid-template-columns: 1.4fr 0.72fr 0.95fr 0.9fr 0.75fr 0.62fr 1fr 0.9fr 1.35fr;
}

.admin-table__row--logs-v2 {
  grid-template-columns: minmax(210px, 1.35fr) 0.66fr 0.85fr 1fr 0.58fr 0.75fr 0.62fr 0.58fr 0.78fr 0.82fr 1.25fr;
}

.admin-table__row .admin-request-id-cell,
.admin-table__row .admin-task-log-created-time,
.admin-table__row .admin-task-log-created-time span {
  overflow: visible;
  text-overflow: clip;
}

.admin-request-id-cell {
  position: relative;
  display: block;
  min-width: 0;
  padding-right: 30px;
  white-space: nowrap;
}

.admin-task-log-copy-button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 0;
  color: var(--admin-muted);
  background: #ffffff;
  cursor: pointer;
}

.admin-task-log-copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.admin-task-log-copy-button:hover,
.admin-task-log-copy-button:focus-visible {
  color: var(--admin-blue);
  border-color: rgba(37, 99, 235, 0.42);
  background: #eff6ff;
}

.admin-task-log-created-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
  white-space: normal;
}

.admin-task-log-created-time span {
  display: block;
  white-space: nowrap;
}

.admin-log-prompt-cell {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-log-thumb-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-log-thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-log-drawer {
  position: fixed;
  inset: 0;
  z-index: 35;
}

.admin-user-detail-drawer {
  z-index: 40;
}

.admin-log-drawer.is-front {
  z-index: 45;
}

.admin-log-drawer[hidden] {
  display: none;
}

.admin-log-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
}

.admin-log-drawer__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, auto);
  gap: 14px;
  width: min(80vw, 1280px);
  max-height: calc(100vh - 56px);
  padding: 18px;
  transform: translate(-50%, -50%);
  overflow: auto;
}

.admin-log-drawer__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border-soft);
}

.admin-code-card,
.admin-channel-card,
.admin-log-card {
  border-color: var(--admin-border-soft);
  background: var(--admin-card-muted);
}

.admin-channel-card {
  padding: 16px;
}

.admin-channel-card__url,
.admin-mono {
  font-size: 0.9rem;
}

.admin-status-pill {
  min-height: 26px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-status-pill--success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--admin-green);
}

.admin-status-pill--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: var(--admin-amber);
}

.admin-status-pill--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--admin-blue);
}

.admin-selection-count {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-user-workspace {
  gap: 16px;
}

.admin-user-toolbar {
  align-items: end;
}

.admin-user-layout,
.admin-user-pane,
.admin-user-detail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-user-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #f8fafc;
}

.admin-user-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--admin-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-user-tab.is-active {
  background: #ffffff;
  color: var(--admin-blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.admin-user-pane[hidden] {
  display: none;
}

.admin-user-row {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.admin-user-row.is-selected {
  background: #eff6ff;
}

.admin-user-row strong,
.admin-user-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-row small {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 0.78rem;
}

.admin-user-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-user-detail-grid > section {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #ffffff;
}

.admin-user-detail-grid h3 {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.admin-user-detail-grid p {
  margin: 0;
  color: var(--admin-text);
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.admin-user-detail-button,
.admin-user-grant-button {
  min-height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}

.admin-quick-grant-dialog {
  width: min(460px, calc(100% - 32px));
  max-width: 100%;
  box-sizing: border-box;
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 1000;
  margin: 0;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--admin-text);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.admin-quick-grant-dialog[open] {
  display: block;
}

.admin-quick-grant-dialog[data-fallback-modal="true"] {
  box-shadow: 0 0 0 100vmax rgba(15, 23, 42, 0.42), 0 24px 80px rgba(15, 23, 42, 0.28);
}

body.admin-quick-grant-fallback-open::before {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: block;
  content: "";
  background: rgba(15, 23, 42, 0.42);
  pointer-events: auto;
}

.admin-quick-grant-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.admin-quick-grant-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.admin-quick-grant-dialog__head,
.admin-quick-grant-form__actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-quick-grant-dialog__head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border-soft);
}

.admin-quick-grant-dialog h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-quick-grant-user {
  max-width: 340px;
  margin: 5px 0 0;
  color: var(--admin-muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.admin-quick-grant-form > label {
  display: grid;
  gap: 6px;
  color: var(--admin-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-quick-grant-form input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--admin-border);
  border-radius: 7px;
  padding: 0 11px;
  background: #ffffff;
  color: var(--admin-text);
  font: inherit;
}

.admin-quick-grant-message {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.84rem;
}

.admin-quick-grant-message[data-type="error"] {
  color: #b42318;
}

.admin-quick-grant-message[data-type="success"] {
  color: var(--admin-green);
}

.admin-user-subtable {
  min-width: 780px;
}

.admin-user-detail-drawer {
  z-index: 40;
}

.admin-user-detail-drawer .admin-log-drawer__panel {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(86vw, 1360px);
  overflow: hidden;
}

.admin-user-detail-drawer .admin-user-detail {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.admin-user-detail-drawer .admin-user-subtable {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
}

.admin-page .meta-pill {
  min-height: 32px;
  border-color: var(--admin-border);
  background: #ffffff;
}

.admin-log-card pre {
  border: 0;
  border-radius: 8px;
  background: #111827;
}

.admin-task-timeline {
  border-color: var(--admin-border-soft);
}

@media (max-width: 1120px) {
  .admin-dashboard-shell {
    grid-template-columns: 1fr;
    background: var(--admin-bg);
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
  }

  .admin-sidebar__brand {
    padding: 16px 18px 12px;
  }

  .admin-function-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px 12px;
  }

  .admin-function-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .admin-sidebar__account {
    display: none;
  }

  .admin-feature-layout,
  .admin-feature-layout--logs {
    grid-template-columns: 1fr;
  }

  .admin-user-detail-grid {
    grid-template-columns: 1fr;
  }

  .admin-log-toolbar {
    align-items: start;
  }

  .admin-log-search {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .admin-log-filters {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 18px 12px 28px;
    gap: 16px;
  }

  .admin-hero {
    display: grid;
    min-height: 0;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-metric {
    min-height: 86px;
    padding: 15px;
  }

  .admin-metric strong {
    font-size: 1.65rem;
  }

  .admin-function-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-function-tab {
    min-height: 50px;
  }

  .admin-section-head,
  .admin-card-row {
    display: grid;
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-table-wrap {
    margin-inline: -2px;
  }

  .admin-table {
    min-width: 860px;
  }

  .admin-log-drawer__panel {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .admin-task-summary {
    grid-template-columns: 1fr;
  }

  .admin-task-summary div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .admin-channel-card {
    grid-template-columns: 1fr;
  }
}

/* FEA1 workspace rebuild overrides */
body:not(.admin-page) {
  /* FEA names remain as compatibility aliases; shared JXT tokens are authoritative. */
  --fea-bg: var(--jxt-color-canvas);
  --fea-panel: var(--jxt-color-surface);
  --fea-panel-strong: var(--jxt-color-surface-raised);
  --fea-card: var(--jxt-color-surface-raised);
  --fea-soft: var(--jxt-color-surface-subtle);
  --fea-border: var(--jxt-color-border);
  --fea-border-strong: var(--jxt-color-border-strong);
  --fea-text: var(--jxt-color-text);
  --fea-muted: var(--jxt-color-muted);
  --fea-accent: var(--jxt-color-primary);
  --fea-accent-soft: var(--jxt-color-primary-soft);
  --fea-green: var(--jxt-color-primary);
  --fea-green-soft: var(--jxt-color-primary-soft);
  --fea-green-strong: var(--jxt-color-primary);
  --fea-green-deep: var(--jxt-color-primary-strong);
  --fea-mint: var(--jxt-color-success-soft);
  --fea-wash: var(--jxt-color-canvas-muted);
  --fea-cream: var(--jxt-color-surface-subtle);
  --fea-shadow: var(--jxt-shadow-panel);
  --fea-shadow-soft: var(--jxt-shadow-soft);
  background: var(--jxt-color-canvas);
}

body:not(.admin-page) {
  --surface: var(--jxt-color-surface);
  --surface-strong: var(--jxt-color-surface-raised);
  --surface-raised: var(--jxt-color-surface-subtle);
  --line: var(--jxt-color-border);
  --line-strong: var(--jxt-color-border-strong);
  --text: var(--fea-text);
  --muted: var(--fea-muted);
  --accent: var(--fea-green);
  --accent-dark: var(--fea-green-deep);
  --accent-soft: var(--fea-green-soft);
  --teal: var(--fea-green-strong);
  --danger-soft: var(--jxt-color-danger-soft);
  --shadow: var(--fea-shadow);
  --shadow-soft: var(--fea-shadow-soft);
  --shadow-lift: var(--jxt-shadow-lift);
  --fea-display-font: "STSong", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --fea-ui-font: var(--jxt-font-ui);
}

body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link,
body:not(.admin-page) .inline-button,
body:not(.admin-page) .attach-trigger,
body:not(.admin-page) select,
body:not(.admin-page) input[type="number"] {
  border: 1px solid var(--fea-border);
  background: var(--jxt-color-surface);
  color: var(--fea-text);
}

body:not(.admin-page) .ghost-button,
body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link,
body:not(.admin-page) .inline-button,
body:not(.admin-page) .attach-trigger {
  font-weight: 400;
}

body:not(.admin-page) .ghost-button:focus-visible,
body:not(.admin-page) .primary-button:focus-visible,
body:not(.admin-page) .primary-link:focus-visible,
body:not(.admin-page) .inline-button:focus-visible,
body:not(.admin-page) .attach-trigger:focus-visible,
body:not(.admin-page) select:focus-visible,
body:not(.admin-page) input:focus-visible {
  box-shadow: var(--jxt-focus-ring);
  border-color: var(--jxt-color-border-strong);
}

body:not(.admin-page) .ghost-button--danger {
  background: var(--jxt-color-danger-soft);
}

body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link {
  border: 0;
  background: var(--jxt-color-primary);
  color: var(--jxt-color-inverse);
  box-shadow: var(--jxt-shadow-primary);
}

body:not(.admin-page) .primary-button:hover,
body:not(.admin-page) .primary-link:hover:not(.disabled) {
  background: var(--jxt-color-primary-strong);
  box-shadow: var(--jxt-shadow-primary-hover);
}

body:not(.admin-page) .empty-state {
  background: rgba(255, 255, 255, 0.52);
  border-color: var(--fea-border-strong);
}

body:not(.admin-page) .chat-bubble--user {
  background: rgba(24, 160, 88, 0.08);
  border-color: rgba(24, 160, 88, 0.16);
}

body:not(.admin-page) .user-prompt-copy-button {
  border-color: rgba(24, 160, 88, 0.22);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .user-prompt-copy-button:focus-visible {
  outline-color: rgba(24, 160, 88, 0.34);
}

body:not(.admin-page) .featured-shell {
  border-color: var(--fea-border);
  background:
    radial-gradient(circle at 50% 14%, rgba(24, 160, 88, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 248, 241, 0.98));
}

body:not(.admin-page) .result-variant.is-active {
  border-color: var(--fea-green);
}

body:not(.admin-page) .info-card {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(24, 160, 88, 0.08);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .info-card--subtle {
  border-color: var(--fea-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--fea-muted);
}

body:not(.admin-page) .composer-shell {
  border-color: var(--fea-border);
  background: var(--jxt-color-surface);
  box-shadow: var(--jxt-shadow-panel);
}

body:not(.admin-page) .auth-modal__backdrop {
  background: var(--jxt-color-overlay);
  backdrop-filter: blur(10px);
}

body:not(.admin-page) .auth-modal__dialog {
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-panel);
  background: var(--jxt-color-surface-raised);
  box-shadow: var(--jxt-shadow-modal);
}

body:not(.admin-page) .auth-tabs {
  border-color: var(--fea-border);
  background: var(--fea-soft);
}

body:not(.admin-page) .auth-tabs .ghost-button:hover {
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.42);
}

body:not(.admin-page) .auth-tabs .is-active {
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(20, 60, 42, 0.08);
}

body:not(.admin-page) .auth-tab-button {
  color: var(--fea-muted);
}

body:not(.admin-page) .auth-tab-button:hover {
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.42);
}

body:not(.admin-page) .auth-tab-button.is-active {
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(20, 60, 42, 0.08);
}

body:not(.admin-page) .auth-form--subtle {
  border-color: rgba(24, 160, 88, 0.22);
  background: rgba(243, 251, 247, 0.84);
}

body:not(.admin-page) .auth-field span {
  font-weight: 500;
  color: var(--fea-text);
}

body:not(.admin-page) .auth-field input {
  border-color: var(--fea-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--fea-text);
}

body:not(.admin-page) .auth-field input:focus {
  border-color: rgba(24, 160, 88, 0.34);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .auth-switch {
  color: var(--fea-green-deep);
  font-weight: 500;
}

body:not(.admin-page) .auth-message[data-type="error"] {
  border-color: rgba(193, 76, 48, 0.18);
  background: rgba(193, 76, 48, 0.08);
  color: #8f4a31;
}

body:not(.admin-page) .redeem-tip {
  color: var(--fea-muted);
}

body:not(.admin-page) .generation-overlay::before {
  background:
    conic-gradient(
      from 120deg,
      rgba(24, 160, 88, 0.06),
      rgba(15, 138, 76, 0.1),
      rgba(223, 245, 232, 0.22),
      rgba(24, 160, 88, 0.06)
    );
}

body:not(.admin-page) .generation-overlay::after {
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.76) 42%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 74%);
}

body:not(.admin-page) .topbar {
  max-width: var(--jxt-shell-max-width, 1480px);
  padding: 14px 24px 0;
  min-height: 72px;
  border-bottom: 1px solid var(--fea-border);
}

body:not(.admin-page) .topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not(.admin-page) .topbar__brand .eyebrow,
body:not(.admin-page) .topbar__brand span,
body:not(.admin-page) #auth-hint {
  display: none !important;
}

body:not(.admin-page) .brand-mark {
  width: 34px;
}

body:not(.admin-page) .topbar__brand strong {
  font-family: var(--fea-display-font);
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

body:not(.admin-page) .topbar__actions {
  gap: 12px;
  flex-wrap: nowrap;
}

body:not(.admin-page) .topbar__actions > * {
  box-shadow: none;
}

body:not(.admin-page) .topbar__actions .auth-user-badge,
body:not(.admin-page) .topbar__actions .credit-badge,
body:not(.admin-page) .topbar__actions .ghost-button,
body:not(.admin-page) .topbar__actions .primary-link {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border-color: var(--fea-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--fea-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

body:not(.admin-page) .topbar__actions .auth-user-badge strong,
body:not(.admin-page) .topbar__actions .credit-badge strong,
body:not(.admin-page) .topbar__actions .primary-link.purchase-link,
body:not(.admin-page) .topbar__actions #open-redeem-button {
  font-weight: 400;
}

.auth-bridge-button {
  display: none !important;
}

body:not(.admin-page) .topbar__actions .credit-badge,
body:not(.admin-page) .topbar__actions .primary-link.purchase-link {
  background: rgba(243, 251, 247, 0.96);
  border-color: rgba(24, 160, 88, 0.16);
}

body:not(.admin-page) .topbar__actions .auth-user-badge {
  gap: 7px;
  min-height: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #5f6b68;
}

body:not(.admin-page) .topbar__actions .auth-user-badge__dot {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 5px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .topbar__actions .credit-badge {
  gap: 7px;
  min-height: 0;
  padding: 0;
  border-color: transparent;
  color: #78867e;
  background: transparent;
}

body:not(.admin-page) .topbar__actions .credit-badge__label {
  color: #87948c;
  font-weight: 400;
}

body:not(.admin-page) .topbar__actions .credit-badge strong {
  color: #20392d;
  font-weight: 400;
}

body:not(.admin-page) .topbar__actions .credit-badge__meta {
  color: #87948c;
}

body:not(.admin-page) .topbar__actions .primary-link.purchase-link {
  border-color: transparent;
  background: #0f8a4c;
  color: #ffffff;
  box-shadow: none;
}

body:not(.admin-page) .topbar__actions .primary-link.purchase-link:hover {
  border-color: #0b753f;
  background: #0b753f;
  color: #ffffff;
}

body:not(.admin-page) .topbar__actions #open-redeem-button {
  color: #315d47;
  background: #ffffff;
  border-color: rgba(24, 160, 88, 0.18);
}

body:not(.admin-page) .topbar__actions #open-redeem-button:hover {
  border-color: rgba(24, 160, 88, 0.26);
  background: #f4fbf7;
  color: #0f8a4c;
}

body:not(.admin-page) .topbar__actions .dev-tools-entry,
body:not(.admin-page) .mobile-account-grid .dev-tools-entry {
  border-color: rgba(33, 102, 213, 0.18);
  background: #f7faff;
  color: #24559f;
}

body:not(.admin-page) .topbar__actions .dev-tools-entry:hover,
body:not(.admin-page) .mobile-account-grid .dev-tools-entry:hover {
  border-color: rgba(33, 102, 213, 0.3);
  background: #eef4ff;
  color: #174ea6;
}

body:not(.admin-page) .app-shell {
  max-width: var(--jxt-shell-max-width, 1480px);
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 24px 28px;
}

body:not(.admin-page) .workspace-nav {
  /* Keep the three workspace tabs visually grouped like the desktop client. */
  gap: 4px;
  padding: 14px 10px;
  min-height: calc(100vh - 108px);
  border: 1px solid var(--fea-border);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(18, 33, 26, 0.08);
  backdrop-filter: none;
}

body:not(.admin-page) .workspace-nav__item {
  grid-template-rows: 30px auto;
  align-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #8a9290;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body:not(.admin-page) .workspace-nav__item:hover {
  background: #f4fbf7;
  border-color: rgba(24, 160, 88, 0.14);
  color: #5f6b68;
}

body:not(.admin-page) .workspace-nav__item.is-active {
  background: #e8f8ef;
  border-color: rgba(24, 160, 88, 0.16);
  color: #079351;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

body:not(.admin-page) .workspace-nav__icon {
  width: 30px;
  height: 30px;
}

body:not(.admin-page) .workspace-nav__icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

body:not(.admin-page) .workspace-nav__label {
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

body:not(.admin-page) .workspace-stage > .workspace-panel {
  display: none;
}

body:not(.admin-page) .workspace-stage > .workspace-panel.is-active {
  display: block;
}

body:not(.admin-page) .workspace-stage > .mobile-account-pane.workspace-panel.is-active {
  display: grid;
}

body:not(.admin-page) .jxt-composer-core__prompt-meta {
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

body:not(.admin-page) .jxt-web-reference-slot {
  position: static;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

body:not(.admin-page) .jxt-web-reference-slot .attach-trigger--inline {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
}

body:not(.admin-page) .jxt-web-reference-slot .attachment-strip {
  min-width: 0;
  margin: 0;
}

body:not(.admin-page) .jxt-web-reference-slot .attachment-strip__head {
  display: none;
}

body:not(.admin-page) .jxt-web-reference-slot .attachment-strip__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
}

body:not(.admin-page) .jxt-web-reference-slot .attachment-preview-item {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

/* Final web overrides follow the legacy composer rules so the shared surface
   remains the only visible creation UI. */
body:not(.admin-page) .workspace-nav {
  grid-template-rows: auto 1fr;
  align-content: start;
}

body:not(.admin-page) .workspace-nav__footer {
  display: grid;
  align-self: end;
  justify-items: stretch;
  gap: 4px;
}

body:not(.admin-page) .workspace-nav__download {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 8px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #5f6b68;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

body:not(.admin-page) .workspace-nav__download:hover,
body:not(.admin-page) .workspace-nav__download:focus-visible {
  border-color: rgba(24, 160, 88, 0.16);
  background: #f4fbf7;
  color: #0f8a4c;
}

body:not(.admin-page) .workspace-nav__download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.admin-page) .jxt-composer-core .jxt-web-reference-slot {
  position: static;
  width: auto;
  height: auto;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

body:not(.admin-page) .topbar .shared-web-account .account-summary {
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.admin-page) .topbar .shared-web-account .account-avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(24, 160, 88, 0.18);
  font-size: 14px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .shared-web-account .account-identity strong {
  font-size: 13px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .shared-web-account .credit-balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

body:not(.admin-page) .topbar .shared-web-account .account-actions {
  gap: 3px;
  padding-left: 8px;
  border-left: 1px solid var(--fea-border);
}

body:not(.admin-page) .topbar .shared-web-account .account-actions .compact,
body:not(.admin-page) .topbar .shared-web-account .account-actions .account-logout-button {
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #6f7975;
  font-size: 12px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .shared-web-account .account-actions .account-purchase-button {
  color: #079351;
}

/* Web workspace alignment with the desktop shell. Keep the three navigation
   actions together; the rail itself is not a full-height content column. */
body:not(.admin-page) .app-shell {
  grid-template-columns: 104px minmax(0, 1fr);
}

body:not(.admin-page) .workspace-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: start;
  gap: 8px;
  height: max-content;
  min-height: 0;
  max-height: none;
  padding: 12px 10px;
}

body:not(.admin-page) .workspace-nav__item {
  flex: 0 0 auto;
  min-height: 68px;
  padding: 10px 8px;
}

/* The desktop uses a balanced creator/results split instead of a narrow
   fixed queue column. Preserve a usable minimum on medium screens. */
body:not(.admin-page) .workspace-layout {
  grid-template-columns: minmax(560px, 58fr) minmax(420px, 42fr);
  align-items: start;
}

body:not(.admin-page) .queue-pane {
  min-width: 0;
}

/* Shared task media is a stable 3:4 slot. Status and progress copy stay
   inside that slot even when localized text is longer than expected. */
body:not(.admin-page) .queue-pane .task {
  min-width: 0;
  overflow: hidden;
}

body:not(.admin-page) .queue-pane .task-placeholder,
body:not(.admin-page) .queue-pane .result-thumb {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

body:not(.admin-page) .queue-pane .task-placeholder__label,
body:not(.admin-page) .queue-pane .task-placeholder__stage,
body:not(.admin-page) .queue-pane .task-placeholder__timer {
  max-width: calc(100% - 24px);
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}

body:not(.admin-page) .queue-pane .task-placeholder__timer {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1;
}

/* Match the desktop account summary: one quiet compact group, with text-like
   redeem/purchase/logout actions rather than separate floating pills. */
body:not(.admin-page) .topbar .shared-web-account {
  max-width: min(640px, 58vw);
}

body:not(.admin-page) .topbar .shared-web-account .account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--fea-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 18px rgba(24, 50, 43, 0.06);
}

body:not(.admin-page) .topbar .shared-web-account .account-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding-left: 8px;
  border-left: 1px solid var(--fea-border);
}

body:not(.admin-page) .topbar .shared-web-account .account-actions .compact,
body:not(.admin-page) .topbar .shared-web-account .account-actions .account-logout-button {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #6f7975;
  font-size: 12px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .shared-web-account .account-actions .compact:hover,
body:not(.admin-page) .topbar .shared-web-account .account-actions .account-logout-button:hover {
  background: var(--jxt-color-surface-subtle);
  color: var(--fea-text);
}

/* Keep this final because legacy web rules below define the workspace split. */
body:not(.admin-page) .workspace-layout {
  grid-template-columns: minmax(560px, 58fr) minmax(420px, 42fr);
}

body:not(.admin-page) .workspace-layout {
  grid-template-columns: var(--jxt-workspace-columns, minmax(0, 1fr) minmax(380px, 430px));
  gap: 20px;
  min-height: calc(100vh - 108px);
}

body:not(.admin-page) .chat-pane,
body:not(.admin-page) .mobile-tab-panel--create.workspace-panel {
  border: 1px solid var(--fea-border);
  border-radius: 18px;
  background: var(--fea-panel);
  box-shadow: var(--fea-shadow);
  backdrop-filter: none;
}

body:not(.admin-page) .chat-pane {
  grid-template-areas:
    "composer"
    "thread";
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 108px);
  padding: 20px;
  gap: 16px;
}

body:not(.admin-page) .chat-thread {
  grid-area: thread;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

body:not(.admin-page) #generate-form {
  grid-area: composer;
}

body:not(.admin-page) #generate-form.is-attachment-dragging .prompt-surface {
  border-color: rgba(24, 160, 88, 0.55);
  box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .composer-shell--create {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--fea-border);
  border-radius: 14px;
  background: var(--fea-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

body:not(.admin-page) .create-toolbar {
  display: none;
}

body:not(.admin-page) #new-task-button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--fea-border);
  background: #ffffff;
  color: var(--fea-muted);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: none;
}

body:not(.admin-page) .create-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--fea-border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

body:not(.admin-page) .create-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body:not(.admin-page) .ratio-picker {
  position: relative;
}

body:not(.admin-page) .create-section__title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not(.admin-page) .create-section__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--fea-accent);
  font-size: 0.92rem;
  font-weight: 700;
}

body:not(.admin-page) .create-section__title {
  font-family: var(--fea-ui-font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fea-text);
}

body:not(.admin-page) .section-link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fea-muted);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
}

body:not(.admin-page) .section-link-button:hover {
  color: var(--fea-text);
}

body:not(.admin-page) .style-grid--recent {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body:not(.admin-page) .ratio-picker {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

body:not(.admin-page) .style-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fea-text);
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: transform 160ms ease;
}

body:not(.admin-page) .style-card:hover {
  transform: translateY(-1px);
}

body:not(.admin-page) .style-card[aria-pressed="true"] {
  box-shadow: none;
}

body:not(.admin-page) .style-card__preview {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 0;
  border-radius: 10px;
  border: 1px solid var(--fea-border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(251, 248, 241, 0.86)),
    var(--fea-cream);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body:not(.admin-page) .style-card[aria-pressed="true"] .style-card__preview {
  border-color: rgba(24, 160, 88, 0.56);
  box-shadow:
    0 0 0 3px rgba(24, 160, 88, 0.12),
    0 6px 18px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .style-card__label {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fea-muted);
}

body:not(.admin-page) .style-card__check {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--fea-green);
  color: #ffffff;
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 160ms ease, transform 160ms ease;
}

body:not(.admin-page) .style-card__zoom {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(17, 24, 39, 0.9);
  cursor: pointer;
  opacity: 0;
  transform: translateY(2px) scale(0.94);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  transition: opacity 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

body:not(.admin-page) .style-card__zoom svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.admin-page) .style-card:hover .style-card__zoom,
body:not(.admin-page) .style-card:focus-within .style-card__zoom,
body:not(.admin-page) .style-card__zoom:hover,
body:not(.admin-page) .style-card__zoom:focus-visible {
  color: rgba(12, 18, 28, 0.96);
  background: rgba(255, 255, 255, 0.92);
  opacity: 1;
  box-shadow:
    0 16px 28px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: translateY(0) scale(1);
}

body:not(.admin-page) .style-card__zoom:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.78);
  outline-offset: 2px;
}

body:not(.admin-page) .style-card:focus-visible .style-card__preview {
  outline: 2px solid rgba(24, 160, 88, 0.24);
  outline-offset: 3px;
}

body:not(.admin-page) .style-card[aria-pressed="true"] .style-card__check {
  opacity: 1;
  transform: scale(1);
}

body:not(.admin-page) .style-card--student .style-card__preview {
  background: linear-gradient(135deg, #f7dcc9 0%, #fff8f1 52%, #f5b494 100%);
}

body:not(.admin-page) .style-card--cartoon .style-card__preview {
  background: linear-gradient(135deg, #fde89d 0%, #ffd4c8 50%, #f6a87b 100%);
}

body:not(.admin-page) .style-card--handwritten .style-card__preview {
  background: linear-gradient(135deg, #efe3d5 0%, #fffdf8 52%, #d6bb9c 100%);
}

body:not(.admin-page) .style-card--chalkboard .style-card__preview {
  background: linear-gradient(135deg, #4a5a53 0%, #71877d 45%, #d7e6dd 100%);
}

body:not(.admin-page) .style-card--paper .style-card__preview {
  background: linear-gradient(135deg, #f2e8dc 0%, #fffdfa 55%, #d3c2af 100%);
}

body:not(.admin-page) .style-card--mint .style-card__preview {
  background: linear-gradient(135deg, #d7efe5 0%, #f6fffb 55%, #84c4aa 100%);
}

body:not(.admin-page) .style-card--marker .style-card__preview {
  background: linear-gradient(135deg, #fce2bf 0%, #fff8f1 52%, #ef8d64 100%);
}

body:not(.admin-page) .style-card--blueprint .style-card__preview {
  background: linear-gradient(135deg, #cadcf8 0%, #f6fbff 55%, #7ea4e3 100%);
}

body:not(.admin-page) .style-card--warm .style-card__preview {
  background: linear-gradient(135deg, #f7ddd1 0%, #fff8f0 52%, #d7a072 100%);
}

body:not(.admin-page) .prompt-surface {
  position: relative;
  min-height: 210px;
  padding: var(--jxt-space-4) var(--jxt-space-4) 72px;
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-panel);
  background: var(--jxt-color-surface);
}

body:not(.admin-page) .prompt-surface textarea {
  min-height: 116px;
  padding: 0;
  color: var(--jxt-color-text);
  font-size: 0.94rem;
  line-height: 1.7;
}

body:not(.admin-page) .prompt-surface__count {
  color: var(--jxt-color-muted);
  font-size: 0.8rem;
}

body:not(.admin-page) .prompt-surface__meta {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not(.admin-page) .prompt-surface__clear {
  border: 0;
  background: transparent;
  color: var(--jxt-color-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

body:not(.admin-page) .prompt-surface__clear:hover:not(:disabled),
body:not(.admin-page) .prompt-surface__clear:focus-visible {
  color: var(--jxt-color-primary);
}

body:not(.admin-page) .prompt-surface__clear:focus-visible {
  outline: 2px solid var(--jxt-color-border-strong);
  outline-offset: 3px;
}

body:not(.admin-page) .prompt-surface__clear:disabled {
  cursor: default;
  opacity: 0.42;
}

body:not(.admin-page) .prompt-surface__floating {
  position: absolute;
  left: 16px;
  right: 112px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

body:not(.admin-page) .attach-trigger--inline {
  width: auto;
  min-width: 58px;
  height: 56px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--fea-soft);
  color: var(--fea-text);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  box-shadow: none;
  border: 1px dashed rgba(24, 160, 88, 0.28);
}

body:not(.admin-page) .attach-trigger__icon {
  font-size: 1rem;
  color: var(--fea-accent);
}

body:not(.admin-page) .attach-trigger__label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--fea-muted);
}

body:not(.admin-page) .prompt-surface .attachment-strip--inline {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body:not(.admin-page) .prompt-surface .attachment-strip__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

body:not(.admin-page) .prompt-surface .attachment-preview-item {
  position: relative;
  grid-template-columns: 1fr;
  width: 56px;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.admin-page) .prompt-surface .attachment-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border-color: var(--fea-border);
}

body:not(.admin-page) .prompt-surface .attachment-thumb__remove {
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  font-size: 0.72rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

body:not(.admin-page) .prompt-surface .attachment-preview-item__meta {
  display: none;
}

body:not(.admin-page) .recent-ratio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body:not(.admin-page) .recent-ratio-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 58px;
  padding: 8px 8px;
  border: 1px solid rgba(18, 33, 26, 0.2);
  border-radius: 10px;
  background: #ffffff;
  color: var(--fea-muted);
  cursor: pointer;
  box-shadow: none;
}

body:not(.admin-page) .recent-ratio-card[aria-pressed="true"] {
  border-color: #164b33;
  background: #164b33;
  color: #ffffff;
  box-shadow: none;
}

body:not(.admin-page) .recent-ratio-card[aria-pressed="true"] .recent-ratio-card__shape,
body:not(.admin-page) .recent-ratio-card[aria-pressed="true"] .recent-ratio-card__label {
  color: #ffffff;
}

body:not(.admin-page) .recent-ratio-card__shape {
  width: var(--ratio-preview-width, 18px);
  height: var(--ratio-preview-height, 18px);
  border-radius: 2px;
  background: transparent;
  border: 0.3px solid currentColor;
  box-shadow: none;
}

body:not(.admin-page) .recent-ratio-card__label {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.2;
}

body:not(.admin-page) .composer-footer--create {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

body:not(.admin-page) .composer-tools--create,
body:not(.admin-page) .composer-actions--create {
  gap: 10px;
}

body:not(.admin-page) .composer-tools--create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  justify-content: start;
  width: 100%;
}

body:not(.admin-page) .select-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--jxt-control-height);
  min-width: 0;
  padding: 0 0 0 12px;
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-control-relaxed);
  background: var(--jxt-color-surface);
  color: var(--jxt-color-muted);
}

body:not(.admin-page) .select-control__label {
  color: var(--jxt-color-muted);
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

body:not(.admin-page) .select-control--channel {
  display: none !important;
  grid-template-columns: minmax(0, 1fr);
  padding-left: 4px;
}

/* Shared task cards use the desktop task markup on the web as well. Reserve
   the media slot before content arrives so progress copy cannot escape the
   card, and keep long localized stage labels inside the 3:4 frame. */
body:not(.admin-page) .queue-pane .task-placeholder {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  box-sizing: border-box;
}

body:not(.admin-page) .queue-pane .result-thumb {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

body:not(.admin-page) .queue-pane .task-placeholder__label,
body:not(.admin-page) .queue-pane .task-placeholder__stage {
  max-width: calc(100% - 24px);
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}

body:not(.admin-page) .queue-pane .task-placeholder__timer {
  max-width: 100%;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1;
}

body:not(.admin-page) .composer-tools--create .select-control select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 30px 0 8px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, #6d7b72 50%),
    linear-gradient(135deg, #6d7b72 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: none;
}

body:not(.admin-page) .composer-tools--create .select-control #clarity,
body:not(.admin-page) .composer-tools--create .select-control #ratio,
body:not(.admin-page) .composer-tools--create .select-control #api-channel {
  min-width: 0;
}

body:not(.admin-page) .composer-actions--create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-items: stretch;
}

body:not(.admin-page) .composer-tools--create select,
body:not(.admin-page) .image-count-control {
  min-height: var(--jxt-control-height);
  border-radius: var(--jxt-radius-control-relaxed);
  border-color: var(--fea-border);
  background-color: var(--jxt-color-surface);
  color: var(--jxt-color-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

body:not(.admin-page) .select-control:focus-within,
body:not(.admin-page) .composer-tools--create select:focus,
body:not(.admin-page) .image-count-control:focus-within {
  border-color: var(--jxt-color-border-strong);
  box-shadow: var(--jxt-focus-ring);
}

body:not(.admin-page) .composer-tools--create .select-control select:focus {
  box-shadow: none;
}

body:not(.admin-page) .ratio-mobile-trigger {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 30px 0 8px;
  border: 0;
  border-radius: 0;
  color: var(--fea-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  background:
    linear-gradient(45deg, transparent 50%, #6d7b72 50%) calc(100% - 16px) calc(50% - 2px) / 5px 5px no-repeat,
    linear-gradient(135deg, #6d7b72 50%, transparent 50%) calc(100% - 11px) calc(50% - 2px) / 5px 5px no-repeat;
}

body:not(.admin-page) .ratio-mobile-trigger[hidden] {
  display: none !important;
}

body:not(.admin-page) .ratio-mobile-trigger span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-page) .ratio-mobile-menu {
  position: fixed;
  z-index: 1200;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
}

body:not(.admin-page) .ratio-mobile-menu[hidden] {
  display: none !important;
}

body:not(.admin-page) .ratio-mobile-option {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--fea-text);
  font: inherit;
  font-size: 0.88rem;
  line-height: 32px;
  text-align: left;
  background: transparent;
}

body:not(.admin-page) .ratio-mobile-option.is-selected {
  color: #ffffff;
  background: #2563eb;
}

body:not(.admin-page) .generation-cost-summary {
  display: block;
  color: var(--fea-muted);
  font-size: 0.82rem;
  text-align: right;
}

body:not(.admin-page) #submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 220px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--fea-green) 0%, var(--fea-green-deep) 100%);
  color: #f8fffb;
  box-shadow: 0 10px 20px rgba(24, 160, 88, 0.18);
}

body:not(.admin-page) #submit-button .submit-button__icon {
  display: inline-flex;
  width: 26px;
  height: 23px;
  flex: 0 0 26px;
  align-items: center;
  justify-content: center;
}

body:not(.admin-page) #submit-button .submit-button__icon svg {
  width: 26px;
  height: 23px;
  flex: 0 0 26px;
  display: block;
  fill: currentColor;
  overflow: visible;
  transform-origin: center;
}

body:not(.admin-page) #submit-button .submit-button__icon svg path {
  fill: currentColor;
}

body:not(.admin-page) #submit-button .submit-button__label {
  min-width: 0;
}

body:not(.admin-page) .style-modal {
  width: min(1180px, calc(100vw - 40px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
}

body:not(.admin-page) .style-modal::backdrop {
  background: var(--jxt-color-overlay);
  backdrop-filter: blur(6px);
}

body:not(.admin-page) .style-modal__shell {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-card-large);
  background: var(--jxt-color-surface-raised);
  box-shadow: var(--jxt-shadow-modal);
}

body:not(.admin-page) .style-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body:not(.admin-page) .style-modal__title {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
}

body:not(.admin-page) .style-modal__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(18, 126, 83, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #465450;
  cursor: pointer;
  font: 400 24px/1 var(--fea-display-font);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px) saturate(150%);
}

body:not(.admin-page) .style-modal__close:hover {
  border-color: rgba(18, 126, 83, 0.24);
  color: #123f2d;
  background: rgba(255, 255, 255, 0.96);
}

body:not(.admin-page) .style-modal__close:focus-visible {
  outline: none;
  border-color: rgba(24, 160, 88, 0.36);
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.08),
    0 0 0 4px rgba(24, 160, 88, 0.14);
}

body:not(.admin-page) .style-grid--modal {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body:not(.admin-page) .ratio-picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  bottom: auto;
  z-index: 8;
  width: 640px;
  max-width: min(640px, calc(100vw - 40px));
  transform: translateX(-50%);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 14px;
  border: 1px solid var(--fea-border);
  background: #ffffff;
  opacity: 1;
  backdrop-filter: none;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  padding: 12px;
}

body:not(.admin-page) .ratio-picker__panel[data-placement="above"] {
  top: auto;
  bottom: calc(100% + 8px);
}

body:not(.admin-page) .ratio-picker__panel[data-placement="below"] {
  top: calc(100% + 8px);
  bottom: auto;
}

body:not(.admin-page) .ratio-picker__head,
body:not(.admin-page) .ratio-option__name,
body:not(.admin-page) .ratio-option__detail {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 500;
}

body:not(.admin-page) .ratio-picker__head {
  padding-bottom: 12px;
  color: var(--fea-text);
  font-size: 0.88rem;
}

body:not(.admin-page) .ratio-picker__head strong {
  color: var(--fea-accent);
}

body:not(.admin-page) .ratio-picker__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body:not(.admin-page) .ratio-option {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 58px;
  padding: 8px 8px;
  border-radius: 10px;
  border-color: var(--fea-border);
  background: #ffffff;
  box-shadow: none;
}

body:not(.admin-page) .ratio-option:hover,
body:not(.admin-page) .ratio-option:focus-visible {
  border-color: rgba(24, 160, 88, 0.34);
  box-shadow: 0 8px 18px rgba(24, 160, 88, 0.1);
}

body:not(.admin-page) .ratio-option[aria-pressed="true"] {
  border-color: rgba(24, 160, 88, 0.34);
  background: var(--fea-wash);
  color: var(--fea-text);
}

body:not(.admin-page) .ratio-option__shape {
  width: var(--ratio-preview-width, 18px);
  height: var(--ratio-preview-height, 18px);
  border-radius: 2px;
  background: transparent;
  border: 0.3px solid currentColor;
}

body:not(.admin-page) .ratio-option[aria-pressed="true"] .ratio-option__shape {
  color: #ffffff;
  background: transparent;
}

body:not(.admin-page) .ratio-option__name {
  color: var(--fea-text);
  font-size: 0.76rem;
  line-height: 1.2;
  font-weight: 400;
}

body:not(.admin-page) .ratio-option__detail {
  display: none;
}

body:not(.admin-page) .ratio-option[aria-pressed="true"] {
  background: #164b33;
  border-color: #164b33;
  color: #ffffff;
}

body:not(.admin-page) .ratio-option[aria-pressed="true"] .ratio-option__name {
  color: #ffffff;
}

body:not(.admin-page) .workspace-layout {
  grid-template-columns: var(--jxt-workspace-columns, minmax(640px, 1fr) minmax(560px, 640px));
  align-items: start;
  gap: 18px;
}

body:not(.admin-page) .mobile-tab-panel--create.workspace-panel {
  width: 100%;
  max-width: 100%;
}

body:not(.admin-page) .chat-pane {
  min-height: 0;
  align-self: start;
  position: sticky;
  z-index: 20;
  top: 12px;
  padding: 18px;
  gap: 14px;
}

body:not(.admin-page) .workspace-nav {
  position: sticky;
  top: 12px;
  align-self: start;
  min-height: calc(100vh - 108px);
  max-height: calc(100vh - 24px);
}

body:not(.admin-page) .queue-pane {
  position: relative;
  z-index: 1;
}

body:not(.admin-page) .chat-thread {
  display: grid;
  align-content: start;
  gap: 14px;
}

body:not(.admin-page) .composer-shell--create {
  gap: var(--jxt-space-6);
  padding: var(--jxt-space-6);
}

/* Prompt library is a static, client-side workspace: browsing and search add no API traffic. */
body:not(.admin-page) .prompt-library-pane {
  min-height: calc(100vh - 108px);
  padding: 22px;
  border: 1px solid #dfe8e5;
  border-radius: 14px;
  background: #f8fbfa;
}

body:not(.admin-page) .prompt-library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

body:not(.admin-page) .prompt-library-head h1,
body:not(.admin-page) .prompt-library-head p {
  margin: 0;
}

body:not(.admin-page) .prompt-library-head h1 {
  margin-top: 4px;
  color: #17211e;
  font-size: 24px;
  line-height: 1.25;
}

body:not(.admin-page) .prompt-library-search {
  display: flex;
  width: min(420px, 46vw);
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #d7e2df;
  border-radius: 8px;
  background: #fff;
  color: #75817d;
}

body:not(.admin-page) .prompt-library-search:focus-within {
  border-color: #1da774;
  box-shadow: 0 0 0 3px rgba(29, 167, 116, .12);
}

body:not(.admin-page) .prompt-library-search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

body:not(.admin-page) .prompt-library-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #17211e;
  font: inherit;
}

body:not(.admin-page) .prompt-library-count {
  margin: 0 0 16px;
  color: #75817d;
  font-size: 13px;
}

body:not(.admin-page) .prompt-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 12px;
}

body:not(.admin-page) .prompt-library-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 160px;
  grid-template-rows: 1fr;
  overflow: hidden;
  border: 1px solid #dfe8e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(28, 55, 45, .05);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body:not(.admin-page) .prompt-library-card:hover,
body:not(.admin-page) .prompt-library-card:focus-within {
  border-color: #9ed7c2;
  box-shadow: 0 9px 24px rgba(28, 55, 45, .1);
  transform: translateY(-1px);
}

body:not(.admin-page) .prompt-library-card__open {
  display: grid;
  min-width: 0;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 10px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

body:not(.admin-page) .prompt-library-card__open > img {
  width: 96px;
  height: 128px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: contain;
  background: #eef4f2;
}

body:not(.admin-page) .prompt-library-card__body {
  display: flex;
  min-width: 0;
  padding-bottom: 32px;
  flex-direction: column;
  align-items: flex-start;
}

body:not(.admin-page) .prompt-library-card__category {
  margin-bottom: 5px;
  color: #16865f;
  font-size: 11px;
  font-weight: 650;
}

body:not(.admin-page) .prompt-library-card__body > strong {
  color: #17211e;
  font-size: 16px;
  line-height: 1.35;
}

body:not(.admin-page) .prompt-library-card__description {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: #697571;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body:not(.admin-page) .prompt-library-card__tags,
body:not(.admin-page) .prompt-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

body:not(.admin-page) .prompt-library-card__tags {
  margin-top: auto;
  padding-top: 8px;
}

body:not(.admin-page) .prompt-library-card__tags span,
body:not(.admin-page) .prompt-detail-tags span {
  padding: 3px 7px;
  border-radius: 5px;
  background: #edf7f3;
  color: #3d6f5e;
  font-size: 11px;
  line-height: 1.2;
}

body:not(.admin-page) .prompt-library-card__actions {
  display: flex;
  position: absolute;
  right: 10px;
  bottom: 10px;
  justify-content: flex-end;
  gap: 7px;
}

body:not(.admin-page) .prompt-library-card__copy,
body:not(.admin-page) .prompt-library-card__use {
  min-height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

body:not(.admin-page) .prompt-library-card__copy {
  display: inline-grid;
  width: 28px;
  place-items: center;
  border: 1px solid #d7e2df;
  background: #fff;
  color: #52615c;
}

body:not(.admin-page) .prompt-library-card__copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

body:not(.admin-page) .prompt-library-card__copy.is-copied {
  border-color: #83c9ad;
  background: #edf8f3;
  color: #12865c;
}

body:not(.admin-page) .prompt-library-card__copy.is-copied svg {
  display: none;
}

body:not(.admin-page) .prompt-library-card__copy.is-copied::after {
  content: "\2713";
  font-size: 17px;
  font-weight: 700;
}

body:not(.admin-page) .prompt-library-card__use {
  min-width: 56px;
  padding: 4px 11px;
  border: 1px solid #159c6c;
  background: #1aa875;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
}

body:not(.admin-page) .prompt-library-card__copy:hover,
body:not(.admin-page) .prompt-library-card__copy:focus-visible {
  border-color: #8fcbb5;
  color: #16865f;
}

body:not(.admin-page) .prompt-library-card__use:hover,
body:not(.admin-page) .prompt-library-card__use:focus-visible {
  background: #128d61;
}

body:not(.admin-page) .prompt-library-empty {
  padding: 80px 20px;
  color: #697571;
  text-align: center;
}

body:not(.admin-page) .prompt-library-empty p {
  margin: 0 0 14px;
}

body:not(.admin-page) .prompt-detail-dialog {
  width: min(980px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #17211e;
  box-shadow: 0 26px 80px rgba(17, 35, 29, .24);
}

body:not(.admin-page) .prompt-detail-dialog::backdrop {
  background: rgba(17, 29, 25, .52);
  backdrop-filter: blur(3px);
}

body:not(.admin-page) .prompt-detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 40%) minmax(0, 1fr);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
}

body:not(.admin-page) .prompt-detail-preview {
  display: grid;
  min-height: 520px;
  place-items: center;
  padding: 16px;
  background: #eef4f2;
}

body:not(.admin-page) .prompt-detail-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body:not(.admin-page) .prompt-detail-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  padding: 34px 32px 28px;
}

body:not(.admin-page) .prompt-detail-content h2 {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.3;
}

body:not(.admin-page) .prompt-detail-description {
  margin: 0;
  color: #697571;
  line-height: 1.7;
}

body:not(.admin-page) .prompt-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body:not(.admin-page) .prompt-detail-meta span {
  padding: 6px 9px;
  border: 1px solid #dce7e3;
  border-radius: 6px;
  color: #52615c;
  font-size: 12px;
}

body:not(.admin-page) .prompt-detail-text-block {
  padding: 15px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  background: #f7faf9;
}

body:not(.admin-page) .prompt-detail-text-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #52615c;
  font-size: 12px;
}

body:not(.admin-page) .prompt-detail-text-block p {
  max-height: 210px;
  margin: 12px 0 0;
  overflow: auto;
  color: #26332f;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

body:not(.admin-page) .prompt-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
}

body:not(.admin-page) .prompt-detail-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid #dce7e3;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #52615c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 760px) {
  body:not(.admin-page) .prompt-library-pane {
    min-height: calc(100vh - 150px);
    padding: 16px 14px 90px;
    border: 0;
    border-radius: 0;
  }

  body:not(.admin-page) .prompt-library-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  body:not(.admin-page) .prompt-library-search {
    width: 100%;
  }

  body:not(.admin-page) .prompt-library-grid {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page) .prompt-detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
  }

  body:not(.admin-page) .prompt-detail-shell {
    display: block;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  body:not(.admin-page) .prompt-detail-preview {
    min-height: 0;
    aspect-ratio: 3 / 4;
  }

  body:not(.admin-page) .prompt-detail-close {
    position: fixed;
    top: 22px;
    right: 22px;
  }

  body:not(.admin-page) .prompt-detail-content {
    gap: 14px;
    padding: 20px 18px 22px;
  }

  body:not(.admin-page) .prompt-detail-content h2 {
    font-size: 21px;
  }

  body:not(.admin-page) .prompt-detail-actions .ghost-button,
  body:not(.admin-page) .prompt-detail-actions .primary-button {
    flex: 1;
  }
}

body:not(.admin-page) .create-section {
  gap: var(--jxt-space-3);
}

body:not(.admin-page) #new-task-button,
body:not(.admin-page) .section-link-button,
body:not(.admin-page) .style-card__label,
body:not(.admin-page) .recent-ratio-card__label,
body:not(.admin-page) .composer-tools--create select,
body:not(.admin-page) .image-count-control,
body:not(.admin-page) .generation-cost-summary,
body:not(.admin-page) .queue-card__title,
body:not(.admin-page) .queue-card__download,
body:not(.admin-page) .queue-card__details-toggle,
body:not(.admin-page) .queue-card__reference,
body:not(.admin-page) .queue-card__regenerate,
body:not(.admin-page) .queue-card__pill,
body:not(.admin-page) .record-card__title,
body:not(.admin-page) .record-card__meta,
body:not(.admin-page) .record-card__summary,
body:not(.admin-page) .mobile-account-card__meta,
body:not(.admin-page) .mobile-account-card__label,
body:not(.admin-page) .queue-card__status,
body:not(.admin-page) .prompt-surface__count,
body:not(.admin-page) .attach-trigger__label,
body:not(.admin-page) .meta-pill {
  font-weight: 400;
}

body:not(.admin-page) .create-section__index,
body:not(.admin-page) .create-section__title,
body:not(.admin-page) .style-modal__title,
body:not(.admin-page) .record-pane__head h1,
body:not(.admin-page) .mobile-account-pane__head h1,
body:not(.admin-page) .mobile-account-card strong,
body:not(.admin-page) .empty-state h2 {
  font-weight: 500;
}

body:not(.admin-page) .record-pane__head h1,
body:not(.admin-page) .mobile-account-pane__head h1,
body:not(.admin-page) .empty-state h2,
body:not(.admin-page) .auth-modal__title-block h2,
body:not(.admin-page) .redeem-panel h2,
body:not(.admin-page) .mobile-account-panel__head h2 {
  font-family: var(--fea-display-font);
  letter-spacing: 0;
}

body:not(.admin-page) .prompt-surface {
  padding: 16px 16px 70px;
}

body:not(.admin-page) .attach-trigger--inline {
  min-width: 72px;
  padding: 0 10px;
  flex-direction: row;
  gap: 6px;
}

body:not(.admin-page) .attach-trigger__icon {
  font-size: 1.05rem;
}

body:not(.admin-page) .attach-trigger__label {
  font-size: 0.76rem;
  white-space: nowrap;
}

body:not(.admin-page) .attachment-strip__head {
  display: none;
}

body:not(.admin-page) .style-grid--recent,
body:not(.admin-page) .recent-ratio-grid {
  gap: 12px;
}

body:not(.admin-page) .style-modal {
  width: min(1120px, calc(100vw - 40px));
}

body:not(.admin-page) .style-modal__shell {
  padding: 20px;
}

body:not(.admin-page) .style-grid--modal {
  grid-template-columns: repeat(auto-fill, 136px);
  justify-content: start;
  gap: 12px;
}

body:not(.admin-page) .queue-pane,
body:not(.admin-page) .record-pane {
  min-height: calc(100vh - 108px);
  padding: 18px;
  border: 1px solid var(--fea-border);
  border-radius: 18px;
  background: var(--fea-panel);
  box-shadow: var(--fea-shadow);
  backdrop-filter: none;
}

body:not(.admin-page) .queue-pane__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--fea-border);
}

body:not(.admin-page) .queue-pane__toolbar > div:first-child {
  min-width: 0;
}

body:not(.admin-page) .queue-pane__toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

body:not(.admin-page) #queue-count {
  display: inline-flex !important;
}

body:not(.admin-page) .queue-pane__new-task {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
}

body:not(.admin-page) .queue-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* The shared list is one grid child containing multiple task cards. It must
   span the whole queue rather than inheriting one half of the legacy grid. */
body:not(.admin-page) .queue-grid > jxt-history-list {
  grid-column: 1 / -1;
  min-width: 0;
}

/* Keep the web queue on the same card grid contract as Desktop. The shared
   history component owns the actual task list, so styling only .queue-grid
   leaves its default flex column in place and makes the queue look like a
   single wide card. Match Desktop's 180px minimum: three columns on wide
   desktop panes, two when the pane is narrower, and let the existing mobile
   rule collapse to one column. */
@media (min-width: 761px) {
  body:not(.admin-page) .queue-pane .jxt-history-list__items,
  body:not(.admin-page) .queue-pane .task-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    width: 100%;
  }
}

@media (min-width: 1200px) {
  body:not(.admin-page) .queue-pane {
    height: calc(100vh - 108px);
    max-height: calc(100vh - 108px);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body:not(.admin-page) .queue-grid {
    min-height: 0;
    overflow-y: auto;
    align-content: start;
    scrollbar-gutter: stable;
  }
}

body:not(.admin-page) .queue-card {
  gap: 10px;
  padding: 10px;
  border-radius: var(--jxt-radius-card-large);
  border-color: var(--fea-border);
  background: var(--jxt-color-surface-raised);
  box-shadow: var(--jxt-shadow-card);
}

body:not(.admin-page) .queue-card__preview {
  border-radius: var(--jxt-radius-media);
  border-color: var(--fea-border);
  background: linear-gradient(180deg, rgba(251, 248, 241, 0.94), rgba(239, 248, 242, 0.9));
}

body:not(.admin-page) .queue-card__status {
  top: 10px;
  right: 10px;
  padding: 5px 9px;
  font-size: 0.76rem;
}

body:not(.admin-page) .queue-card__placeholder {
  font-size: 0.84rem;
  font-weight: 400;
}

body:not(.admin-page) .queue-card__body {
  gap: 8px;
}

body:not(.admin-page) .queue-card__actions {
  gap: 6px;
}

/* The Desktop queue is a quiet raised canvas rather than a second white
   composer card.  Keep this surface/token exact on Web so empty space and
   completed cards compare the same at wide desktop widths. */
body:not(.admin-page) .queue-pane {
  border-color: #dce9e5;
  background: #f7faf9;
  box-shadow: none;
}

/* Keep the shared Web task cards in the same information order as Desktop:
   the fixed 3:4 media slot comes first, followed by prompt/meta and actions.
   The shared component intentionally owns markup; these platform rules only
   tune the Web presentation and do not change task semantics. */
body:not(.admin-page) .queue-pane .task {
  display: flex;
  flex-direction: column;
  padding: 10px;
  position: relative;
}

body:not(.admin-page) .queue-pane .task-head {
  order: 2;
  gap: 8px;
}

body:not(.admin-page) .queue-pane .task-head > div,
body:not(.admin-page) .queue-pane .task-prompt-block {
  min-width: 0;
}

body:not(.admin-page) .queue-pane .task-head strong {
  max-width: none;
  overflow: hidden;
  color: var(--fea-text);
  font-size: 0.82rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-page) .queue-pane .task-head small {
  margin-top: 4px;
  color: var(--fea-muted);
  font-size: 0.64rem;
}

/* Desktop keeps the task id out of the compact card and exposes it from the
   details surface instead. Keep the Web copy affordance in the DOM for
   keyboard/automation access, but remove it from the default card geometry;
   expanding "more" restores the same inline row for Web users. */
body:not(.admin-page) .queue-pane .task > .task-id {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

body:not(.admin-page) .queue-pane .task.task-details-open > .task-id {
  position: static;
  width: auto;
  height: auto;
  margin-top: 9px;
  padding: 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  opacity: 1;
  pointer-events: auto;
}

body:not(.admin-page) .queue-pane .task-head .status {
  position: absolute;
  top: 10px;
  right: 10px;
  pointer-events: none;
}

body:not(.admin-page) .queue-pane .task-placeholder,
body:not(.admin-page) .queue-pane .result-grid {
  order: 1;
  margin-top: 10px;
}

body:not(.admin-page) .queue-pane .task-placeholder {
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-media);
  background: #f0f6f4;
}

body:not(.admin-page) .queue-pane .result-grid {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.admin-page) .queue-pane .result-thumb {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--fea-border);
  border-radius: var(--jxt-radius-media);
}

body:not(.admin-page) .queue-pane .task-actions {
  order: 3;
  margin-top: 10px;
}

body:not(.admin-page) .queue-pane .message {
  order: 5;
  margin-top: 10px;
}

/* History uses the same compact horizontal record as the Desktop record pane.
   The shared record card remains keyboard/action compatible while its media
   thumb, metadata and controls occupy the same stable columns. */
body:not(.admin-page) .record-pane .jxt-history-list__items {
  display: grid;
  gap: 12px;
}

body:not(.admin-page) .record-pane .record-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  column-gap: 14px;
  row-gap: 4px;
  box-sizing: border-box;
  height: 152px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border-color: #d5e5e0;
  border-radius: 12px;
  background: var(--jxt-color-surface-raised);
  box-shadow: 0 2px 8px rgba(35, 76, 66, .045);
}

body:not(.admin-page) .record-pane .record-card .task-placeholder,
body:not(.admin-page) .record-pane .record-card .result-grid {
  grid-column: 1;
  grid-row: 1 / span 4;
  align-self: start;
  width: 96px;
  margin: 0;
}

body:not(.admin-page) .record-pane .record-card .task-placeholder {
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
}

body:not(.admin-page) .record-pane .record-card .result-grid {
  grid-template-columns: minmax(0, 1fr);
}

body:not(.admin-page) .record-pane .record-card .result-thumb {
  aspect-ratio: 3 / 4;
}

body:not(.admin-page) .record-pane .record-card .task-head,
body:not(.admin-page) .record-pane .record-card .task-id,
body:not(.admin-page) .record-pane .record-card .message,
body:not(.admin-page) .record-pane .record-card .task-actions,
body:not(.admin-page) .record-pane .record-card .task-details {
  grid-column: 2;
  min-width: 0;
}

body:not(.admin-page) .record-pane .record-card .task-head {
  grid-row: 1;
  order: initial;
  align-items: flex-start;
}

body:not(.admin-page) .record-pane .record-card .task-head strong {
  max-width: 100%;
  color: var(--fea-text);
  font-size: 0.82rem;
}

body:not(.admin-page) .record-pane .record-card .task-head small {
  margin-top: 2px;
  line-height: 1.2;
}

body:not(.admin-page) .record-pane .record-card .task-head .status {
  position: static;
}

body:not(.admin-page) .record-pane .record-card .task-id {
  display: flex;
  grid-row: 2;
  order: initial;
  margin-top: 0;
}

body:not(.admin-page) .record-pane .record-card .task-id code {
  color: var(--fea-muted);
  font-family: var(--jxt-font-mono);
  font-size: 0.72rem;
}

body:not(.admin-page) .record-pane .record-card .message {
  display: block;
  grid-row: 4;
  order: initial;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-page) .record-pane .record-card .task-actions {
  align-self: end;
  justify-self: end;
  grid-row: 3;
  order: initial;
  margin-top: 0;
}

body:not(.admin-page) .record-pane .record-card .task-details {
  display: flex;
  flex-wrap: nowrap;
  grid-row: 3;
  order: initial;
  gap: 4px;
  max-width: calc(100% - 128px);
  overflow: hidden;
  margin-top: 0;
}

body:not(.admin-page) .record-pane .record-card .task-detail-item {
  min-width: 0;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--fea-soft);
  color: var(--fea-muted);
  font-size: 0.625rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.admin-page) .record-pane .record-card .task-actions button[data-task-action="details"],
body:not(.admin-page) .record-pane .record-card .task-log-copy {
  display: none;
}

body:not(.admin-page) .queue-card__title {
  font-size: 0.9rem;
  line-height: 1.45;
}

body:not(.admin-page) .queue-card__download,
body:not(.admin-page) .queue-card__reference,
body:not(.admin-page) .queue-card__regenerate,
body:not(.admin-page) .queue-card__details-toggle {
  min-height: 32px;
  padding: 7px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1;
}

body:not(.admin-page) .queue-card__details-toggle {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

body:not(.admin-page) .queue-card__pill {
  min-height: 32px;
  padding: 7px 11px;
  font-size: 0.8rem;
}

body:not(.admin-page) .record-card {
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--jxt-radius-card-large);
  background: var(--jxt-color-surface-raised);
  border-color: var(--fea-border);
  box-shadow: var(--jxt-shadow-card);
}

body:not(.admin-page) .record-card__meta,
body:not(.admin-page) .record-card__summary {
  font-size: 0.88rem;
  line-height: 1.75;
}

body:not(.admin-page) .record-card__title {
  font-size: 0.94rem;
  line-height: 1.6;
}

body:not(.admin-page) .record-card__prompt-action {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(240, 251, 245, 0.96);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .record-card__prompt-action:hover,
body:not(.admin-page) .record-card__prompt-action:focus-visible {
  background: rgba(226, 247, 234, 0.96);
}

body:not(.admin-page) .chat-pane {
  grid-template-rows: auto;
}

body:not(.admin-page) .chat-thread {
  display: none;
}

body:not(.admin-page) .mobile-account-summary {
  margin-bottom: 6px;
}

body:not(.admin-page) .mobile-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

body:not(.admin-page) .mobile-account-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--fea-border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--fea-shadow-soft);
}

body:not(.admin-page) .mobile-account-panel--soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 247, 0.9));
}

body:not(.admin-page) .mobile-account-panel__head {
  display: grid;
  gap: 6px;
}

body:not(.admin-page) .mobile-account-panel__head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--fea-text);
}

body:not(.admin-page) .record-pane__head h1,
body:not(.admin-page) .mobile-account-pane__head h1 {
  font-size: clamp(2.2rem, 3.8vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
}

body:not(.admin-page) .mobile-account-panel__head p {
  margin: 0;
  color: var(--fea-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

body:not(.admin-page) .mobile-account-actions {
  gap: 12px;
}

body:not(.admin-page) .mobile-account-actions .ghost-button,
body:not(.admin-page) .mobile-account-actions .primary-link,
body:not(.admin-page) .mobile-account-actions .primary-button {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--fea-border);
  background: #ffffff;
  color: var(--fea-text);
  box-shadow: none;
  font-weight: 400;
  justify-content: center;
}

body:not(.admin-page) .mobile-account-actions .ghost-button:hover,
body:not(.admin-page) .mobile-account-actions .primary-link:hover,
body:not(.admin-page) .mobile-account-actions .primary-button:hover {
  background: #f8fafc;
  box-shadow: none;
}

body:not(.admin-page) .mobile-account-actions .ghost-button--danger {
  background: linear-gradient(180deg, #fffaf8 0%, #fff5f2 100%);
  color: #8f4a31;
  border-color: rgba(193, 76, 48, 0.12);
}

body:not(.admin-page) .mobile-account-pane__head .meta-pill {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--fea-soft);
  color: var(--fea-muted);
  font-size: 0.82rem;
  font-weight: 400;
}

body:not(.admin-page) .mobile-account-notes {
  display: grid;
  gap: 12px;
}

body:not(.admin-page) .mobile-account-note {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--fea-soft);
  border: 1px solid rgba(24, 160, 88, 0.08);
}

body:not(.admin-page) .mobile-account-note__title {
  color: var(--fea-text);
  font-size: 0.9rem;
  font-weight: 500;
}

body:not(.admin-page) .mobile-account-note p {
  margin: 0;
  color: var(--fea-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

@media (max-width: 1400px) {
  body:not(.admin-page) .queue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-card--row {
    grid-template-columns: 200px 72px 118px 76px 100px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (max-width: 1080px) {
  body:not(.admin-page) .workspace-layout {
    grid-template-columns: 1fr;
  }

  /* Full-width queue cards without a final image stay compact. A 3:4 empty
     slot here would exceed a short desktop viewport before progress or a
     retry message can be read. Final images retain their native 3:4 slot. */
  body:not(.admin-page) .queue-pane .task-placeholder {
    aspect-ratio: 16 / 9;
  }

  body:not(.admin-page) .chat-pane {
    position: static;
    top: auto;
  }

  body:not(.admin-page) .style-grid--modal {
    grid-template-columns: repeat(3, 136px);
    justify-content: space-between;
  }

  body:not(.admin-page) .queue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.admin-page) .mobile-account-grid {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page) .generation-cost-summary {
    text-align: left;
  }
}

@media (max-width: 760px) {
  body:not(.admin-page) .topbar {
    padding: 14px 16px 0;
  }

  body:not(.admin-page) .topbar__brand {
    padding: 10px 12px;
    border: 1px solid rgba(226, 232, 240, 0.96);
    border-radius: 12px;
    background: #ffffff;
  }

  body:not(.admin-page) .topbar__brand strong {
    font-size: 1rem;
  }

  body:not(.admin-page) .workspace-nav {
    display: none;
  }

  body:not(.admin-page) .app-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 16px 24px;
  }

  body:not(.admin-page) .workspace-stage > .workspace-panel.is-active {
    display: block;
  }

  body:not(.admin-page) .workspace-stage > .mobile-account-pane.workspace-panel.is-active {
    display: grid;
  }

  body:not(.admin-page) .chat-pane,
  body:not(.admin-page) .mobile-tab-panel--create.workspace-panel {
    min-height: calc(100vh - 190px);
    padding: 14px;
    border-radius: 16px;
  }

  body:not(.admin-page) .chat-thread {
    display: grid;
  }

  body:not(.admin-page) .composer-shell--create,
  body:not(.admin-page) .create-section,
  body:not(.admin-page) .prompt-surface {
    border-radius: 14px;
  }

  body:not(.admin-page) .style-grid--recent,
  body:not(.admin-page) .recent-ratio-grid,
  body:not(.admin-page) .style-grid--modal {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page) .prompt-surface {
    padding: 16px 16px 86px;
  }

  body:not(.admin-page) .prompt-surface__floating {
    align-items: stretch;
    flex-direction: column;
  }

  body:not(.admin-page) .prompt-surface .attachment-strip__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body:not(.admin-page) .prompt-surface .attachment-thumb__remove {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }

  body:not(.admin-page) .composer-footer--create {
    grid-template-columns: 1fr;
  }

  body:not(.admin-page) .mobile-bottom-nav {
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  }

  body:not(.admin-page) .mobile-bottom-nav__item {
    min-height: 48px;
    border-radius: 16px;
    color: #8a9290;
    font-weight: 500;
  }

  body:not(.admin-page) .mobile-bottom-nav__item.is-active {
    background: rgba(255, 255, 255, 0.92);
    color: var(--fea-text);
  }
}

body:not(.admin-page) {
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --surface-raised: #f6fbf8;
  --line: var(--fea-border);
  --line-strong: var(--fea-border-strong);
  --text: var(--fea-text);
  --muted: var(--fea-muted);
  --accent: var(--fea-green);
  --accent-dark: var(--fea-green-deep);
  --accent-soft: var(--fea-green-soft);
  --teal: var(--fea-green-strong);
  --danger-soft: rgba(190, 77, 55, 0.08);
  --shadow: var(--fea-shadow);
  --shadow-soft: var(--fea-shadow-soft);
  --shadow-lift: 0 18px 38px rgba(13, 111, 63, 0.12);
}

body:not(.admin-page) .ghost-button,
body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link,
body:not(.admin-page) .inline-button,
body:not(.admin-page) .attach-trigger,
body:not(.admin-page) select,
body:not(.admin-page) input[type="number"] {
  border-radius: 14px;
  border-color: var(--fea-border);
  background: rgba(255, 255, 255, 0.96);
  color: var(--fea-text);
  box-shadow: none;
}

body:not(.admin-page) .ghost-button,
body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link,
body:not(.admin-page) .inline-button,
body:not(.admin-page) .attach-trigger {
  font-weight: 600;
}

body:not(.admin-page) .ghost-button:hover,
body:not(.admin-page) .primary-button:hover,
body:not(.admin-page) .primary-link:hover:not(.disabled),
body:not(.admin-page) .inline-button:hover,
body:not(.admin-page) .attach-trigger:hover {
  border-color: var(--fea-border-strong);
}

body:not(.admin-page) .ghost-button:focus-visible,
body:not(.admin-page) .primary-button:focus-visible,
body:not(.admin-page) .primary-link:focus-visible,
body:not(.admin-page) .inline-button:focus-visible,
body:not(.admin-page) .attach-trigger:focus-visible,
body:not(.admin-page) select:focus-visible,
body:not(.admin-page) input:focus-visible {
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.14);
  border-color: rgba(24, 160, 88, 0.36);
}

body:not(.admin-page) .primary-button,
body:not(.admin-page) .primary-link {
  background: linear-gradient(135deg, var(--fea-green) 0%, var(--fea-green-strong) 100%);
  color: #f8fffb;
  box-shadow: 0 14px 28px rgba(24, 160, 88, 0.2);
}

body:not(.admin-page) .primary-button:hover,
body:not(.admin-page) .primary-link:hover:not(.disabled) {
  box-shadow: 0 18px 34px rgba(24, 160, 88, 0.24);
}

/* Disabled generation uses the same muted green treatment as Desktop. */
body:not(.admin-page) .jxt-composer-core__submit:disabled,
body:not(.admin-page) .primary-button:disabled {
  opacity: 0.55;
}

body:not(.admin-page) .ghost-button--danger {
  border-color: rgba(190, 77, 55, 0.18);
  background: rgba(255, 248, 246, 0.96);
  color: #8f3d2d;
}

body:not(.admin-page) .auth-user-badge {
  border-color: var(--fea-border);
  background: rgba(247, 252, 249, 0.96);
  color: var(--fea-text);
}

body:not(.admin-page) .auth-user-badge__dot {
  background: var(--fea-green);
  box-shadow: 0 0 0 6px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .credit-badge {
  border-color: rgba(24, 160, 88, 0.18);
  background: linear-gradient(180deg, #fbfffc 0%, #f1fbf5 100%);
}

body:not(.admin-page) .credit-badge__label,
body:not(.admin-page) .credit-badge__meta {
  color: var(--fea-muted);
}

body:not(.admin-page) .panel,
body:not(.admin-page) .queue-pane,
body:not(.admin-page) .record-pane,
body:not(.admin-page) .chat-pane,
body:not(.admin-page) .mobile-account-pane,
body:not(.admin-page) .mobile-account-card {
  border-color: rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .chat-bubble--user {
  background: linear-gradient(180deg, rgba(24, 160, 88, 0.12) 0%, rgba(24, 160, 88, 0.08) 100%);
  border-color: rgba(24, 160, 88, 0.18);
}

body:not(.admin-page) .user-prompt-copy-button {
  border-color: rgba(24, 160, 88, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .user-prompt-copy-button:focus-visible {
  outline-color: rgba(24, 160, 88, 0.38);
}

body:not(.admin-page) .chat-bubble--assistant {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .featured-shell {
  border-color: rgba(24, 160, 88, 0.12);
  background:
    radial-gradient(circle at 50% 12%, rgba(24, 160, 88, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(251, 255, 252, 0.96), rgba(240, 249, 243, 0.98));
}

body:not(.admin-page) .generation-overlay {
  background: linear-gradient(180deg, rgba(247, 253, 249, 0.82), rgba(235, 247, 239, 0.88));
}

body:not(.admin-page) .generation-orb {
  background: radial-gradient(circle, rgba(24, 160, 88, 0.22) 0%, rgba(24, 160, 88, 0.08) 54%, transparent 76%);
}

body:not(.admin-page) .result-variant {
  background: rgba(250, 255, 252, 0.96);
  box-shadow: 0 8px 18px rgba(13, 111, 63, 0.1);
}

body:not(.admin-page) .result-variant.is-active {
  border-color: var(--fea-green);
}

body:not(.admin-page) .details-toggle,
body:not(.admin-page) .queue-card__download,
body:not(.admin-page) .queue-card__details-toggle,
body:not(.admin-page) .queue-card__reference,
body:not(.admin-page) .featured-detail-copy,
body:not(.admin-page) .meta-pill,
body:not(.admin-page) .history-card__meta span {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(240, 251, 245, 0.96);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .queue-card__regenerate {
  border-color: rgba(211, 137, 55, 0.2);
  background: rgba(255, 247, 235, 0.96);
  color: #9a5a14;
}

body:not(.admin-page) .queue-card__regenerate:hover:not(:disabled) {
  background: rgba(255, 238, 210, 0.98);
}

body:not(.admin-page) .details-toggle:hover,
body:not(.admin-page) .queue-card__download:hover,
body:not(.admin-page) .queue-card__details-toggle:hover,
body:not(.admin-page) .queue-card__reference:hover:not(:disabled),
body:not(.admin-page) .featured-detail-copy:hover {
  background: rgba(226, 247, 234, 0.96);
}

body:not(.admin-page) .featured-details,
body:not(.admin-page) .conversation-actions {
  gap: 12px;
}

body:not(.admin-page) .info-card {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(236, 249, 240, 0.9);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .info-card--subtle,
body:not(.admin-page) .status,
body:not(.admin-page) .status--subtle,
body:not(.admin-page) .history-empty,
body:not(.admin-page) #queue-empty,
body:not(.admin-page) #history-empty {
  border-color: rgba(24, 160, 88, 0.1);
  background: rgba(247, 252, 249, 0.88);
  color: var(--fea-muted);
}

body:not(.admin-page) .queue-card,
body:not(.admin-page) .record-card {
  border-color: rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .queue-card.is-active,
body:not(.admin-page) .record-card.is-active,
body:not(.admin-page) .record-card:hover,
body:not(.admin-page) .queue-card:hover {
  border-color: rgba(24, 160, 88, 0.28);
  box-shadow: 0 16px 34px rgba(13, 111, 63, 0.12);
}

body:not(.admin-page) .queue-card__preview,
body:not(.admin-page) .queue-card__placeholder {
  background: linear-gradient(180deg, #f8fdf9 0%, #eef8f2 100%);
}

body:not(.admin-page) .queue-card__placeholder.queue-card__placeholder--progress {
  background:
    radial-gradient(circle at var(--glow-a-x, 18%) var(--glow-a-y, 18%), rgba(58, 210, 130, 0.52), transparent 30%),
    radial-gradient(circle at var(--glow-b-x, 82%) var(--glow-b-y, 74%), rgba(26, 175, 153, 0.44), transparent 34%),
    linear-gradient(135deg, #f6fff8 0%, #dff4e8 46%, #f7fcf8 100%);
  background-size: 190% 190%, 180% 180%, 100% 100%;
}

body:not(.admin-page) .queue-card__status,
body:not(.admin-page) .history-card__status,
body:not(.admin-page) .record-card__meta,
body:not(.admin-page) .record-card__summary,
body:not(.admin-page) .queue-card__pill {
  color: var(--fea-muted);
}

body:not(.admin-page) .queue-card__status--pending,
body:not(.admin-page) .history-card__status--pending {
  color: var(--fea-green-deep);
}

body:not(.admin-page) .queue-card__status--failed,
body:not(.admin-page) .history-card__status--failed {
  color: #9a4d3d;
}

body:not(.admin-page) .mobile-account-card {
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
  box-shadow: 0 10px 24px rgba(13, 111, 63, 0.08);
}

body:not(.admin-page) .mobile-account-card__label,
body:not(.admin-page) .mobile-account-card__meta {
  color: var(--fea-muted);
}

body:not(.admin-page) .mobile-account-card strong,
body:not(.admin-page) .queue-card__title,
body:not(.admin-page) .record-card__title,
body:not(.admin-page) .style-modal__title {
  color: var(--fea-text);
}

body:not(.admin-page) .mobile-bottom-nav {
  border: 1px solid rgba(24, 160, 88, 0.14);
  background: rgba(255, 255, 255, 0.98);
}

body:not(.admin-page) .mobile-bottom-nav__item:not(.is-active):hover {
  color: var(--fea-green-deep);
}

body:not(.admin-page) .mobile-bottom-nav__item.is-active {
  background: linear-gradient(180deg, rgba(236, 249, 240, 0.98) 0%, rgba(226, 247, 234, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(24, 160, 88, 0.12);
}

body:not(.admin-page) .create-section--styles {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 249, 0.98) 100%);
}

body:not(.admin-page) .create-section--styles .create-section__head {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(24, 160, 88, 0.08);
}

body:not(.admin-page) .style-grid--recent {
  padding: 2px 0 0;
}

body:not(.admin-page) .style-card {
  gap: 10px;
}

body:not(.admin-page) .style-card__preview {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(24, 160, 88, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 251, 247, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(13, 111, 63, 0.06);
}

body:not(.admin-page) .style-card__preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  pointer-events: none;
}

body:not(.admin-page) .style-card[aria-pressed="true"] .style-card__preview {
  border-color: rgba(24, 160, 88, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.92),
    0 0 0 3px rgba(24, 160, 88, 0.1),
    0 12px 22px rgba(24, 160, 88, 0.14);
}

body:not(.admin-page) .style-card__label {
  color: var(--fea-text);
  letter-spacing: -0.01em;
}

body:not(.admin-page) .style-card__check {
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  background: linear-gradient(180deg, var(--fea-green) 0%, var(--fea-green-deep) 100%);
  box-shadow: 0 8px 14px rgba(24, 160, 88, 0.2);
}

body:not(.admin-page) .style-card__zoom {
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body:not(.admin-page) .style-modal__shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 252, 248, 0.98) 100%);
}

body:not(.admin-page) .auth-modal__backdrop {
  background: rgba(15, 35, 28, 0.34);
  backdrop-filter: blur(10px);
}

body:not(.admin-page) .auth-modal__dialog {
  border: 1px solid rgba(24, 160, 88, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 251, 247, 0.98) 100%);
  box-shadow: 0 24px 60px rgba(13, 111, 63, 0.14);
}

body:not(.admin-page) .auth-modal__head {
  gap: 12px;
  padding-bottom: 4px;
}

body:not(.admin-page) .auth-modal__title-block h2,
body:not(.admin-page) .redeem-panel h2 {
  color: var(--fea-text);
}

body:not(.admin-page) .auth-account-note,
body:not(.admin-page) .redeem-tip {
  color: var(--fea-muted);
}

body:not(.admin-page) .auth-tabs {
  border-color: rgba(24, 160, 88, 0.12);
  background: rgba(236, 249, 240, 0.72);
}

body:not(.admin-page) .auth-tabs .ghost-button {
  color: var(--fea-muted);
}

body:not(.admin-page) .auth-tabs .ghost-button:hover {
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.58);
}

body:not(.admin-page) .auth-tabs .is-active {
  color: var(--fea-text);
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(13, 111, 63, 0.08);
}

body:not(.admin-page) .auth-tab-button {
  border: 1px solid rgba(24, 160, 88, 0.14);
  border-radius: 999px;
  background: rgba(243, 251, 247, 0.82);
  color: var(--fea-muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

body:not(.admin-page) .auth-tab-button:hover {
  border-color: rgba(24, 160, 88, 0.24);
  color: var(--fea-green-deep);
  background: rgba(255, 255, 255, 0.76);
}

body:not(.admin-page) .auth-tab-button.is-active {
  border-color: rgba(24, 160, 88, 0.12);
  color: var(--fea-text);
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(13, 111, 63, 0.08);
}

body:not(.admin-page) .auth-panel,
body:not(.admin-page) .auth-form {
  gap: 14px;
}

body:not(.admin-page) .auth-form--subtle {
  border-style: solid;
  border-color: rgba(24, 160, 88, 0.12);
  background: rgba(244, 251, 247, 0.9);
}

body:not(.admin-page) .redeem-panel .auth-form {
  padding: 2px 0 0;
}

body:not(.admin-page) .redeem-actions {
  gap: 12px;
}

body:not(.admin-page) .auth-field span {
  color: var(--fea-text);
  font-weight: 600;
}

body:not(.admin-page) .auth-field input {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: var(--fea-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body:not(.admin-page) .auth-field input::placeholder {
  color: rgba(107, 127, 118, 0.82);
}

body:not(.admin-page) .auth-field input:focus {
  border-color: rgba(24, 160, 88, 0.32);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.1);
}

body:not(.admin-page) .auth-switch {
  color: var(--fea-green-deep);
}

body:not(.admin-page) .auth-message {
  border-color: rgba(24, 160, 88, 0.14);
  background: rgba(236, 249, 240, 0.92);
  color: var(--fea-green-deep);
}

body:not(.admin-page) .auth-message[data-type="error"] {
  border-color: rgba(190, 77, 55, 0.16);
  background: rgba(255, 245, 242, 0.94);
  color: #99503f;
}

@media (max-width: 760px) {
  html,
  body:not(.admin-page) {
    max-width: 100%;
    overflow-x: hidden;
  }

  body:not(.admin-page) {
    padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px));
    background:
      linear-gradient(180deg, #f7fcf9 0%, #eef8f2 100%) !important;
    color: var(--fea-text);
  }

  body:not(.admin-page) .auth-modal {
    padding: 12px;
    align-items: center;
    justify-items: center;
  }

  body:not(.admin-page) .auth-modal__dialog {
    width: min(460px, calc(100% - 24px));
    max-width: calc(100% - 24px);
    padding: 20px 16px;
    gap: 14px;
  }

  body:not(.admin-page) .auth-panel,
  body:not(.admin-page) .auth-form,
  body:not(.admin-page) .auth-field,
  body:not(.admin-page) .auth-field input,
  body:not(.admin-page) .auth-form .primary-button {
    min-width: 0;
    max-width: 100%;
  }

  body:not(.admin-page) .auth-modal__dialog--account {
    column-gap: 12px;
  }

  body:not(.admin-page) .auth-account-note {
    overflow-wrap: anywhere;
  }

  body:not(.admin-page) .auth-tab-button {
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
  }

  body:not(.admin-page) .topbar {
    min-height: auto;
    padding: 12px 14px 0;
    border-bottom: 0;
  }

  body:not(.admin-page) .topbar__brand {
    width: 100%;
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  }

  body:not(.admin-page) .brand-mark {
    width: 30px;
  }

  body:not(.admin-page) .topbar__brand strong {
    font-size: 1.02rem;
    line-height: 1.2;
  }

  body:not(.admin-page) .topbar__actions {
    display: none;
  }

  body:not(.admin-page) .app-shell {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 14px 14px calc(132px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }

  body:not(.admin-page) .workspace-nav {
    display: none;
  }

  body:not(.admin-page) .workspace-stage,
  body:not(.admin-page) .workspace-layout,
  body:not(.admin-page) .mobile-tab-panel--create.workspace-panel,
  body:not(.admin-page) .chat-pane,
  body:not(.admin-page) .composer-bar,
  body:not(.admin-page) .composer-shell--create {
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body:not(.admin-page) .mobile-tab-panel {
    display: none;
    overflow-anchor: none;
  }

  body:not(.admin-page) .workspace-stage > .mobile-tab-panel:not(.is-active) {
    display: none !important;
  }

  body:not(.admin-page) .mobile-tab-panel.is-active {
    display: block;
    animation: mobile-panel-enter 180ms ease;
  }

  body:not(.admin-page) .chat-thread {
    display: block;
    padding: 0;
  }

  body:not(.admin-page) .empty-state {
    padding: 18px 4px 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body:not(.admin-page) .empty-state h2,
  body:not(.admin-page) .empty-copy {
    display: none;
  }

  body:not(.admin-page) .create-section {
    gap: var(--jxt-space-3);
    margin: 0;
    padding: var(--jxt-space-4);
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
  }

  body:not(.admin-page) .composer-shell--create {
    display: grid;
    gap: var(--jxt-space-6);
  }

  body:not(.admin-page) .create-section--styles {
    background: rgba(255, 255, 255, 0.86);
  }

  body:not(.admin-page) .create-section__head,
  body:not(.admin-page) .create-section--styles .create-section__head {
    padding: 0;
    border-bottom: 0;
  }

  body:not(.admin-page) .create-section__title-group {
    gap: 8px;
  }

  body:not(.admin-page) .create-section__index {
    min-width: auto;
    color: var(--fea-green-deep);
    font-size: 0.9rem;
  }

  body:not(.admin-page) .create-section__title {
    font-size: 0.98rem;
    font-weight: 650;
  }

  body:not(.admin-page) .section-link-button {
    min-height: 32px;
    padding: 0 4px;
    color: var(--fea-muted);
    font-size: 0.86rem;
  }

  body:not(.admin-page) .style-grid--recent {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  body:not(.admin-page) .style-grid--recent .style-card {
    gap: 5px;
  }

  body:not(.admin-page) .style-card__preview {
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(24, 160, 88, 0.1);
    border-radius: 12px;
    box-shadow: none;
  }

  body:not(.admin-page) .style-grid--recent .style-card[aria-pressed="true"] .style-card__preview {
    border-color: rgba(24, 160, 88, 0.5);
    box-shadow: 0 0 0 3px rgba(24, 160, 88, 0.1);
  }

  body:not(.admin-page) .style-card__label {
    font-size: 0.78rem;
    color: var(--fea-muted);
    letter-spacing: 0;
  }

  body:not(.admin-page) .style-card__check {
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    box-shadow: 0 8px 16px rgba(13, 111, 63, 0.18);
  }

  body:not(.admin-page) .style-card__zoom {
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.86);
    color: rgba(17, 24, 39, 0.92);
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow:
      0 10px 18px rgba(15, 23, 42, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body:not(.admin-page) .style-card__zoom svg {
    width: 10px;
    height: 10px;
  }

  body:not(.admin-page) .prompt-surface {
    min-height: 180px;
    padding: 14px 14px 74px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: none;
  }

  body:not(.admin-page) .prompt-surface textarea {
    min-height: 98px;
    font-size: 0.95rem;
  }

  body:not(.admin-page) .prompt-surface__floating {
    left: 14px;
    right: 108px;
    bottom: 12px;
    flex-direction: row;
    align-items: flex-end;
  }

  body:not(.admin-page) .attach-trigger--inline {
    min-width: 54px;
    height: 52px;
    border-radius: 12px;
    background: #f7fbf9;
  }

  body:not(.admin-page) #ratio.visually-hidden {
    position: static !important;
    grid-column: 1 / -1;
    width: 100% !important;
    height: 42px !important;
    min-height: 42px;
    padding: 0 34px 0 12px !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 12px !important;
    color: var(--fea-text);
    background:
      linear-gradient(45deg, transparent 50%, var(--fea-muted) 50%) calc(100% - 19px) calc(50% - 2px) / 6px 6px no-repeat,
      linear-gradient(135deg, var(--fea-muted) 50%, transparent 50%) calc(100% - 14px) calc(50% - 2px) / 6px 6px no-repeat,
      #ffffff;
    box-shadow: none;
    appearance: none;
  }

  body:not(.admin-page) .composer-footer--create,
  body:not(.admin-page) .composer-tools--create,
  body:not(.admin-page) .composer-actions--create {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body:not(.admin-page) .composer-tools--create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.admin-page) .select-control,
  body:not(.admin-page) .composer-tools--create select,
  body:not(.admin-page) .image-count-control {
    min-height: 42px;
    border-color: rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
  }

  body:not(.admin-page) .select-control--ratio #ratio.is-mobile-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
  }

  body:not(.admin-page) .ratio-mobile-trigger:not([hidden]) {
    display: block;
  }

  body:not(.admin-page) #submit-button {
    min-height: 48px;
    border-radius: 14px;
    box-shadow: 0 12px 22px rgba(13, 111, 63, 0.18);
  }

  body:not(.admin-page) #submit-button[aria-busy="true"] {
    opacity: 0.82;
    cursor: wait;
  }

  body:not(.admin-page) .generation-cost-summary {
    text-align: left;
  }

  body:not(.admin-page) [data-mobile-tab-panel="create"] .queue-pane {
    display: none !important;
  }

  body:not(.admin-page) .queue-pane,
  body:not(.admin-page) .record-pane,
  body:not(.admin-page) .mobile-account-pane,
  body:not(.admin-page) .mobile-account-panel,
  body:not(.admin-page) .mobile-account-card {
    border: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
  }

  body:not(.admin-page) .record-pane__head .eyebrow,
  body:not(.admin-page) .mobile-account-pane__head .eyebrow {
    display: none;
  }

  body:not(.admin-page) .mobile-account-pane__head {
    margin-bottom: 2px;
  }

  body:not(.admin-page) .mobile-account-summary {
    gap: 10px;
    margin-bottom: 10px;
  }

  body:not(.admin-page) .mobile-account-card,
  body:not(.admin-page) .mobile-account-panel {
    padding: 14px;
  }

  body:not(.admin-page) .mobile-account-panel__head p {
    display: none;
  }

  body:not(.admin-page) .mobile-account-card__meta {
    display: block;
  }

  body:not(.admin-page) .mobile-account-actions {
    gap: 10px;
  }

  body:not(.admin-page) .queue-pane {
    margin-top: 2px;
    padding: 14px;
  }

  body:not(.admin-page) .queue-pane__toolbar {
    padding: 0;
    border-bottom: 0;
  }

  body:not(.admin-page) .queue-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body:not(.admin-page) .queue-card,
  body:not(.admin-page) .record-card {
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: none;
  }

  body:not(.admin-page) .record-list {
    width: 100%;
    max-width: 100%;
    gap: 12px;
    overflow: hidden;
  }

  body:not(.admin-page) .record-card--header {
    display: none;
  }

  body:not(.admin-page) .record-card--row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px;
    overflow: hidden;
  }

  body:not(.admin-page) .record-card--row .record-card__cell {
    min-width: 0;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  body:not(.admin-page) .record-card--row .record-card__cell--id {
    max-width: 100%;
    font-size: 0.9rem;
  }

  body:not(.admin-page) .record-card--row .record-card__thumb {
    width: 90px;
    justify-self: start;
  }

  body:not(.admin-page) .record-card__content {
    min-height: 112px;
    align-content: start;
    gap: 6px;
  }

  body:not(.admin-page) .record-card--row .record-card__cell--prompt {
    padding-top: 0;
  }

  body:not(.admin-page) .record-card__prompt-text {
    -webkit-line-clamp: 2;
    font-size: 0.84rem;
    line-height: 1.5;
  }

  body:not(.admin-page) .record-card__prompt-line {
    gap: 6px;
  }

  body:not(.admin-page) .record-card__copy-button {
    min-height: 24px;
    min-width: 24px;
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0.72rem;
  }

  body:not(.admin-page) .record-card__copy-button svg {
    width: 13px;
    height: 13px;
  }

  body:not(.admin-page) .record-card__prompt-actions {
    display: none;
  }

  body:not(.admin-page) .record-card__meta-row {
    justify-content: flex-end;
    margin-top: auto;
    text-align: right;
    font-size: 0.76rem;
  }

  body:not(.admin-page) .record-card__actions {
    gap: 6px;
  }

  body:not(.admin-page) .record-card__action {
    min-height: 30px;
    padding: 7px 4px;
    border-radius: 9px;
    font-size: 0.7rem;
  }

  body:not(.admin-page) .style-modal {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
  }

  body:not(.admin-page) .style-modal__shell {
    max-height: min(82vh, 680px);
    padding: 16px;
    border: 0;
    border-radius: 22px 22px 0 0;
    background: #ffffff;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.14);
  }

  body:not(.admin-page) .style-modal__head {
    gap: 10px;
  }

  body:not(.admin-page) .style-modal__close {
    width: 32px;
    height: 32px;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  }

  body:not(.admin-page) .style-grid--modal {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px;
    padding: 0;
  }

  body:not(.admin-page) .style-grid--modal .style-card {
    gap: 5px;
  }

  body:not(.admin-page) .style-grid--modal .style-card__preview {
    aspect-ratio: 3 / 4;
  }

  body:not(.admin-page) .mobile-bottom-nav {
    left: 14px;
    right: 14px;
    width: auto;
    max-width: calc(100vw - 28px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body:not(.admin-page) .mobile-bottom-nav__item {
    min-width: 0;
    min-height: 50px;
    padding: 0 8px;
    border-radius: 14px;
    color: #8a9290;
    font-weight: 500;
  }

  body:not(.admin-page) .mobile-bottom-nav__item.is-active {
    color: var(--fea-green-deep);
    background: rgba(226, 247, 234, 0.9);
    box-shadow: none;
    transform: none;
  }

  body:not(.admin-page) #ratio.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .admin-user-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-user-pagination__controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .admin-user-pagination__controls .ghost-button {
    width: auto;
    flex: 0 0 auto;
  }
}

.admin-user-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--admin-blue);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.admin-user-avatar:focus-visible,
.admin-user-avatar:hover {
  border-color: var(--admin-blue);
  background: #dbeafe;
  outline: none;
}

.admin-user-history-thumb {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--admin-border-soft);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}

.admin-user-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-history-thumb:focus-visible,
.admin-user-history-thumb:hover {
  border-color: var(--admin-blue);
  outline: none;
}

.admin-user-history-prompt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.35;
}

.admin-page .admin-action-button-light,
.admin-page .admin-table .admin-actions .admin-action-button-light,
.admin-page .admin-table .admin-actions .ghost-button {
  font-family: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif !important;
  font-weight: 300 !important;
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased;
}

/* Final ordinary-workspace alignment (after legacy page rules). */
@media (min-width: 1200px) {
  body:not(.admin-page) .workspace-layout {
    grid-template-columns: minmax(560px, 58fr) minmax(420px, 42fr);
  }

  body:not(.admin-page) .workspace-nav {
    display: grid;
    grid-template-rows: auto 1fr;
    align-content: start;
    align-self: start;
    min-height: calc(100vh - 108px);
    gap: 8px;
  }

  body:not(.admin-page) .workspace-nav__items {
    display: grid;
    align-content: start;
    gap: 8px;
  }

  body:not(.admin-page) .workspace-nav__item {
    min-height: 68px;
  }

  body:not(.admin-page) .workspace-nav__version {
    align-self: end;
    justify-self: stretch;
    margin-top: 4px;
    padding: 10px 4px 2px;
    color: #8a9290;
    font-size: 11px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }
}

/* Keep the web shell on the same full-width canvas as the desktop client. */
body:not(.admin-page) .topbar,
body:not(.admin-page) .app-shell {
  max-width: none;
}

/* Desktop keeps its left rail on narrow desktop windows (for example
   980px) and only stacks the creator/queue panes inside the stage.  The
   generic legacy max-width:1120 rule collapses the whole shell and hides the
   rail; restore the Desktop shell for Web widths above the mobile breakpoint.
   The <=760px mobile rules below still take precedence for phones. */
@media (min-width: 761px) and (max-width: 1199px) {
  body:not(.admin-page) .app-shell {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    padding: 20px 24px 28px;
    /* Desktop keeps the top bar fixed while the tall creator/queue canvas
       scrolls inside the shell.  Without this bounded scroller, a narrow
       Web viewport scrolls the document itself and hides the top bar when a
       task card is centered by the baseline/real UI. */
    height: calc(100vh - 72px);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:not(.admin-page) .workspace-nav {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: calc(100vh - 108px);
    padding: 12px 10px;
  }

  body:not(.admin-page) .workspace-nav__items {
    display: grid;
    align-content: start;
    gap: 8px;
  }

  body:not(.admin-page) .workspace-nav__item {
    min-height: 68px;
  }

  body:not(.admin-page) .workspace-nav__version {
    align-self: end;
    justify-self: stretch;
    margin-top: 4px;
    padding: 10px 4px 2px;
    color: #8a9290;
    font-size: 11px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }

  body:not(.admin-page) .workspace-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: calc(100vh - 108px);
  }
}

@media (max-width: 760px) {
  body:not(.admin-page) .workspace-nav {
    display: none;
  }

  body:not(.admin-page) .workspace-stage {
    min-height: 0;
  }

  body:not(.admin-page) .chat-thread .empty-state {
    display: none;
  }

  body:not(.admin-page) .workspace-layout {
    grid-template-columns: 1fr;
  }
}

/* The desktop creator has one panel around the composer. The web form used
   to add a second tinted card inside it, which made the two clients read as
   different products. Keep the form shell structural and let the shared
   composer own the surface styling. */
body:not(.admin-page) .composer-shell--create {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* The shared account summary replaces the legacy split user/credit controls. */
body:not(.admin-page) .topbar__actions > #auth-user-badge,
body:not(.admin-page) .topbar__actions > #credit-badge,
body:not(.admin-page) .topbar__actions > #open-redeem-button,
body:not(.admin-page) .topbar__actions > #buy-credits-link,
body:not(.admin-page) .topbar__actions > #logout-button {
  display: none !important;
}

/* Match the desktop client: the signed-in account row is text-like, not a
   floating card. Development tools stay available on their dedicated route. */
body:not(.admin-page) .topbar .shared-web-account .account-summary {
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body:not(.admin-page) .topbar .shared-web-account .account-identity strong,
body:not(.admin-page) .topbar .shared-web-account .account-identity small {
  font-size: 13px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .shared-web-account .account-identity small {
  display: none;
}

body:not(.admin-page) .topbar .shared-web-account .credit-balance {
  min-height: 30px;
  padding: 3px 0;
  border: 0;
  background: transparent;
}

body:not(.admin-page) .topbar .shared-web-account .account-actions {
  padding-left: 8px;
  border-left: 1px solid var(--fea-border);
}

body:not(.admin-page) .topbar .shared-web-account .account-actions .account-logout-button {
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: #6f7975;
  font-size: 12px;
  font-weight: 400;
}

body:not(.admin-page) .topbar .dev-tools-entry {
  display: none !important;
}

/* Keep the Web workspace chrome aligned with the Desktop client at desktop
   widths. Desktop treats the queue as a quiet sticky working surface with a
   compact heading; the Web queue used to retain a marketing-style eyebrow,
   a redundant "new task" action, and a larger heading. */
@media (min-width: 1081px) {
  body:not(.admin-page) .queue-pane {
    position: sticky;
    top: 20px;
    min-height: calc(100vh - 108px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 14px;
    border-radius: 14px;
  }

  body:not(.admin-page) .chat-pane,
  body:not(.admin-page) .workspace-layout {
    min-height: calc(100vh - 120px);
  }
}

body:not(.admin-page) .queue-pane__toolbar {
  min-height: 34px;
  margin-bottom: 10px;
  padding: 0 2px;
  border-bottom: 0;
}

body:not(.admin-page) .queue-pane__toolbar .eyebrow {
  display: none;
}

body:not(.admin-page) .queue-pane__toolbar h2 {
  margin: 0;
  color: #20322e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

body:not(.admin-page) .queue-pane__new-task {
  display: none !important;
}

@media (min-width: 761px) and (max-height: 600px) {
  body:not(.admin-page) .workspace-nav {
    grid-template-rows: minmax(0, 1fr) auto;
    height: calc(100vh - 116px);
    min-height: 0;
    max-height: calc(100vh - 116px);
    overflow: hidden;
  }

  body:not(.admin-page) .workspace-nav__items {
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
  }

  body:not(.admin-page) .workspace-nav__item {
    min-height: 60px;
    padding: 6px 8px;
  }
}
