:root {
  --bg: #0b2228;
  --bg-elev: #0f2c33;
  --bg-elev-2: #133640;
  --border: #1c4750;
  --text: #eaf3f2;
  --text-muted: #9fbdbc;
  --coral: #ff6b57;
  --coral-hover: #ff8571;
  --success: #4fd1a5;
  --danger: #ff5b5b;
  --warning: #ffc267;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* ---- Premium redesign tokens ---- */
  --teal: #35c4b5;
  --teal-hover: #4ad8c8;
  --text-secondary: #c9c0b0;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --glass-bg: rgba(15, 44, 51, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-glow-coral: 0 0 24px rgba(255, 107, 87, 0.25);
  --shadow-glow-teal: 0 0 24px rgba(53, 196, 181, 0.25);
  --ease: 0.15s ease;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

/* ---- Global animation primitives ---- */
@keyframes gradient-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, -4%) scale(1.08); }
  66% { transform: translate(-3%, 3%) scale(0.96); }
}

@keyframes border-glow-rotate {
  to { transform: rotate(360deg); }
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 87, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 87, 0); }
}

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255, 107, 87, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 0 rgba(53, 196, 181, 0.45); }
  50% { box-shadow: 0 4px 16px rgba(255, 107, 87, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 9px rgba(53, 196, 181, 0); }
}

@keyframes cta-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes cta-shimmer-sweep {
  0% { background-position: 200% 0; }
  60%, 100% { background-position: -60% 0; }
}

@keyframes shimmer-sweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes press-pop {
  from { transform: scale(0.97); }
  to { transform: scale(1); }
}

.shimmer {
  background: linear-gradient(90deg, var(--bg-elev) 25%, var(--bg-elev-2) 50%, var(--bg-elev) 75%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-mesh-blob { animation: gradient-drift 22s ease-in-out infinite; }
  .prompt-bar-glow::before { animation: border-glow-rotate 6s linear infinite; }
  .shimmer { animation: shimmer-sweep 1.6s linear infinite; }
  .prompt-mic-btn.recording { animation: mic-pulse 1.2s ease-in-out infinite; }
  .cta-pulse-btn { animation: cta-pulse 2.6s ease-in-out infinite, cta-gradient-shift 5s ease-in-out infinite; }
  .cta-pulse-btn::after { animation: cta-shimmer-sweep 3.4s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mesh-blob,
  .prompt-bar-glow::before,
  .shimmer,
  .prompt-mic-btn.recording,
  .cta-pulse-btn,
  .cta-pulse-btn::after {
    animation: none !important;
  }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}

* {
  box-sizing: border-box;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: rgba(255, 107, 87, 0.35);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 107, 87, 0.08), transparent),
    radial-gradient(1000px 500px at 100% 0%, rgba(79, 209, 165, 0.06), transparent),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand, .btn, label.section-label {
  font-family: "Sora", sans-serif;
}

a {
  color: var(--coral);
}

::selection {
  background: var(--coral);
  color: #0b2228;
}

/* ---------- Layout shells ---------- */

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app-shell {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Topbar / brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.2px;
  color: inherit;
  text-decoration: none;
}

.brand-logo-icon {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-auth {
  justify-content: center;
}

.brand-logo-full {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- Auth card ---------- */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.google-signin-btn-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 40px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--coral);
  color: #241009;
}

.form-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.form-panel.active {
  display: flex;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

input, textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

select {
  cursor: pointer;
}

select option {
  background: var(--bg-elev-2);
  color: var(--text);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 107, 87, 0.15);
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease), opacity var(--ease), box-shadow var(--ease);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--coral);
  color: #241009;
}

.btn-primary:hover:not(:disabled) {
  background: var(--coral-hover);
  box-shadow: var(--shadow-glow-coral);
}

.password-field-wrap {
  position: relative;
  display: flex;
}

.password-field-wrap input {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--ease);
}

.password-toggle-btn:hover {
  color: var(--text);
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.forgot-password-link {
  align-self: flex-end;
  font-size: 12px;
  color: var(--coral);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: -6px;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
}

.btn-danger {
  background: rgba(255, 91, 91, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 91, 91, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 91, 91, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #5fe0b5, #2fb388);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(47, 179, 136, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #6fe8c0, #34c292);
  box-shadow: 0 6px 20px rgba(47, 179, 136, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.form-success {
  min-height: 18px;
  color: var(--success);
  font-size: 13px;
}

/* ---------- Dashboard shell ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-breadcrumb {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 640px) {
  .topbar-breadcrumb,
  .topbar-left .topbar-divider {
    display: none;
  }
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.user-chip {
  font-size: 13px;
  color: var(--text-muted);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* ---------- Dashboard shell (sidebar + main) ---------- */

.dashboard-shell {
  display: flex;
  align-items: stretch;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.dashboard-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin: 14px 0 14px 14px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: calc(100% - 28px);
  overflow-y: auto;
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.dashboard-sidebar::-webkit-scrollbar,
.dashboard-main::-webkit-scrollbar {
  width: 6px;
}

.dashboard-sidebar::-webkit-scrollbar-track,
.dashboard-main::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-sidebar::-webkit-scrollbar-thumb,
.dashboard-main::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.dashboard-sidebar::-webkit-scrollbar-thumb:hover,
.dashboard-main::-webkit-scrollbar-thumb:hover {
  background: var(--coral);
}

.dashboard-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 2px 8px;
}

.dashboard-nav-section {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.dashboard-nav-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--coral), var(--teal));
  opacity: 0.55;
}

.dashboard-nav-section:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.dashboard-nav-section:last-of-type {
  margin-bottom: 0;
}

.sidebar-chip-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.sidebar-chip-pill:hover {
  border-color: var(--teal);
  color: var(--text);
  background: rgba(53, 196, 181, 0.08);
}

.sidebar-chip-pill svg {
  flex-shrink: 0;
  color: var(--warning);
}

.sidebar-chip-pill-whatsapp:hover {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.1);
}

.sidebar-chip-pill-whatsapp svg {
  color: #25d366;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.dashboard-nav-item::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--coral);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity var(--ease), transform var(--ease);
}

.dashboard-nav-item:disabled {
  cursor: default;
}

.dashboard-nav-item.active {
  background: linear-gradient(135deg, rgba(255, 107, 87, 0.18), rgba(255, 107, 87, 0.06));
  border-color: rgba(255, 107, 87, 0.6);
  color: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 107, 87, 0.3), 0 0 16px rgba(255, 107, 87, 0.35);
}

.dashboard-nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.dashboard-nav-item:hover:not(.active) {
  background: rgba(53, 196, 181, 0.1);
  border-color: rgba(53, 196, 181, 0.35);
  color: var(--text);
}

.dashboard-nav-item svg {
  flex-shrink: 0;
  padding: 5px;
  box-sizing: content-box;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  transition: background 0.15s ease;
}

.dashboard-nav-item.active svg {
  background: rgba(255, 107, 87, 0.22);
}

.dashboard-nav-item:hover:not(.active) svg {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Sidebar footer (plan / credits / avatar) ---------- */

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-footer .plan-pill {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer #planPillText {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-menu {
  width: 100%;
  display: flex;
}

.sidebar-footer-menu .credits-pill {
  width: 100%;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-footer-menu .credits-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer-menu-center {
  justify-content: center;
}

.sidebar-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0 auto;
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--ease);
}

.sidebar-profile-btn:hover {
  color: var(--teal);
}

.sidebar-profile-btn .avatar-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  pointer-events: none;
}

.sidebar-profile-chevron {
  flex-shrink: 0;
  transition: color var(--ease);
}

.popover-up {
  top: auto !important;
  bottom: calc(100% + 10px);
  left: 0;
  right: auto;
}

.popover-progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.popover-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--teal), var(--coral));
  transition: width 0.3s ease;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  max-width: 1100px;
  padding: 36px 24px 60px;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

@media (max-width: 880px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }
  .dashboard-shell {
    flex-direction: column;
    flex: none;
  }
  .dashboard-sidebar {
    width: auto;
    height: auto;
    overflow-y: visible;
    margin: 12px;
    border-radius: var(--radius);
  }
  .dashboard-main {
    height: auto;
    overflow-y: visible;
    padding: 24px 16px 40px;
  }
}

.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border-color: var(--coral);
  color: var(--text);
  cursor: default;
}

.mode-tab:not(.active):hover {
  border-color: var(--coral);
  color: var(--text);
}

.mode-tab-badge {
  background: var(--warning);
  color: #241009;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.coming-soon-card {
  max-width: 380px;
  text-align: center;
  padding: 36px 28px 28px;
  position: relative;
}

.coming-soon-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.coming-soon-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 107, 87, 0.12);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-soon-card h2 {
  margin: 0 0 10px;
}

.coming-soon-text {
  margin: 0 0 22px;
  line-height: 1.6;
}

.credit-confirm-card {
  max-width: 360px;
  text-align: center;
  padding: 32px 28px 28px;
}

.credit-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(79, 209, 165, 0.14);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.credit-confirm-card h2 {
  margin: 0 0 8px;
}

.credit-confirm-card .hint {
  margin: 0 0 22px;
  line-height: 1.5;
}

.credit-confirm-actions {
  display: flex;
  gap: 10px;
}

.credit-confirm-actions .btn {
  flex: 1;
  min-width: 0;
}

.prompt-gen-hint {
  margin: 10px 0 0;
}

/* ---------- Dashboard home (overview) ---------- */

.dashboard-home-hero {
  position: relative;
  margin-bottom: 16px;
  padding: 20px 24px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
}

.hero-mesh-blob-coral {
  top: -30px;
  left: 5%;
  width: 220px;
  height: 220px;
  background: var(--coral);
}

.hero-mesh-blob-teal {
  top: -10px;
  right: 10%;
  width: 180px;
  height: 180px;
  background: var(--teal);
  animation-delay: -7s;
}

.hero-mesh-blob-coral2 {
  bottom: -50px;
  left: 40%;
  width: 160px;
  height: 160px;
  background: var(--coral-hover);
  opacity: 0.2;
  animation-delay: -14s;
}

.dashboard-home-title {
  position: relative;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.dashboard-home-title span {
  color: var(--coral);
}

.dashboard-stats-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto 30px;
}

.dashboard-stat-card {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 8px 18px 8px 8px;
  width: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.dashboard-stat-card-coral {
  border-color: rgba(255, 107, 87, 0.3);
}

.dashboard-stat-card-teal {
  border-color: rgba(53, 196, 181, 0.3);
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.dashboard-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
}

.dashboard-stat-icon svg {
  width: 14px;
  height: 14px;
}

.dashboard-stat-card-coral .dashboard-stat-icon {
  background: rgba(255, 107, 87, 0.14);
  color: var(--coral);
}

.dashboard-stat-card-teal .dashboard-stat-icon {
  background: rgba(53, 196, 181, 0.14);
  color: var(--teal);
}

.dashboard-stat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.dashboard-stat-text .section-label {
  margin: 0;
  padding: 0;
  font-size: 10.5px;
}

.dashboard-stat-value {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.dashboard-stat-card-coral .dashboard-stat-value {
  color: var(--coral);
}

.dashboard-stat-card-teal .dashboard-stat-value {
  color: var(--teal);
}

.dashboard-home-quicklinks {
  margin-top: 36px;
}

.dashboard-quicklink-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.dashboard-quicklink {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  padding: 20px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), color var(--ease), background var(--ease);
}

.dashboard-quicklink:hover {
  border-color: rgba(255, 107, 87, 0.5);
  color: var(--text);
  background: rgba(255, 107, 87, 0.06);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-coral);
}

.dashboard-quicklink:active {
  transform: translateY(-1px) scale(0.98);
}

.dashboard-quicklink svg {
  color: var(--coral);
  width: 22px;
  height: 22px;
  padding: 8px;
  box-sizing: content-box;
  background: rgba(255, 107, 87, 0.1);
  border-radius: 50%;
  transition: background var(--ease);
}

.dashboard-quicklink:hover svg {
  background: rgba(255, 107, 87, 0.2);
}

@media (max-width: 720px) {
  .dashboard-stats-grid {
    justify-content: flex-start;
  }
  .dashboard-quicklink-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Leonardo-style generate dashboard ---------- */

.generate-layout {
  margin-bottom: 32px;
}

.sidebar-gen-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.gen-setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gen-setting-group .section-label {
  margin-bottom: 0;
}

.gen-setting-group select {
  font-size: 13px;
  padding: 10px 12px;
}

.gen-setting-group select:disabled option,
.gen-setting-group select option:disabled {
  color: var(--text-muted);
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.dimension-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dimension-btn:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--text);
}

.dimension-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dimension-btn.active {
  background: rgba(255, 107, 87, 0.16);
  border-color: var(--coral);
  color: var(--coral);
}

.dimension-icon {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}

.dimension-icon-portrait {
  width: 10px;
  height: 15px;
}

.dimension-icon-square {
  width: 12px;
  height: 12px;
}

.dimension-icon-landscape {
  width: 16px;
  height: 9px;
}

.dimension-icon-custom {
  width: 12px;
  height: 12px;
  border-style: dashed;
}

.count-select {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.count-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.count-btn.active {
  background: var(--coral);
  color: #241009;
}

.gen-reset-btn {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.generate-main-col {
  min-width: 0;
}

.prompt-bar-wrap {
  position: relative;
}

.prompt-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #d8dee0;
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--ease);
}

.prompt-bar-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: var(--radius-lg);
  background: conic-gradient(from 0deg, var(--coral), var(--teal), var(--coral-hover), var(--coral));
  opacity: 0.3;
  filter: blur(5px);
  transition: opacity var(--ease);
}

.prompt-bar-glow:focus-within::before {
  opacity: 0.8;
  filter: blur(7px);
}

.prompt-bar:focus-within {
  box-shadow: var(--shadow), 0 0 0 3px rgba(255, 107, 87, 0.12);
}

.prompt-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.prompt-bar-icon-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e2e6e8;
  background: #f4f6f7;
  color: #5a6469;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease);
}

.prompt-bar-icon-btn:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: var(--shadow-glow-teal);
}

.prompt-bar-magic {
  color: var(--coral);
  border-color: rgba(255, 107, 87, 0.3);
  background: rgba(255, 107, 87, 0.08);
}

.prompt-bar-magic:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
  box-shadow: var(--shadow-glow-coral);
}

.prompt-mic-btn {
  border-color: var(--border);
  background: var(--bg-elev-2);
  color: var(--text-muted);
}

.prompt-mic-btn:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: var(--shadow-glow-teal);
}

.prompt-mic-btn.recording {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(255, 107, 87, 0.12);
}

.prompt-lang-toggle {
  flex-shrink: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-muted);
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--ease);
}

.prompt-lang-toggle:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.prompt-bar-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: #1a2226;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 6px;
  resize: none;
  max-height: 160px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
  font-family: "Manrope", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.prompt-bar-input::placeholder {
  color: #8a9498;
}

.prompt-bar-input:focus {
  box-shadow: none;
}

.prompt-bar-input:focus-visible {
  outline: none;
}

.generate-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--coral), var(--coral-hover));
  color: #241009;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(255, 107, 87, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}

.generate-btn:hover:not(:disabled) {
  box-shadow: var(--shadow-glow-coral), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 10px rgba(255, 107, 87, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-pulse-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--coral), var(--teal), var(--coral-hover));
  background-size: 220% auto;
  background-position: 0% 50%;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cta-pulse-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 200% 0;
  pointer-events: none;
}

.cta-pulse-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.inspiration-section {
  margin: 32px 0 40px;
}

.inspiration-heading {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}

.inspiration-grid {
  display: flex;
  gap: 14px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.inspiration-card {
  position: relative;
  flex: 0 0 180px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  aspect-ratio: 1 / 1;
  background: var(--bg-elev-2);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.inspiration-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--teal);
  box-shadow: var(--shadow-glow-teal);
}

.inspiration-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inspiration-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
}

.pro-examples-section {
  margin-top: 40px;
}

.pro-examples-grid {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.pro-example-card {
  position: relative;
  flex: 0 0 200px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--bg-elev-2);
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.pro-example-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--coral);
  box-shadow: var(--shadow-glow-coral);
}

.pro-example-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.pro-example-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
  color: #ffffff;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 980px) {
  .sidebar-gen-panel {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .gen-setting-group {
    flex: 1 1 160px;
  }
  .gen-reset-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 640px) {
  .prompt-actions-row {
    justify-content: stretch;
  }
  .prompt-actions-row .generate-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ---------- Avatar ---------- */

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.2s ease;
}

.avatar-btn:hover {
  border-color: var(--coral);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pill-btn {
  border: none;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  transition: border-color 0.2s ease;
}

.pill-btn:hover {
  border-color: var(--coral);
}

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.35);
}

.help-btn:hover {
  border-color: #25d366;
  color: #25d366;
  background: rgba(37, 211, 102, 0.1);
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
}

.plan-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.plan-pill.is-pro {
  border-color: rgba(79, 209, 165, 0.4);
  background: rgba(79, 209, 165, 0.1);
  color: var(--success);
}

.plan-pill.is-pro .plan-pill-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(79, 209, 165, 0.7);
}

.credits-pill {
  gap: 7px;
  background: rgba(255, 107, 87, 0.12);
  border-color: rgba(255, 107, 87, 0.3);
  color: var(--coral);
}

.credits-pill-icon {
  color: var(--coral);
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .plan-pill {
    display: none;
  }
}

/* ---------- Topbar dropdown / popover ---------- */

.topbar-menu {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 150;
}

.popover {
  width: 260px;
  padding: 16px;
}

.popover-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.popover-row .section-label {
  margin-bottom: 0;
}

.popover-row span:not(.section-label) {
  font-size: 14px;
  word-break: break-all;
}

.popover-credits {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--coral);
}

.popover-credits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.popover-credits-grid .popover-row {
  margin-bottom: 0;
}

.popover-credits-used {
  color: var(--text-muted);
}

.dropdown {
  width: 270px;
  padding: 8px;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 14px;
}

.dropdown-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 16px;
}

.dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--coral);
  color: #241009;
  border: 2px solid var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.dropdown-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dropdown-email {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-role {
  font-size: 12px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: rgba(255, 107, 87, 0.1);
}

.dropdown-item:hover .dropdown-item-icon {
  color: var(--coral);
}

.dropdown-item-danger {
  color: var(--danger);
}

.dropdown-item-danger .dropdown-item-icon {
  color: var(--danger);
}

.dropdown-item-danger:hover {
  background: rgba(255, 91, 91, 0.12);
}

/* ---------- User Policy ---------- */

.policy-content {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 20px;
  padding-right: 6px;
}

.policy-content h3 {
  font-size: 14px;
  margin: 18px 0 6px;
}

.policy-content h3:first-child {
  margin-top: 0;
}

.policy-content p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 15, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  animation: modal-fade-in 0.15s ease;
}

/* Must outrank every other .modal-overlay (z-index 200) since it can be triggered
   from inside an already-open modal (Enhance, Restore, Edit, etc.) and needs to
   paint above it, not behind it. */
#creditConfirmModal {
  z-index: 500;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  animation: modal-scale-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card::-webkit-scrollbar {
  width: 6px;
}

.modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.modal-card::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--coral);
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}

.avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 28px;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.avatar-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 20px 0;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.profile-info-item .section-label {
  margin-bottom: 0;
}

/* ---------- Image Editor ---------- */

.image-editor-card {
  max-width: 860px;
  width: 100%;
}

.editor-body {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.editor-canvas-wrap {
  flex: 1 1 420px;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 480px;
  overflow: hidden;
}

#editorCanvas {
  max-width: 100%;
  max-height: 456px;
  cursor: crosshair;
  border-radius: 6px;
}

.editor-tools {
  flex: 1 1 240px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.editor-tabs {
  margin-bottom: 0;
}

.editor-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.editor-panel.active {
  display: flex;
}

.editor-tool-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-tool-group .section-label {
  margin-bottom: 0;
}

.editor-btn-row {
  display: flex;
  gap: 8px;
}

.editor-btn-row .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
}

.editor-tool-group input[type="range"] {
  width: 100%;
}

.filter-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.active {
  background: var(--coral);
  color: #241009;
  border-color: var(--coral);
}

#editorAiInstruction {
  min-height: 70px;
  resize: vertical;
}

.editor-save-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .editor-body {
    flex-direction: column;
  }
  .editor-canvas-wrap {
    max-height: 340px;
  }
  #editorCanvas {
    max-height: 316px;
  }
}

/* ---------- Product Photo Maker ---------- */

.product-photo-card {
  max-width: 920px;
}

.product-canvas-wrap {
  position: relative;
  flex-direction: column;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.04) 75%) 10px 10px / 20px 20px,
    rgba(0, 0, 0, 0.3);
}

#productPreviewImg {
  max-width: 100%;
  max-height: 456px;
  border-radius: 6px;
  object-fit: contain;
}

#productFabricCanvasWrap {
  max-width: 100%;
  max-height: 456px;
}

#productFabricCanvasWrap .canvas-container {
  border-radius: 6px;
  overflow: hidden;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--coral);
  cursor: pointer;
}

.product-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-style-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.product-style-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-style-btn.active {
  background: var(--coral);
  color: #241009;
  border-color: var(--coral);
}

.product-style-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.product-style-swatch-white { background: #f4f4f2; }
.product-style-swatch-marble { background: linear-gradient(135deg, #e8e6e1, #b9b5ad); }
.product-style-swatch-gradient { background: linear-gradient(135deg, var(--success), #f4f4f2); }
.product-style-swatch-lifestyle { background: linear-gradient(135deg, #a97c50, #6b4a2f); }

.product-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 8px;
}

.product-bulk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.product-bulk-item img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.product-bulk-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.product-bulk-item-status {
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.product-bulk-item-status.status-done { color: var(--success); }
.product-bulk-item-status.status-error { color: var(--coral); }
.product-bulk-item-status.status-pending { color: var(--text-muted); }

/* ---------- Logo Maker ---------- */

.logo-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  padding: 8px;
}

.logo-result-card {
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
  aspect-ratio: 1 / 1;
}

.logo-result-card:hover {
  border-color: var(--coral);
  transform: translateY(-2px);
}

.logo-result-card img {
  width: 88%;
  height: 88%;
  margin: 6%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
}

.logo-result-card.logo-result-shape-circle img {
  border-radius: 50%;
}

.logo-result-card-actions {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  z-index: 1;
}

.logo-result-download-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #241009;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.logo-result-download-btn:hover {
  background: var(--coral-hover);
}

.logo-result-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 34, 40, 0.75);
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.logo-result-card:hover .logo-result-card-overlay {
  opacity: 1;
}

/* ---------- Customer Reviews ---------- */

.reviews-modal-card {
  max-width: 620px;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.reviews-row {
  display: flex;
  gap: 14px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.reviews-row .review-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
}

.review-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.review-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.review-card-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 107, 87, 0.14);
  color: var(--coral);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-card-head-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.review-card-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
}

.review-card-stars {
  color: var(--warning);
  font-size: 12px;
  letter-spacing: 1px;
}

.review-card-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.review-form-stars {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.review-star-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
  transition: color var(--ease), transform var(--ease);
}

.review-star-btn:hover {
  transform: scale(1.15);
}

.review-star-btn.active {
  color: var(--warning);
}

/* ---------- HD Enhance: before/after compare slider ---------- */

.compare-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 456px;
  line-height: 0;
  user-select: none;
  border-radius: 6px;
  overflow: hidden;
}

.compare-img {
  display: block;
  max-width: 100%;
  max-height: 456px;
  width: auto;
  height: auto;
  pointer-events: none;
}

.compare-after-clip {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  line-height: 0;
}

.compare-after-clip .compare-img {
  max-height: none;
  height: 100%;
  width: auto;
  max-width: none;
}

.compare-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--coral);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(255, 107, 87, 0.6);
}

.compare-range {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.compare-range::-webkit-slider-thumb {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  cursor: ew-resize;
  margin-top: 0;
}

.compare-range::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  cursor: ew-resize;
}

.compare-range::-webkit-slider-runnable-track {
  background: transparent;
}

.compare-label {
  position: absolute;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
}

.compare-label-before {
  left: 10px;
}

.compare-label-after {
  right: 10px;
}

.enhance-tier-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.enhance-tier-card p.hint {
  margin: 4px 0 10px;
}

.enhance-tier-premium {
  border-color: rgba(255, 107, 87, 0.4);
  background: linear-gradient(135deg, rgba(255, 107, 87, 0.1), rgba(79, 209, 165, 0.06));
}

.pro-badge {
  display: inline-block;
  background: var(--teal);
  color: #072620;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 4px;
  box-shadow: 0 0 8px rgba(53, 196, 181, 0.5);
}

/* ---------- Text Tool Dashboards (dedicated full-screen page per tool) ---------- */

.text-tool-page {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.text-tool-page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 34, 40, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}

.text-tool-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.text-tool-back-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.text-tool-page-heading {
  padding-left: 20px;
  border-left: 1px solid var(--border);
  min-width: 0;
}

.text-tool-page-heading h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 20px;
}

.text-tool-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 640px;
}

.text-tool-page-body {
  flex: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 32px;
  align-items: start;
}

.text-tool-panel {
  position: sticky;
  top: 96px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

#textToolInput {
  min-height: 110px;
  resize: vertical;
}

.text-tool-actions {
  margin-top: 14px;
}

.text-tool-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.text-tool-result-box {
  min-height: 100px;
  resize: vertical;
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
}

.text-tool-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.text-tool-result-actions .btn {
  flex: 1;
}

.text-tool-upgrade-cta {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 107, 87, 0.14), rgba(79, 209, 165, 0.08));
  border: 1px solid rgba(255, 107, 87, 0.35);
}

.text-tool-upgrade-cta p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.text-tool-upgrade-cta strong {
  color: var(--text);
}

.text-tool-examples-panel {
  min-width: 0;
}

.text-tool-examples-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.text-tool-examples-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.text-tool-example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.text-tool-example-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.2));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-tool-example-card[data-clickable="true"]:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 87, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.text-tool-example-tag {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(79, 209, 165, 0.14);
  color: var(--success);
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.text-tool-example-input {
  color: var(--text-muted);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.4;
}

.text-tool-example-arrow {
  color: var(--coral);
  font-size: 12px;
  line-height: 1;
}

.text-tool-example-output {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-line;
}

@media (max-width: 980px) {
  .text-tool-page-body {
    grid-template-columns: 1fr;
  }
  .text-tool-panel {
    position: static;
  }
  .text-tool-example-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .text-tool-page-header {
    padding: 14px 18px;
    flex-wrap: wrap;
  }
  .text-tool-page-heading {
    padding-left: 0;
    border-left: none;
  }
  .text-tool-page-body {
    padding: 18px;
  }
  .text-tool-example-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- AI Support Assistant ---------- */

.assistant-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5b9dff, #2f6fe0);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(47, 111, 224, 0.45);
  z-index: 180;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.assistant-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 28px rgba(47, 111, 224, 0.55);
}

.assistant-fab-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(91, 157, 255, 0.5);
  animation: assistant-fab-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes assistant-fab-pulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.assistant-fab-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
}

.assistant-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  height: 500px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 190;
  animation: modal-scale-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.assistant-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.assistant-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--border);
}

.assistant-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.assistant-header-text {
  flex: 1;
  min-width: 0;
}

.assistant-title {
  display: block;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.assistant-subtitle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.assistant-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(79, 209, 165, 0.8);
  flex-shrink: 0;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.assistant-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: assistant-bubble-in 0.2s ease;
}

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

.assistant-bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #5b9dff, #2f6fe0);
  color: #ffffff;
  font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(47, 111, 224, 0.3);
}

.assistant-bubble-assistant {
  align-self: flex-start;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.assistant-bubble-typing {
  align-self: flex-start;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  padding: 11px 14px;
  display: flex;
  gap: 4px;
}

.assistant-bubble-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: assistant-typing 1s infinite ease-in-out;
}

.assistant-bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-bubble-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes assistant-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.assistant-suggestion-chip {
  background: rgba(91, 157, 255, 0.12);
  border: 1px solid rgba(91, 157, 255, 0.35);
  color: #7aade9;
  font-family: "Manrope", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.assistant-suggestion-chip:hover {
  background: rgba(91, 157, 255, 0.22);
  border-color: #5b9dff;
}

.assistant-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.assistant-input-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.assistant-send-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5b9dff, #2f6fe0);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(47, 111, 224, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.assistant-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
}

.assistant-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .assistant-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
    height: 70vh;
  }
  .assistant-fab {
    right: 16px;
    bottom: 16px;
  }
}

/* ---------- Preview mode ---------- */

.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-shrink: 0;
  background: rgba(255, 194, 103, 0.12);
  border-bottom: 1px solid rgba(255, 194, 103, 0.35);
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
}

.preview-banner .btn {
  padding: 6px 14px;
  font-size: 12px;
}

/* ---------- Payments / Top Up ---------- */

.plans-modal-card {
  max-width: 760px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 157, 255, 0.5);
}

.plan-card-highlight {
  border-color: rgba(91, 157, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(91, 157, 255, 0.2), 0 8px 24px rgba(47, 111, 224, 0.25);
}

.plan-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #5b9dff, #2f6fe0);
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-card-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.plan-card-price {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 22px;
}

.plan-card-price-period {
  font-family: "Manrope", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
}

.plan-card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.plan-card-features li {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.plan-card-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.selected-plan-banner {
  background: rgba(91, 157, 255, 0.1);
  border: 1px solid rgba(91, 157, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 13px;
}

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

.payment-method-box {
  background: rgba(255, 107, 87, 0.08);
  border: 1px solid rgba(255, 107, 87, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.payment-method-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.payment-method-row:not(:last-child) {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.payment-method-name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--coral);
}

.payment-account-number {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
}

#topUpForm .field {
  margin-bottom: 14px;
}

#topUpScreenshotInput {
  padding: 10px;
}

.payment-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.payment-history-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.payment-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

.payment-history-item .payment-history-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payment-history-item .payment-history-meta .txn {
  color: var(--text-muted);
  font-size: 12px;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.gallery-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-card {
  background: var(--bg-elev);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.gallery-card:hover {
  border-color: rgba(255, 107, 87, 0.4);
  box-shadow: var(--shadow), var(--shadow-glow-coral);
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 50%);
  opacity: 0;
  transition: opacity var(--ease);
  pointer-events: none;
}

.gallery-card:hover::after {
  opacity: 1;
}

.gallery-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--ease);
  z-index: 1;
}

.gallery-card:hover .gallery-card-actions {
  opacity: 1;
}

.gallery-edit-btn {
  background: rgba(11, 34, 40, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.gallery-edit-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

@media (hover: none) {
  .gallery-card-actions {
    opacity: 1;
  }
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--bg-elev-2);
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

.gallery-card .caption {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state-icon {
  width: 44px;
  height: 44px;
  padding: 12px;
  box-sizing: content-box;
  border-radius: 50%;
  background: rgba(255, 107, 87, 0.08);
  color: var(--coral);
}

.empty-state p {
  margin: 0;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #241009;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.spinner-dark {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.caption-loading {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px 0;
}

.caption-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
}

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

/* ---------- Admin panel ---------- */

.admin-shell {
  display: flex;
  align-items: stretch;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin: 14px 0 14px 14px;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100vh - 28px);
  overflow-y: auto;
}

.admin-owner-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(53, 196, 181, 0.15);
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.admin-nav a::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--coral);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity var(--ease), transform var(--ease);
}

.admin-nav a svg {
  flex-shrink: 0;
  padding: 5px;
  box-sizing: content-box;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  transition: background var(--ease);
}

.admin-nav a:hover {
  background: rgba(53, 196, 181, 0.1);
  border-color: rgba(53, 196, 181, 0.35);
  color: var(--text);
}

.admin-nav a:hover svg {
  background: rgba(255, 255, 255, 0.1);
}

.admin-nav a.active {
  background: linear-gradient(135deg, rgba(255, 107, 87, 0.18), rgba(255, 107, 87, 0.06));
  border-color: rgba(255, 107, 87, 0.6);
  color: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 107, 87, 0.3), 0 0 16px rgba(255, 107, 87, 0.35);
}

.admin-nav a.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.admin-nav a.active svg {
  background: rgba(255, 107, 87, 0.22);
}

.nav-badge {
  display: inline-block;
  background: var(--coral);
  color: #241009;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

.payments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.payment-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--ease), border-color var(--ease);
}

.payment-card:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 196, 181, 0.35);
}

.payment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.payment-card-email {
  font-weight: 700;
  font-size: 14px;
}

.payment-card-screenshot {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.payment-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-card-meta strong {
  color: var(--text);
}

.payment-card-approve-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.payment-card-approve-row input {
  width: 90px;
  padding: 8px;
  font-size: 13px;
}

.payment-card-actions {
  display: flex;
  gap: 8px;
}

.admin-main {
  padding: 22px 28px;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.admin-main h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 87, 0.35);
}

.stat-card-coral:hover { box-shadow: var(--shadow), var(--shadow-glow-coral); }
.stat-card-teal:hover { box-shadow: var(--shadow), var(--shadow-glow-teal); }

.stat-card-clickable {
  cursor: pointer;
}

.stat-card-clickable:active {
  transform: translateY(-1px) scale(0.98);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  margin-bottom: 6px;
}

.stat-icon svg {
  width: 13px;
  height: 13px;
}

.stat-card-coral .stat-icon {
  background: rgba(255, 107, 87, 0.14);
  color: var(--coral);
}

.stat-card-teal .stat-icon {
  background: rgba(53, 196, 181, 0.14);
  color: var(--teal);
}

.stat-card .stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-family: "Sora", sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.table-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.admin-review-card {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
}

.review-order-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  flex-shrink: 0;
}

.review-edit-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.review-edit-form textarea {
  resize: vertical;
}

.row-pinned {
  background: rgba(53, 196, 181, 0.06);
}

.user-detail-card {
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
}

.user-detail-password-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.user-detail-password-row input {
  flex: 1;
}

.user-detail-generations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.user-detail-gen-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.user-detail-gen-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.user-detail-gen-card p {
  margin: 0;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cf-usage-card {
  position: relative;
  background: linear-gradient(135deg, rgba(53, 196, 181, 0.1), rgba(255, 107, 87, 0.06));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  overflow: hidden;
}

.cf-usage-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cf-usage-head h2 {
  margin: 0;
  font-size: 15px;
}

.cf-usage-head .hint {
  margin: 2px 0 0;
}

.cf-usage-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(53, 196, 181, 0.16);
  color: var(--teal);
}

.cf-usage-numbers {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cf-usage-number-block .cf-usage-number-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.cf-usage-number-block .cf-usage-number-value {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 28px;
}

.cf-usage-number-block.cf-usage-used .cf-usage-number-value { color: var(--coral); }
.cf-usage-number-block.cf-usage-remaining .cf-usage-number-value { color: var(--teal); }

.cf-usage-bar-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.cf-usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  border-radius: var(--radius-pill);
  transition: width var(--ease);
}

.tools-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tools-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.tools-manage-label {
  font-weight: 600;
  font-size: 13px;
}

.tools-manage-name-input {
  width: auto;
  max-width: 240px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 10px;
}

.payment-method-entry-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.table-toolbar input {
  max-width: 260px;
}

.table-scroll-wrap {
  overflow-x: auto;
  scrollbar-width: auto;
  scrollbar-color: var(--coral) var(--bg-elev-2);
  border-bottom: 2px solid var(--bg-elev-2);
}

.table-scroll-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-scroll-wrap::-webkit-scrollbar-track {
  background: var(--bg-elev-2);
}

.table-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--coral);
  border-radius: var(--radius-pill);
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 20px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(28, 71, 80, 0.5);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active {
  background: rgba(79, 209, 165, 0.15);
  color: var(--success);
}

.badge-inactive {
  background: rgba(255, 91, 91, 0.15);
  color: var(--danger);
}

.badge-admin {
  background: rgba(255, 107, 87, 0.15);
  color: var(--coral);
}

.badge-pending {
  background: rgba(255, 194, 103, 0.15);
  color: var(--warning);
}

.badge-approved {
  background: rgba(79, 209, 165, 0.15);
  color: var(--success);
}

.badge-rejected {
  background: rgba(255, 91, 91, 0.15);
  color: var(--danger);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
}

.credit-input {
  width: 70px;
  padding: 6px 8px;
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--coral);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 320px;
  z-index: 100;
  display: none;
}

.toast.show {
  display: block;
}

.toast.error {
  border-left-color: var(--danger);
}

@media (max-width: 720px) {
  .admin-shell {
    flex-direction: column;
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
  }
  .admin-sidebar {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    height: auto;
    margin: 12px;
  }
  .admin-main {
    height: auto;
    overflow-y: visible;
    overflow-x: hidden;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .topbar {
    padding: 14px 16px;
  }
  .main {
    padding: 24px 16px 40px;
  }
}
