:root {
  color-scheme: light;
}

html,
body {
  background: #ffffff !important;
}

body {
  background-color: #ffffff !important;
}

/* App header: center logo (no FaceIQ text) */
#appHead.app-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#appHead .brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

#appHead .app-visage-wordmark {
  font-family: Sora, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #111827;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
}

#appHead #engineBadge.engine-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.bg-glow,
.bg-glow-a,
.bg-glow-b {
  display: none !important;
}

body.is-result-mode {
  background: #ffffff !important;
}

body.is-home-mode,
body.is-flow-stage,
body.is-gender-stage,
body.is-upload-stage,
body.is-points-stage {
  background: #ffffff !important;
}

/* Make the app feel like one full-screen page (no "window in window") */
body.is-home-mode .app-shell,
body.is-flow-stage .app-shell,
body.is-result-mode .app-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.is-flow-stage #mainCard,
body.is-result-mode #mainCard {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #ffffff !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Upload: keep pure white behind photo (no bluish tint) */
body.is-upload-stage #uploadZone,
body.is-upload-stage #uploadPlaceholder {
  background: #ffffff !important;
}

body.is-upload-stage #uploadPlaceholder,
body.is-upload-stage .upload-placeholder {
  border: 0 !important;
  box-shadow: none !important;
}

#uploadZone.is-busy {
  cursor: wait !important;
}

.upload-busy-state {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
  padding: 16px;
}

.upload-busy-state[hidden] {
  display: none !important;
}

.upload-busy-spinner {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.upload-busy-title {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.upload-busy-text {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 11px;
  color: rgba(17, 24, 39, 0.66);
}

/* Home: tighten spacing for New Scan / Partnership */
body.is-home-mode .hub-shell {
  background: #ffffff !important;
}

/* History empty: no dashed border / no circle, more compact */
.hub-history-empty {
  min-height: 0 !important;
  margin-top: 12px !important;
  padding: 16px !important;
  border-style: solid !important;
  background: #ffffff !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 6px !important;
}

.hub-history-empty-icon {
  display: none !important;
}

.hub-history-start-btn {
  align-self: flex-start !important;
  margin-top: 8px !important;
}

@media (max-width: 520px) {
  body.is-home-mode .hub-body {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 14px !important;
  }

  body.is-home-mode .hub-grid {
    gap: 8px !important;
    max-width: none !important;
  }
}

/* Flow: remove bluish/grey panels behind canvases */
body.is-points-stage #referenceStage,
body.is-points-stage #placementStage {
  background: #ffffff !important;
}

body.is-flow-stage {
  background: #ffffff !important;
}

body.is-flow-stage .bg-glow {
  display: none !important;
}

body.is-flow-stage .app-shell,
body.is-flow-stage #mainCard,
body.is-flow-stage #screenUpload,
body.is-flow-stage #screenPoints,
body.is-flow-stage #screenGender {
  background: #ffffff !important;
}

body.is-telegram-miniapp,
body.is-telegram-miniapp .app-shell,
body.is-telegram-miniapp #screenHome,
body.is-telegram-miniapp #screenGender,
body.is-telegram-miniapp #screenUpload,
body.is-telegram-miniapp #screenPoints,
body.is-telegram-miniapp #screenResult {
  min-height: var(--app-screen-height, 100dvh) !important;
}

html,
body.is-telegram-miniapp {
  background: #ffffff !important;
  overscroll-behavior: none !important;
}

body.is-telegram-miniapp .app-shell {
  height: var(--app-screen-height, 100dvh) !important;
  min-height: var(--app-screen-height, 100dvh) !important;
  overflow: hidden !important;
  touch-action: manipulation !important;
}

body.is-telegram-miniapp.is-home-mode .app-shell {
  height: var(--app-screen-height, 100dvh) !important;
  min-height: var(--app-screen-height, 100dvh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.is-telegram-miniapp.is-home-mode #screenHome,
body.is-telegram-miniapp.is-home-mode .home-screen {
  height: auto !important;
  min-height: 100% !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
}

body.is-telegram-miniapp.is-home-mode .hub-shell {
  min-height: 100% !important;
}

body.is-telegram-miniapp.is-home-mode .hub-body {
  padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px)) !important;
}

body.is-telegram-miniapp #screenGender > .fixed,
body.is-telegram-miniapp #screenUpload > .fixed,
body.is-telegram-miniapp #screenPoints > .fixed {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--app-screen-height, 100dvh) !important;
  min-height: var(--app-screen-height, 100dvh) !important;
  overflow: hidden !important;
  transform: none !important;
  contain: layout paint style !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

body.is-telegram-miniapp #screenPoints > .fixed > div {
  height: 100% !important;
}

body.is-telegram-miniapp .screen,
body.is-telegram-miniapp .screen.is-active,
body.is-telegram-miniapp #mainCard,
body.is-telegram-miniapp .card {
  transform: none !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Points: reserve space for 2 lines of hint text (no layout jump) */
body.is-points-stage #pointHint {
  line-height: 1.25 !important;
  min-height: 2.5em;
}

/* Result top tabs: match FaceIQ reference (small pills, only active has bg) */
body.is-result-mode .fiq-ref-tabs .fiq-link-pill {
  min-height: 0 !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  background: transparent !important;
  color: #9ca3af !important;
  border: 0 !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

body.is-result-mode .fiq-ref-tabs .fiq-link-pill:hover {
  color: #374151 !important;
}

body.is-result-mode .fiq-ref-tabs .fiq-link-pill.is-active,
body.is-result-mode .fiq-ref-tabs .fiq-link-pill[aria-current="page"] {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

body.is-result-mode #resultModeStrip.is-pillar-summary {
  gap: 0 !important;
}

body.is-result-mode #resultModeStrip.is-pillar-summary #resultFrontCard {
  width: 100% !important;
  min-width: 0 !important;
  cursor: default !important;
}

body.is-result-mode #resultModeStrip.is-pillar-summary #resultSideCard {
  display: none !important;
}

body.is-result-mode #resultModeStrip.is-pillar-summary .fiq-mode-copy {
  min-width: 0;
}

body.is-result-mode #resultModeStrip.is-pillar-summary .fiq-mode-copy strong {
  color: #6b7383 !important;
}

/* Result header: collapse brand bar on scroll, keep menu pinned */
body.is-result-mode {
  --fiq-ref-header-h: 44px;
  --fiq-ref-subheader-h: 40px;
}

body.is-result-mode.fiq-header-collapsed {
  --fiq-ref-header-h: 0px;
}

/* Result screen: remove transform from fade animation so fixed header works */
body.is-result-mode #screenResult {
  animation: none !important;
  transform: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

body.is-result-mode .fiq-ref-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 320;
  height: var(--fiq-ref-header-h) !important;
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
  width: 100vw !important;
  display: block !important;
  visibility: visible !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    height 0.22s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
}

body.is-result-mode .fiq-ref-header-inner {
  position: relative;
}

body.is-result-mode .fiq-ref-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  pointer-events: none;
}

body.is-result-mode .fiq-ref-wordmark {
  font-family: Sora, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #111827;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
}

body.is-result-mode.fiq-header-collapsed .fiq-ref-header {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  border-bottom-color: transparent !important;
}

body.is-result-mode .fiq-ref-subheader {
  position: fixed !important;
  left: 0;
  right: 0;
  z-index: 319;
  top: var(--fiq-ref-header-h) !important;
  width: 100vw !important;
  display: block !important;
  visibility: visible !important;
  background: rgba(255, 255, 255, 0.985) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  transform: translateZ(0);
  transition: top 0.22s ease;
}

body.is-telegram-miniapp.is-result-mode .fiq-ref-header,
body.is-telegram-miniapp.is-result-mode .fiq-ref-subheader {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.995) !important;
  transition: none !important;
}

body.is-telegram-miniapp.is-result-mode .fiq-ref-bars-spacer {
  transition: none !important;
}

body.is-telegram-miniapp.is-result-mode .result-hero,
body.is-telegram-miniapp.is-result-mode #resultCanvas,
body.is-telegram-miniapp.is-result-mode .hero-overlay {
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.is-telegram-miniapp.is-result-mode .fiq-topbar,
body.is-telegram-miniapp.is-result-mode .fiq-main-tabs {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #ffffff !important;
}

body.is-telegram-miniapp.is-result-mode .fiq-topbar,
body.is-telegram-miniapp.is-result-mode .fiq-main-tabs {
  position: relative !important;
  top: auto !important;
}

body.is-telegram-miniapp.is-result-mode .screen {
  animation: none !important;
}

body.is-telegram-miniapp.is-result-mode .metric-row {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.is-telegram-miniapp.is-result-mode #resultCanvas {
  background: #dbe4ee !important;
}

/* iOS/Telegram WebView: avoid scroll flicker and jump caused by content-visibility/contain */
body.is-telegram-miniapp.is-result-mode .metrics-block,
body.is-telegram-miniapp.is-result-mode .metric-info-card,
body.is-telegram-miniapp.is-result-mode .metric-row,
body.is-telegram-miniapp.is-result-mode .metrics-head,
body.is-telegram-miniapp.is-result-mode #metricsList,
body.is-telegram-miniapp.is-result-mode .metrics-list,
body.is-telegram-miniapp.is-result-mode .fiq-ref-header-inner,
body.is-telegram-miniapp.is-result-mode .fiq-ref-subheader-inner {
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
}

body.is-telegram-miniapp.is-result-mode .result-hero,
body.is-telegram-miniapp.is-result-mode .metrics-block,
body.is-telegram-miniapp.is-result-mode .metric-row,
body.is-telegram-miniapp.is-result-mode .metrics-head,
body.is-telegram-miniapp.is-result-mode #metricsList,
body.is-telegram-miniapp.is-result-mode .metrics-list,
body.is-telegram-miniapp.is-result-mode .fiq-ref-header-inner,
body.is-telegram-miniapp.is-result-mode .fiq-ref-subheader-inner {
  contain: none !important;
}

body.is-telegram-miniapp.is-result-mode .metrics-head,
body.is-telegram-miniapp.is-result-mode #metricsList,
body.is-telegram-miniapp.is-result-mode .metrics-list,
body.is-telegram-miniapp.is-result-mode .fiq-ref-header-inner,
body.is-telegram-miniapp.is-result-mode .fiq-ref-subheader-inner {
  transform: translateZ(0);
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  background: #fff !important;
}

body.is-telegram-miniapp.is-result-mode .result-hero::before,
body.is-telegram-miniapp.is-result-mode .result-hero::after {
  animation: none !important;
}

body.is-result-mode .app-shell,
body.is-result-mode .fiq-ref-header-inner,
body.is-result-mode .fiq-ref-subheader-inner,
body.is-result-mode .fiq-ref-bars-spacer {
  overflow: visible !important;
}

body.is-result-mode .fiq-ref-subheader-inner {
  position: relative;
  z-index: 2;
}

body.is-result-mode .fiq-ref-bars-spacer {
  height: calc(var(--fiq-ref-header-h) + var(--fiq-ref-subheader-h)) !important;
  transition: height 0.22s ease;
}

/* Unlock button: centered on its own line (mobile) */
body.is-result-mode .metrics-unlock-btn {
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
}

body.is-result-mode .metrics-cta.is-primary-centered {
  justify-content: center !important;
  width: 100%;
}

body.is-result-mode .metrics-cta.is-primary-centered #downloadResultBtn,
body.is-result-mode .metrics-cta.is-primary-centered #unlockAllMetricsBtn,
body.is-result-mode .metrics-cta.is-primary-centered #overviewChartUnlockBtn {
  margin-inline: auto;
  min-width: 220px;
  justify-content: center;
  text-align: center;
}

#pillarStartAnalysisBtn {
  display: inline-flex;
  margin-inline: auto;
  min-width: 220px;
  justify-content: center;
  text-align: center;
}

@media (max-width: 760px) {
  body.is-result-mode .metrics-cta {
    flex-wrap: wrap;
  }

  body.is-result-mode .metrics-cta.is-primary-centered #downloadResultBtn,
  body.is-result-mode .metrics-cta.is-primary-centered #unlockAllMetricsBtn,
  body.is-result-mode .metrics-cta.is-primary-centered #overviewChartUnlockBtn,
  #pillarStartAnalysisBtn {
    flex: 1 1 100%;
    max-width: 280px;
  }

  body.is-result-mode .metrics-unlock-btn {
    order: 50;
    flex: 1 1 100%;
    max-width: 260px;
    margin: 10px auto 0;
    text-align: center;
    font-size: 11px !important;
  }
}

/* FaceGPT as a Result tab (not a modal overlay) */
body.is-result-mode.is-facegpt-tab #faceGptModal.facegpt-modal {
  position: relative !important;
  inset: auto !important;
  z-index: 5 !important;
  display: block !important;
  padding: 0 !important;
  animation: none !important;
}

body.is-result-mode.is-facegpt-tab {
  overflow: hidden !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-backdrop {
  display: none !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-panel {
  position: relative !important;
  width: 100% !important;
  height: calc(100dvh - (var(--fiq-ref-header-h) + var(--fiq-ref-subheader-h))) !important;
  min-height: calc(100dvh - (var(--fiq-ref-header-h) + var(--fiq-ref-subheader-h))) !important;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 12px !important;
  display: flex !important;
  flex-direction: column !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-close {
  display: none !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-head {
  border-bottom: 0 !important;
  padding: 8px 12px 6px !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-head h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-meta {
  font-size: 12px !important;
  color: rgba(107, 114, 128, 0.9) !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-messages {
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 12px 16px !important;
  gap: 16px !important;
  max-width: 880px !important;
  margin: 0 auto !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-bottom {
  position: relative !important;
  bottom: auto !important;
  background: #ffffff !important;
  padding: 10px 0 16px !important;
  margin-top: auto !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-input-wrap {
  width: 100% !important;
  max-width: 880px !important;
  margin: 0 auto !important;
  background: rgb(243, 244, 246) !important;
  border-radius: 24px !important; /* rounded-3xl */
  padding: 12px !important;
  display: flex !important;
  align-items: flex-end !important;
  gap: 8px !important;
  overflow: hidden !important;
  border-top: 0 !important;
  grid-template-columns: none !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-tool-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 999px !important;
  border: 1px solid rgb(209, 213, 219) !important;
  background: transparent !important;
  color: rgb(107, 114, 128) !important;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-tool-btn:hover {
  background: rgb(229, 231, 235);
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-mode-btn {
  height: 32px !important;
  border-radius: 999px !important;
  border: 1px solid rgb(209, 213, 219) !important;
  background: transparent !important;
  color: rgb(107, 114, 128) !important;
  padding: 0 10px !important;
  gap: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-mode-btn:hover {
  background: rgb(229, 231, 235);
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-input {
  border: 0 !important;
  background: transparent !important;
  padding: 10px 8px !important;
  min-height: 40px !important;
  max-height: 150px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-send {
  min-width: 36px !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgb(17, 24, 39) !important;
  display: grid !important;
  place-items: center !important;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-send:hover:not(:disabled) {
  background: rgb(31, 41, 55);
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-send:disabled {
  background: rgb(229, 231, 235) !important;
  opacity: 1;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-send svg {
  width: 18px !important;
  height: 18px !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-send:disabled svg {
  color: rgb(156, 163, 175);
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-prompts {
  display: none !important;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-avatar {
  display: none !important;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-model-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  margin: 8px auto 0 !important;
  width: fit-content !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: rgb(156, 163, 175) !important;
  transition: color 0.18s ease;
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-model-btn:hover {
  color: rgb(75, 85, 99);
}

body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-model-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.85;
}

/* FaceGPT message styles (FaceIQ Advanced reference) */
body.is-result-mode.is-facegpt-tab .fiq-chat-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-row-user {
  justify-content: flex-end;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-col {
  min-width: 0;
  max-width: 100%;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-row-user .fiq-chat-col {
  max-width: 90%;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-bubble {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 16px; /* rounded-2xl */
  overflow-wrap: break-word;
  word-break: break-word;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-bubble-user {
  color: #ffffff;
  border-top-right-radius: 2px; /* rounded-tr-sm */
  background: linear-gradient(135deg, rgb(90, 106, 117) 0%, rgb(114, 131, 140) 100%);
  box-shadow: rgba(90, 106, 117, 0.25) 0 2px 8px;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-bubble-assistant {
  background: rgb(243, 244, 246);
  color: rgb(17, 24, 39);
  border-top-left-radius: 2px; /* rounded-tl-sm */
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text {
  font-size: 13px;
  color: inherit;
  overflow: hidden;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text p {
  margin: 10px 0;
  white-space: pre-wrap;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text p:first-child {
  margin-top: 0;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text p:last-child {
  margin-bottom: 0;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text ul {
  margin: 10px 0;
  padding-left: 16px;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text li {
  margin: 0;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text li + li {
  margin-top: 6px;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text-user {
  line-height: 1.625; /* leading-relaxed */
}

body.is-result-mode.is-facegpt-tab .fiq-chat-text-assistant {
  line-height: 1.75;
  color: rgb(31, 41, 55); /* gray-800 */
}

body.is-result-mode.is-facegpt-tab .fiq-chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-meta-user {
  justify-content: flex-end;
}

body.is-result-mode.is-facegpt-tab .fiq-chat-time {
  font-size: 12px;
  color: rgb(156, 163, 175);
}

@media (min-width: 640px) {
  body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-panel {
    padding: 0 24px !important;
  }

  body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-messages {
    padding: 24px 24px 24px !important;
    gap: 24px !important;
  }

  body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-bottom {
    padding-bottom: 24px !important;
  }

  body.is-result-mode.is-facegpt-tab #faceGptModal .facegpt-input-wrap {
    padding: 16px !important;
    gap: 12px !important;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-bubble {
    padding: 12px 16px;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-text {
    font-size: 15px;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-text-assistant {
    line-height: 1.85;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-text p {
    margin: 12px 0;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-text ul {
    margin: 12px 0;
  }

  body.is-result-mode.is-facegpt-tab .fiq-chat-text ul {
    padding-left: 20px;
  }
}

/* Paywall modal */
.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: block;
  pointer-events: auto;
}

.paywall-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.paywall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 14, 24, 0.72);
  backdrop-filter: blur(8px);
}

.paywall-panel {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(13, 23, 37, 0.34);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.paywall-head {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.96);
  background: #ffffff;
  text-align: center;
}

.paywall-head-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.paywall-brand {
  font-family: Sora, Manrope, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: #111827;
  text-transform: lowercase;
}

.paywall-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

.paywall-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: rgb(156, 163, 175);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.paywall-close:hover {
  background: rgba(243, 244, 246, 0.95);
  color: rgb(107, 114, 128);
}

.paywall-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paywall-body {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paywall-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgb(107, 114, 128);
}

.paywall-cards {
  display: grid;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
  flex: 1 1 auto;
  align-content: start;
}

.paywall-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(229, 231, 235, 1);
  background: #ffffff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  min-height: 0;
}

.paywall-card:hover {
  border-color: rgba(165, 180, 252, 0.72);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.paywall-card.is-selected {
  border-color: rgba(99, 102, 241, 0.78);
  box-shadow: 0 18px 42px rgba(99, 102, 241, 0.16);
  transform: translateY(-1px);
}

.paywall-card.is-current {
  border-color: rgba(17, 24, 39, 0.18);
}

.paywall-card-pro {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.12);
}

.paywall-plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.paywall-plan-badge-accent {
  background: rgb(79, 70, 229);
}

.paywall-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 14px 12px;
}

.paywall-card-name {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.paywall-card-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.paywall-card-price-main {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #111827;
}

.paywall-card-price-sub {
  font-size: 11px;
  color: rgb(156, 163, 175);
}

.paywall-card-action {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.paywall-card-action:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
}

.paywall-card-action:disabled {
  background: rgb(243, 244, 246);
  color: rgb(156, 163, 175);
  cursor: not-allowed;
}

.paywall-card-action-accent {
  background: rgb(79, 70, 229);
}

.paywall-card-action-accent:hover:not(:disabled) {
  background: rgb(67, 56, 202);
}

.paywall-card-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(243, 244, 246, 1);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  flex: 1 1 auto;
}

.paywall-card-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.25;
  color: rgb(75, 85, 99);
  min-width: 0;
}

.paywall-card-check {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  flex-shrink: 0;
  position: relative;
}

.paywall-card-check::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(229, 231, 235, 0.9);
}

.paywall-card-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 7px;
  border-right: 1.75px solid rgb(107, 114, 128);
  border-bottom: 1.75px solid rgb(107, 114, 128);
  transform: rotate(40deg);
}

.paywall-card-pro .paywall-card-check::before,
.paywall-card.is-selected .paywall-card-check::before {
  background: rgba(224, 231, 255, 0.92);
}

.paywall-card-pro .paywall-card-check::after,
.paywall-card.is-selected .paywall-card-check::after {
  border-color: rgb(79, 70, 229);
}

.paywall-footnote {
  max-width: 860px;
  margin: 0 auto;
  padding-top: 10px;
  border-top: 1px solid rgba(229, 231, 235, 0.96);
  text-align: center;
  font-size: 10px;
  line-height: 1.35;
  color: rgb(107, 114, 128);
}

@media (min-width: 900px) {
  .paywall-body {
    padding: 28px 26px 30px;
  }

  .paywall-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .paywall-head {
    padding: 14px 14px 10px;
  }

  .paywall-brand {
    font-size: 16px;
  }

  .paywall-title {
    font-size: 17px;
  }

  .paywall-body {
    padding: 10px 10px 12px;
  }

  .paywall-card-inner {
    padding: 12px 12px 10px;
  }

  .paywall-card-price-main {
    font-size: 24px;
  }
}

@media (max-height: 820px) {
  .paywall-head {
    padding: 12px 14px 8px;
  }

  .paywall-subtitle {
    font-size: 11px;
  }

  .paywall-body {
    padding: 8px 10px 10px;
    gap: 8px;
  }

  .paywall-cards {
    gap: 8px;
  }

  .paywall-card-inner {
    padding: 10px 11px 9px;
  }

  .paywall-card-name {
    margin-bottom: 8px;
    font-size: 15px;
  }

  .paywall-card-price-wrap {
    margin-bottom: 8px;
  }

  .paywall-card-price-main {
    font-size: 22px;
  }

  .paywall-card-action {
    height: 34px;
    font-size: 12px;
  }

  .paywall-card-list {
    margin-top: 8px;
    padding-top: 8px;
    gap: 6px 10px;
  }

  .paywall-card-item {
    font-size: 11px;
    line-height: 1.2;
  }

  .paywall-footnote {
    padding-top: 8px;
    font-size: 9px;
  }
}

/* Cross-screen transition loader (prevents "old skin" flash) */
body.app-booting #appHead,
body.app-booting #mainCard > *:not(#transitionLoading),
body.transition-loading-active #appHead,
body.transition-loading-active #mainCard > *:not(#transitionLoading) {
  visibility: hidden !important;
}

body.app-booting #mainCard,
body.transition-loading-active #mainCard {
  background: transparent !important;
  box-shadow: none !important;
}

body.app-booting .bg-glow,
body.transition-loading-active .bg-glow {
  opacity: 0 !important;
}

.transition-loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.transition-loading[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.transition-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(280px, calc(100vw - 48px));
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.transition-loading-brand {
  display: none !important;
}

.transition-spinner {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 4px solid rgba(17, 24, 39, 0.18);
  border-top-color: #111827;
  border-right-color: #111827;
  animation: transitionSpin 0.9s linear infinite;
}

.transition-loading-text {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.025em;
  text-align: center;
}

.transition-loading-detail {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: rgba(107, 114, 128, 0.92);
  text-align: center;
}

.transition-loading-detail[hidden] {
  display: none !important;
}

.transition-loading-progress {
  display: none !important;
}

.transition-loading-progress[hidden] {
  display: none !important;
}

.transition-loading-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(209, 213, 219, 0.7);
}

.transition-loading-progress-bar {
  height: 100%;
  min-width: 4%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111827 0%, #334155 100%);
  transition: width 220ms ease;
}

.transition-loading-percent {
  display: none !important;
}

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

/* Support Tailwind arbitrary z-index used in saved FaceIQ layouts */
.z-\[70\] {
  z-index: 70 !important;
}

/* FaceIQ-like metric locks */
.metric-row {
  position: relative !important;
  overflow: hidden;
}

.metric-row .metric-row-blurable {
  transition:
    filter 0.32s ease,
    opacity 0.32s ease;
  will-change: filter, opacity;
  display: block;
}

.metric-row.is-locked .metric-row-blurable {
  filter: blur(5px);
  opacity: 0.78;
}

.metric-row.is-locked .bar::after,
.metric-row.is-locked .bar-fill::after {
  opacity: 0 !important;
  visibility: hidden !important;
}

.metric-row .metric-score-wrap,
.metric-row .metric-score,
.metric-row .metric-chevron {
  position: relative;
  z-index: 1;
}

.metric-row .metric-row-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  padding-right: 0;
  transform: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.metric-row.is-locked .metric-row-lock {
  opacity: 1;
  transform: none;
}

.metric-row-lock-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(35, 42, 48, 0.92);
  backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    rgba(0, 0, 0, 0.2) 0 4px 16px,
    rgba(0, 0, 0, 0.12) 0 2px 6px,
    rgba(255, 255, 255, 0.08) 0 1px 0 inset;
}

.metric-row-lock-icon svg {
  width: 12px;
  height: 12px;
}

.metric-row.is-unlocking .metric-row-lock-icon {
  animation: metricUnlockPop 0.32s cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes metricUnlockPop {
  0% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(0.95);
  }
}

.fiq-premium-score {
  display: inline-block;
  transition:
    color 0.42s linear,
    filter 0.28s ease,
    opacity 0.28s ease;
}

.fiq-premium-score.is-locked {
  filter: blur(5px);
  opacity: 0.9;
  text-shadow: none !important;
  user-select: none;
}

.fiq-lock-copy {
  filter: blur(5px);
  opacity: 0.9;
  user-select: none;
}

.fiq-lock-dynamic {
  transition:
    color 0.42s linear,
    filter 0.28s ease,
    opacity 0.28s ease;
}

body.score-reveal-frozen .hero-score,
body.score-reveal-frozen .hero-score-unit,
body.score-reveal-frozen .fiq-premium-score,
body.score-reveal-frozen .fiq-lock-dynamic {
  opacity: 0 !important;
}

.fiq-mode-thumb {
  transition:
    transform var(--fiq-thumb-flip-duration, 0.18s) ease,
    filter 0.18s ease,
    opacity 0.18s ease;
  will-change: transform;
}

#heroScoreBox.is-analysis-locked,
#overviewOverallCard.is-analysis-locked,
#overviewFrontCardBtn.is-analysis-locked,
#overviewSideCardBtn.is-analysis-locked,
#overviewChartCard.is-analysis-locked,
#hubLatestCard.is-analysis-locked,
.hub-history-item.is-analysis-locked,
button[data-overview-tab].is-analysis-locked {
  position: relative;
  cursor: pointer !important;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

#heroScoreBox.is-analysis-locked:hover,
#overviewOverallCard.is-analysis-locked:hover,
#overviewFrontCardBtn.is-analysis-locked:hover,
#overviewSideCardBtn.is-analysis-locked:hover,
#overviewChartCard.is-analysis-locked:hover,
#hubLatestCard.is-analysis-locked:hover,
.hub-history-item.is-analysis-locked:hover,
button[data-overview-tab].is-analysis-locked:hover {
  transform: translateY(-1px);
}

#overviewChartCard.is-analysis-locked #overviewDistributionCanvas {
  filter: blur(6px) saturate(0.96);
  opacity: 0.86;
  transform: scale(1.01);
  transform-origin: center;
}

#overviewChartCard.is-analysis-locked #overviewChartUnlockBtn {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-top: 0;
}

#resultModeStrip .fiq-mode-score.fiq-premium-score.is-locked {
  font-size: 18px !important;
  letter-spacing: 0.03em;
  filter: blur(5px);
  opacity: 0.96;
  color: var(--mode-score-color, currentColor) !important;
  -webkit-text-fill-color: var(--mode-score-color, currentColor) !important;
  text-shadow:
    rgba(255, 255, 255, 0.38) 0 0 8px,
    rgba(148, 163, 184, 0.32) 0 0 14px;
}

#resultHero .hero-score {
  font-size: clamp(24px, 3.4vw, 44px) !important;
  letter-spacing: -0.045em !important;
}

#resultHero .hero-score-unit {
  font-size: clamp(12px, 1.8vw, 22px) !important;
}

#resultHero .hero-grade {
  font-size: clamp(18px, 2.6vw, 34px) !important;
}

.hub-history-item.is-selectable {
  position: relative;
  padding-right: 52px;
}

.hub-history-item.is-selectable .hub-history-item-arrow {
  display: none;
}

.hub-history-item.is-selected {
  border-color: rgba(17, 24, 39, 0.22);
  background: rgba(243, 244, 246, 0.95);
}

.hub-history-item-check {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.hub-history-item-check.is-selected {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(17, 24, 39, 0.92);
  color: #ffffff;
}

.fiq-metric-point-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fiq-metric-point-chip {
  appearance: none;
  border: 1px solid rgba(74, 86, 96, 0.14);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.fiq-metric-point-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 45, 51, 0.22);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.fiq-metric-point-chip-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.fiq-metric-point-chip-label {
  font-size: 12px;
  font-weight: 700;
  color: rgb(28, 36, 41);
  line-height: 1.1;
}

.fiq-metric-point-chip-action {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(74, 86, 96, 0.62);
}

.fiq-point-edit-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  border-top: 1px solid rgba(245, 158, 11, 0.24);
  background: rgba(255, 251, 235, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 -6px 24px rgba(120, 53, 15, 0.12);
}

.fiq-point-edit-footer-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding-left: 14px;
}

.fiq-point-edit-footer-copy::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgb(245, 158, 11);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.fiq-point-edit-footer-title {
  font-size: 13px;
  font-weight: 800;
  color: rgb(146, 64, 14);
}

.fiq-point-edit-footer-hint {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(146, 64, 14, 0.74);
}

.fiq-point-edit-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fiq-point-edit-footer-btn {
  appearance: none;
  min-width: 88px;
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.fiq-point-edit-footer-btn:active {
  transform: translateY(1px);
}

.fiq-point-edit-footer-btn-secondary {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(180, 83, 9, 0.9);
}

.fiq-point-edit-footer-btn-primary {
  border: 1px solid rgba(180, 83, 9, 0.12);
  background: rgb(217, 119, 6);
  color: #ffffff;
}

#overviewChartUnlockBtn.metrics-unlock-btn,
#harmonyUnlockBtn.metrics-unlock-btn {
  width: auto;
  min-width: 190px;
  justify-content: center;
}

#downloadResultBtn.is-unlock-mode {
  color: #fff !important;
  background: rgba(35, 42, 48, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    rgba(0, 0, 0, 0.2) 0 4px 16px,
    rgba(0, 0, 0, 0.12) 0 2px 6px,
    rgba(255, 255, 255, 0.08) 0 1px 0 inset !important;
}

.fiq-overview-section-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  background: rgba(249, 250, 251, 0.72);
  text-align: left;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.fiq-overview-section-item:hover {
  background: rgba(249, 250, 251, 0.96);
  border-color: rgba(209, 213, 219, 1);
}

.fiq-overview-section-item[disabled] {
  opacity: 0.6;
  cursor: default;
}

.fiq-overview-section-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(17, 24, 39);
  color: rgb(255, 255, 255);
  font-size: 10px;
  font-weight: 700;
}

.fiq-overview-section-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.fiq-overview-section-title {
  font-size: 14px;
  font-weight: 600;
  color: rgb(17, 24, 39);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fiq-overview-section-meta {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
  color: rgb(156, 163, 175);
}

.fiq-overview-section-score-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.fiq-overview-section-score {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.fiq-overview-section-chevron {
  width: 16px;
  height: 16px;
  color: rgb(156, 163, 175);
}

/* Visually hidden (screen reader only) */
.fiq-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Options drawer (FaceIQ Options reference) */
.fiq-drawer {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: block;
  pointer-events: none;
}

.fiq-drawer[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.fiq-drawer.is-open {
  pointer-events: auto;
}

.fiq-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.fiq-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100vw;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
  transform: translateX(-10px);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 640px) {
  .fiq-drawer-panel {
    width: 280px;
  }
}

.fiq-drawer.is-open .fiq-drawer-backdrop {
  opacity: 1;
}

.fiq-drawer.is-open .fiq-drawer-panel {
  transform: translateX(0);
  opacity: 1;
}

.fiq-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.fiq-drawer-head-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.fiq-drawer-wordmark {
  font-family: Sora, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #111827;
  text-transform: lowercase;
  line-height: 1;
  white-space: nowrap;
}

.fiq-drawer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: rgb(17, 24, 39);
}

.fiq-drawer-brand-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.fiq-drawer-brand-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fiq-drawer-brand-slash {
  color: rgba(107, 114, 128, 0.75);
}

.fiq-drawer-brand-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(243, 244, 246, 0.9);
  color: rgba(55, 65, 81, 0.95);
  white-space: nowrap;
}

.fiq-drawer-close {
  appearance: none;
  border: 0;
  background: rgba(243, 244, 246, 0.9);
  color: rgba(75, 85, 99, 0.9);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.fiq-drawer-close:hover {
  background: rgba(229, 231, 235, 0.92);
  transform: translateY(-1px);
}

.fiq-drawer-profile,
.fiq-drawer-account {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.fiq-drawer-profile-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fiq-drawer-profile-col {
  flex: 1 1 auto;
  min-width: 0;
}

.fiq-drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.03));
  border: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.fiq-drawer-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fiq-drawer-avatar-fallback {
  font-size: 17px;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.72);
  line-height: 1;
}

.fiq-drawer-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: rgb(17, 24, 39);
}

.fiq-drawer-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.fiq-drawer-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  color: rgba(17, 24, 39, 0.78);
}

.fiq-drawer-badge-muted {
  background: rgba(243, 244, 246, 0.92);
  color: rgba(107, 114, 128, 0.95);
}

.fiq-drawer-upgrade {
  width: 100%;
  margin-top: 12px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgb(17, 24, 39);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
}

.fiq-drawer-history {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fiq-drawer-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fiq-drawer-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiq-drawer-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgb(17, 24, 39);
}

.fiq-drawer-new-btn {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(243, 244, 246, 0.92);
  color: rgba(17, 24, 39, 0.85);
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.fiq-drawer-new-btn:active {
  transform: translateY(1px);
}

.fiq-drawer-icon-btn {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(243, 244, 246, 0.92);
  color: rgba(17, 24, 39, 0.76);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    border-color 0.18s ease;
}

.fiq-drawer-icon-btn svg {
  width: 16px;
  height: 16px;
}

.fiq-drawer-icon-btn:hover,
.fiq-drawer-icon-btn[aria-pressed="true"] {
  background: rgba(17, 24, 39, 0.92);
  border-color: rgba(17, 24, 39, 0.92);
  color: #ffffff;
}

.fiq-drawer-icon-btn:active {
  transform: translateY(1px);
}

.fiq-drawer-delete-actions {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  background: rgba(249, 250, 251, 0.9);
}

.fiq-drawer-delete-count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(17, 24, 39, 0.8);
}

.fiq-drawer-delete-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiq-drawer-delete-btn {
  appearance: none;
  border-radius: 999px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.fiq-drawer-delete-btn:active {
  transform: translateY(1px);
}

.fiq-drawer-delete-btn[disabled] {
  opacity: 0.45;
}

.fiq-drawer-delete-btn-secondary {
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(17, 24, 39, 0.78);
}

.fiq-drawer-delete-btn-primary {
  border: 1px solid rgba(185, 28, 28, 0.16);
  background: rgba(185, 28, 28, 0.92);
  color: #ffffff;
}

.fiq-drawer-nav {
  padding: 10px 10px 12px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fiq-drawer-nav-item {
  appearance: none;
  border: 0;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 14px;
  background: transparent;
  color: rgb(17, 24, 39);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.fiq-drawer-nav-item:hover {
  background: rgba(243, 244, 246, 0.92);
  transform: translateY(-1px);
}

.fiq-drawer-nav-item-cta {
  background: linear-gradient(135deg, rgb(17, 24, 39) 0%, rgb(31, 41, 55) 100%);
  color: #ffffff;
}

.fiq-drawer-nav-item-cta:hover {
  background: linear-gradient(135deg, rgb(31, 41, 55) 0%, rgb(17, 24, 39) 100%);
}

.fiq-drawer-footer {
  margin-top: auto;
  padding: 10px 14px 16px;
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.fiq-drawer-footer-link {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 4px;
  color: rgba(107, 114, 128, 0.95);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.fiq-drawer-footer-link:hover {
  color: rgb(17, 24, 39);
}

/* Highlight unlock: smooth blur removal */
.fiq-highlight-item.is-analysis-locked {
  background: rgba(249, 250, 251, 0.72);
  border: 1px solid rgba(229, 231, 235, 0.92);
  box-shadow: none;
}

.fiq-highlight-item.is-analysis-locked:hover {
  background: rgba(249, 250, 251, 0.96);
  border-color: rgba(209, 213, 219, 1);
}

.fiq-lock-cta {
  position: relative;
}

.fiq-lock-cta .fiq-highlight-more-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.fiq-lock-cta .fiq-highlight-more-inner::before {
  content: "";
  width: 13px;
  height: 13px;
  display: inline-block;
  background: center / 13px 13px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 11V7a4 4 0 0 0-8 0v4'/%3E%3Crect x='6' y='11' width='12' height='10' rx='2'/%3E%3C/svg%3E");
}

.fiq-highlight-name,
.fiq-highlight-summary {
  transition:
    filter 0.28s ease,
    opacity 0.28s ease;
  will-change: filter, opacity;
}

.fiq-highlight-name.is-locked,
.fiq-highlight-summary.is-locked {
  filter: blur(5px);
  opacity: 0.92;
  user-select: none;
}

.fiq-highlight-score.is-locked {
  filter: blur(4px);
  opacity: 0.9;
  user-select: none;
  color: rgb(16, 185, 129) !important;
}

#metricDetailContent.is-analysis-locked {
  filter: blur(10px);
  opacity: 0.72;
  user-select: none;
  pointer-events: none;
}

.fiq-metric-detail-lock {
  position: absolute;
  left: 0;
  right: 0;
  top: 62px;
  bottom: 74px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.fiq-metric-detail-lock-card {
  max-width: 320px;
  width: 100%;
  border-radius: 22px;
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.95);
  box-shadow:
    rgba(15, 23, 42, 0.12) 0 24px 48px,
    rgba(255, 255, 255, 0.85) 0 1px 0 inset;
  text-align: center;
  pointer-events: auto;
}

.fiq-metric-detail-lock-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(17, 24, 39);
  color: rgb(255, 255, 255);
}

.fiq-metric-detail-lock-icon svg {
  width: 18px;
  height: 18px;
}

.fiq-metric-detail-lock-text {
  margin: 0 0 14px;
  color: rgb(55, 65, 81);
  font-size: 14px;
  line-height: 1.5;
}

.fiq-metric-detail-lock-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgb(17, 24, 39);
  color: rgb(255, 255, 255);
  font-size: 13px;
  font-weight: 700;
}

#metricDetailPage[hidden],
#soonPage[hidden],
#uploadInstructionsModal[hidden],
#faceGptModal[hidden],
#paywallModal[hidden],
#optionsDrawer[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Android tap highlight/focus ring fix for subscription card */
.hub-upgrade-card,
.hub-upgrade-card * {
  -webkit-tap-highlight-color: transparent;
}

.hub-upgrade-card:focus,
.hub-upgrade-card:focus-visible,
.hub-upgrade-card:active {
  outline: none !important;
  border-color: rgba(229, 231, 235, 0.9) !important;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.05) !important;
}

/* Trial flow: keep upload / detect / crop surfaces crystal white */
body.is-upload-stage #uploadZone,
body.is-upload-stage #uploadZone.has-image,
body.is-upload-stage #uploadZone.has-success,
body.is-upload-stage #uploadZone.has-error,
body.is-upload-stage .upload-zone,
body.is-upload-stage .upload-zone.has-image,
body.is-upload-stage .upload-zone.has-success,
body.is-upload-stage .upload-zone.has-error,
body.is-upload-stage #uploadPlaceholder,
body.is-upload-stage .upload-placeholder,
body.is-upload-stage #uploadPreview,
body.is-upload-stage .upload-preview,
body.is-upload-stage #uploadBusyState,
body.is-upload-stage .upload-busy-state,
body.is-upload-stage #uploadDetectState,
body.is-upload-stage .upload-detect-state,
body.is-points-stage #referenceStage,
body.is-points-stage .reference-stage,
body.is-points-stage #placementStage,
body.is-points-stage .placement-stage,
body.is-points-stage #placementViewport {
  background: #ffffff !important;
  background-image: none !important;
}

body.is-points-stage #placementCanvas {
  opacity: 1 !important;
  transition: none !important;
  visibility: visible !important;
}

/* Telegram Mini App: reduce compositor bugs that leave a white screen until pinch/repaint */
body.is-telegram-miniapp .hub-topbar,
body.is-telegram-miniapp .fiq-ref-header,
body.is-telegram-miniapp .fiq-ref-subheader,
body.is-telegram-miniapp .metric-detail-header,
body.is-telegram-miniapp #metricDetailNavFooter,
body.is-telegram-miniapp .transition-loading,
body.is-telegram-miniapp #uploadDetectState,
body.is-telegram-miniapp #uploadBusyState {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-image: none !important;
}

body.is-telegram-miniapp .hub-topbar {
  background: rgba(255, 255, 255, 0.995) !important;
}

body.is-telegram-miniapp .app-shell,
body.is-telegram-miniapp #mainCard,
body.is-telegram-miniapp .screen.is-active,
body.is-telegram-miniapp #screenGender > .fixed,
body.is-telegram-miniapp #screenUpload > .fixed,
body.is-telegram-miniapp #screenPoints > .fixed,
body.is-telegram-miniapp #screenPoints > .fixed > div {
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  contain: none !important;
}

body.is-telegram-miniapp .placement-stage,
body.is-telegram-miniapp .result-hero,
body.is-telegram-miniapp .metrics-block,
body.is-telegram-miniapp .metric-detail-photo-card,
body.is-telegram-miniapp .metric-curve-card,
body.is-telegram-miniapp .metric-row,
body.is-telegram-miniapp .metric-info-card {
  contain: none !important;
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
}

body.is-telegram-miniapp #screenPoints > .fixed > div {
  height: var(--app-screen-height, 100dvh) !important;
  min-height: var(--app-screen-height, 100dvh) !important;
}

body.is-point-dragging,
body.is-point-dragging .app-shell,
body.is-point-dragging #mainCard,
body.is-point-dragging #screenPoints,
body.is-point-dragging #screenPoints > .fixed,
body.is-point-dragging #screenPoints > .fixed > div {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

body.is-point-dragging .placement-stage,
body.is-point-dragging #placementStage,
body.is-point-dragging #placementCanvas,
body.is-point-dragging #crosshair {
  touch-action: none !important;
}

body.is-result-mode .result-hero,
body.is-result-mode #resultCanvas {
  width: 100% !important;
  max-width: none !important;
}

body.is-telegram-miniapp.tg-force-repaint .app-shell,
body.is-telegram-miniapp.tg-force-repaint #mainCard,
body.is-telegram-miniapp.tg-force-repaint .screen.is-active,
body.is-telegram-miniapp.tg-force-repaint #screenGender > .fixed,
body.is-telegram-miniapp.tg-force-repaint #screenUpload > .fixed,
body.is-telegram-miniapp.tg-force-repaint #screenPoints > .fixed {
  transform: translate3d(0, 0, 0.01px) !important;
  -webkit-transform: translate3d(0, 0, 0.01px) !important;
}
