/* ============================================================
   Quro — luminous obsidian studio for GPT Image 2
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #060608;
  --bg-soft: #0c0c11;
  --ink: #f4f3f7;
  --muted: #9a9aa9;
  --faint: #6c6c7a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* luminous accents */
  --c1: #ff5e8a;   /* magenta-rose  */
  --c2: #7b5bff;   /* violet        */
  --c3: #2bd9d0;   /* teal          */
  --c4: #ffb347;   /* warm amber    */

  --glass: rgba(18, 18, 24, 0.62);
  --glass-strong: rgba(20, 20, 28, 0.82);

  --radius: 22px;
  --radius-lg: 30px;

  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;

  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 30px 90px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.display { font-family: var(--font-display); font-weight: 500; }
.muted { color: var(--muted); }
small { color: var(--faint); font-size: 12.5px; }

a { color: inherit; }

::selection { background: rgba(123, 91, 255, 0.45); color: #fff; }

/* ---------- Luminous backdrop ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(123, 91, 255, 0.12), transparent 60%),
    var(--bg);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}
.blob-a {
  width: 48vw; height: 48vw;
  top: -12vw; left: -8vw;
  background: radial-gradient(circle, var(--c1), transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}
.blob-b {
  width: 52vw; height: 52vw;
  top: -6vw; right: -14vw;
  background: radial-gradient(circle, var(--c2), transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}
.blob-c {
  width: 40vw; height: 40vw;
  bottom: -14vw; left: 30vw;
  background: radial-gradient(circle, var(--c3), transparent 70%);
  opacity: 0.4;
  animation: drift-c 30s ease-in-out infinite;
}
@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, 6vw) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-7vw, 9vw) scale(1.08); }
}
@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5vw, -8vw) scale(1.15); }
}
.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
}

/* ---------- Layout shell ---------- */
main {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 150px;
}

.spark {
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  color: var(--c4);
  filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.7));
  animation: twinkle 3.2s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.55; transform: scale(0.82) rotate(45deg); }
}

/* ---------- Login ---------- */
.login-screen {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
}
.login-card {
  width: min(440px, 100%);
  text-align: center;
  padding: 48px 40px 38px;
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  position: relative;
  overflow: hidden;
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 94, 138, 0.14), transparent 40%, rgba(43, 217, 208, 0.12));
  pointer-events: none;
}
.login-card .spark { font-size: 22px; margin-bottom: 14px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  font-weight: 600;
  color: var(--c2);
}
.login-card .display {
  font-size: clamp(52px, 9vw, 72px);
  line-height: 0.95;
  margin: 10px 0 16px;
  background: linear-gradient(110deg, var(--c1), var(--c4) 45%, var(--c3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { color: var(--muted); font-size: 15px; }
.login-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 14px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #08080b;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
  box-shadow: 0 10px 30px rgba(244, 243, 247, 0.18);
}
.login-button:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(244, 243, 247, 0.28); }
.login-button:active { transform: translateY(0); }
.login-card small { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand .spark { font-size: 15px; }
.brand .display {
  font-size: 19px;
  line-height: 1;
  background: linear-gradient(110deg, var(--c1), var(--c4) 50%, var(--c3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .muted { font-size: 11px; margin-top: 1px; }

.auth-card {
  position: fixed;
  top: 21px;
  right: max(20px, calc((100vw - 1240px) / 2));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 11px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  color: var(--muted);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.auth-card .who { display: flex; align-items: center; gap: 7px; max-width: 170px; }
.auth-card .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card img { width: 22px; height: 22px; border-radius: 999px; }
.auth-card .logout {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 11.5px;
  transition: background 0.2s, border-color 0.2s;
}
.auth-card .logout:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line-strong); }

/* ---------- Status ---------- */
.status {
  min-height: 22px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13.5px;
}
.status:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.status.working::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c3);
  box-shadow: 0 0 12px var(--c3);
  animation: pulse 1.1s ease-in-out infinite;
}
.status.error { color: #ffb1c0; }
.status.error::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 12px var(--c1);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ---------- Gallery (JS waterfall / masonry) ---------- */
.gallery {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.empty {
  width: 100%;
  text-align: center;
  padding: 80px 30px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
}
.empty strong { color: var(--ink); font-family: var(--font-display); font-weight: 500; font-size: 20px; }
.empty p { margin-top: 8px; font-size: 14px; }

.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  position: relative;
  transform: translateZ(0);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s, box-shadow 0.4s;
  animation: card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}
.card a.media, .card .media { display: block; position: relative; }
.card .placeholder {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #0e0e15, #0a0a0f);
}

/* slow-drifting aurora that breathes — the "modern" loading state */
.card .ph-aura {
  position: absolute;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(38% 50% at 28% 30%, rgba(123, 91, 255, 0.55), transparent 70%),
    radial-gradient(34% 46% at 74% 38%, rgba(255, 94, 138, 0.42), transparent 70%),
    radial-gradient(40% 52% at 52% 78%, rgba(43, 217, 208, 0.40), transparent 72%);
  filter: blur(34px) saturate(125%);
  opacity: 0.85;
  animation: aura-breathe 6.5s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes aura-breathe {
  0%, 100% { transform: scale(1) translate3d(0, 0, 0); opacity: 0.6; }
  50%      { transform: scale(1.18) translate3d(2%, -3%, 0); opacity: 0.92; }
}

/* a single soft sweep of light passing over the surface */
.card .placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: ph-sweep 3.6s ease-in-out infinite;
}
@keyframes ph-sweep {
  0%   { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}

.card .ph-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: rgba(10, 10, 14, 0.4);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.card .ph-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c3);
  box-shadow: 0 0 10px var(--c3);
  animation: ph-breathe 2.4s ease-in-out infinite;
}
@keyframes ph-breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--c3); }
  50%      { opacity: 0.45; box-shadow: 0 0 3px var(--c3); }
}

.card .placeholder.is-error { background: linear-gradient(180deg, #1a0e12, #120a0d); }
.card .placeholder.is-error .ph-aura { display: none; }
.card .placeholder.is-error .ph-label { color: #ffb4b4; }
.card .placeholder.is-error .ph-dot { background: var(--c1); box-shadow: 0 0 10px var(--c1); animation: none; }
.card.is-pending, .card.is-processing { border-color: rgba(255,255,255,0.18); }
.card img {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}
.card .overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 14px 14px;
  background: linear-gradient(to top, rgba(6, 6, 8, 0.92), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
.card:hover .overlay, .card.is-pending .overlay, .card.is-processing .overlay, .card.is-failed .overlay { opacity: 1; transform: none; }
.card .prompt {
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: auto;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag.dl {
  margin-left: auto;
  color: #08080b;
  background: var(--ink);
  border-color: transparent;
  text-decoration: none;
  transition: transform 0.2s;
}
.tag.dl:hover { transform: scale(1.06); }

.card .media {
  /* the media is now a <button> — strip native chrome */
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Lightbox / image box ---------- */
body.lb-open { overflow: hidden; }

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 48px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.lightbox.is-open { opacity: 1; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 7, 0.78);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.lb-stage {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: stretch;
  max-width: min(1180px, 100%);
  max-height: 100%;
  transform: scale(0.97);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lightbox.is-open .lb-stage { transform: none; }

.lb-figure {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  flex: 1 1 auto;
}
.lb-img {
  max-width: 100%;
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 18px;
  background: #000;
  box-shadow: var(--shadow-float);
  display: block;
}

.lb-panel {
  flex: 0 0 280px;
  align-self: center;
  max-height: 86vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.lb-prompt-row { display: flex; align-items: flex-start; gap: 10px; }
.lb-prompt {
  flex: 1 1 auto;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.lb-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lb-copy:hover { color: var(--ink); background: rgba(255, 255, 255, 0.14); }
.lb-copy.ok { color: var(--c3); border-color: rgba(43, 217, 208, 0.5); }

.lb-meta { display: flex; flex-wrap: wrap; gap: 7px; }

.lb-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.lb-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #08080b;
  background: var(--ink);
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.2s;
}
.lb-download:hover { transform: translateY(-1px); }
.lb-open {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
.lb-open:hover { color: var(--ink); }

/* close + nav buttons */
.lb-close, .lb-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.16); border-color: var(--line-strong); }
.lb-close {
  top: clamp(12px, 3vw, 26px);
  right: clamp(12px, 3vw, 26px);
  width: 42px;
  height: 42px;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}
.lb-nav:hover { transform: translateY(-50%) scale(1.06); }
.lb-prev { left: clamp(10px, 2.5vw, 24px); }
.lb-next { right: clamp(10px, 2.5vw, 24px); }
.lightbox.lb-single .lb-nav { display: none; }

@media (max-width: 760px) {
  .lightbox { padding: 0; place-items: stretch; }
  .lb-stage {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* bottom clearance leaves room for the fixed nav-button pair */
    padding: max(56px, env(safe-area-inset-top)) 0 calc(76px + env(safe-area-inset-bottom));
  }
  .lb-figure { flex: 0 0 auto; padding: 0 12px; }
  .lb-img {
    max-height: 62vh;
    max-width: 100%;
    border-radius: 14px;
  }
  .lb-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 14px 12px 0;
    width: calc(100% - 24px);
    overflow: visible;
  }
  /* nav buttons sit as a bottom-centered pair, thumb-reachable */
  .lb-nav {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: none;
    width: 44px;
    height: 44px;
  }
  .lb-nav:hover { transform: none; }
  .lb-prev { left: auto; right: calc(50% + 8px); }
  .lb-next { right: calc(50% - 52px); }
  .lb-close {
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    width: 38px;
    height: 38px;
  }
}

/* ---------- Composer (Sora-style floating dock) ---------- */
.composer {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(820px, calc(100vw - 32px));
  z-index: 50;
  animation: dock-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes dock-in {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translateX(-50%); }
}
.composer-glow {
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: linear-gradient(120deg, var(--c1), var(--c2), var(--c3), var(--c4));
  background-size: 300% 300%;
  filter: blur(16px);
  opacity: 0.45;
  z-index: -1;
  animation: glow-shift 8s ease infinite;
}
@keyframes glow-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.composer-inner {
  border-radius: var(--radius-lg);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow: var(--shadow-float);
  padding: 10px 12px 9px;
}
.composer textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  padding: 3px 4px;
  max-height: 160px;
  outline: none;
}
.composer textarea::placeholder { color: var(--faint); }

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  cursor: pointer;
}
.chip:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.08); }
.chip-icon { color: var(--faint); flex: none; transition: color 0.2s; }
.chip:hover .chip-icon { color: var(--c3); }
.chip select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 0 2px 0 0;
}
.chip select option { background: #121218; color: var(--ink); }

.generate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--c1), var(--c2));
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 8px 26px rgba(255, 94, 138, 0.4);
}
.generate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(123, 91, 255, 0.5); }
.generate:active:not(:disabled) { transform: translateY(0); }
.generate:disabled { cursor: wait; filter: saturate(0.5) brightness(0.85); }
.generate .arrow { transition: transform 0.25s; }
.generate:hover:not(:disabled) .arrow { transform: translateX(3px); }
.generate .spinner { display: none; animation: spin 0.8s linear infinite; }
.generate.busy .arrow,
.generate.busy .generate-label { display: none; }
.generate.busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  display: block;
  margin-top: 7px;
  padding-left: 4px;
  font-size: 11px;
  color: var(--faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  main { padding: 20px 0 190px; }
  .topbar { margin-bottom: 16px; }
  .brand .display { font-size: 18px; }
  .auth-card {
    top: 14px;
    right: 14px;
    padding: 4px 4px 4px 9px;
    font-size: 11.5px;
  }
  .auth-card .who { max-width: 84px; }
  .auth-card img { width: 20px; height: 20px; }
  .brand .muted { display: none; }
  .gallery { gap: 12px; }
  .masonry-col { gap: 12px; }
  .composer {
    width: calc(100vw - 16px);
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  .composer-inner { padding: 9px 10px 8px; }
  .composer textarea { font-size: 16px; max-height: 120px; } /* 16px avoids iOS focus zoom */
  .composer-bar { flex-wrap: wrap; gap: 7px; }
  .chips { flex: 1 1 100%; }
  .chip { flex: 1 1 auto; justify-content: center; }
  .chip select { width: 100%; }
  .generate { width: 100%; margin-left: 0; justify-content: center; padding: 11px 20px; }
  .hint { display: none; }
}

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