:root {
  --bg: #fff8fb;
  --bg-soft: #fff1f5;
  --rose: #e780a4;
  --rose-deep: #cb547e;
  --rose-ink: #82304e;
  --peach: #ffd5c9;
  --lavender: #f6ebff;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 251, 253, 0.92);
  --line: rgba(213, 112, 148, 0.18);
  --text: #402330;
  --muted: #8f6879;
  --shadow: 0 30px 80px rgba(219, 124, 160, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 208, 223, 0.7), transparent 24%),
    radial-gradient(circle at 85% 14%, rgba(255, 225, 210, 0.72), transparent 18%),
    radial-gradient(circle at 85% 78%, rgba(240, 217, 255, 0.65), transparent 20%),
    linear-gradient(180deg, #fffafd 0%, var(--bg-soft) 52%, #fff6f9 100%);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 34px 18px 40px;
  overflow: hidden;
}

.backdrop {
  position: absolute;
  pointer-events: none;
}

.blush-one,
.blush-two {
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.7;
}

.blush-one {
  top: 72px;
  left: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 194, 214, 0.85);
}

.blush-two {
  right: -30px;
  top: 140px;
  width: 220px;
  height: 220px;
  background: rgba(255, 221, 202, 0.68);
}

.pearl-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 78%);
  opacity: 0.25;
}

.app-card {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 252, 0.76)),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  align-items: stretch;
}

.eyebrow,
.section-kicker,
.panel-kicker,
.note-label {
  margin: 0 0 10px;
  color: var(--rose-deep);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.14;
  font-weight: 700;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.85;
  font-size: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-tags span,
.panel-badge,
.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(224, 120, 162, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--rose-ink);
  font-size: 13px;
  font-weight: 500;
}

.hero-note {
  position: relative;
  padding: 24px 22px;
  border: 1px solid rgba(228, 135, 172, 0.18);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 244, 248, 0.96), rgba(251, 241, 255, 0.85));
  overflow: hidden;
}

.note-glow {
  position: absolute;
  top: -24px;
  right: -8px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 214, 226, 0.85), transparent 68%);
}

.note-title {
  position: relative;
  margin: 0 0 14px;
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
}

.note-list {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.85;
}

.auth-shell,
.admin-section-grid,
.result-grid,
.recharge-grid {
  display: grid;
  gap: 20px;
}

.auth-shell {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 26px;
}

.auth-shell.single {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin: 26px auto 0;
}

.dashboard-shell {
  margin-top: 26px;
}

.auth-card,
.composer-card,
.panel,
.user-card,
.quota-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--card-strong), rgba(255, 249, 252, 0.74));
  box-shadow: 0 12px 36px rgba(230, 160, 189, 0.09);
}

.auth-card,
.panel,
.composer-card {
  padding: 24px;
}

.section-heading,
.panel-header,
.admin-header,
.user-bar,
.admin-item-head,
.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 28px;
}

.section-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stack-form,
.recharge-controls,
.admin-list,
.stack-field {
  display: grid;
  gap: 12px;
}

.generator-form {
  margin-top: 18px;
}

.input-label,
.stack-field span {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

input,
button,
.payment-link {
  font: inherit;
}

input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(222, 137, 168, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input::placeholder {
  color: #bc90a1;
}

input:focus {
  border-color: rgba(231, 128, 164, 0.65);
  box-shadow: 0 0 0 4px rgba(231, 128, 164, 0.13);
}

button,
.payment-link {
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff8fb;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  box-shadow: 0 18px 32px rgba(210, 97, 139, 0.26);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.payment-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--rose-ink);
  border: 1px solid rgba(224, 120, 162, 0.18);
  box-shadow: none;
}

.ghost-button.small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

.status-panel,
.mini-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.7;
  background: rgba(235, 148, 179, 0.12);
  color: var(--rose-ink);
}

.status-panel.error {
  background: rgba(212, 102, 131, 0.14);
  color: #9e3155;
}

.status-panel.success {
  background: rgba(117, 186, 146, 0.14);
  color: #2f7853;
}

.copy-output {
  margin: 16px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.9;
}

.image-placeholder,
.result-image {
  width: 100%;
  min-height: 330px;
  margin-top: 16px;
  border-radius: 24px;
}

.image-placeholder {
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed rgba(225, 132, 167, 0.28);
  background: linear-gradient(145deg, rgba(255, 243, 247, 0.96), rgba(250, 240, 255, 0.9));
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.result-image {
  display: block;
  border: 1px solid rgba(225, 132, 167, 0.18);
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(231, 150, 185, 0.18);
}

.hidden {
  display: none !important;
}

.user-bar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  display: grid;
  align-items: stretch;
  margin-top: 26px;
}

.user-card,
.quota-card {
  padding: 20px 22px;
}

.user-card strong {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
}

.quota-card {
  min-width: 180px;
  display: grid;
  place-items: center;
}

.quota-card span {
  font-size: 40px;
  font-weight: 700;
  color: var(--rose-deep);
}

.user-actions,
.recharge-actions,
.admin-inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.price-box {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(224, 120, 162, 0.16);
}

.price-box strong {
  display: block;
  font-size: 26px;
  margin-bottom: 6px;
}

.orders-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.orders-list.empty,
.admin-list.empty {
  color: var(--muted);
}

.order-item,
.admin-item {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(224, 120, 162, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.order-item p,
.admin-item p,
.admin-item small {
  margin: 6px 0 0;
  color: var(--muted);
}

.order-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.order-badge.paid {
  background: rgba(117, 186, 146, 0.14);
  color: #2f7853;
}

.order-badge.pending {
  background: rgba(235, 148, 179, 0.12);
  color: var(--rose-ink);
}

.payment-link.hidden {
  display: none !important;
}

.admin-card {
  max-width: 1200px;
}

.admin-toolbar,
.admin-header {
  margin-top: 22px;
}

.admin-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.admin-orders-panel {
  margin-top: 22px;
}

@media (max-width: 920px) {
  .hero,
  .auth-shell,
  .result-grid,
  .recharge-grid,
  .admin-section-grid,
  .input-row,
  .user-bar {
    grid-template-columns: 1fr;
  }

  .app-card {
    padding: 22px;
  }

  .section-heading,
  .panel-header,
  .admin-header,
  .admin-item-head,
  .admin-toolbar {
    flex-direction: column;
  }
}

.workspace-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Noto Sans SC", sans-serif;
  color: #183153;
  background:
    radial-gradient(circle at top left, rgba(128, 185, 255, 0.2), transparent 28%),
    radial-gradient(circle at 92% 16%, rgba(169, 207, 255, 0.32), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #f4f8ff 46%, #eef5ff 100%);
}

.workspace-page * {
  box-sizing: border-box;
}

.workspace-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.workspace-glow,
.workspace-grid {
  position: absolute;
  pointer-events: none;
}

.workspace-glow {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.42;
}

.glow-left {
  top: -80px;
  left: -100px;
  background: rgba(125, 181, 255, 0.35);
}

.glow-right {
  top: 140px;
  right: -110px;
  background: rgba(154, 210, 255, 0.4);
}

.workspace-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(133, 173, 225, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 173, 225, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 86%);
}

.workspace-topbar,
.workspace-app {
  position: relative;
  z-index: 1;
}

.workspace-app {
  z-index: auto;
}

.workspace-topbar {
  max-width: 1480px;
  margin: 0 auto 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(128, 171, 232, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 44px rgba(86, 127, 188, 0.06);
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2d6df7, #56a6ff);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(52, 111, 235, 0.2);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-size: 15px;
  color: #10274a;
}

.brand-copy span,
.topbar-links span {
  color: #6d84a6;
  font-size: 13px;
}

.workspace-app {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.welcome-banner,
.command-stage,
.board-card,
.auth-panel {
  border: 1px solid rgba(128, 171, 232, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 28px 70px rgba(86, 127, 188, 0.08);
  backdrop-filter: blur(18px);
}

.welcome-banner {
  padding: 32px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 248, 255, 0.92)),
    radial-gradient(circle at 90% 30%, rgba(146, 196, 255, 0.26), transparent 26%);
}

.banner-kicker,
.workspace-mini-title {
  margin: 0 0 10px;
  color: #3e7ef8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.welcome-banner h1,
.workspace-page h2,
.workspace-page h3 {
  margin: 0;
  color: #183153;
  font-family: "Noto Sans SC", sans-serif;
}

.welcome-banner h1 {
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.2;
  font-weight: 800;
  max-width: 860px;
}

.banner-subtitle,
.stage-note,
.tool-hints span,
.side-card small,
.generated-meta {
  color: #6680a4;
  line-height: 1.7;
}

.banner-subtitle {
  margin: 14px 0 0;
  font-size: 16px;
  max-width: 760px;
}

.banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.banner-tags span {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(132, 176, 236, 0.24);
  background: rgba(248, 251, 255, 0.96);
  color: #58759c;
  font-size: 13px;
  font-weight: 600;
}

.banner-side {
  display: grid;
  gap: 14px;
}

.side-card {
  min-height: 126px;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid rgba(147, 188, 243, 0.28);
  background: linear-gradient(180deg, rgba(245, 250, 255, 0.95), rgba(236, 244, 255, 0.82));
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-label {
  color: #7f96b3;
  font-size: 12px;
  font-weight: 700;
}

.side-card strong {
  font-size: 19px;
  color: #183153;
}

.workspace-auth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.workspace-account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(128, 171, 232, 0.24);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 255, 0.9));
  box-shadow: 0 18px 48px rgba(86, 127, 188, 0.06);
}

.auth-panel,
.command-stage,
.board-card {
  padding: 24px;
}

.workspace-section-title,
.command-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-section-title.compact {
  margin-bottom: 14px;
}

.workspace-page h2 {
  font-size: 30px;
  line-height: 1.25;
}

.workspace-page h3 {
  font-size: 22px;
  line-height: 1.3;
}

.auth-form,
.workspace-dashboard,
.prompt-panel,
.prompt-grid,
.info-list,
.results-board {
  display: grid;
  gap: 16px;
}

.workspace-page input,
.workspace-page textarea,
.workspace-page button {
  font: inherit;
}

.workspace-page input,
.workspace-page textarea {
  width: 100%;
  border: 1px solid rgba(131, 173, 228, 0.35);
  border-radius: 18px;
  background: #fff;
  color: #183153;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.workspace-page input {
  min-height: 56px;
  padding: 0 18px;
}

.workspace-page textarea {
  min-height: 146px;
  padding: 16px 18px;
  resize: vertical;
}

.workspace-page input:focus,
.workspace-page textarea:focus {
  border-color: rgba(62, 126, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(62, 126, 248, 0.12);
}

.workspace-page button {
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #2f72ff, #4d9cff);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(59, 122, 235, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.workspace-page button:hover {
  transform: translateY(-1px);
}

.workspace-page button:disabled {
  opacity: 0.68;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  background: rgba(243, 248, 255, 0.95) !important;
  color: #2e65c8 !important;
  border: 1px solid rgba(132, 176, 236, 0.28) !important;
  box-shadow: none !important;
}

.secondary-button.small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 13px;
}

.command-stage {
  gap: 18px;
  display: grid;
  position: relative;
  overflow: hidden;
}

.command-stage-head {
  align-items: center;
}

.command-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 24px;
  background: linear-gradient(180deg, #3b7cff, #85b6ff);
}

.image-stage::before {
  background: linear-gradient(180deg, #4f9cff, #8fd2ff);
}

.account-pills,
.account-actions,
.tool-hints,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-actions {
  justify-content: flex-end;
}

.panel-heading.compact {
  margin-top: 18px;
}

.pill,
.tool-hints span {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(135, 179, 237, 0.28);
  background: rgba(247, 251, 255, 0.95);
  color: #59779d;
  font-size: 13px;
}

.pill strong {
  color: #1a3d71;
}

.command-bar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(132, 176, 236, 0.28);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.command-icon {
  min-height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(221, 236, 255, 0.95), rgba(241, 247, 255, 0.92));
  color: #3f78db;
  font-size: 18px;
  font-weight: 800;
}

.prompt-panel {
  padding: 18px;
  border: 1px solid rgba(132, 176, 236, 0.28);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(244, 249, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.reference-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px dashed rgba(93, 146, 224, 0.42);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: #59779d;
}

.reference-upload span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.reference-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reference-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reference-upload label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.reference-image-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}

.reference-image-item {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(132, 176, 236, 0.24);
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.92);
}

.reference-image-item img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  background: #eef5ff;
}

.reference-image-item figcaption {
  margin-top: 6px;
  overflow: hidden;
  color: #59779d;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  min-width: 28px;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(22, 38, 66, 0.72) !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 18px;
  line-height: 1;
}

.status-panel {
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(130, 176, 234, 0.2);
  background: rgba(232, 242, 255, 0.82);
  color: #2f68c8;
  line-height: 1.7;
}

.status-panel.error {
  background: rgba(255, 238, 240, 0.9);
  color: #c64867;
}

.status-panel.success {
  background: rgba(234, 248, 240, 0.9);
  color: #218058;
}

.status-panel.info {
  background: rgba(232, 242, 255, 0.9);
  color: #2f68c8;
}

.results-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-card {
  min-width: 0;
}

.video-results-board .copy-card {
  min-width: 0;
}

.video-results-board {
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
}

.image-results-board {
  grid-template-columns: minmax(0, 1fr);
}

.image-results-board .media-card {
  max-width: 760px;
  justify-self: center;
  width: 100%;
}

.copy-output {
  margin: 0;
  padding: 18px;
  min-height: 420px;
  max-height: 600px;
  overflow: auto;
  border: 1px solid rgba(132, 176, 236, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.94), rgba(245, 249, 255, 0.92));
  color: #25415f;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.media-placeholder,
.media-image {
  width: 100%;
  min-height: 420px;
  border-radius: 20px;
}

.media-placeholder {
  display: grid;
  place-items: center;
  padding: 22px;
  border: 1px dashed rgba(132, 176, 236, 0.42);
  background:
    radial-gradient(circle at top right, rgba(180, 216, 255, 0.2), transparent 24%),
    linear-gradient(145deg, rgba(247, 251, 255, 0.98), rgba(238, 245, 255, 0.96));
  color: #6a84a6;
  text-align: center;
  line-height: 1.7;
}

.media-image {
  display: block;
  object-fit: cover;
  border: 1px solid rgba(132, 176, 236, 0.22);
  box-shadow: 0 20px 50px rgba(79, 128, 195, 0.12);
}

.generated-meta {
  margin: 14px 0 0;
  font-size: 13px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(245, 249, 255, 0.9);
  border: 1px solid rgba(132, 176, 236, 0.2);
}

@media (max-width: 1280px) {
  .video-results-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .workspace-shell {
    padding: 18px;
  }

  .workspace-topbar,
  .welcome-banner,
  .workspace-auth,
  .workspace-account-strip,
  .command-stage-head,
  .command-bar,
  .reference-upload,
  .prompt-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .welcome-banner,
  .workspace-auth,
  .results-board {
    grid-template-columns: 1fr;
  }

  .command-bar {
    grid-template-columns: 1fr;
  }

  .command-icon {
    min-height: 48px;
  }
}

/* Starflow-style creator workspace */
.workspace-page {
  --surface: #ffffff;
  --surface-muted: #f6f6f4;
  --surface-soft: #fafaf8;
  --ink: #1f2328;
  --ink-muted: #6f7378;
  --ink-soft: #9a9da2;
  --border: #dededb;
  --border-strong: #c9c9c5;
  --accent: #ff5c58;
  --accent-soft: #ffe3e1;
  --shadow-soft: 0 18px 45px rgba(31, 35, 40, 0.08);
  background: #fff;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", sans-serif;
}

.workspace-page *,
.workspace-page *::before,
.workspace-page *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

.workspace-shell {
  min-height: 100vh;
  padding: 18px 32px 56px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 248, 0.98) 58%, #fff 100%),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(31, 35, 40, 0.025) 38px 39px);
}

.workspace-topbar {
  max-width: none;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.workspace-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
}

.topbar-account,
.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.account-chip strong {
  color: var(--ink);
}

.workspace-app {
  max-width: 1480px;
  margin: 0 auto;
  gap: 28px;
}

.workspace-auth {
  max-width: 460px;
  margin: 0;
  align-items: center;
  grid-template-columns: 1fr;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 19, 20, 0.28);
  backdrop-filter: blur(10px);
}

.auth-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 32px 90px rgba(31, 35, 40, 0.22);
}

.auth-switch-button,
.workspace-page .auth-switch-button {
  width: 100%;
  margin-top: 12px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  background: #f4f4f1 !important;
  color: var(--ink) !important;
  font-size: 22px;
}

.auth-modal-open {
  overflow: hidden;
}

.auth-intro {
  display: grid;
  gap: 16px;
}

.auth-intro h1 {
  margin: 0;
  max-width: 620px;
  color: var(--ink);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
}

.auth-intro p {
  margin: 0;
  max-width: 560px;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.8;
}

.eyebrow,
.workspace-mini-title {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.workspace-section-title,
.panel-heading,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-page h1,
.workspace-page h2,
.workspace-page h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans SC", "Plus Jakarta Sans", sans-serif;
}

.workspace-page h2 {
  font-size: 24px;
  line-height: 1.25;
}

.workspace-page h3 {
  font-size: 17px;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.workspace-page input,
.workspace-page textarea,
.workspace-page button {
  font: inherit;
}

.workspace-page input,
.workspace-page textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.workspace-page input {
  min-height: 52px;
  padding: 0 16px;
}

.workspace-page input::placeholder,
.workspace-page textarea::placeholder {
  color: #a2a5aa;
}

.workspace-page input:focus,
.workspace-page textarea:focus {
  border-color: #9e9e98;
  box-shadow: 0 0 0 4px rgba(31, 35, 40, 0.07);
}

.workspace-page button,
.subtle-link {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.workspace-page button {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}

.workspace-page button:hover,
.subtle-link:hover {
  transform: translateY(-1px);
}

.workspace-page button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.subtle-button,
.workspace-page .subtle-button,
.subtle-link {
  border: 1px solid var(--border) !important;
  background: var(--surface-muted) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.dark-button,
.workspace-page .dark-button {
  background: var(--ink) !important;
  color: #fff !important;
}

.small {
  min-height: 36px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}

.workspace-dashboard {
  display: grid;
  gap: 34px;
  padding-top: 120px;
}

.hero-composer {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.hero-composer > * {
  animation: rise-in 560ms cubic-bezier(0.2, 0.78, 0.2, 1) both;
}

.hero-composer > *:nth-child(2) {
  animation-delay: 900ms;
}

.hero-composer > *:nth-child(3) {
  animation-delay: 1040ms;
}

.hero-composer > *:nth-child(4) {
  animation-delay: 1180ms;
}

.hero-composer > .quick-prompts {
  animation-delay: 1180ms;
}

.release-pill {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.release-pill span {
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.release-pill small {
  color: var(--ink-muted);
}

.studio-title-block {
  width: min(100%, 980px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.studio-logo {
  font-size: 54px;
  line-height: 1;
}

.studio-title-block h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
}

.studio-title-block p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.typewriter {
  position: relative;
  display: inline-block;
  max-width: max-content;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

.typewriter::after {
  content: "";
  position: absolute;
  top: 0.18em;
  right: 0;
  width: 2px;
  height: 0.82em;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
}

.typewriter-title {
  width: 0;
  animation: type-title 820ms steps(7, end) 120ms forwards;
}

.typewriter-title::after {
  animation:
    caret-blink 720ms step-end 120ms 2,
    caret-hide 1ms linear 960ms forwards;
}

.typewriter-subtitle {
  width: 0;
  animation: type-subtitle 1200ms steps(12, end) 960ms forwards;
}

.typewriter-subtitle::after {
  top: 0.28em;
  height: 0.92em;
  animation:
    caret-blink 720ms step-end 960ms 4,
    caret-hide 1ms linear 4200ms forwards;
}

.mode-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  gap: 4px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.mode-switch:hover {
  transform: translateY(-1px);
}

.mode-button,
.workspace-page .mode-button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  box-shadow: none;
}

.mode-button.active,
.workspace-page .mode-button.active {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.main-command-form {
  width: min(100%, 960px);
  min-height: 146px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 40px rgba(31, 35, 40, 0.08);
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  text-align: left;
}

.main-command-form textarea {
  min-height: 76px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.65;
  box-shadow: none;
  transition: height 160ms ease;
}

.main-command-form textarea:focus {
  box-shadow: none;
}

.main-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.workspace-page .icon-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-muted);
  font-size: 18px;
}

.send-button,
.workspace-page .send-button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
}

.quick-prompts {
  width: min(100%, 960px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.quick-prompts button,
.gallery-tabs button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-muted);
  box-shadow: none;
  font-size: 14px;
}

.quick-prompts button:hover,
.gallery-tabs button:hover,
.gallery-tabs button.active {
  background: var(--surface-muted);
  color: var(--ink);
}

.reference-upload {
  width: min(100%, 860px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--ink-muted);
  text-align: left;
}

.reference-upload span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.reference-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.reference-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reference-upload label {
  cursor: pointer;
}

.reference-image-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.reference-image-item {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.reference-image-item img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-muted);
}

.reference-image-item figcaption {
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-image-remove,
.workspace-page .reference-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  min-width: 28px;
  min-height: 28px !important;
  padding: 0 !important;
  border-radius: 50%;
  background: rgba(31, 35, 40, 0.78);
  color: #fff;
  font-size: 18px;
}

.status-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  margin: 0;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  line-height: 1.6;
}

.status-panel.error {
  border-color: #ffd1d1;
  background: #fff3f3;
  color: #b42318;
}

.status-panel.success {
  border-color: #cce9d8;
  background: #f0fbf4;
  color: #216e3a;
}

.workspace-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 18px;
}

.workspace-results.single-result {
  grid-template-columns: minmax(0, 1100px);
  justify-content: center;
}

.workspace-results.single-result .result-panel {
  width: 100%;
}

.result-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 36px rgba(31, 35, 40, 0.055);
}

.copy-output {
  min-height: 280px;
  max-height: 520px;
  margin: 16px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  color: #34383d;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.85;
  font-size: 15px;
}

.copy-output.is-loading {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--ink-muted);
  text-align: center;
}

.copy-output.is-loading::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid rgba(23, 25, 28, 0.12);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: panel-spin 850ms linear infinite;
}

.optimized-copy-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.optimized-output {
  min-height: 220px;
}

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

.media-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.media-placeholder,
.media-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 240px;
  border-radius: 14px;
}

.media-placeholder {
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.7;
}

.media-image {
  display: block;
  object-fit: contain;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.generated-meta {
  margin: 12px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
}

.inspiration-section {
  display: grid;
  gap: 18px;
}

.section-head {
  align-items: flex-end;
}

.source-link {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
}

.gallery-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.prompt-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.gallery-column {
  min-width: 0;
  display: grid;
  gap: 18px;
  align-content: start;
}

.gallery-card {
  min-width: 0;
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.gallery-card:hover,
.gallery-card:focus {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: var(--surface-muted);
}

.gallery-card-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--ink-muted);
  font-weight: 800;
}

.gallery-card-copy {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.gallery-card-copy span,
.detail-category {
  width: fit-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.gallery-card-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

.gallery-detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gallery-detail-open {
  overflow: hidden;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 35, 40, 0.48);
}

.detail-panel {
  position: relative;
  width: min(1500px, calc(100vw - 48px));
  height: min(860px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(360px, 0.92fr);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
}

.detail-close,
.workspace-page .detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.detail-panel > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: var(--surface-muted);
}

.detail-copy {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  overflow: hidden;
}

.detail-copy p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.75;
}

.detail-copy pre {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: #30343a;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
  font-family: inherit;
  font-size: 14px;
}

.detail-license {
  font-size: 13px;
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 28%);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .prompt-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-results {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .workspace-shell {
    padding: 16px 16px 44px;
  }

  .workspace-auth {
    min-height: auto;
    margin-top: 0;
    grid-template-columns: 1fr;
  }

  .auth-modal {
    align-items: start;
    padding: 18px;
    overflow: auto;
  }

  .auth-dialog {
    padding: 18px;
  }

  .workspace-dashboard {
    padding-top: 64px;
  }

  .topbar-account {
    width: 100%;
    justify-content: flex-start;
  }

  .workspace-topbar,
  .section-head,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-topbar {
    align-items: center;
    flex-direction: row;
  }

  #open-auth-button {
    width: auto;
    min-width: 72px;
  }

  .studio-title-block {
    flex-direction: column;
    gap: 8px;
  }

  .release-pill {
    flex-wrap: wrap;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
  }

  .main-command-form {
    min-height: 132px;
  }

  .main-command-form textarea {
    font-size: 16px;
  }

  .reference-upload {
    grid-template-columns: 1fr;
  }

  .reference-upload-actions,
  .main-command-actions {
    justify-content: flex-start;
  }

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

  .detail-panel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 34dvh) minmax(0, 1fr);
    overflow: hidden;
  }

  .detail-panel > img {
    height: 100%;
    min-height: 0;
  }

  .detail-copy {
    gap: 10px;
    padding: 18px;
  }
}

@media (max-width: 560px) {
  .workspace-shell {
    padding-inline: 12px;
  }

  .brand-name {
    font-size: 18px;
  }

  .auth-panel,
  .result-panel,
  .detail-copy {
    padding: 18px;
  }

  .studio-title-block h1 {
    font-size: 38px;
  }

  .studio-title-block p {
    font-size: 15px;
  }

  .mode-switch,
  .quick-prompts,
  .gallery-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .prompt-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-detail {
    padding: 12px;
  }
}

/* UI/UX Pro Max polish pass */
.workspace-page {
  --surface-muted: #f3f3ef;
  --surface-soft: #fbfbf8;
  --ink: #17191c;
  --ink-muted: #62666d;
  --ink-soft: #8b9097;
  --border: #ddddd7;
  --border-strong: #bdbdb4;
  --accent: #ff5a50;
  --accent-soft: #ffe5e2;
  --focus-ring: rgba(23, 25, 28, 0.16);
  background: #fff;
}

.workspace-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 247, 0.98) 68%, #fff 100%);
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 52px;
  padding: 8px 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand-mark,
.studio-logo {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, 8px);
  grid-template-rows: repeat(3, 8px);
  gap: 2px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.studio-logo {
  width: 58px;
  height: 58px;
  display: inline-block;
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 28%, #fff8d8 0 7px, transparent 8px),
    linear-gradient(135deg, #ff4f67 0%, #ff7d52 100%);
  box-shadow: 0 18px 34px rgba(255, 91, 91, 0.24);
  overflow: hidden;
}

.brand-mark span,
.studio-logo span {
  display: block;
  background: var(--ink);
  transform: rotate(45deg);
}

.brand-mark span:nth-child(1),
.studio-logo span:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.brand-mark span:nth-child(2),
.studio-logo span:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.brand-mark span:nth-child(3),
.studio-logo span:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.brand-mark span:nth-child(4),
.studio-logo span:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.brand-mark span:nth-child(5),
.studio-logo span:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

.studio-logo::before,
.studio-logo::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 24px;
  border-radius: 9px 9px 7px 7px;
  background: rgba(255, 255, 255, 0.95);
}

.studio-logo::after {
  left: 20px;
  right: 10px;
  bottom: 12px;
  height: 19px;
  border-radius: 8px 8px 7px 7px;
  background: linear-gradient(135deg, transparent 0 38%, rgba(255, 255, 255, 0.95) 39%);
  transform: skewX(-14deg);
}

.studio-logo span {
  display: none;
}

.brand-name {
  font-weight: 800;
}

.account-chip,
.subtle-button,
.subtle-link,
.quick-prompts button,
.gallery-tabs button {
  border-color: transparent !important;
  background: #f4f4f1 !important;
}

.workspace-page button,
.subtle-link,
.gallery-card {
  touch-action: manipulation;
}

.workspace-page button:focus-visible,
.workspace-page input:focus-visible,
.workspace-page textarea:focus-visible,
.subtle-link:focus-visible,
.gallery-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.release-pill {
  box-shadow: inset 0 0 0 1px rgba(255, 90, 80, 0.08);
}

.studio-title-block {
  gap: 18px;
}

.studio-title-block h1 {
  font-weight: 800;
  text-wrap: balance;
}

.studio-title-block p,
.auth-intro p {
  color: #767a82;
}

.mode-switch {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(23, 25, 28, 0.06);
}

.main-command-form {
  border-color: rgba(23, 25, 28, 0.16);
  box-shadow:
    0 24px 70px rgba(23, 25, 28, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: transform 220ms ease, border-color 180ms ease, box-shadow 220ms ease;
}

.main-command-form:focus-within {
  border-color: rgba(23, 25, 28, 0.34);
  box-shadow:
    0 28px 80px rgba(23, 25, 28, 0.12),
    0 0 0 4px rgba(23, 25, 28, 0.06);
  transform: translateY(-2px);
}

.icon-button,
.workspace-page .icon-button,
.send-button,
.workspace-page .send-button {
  position: relative;
}

.icon-button::before,
.icon-button::after,
.send-button::before,
.send-button::after,
.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.clear-icon::before {
  width: 16px;
  height: 10px;
  border: 2px solid currentColor;
  border-left-width: 0;
  border-radius: 2px 4px 4px 2px;
  transform: translateX(2px);
}

.clear-icon::after {
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-7px) rotate(45deg);
}

.plus-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.plus-icon::before,
.plus-icon::after {
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.copy-icon::before,
.copy-icon::after {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.copy-icon::before {
  transform: translate(2px, -2px);
}

.copy-icon::after {
  transform: translate(-3px, 3px);
  background: #fff;
}

.send-button::before {
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(-50%, -32%) rotate(-45deg);
}

.send-button::after {
  left: 50%;
  top: 50%;
  width: 2px;
  height: 17px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -28%);
}

.send-button.is-loading::before {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 800ms linear infinite;
}

.send-button.is-loading::after {
  display: none;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes type-title {
  from {
    width: 0;
  }
  to {
    width: 7em;
  }
}

@keyframes type-subtitle {
  from {
    width: 0;
  }
  to {
    width: 12em;
  }
}

@keyframes caret-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes caret-hide {
  to {
    opacity: 0;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes gallery-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-panel {
  top: 18px;
  right: auto;
  bottom: auto;
  left: 50%;
  z-index: 9999;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
}

.status-panel.is-visible {
  animation: toast-in 180ms ease-out both;
}

.inspiration-section {
  opacity: 0;
  animation: rise-in 680ms cubic-bezier(0.2, 0.78, 0.2, 1) 1500ms both;
}

.gallery-card {
  opacity: 1;
}

.gallery-load-sentinel,
.workspace-page .gallery-load-sentinel {
  width: fit-content;
  min-width: 176px;
  min-height: 46px;
  margin: 2px auto 0;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f4f4f1;
  color: var(--ink);
  box-shadow: none;
  opacity: 0.78;
}

.gallery-load-sentinel:hover {
  background: #ecece8;
}

.gallery-load-sentinel.is-loading {
  cursor: wait;
  opacity: 1;
}

.gallery-load-sentinel.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(23, 25, 28, 0.18);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: sentinel-spin 800ms linear infinite;
}

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

.quick-prompts button,
.gallery-tabs button {
  min-height: 42px;
}

.quick-prompts button,
.gallery-tabs button,
.mode-button,
.icon-button,
.send-button {
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.quick-prompts button:hover,
.gallery-tabs button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(23, 25, 28, 0.08);
}

.send-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 16px 34px rgba(23, 25, 28, 0.18);
}

.quick-prompts button:active,
.gallery-tabs button:active,
.icon-button:active,
.send-button:active,
.gallery-card:active {
  transform: scale(0.98);
}

.workspace-results {
  align-items: start;
}

.result-panel,
.auth-panel {
  box-shadow: 0 10px 34px rgba(23, 25, 28, 0.055);
}

.copy-output,
.media-placeholder,
.detail-copy pre {
  background: #f8f8f5;
}

.prompt-gallery {
  gap: 18px;
}

.gallery-card {
  border-color: rgba(23, 25, 28, 0.08);
  box-shadow: 0 1px 0 rgba(23, 25, 28, 0.04);
}

.gallery-card img {
  aspect-ratio: auto;
}

.gallery-card-copy {
  min-height: auto;
}

.gallery-card-copy h3 {
  font-size: 18px;
}

.gallery-card-copy p {
  color: #6e7279;
}

.detail-panel {
  border-radius: 16px;
}

.detail-panel > img {
  aspect-ratio: auto;
}

.detail-actions button,
.detail-actions .subtle-link {
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 920px) {
  .workspace-topbar {
    position: relative;
  }

  .main-command-actions {
    justify-content: flex-end;
  }

  .gallery-card-copy {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .workspace-shell {
    padding-top: 12px;
  }

  .workspace-dashboard {
    padding-top: 40px;
  }

  .release-pill {
    width: 100%;
    justify-content: center;
  }

  .main-command-form {
    padding: 14px;
  }

  .main-command-actions {
    gap: 8px;
  }

  .icon-button,
  .workspace-page .icon-button,
  .send-button,
  .workspace-page .send-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .mode-switch {
    width: min(100%, calc(100vw - 32px));
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.82fr) minmax(0, 1.22fr);
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .mode-switch::-webkit-scrollbar {
    display: none;
  }

  .mode-button,
  .workspace-page .mode-button {
    min-width: 0;
    white-space: nowrap;
    word-break: keep-all;
    padding-inline: 10px;
    font-size: 14px;
  }

  .gallery-tabs {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    scrollbar-width: none;
  }

  .gallery-tabs::-webkit-scrollbar {
    display: none;
  }

  .gallery-tabs button,
  .workspace-page .gallery-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
    word-break: keep-all;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
}
