/* ═══════════════════════════════════════════════════════════════════════════
   IMAGINE PAGE — 3-column premium redesign
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Color tokens ─────────────────────────────────────────────────────────── */
:root {
  --im-bg:       transparent;
  --im-surface:  rgba(14,10,26,0.55);
  --im-border:   rgba(255,255,255,0.09);
  --im-purple:   #7c3aed;
  --im-purple-lo: rgba(124,58,237,0.15);
  --im-gold:     #c9932a;
  --im-gold-lo:  rgba(201,147,42,0.12);
  --im-gold-hi:  #f0b429;
  --im-text:     #e8e0f0;
  --im-muted:    rgba(232,224,240,0.35);
}

/* ── Cursor fix ───────────────────────────────────────────────────────────── */
.im-body, .im-body * { cursor: auto; }
.im-body button,
.im-body [data-style],
.im-body [data-spectrum],
.im-body [data-mode],
.im-body [data-eye],
.im-body [data-aspect],
.im-body a,
.im-body .im-buy-link,
.im-body .im-gen-btn,
.im-body .im-download-btn,
.im-body .im-surprise-btn,
.im-body .im-sb-item,
.im-body .im-sb-invite-btn,
.im-body .im-rp-up-btn,
.im-body .im-rp-add-btn { cursor: pointer !important; }
.im-body input,
.im-body textarea { cursor: text !important; }

/* Hide old nav bar — keep in DOM for auth/wallet wiring */
.im-body .pf-nav.im-nav-hidden {
  display: none !important;
}

/* ── 3-column layout ──────────────────────────────────────────────────────── */
.im-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 65% 35% at 18% 12%, rgba(24,52,180,0.88) 0%, transparent 68%),
    radial-gradient(ellipse 55% 30% at 82% 10%, rgba(18,38,140,0.72) 0%, transparent 65%),
    radial-gradient(ellipse 80% 42% at 50% 50%, rgba(155,40,220,0.78) 0%, transparent 62%),
    radial-gradient(ellipse 90% 38% at 50% 78%, rgba(240,46,158,0.9) 0%, transparent 60%),
    radial-gradient(ellipse 110% 42% at 50% 108%, rgba(245,96,40,0.98) 0%, transparent 55%),
    #06060c;
  background-attachment: fixed;
  animation: imagineBreath 8s ease-in-out infinite alternate;
}
@keyframes imagineBreath {
  0%   { filter: hue-rotate(0deg) brightness(1); }
  50%  { filter: hue-rotate(6deg) brightness(1.05); }
  100% { filter: hue-rotate(-4deg) brightness(0.96); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.im-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  border-right: 1px solid var(--im-border);
  background: rgba(6,4,14,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
  scrollbar-width: none;
}
.im-sidebar::-webkit-scrollbar { display: none; }

/* Brand */
.im-sb-brand { margin-bottom: 28px; padding: 0 4px; }
.im-sb-logo-link { text-decoration: none; display: block; }
.im-sb-logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #f0b429 0%, #c9932a 60%, #f0b429 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.im-sb-logo-imagine {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 1px;
  margin-top: 4px;
  background: linear-gradient(135deg, rgba(232,224,240,0.55) 0%, rgba(232,224,240,0.3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.im-sb-tagline {
  font-size: 0.62rem;
  color: rgba(232,224,240,0.28);
  margin-top: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: 0.1px;
}
.im-tag-ignite {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.72rem;
  background: linear-gradient(135deg, #ff8c00 0%, #f0b429 50%, #ffd54f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.im-tag-strengthen {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.72rem;
  background: linear-gradient(135deg, #7c3aed 0%, #c47cf3 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav */
.im-sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.im-sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--im-muted);
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.im-sb-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--im-text);
}
.im-sb-item--active {
  background: var(--im-purple-lo);
  border: 1px solid rgba(124,58,237,0.3);
  color: #c4a9ff;
  font-weight: 600;
}
.im-sb-item-icon {
  font-size: 0.82rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.im-sb-signout { color: rgba(232,224,240,0.25); }
.im-sb-signout:hover { color: #f87171; background: rgba(248,113,113,0.06); }

.im-sb-divider {
  height: 1px;
  background: var(--im-border);
  margin: 8px 4px;
}
.im-sb-spacer { flex: 1; }

/* Invite card */
.im-sb-invite {
  background: linear-gradient(135deg, #1e0f3a, #160a28);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.im-sb-invite-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.im-sb-invite-ico { font-size: 1rem; }
.im-sb-invite-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--im-text);
}
.im-sb-invite-desc {
  font-size: 0.64rem;
  color: var(--im-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.im-sb-invite-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid rgba(201,147,42,0.45);
  border-radius: 8px;
  padding: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--im-gold-hi);
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.im-sb-invite-btn:hover {
  background: rgba(201,147,42,0.1);
  border-color: var(--im-gold-hi);
}
.im-sb-copy {
  font-size: 0.56rem;
  color: rgba(232,224,240,0.12);
  text-align: center;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.im-page {
  padding: 36px 32px 80px;
  min-width: 0;
  overflow-y: auto;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.im-header {
  position: relative;
  margin-bottom: 32px;
  padding: 28px 0 20px;
  overflow: hidden;
}
.im-header-text {
  position: relative;
  z-index: 2;
  max-width: 520px;
}
.im-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--im-text);
  margin-bottom: 12px;
}
.im-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--im-gold), var(--im-gold-hi), #f8d87a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.im-sub {
  font-size: 0.88rem;
  color: var(--im-muted);
  line-height: 1.7;
}
.im-header-glow {
  position: absolute;
  top: -20px;
  right: -32px;
  width: 520px;
  height: 340px;
  background: url('/public/img/imagine-hero.svg') right center / cover no-repeat;
  pointer-events: none;
  mask-image: linear-gradient(
    to left,
    rgba(0,0,0,0.9) 0%,
    rgba(0,0,0,0.6) 40%,
    transparent     75%
  );
  -webkit-mask-image: linear-gradient(
    to left,
    rgba(0,0,0,0.9) 0%,
    rgba(0,0,0,0.6) 40%,
    transparent     75%
  );
}

/* ── Auth wall ────────────────────────────────────────────────────────────── */
.im-auth-wall {
  text-align: center;
  padding: 64px 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--im-border);
  border-radius: 24px;
}
.im-auth-icon {
  font-size: 2rem;
  color: var(--im-gold);
  margin-bottom: 16px;
}
.im-auth-msg {
  font-size: 1rem;
  color: var(--im-muted);
  margin-bottom: 14px;
}
.im-auth-link {
  color: var(--im-gold);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}
.im-auth-link:hover { opacity: 0.8; }

/* ── Widget container ─────────────────────────────────────────────────────── */
.im-widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Step blocks ──────────────────────────────────────────────────────────── */
.im-step {
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: 18px;
  padding: 20px 22px 18px;
  transition: border-color 0.2s;
}
.im-step:focus-within {
  border-color: rgba(201,147,42,0.2);
}
.im-step-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 16px;
}
.im-step-head--toggle {
  cursor: pointer !important;
  margin-bottom: 0;
  user-select: none;
}
.im-step--collapsible.open .im-step-head--toggle {
  margin-bottom: 16px;
}
.im-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(201,147,42,0.1);
  border: 1.5px solid rgba(201,147,42,0.35);
  color: var(--im-gold-hi);
  font-size: 0.66rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.im-step-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(232,224,240,0.65);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.im-step-hint {
  display: block;
  font-size: 0.63rem;
  color: var(--im-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.im-step-caret {
  color: var(--im-muted);
  font-size: 0.75rem;
  align-self: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.im-step--collapsible.open .im-step-caret {
  transform: rotate(180deg);
}

/* ── Section label ────────────────────────────────────────────────────────── */
.im-section-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--im-muted);
  margin-bottom: 14px;
  margin-top: 32px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STYLE ENGINE — horizontal scroll + nav arrows
   ═══════════════════════════════════════════════════════════════════════════ */
.im-style-scroll-wrap {
  position: relative;
}
.im-style-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.im-style-row::-webkit-scrollbar { display: none; }

.im-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(13,10,20,0.94);
  border: 1.5px solid rgba(201,147,42,0.45);
  color: var(--im-gold-hi);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  z-index: 5;
  transition: background 0.15s, border-color 0.15s, opacity 0.2s;
  backdrop-filter: blur(4px);
  font-family: inherit;
  line-height: 1;
}
.im-scroll-btn:hover {
  background: rgba(201,147,42,0.2);
  border-color: var(--im-gold-hi);
}
.im-scroll-btn.hidden { opacity: 0; pointer-events: none; }
.im-scroll-btn-left  { left: -14px; }
.im-scroll-btn-right { right: -14px; }

.im-style-card {
  flex: 0 0 128px;
  height: 170px;
  position: relative;
  background: rgba(255,255,255,0.04) center/cover no-repeat;
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.18s, box-shadow 0.2s;
  cursor: pointer !important;
}
.im-style-card:hover {
  border-color: rgba(201,147,42,0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.im-style-card.active {
  border-color: var(--im-gold);
  box-shadow: 0 0 0 3px rgba(201,147,42,0.2), 0 8px 28px rgba(0,0,0,0.5);
}

/* Gradient overlay — pointer-events off so cursor stays on card */
.im-style-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6,2,14,0.95) 0%,
    rgba(6,2,14,0.25) 50%,
    transparent       100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 9px 10px 10px;
  pointer-events: none;
}
.im-style-emoji {
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 4px;
  display: block;
}
.im-style-name {
  font-size: 0.67rem;
  font-weight: 700;
  color: #f8f4ff;
  line-height: 1.2;
  display: block;
}

/* Eye / preview button */
.im-style-eye {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(6,2,14,0.75);
  border: 1.5px solid rgba(255,255,255,0.5);
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  transition: background 0.15s, border-color 0.15s;
  z-index: 2;
  line-height: 1;
}
.im-style-eye::before {
  content: '◉';
  font-size: 0.7rem;
  color: rgba(255,255,255,0.9);
  line-height: 1;
}
.im-style-eye:hover {
  background: rgba(201,147,42,0.6);
  border-color: var(--im-gold-hi);
}
.im-style-eye:hover::before { color: #fff; }

/* Selected checkmark badge */
.im-style-card.active::after {
  content: '✓';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--im-gold);
  color: #0d0a14;
  font-size: 0.55rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

/* Locked style cards */
.im-style-lock-veil {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(5px) brightness(0.55);
  -webkit-backdrop-filter: blur(5px) brightness(0.55);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
  background: rgba(4,1,10,0.35);
}
.im-style-lock-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.8));
  opacity: 0.9;
}
.im-style-locked { cursor: pointer !important; }
.im-style-locked:hover { border-color: rgba(255,255,255,0.15) !important; transform: none !important; }
.im-style-locked .im-style-eye { pointer-events: auto; }

/* Locked popup */
.im-locked-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(4,1,10,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s;
}
.im-locked-popup-overlay.visible { opacity: 1; }
.im-locked-popup {
  background: linear-gradient(160deg, #1a1030 0%, #0d0a1e 100%);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 0 60px rgba(167,139,250,0.12), 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(12px);
  transition: transform 0.3s;
}
.im-locked-popup-overlay.visible .im-locked-popup { transform: translateY(0); }
.im-locked-popup-icon { font-size: 2rem; margin-bottom: 1rem; }
.im-locked-popup-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(248,244,255,0.92);
  margin-bottom: 0.6rem;
}
.im-locked-popup-sub {
  font-size: 0.78rem;
  color: rgba(248,244,255,0.45);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.im-locked-popup-sub em { color: #f472b6; font-style: normal; font-weight: 600; }
.im-locked-popup-close {
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.8rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.im-locked-popup-close:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════════════════
   INTIMACY SPECTRUM
   ═══════════════════════════════════════════════════════════════════════════ */
.im-spectrum-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.im-spectrum-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.im-spectrum-group-label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--im-muted);
  min-width: 66px;
  flex-shrink: 0;
}
.im-spectrum-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.im-spectrum-btn {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--im-muted);
  cursor: pointer !important;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.im-spectrum-btn:hover {
  border-color: rgba(201,147,42,0.4);
  color: rgba(232,224,240,0.85);
}
.im-spectrum-btn.active {
  border-color: var(--im-gold);
  background: var(--im-gold-lo);
  color: var(--im-gold-hi);
}
.im-spectrum-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2px;
}
.im-spectrum-ai-btn {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--im-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.im-spectrum-ai-btn:hover {
  border-color: rgba(201,147,42,0.4);
  color: rgba(232,224,240,0.85);
}
.im-spectrum-ai-btn.active {
  border-color: var(--im-gold);
  background: var(--im-gold-lo);
  color: var(--im-gold-hi);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VISION INPUT
   ═══════════════════════════════════════════════════════════════════════════ */
.im-vision-wrap { position: relative; }

.im-prompt-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  padding: 14px 16px 44px;
  font-size: 0.9rem;
  color: var(--im-text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  outline: none;
  resize: none;
  transition: border-color 0.18s;
  min-height: 100px;
  cursor: text !important;
}
.im-prompt-input::placeholder { color: rgba(232,224,240,0.2); }
.im-prompt-input:focus { border-color: rgba(201,147,42,0.4); }

.im-surprise-btn {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: rgba(201,147,42,0.08);
  border: 1px solid rgba(201,147,42,0.28);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--im-gold-hi);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, border-color 0.15s;
}
.im-surprise-btn:hover {
  background: rgba(201,147,42,0.18);
  border-color: var(--im-gold);
}
.im-surprise-cost {
  background: rgba(201,147,42,0.18);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 0.58rem;
}

.im-char-counter {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 0.61rem;
  color: var(--im-muted);
  pointer-events: none;
}

/* ── Optional Controls ────────────────────────────────────────────────────── */
.im-opt-body { padding-top: 4px; }
.im-aspect-row { display: flex; gap: 8px; flex-wrap: wrap; }
.im-aspect-btn {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--im-muted);
  font-family: inherit;
  cursor: pointer !important;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.im-aspect-btn:hover {
  border-color: rgba(201,147,42,0.4);
  color: var(--im-text);
}
.im-aspect-btn.active {
  border-color: var(--im-gold);
  background: var(--im-gold-lo);
  color: var(--im-gold-hi);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GENERATION MODE
   ═══════════════════════════════════════════════════════════════════════════ */
.im-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.im-mode-tab {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px 14px 14px;
  cursor: pointer !important;
  text-align: left;
  transition: border-color 0.18s, background 0.18s, transform 0.15s, box-shadow 0.18s;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.im-mode-tab:hover {
  border-color: rgba(201,147,42,0.35);
  transform: translateY(-1px);
}
.im-mode-tab.active {
  border-color: var(--im-gold);
  background: linear-gradient(135deg, rgba(201,147,42,0.1), rgba(201,147,42,0.04));
  box-shadow: 0 0 0 2px rgba(201,147,42,0.15), 0 6px 20px rgba(0,0,0,0.3);
}
.im-mode-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, var(--im-gold), var(--im-gold-hi));
  color: #0d0a14;
  font-size: 0.52rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.im-mode-icon {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1;
  color: var(--im-muted);
}
.im-mode-tab.active .im-mode-icon { color: var(--im-gold-hi); }
.im-mode-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--im-text);
  margin-bottom: 4px;
}
.im-mode-tab.active .im-mode-name { color: var(--im-gold-hi); }
.im-mode-desc {
  display: block;
  font-size: 0.61rem;
  color: var(--im-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.im-mode-cost {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(232,224,240,0.35);
}
.im-mode-tab.active .im-mode-cost { color: var(--im-gold); }
.im-mode-radio {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.14);
  transition: border-color 0.15s, background 0.15s;
}
.im-mode-tab.active .im-mode-radio {
  border-color: var(--im-gold);
  background: radial-gradient(circle, var(--im-gold) 38%, transparent 38%);
}

.im-mode-tab[data-mode="elite"] {
  opacity: 0.38;
  cursor: pointer !important;
  filter: grayscale(0.6);
}
.im-mode-tab[data-mode="elite"]:hover {
  border-color: rgba(255,255,255,0.08);
  transform: none;
}

/* ── Elite flip card ──────────────────────────────────────────────────────── */
.im-mode-flip-wrap {
  perspective: 900px;
}

.im-mode-flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.im-mode-flip-inner.flipped {
  transform: rotateY(180deg);
}

.im-mode-flip-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.im-mode-flip-front .im-mode-tab {
  width: 100%;
  overflow: visible;
}

.im-mode-flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  border-radius: 14px;
  border: 1.5px solid rgba(124,58,237,0.35);
  background: linear-gradient(135deg, rgba(50,20,100,0.6), rgba(20,8,40,0.7));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 14px;
}

.im-mode-flip-icon {
  font-size: 1.4rem;
  color: var(--im-purple);
  opacity: 0.7;
  margin-bottom: 4px;
}

.im-mode-flip-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--im-text);
  text-align: center;
  line-height: 1.3;
}

.im-mode-flip-sub {
  font-size: 0.7rem;
  color: var(--im-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GENERATE BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.im-generate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: 18px;
  margin-top: 4px;
}
.im-balance-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
}
.im-balance-icon { color: var(--im-gold); font-size: 0.9rem; }
.im-balance-num {
  color: var(--im-gold-hi);
  font-weight: 800;
  font-size: 1.1rem;
}
.im-balance-label { color: var(--im-muted); }
.im-buy-link {
  background: var(--im-gold-lo);
  border: 1px solid rgba(201,147,42,0.3);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--im-gold-hi);
  cursor: pointer !important;
  font-family: inherit;
  transition: background 0.15s;
}
.im-buy-link:hover { background: rgba(201,147,42,0.2); }

.im-gen-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.im-gen-btn {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #c9932a 100%);
  border: none;
  border-radius: 14px;
  padding: 13px 34px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  cursor: pointer !important;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  font-family: inherit;
}
.im-gen-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124,58,237,0.55);
}
.im-gen-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  transform: none;
}
.im-gen-cost-hint {
  font-size: 0.61rem;
  color: var(--im-muted);
  text-align: right;
  margin: 0;
}

/* ── Status ───────────────────────────────────────────────────────────────── */
.im-status {
  font-size: 0.8rem;
  color: var(--im-muted);
  min-height: 1.2em;
  text-align: center;
  margin-top: 2px;
  transition: color 0.2s;
}
.im-status.error { color: #f87171; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESULT
   ═══════════════════════════════════════════════════════════════════════════ */
.im-result {
  display: none;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--im-border);
  border-radius: 18px;
  overflow: hidden;
  animation: im-fadein 0.4s ease;
}
.im-result.visible { display: block; }

@keyframes im-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.im-result-img-wrap { position: relative; }
.im-result-img-wrap img {
  width: 100%;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #080412;
}
.im-download-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(6,2,14,0.8);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(248,244,255,0.8);
  text-decoration: none;
  cursor: pointer !important;
  backdrop-filter: blur(4px);
  transition: background 0.15s, color 0.15s;
}
.im-download-btn:hover { background: rgba(201,147,42,0.5); color: #fff; }
.im-result-meta {
  padding: 12px 18px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.im-result-prompt { font-size: 0.76rem; color: var(--im-muted); }
.im-result-cost { font-size: 0.7rem; color: var(--im-gold); font-weight: 700; }
.im-result-enhanced {
  padding: 0 18px 14px;
  font-size: 0.67rem;
  color: rgba(232,224,240,0.2);
  font-style: italic;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULT OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.im-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 6, 16, 0.97);
  display: flex;
  flex-direction: column;
  animation: im-ro-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes im-ro-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes im-ro-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

.im-ro-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.im-ro-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--im-gold);
}

.im-ro-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: rgba(248,244,255,0.5);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.im-ro-close:hover { background: rgba(255,255,255,0.13); color: #fff; }

.im-ro-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 16px;
  overflow: hidden;
}

.im-ro-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
}

.im-ro-footer {
  flex-shrink: 0;
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.im-ro-prompt {
  flex: 1;
  font-size: 0.74rem;
  color: rgba(248,244,255,0.45);
  line-height: 1.5;
  min-width: 0;
}

.im-ro-cost {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--im-gold);
  white-space: nowrap;
}

.im-ro-dl {
  background: rgba(201,147,42,0.18);
  border: 1px solid rgba(201,147,42,0.4);
  border-radius: 8px;
  padding: 7px 18px;
  color: var(--im-gold);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.im-ro-dl:hover { background: rgba(201,147,42,0.32); }

/* ═══════════════════════════════════════════════════════════════════════════
   SESSION HISTORY
   ═══════════════════════════════════════════════════════════════════════════ */
.im-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.im-history-item {
  border-radius: 11px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--im-border);
  cursor: pointer !important;
  transition: border-color 0.15s, transform 0.15s;
}
.im-history-item:hover {
  border-color: rgba(201,147,42,0.4);
  transform: translateY(-1px);
}
.im-history-item img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}
.im-history-caption {
  padding: 6px 8px;
  font-size: 0.63rem;
  color: var(--im-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Quality bar ──────────────────────────────────────────────────────────── */
.im-quality-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--im-border);
}
.im-quality-bar span {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT PANEL
   ═══════════════════════════════════════════════════════════════════════════ */
.im-right-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  gap: 16px;
  border-left: 1px solid var(--im-border);
  background: rgba(6,4,14,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-y: auto;
  scrollbar-width: none;
}
.im-right-panel::-webkit-scrollbar { display: none; }

.im-rp-coins {
  background: var(--im-surface);
  border: 1px solid var(--im-border);
  border-radius: 16px;
  padding: 18px;
}
.im-rp-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--im-muted);
  margin-bottom: 10px;
}
.im-rp-num-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.im-rp-coin-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--im-gold), var(--im-gold-hi));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #0d0a14;
  font-weight: 900;
  flex-shrink: 0;
}
.im-rp-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--im-text);
  line-height: 1;
  font-family: 'Inter', sans-serif;
  flex: 1;
}
.im-rp-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--im-gold-lo);
  border: 1.5px solid rgba(201,147,42,0.35);
  color: var(--im-gold-hi);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}
.im-rp-add-btn:hover { background: rgba(201,147,42,0.22); }
.im-rp-timer-label {
  font-size: 0.58rem;
  color: var(--im-muted);
  margin-bottom: 4px;
}
.im-rp-timer {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--im-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.im-rp-upgrade {
  background: linear-gradient(135deg, #1c0f38, #150a26);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 16px;
  padding: 18px;
}
.im-rp-up-pre {
  font-size: 0.6rem;
  color: var(--im-muted);
  margin-bottom: 3px;
}
.im-rp-up-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--im-text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.im-rp-crown { color: var(--im-gold-hi); }
.im-rp-up-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.im-rp-up-list li {
  font-size: 0.7rem;
  color: rgba(232,224,240,0.55);
}
.im-rp-up-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}
.im-rp-up-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════════════════
   SAMPLE CALLOUT MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.im-callout-overlay {
  position: fixed; inset: 0;
  background: rgba(4,1,10,0.9);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.im-callout {
  background: #0e0818;
  border: 1px solid rgba(201,147,42,0.2);
  border-radius: 20px;
  padding: 24px 24px 20px;
  width: min(520px, calc(100vw - 32px));
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  display: flex; flex-direction: column; gap: 16px;
}
.im-callout-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%; width: 28px; height: 28px;
  color: var(--im-muted); font-size: 0.78rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s; font-family: inherit;
}
.im-callout-close:hover { background: rgba(255,255,255,0.12); color: var(--im-text); }
.im-callout-header {
  display: flex; flex-direction: column; gap: 8px;
}
.im-callout-title {
  font-size: 0.65rem; font-weight: 800;
  color: var(--im-muted); letter-spacing: 2.5px;
  text-transform: uppercase; padding-right: 36px;
}
.im-callout-desc-wrap {
  margin-top: 0.5rem;
}
.im-callout-desc-wrap[open] .im-callout-desc-toggle {
  margin-bottom: 0.5rem;
}
.im-callout-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f472b6;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s;
}
.im-callout-desc-toggle::-webkit-details-marker { display: none; }
.im-callout-desc-toggle::before {
  content: '▸';
  font-size: 0.6rem;
  transition: transform 0.2s;
}
.im-callout-desc-wrap[open] .im-callout-desc-toggle::before {
  transform: rotate(90deg);
}
.im-callout-desc-toggle:hover { color: #fb93c8; }
.im-callout-desc {
  font-size: 0.72rem;
  color: rgba(248,244,255,0.38);
  line-height: 1.6;
  font-style: italic;
  padding-right: 36px;
  margin: 0;
}
/* Main image wrap + side arrows */
.im-callout-img-wrap {
  position: relative;
}

.im-callout-side-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-family: inherit;
}

.im-callout-side-prev { left: 10px; }
.im-callout-side-next { right: 10px; }

.im-callout-side-arrow:hover {
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

/* Main image */
.im-callout-main {
  width: 100%; aspect-ratio: 4/5;
  border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,0.03);
  display: flex; align-items: center; justify-content: center;
}
.im-callout-img-full {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.im-callout-prompt-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 0.85rem;
  background: linear-gradient(to bottom, transparent, rgba(4, 1, 12, 0.88));
  border-radius: 0 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: im-cpb-in 0.35s ease forwards;
}

@keyframes im-cpb-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.im-callout-prompt-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--im-gold-hi);
  opacity: 0.7;
}

.im-callout-prompt-text {
  font-size: 0.74rem;
  color: rgba(248, 244, 255, 0.75);
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.im-callout-spinner {
  font-size: 0.78rem; color: rgba(248,244,255,0.25);
}
.im-callout-empty {
  font-size: 0.78rem; color: rgba(248,244,255,0.25); margin: 0;
}
/* Nav strip */
.im-callout-nav {
  display: flex; align-items: center; gap: 8px;
}
.im-callout-arrow {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; width: 30px; height: 50px;
  color: var(--im-muted); font-size: 1.1rem;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s; font-family: inherit;
}
.im-callout-arrow:hover { background: rgba(255,255,255,0.1); color: var(--im-text); }
.im-callout-thumbs {
  display: flex; gap: 6px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.im-callout-thumbs::-webkit-scrollbar { display: none; }
.im-callout-thumb {
  flex-shrink: 0; width: 50px; height: 50px;
  border-radius: 8px; overflow: hidden; padding: 0;
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer; transition: border-color 0.15s, transform 0.15s;
  background: rgba(255,255,255,0.03);
}
.im-callout-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-callout-thumb:hover { border-color: rgba(201,147,42,0.4); transform: translateY(-1px); }
.im-callout-thumb.active { border-color: var(--im-gold); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.im-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e1530;
  border: 1px solid rgba(201,147,42,0.35);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--im-gold-hi);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.im-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.im-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--lo-bg, #0d0a1e);
  transition: background 1.8s ease;
  animation: im-lo-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes im-lo-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes im-lo-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes im-lo-card-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-22px); }
}

.im-lo-intro {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lo-accent, #a78bfa);
  opacity: 0.82;
  margin-bottom: 2rem;
  text-align: center;
  padding: 0 24px;
  text-shadow: 0 0 24px color-mix(in srgb, var(--lo-accent, #a78bfa) 40%, transparent);
}

.im-lo-card-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

@keyframes lo-border-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.im-lo-card-frame {
  position: relative;
  max-width: 560px;
  width: 100%;
  padding: 1px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.55),
    0 0 48px color-mix(in srgb, var(--lo-accent, #a78bfa) 7%, transparent);
}

.im-lo-card-frame::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: conic-gradient(
    from 0deg,
    transparent 72%,
    var(--lo-accent, #a78bfa) 86%,
    transparent 100%
  );
  animation: lo-border-spin 3s linear infinite;
}

.im-lo-card {
  position: relative;
  width: 100%;
  padding: 2.5rem 2.5rem 2rem;
  text-align: center;
  background: var(--lo-bg, #0d0a1e);
  border-radius: 3px;
}

.im-lo-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lo-accent, #a78bfa);
  margin-bottom: 1.8rem;
  opacity: 0.7;
}

.im-lo-text {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.8;
  color: rgba(232, 224, 240, 0.9);
  min-height: 4rem;
  display: block;
  font-style: italic;
}

.im-lo-source {
  margin-top: 1.2rem;
  font-size: 0.67rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.06em;
  font-style: normal;
}

.im-lo-progress {
  margin-top: 2.2rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 1px;
  overflow: hidden;
}

.im-lo-bar {
  height: 100%;
  width: 0%;
  background: var(--lo-accent, #a78bfa);
  opacity: 0.55;
  border-radius: 1px;
}

.im-lo-bar.running {
  width: 100%;
  transition: width var(--hold-ms, 3500ms) linear;
}

.im-lo-status {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.13);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ── Effect: word-burst ───────────────────────────────────────────────────── */
.effect-word-burst .im-lo-text .lo-word {
  display: inline-block;
  opacity: 0;
  transform: scale(0.4) translateY(8px);
  animation: lo-wb-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes lo-wb-in {
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Effect: ink-bleed ────────────────────────────────────────────────────── */
.effect-ink-bleed .im-lo-text {
  clip-path: inset(0 0 100% 0);
  animation: lo-ib-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes lo-ib-in {
  to { clip-path: inset(0 0 0% 0); }
}

/* ── Effect: shimmer-rise ─────────────────────────────────────────────────── */
.effect-shimmer-rise .im-lo-text {
  opacity: 0;
  transform: translateY(20px);
  animation: lo-sr-in 0.75s ease forwards;
}

@keyframes lo-sr-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Effect: oracle-flip ──────────────────────────────────────────────────── */
.effect-oracle-flip .im-lo-text {
  opacity: 0;
  transform: rotateX(55deg) translateY(12px);
  transform-origin: 50% 0%;
  animation: lo-of-in 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes lo-of-in {
  to { opacity: 1; transform: rotateX(0deg) translateY(0); }
}

/* ── Effect: typewriter — cursor is inline ▍ char injected by JS ────────────── */
.effect-typewriter .im-lo-text {
  /* no special CSS needed — cursor is ▍ in textContent */
}

/* ── Effect: breath-pulse ─────────────────────────────────────────────────── */
.effect-breath-pulse .im-lo-text {
  opacity: 0;
  animation: lo-bp-in 1.1s ease forwards, lo-bp-pulse 4.5s ease-in-out 1.1s infinite;
}

@keyframes lo-bp-in {
  to { opacity: 1; }
}

@keyframes lo-bp-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1120px) {
  .im-layout { grid-template-columns: 200px 1fr; }
  .im-right-panel { display: none; }
}
@media (max-width: 740px) {
  .im-layout { grid-template-columns: 1fr; }
  .im-sidebar { display: none; }
  .im-page { padding: 24px 16px 80px; }
  .im-mode-row { grid-template-columns: 1fr; }
  .im-generate-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .im-gen-wrap { align-items: stretch; }
  .im-gen-btn { text-align: center; padding: 14px; }
  .im-gen-cost-hint { text-align: center; }
}
