:root {
  --rd-bg: #eef3fb;
  --rd-bg2: #e6edf8;
  --rd-surface: rgba(255, 255, 255, 0.84);
  --rd-surface-strong: rgba(255, 255, 255, 0.95);
  --rd-line: rgba(139, 163, 196, 0.34);
  --rd-line-strong: rgba(88, 118, 157, 0.45);
  --rd-text: #0f1727;
  --rd-muted: #66758b;
  --rd-primary: #245df5;
  --rd-primary-2: #173ea8;
  --rd-success: #13b167;
  --rd-danger: #ff4d4d;
  --rd-shadow: 0 14px 32px rgba(20, 39, 67, 0.12);
  --rd-shadow-soft: 0 8px 22px rgba(21, 43, 78, 0.08);
  --rd-radius-lg: 24px;
  --rd-radius-md: 16px;
  --rd-radius-sm: 12px;
}

@keyframes rd-fade-up {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes rd-float {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes rd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(36, 93, 245, 0.32); }
  50% { box-shadow: 0 0 0 9px rgba(36, 93, 245, 0); }
}

@keyframes rd-shimmer {
  0% { background-position: -140% 0; }
  100% { background-position: 140% 0; }
}

@keyframes rd-glow-drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(4vw, 2vh, 0) scale(1.1); }
}

@keyframes rd-glow-drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-3vw, -2vh, 0) scale(1.08); }
}

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

@keyframes rd-modal-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 22px, 0) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background:
    radial-gradient(1000px 520px at -10% -12%, rgba(87, 159, 255, 0.24), rgba(87, 159, 255, 0) 65%),
    radial-gradient(860px 420px at 110% 10%, rgba(30, 74, 170, 0.2), rgba(30, 74, 170, 0) 70%),
    linear-gradient(180deg, var(--rd-bg) 0%, var(--rd-bg2) 100%) !important;
  color: var(--rd-text) !important;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

.bg-glow {
  display: block !important;
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(42px);
  pointer-events: none;
  opacity: 0.65;
}

.bg-glow-a {
  width: 42vw;
  height: 42vw;
  top: -17vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(72, 195, 246, 0.45) 0%, rgba(72, 195, 246, 0) 68%);
  animation: rd-glow-drift-a 14s ease-in-out infinite alternate;
}

.bg-glow-b {
  width: 38vw;
  height: 38vw;
  right: -8vw;
  bottom: -16vw;
  background: radial-gradient(circle, rgba(52, 102, 232, 0.42) 0%, rgba(52, 102, 232, 0) 70%);
  animation: rd-glow-drift-b 15s ease-in-out infinite alternate;
}

.app-shell {
  width: min(1120px, 100%) !important;
  padding: 14px !important;
  gap: 10px !important;
}

.app-head {
  height: 42px !important;
}

.brand {
  font-family: Sora, Manrope, sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: #16233a !important;
}

.engine-badge {
  border: 1px solid var(--rd-line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 255, 0.82)) !important;
  color: #445672 !important;
  border-radius: 999px !important;
  box-shadow: var(--rd-shadow-soft) !important;
}

.card {
  border: 1px solid var(--rd-line) !important;
  border-radius: var(--rd-radius-lg) !important;
  background: linear-gradient(145deg, var(--rd-surface-strong), var(--rd-surface)) !important;
  backdrop-filter: blur(14px);
  box-shadow: var(--rd-shadow) !important;
  padding: 10px !important;
}

.status-line {
  color: #5e7089 !important;
  font-weight: 600 !important;
}

.screen,
.screen.is-active {
  animation: rd-fade-up 0.34s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

#screenGender h1,
#screenUpload h1,
#screenPoints h1 {
  font-family: Sora, Manrope, sans-serif !important;
  color: #111d2f !important;
}

#screenGender > p,
#screenUpload > p,
#screenPoints > p {
  color: var(--rd-muted) !important;
}

.choice-btn,
.btn,
.tagger-upload-back,
.metrics-download-btn,
.metrics-facegpt,
.metrics-unlock-btn,
.metric-detail-nav,
.metric-lock-btn,
.facegpt-send {
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.24s ease,
    border-color 0.24s ease,
    background-color 0.2s ease,
    color 0.2s ease !important;
}

.choice-btn,
.btn {
  border: 1px solid var(--rd-line) !important;
  border-radius: var(--rd-radius-sm) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.78)) !important;
  color: #1b2a3f !important;
  box-shadow: 0 8px 18px rgba(18, 39, 69, 0.1) !important;
}

.choice-btn:hover,
.btn:hover:not(:disabled),
.tagger-upload-back:hover,
.metrics-download-btn:hover,
.metrics-unlock-btn:hover,
.metric-detail-nav:hover:not(:disabled),
.facegpt-send:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(18, 43, 76, 0.16) !important;
}

.choice-btn.is-selected {
  border-color: rgba(36, 93, 245, 0.58) !important;
  background: linear-gradient(180deg, rgba(224, 236, 255, 0.95), rgba(212, 228, 255, 0.8)) !important;
}

.btn-primary,
.facegpt-send,
.metrics-download-btn {
  border-color: rgba(21, 67, 180, 0.85) !important;
  background: linear-gradient(135deg, var(--rd-primary) 0%, var(--rd-primary-2) 100%) !important;
  color: #fff !important;
}

.btn-primary:hover:not(:disabled),
.facegpt-send:hover:not(:disabled),
.metrics-download-btn:hover {
  background: linear-gradient(135deg, #1f53dc 0%, #14398f 100%) !important;
}

.btn-ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 247, 255, 0.78)) !important;
}

.upload-zone {
  border: 1.5px dashed rgba(102, 132, 173, 0.58) !important;
  border-radius: 20px !important;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.88), rgba(237, 245, 255, 0.76)),
    repeating-linear-gradient(45deg, rgba(103, 134, 174, 0.08), rgba(103, 134, 174, 0.08) 10px, rgba(103, 134, 174, 0) 10px, rgba(103, 134, 174, 0) 22px) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.upload-zone.is-drag {
  border-color: rgba(37, 95, 245, 0.8) !important;
  box-shadow: 0 14px 30px rgba(37, 95, 245, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.62) !important;
}

.upload-icon {
  border: 1px solid rgba(120, 149, 188, 0.6) !important;
  box-shadow: 0 8px 16px rgba(34, 59, 97, 0.14) !important;
  animation: rd-float 3.2s ease-in-out infinite;
}

.upload-zone.has-image .upload-preview {
  transform: scale(1.014);
}

.remove-photo {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 8px 20px rgba(18, 37, 65, 0.2) !important;
}

.detected-badge {
  background: linear-gradient(135deg, #17c473 0%, #12a361 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  box-shadow: 0 12px 22px rgba(17, 157, 96, 0.36) !important;
  animation: rd-fade-up 0.24s ease;
}

.tagger-top-panel,
.tagger-tabs {
  border: 1px solid var(--rd-line) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 251, 255, 0.78)) !important;
  box-shadow: var(--rd-shadow-soft) !important;
}

.progress-track {
  background: #e1eaf8 !important;
}

.progress-fill {
  background: linear-gradient(90deg, #2f74ff 0%, #53a2ff 55%, #6fd9ff 100%) !important;
}

.tagger-tab {
  color: #667995 !important;
}

.tagger-tab.is-active {
  color: #1b2d46 !important;
  background: rgba(41, 96, 229, 0.08) !important;
}

.tagger-tab.is-active::after {
  background: linear-gradient(90deg, #2f74ff, #53a2ff) !important;
}

.placement-stage,
.result-hero {
  border: 1px solid var(--rd-line-strong) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(228, 237, 249, 0.92), rgba(211, 223, 241, 0.9)) !important;
  box-shadow: var(--rd-shadow-soft) !important;
}

.crosshair {
  animation: rd-pulse 2.2s ease-in-out infinite;
}

.crosshair-corner,
.crosshair-line,
.crosshair-dot {
  border-color: #ff4b4b !important;
  background: #ff4b4b !important;
}

.crosshair-dot {
  box-shadow: 0 0 0 2px #fff, 0 6px 15px rgba(255, 75, 75, 0.46) !important;
}

.tagger-nav-btn-outline {
  border: 1px solid rgba(137, 164, 198, 0.56) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 249, 255, 0.84)) !important;
}

.tagger-nav-btn-dark {
  background: linear-gradient(135deg, #1c2d43, #132036) !important;
}

.fiq-topbar {
  border-bottom: 1px solid rgba(139, 163, 196, 0.38) !important;
}

.fiq-icon-btn {
  color: #6f8099 !important;
}

.fiq-brand {
  color: #142238 !important;
}

.fiq-main-tabs {
  border-bottom: 1px solid rgba(139, 163, 196, 0.38) !important;
}

.fiq-main-tabs button {
  color: #8b98ab !important;
}

.fiq-main-tabs button.is-active {
  color: #192a44 !important;
  border-bottom-color: #2b61df !important;
}

.fiq-mode-strip {
  border: 1px solid var(--rd-line) !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 250, 255, 0.7)) !important;
}

.fiq-mode-card {
  border: 1px solid rgba(132, 156, 190, 0.4) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

.result-hero {
  position: relative !important;
  overflow: hidden !important;
  min-height: clamp(360px, 56vh, 790px) !important;
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.82) !important;
  padding: 2px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow:
    rgba(255, 255, 255, 0.08) 0 0 60px,
    rgba(255, 255, 255, 0.05) 0 0 100px,
    rgba(0, 0, 0, 0.2) 0 8px 40px !important;
  animation: 0.5s cubic-bezier(0.22, 1, 0.36, 1) both fadeInUp !important;
}

.result-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(114, 131, 140, 0.32) 0%, transparent 50%),
    radial-gradient(100% 60% at 80% 100%, rgba(90, 107, 117, 0.22) 0%, transparent 40%),
    radial-gradient(80% 50% at 20% 80%, rgba(72, 87, 97, 0.18) 0%, transparent 35%),
    linear-gradient(165deg, rgba(74, 86, 96, 0.24) 0%, rgba(28, 35, 40, 0.16) 100%);
  mix-blend-mode: soft-light;
  animation: 8s ease-in-out infinite pulse-glow !important;
}

.result-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(25, 30, 35, 0.82) 0%, rgba(25, 30, 35, 0.3) 35%, transparent 62%),
    radial-gradient(60% 45% at 50% 35%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  opacity: 0.8;
}

#resultCanvas {
  position: relative !important;
  z-index: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 22px !important;
  filter: saturate(1.06) contrast(1.03) brightness(1.01) !important;
  animation: 6.5s ease-in-out infinite saturationWave !important;
}

.hero-settings-btn {
  top: 16px !important;
  right: 16px !important;
  z-index: 6 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 10px 24px rgba(14, 27, 45, 0.26) !important;
  animation: 2.4s ease-in-out infinite pulse-glow !important;
}

.hero-settings-btn:hover {
  transform: translateY(-1px) scale(1.04) !important;
  background: rgba(0, 0, 0, 0.48) !important;
}

.hero-overlay {
  z-index: 5 !important;
  backdrop-filter: blur(8px) !important;
  padding: 14px 18px 18px !important;
  background:
    linear-gradient(to top, rgba(25, 30, 35, 0.92) 0%, rgba(25, 30, 35, 0.75) 30%, rgba(25, 30, 35, 0.4) 55%, rgba(25, 30, 35, 0.15) 75%, transparent 100%) !important;
  animation: 0.45s ease-out both fadeIn !important;
}

.hero-watermark {
  display: none !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  letter-spacing: 0.12em !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
  box-shadow:
    rgba(255, 255, 255, 0.15) 0 1px 1px inset,
    rgba(0, 0, 0, 0.2) 0 1px 3px !important;
  position: relative;
  overflow: hidden;
}

.hero-watermark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.34) 48%, transparent 100%);
  transform: translateX(-120%);
  animation: rd-shimmer 3.6s linear infinite;
}

.hero-score {
  background: linear-gradient(180deg, #9ff4ff, #52d3f7) !important;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: rgba(150, 170, 180, 0.4) 0 2px 20px, rgba(0, 0, 0, 0.25) 0 4px 30px;
}

.hero-grade {
  text-shadow: rgba(0, 0, 0, 0.35) 0 1px 3px;
}

.hero-slider-nav {
  border: 1px solid rgba(114, 131, 140, 0.1) !important;
  border-radius: 16px !important;
  background: rgba(240, 243, 245, 0.98) !important;
  box-shadow: rgba(0, 0, 0, 0.04) 0 2px 8px !important;
  animation: 0.5s ease-out both slideUpFade !important;
}

.hero-nav-btn {
  color: #74839a !important;
  transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hero-nav-btn:not(:disabled):hover {
  transform: translateY(-1px);
  color: #4f647f !important;
}

.metrics-block {
  border: 1px solid var(--rd-line) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.84)) !important;
  box-shadow: var(--rd-shadow-soft) !important;
}

.metrics-understanding {
  color: #73839a !important;
}

.metrics-facegpt {
  color: #637b9d !important;
  font-weight: 700 !important;
}

.metrics-unlock-btn {
  border: 1px solid rgba(20, 40, 72, 0.75) !important;
  background: linear-gradient(135deg, #1f2f45 0%, #182538 100%) !important;
  color: #fff !important;
}

.metric-row {
  border-top: 1px solid rgba(190, 206, 226, 0.5) !important;
  border-radius: 12px !important;
  padding: 14px 10px !important;
  margin-bottom: 4px;
  background: transparent;
}

.metric-row:hover {
  background: rgba(37, 95, 245, 0.06) !important;
}

.metric-row.is-active {
  background: rgba(37, 95, 245, 0.12) !important;
  border-top-color: rgba(37, 95, 245, 0.2) !important;
}

.metric-name {
  color: #1a2a42 !important;
}

.metric-score {
  color: #0f6f53 !important;
}

.bar {
  background: #dfe8f5 !important;
  border-radius: 999px !important;
}

.bar-fill {
  background:
    linear-gradient(90deg,
      #b44556 0%,
      #bf7d53 22%,
      #66b3a6 50%,
      #bf7d53 78%,
      #b44556 100%) !important;
  background-size: 200% 100%;
  animation: rd-shimmer 3.8s linear infinite;
}

.metric-detail-page {
  background: #f4f8ff !important;
}

.metric-detail-header {
  border-bottom: 1px solid rgba(141, 166, 201, 0.4) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
}

.metric-detail-content {
  background:
    linear-gradient(180deg, rgba(250, 253, 255, 0.9), rgba(241, 248, 255, 0.84));
}

.metric-mini-card,
.metric-range-card,
.metric-info-card,
.metric-detail-photo-card,
.metric-curve-card {
  border: 1px solid rgba(141, 166, 201, 0.28) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 20px rgba(20, 39, 67, 0.08) !important;
}

.metric-mini-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 251, 255, 0.86)) !important;
}

.metric-mini-card-accent {
  background: linear-gradient(180deg, rgba(219, 240, 245, 0.8), rgba(208, 234, 240, 0.68)) !important;
}

.metric-range-badge {
  background: linear-gradient(135deg, #2e9ba6 0%, #2d8e9d 100%) !important;
}

.metric-range-badge::after {
  border-top-color: #2d8e9d !important;
}

.metric-range-line {
  background:
    linear-gradient(90deg,
      #a13f50 0%,
      #bf7649 25%,
      #57a9a0 50%,
      #bf7649 75%,
      #a13f50 100%) !important;
}

.metric-warning-card {
  border-color: rgba(39, 155, 86, 0.22) !important;
  background: linear-gradient(135deg, rgba(24, 174, 94, 0.08), rgba(24, 174, 94, 0.03)) !important;
}

.metric-warning-item {
  border-color: rgba(39, 155, 86, 0.2) !important;
}

.metric-detail-footer {
  border-top: 1px solid rgba(141, 166, 201, 0.42) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(12px);
}

.metric-detail-nav {
  border: 1px solid rgba(133, 159, 194, 0.42) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 247, 255, 0.82)) !important;
  color: #627893 !important;
}

.facegpt-modal {
  animation: rd-fade-up 0.28s ease;
}

.facegpt-backdrop {
  background: rgba(9, 15, 25, 0.58) !important;
  backdrop-filter: blur(5px) !important;
}

.facegpt-panel {
  border: 1px solid rgba(141, 166, 201, 0.36) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.92)) !important;
  box-shadow: 0 30px 80px rgba(11, 26, 48, 0.33) !important;
  animation: rd-modal-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.facegpt-head {
  border-bottom: 1px solid rgba(141, 166, 201, 0.28) !important;
}

.facegpt-close {
  border-radius: 10px;
}

.facegpt-close:hover {
  background: rgba(35, 88, 199, 0.08);
}

.facegpt-messages {
  background: linear-gradient(180deg, #f8fbff 0%, #eff5fd 100%) !important;
}

.facegpt-msg.user {
  background: linear-gradient(135deg, #24344b, #1b2738) !important;
}

.facegpt-msg.assistant {
  background: linear-gradient(180deg, #edf4ff, #e7f0fd) !important;
}

.facegpt-input-wrap {
  border-top: 1px solid rgba(141, 166, 201, 0.28) !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

.facegpt-input {
  border: 1px solid rgba(138, 163, 198, 0.42) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

.facegpt-input:focus {
  border-color: rgba(55, 112, 245, 0.62) !important;
  box-shadow: 0 0 0 3px rgba(55, 112, 245, 0.18) !important;
}

body.is-home-mode {
  background: #f8f8fa !important;
}

body.is-home-mode .app-shell {
  width: min(100%, 860px) !important;
  padding: 0 !important;
  gap: 0 !important;
  height: 100dvh;
}

body.is-home-mode .card {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

body.is-home-mode .status-line,
body.is-home-mode .app-head {
  display: none !important;
}

.home-screen {
  overflow-y: auto !important;
  padding: 0 !important;
}

.hub-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f8f8fa;
}

.hub-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(env(safe-area-inset-top), 16px) 20px 10px;
}

.hub-topbar {
  justify-content: center !important;
}

.hub-brand-btn,
.hub-avatar-btn,
.hub-action-card,
.hub-mini-btn,
.hub-upgrade-card,
.hub-inline-link,
.hub-footer button {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.hub-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  justify-content: center;
}

.hub-brand-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-brand-mark,
.hub-avatar-btn,
.hub-title,
.hub-stats {
  display: none !important;
}

.hub-body {
  padding-top: 10px !important;
}

.hub-brand-mark svg,
.hub-action-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-avatar-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eceff5;
  color: #626f86;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.hub-body {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 2px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hub-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 38px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  font-weight: 700;
  color: #111827;
}

.hub-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #9aa3b2;
  font-size: 12px;
  line-height: 1.4;
}

.hub-stats b {
  color: #647084;
  font-weight: 600;
}

.hub-grid-wrap {
  display: flex;
  justify-content: flex-start;
}

.hub-grid {
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hub-latest-card {
  position: relative;
  grid-column: span 2;
  grid-row: span 2;
  min-height: 244px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 22%, rgba(154, 173, 207, 0.22), rgba(154, 173, 207, 0) 38%),
    linear-gradient(180deg, #596477 0%, #2d3646 100%);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.16);
}

.hub-latest-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.36));
  pointer-events: none;
}

.hub-latest-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hub-latest-ghost {
  width: 118px;
  height: 118px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0) 70%);
  color: rgba(255, 255, 255, 0.18);
}

.hub-latest-ghost svg {
  width: 76px;
  height: 76px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-latest-copy,
.hub-latest-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 1;
}

.hub-latest-copy {
  bottom: 15px;
  color: #fff;
  pointer-events: none;
}

.hub-latest-kicker {
  margin: 0 0 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.58);
}

.hub-latest-score {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.3);
  filter: blur(4px);
  user-select: none;
}

.hub-latest-metrics {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
}

.hub-latest-status {
  margin: 6px 0 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.48);
}

.hub-latest-actions {
  top: 14px;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hub-latest-card:hover .hub-latest-actions {
  display: flex;
}

.hub-mini-btn {
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.hub-action-card {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px solid rgba(209, 213, 219, 0.7);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b7280;
  padding: 10px;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.hub-action-card:hover,
.hub-upgrade-card:hover,
.hub-footer button:hover,
.hub-inline-link:hover,
.hub-brand-btn:hover,
.hub-mini-btn:hover,
.hub-avatar-btn:hover {
  transform: translateY(-1px);
}

.hub-action-card:hover {
  background: #f9fafb;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.hub-action-card-primary {
  color: #475569;
}

.hub-action-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-action-card span:last-child {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
}

.hub-upgrade-card,
.hub-history-card {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.05);
}

.hub-upgrade-card {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
}

.hub-upgrade-card strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hub-upgrade-card p {
  margin: 6px 0 0;
  color: #7b8595;
  font-size: 13px;
  line-height: 1.45;
}

.hub-upgrade-card > span {
  color: #9aa3b2;
  font-size: 20px;
  font-weight: 700;
}

.hub-history-card {
  padding: 16px 18px;
}

.hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-section-head h2 {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hub-inline-link {
  padding: 0;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 600;
}

.hub-history-empty {
  margin-top: 14px;
  min-height: 132px;
  border-radius: 16px;
  border: 1px dashed rgba(209, 213, 219, 0.9);
  background: linear-gradient(180deg, rgba(250, 251, 253, 0.9), rgba(245, 247, 250, 0.92));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 18px;
}

.hub-history-empty-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf1f7;
  color: #9aa3b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.hub-history-empty strong {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.hub-history-empty p {
  margin: 0;
  color: #8993a5;
  font-size: 12px;
  line-height: 1.5;
}

.hub-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 2px 4px 10px;
}

.hub-footer button {
  padding: 0;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 500;
}

.soon-toast {
  position: fixed;
  left: 50%;
  bottom: max(env(safe-area-inset-bottom), 20px);
  transform: translate(-50%, 16px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 2000;
}

.soon-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  .app-shell {
    width: 100% !important;
    padding: 10px !important;
  }

  .fiq-main-tabs {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 18px;
  }

  .fiq-main-tabs button {
    white-space: nowrap;
  }

  body.is-home-mode .app-shell {
    padding: 0 !important;
  }
}

@media (max-width: 640px) {
  .card {
    border-radius: 18px !important;
    padding: 8px !important;
  }

  .result-hero {
    min-height: clamp(300px, 46vh, 620px) !important;
  }

  .hero-slider-nav {
    height: 56px;
  }

  .metric-detail-content {
    padding: 12px 12px 92px !important;
  }

  .facegpt-panel {
    width: calc(100vw - 12px) !important;
    height: min(90vh, 840px) !important;
    border-radius: 14px !important;
  }

  .hub-topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hub-body {
    padding: 2px 16px 28px;
  }

  .hub-grid {
    max-width: 100%;
  }

  .hub-latest-card {
    min-height: 228px;
  }
}

/* Keep the workflow screens on the same visual system as the home dashboard. */
:root {
  --hub-ui-page: #f8f8fa;
  --hub-ui-surface: rgba(255, 255, 255, 0.9);
  --hub-ui-surface-strong: #ffffff;
  --hub-ui-surface-soft: #f3f4f6;
  --hub-ui-border: rgba(229, 231, 235, 0.92);
  --hub-ui-border-strong: rgba(209, 213, 219, 0.96);
  --hub-ui-text: #111827;
  --hub-ui-muted: #6b7280;
  --hub-ui-shadow: 0 10px 26px rgba(17, 24, 39, 0.05);
  --hub-ui-shadow-lg: 0 14px 36px rgba(17, 24, 39, 0.12);
  --hub-ui-hero: linear-gradient(180deg, #596477 0%, #2d3646 100%);
}

body:not(.is-home-mode),
body.is-result-mode {
  background: var(--hub-ui-page) !important;
}

body:not(.is-home-mode) .bg-glow {
  display: none !important;
}

body:not(.is-home-mode) .app-shell {
  width: min(1024px, 100%) !important;
  padding: 14px !important;
  gap: 12px !important;
}

body.is-result-mode .app-shell {
  width: min(1160px, 100%) !important;
  padding: 14px !important;
}

body:not(.is-home-mode) .app-head {
  padding: 0 6px !important;
}

body:not(.is-home-mode) .brand {
  color: var(--hub-ui-text) !important;
}

body:not(.is-home-mode) .engine-badge {
  border-color: var(--hub-ui-border) !important;
  background: var(--hub-ui-surface-strong) !important;
  color: var(--hub-ui-muted) !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

body:not(.is-home-mode) .status-line {
  padding: 0 8px !important;
  color: #8993a5 !important;
}

body:not(.is-home-mode) .card {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 12px !important;
}

#screenGender,
#screenUpload,
#screenPoints,
#screenResult {
  border: 1px solid var(--hub-ui-border) !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 251, 0.96)) !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

#screenGender,
#screenUpload,
#screenPoints {
  padding: 28px !important;
}

#screenResult {
  padding: 18px !important;
  gap: 18px !important;
}

#screenGender {
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
  text-align: center !important;
}

#screenGender h1,
#screenUpload h1,
#screenPoints h1,
.metrics-head h2,
.metric-detail-header h3 {
  font-family: Sora, Manrope, sans-serif !important;
  letter-spacing: -0.03em !important;
  color: var(--hub-ui-text) !important;
}

#screenGender h1 {
  font-size: clamp(32px, 4vw, 42px) !important;
}

#screenGender > p,
#screenUpload > p,
#screenPoints > p,
.metrics-head p,
.facegpt-meta {
  color: #7b8595 !important;
}

#screenGender > p,
#screenGender .gender-grid,
#screenGender #genderContinueBtn {
  width: min(100%, 430px);
}

.gender-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 4px !important;
}

.choice-btn,
.btn,
.tagger-upload-back,
.tagger-nav-btn,
.fiq-icon-btn,
.fiq-link-btn,
.metrics-facegpt,
.metrics-download-btn,
.metrics-unlock-btn,
.metric-detail-nav,
.metric-lock-btn,
.facegpt-send {
  appearance: none !important;
  border: 1px solid var(--hub-ui-border) !important;
  border-radius: 16px !important;
  background: var(--hub-ui-surface-strong) !important;
  color: var(--hub-ui-text) !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

.choice-btn,
.btn {
  min-height: 58px !important;
  padding: 16px 18px !important;
  font-weight: 700 !important;
}

.choice-btn.is-selected {
  border-color: #cbd5e1 !important;
  background: #edf1f7 !important;
  color: #334155 !important;
}

.btn-primary,
.tagger-nav-btn-dark,
.metrics-unlock-btn,
.facegpt-send {
  border-color: rgba(45, 54, 70, 0.92) !important;
  background: var(--hub-ui-hero) !important;
  color: #fff !important;
}

.btn-ghost,
.tagger-nav-btn-outline,
.metrics-facegpt,
.metrics-download-btn,
.metric-detail-nav,
.metric-lock-btn,
.fiq-icon-btn,
.fiq-link-btn {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #5f6b7c !important;
}

.fiq-icon-btn {
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  font-size: 18px !important;
  line-height: 1 !important;
  padding: 0 !important;
}

.fiq-link-btn,
.metrics-facegpt,
.metrics-download-btn,
.metrics-unlock-btn,
.metric-detail-nav,
.metric-lock-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fiq-link-btn,
.metrics-facegpt,
.metrics-download-btn,
.metrics-unlock-btn {
  min-height: 42px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
}

.tagger-upload-back {
  padding: 10px 14px !important;
  border-radius: 999px !important;
}

.tagger-nav-btn {
  min-width: 110px !important;
  border-radius: 999px !important;
  padding: 14px 20px !important;
  letter-spacing: 0 !important;
}

.metric-detail-nav {
  min-height: 44px !important;
  padding: 0 16px !important;
}

.metric-lock-btn {
  border-radius: 999px !important;
}

.fiq-link-btn.fiq-link-muted span {
  background: #6b7280 !important;
}

#screenUpload {
  gap: 18px !important;
}

.upload-zone {
  min-height: clamp(280px, 48vh, 560px) !important;
  border: 1.5px dashed #d1d5db !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, #fbfbfc 0%, #f3f4f6 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    var(--hub-ui-shadow) !important;
}

.upload-zone.is-drag {
  border-color: #94a3b8 !important;
  background: linear-gradient(180deg, #ffffff 0%, #edf2f7 100%) !important;
}

.upload-placeholder {
  color: #7b8595 !important;
}

.upload-placeholder strong {
  color: var(--hub-ui-text) !important;
}

.upload-icon {
  border-color: #d1d5db !important;
  background: #ffffff !important;
  color: #6b7280 !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

.remove-photo {
  border: 1px solid var(--hub-ui-border) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: #4b5563 !important;
}

.detected-badge {
  background: var(--hub-ui-hero) !important;
  color: #fff !important;
  box-shadow: var(--hub-ui-shadow-lg) !important;
}

.row-actions {
  gap: 12px !important;
}

#screenPoints {
  gap: 14px !important;
}

.tagger-top-panel,
.tagger-tabs,
.fiq-topbar,
.fiq-main-tabs,
.fiq-mode-strip,
.metrics-block {
  border: 1px solid var(--hub-ui-border) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

.tagger-top-panel,
.tagger-tabs,
.fiq-topbar,
.fiq-main-tabs,
.fiq-mode-strip,
.metrics-block,
.result-hero {
  border-radius: 22px !important;
}

.tagger-top-panel {
  padding: 14px 16px !important;
}

.tagger-tabs {
  padding: 6px !important;
  gap: 6px !important;
}

.tagger-tab {
  border-radius: 14px !important;
  padding: 11px 10px !important;
  color: #7b8595 !important;
}

.tagger-tab.is-active {
  background: #edf1f7 !important;
  color: var(--hub-ui-text) !important;
}

.tagger-tab.is-active::after {
  display: none !important;
}

.progress-track {
  background: #e5e7eb !important;
}

.progress-fill {
  background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%) !important;
}

.placement-stage {
  border: 1px solid var(--hub-ui-border-strong) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75) !important;
}

.tagger-bottom-buttons {
  bottom: 16px !important;
  gap: 12px !important;
}

#screenResult {
  background: linear-gradient(180deg, rgba(248, 248, 250, 0.98), rgba(243, 244, 246, 0.96)) !important;
}

.fiq-topbar {
  min-height: auto !important;
  padding: 12px 14px !important;
  border-bottom: none !important;
}

.fiq-topbar-left,
.fiq-topbar-right,
.metrics-cta {
  flex-wrap: wrap !important;
}

.fiq-brand {
  font-family: Sora, Manrope, sans-serif !important;
  font-size: clamp(18px, 2.2vw, 30px) !important;
  color: var(--hub-ui-text) !important;
}

.fiq-brand-mark {
  border-color: #374151 !important;
}

.fiq-brand-mark::before,
.fiq-brand-mark::after {
  background: #374151 !important;
}

.fiq-main-tabs {
  padding: 6px !important;
  gap: 8px !important;
  border-bottom: none !important;
  overflow-x: auto !important;
}

.fiq-main-tabs button {
  border-radius: 999px !important;
  padding: 10px 14px !important;
  color: #7b8595 !important;
  background: transparent !important;
  border-bottom-color: transparent !important;
  white-space: nowrap;
}

.fiq-main-tabs button.is-active {
  background: #edf1f7 !important;
  color: var(--hub-ui-text) !important;
}

.fiq-mode-strip {
  padding: 10px !important;
  gap: 10px !important;
}

.fiq-mode-card {
  border: 1px solid var(--hub-ui-border) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.fiq-mode-card.is-active {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.result-hero {
  min-height: clamp(340px, 54vh, 780px) !important;
  border: 1px solid var(--hub-ui-border) !important;
  background: #ffffff !important;
  box-shadow: var(--hub-ui-shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden !important;
  animation: none !important;
}

.result-hero::before {
  background: radial-gradient(circle at 50% 0%, rgba(154, 173, 207, 0.22) 0%, rgba(154, 173, 207, 0) 48%) !important;
  mix-blend-mode: normal !important;
  animation: none !important;
}

.result-hero::after {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.1) 58%, rgba(17, 24, 39, 0.58) 100%) !important;
  opacity: 1 !important;
}

#resultCanvas {
  border-radius: 22px !important;
  filter: none !important;
  animation: none !important;
}

.hero-settings-btn {
  top: 14px !important;
  right: 14px !important;
  width: 40px !important;
  height: 40px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #6b7280 !important;
  border: 1px solid var(--hub-ui-border) !important;
  box-shadow: var(--hub-ui-shadow) !important;
  animation: none !important;
}

.hero-settings-btn:hover {
  background: #fff !important;
  transform: translateY(-1px) !important;
}

.hero-overlay {
  padding: 16px 18px 18px !important;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0) 0%, rgba(17, 24, 39, 0.18) 55%, rgba(17, 24, 39, 0.72) 100%) !important;
  backdrop-filter: none !important;
}

.hero-metric-name {
  color: #fff !important;
}

.hero-kicker {
  color: rgba(255, 255, 255, 0.74) !important;
}

.hero-score {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: currentColor !important;
  color: #fff !important;
  text-shadow: none !important;
}

.hero-score-unit,
.hero-grade {
  color: rgba(243, 244, 246, 0.92) !important;
  text-shadow: none !important;
}

.hero-slider-nav {
  height: 62px !important;
  padding: 0 12px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid var(--hub-ui-border) !important;
  box-shadow: var(--hub-ui-shadow) !important;
  animation: none !important;
}

.hero-nav-btn {
  color: #6b7280 !important;
}

.hero-nav-btn:not(:disabled):hover {
  color: #374151 !important;
}

.metrics-block {
  padding: 0 !important;
}

.metrics-head {
  padding: 18px 18px 12px !important;
}

.metrics-topline {
  align-items: center !important;
  gap: 12px !important;
}

.metrics-understanding {
  color: #7b8595 !important;
}

.metrics-head p {
  color: #8993a5 !important;
}

.metrics-list {
  padding: 4px 14px 16px !important;
}

.metric-row {
  border-top: 1px solid var(--hub-ui-border) !important;
  border-radius: 16px !important;
  padding: 14px 12px !important;
  margin-bottom: 6px !important;
}

.metric-row:first-child {
  border-top-color: transparent !important;
}

.metric-row:hover {
  background: #f8fafc !important;
}

.metric-row.is-active {
  background: #edf1f7 !important;
  border-top-color: #edf1f7 !important;
}

.metric-name {
  color: var(--hub-ui-text) !important;
}

.metric-score {
  color: #374151 !important;
}

.metric-value,
.metric-ideal {
  color: #94a3b8 !important;
}

.bar {
  background: #e5e7eb !important;
}

.bar-fill {
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 45%, #475569 100%) !important;
  animation: none !important;
}

.metric-detail-page {
  background: var(--hub-ui-page) !important;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

.metric-detail-header,
.metric-mini-card,
.metric-range-card,
.metric-info-card,
.metric-detail-photo-card,
.metric-curve-card,
.metric-detail-footer,
.facegpt-panel {
  border: 1px solid var(--hub-ui-border) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--hub-ui-shadow) !important;
}

.metric-detail-header,
.metric-detail-footer {
  backdrop-filter: none !important;
}

.metric-mini-card-accent {
  background: #eef2f7 !important;
}

.metric-range-badge {
  background: var(--hub-ui-hero) !important;
}

.metric-range-badge::after {
  border-top-color: #2d3646 !important;
}

.metric-range-line {
  background: linear-gradient(90deg, #e5e7eb 0%, #94a3b8 50%, #e5e7eb 100%) !important;
}

.metric-warning-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 250, 0.96)) !important;
  border-color: var(--hub-ui-border) !important;
}

.metric-warning-item {
  border-color: var(--hub-ui-border) !important;
}

.metric-info-title,
.metric-curve-head,
.metric-mini-card span {
  color: #8993a5 !important;
}

.metric-mini-card strong,
.metric-curve-head b,
#metricDetailIndex {
  color: var(--hub-ui-text) !important;
}

.facegpt-backdrop {
  background: rgba(17, 24, 39, 0.22) !important;
  backdrop-filter: blur(4px) !important;
}

.facegpt-head,
.facegpt-input-wrap {
  border-color: var(--hub-ui-border) !important;
}

.facegpt-messages {
  background: linear-gradient(180deg, #fbfbfc 0%, #f3f4f6 100%) !important;
}

.facegpt-msg.user {
  background: var(--hub-ui-hero) !important;
  color: #fff !important;
}

.facegpt-msg.assistant {
  background: #eef2f7 !important;
  color: var(--hub-ui-text) !important;
}

.facegpt-input {
  border-color: var(--hub-ui-border) !important;
  background: #fff !important;
}

.facegpt-input:focus {
  border-color: #cbd5e1 !important;
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.4) !important;
}

@media (max-width: 760px) {
  #screenGender,
  #screenUpload,
  #screenPoints,
  #screenResult {
    border-radius: 22px !important;
  }

  #screenGender,
  #screenUpload,
  #screenPoints {
    padding: 20px !important;
  }

  #screenResult {
    /* Keep the sticky result topbar flush to the container, but preserve side/bottom padding. */
    padding: 0 14px 14px !important;
  }

  .gender-grid {
    grid-template-columns: 1fr !important;
  }

  .fiq-topbar,
  .metrics-topline {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .fiq-topbar-right,
  .metrics-cta {
    width: 100%;
  }

  .fiq-topbar-right {
    justify-content: flex-start !important;
  }

  .metrics-cta {
    flex-wrap: wrap !important;
  }

  .fiq-link-btn,
  .metrics-facegpt,
  .metrics-download-btn,
  .metrics-unlock-btn {
    justify-content: center !important;
  }

  .result-hero {
    min-height: clamp(280px, 42vh, 520px) !important;
  }

  .hero-meta {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .hero-score-box {
    text-align: left !important;
  }

  .metric-detail-cards {
    flex-direction: column !important;
  }
}

/* 2026-03 mobile image fitting fixes */
.upload-preview {
  object-fit: contain !important;
  background: #e7edf6 !important;
  transform: none !important;
}

.upload-zone.has-image .upload-preview {
  transform: none !important;
}

.upload-zone.has-image {
  background:
    linear-gradient(180deg, rgba(238, 244, 252, 0.96), rgba(228, 237, 249, 0.9)) !important;
}

.placement-stage {
  min-height: clamp(280px, 50svh, 560px) !important;
}

.metric-detail-photo-card {
  aspect-ratio: 1 / 1 !important;
}

@media (max-width: 760px) {
  .upload-zone {
    min-height: clamp(230px, 38svh, 380px) !important;
  }

  .placement-stage {
    min-height: clamp(300px, 52svh, 520px) !important;
  }

  .result-hero {
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .hero-overlay {
    padding: 12px 14px 14px !important;
  }

  .hero-metric-name {
    font-size: clamp(18px, 6vw, 28px) !important;
  }

  .hero-kicker {
    font-size: clamp(15px, 5vw, 24px) !important;
  }

  .hero-score {
    font-size: clamp(28px, 9vw, 44px) !important;
  }

  .hero-grade {
    font-size: clamp(13px, 4.2vw, 19px) !important;
  }

  .metric-detail-photo-card {
    max-height: min(72svh, 520px) !important;
  }
}

/* FaceGPT refit from saved FaceIQ chat page */
#faceGptModal.facegpt-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 160 !important;
  display: grid !important;
  place-items: center !important;
  padding: clamp(12px, 2vw, 24px) !important;
  animation: rd-fade-up 0.26s ease !important;
}

#faceGptModal.facegpt-modal[hidden] {
  display: none !important;
}

#faceGptModal .facegpt-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(246, 247, 249, 0.8) !important;
  backdrop-filter: blur(6px) !important;
}

#faceGptModal .facegpt-panel {
  position: relative !important;
  width: min(900px, calc(100vw - 24px)) !important;
  height: min(860px, calc(100vh - 24px)) !important;
  border-radius: 30px !important;
  border: 1px solid rgba(225, 228, 233, 0.92) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 24px 70px rgba(28, 36, 46, 0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 32px 28px 28px !important;
  overflow: hidden !important;
}

#faceGptModal .facegpt-panel.has-chat {
  justify-content: flex-start !important;
  align-items: stretch !important;
  padding-top: 24px !important;
}

#faceGptModal .facegpt-close {
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
  z-index: 2 !important;
  width: 48px !important;
  height: 48px !important;
  border: none !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #8d95a3 !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
}

#faceGptModal .facegpt-close svg {
  width: 26px !important;
  height: 26px !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  fill: none !important;
  stroke-linecap: round !important;
}

#faceGptModal .facegpt-close:hover {
  background: rgba(239, 241, 245, 0.92) !important;
  color: #667080 !important;
  transform: scale(1.03) !important;
}

#faceGptModal .facegpt-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 auto 22px !important;
}

#faceGptModal .facegpt-panel.has-chat .facegpt-empty {
  display: none !important;
}

#faceGptModal .facegpt-empty-title {
  margin: 0 !important;
  max-width: 720px !important;
  text-align: center !important;
  font: 600 clamp(30px, 5vw, 58px)/1.08 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif !important;
  letter-spacing: -0.045em !important;
  color: #55616f !important;
}

#faceGptModal .facegpt-head {
  display: none !important;
}

#faceGptModal .facegpt-panel.has-chat .facegpt-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 4px 2px 14px !important;
  border: 0 !important;
}

#faceGptModal .facegpt-head-copy h3 {
  margin: 0 !important;
  font: 700 22px/1.08 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif !important;
  letter-spacing: -0.04em !important;
  color: #1e2732 !important;
}

#faceGptModal .facegpt-meta {
  margin: 6px 0 0 !important;
  font: 500 14px/1.35 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
  color: #98a1ae !important;
}

#faceGptModal .facegpt-messages {
  display: none !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px 8px 18px !important;
  background: transparent !important;
  gap: 14px !important;
}

#faceGptModal .facegpt-panel.has-chat .facegpt-messages {
  display: flex !important;
  flex-direction: column !important;
}

#faceGptModal .facegpt-msg {
  max-width: min(72%, 620px) !important;
  padding: 15px 18px !important;
  border-radius: 22px !important;
  font: 500 15px/1.55 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
  box-shadow: none !important;
}

#faceGptModal .facegpt-msg.user {
  margin-left: auto !important;
  border-bottom-right-radius: 12px !important;
  background: #202d3d !important;
  color: #f7fbff !important;
}

#faceGptModal .facegpt-msg.assistant {
  margin-right: auto !important;
  border: 1px solid rgba(224, 229, 235, 0.92) !important;
  border-bottom-left-radius: 12px !important;
  background: #f2f4f7 !important;
  color: #2b3644 !important;
}

#faceGptModal .facegpt-bottom {
  width: min(840px, 100%) !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 14px !important;
}

#faceGptModal .facegpt-panel.has-chat .facegpt-bottom {
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 10px !important;
}

#faceGptModal .facegpt-input-wrap {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 12px !important;
  padding: 14px 18px !important;
  border: 0 !important;
  border-radius: 34px !important;
  background: #f3f4f6 !important;
  box-shadow: none !important;
}

#faceGptModal .facegpt-tool-btn,
#faceGptModal .facegpt-mode-btn {
  appearance: none !important;
  border: 1px solid #d2d7df !important;
  background: transparent !important;
  color: #747f8f !important;
  flex-shrink: 0 !important;
}

#faceGptModal .facegpt-tool-btn {
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
}

#faceGptModal .facegpt-tool-btn svg,
#faceGptModal .facegpt-mode-btn svg,
#faceGptModal .facegpt-send svg,
#faceGptModal .facegpt-model-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#faceGptModal .facegpt-mode-btn {
  height: 48px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font: 500 16px/1 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
}

#faceGptModal .facegpt-tool-btn:hover,
#faceGptModal .facegpt-mode-btn:hover,
#faceGptModal .facegpt-prompt-btn:hover,
#faceGptModal .facegpt-model-btn:hover {
  background: #eceef1 !important;
  color: #5c6673 !important;
}

#faceGptModal .facegpt-input {
  width: 100% !important;
  min-height: 40px !important;
  max-height: 150px !important;
  padding: 8px 0 7px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #5f6875 !important;
  font: 500 clamp(16px, 2vw, 22px)/1.3 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
  resize: none !important;
  box-shadow: none !important;
}

#faceGptModal .facegpt-input::placeholder {
  color: #a0a8b4 !important;
}

#faceGptModal .facegpt-input:focus {
  outline: none !important;
  box-shadow: none !important;
}

#faceGptModal .facegpt-send {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  background: #d8dbe0 !important;
  color: #f9fafb !important;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease !important;
}

#faceGptModal .facegpt-input-wrap.is-filled .facegpt-send:not(:disabled) {
  background: #1f2937 !important;
  color: #ffffff !important;
}

#faceGptModal .facegpt-send:hover:not(:disabled) {
  transform: translateY(-1px) !important;
}

#faceGptModal .facegpt-send:disabled {
  opacity: 1 !important;
  background: #e4e6ea !important;
  color: #f8f9fb !important;
  cursor: not-allowed !important;
}

#faceGptModal .facegpt-model-btn {
  appearance: none !important;
  border: 0 !important;
  background: transparent !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #a2a9b4 !important;
  font: 500 13px/1 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
}

#faceGptModal .facegpt-prompts {
  position: relative !important;
  width: min(440px, 100%) !important;
  height: 170px !important;
  overflow: hidden !important;
}

#faceGptModal .facegpt-panel.has-chat .facegpt-model-btn,
#faceGptModal .facegpt-panel.has-chat .facegpt-prompts {
  display: none !important;
}

#faceGptModal .facegpt-prompts-fade {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  height: 28px !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

#faceGptModal .facegpt-prompts-fade-top {
  top: 0 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 100%) !important;
}

#faceGptModal .facegpt-prompts-fade-bottom {
  bottom: 0 !important;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 100%) !important;
}

#faceGptModal .facegpt-prompts-track {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
  animation: facegpt-scroll-questions 26s linear infinite !important;
}

#faceGptModal .facegpt-prompt-btn {
  appearance: none !important;
  border: 1px solid #dfe3e8 !important;
  background: #ffffff !important;
  border-radius: 999px !important;
  padding: 12px 24px !important;
  color: #687281 !important;
  font: 500 clamp(14px, 1.7vw, 18px)/1 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease !important;
}

#faceGptModal .facegpt-prompt-btn:hover {
  transform: translateY(-1px) !important;
  border-color: #d0d6dd !important;
  color: #404b58 !important;
}

#faceGptModal .facegpt-typing {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#faceGptModal .facegpt-typing span {
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: #8190a2 !important;
}

@keyframes facegpt-scroll-questions {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

@media (max-width: 760px) {
  #faceGptModal.facegpt-modal {
    padding: 0 !important;
  }

  #faceGptModal .facegpt-panel {
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    padding: 24px 18px 18px !important;
  }

  #faceGptModal .facegpt-panel.has-chat {
    padding-top: 18px !important;
  }

  #faceGptModal .facegpt-empty {
    margin-bottom: 16px !important;
  }

  #faceGptModal .facegpt-empty-title {
    font-size: clamp(22px, 8vw, 38px) !important;
    max-width: 340px !important;
  }

  #faceGptModal .facegpt-input-wrap {
    grid-template-columns: auto auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-radius: 28px !important;
  }

  #faceGptModal .facegpt-tool-btn,
  #faceGptModal .facegpt-mode-btn {
    height: 42px !important;
  }

  #faceGptModal .facegpt-tool-btn {
    width: 42px !important;
  }

  #faceGptModal .facegpt-mode-btn {
    padding: 0 12px !important;
    font-size: 14px !important;
  }

  #faceGptModal .facegpt-input {
    font-size: 16px !important;
    min-height: 36px !important;
  }

  #faceGptModal .facegpt-send {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }

  #faceGptModal .facegpt-model-btn {
    font-size: 12px !important;
  }

  #faceGptModal .facegpt-prompts {
    width: 100% !important;
    height: 156px !important;
  }

  #faceGptModal .facegpt-prompt-btn {
    max-width: 92vw !important;
    padding: 11px 18px !important;
    font-size: 13px !important;
  }

  #faceGptModal .facegpt-msg {
    max-width: 88% !important;
    padding: 13px 15px !important;
    font-size: 14px !important;
  }
}

/* Hero auto-metric mode */
.result-hero {
  overflow: hidden !important;
}

.hero-overlay {
  z-index: 8 !important;
  padding: 18px 22px 20px !important;
  background: linear-gradient(180deg, rgba(6, 9, 14, 0) 0%, rgba(7, 12, 19, 0.72) 68%, rgba(9, 14, 22, 0.84) 100%) !important;
}

.hero-meta {
  align-items: flex-end !important;
}

.hero-copy {
  display: flex !important;
  align-items: flex-end !important;
}

.hero-metric-name {
  font: 500 clamp(16px, 2.4vw, 28px)/1.04 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif !important;
  letter-spacing: -0.04em !important;
  color: rgba(236, 243, 250, 0.96) !important;
}

.hero-kicker,
.hero-grade,
.hero-slider-nav {
  display: none !important;
}

.hero-score-box {
  text-align: right !important;
}

.hero-score {
  font: 600 clamp(38px, 8vw, 88px)/0.92 Manrope, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif !important;
  letter-spacing: -0.05em !important;
}

.hero-score-unit {
  display: none !important;
}

@media (max-width: 760px) {
  .hero-overlay {
    padding: 14px 16px 16px !important;
  }

  .hero-metric-name {
    font-size: clamp(14px, 4vw, 20px) !important;
  }

  .hero-score {
    font-size: clamp(34px, 10vw, 60px) !important;
  }
}

/* 2026-03 flow stages: gender/upload/points */
body.is-flow-stage #appHead,
body.is-flow-stage #statusLine {
  display: none !important;
}

body.is-flow-stage .app-shell {
  gap: 0 !important;
}

body.is-flow-stage #mainCard.is-flow-shell {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
}

body.is-flow-stage #screenGender,
body.is-flow-stage #screenUpload,
body.is-flow-stage #screenPoints {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.is-gender-stage #screenGender {
  min-height: calc(100svh - 54px) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

body.is-gender-stage #screenGender > p,
body.is-gender-stage #screenGender .gender-grid,
body.is-gender-stage #screenGender #genderContinueBtn {
  width: min(100%, 760px) !important;
}

body.is-upload-stage #screenUpload,
body.is-points-stage #screenPoints {
  width: min(100%, 860px) !important;
  margin: 0 auto !important;
}

.upload-zone {
  --upload-stage-aspect: 1 / 1;
  width: min(100%, 760px) !important;
  aspect-ratio: var(--upload-stage-aspect) !important;
  min-height: 0 !important;
  max-height: none !important;
  place-self: center !important;
  margin: 0 auto !important;
  border-radius: 28px !important;
  overflow: hidden !important;
}

.upload-zone.has-image {
  background: linear-gradient(180deg, rgba(221, 229, 239, 0.9), rgba(210, 220, 233, 0.88)) !important;
}

.upload-zone.has-success {
  border-color: rgba(27, 182, 111, 0.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 40px rgba(18, 34, 52, 0.12) !important;
}

.upload-zone.has-error {
  border-color: rgba(235, 86, 104, 0.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 40px rgba(136, 29, 42, 0.12) !important;
}

.upload-preview {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: linear-gradient(180deg, #dfe7f2 0%, #cfd9e8 100%) !important;
}

.upload-placeholder {
  padding: 28px !important;
}

.remove-photo {
  top: 14px !important;
  right: 14px !important;
  width: 46px !important;
  height: 46px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(207, 213, 223, 0.9) !important;
}

.detected-badge {
  left: 16px !important;
  right: 16px !important;
  bottom: 16px !important;
  border-radius: 18px !important;
  padding: 12px 16px !important;
  background: linear-gradient(135deg, #22c86d 0%, #179853 100%) !important;
  color: #fff !important;
  font: 700 14px/1.2 Manrope, sans-serif !important;
  box-shadow: 0 14px 30px rgba(23, 152, 83, 0.3) !important;
}

.upload-detect-state {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 28px !important;
  text-align: center !important;
  background: linear-gradient(180deg, rgba(26, 31, 40, 0.04), rgba(26, 31, 40, 0.16)) !important;
  z-index: 4 !important;
}

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

.upload-detect-cross {
  position: relative !important;
  width: 64px !important;
  height: 64px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(235, 86, 104, 0.24) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 18px 32px rgba(148, 31, 48, 0.16) !important;
  animation: rd-pulse 1.7s ease-in-out infinite !important;
}

.upload-detect-cross span {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 30px !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.28) !important;
  transform-origin: center !important;
}

.upload-detect-cross span:first-child {
  transform: translate(-50%, -50%) rotate(45deg) !important;
}

.upload-detect-cross span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg) !important;
}

.upload-detect-state strong {
  font: 700 20px/1.1 Sora, Manrope, sans-serif !important;
  letter-spacing: -0.03em !important;
  color: #182334 !important;
}

.upload-detect-state span {
  max-width: 320px !important;
  color: #6f7d91 !important;
  font: 600 14px/1.35 Manrope, sans-serif !important;
}

body.is-points-stage .placement-stage {
  --placement-stage-aspect: 1 / 1;
  width: min(100%, 640px) !important;
  aspect-ratio: var(--placement-stage-aspect) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 auto !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, #dbe4ee 0%, #ccd7e6 100%) !important;
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
}

.placement-drag-pill {
  position: absolute !important;
  top: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  background: rgba(12, 16, 22, 0.38) !important;
  backdrop-filter: blur(8px) !important;
  color: rgba(255, 255, 255, 0.84) !important;
  font: 600 10px/1 Manrope, sans-serif !important;
  z-index: 7 !important;
  pointer-events: none !important;
}

.placement-drag-pill svg {
  width: 10px !important;
  height: 10px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
}

.crosshair {
  width: 72px !important;
  height: 72px !important;
  animation: rd-pulse 1.9s ease-in-out infinite !important;
  margin-left: 0 !important;
  margin-top: 0 !important;
  transform: translate(-50%, -50%) !important;
  touch-action: none !important;
}

.crosshair::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 999px !important;
  border: 2px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.22) !important;
  pointer-events: none !important;
}

.crosshair-corner {
  display: none !important;
}

.crosshair-line {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.crosshair-line::before,
.crosshair-line::after {
  content: "" !important;
  position: absolute !important;
  background: #ffffff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.86) !important;
  border-radius: 999px !important;
}

.crosshair-line.h::before,
.crosshair-line.h::after {
  top: 50% !important;
  width: 14px !important;
  height: 1px !important;
  transform: translateY(-50%) !important;
}

.crosshair-line.h::before {
  right: calc(50% + 12px) !important;
}

.crosshair-line.h::after {
  left: calc(50% + 12px) !important;
}

.crosshair-line.v::before,
.crosshair-line.v::after {
  left: 50% !important;
  width: 1px !important;
  height: 14px !important;
  transform: translateX(-50%) !important;
}

.crosshair-line.v::before {
  bottom: calc(50% + 12px) !important;
}

.crosshair-line.v::after {
  top: calc(50% + 12px) !important;
}

.crosshair-dot {
  width: 4px !important;
  height: 4px !important;
  margin: -2px 0 0 -2px !important;
  background: #ef4444 !important;
  border-radius: 999px !important;
  box-shadow: 0 0 0 1px #fff, 0 0 12px rgba(239, 68, 68, 0.34) !important;
}

.placement-float-controls,
.tagger-bottom-buttons {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 148px !important;
  height: 148px !important;
  pointer-events: none !important;
  z-index: 8 !important;
}

.placement-float-btn,
.tagger-bottom-buttons .tagger-nav-btn {
  pointer-events: auto !important;
  border: 1px solid rgba(220, 226, 234, 0.98) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12) !important;
  color: #5f6774 !important;
}

.placement-float-btn {
  position: absolute !important;
  width: 32px !important;
  height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  padding: 0 !important;
}

.placement-float-btn svg {
  width: 13px !important;
  height: 13px !important;
  stroke: currentColor !important;
  fill: none !important;
  stroke-width: 2 !important;
}

.placement-float-btn-icon {
  top: 2px !important;
  left: 2px !important;
}

.placement-float-btn-zoom {
  top: 2px !important;
  right: 2px !important;
  flex-direction: column !important;
  gap: 0 !important;
}

.placement-float-btn-zoom span {
  margin-top: -1px !important;
  font: 700 9px/1 Manrope, sans-serif !important;
}

.tagger-bottom-buttons {
  gap: 0 !important;
  bottom: auto !important;
}

.crosshair.is-dragging {
  transform: translate(-50%, -50%) scale(1.02) !important;
}

body.is-points-stage,
body.is-points-stage #mainCard,
body.is-points-stage #placementCanvas {
  touch-action: none !important;
  overscroll-behavior: none !important;
}

body.is-points-stage {
  overflow: hidden !important;
}

.tagger-bottom-buttons .tagger-nav-btn {
  position: absolute !important;
  bottom: 0 !important;
  min-width: 58px !important;
  height: 38px !important;
  border-radius: 12px !important;
  padding: 0 12px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font: 700 11px/1 Manrope, sans-serif !important;
}

.tagger-bottom-buttons .tagger-nav-btn-outline {
  left: -8px !important;
}

.tagger-bottom-buttons .tagger-nav-btn-dark {
  right: -8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #495365 !important;
}

.tagger-bottom-buttons .tagger-nav-btn:disabled {
  opacity: 0.34 !important;
}

@media (max-width: 760px) {
  body.is-flow-stage #mainCard.is-flow-shell {
    padding: 0 2px env(safe-area-inset-bottom) !important;
  }

  .upload-zone,
  body.is-points-stage .placement-stage {
    width: 100% !important;
    border-radius: 24px !important;
  }

  .placement-drag-pill {
    top: 10px !important;
  }
}

/* 2026-03 result screen: remove frames and scale content up */
body.is-result-mode .app-shell {
  width: min(1320px, calc(100vw - 18px)) !important;
  padding: 10px 10px 28px !important;
  gap: 18px !important;
}

body.is-result-mode .card,
#screenResult {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

#screenResult {
  padding: 4px 0 22px !important;
  gap: 22px !important;
}

.fiq-topbar,
.fiq-main-tabs,
.fiq-mode-strip,
.metrics-block,
.result-hero,
.hero-slider-nav {
  border: none !important;
  box-shadow: none !important;
}

.fiq-topbar,
.fiq-main-tabs,
.fiq-mode-strip,
.metrics-block {
  background: transparent !important;
}

.fiq-topbar {
  padding: 2px 0 0 !important;
  min-height: 0 !important;
}

.fiq-topbar-left {
  gap: 18px !important;
}

.fiq-main-tabs {
  padding: 4px 0 !important;
  gap: 18px !important;
}

.fiq-main-tabs button {
  min-height: 56px !important;
  padding: 15px 24px !important;
  font-size: clamp(16px, 1.6vw, 21px) !important;
  border-radius: 22px !important;
}

.fiq-main-tabs button.is-active {
  box-shadow: 0 10px 24px rgba(58, 96, 176, 0.15) !important;
}

.fiq-mode-strip {
  padding: 6px 0 !important;
  gap: 18px !important;
}

.fiq-mode-card {
  border: none !important;
  box-shadow: none !important;
  min-height: 112px !important;
  padding: 18px 20px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

.fiq-mode-card.is-active {
  background: rgba(241, 246, 254, 0.98) !important;
  box-shadow: 0 10px 28px rgba(120, 144, 184, 0.14) !important;
}

.fiq-mode-thumb {
  width: 76px !important;
  height: 76px !important;
  border-radius: 24px !important;
}

.fiq-mode-label {
  font-size: clamp(17px, 1.55vw, 22px) !important;
}

.fiq-mode-score {
  font-size: clamp(24px, 2.2vw, 34px) !important;
}

.result-hero {
  min-height: clamp(500px, 72vh, 1120px) !important;
  border-radius: 38px !important;
  background: #ffffff !important;
}

#resultCanvas {
  border-radius: 38px !important;
}

.hero-overlay {
  padding: 26px 28px 28px !important;
}

.hero-metric-name {
  font-size: clamp(28px, 3vw, 44px) !important;
}

.hero-score-label {
  font-size: clamp(18px, 1.7vw, 24px) !important;
}

.hero-score {
  font-size: clamp(72px, 11vw, 148px) !important;
  line-height: 0.9 !important;
}

.metrics-block {
  padding-bottom: 6px !important;
}

.metrics-head {
  padding: 12px 8px 16px !important;
}

.metrics-title {
  font-size: clamp(28px, 2.4vw, 38px) !important;
}

.metrics-list {
  padding: 0 !important;
  gap: 10px !important;
}

.metric-row {
  border: none !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04) !important;
  border-radius: 22px !important;
  padding: 18px 16px !important;
  margin-bottom: 10px !important;
}

.metric-name {
  font-size: clamp(17px, 1.55vw, 22px) !important;
}

.metric-score {
  font-size: clamp(28px, 2.3vw, 38px) !important;
}

.metric-row:hover {
  background: rgba(248, 250, 253, 0.98) !important;
}

@media (max-width: 760px) {
  body.is-result-mode .app-shell {
    width: calc(100vw - 8px) !important;
    padding: 6px 4px 18px !important;
    gap: 12px !important;
  }

  #screenResult {
    padding: 0 0 16px !important;
    gap: 16px !important;
  }

  .fiq-main-tabs {
    gap: 8px !important;
  }

  .fiq-main-tabs button {
    min-height: 50px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    border-radius: 18px !important;
  }

  .fiq-mode-strip {
    gap: 10px !important;
  }

  .fiq-mode-card {
    min-height: 94px !important;
    padding: 14px !important;
    border-radius: 22px !important;
  }

  .fiq-mode-thumb {
    width: 62px !important;
    height: 62px !important;
    border-radius: 20px !important;
  }

  .result-hero {
    min-height: clamp(430px, 60svh, 760px) !important;
    border-radius: 30px !important;
  }

  #resultCanvas {
    border-radius: 30px !important;
  }

  .hero-overlay {
    padding: 18px 18px 20px !important;
  }

  .hero-metric-name {
    font-size: clamp(20px, 5.5vw, 32px) !important;
  }

  .hero-score-label {
    font-size: 15px !important;
  }

  .hero-score {
    font-size: clamp(58px, 18vw, 92px) !important;
  }

  .metrics-title {
    font-size: 24px !important;
  }

  .metric-row {
    border-radius: 18px !important;
    padding: 16px 14px !important;
  }

  .metric-name {
    font-size: 16px !important;
  }

  .metric-score {
    font-size: 30px !important;
  }
}

/* 2026-03 metric detail stat cards: always one row */
.metric-detail-cards {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
  margin-bottom: 18px !important;
}

.metric-mini-card {
  min-height: 110px !important;
  padding: 18px 18px 16px !important;
  border-radius: 22px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.metric-mini-card span {
  margin-bottom: 10px !important;
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
}

.metric-mini-card strong {
  font-size: clamp(28px, 3vw, 42px) !important;
  line-height: 1.02 !important;
}

.metric-mini-card-accent em {
  font-size: 18px !important;
}

@media (max-width: 760px) {
  .metric-detail-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .metric-mini-card {
    min-height: 92px !important;
    padding: 14px 12px 12px !important;
    border-radius: 18px !important;
  }

  .metric-mini-card span {
    margin-bottom: 8px !important;
    font-size: 9px !important;
  }

  .metric-mini-card strong {
    font-size: clamp(19px, 6vw, 30px) !important;
  }

.metric-mini-card-accent em {
  font-size: 14px !important;
  }
}

/* 2026-03 FaceIQ mobile result page look */
body.is-result-mode {
  background: #ffffff !important;
}

body.is-result-mode .bg-glow {
  display: none !important;
}

body.is-result-mode .app-shell {
  width: min(100%, 480px) !important;
  padding: 0 0 22px !important;
  gap: 12px !important;
}

body.is-result-mode .app-head,
body.is-result-mode .status-line {
  display: none !important;
}

#screenResult {
  gap: 14px !important;
  padding: 0 12px 18px !important;
}

.fiq-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 8px 8px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.86) !important;
}

.fiq-brand {
  font-family: Manrope, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}

.fiq-topbar-right .fiq-link-btn:first-of-type,
.fiq-topbar-right .fiq-icon-btn:first-of-type {
  display: none !important;
}

.fiq-topbar-right {
  gap: 8px !important;
}

.fiq-icon-btn,
.fiq-link-btn {
  min-height: 34px !important;
  border-radius: 10px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #6b7280 !important;
  padding: 6px 8px !important;
}

.fiq-link-btn.fiq-link-muted span {
  background: #6b7280 !important;
  color: #fff !important;
}

.fiq-main-tabs {
  position: sticky !important;
  top: 52px !important;
  z-index: 29 !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  display: flex !important;
  gap: 2px !important;
  padding: 8px 0 10px !important;
  background: linear-gradient(180deg, rgba(249, 250, 251, 0.98), rgba(249, 250, 251, 0.88)) !important;
  border-bottom: 1px solid rgba(243, 244, 246, 0.95) !important;
}

.fiq-main-tabs::-webkit-scrollbar {
  display: none !important;
}

.fiq-main-tabs button {
  flex: 0 0 auto !important;
  min-height: 32px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #9ca3af !important;
  background: transparent !important;
  box-shadow: none !important;
}

.fiq-main-tabs button.is-active {
  color: #111827 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08) !important;
}

.fiq-mode-strip {
  margin-top: 4px !important;
  padding: 8px !important;
  gap: 10px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58)) !important;
  box-shadow: rgba(114, 131, 140, 0.1) 0 4px 24px, rgba(114, 131, 140, 0.08) 0 8px 48px, rgba(255, 255, 255, 0.9) 0 1px 1px inset !important;
}

.fiq-mode-card {
  min-height: 76px !important;
  padding: 10px !important;
  gap: 10px !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: none !important;
}

.fiq-mode-card.is-active {
  background: rgba(255, 255, 255, 0.94) !important;
}

.fiq-mode-thumb,
.fiq-mode-placeholder {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
}

.fiq-mode-copy strong {
  font-size: 11px !important;
  letter-spacing: 0.06em !important;
  color: #6b7280 !important;
}

.fiq-mode-score {
  font-size: 17px !important;
  color: #111827 !important;
}

.result-hero {
  position: relative !important;
  min-height: 0 !important;
  aspect-ratio: 3 / 4 !important;
  border-radius: 24px !important;
  padding: 2px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: rgba(255, 255, 255, 0.08) 0 0 60px, rgba(255, 255, 255, 0.05) 0 0 100px, rgba(0, 0, 0, 0.2) 0 8px 40px !important;
}

.result-hero::before,
.result-hero::after {
  display: none !important;
}

#resultCanvas {
  border-radius: 22px !important;
  background: linear-gradient(165deg, rgb(255, 255, 255) 0%, rgb(245, 247, 249) 25%, rgb(238, 241, 244) 50%, rgb(232, 236, 239) 75%, rgb(226, 230, 234) 100%) !important;
  filter: none !important;
}

.hero-overlay {
  padding: 0 !important;
  background: linear-gradient(to top, rgba(25, 30, 35, 0.92) 0%, rgba(25, 30, 35, 0.75) 30%, rgba(25, 30, 35, 0.4) 55%, rgba(25, 30, 35, 0.15) 75%, transparent 100%) !important;
  display: flex !important;
  align-items: flex-end !important;
}

.hero-meta {
  width: 100% !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  padding: 84px 20px 20px !important;
}

.hero-copy {
  max-width: 55% !important;
}

.hero-metric-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.hero-metric-name,
.hero-metric-sub {
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: rgba(0, 0, 0, 0.4) 0 1px 3px !important;
}

.hero-metric-sub {
  color: rgba(255, 255, 255, 0.55) !important;
}

.hero-score-box {
  text-align: right !important;
}

.hero-score {
  font-size: 48px !important;
  font-weight: 400 !important;
  line-height: 0.95 !important;
  letter-spacing: -0.04em !important;
  text-shadow: rgba(150, 170, 180, 0.22) 0 2px 20px, rgba(0, 0, 0, 0.25) 0 4px 30px !important;
}

.hero-score-unit {
  font-size: 14px !important;
  font-weight: 400 !important;
  margin-left: 3px !important;
  opacity: 0.7 !important;
  color: inherit !important;
}

.hero-grade {
  margin-top: 6px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  opacity: 0.95 !important;
}

body.is-result-mode .hero-meta {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
}

body.is-result-mode .hero-copy {
  display: flex !important;
  align-items: flex-end !important;
  max-width: 55% !important;
}

body.is-result-mode .hero-score {
  color: var(--hero-score-color, #ffffff) !important;
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
}

body.is-result-mode .fiq-mode-score {
  color: var(--mode-score-color, #111827) !important;
}

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

.metrics-block {
  position: relative !important;
  padding: 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
  box-shadow: rgba(114, 131, 140, 0.1) 0 4px 24px, rgba(114, 131, 140, 0.08) 0 8px 48px, rgba(255, 255, 255, 0.9) 0 1px 1px inset !important;
}

.metrics-head {
  padding: 2px 0 10px !important;
}

.metrics-topline {
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 10px !important;
}

.metrics-understanding {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: rgb(114, 131, 140) !important;
}

.metrics-facegpt {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: rgb(90, 106, 117) !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#downloadPdfBtn {
  display: none !important;
}

.metrics-unlock-btn {
  padding: 8px 12px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  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;
}

#resultRatiosTitle {
  font-size: 20px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  color: rgb(45, 54, 61) !important;
}

#metricFormula {
  display: none !important;
}

.metrics-list {
  padding: 0 !important;
}

.metric-row {
  position: relative !important;
  width: 100% !important;
  text-align: left !important;
  border: 0 !important;
  border-left: 2px solid transparent !important;
  border-bottom: 1px solid rgba(114, 131, 140, 0.06) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 12px 2px 12px 14px !important;
  margin: 0 !important;
}

.metric-row:first-child {
  border-top: 0 !important;
}

.metric-row:hover,
.metric-row.is-active {
  background: transparent !important;
}

.metric-row-main {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.metric-title-wrap {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.metric-name {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: rgba(0, 0, 0, 0.8) !important;
  letter-spacing: 0.02em !important;
  display: inline !important;
}

.metric-value {
  display: inline-block !important;
  margin-left: 8px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  vertical-align: middle !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: var(--metric-score-color, rgb(58, 140, 112)) !important;
  background: color-mix(in srgb, var(--metric-score-color, rgb(58, 140, 112)) 12%, transparent) !important;
}

.metric-score-wrap {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.metric-score {
  font-size: 28px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  color: var(--metric-score-color, rgb(81, 148, 110)) !important;
}

.metric-chevron {
  font-size: 22px !important;
  line-height: 1 !important;
  color: rgba(114, 131, 140, 0.3) !important;
}

.metric-row-bar {
  width: 74% !important;
  margin-top: 8px !important;
  opacity: 0.95 !important;
}

.metric-ideal {
  display: none !important;
}

.bar {
  position: relative !important;
  height: 10px !important;
  border-radius: 999px !important;
  overflow: visible !important;
  background: transparent !important;
}

.bar::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: 999px !important;
  opacity: 0.6 !important;
  background: linear-gradient(to right, rgba(180,80,80,0.6) 0%, rgba(190,114,85,0.6) 16%, rgba(195,149,75,0.6) 22%, rgba(35,120,135,0.6) 50%, rgba(195,149,75,0.6) 78%, rgba(180,80,80,0.6) 100%) !important;
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%) !important;
}

.bar::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: var(--metric-ideal-start, 42%) !important;
  width: var(--metric-ideal-width, 14%) !important;
  background: rgba(100, 180, 180, 0.15) !important;
  border: 1px solid rgba(100, 180, 180, 0.3) !important;
  border-radius: 999px !important;
}

.bar-fill {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  background: transparent !important;
  animation: none !important;
}

.bar-fill::after {
  content: "" !important;
  position: absolute !important;
  left: var(--metric-value-pos, 50%) !important;
  top: 50% !important;
  width: 16px !important;
  height: 9px !important;
  margin-left: -8px !important;
  margin-top: -4.5px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 2px solid rgb(114, 131, 140) !important;
  box-shadow: rgba(0, 0, 0, 0.2) 0 1px 4px !important;
}

@media (min-width: 761px) {
  body.is-result-mode .app-shell {
    width: min(430px, 100vw) !important;
  }
}

/* 2026-03 Telegram mini app safe area */
:root {
  --tg-viewport-height: 100dvh;
  --tg-top-safe: 0px;
  --tg-bottom-safe: 0px;
  /* Clamp overly conservative JS reserves so headers don't get huge on iOS/Telegram. */
  /* Need enough clearance for Dynamic Island + TG header buttons, but not the full 58px reserve. */
  --tg-top-safe-clamped: min(var(--tg-top-safe, 0px), 44px);
  --tg-bottom-safe-clamped: min(var(--tg-bottom-safe, 0px), 24px);
}

body.is-telegram-miniapp {
  overscroll-behavior: none !important;
}

body.is-telegram-miniapp .app-shell {
  min-height: var(--tg-viewport-height, 100dvh) !important;
}

body.is-telegram-miniapp .hub-shell {
  min-height: var(--tg-viewport-height, 100dvh) !important;
}

body.is-telegram-miniapp .hub-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  min-height: calc(28px + var(--tg-top-safe-clamped, 0px)) !important;
  padding: calc(var(--tg-top-safe-clamped, 0px) + 8px) 16px 12px !important;
  background: rgba(248, 248, 250, 0.96) !important;
  backdrop-filter: blur(16px) !important;
}

body.is-telegram-miniapp .hub-miniapp-title {
  font-family: Sora, Manrope, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  line-height: 1 !important;
  color: #0f172a !important;
}

body.is-telegram-miniapp .hub-body {
  padding-top: 6px !important;
}

body.is-telegram-miniapp.is-flow-stage #screenGender,
body.is-telegram-miniapp.is-flow-stage #screenUpload,
body.is-telegram-miniapp.is-flow-stage #screenPoints {
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 18px) !important;
}

body.is-telegram-miniapp.is-result-mode .fiq-topbar {
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 4px) !important;
}

body.is-telegram-miniapp.is-result-mode .fiq-main-tabs {
  top: calc(var(--tg-top-safe-clamped, 0px) + 56px) !important;
}

body.is-telegram-miniapp .metric-detail-header {
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 10px) !important;
}

body.is-telegram-miniapp #faceGptModal .facegpt-head {
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 8px) !important;
}

body.is-telegram-miniapp #faceGptModal .facegpt-close,
body.is-telegram-miniapp .metric-detail-close {
  top: calc(var(--tg-top-safe-clamped, 0px) + 16px) !important;
}

body.is-telegram-miniapp #faceGptModal .facegpt-panel {
  height: min(860px, calc(var(--tg-viewport-height, 100dvh) - 20px)) !important;
  max-height: calc(var(--tg-viewport-height, 100dvh) - 20px) !important;
}

@media (max-width: 760px) {
  body.is-telegram-miniapp .app-shell {
    width: 100% !important;
  }

  body.is-telegram-miniapp .hub-topbar {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body.is-telegram-miniapp.is-flow-stage #screenGender,
  body.is-telegram-miniapp.is-flow-stage #screenUpload,
  body.is-telegram-miniapp.is-flow-stage #screenPoints {
    padding-top: calc(var(--tg-top-safe-clamped, 0px) + 16px) !important;
  }
}

/* 2026-03 topbar/home simplification */
.metric-detail-header {
  position: relative !important;
  padding-right: 72px !important;
}

.metric-detail-header h3 {
  max-width: calc(100% - 72px) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.fiq-main-tabs {
  display: none !important;
}

.fiq-topbar {
  gap: 10px !important;
}

.fiq-topbar-left,
.fiq-topbar-right {
  gap: 10px !important;
}

.fiq-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-family: Sora, Manrope, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  color: #111827 !important;
}

.fiq-brand-logo,
.hub-miniapp-logo {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
}

.fiq-topbar-right {
  margin-left: auto !important;
}

.fiq-link-pill {
  min-height: 34px !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #374151 !important;
  border: 1px solid rgba(229, 231, 235, 0.92) !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06) !important;
}

.fiq-icon-btn-menu {
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  font-size: 24px !important;
  line-height: 1 !important;
  color: #6b7280 !important;
}

.hub-miniapp-title {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-family: Sora, Manrope, sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: -0.04em !important;
  color: #0f172a !important;
}

.hub-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

.hub-grid > .hub-action-card,
.hub-upgrade-card,
.hub-footer,
.hub-section-head .hub-inline-link,
.hub-latest-actions {
  display: none !important;
}

.hub-grid-wrap {
  margin-bottom: 0 !important;
}

.hub-latest-card,
.hub-history-card {
  width: 100% !important;
}

.hub-history-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
}

.hub-history-start-btn {
  appearance: none !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #223552, #15253d) !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  font: 700 13px/1 Manrope, sans-serif !important;
  box-shadow: 0 10px 22px rgba(21, 37, 61, 0.18) !important;
  cursor: pointer !important;
}

@media (max-width: 760px) {
  .fiq-brand {
    font-size: 17px !important;
  }

  .fiq-brand-logo,
  .hub-miniapp-logo {
    width: 17px !important;
    height: 17px !important;
  }

  .metric-detail-header {
    padding-right: 64px !important;
  }

  .metric-detail-header h3 {
    max-width: calc(100% - 64px) !important;
    font-size: 22px !important;
    line-height: 1.1 !important;
  }
}

.fiq-topbar-right .fiq-link-btn:first-of-type,
.fiq-topbar-right .fiq-icon-btn:first-of-type {
  display: inline-flex !important;
}

.hub-miniapp-title,
.fiq-brand {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
}

.hub-miniapp-logo,
.fiq-brand-logo {
  width: 56px !important;
  height: 56px !important;
  object-fit: contain !important;
}

.fiq-topbar {
  position: sticky !important;
  top: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  grid-template-rows: auto auto !important;
  align-items: center !important;
  justify-content: normal !important;
  min-height: 80px !important;
  padding: 2px 10px 6px !important;
  z-index: 30 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.86) !important;
}

.fiq-topbar-left {
  width: auto !important;
  justify-content: center !important;
  justify-self: center !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.fiq-topbar-right {
  position: static !important;
  transform: none !important;
  justify-self: center !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  margin-left: 0 !important;
  margin-top: 2px !important;
}

.hub-grid {
  width: 100% !important;
  max-width: 360px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.hub-latest-card {
  grid-column: span 2 !important;
  grid-row: span 2 !important;
  min-height: 244px !important;
}

.hub-grid > .hub-action-card {
  display: flex !important;
}

.hub-upgrade-card {
  display: flex !important;
}

.hub-footer {
  display: flex !important;
}

.hub-section-head .hub-inline-link {
  display: inline-flex !important;
}

.hub-latest-actions {
  display: none !important;
}

.hub-latest-thumb {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  display: block !important;
}

.hub-latest-visual {
  overflow: hidden !important;
}

.hub-history-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  margin-top: 8px !important;
}

.hub-history-empty[hidden],
.hub-history-list[hidden] {
  display: none !important;
}

.fiq-mode-thumb {
  object-fit: cover !important;
  display: block !important;
}

.metrics-sort-wrap {
  position: relative !important;
}

.metrics-sort-btn {
  appearance: none !important;
  border: 1px solid rgba(207, 213, 223, 0.92) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #5a6a75 !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  font: 600 10px/1 Manrope, sans-serif !important;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08) !important;
}

#downloadResultBtn {
  appearance: none !important;
  border: 1px solid rgba(207, 213, 223, 0.92) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #5a6a75 !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  font: 600 10px/1 Manrope, sans-serif !important;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08) !important;
}

#downloadResultBtn:hover {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(186, 196, 210, 0.98) !important;
}

.metrics-sort-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  min-width: 148px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 8px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(214, 221, 230, 0.92) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.12) !important;
  z-index: 20 !important;
}

.metrics-sort-menu[hidden] {
  display: none !important;
}

.metrics-sort-option {
  appearance: none !important;
  border: 0 !important;
  background: transparent !important;
  color: #495666 !important;
  text-align: left !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  font: 600 12px/1.1 Manrope, sans-serif !important;
}

.metrics-sort-option.is-active {
  background: rgba(230, 238, 248, 0.9) !important;
  color: #162235 !important;
}

.hub-history-item {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.hub-history-thumb {
  width: 64px !important;
  height: 64px !important;
  border-radius: 18px !important;
  object-fit: cover !important;
  background: linear-gradient(180deg, #d7dce5, #c5ccd9) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset !important;
  flex: 0 0 auto !important;
}

.hub-history-thumb-placeholder {
  background: linear-gradient(180deg, #d7dce5, #c5ccd9) !important;
}

.hub-history-item-main {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.hub-history-item-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.hub-history-item-row strong {
  font: 700 16px/1 Manrope, sans-serif !important;
  color: #111827 !important;
}

.hub-history-item-date,
.hub-history-item-sub {
  font: 500 13px/1.2 Manrope, sans-serif !important;
  color: #9aa4b2 !important;
}

.hub-history-item-sub {
  display: flex !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}

.hub-history-item-arrow {
  color: #c5ccd6 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

.result-hero {
  aspect-ratio: var(--result-hero-aspect, 3 / 4) !important;
  padding: 0 !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
}

#resultCanvas {
  background: transparent !important;
}

.metric-detail-header {
  position: sticky !important;
  top: 0 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 20px 20px 14px !important;
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 12px) !important;
  z-index: 40 !important;
}

.metric-detail-header h3 {
  flex: 1 1 auto !important;
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.02 !important;
}

.metric-detail-close {
  position: static !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.metric-detail-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body.is-telegram-miniapp.is-result-mode .fiq-topbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  padding: calc(var(--tg-top-safe-clamped, 0px) + 2px) 10px 6px !important;
}

body.is-telegram-miniapp .metric-detail-header {
  padding: 20px 20px 14px !important;
  padding-top: calc(var(--tg-top-safe-clamped, 0px) + 12px) !important;
}

body.is-upload-stage .row-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.is-upload-stage #screenUpload.is-side-upload .row-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#uploadSkipBtn[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .hub-miniapp-logo,
  .fiq-brand-logo {
    width: 56px !important;
    height: 56px !important;
  }

  .hub-grid {
    max-width: 360px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .hub-latest-card {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
  }

  .hub-history-thumb {
    width: 58px !important;
    height: 58px !important;
    border-radius: 16px !important;
  }

  body.is-upload-stage .row-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.is-upload-stage #screenUpload.is-side-upload .row-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .fiq-topbar {
    min-height: 70px !important;
    padding: 0 6px 8px !important;
  }

  .fiq-link-pill,
  .fiq-icon-btn-menu {
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
  }

  .metrics-sort-btn {
    padding: 7px 10px !important;
    font-size: 10px !important;
  }

  #downloadResultBtn {
    padding: 7px 10px !important;
    font-size: 10px !important;
  }

  .metric-detail-header {
    padding: 18px 16px 12px !important;
    padding-top: calc(var(--tg-top-safe-clamped, 0px) + 10px) !important;
  }
}

/* 2026-03 compact mobile result topbar (remove big empty whitespace) */
body.is-result-mode .fiq-topbar {
  min-height: 0 !important;
  align-content: start !important;
}

@media (max-width: 760px) {
  body.is-result-mode .fiq-topbar {
    padding-top: 0 !important;
    padding-bottom: 6px !important;
    row-gap: 2px !important;
  }

  body.is-result-mode .hero-meta {
    flex-direction: row !important;
    align-items: flex-end !important;
  }

  body.is-result-mode .hero-score-box {
    text-align: right !important;
  }

  body.is-result-mode .fiq-topbar-right {
    margin-top: 0 !important;
  }

  body.is-telegram-miniapp.is-result-mode .fiq-topbar {
    /* Keep a little breathing room under Telegram chrome, but don't waste space. */
    padding-top: calc(var(--tg-top-safe-clamped, 0px) + 6px) !important;
  }
}
