/* ===== Joy Assistant — 5-step guided wizard + real client preview ===== */
#joyAssistantPage.page {
  --joy-top-chrome: calc(12px + env(safe-area-inset-top, 0px));
  --joy-client-reserve: 24px;
  --joy-duo-h: 76px;
  --joy-cta-h: 68px;
  --joy-card-max-h: min(34vh, 240px);
  --joy-card-actions-max-h: min(52vh, 360px);
  background: transparent;
  color: #fff;
  min-height: 100dvh;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 12;
}

#joyAssistantPage .joy-assistant-shell,
#joyAssistantPage .joy-assistant-center,
#joyAssistantPage .joy-assistant-card,
#joyAssistantPage .joy-assistant-popover,
#joyAssistantPage .joy-assistant-card__body,
#joyAssistantPage .joy-assistant-card__nav {
  pointer-events: auto;
}

/* Fundal slideshow vizibil în Joy Assistant (fără .visible pe #clientPage) */
body.joy-assistant-active.joy-assistant-client-preview #bgContainer {
  z-index: 0;
}

body.joy-assistant-active.joy-assistant-client-preview #bgContainer .bg-slide {
  filter: brightness(1.08) contrast(1.08) saturate(1.22);
  transform: scale(1.02);
  transform-origin: center center;
}

body.joy-assistant-active.joy-assistant-client-preview #bgContainer .bg-slide.active {
  opacity: 1;
}

body.joy-assistant-active.joy-assistant-client-preview #bgContainer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.42) 0%,
      rgba(0, 0, 0, 0.08) 38%,
      rgba(0, 0, 0, 0.12) 62%,
      rgba(0, 0, 0, 0.68) 100%
    );
}

body.joy-assistant-active.joy-assistant-client-preview #app {
  background: transparent;
}

/* Mod Client real — fundal fullscreen în Joy Assistant */
body.joy-assistant-active.joy-assistant-client-preview #clientPage.page {
  display: flex !important;
  visibility: visible !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  position: fixed;
  inset: 0;
  z-index: 10;
  min-height: 100dvh !important;
  max-width: 520px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding:
    calc(env(safe-area-inset-top, 0px) + 10px)
    calc(env(safe-area-inset-right, 0px) + 16px)
    calc(env(safe-area-inset-bottom, 0px) + 8px)
    calc(env(safe-area-inset-left, 0px) + 16px) !important;
  box-sizing: border-box !important;
  pointer-events: none;
  overflow: hidden;
}

/* Anulează stage/hero fixed — altfel butoanele rămân sus (nu pe Custom: are layout propriu) */
body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-premium-stage,
body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-hero-actions {
  display: contents !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none !important;
  z-index: auto !important;
  flex: none !important;
  gap: 0 !important;
}

/* Stack jos identic Mod Client: Campanie → Meniu|Recenzie → FAB (nu pe Custom) */
body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-premium-center-cta,
body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-premium-bottom-dock,
body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) #clientPremiumSectionDuo,
body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) .client-premium-duo {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  flex-shrink: 0 !important;
  pointer-events: auto !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) #clientPremiumSectionPromo,
body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) .client-premium-hero-section[data-hero-section='promo'] {
  order: 1 !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-elegant-social-section {
  order: 2 !important;
  display: none !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-template-header.client-elegant-top-chrome {
  z-index: 11 !important;
  pointer-events: none !important;
}

body.joy-assistant-active.joy-assistant-client-preview
  #clientPage
  .client-elegant-top-chrome
  .client-template-header__brand-wrap,
body.joy-assistant-active.joy-assistant-client-preview
  #clientPage
  .client-elegant-top-chrome
  .client-template-header__social {
  pointer-events: auto !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-premium-center-cta {
  order: 3 !important;
  margin-top: auto !important;
  padding: 0 !important;
  display: flex !important;
  pointer-events: none !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) #clientPremiumSectionDuo,
body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) .client-premium-duo {
  order: 4 !important;
  margin-top: var(--tpl-elegant-gap, 14px) !important;
  padding: 0 !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui:not(.template-custom) .client-premium-bottom-dock {
  order: 5 !important;
  margin-top: var(--tpl-elegant-gap, 14px) !important;
  padding:
    0
    0
    max(0px, env(safe-area-inset-bottom, 0px))
    0 !important;
  pointer-events: none !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui .client-premium-center-cta > *,
body.joy-assistant-active.joy-assistant-client-preview #clientPage.client-premium-ui .client-premium-bottom-dock > * {
  pointer-events: auto !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) .client-fab-bar,
body.joy-assistant-active.joy-assistant-client-preview #clientPage:not(.template-custom) .client-premium-fab-bar {
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-premium-stage,
body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-premium-bottom-dock,
body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-fab-bar,
body.joy-assistant-active.joy-assistant-client-preview #clientPage .client-fab-bar button,
body.joy-assistant-active.joy-assistant-client-preview #clientPage .location-menu-btn,
body.joy-assistant-active.joy-assistant-client-preview #clientPage #feedbackBtn,
body.joy-assistant-active.joy-assistant-client-preview #clientPage [data-joy-config-module],
body.joy-assistant-active.joy-assistant-client-preview #clientPage .joy-preview-config-target {
  pointer-events: auto;
  cursor: pointer;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage #playBtn,
body.joy-assistant-active.joy-assistant-client-preview #clientPage #clientLoyaltyCenterBtn {
  pointer-events: none;
}

body.joy-assistant-active .client-interface-module-popup.active {
  z-index: 12000;
  pointer-events: auto;
}

/* ===== Build mode pe designul Custom — pagina se construiește live ===== */

/* Custom își face singur layout-ul: fixed fullscreen, fără padding-ul generic Joy */
body.joy-assistant-active.joy-assistant-client-preview #clientPage.page.template-custom {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Custom ascunde bgContainer doar cu .visible pe clientPage — replicăm pentru Joy */
body.joy-assistant-active.joy-assistant-client-preview:has(#clientPage.template-custom) #bgContainer {
  display: none !important;
  visibility: hidden !important;
}

/* Cardul de creștere e doar vizual în preview */
body.joy-assistant-active.joy-assistant-client-preview #clientPage.template-custom #clientConnectCampaignCard {
  pointer-events: none !important;
}

/* Apariție progresivă a elementelor adăugate */
body.joy-assistant-active #clientPage .joy-appear {
  animation: joyElementAppear 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes joyElementAppear {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Mască build mode: atributul data-joy-mask câștigă chiar dacă sync-urile
   temei curăță stilurile inline (backstop CSS pentru joyHide/joyShow).
   ID-ul e triplat intenționat: temele folosesc selectori cu 2 ID-uri
   (#clientPage… #element) cu !important — masca trebuie să bată tot. */
#clientPage#clientPage#clientPage[data-joy-build] [data-joy-mask='hide'] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Butoanele social sunt reconstruite de sync-ul temei — în build mode apar
   doar cele marcate explicit de mască */
#clientPage#clientPage#clientPage[data-joy-build]
  #clientTemplateSocialRow
  .client-template-header__social-btn:not([data-joy-mask='show']) {
  display: none !important;
}

/* Stare goală: headerul stă ascuns — numele estompat ține locul brandului */
#clientPage#clientPage#clientPage[data-joy-build].joy-preview-empty #clientTemplateHeader {
  display: none !important;
}

/* Header în build mode: stilul Custom (brand + social peste hero), indiferent
   dacă un ciclu restore al temei a scos clasa .client-custom-top-chrome */
#clientPage#clientPage#clientPage[data-joy-build].template-custom:not(.joy-preview-empty)
  #clientTemplateHeader {
  position: fixed !important;
  top: auto !important;
  bottom: calc(var(--tpl-custom-bottom-stack, 150px) + var(--tpl-custom-header-gap, 8px)) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 18 !important;
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  min-height: var(--tpl-custom-header-h, 48px);
  padding: 10px var(--tpl-custom-pad-x, 16px) 6px;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.65) 40%,
    rgba(0, 0, 0, 0.2) 75%,
    transparent 100%
  ) !important;
}

/* Stare goală: gradient închis pe tot ecranul + numele firmei estompat */
body.joy-assistant-active.joy-assistant-client-preview
  #clientPage.template-custom.joy-preview-empty
  #clientConnectSlideshow {
  height: calc(100dvh - env(safe-area-inset-top, 0px)) !important;
}

body.joy-assistant-active.joy-assistant-client-preview
  #clientPage.template-custom.joy-preview-empty
  #clientConnectSlideshow
  .client-connect-slideshow__viewport {
  background: linear-gradient(165deg, #1c1c26 0%, #101017 55%, #07070b 100%) !important;
  border-color: rgba(212, 175, 55, 0.1) !important;
  border-radius: 0 !important;
}

.joy-empty-stage-brand {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 17dvh);
  transform: translateX(-50%);
  z-index: 11;
  max-width: 86vw;
  font-size: clamp(1.5rem, 7.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgba(255, 255, 255, 0.22);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: joyEmptyBrandIn 0.8s ease;
}

.joy-empty-stage-brand[hidden] {
  display: none;
}

@keyframes joyEmptyBrandIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Logo lângă numele firmei (build mode — Custom nu are logo propriu) */
.joy-custom-header-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin-right: 8px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.4);
  vertical-align: middle;
}

.joy-custom-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.joy-custom-header-logo__ph {
  font-size: 17px;
  line-height: 1;
}

body.joy-assistant-active.joy-assistant-client-preview #clientPage [data-joy-config-module] {
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.65);
}

#joyAssistantPage .joy-assistant-shell {
  position: relative;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Logo stânga + social dreapta — strat Joy (deasupra preview client) */
.joy-preview-top-chrome {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: calc(env(safe-area-inset-left, 0px) + 14px);
  right: calc(env(safe-area-inset-right, 0px) + 14px);
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.joy-preview-top-chrome__logo,
.joy-preview-top-chrome__social {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.joy-preview-top-chrome__logo-img,
.joy-preview-top-chrome__logo-ph {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 16px;
  object-fit: contain;
  box-sizing: border-box;
  border: 1px solid rgba(212, 175, 90, 0.55);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.joy-preview-top-chrome__logo-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.joy-preview-top-chrome__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  flex-shrink: 0;
}

.joy-preview-top-chrome__social-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.joy-preview-top-chrome__social-btn--facebook {
  background: #1877f2;
  border-color: rgba(120, 190, 255, 0.45);
}

.joy-preview-top-chrome__social-btn--instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  border-color: rgba(255, 180, 220, 0.45);
}

.joy-preview-top-chrome__social-btn--tiktok {
  background: #010101;
  border-color: rgba(255, 255, 255, 0.35);
}

#joyAssistantPage .joy-assistant-progress--sr,
#joyAssistantPage .joy-assistant-progress-bar--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#joyAssistantPage .joy-assistant-topbar__center {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

#joyAssistantPage .joy-assistant-back {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

#joyAssistantPage .joy-assistant-topbar h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

#joyAssistantPage .joy-assistant-progress {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #86efac;
}

#joyAssistantPage .joy-assistant-progress-track {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 32;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

#joyAssistantPage .joy-assistant-progress-bar {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.25s ease;
}

#joyAssistantPage .joy-assistant-scene {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

#joyAssistantPage .joy-assistant-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #1f2937 0%, #0f172a 55%, #020617 100%) center / cover no-repeat;
  transition: background-image 0.8s ease;
}

#joyAssistantPage .joy-assistant-bg.has-image {
  background-size: cover;
  background-position: center;
}

#joyAssistantPage .joy-assistant-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.12) 30%,
    rgba(0, 0, 0, 0.5) 65%,
    rgba(0, 0, 0, 0.95) 100%
  );
  pointer-events: none;
}

#joyAssistantPage .joy-assistant-brand-row {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

#joyAssistantPage .joy-assistant-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

#joyAssistantPage .joy-assistant-bg-brand {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

#joyAssistantPage .joy-assistant-promo-preview {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 108px;
  z-index: 11;
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 10, 12, 0.78);
  backdrop-filter: blur(10px);
  pointer-events: none;
  animation: joyDockIn 0.35s ease;
}

#joyAssistantPage .joy-assistant-promo-preview__img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

#joyAssistantPage .joy-assistant-promo-preview__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#joyAssistantPage .joy-assistant-promo-preview__title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

#joyAssistantPage .joy-assistant-promo-preview__text {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

#joyAssistantPage .joy-assistant-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

#joyAssistantPage .joy-assistant-dock__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

#joyAssistantPage .joy-assistant-dock__row:empty {
  display: none;
}

#joyAssistantPage .joy-assistant-dock-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(8, 10, 12, 0.72);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  animation: joyDockIn 0.35s ease;
}

#joyAssistantPage .joy-assistant-dock-fab__icon {
  font-size: 15px;
  line-height: 1;
}

@keyframes joyDockIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Robot + card dialog — mijlocul zonei libere (ca în Mod Client) */
#joyAssistantPage .joy-assistant-center {
  position: fixed;
  left: 50%;
  top: calc(
    var(--joy-top-chrome) +
    (100dvh - var(--joy-top-chrome) - var(--joy-client-reserve)) * 0.48
  );
  transform: translate(-50%, -50%);
  z-index: 29;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(calc(100vw - 24px), 288px);
  max-width: 520px;
  pointer-events: none;
}

#joyAssistantPage .joy-assistant-card {
  width: 100%;
  max-height: var(--joy-card-max-h);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: rgba(10, 14, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  pointer-events: auto;
}

#joyAssistantPage.joy-intro-only .joy-assistant-card {
  max-height: none;
}

#joyAssistantPage.joy-has-card-body .joy-assistant-card {
  max-height: var(--joy-card-actions-max-h);
}

#joyAssistantPage.joy-checklist-step .joy-assistant-card {
  max-height: min(56vh, 400px);
}

#joyAssistantPage.joy-checklist-step .joy-assistant-card__body {
  overflow-y: visible;
  padding-bottom: 8px;
}

#joyAssistantPage .joy-assistant-popover {
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 12px 14px 8px;
}

#joyAssistantPage .joy-assistant-popover::before {
  display: none;
}

#joyAssistantPage .joy-assistant-card__body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 6px;
}

#joyAssistantPage .joy-assistant-card__body:empty {
  display: none;
  padding: 0;
}

#joyAssistantPage .joy-assistant-card__nav {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

#joyAssistantPage .joy-assistant-robot {
  position: relative;
  flex-shrink: 0;
  width: 58px;
  height: 76px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  animation: joyRobotFloat 3.2s ease-in-out infinite;
}

@keyframes joyRobotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

#joyAssistantPage .joy-assistant-robot__antenna {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 10px;
  margin-left: -1.5px;
  background: #4ade80;
  border-radius: 2px;
}

#joyAssistantPage .joy-assistant-robot__antenna::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

#joyAssistantPage .joy-assistant-robot__head {
  position: absolute;
  top: 12px;
  left: 6px;
  width: 52px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(145deg, #e2e8f0, #94a3b8);
  border: 2px solid #64748b;
}

#joyAssistantPage .joy-assistant-robot__eye {
  position: absolute;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f172a;
}

#joyAssistantPage .joy-assistant-robot__eye--l { left: 9px; }
#joyAssistantPage .joy-assistant-robot__eye--r { right: 9px; }

#joyAssistantPage .joy-assistant-robot__mouth {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 14px;
  height: 5px;
  margin-left: -7px;
  border-radius: 0 0 10px 10px;
  background: #334155;
}

#joyAssistantPage .joy-assistant-robot__body {
  position: absolute;
  bottom: 0;
  left: 14px;
  width: 36px;
  height: 24px;
  border-radius: 12px 12px 10px 10px;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  border: 2px solid #15803d;
}

#joyAssistantPage .joy-assistant-popover--enter {
  animation: joyPopoverIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes joyPopoverIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#joyAssistantPage .joy-assistant-popover__step {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86efac;
}

#joyAssistantPage .joy-assistant-popover__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
}

#joyAssistantPage .joy-assistant-popover__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.82);
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-panel-box {
  background: rgba(10, 14, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 10px;
  color: #f8fafc;
  backdrop-filter: blur(12px);
}

#joyAssistantPage .joy-assistant-panel-box {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 14px;
  padding: 12px;
  color: #111;
}

#joyAssistantPage .joy-assistant-upload__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-upload__head {
  color: rgba(248, 250, 252, 0.9);
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-fieldset {
  margin-top: 6px;
  border: none;
  padding: 0;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-fieldset legend {
  font-size: 11px;
  color: rgba(248, 250, 252, 0.7);
  margin-bottom: 4px;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-pill {
  padding: 5px 9px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e7eb;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-pill.is-active {
  background: rgba(34, 197, 94, 0.25);
  border-color: #4ade80;
  color: #bbf7d0;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-check {
  color: #f3f4f6;
  padding: 6px 4px;
  font-size: 12px;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-checklist--grid .joy-assistant-check {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 4px;
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-checklist--grid .joy-assistant-check:has(input:checked) {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(34, 197, 94, 0.12);
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-checklist--grid .joy-assistant-check input {
  width: 14px;
  height: 14px;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-checklist--grid .joy-assistant-check__icon {
  width: auto;
  font-size: 18px;
  line-height: 1;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-check:hover {
  background: rgba(255, 255, 255, 0.06);
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-add-btn {
  padding: 9px;
  font-size: 13px;
}

#joyAssistantPage .joy-assistant-card__body .joy-assistant-thumb-grid {
  margin-top: 6px;
}

#joyAssistantPage .joy-assistant-add-btn,
#joyAssistantPage .joy-assistant-nav-next {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.28);
}

#joyAssistantPage .joy-assistant-add-btn {
  width: 100%;
}

#joyAssistantPage .joy-assistant-add-btn:disabled,
#joyAssistantPage .joy-assistant-nav-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

#joyAssistantPage .joy-assistant-secondary-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#joyAssistantPage .joy-assistant-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

#joyAssistantPage .joy-assistant-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#joyAssistantPage .joy-assistant-thumb__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-fieldset {
  margin: 12px 0 0;
  padding: 0;
  border: none;
}

#joyAssistantPage .joy-assistant-fieldset legend {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
  padding: 0;
}

#joyAssistantPage .joy-assistant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#joyAssistantPage .joy-assistant-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-pill.is-active {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

#joyAssistantPage .joy-assistant-checklist:not(.joy-assistant-checklist--grid) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#joyAssistantPage .joy-assistant-checklist.joy-assistant-checklist--grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#joyAssistantPage .joy-assistant-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-check:hover {
  background: #f3f4f6;
}

#joyAssistantPage .joy-assistant-check input {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
  flex-shrink: 0;
}

#joyAssistantPage .joy-assistant-check__icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

#joyAssistantPage .joy-assistant-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#joyAssistantPage .joy-assistant-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#joyAssistantPage .joy-assistant-field > span {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

#joyAssistantPage .joy-assistant-field input,
#joyAssistantPage .joy-assistant-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

#joyAssistantPage .joy-assistant-section-img-preview {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
}

#joyAssistantPage .joy-assistant-section-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#joyAssistantPage .joy-assistant-growth-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

#joyAssistantPage .joy-assistant-panel-box--growth {
  padding: 6px;
}

#joyAssistantPage .joy-assistant-growth-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  font-size: 11px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-growth-pick.is-active {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

#joyAssistantPage .joy-assistant-growth-pick__icon {
  font-size: 18px;
  line-height: 1;
}

#joyAssistantPage .joy-assistant-card__nav {
  display: flex;
  gap: 8px;
}

#joyAssistantPage .joy-assistant-nav-back {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(8, 10, 12, 0.7);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

#joyAssistantPage .joy-assistant-nav-back:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#joyAssistantPage .joy-assistant-nav-next {
  flex: 1.4;
}

.joy-assistant-entry-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 32px);
  max-width: 520px;
  margin: 0 auto 16px;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.32);
}

@media (max-width: 480px) {
  #joyAssistantPage.page {
    --joy-card-max-h: min(36vh, 260px);
  }

  #joyAssistantPage .joy-assistant-center {
    width: min(calc(100vw - 20px), 280px);
    gap: 6px;
  }

  #joyAssistantPage .joy-assistant-robot {
    width: 50px;
    height: 66px;
  }

  #joyAssistantPage .joy-assistant-popover {
    padding: 10px 12px 6px;
  }

  #joyAssistantPage .joy-assistant-popover__title {
    font-size: 0.92rem;
  }

  #joyAssistantPage .joy-assistant-popover__hint {
    font-size: 11px;
  }

  #joyAssistantPage .joy-assistant-card__nav {
    padding: 6px 8px 8px;
  }

  #joyAssistantPage .joy-assistant-nav-back,
  #joyAssistantPage .joy-assistant-nav-next {
    padding: 9px;
    font-size: 13px;
  }
}
