:root {
  --bg:           #f6f8fc;
  --surface:      #ffffff;
  --surface-soft: #f0f4fb;
  --ink:          #0a1f44;
  --ink-mid:      #2c3e60;
  --ink-soft:     #5a6b85;
  --line:         #e2e8f3;
  --line-soft:    #eef2fa;
  --accent:       #1e6cf7;
  --accent-deep:  #1554d4;
  --accent-soft:  #e9f0ff;
  --online:       #22c55e;
  --offline:      #c9d1e0;
  --danger:       #ef4444;

  --shadow-card: 0 1px 2px rgba(10, 31, 68, .04), 0 8px 24px rgba(10, 31, 68, .06);
  --shadow-soft: 0 1px 1px rgba(10, 31, 68, .04), 0 2px 6px rgba(10, 31, 68, .04);
  --shadow-lift: 0 10px 30px rgba(10, 31, 68, .12);

  --radius-card:  14px;
  --radius-input: 10px;
  --radius-pill:  999px;

  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 12% -10%, rgba(30, 108, 247, .14), transparent 60%),
    radial-gradient(ellipse 70% 60% at 110% 10%, rgba(120, 95, 255, .12), transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 110%, rgba(34, 197, 94, .07), transparent 60%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 28px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 720px;
  padding: 4px 4px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  padding: 0;
  margin: 0;
  cursor: pointer;
  pointer-events: auto;
  font-family: inherit;
  box-shadow: var(--shadow-soft);
  transition: background .15s, border-color .15s, transform .15s;
}
.topbar-icon:hover { background: var(--surface); border-color: #c9d4ea; }
.topbar-icon:active { transform: translateY(1px); }
.topbar-icon:focus-visible {
  outline: none;
  box-shadow: var(--shadow-soft), 0 0 0 4px rgba(30, 108, 247, .15);
}
.topbar-icon svg { display: block; }
.topbar-burger { background: var(--surface); }

.stage {
  width: 100%;
  max-width: 560px;
  padding: 24px 8px 0;
}

.progress-bar {
  height: 3px;
  background: var(--line-soft);
  border-radius: 999px;
  margin: 0 0 28px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #7858ff);
  border-radius: 999px;
  transition: width .45s cubic-bezier(.2,.9,.3,1);
}

.screen { display: none; }
.screen.active {
  display: block;
  animation: stage-in .45s cubic-bezier(.2,.9,.3,1) both;
}

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

.screen.active > * {
  animation: child-in .55s cubic-bezier(.2,.9,.3,1) both;
}
.screen.active > *:nth-child(1) { animation-delay: .02s; }
.screen.active > *:nth-child(2) { animation-delay: .08s; }
.screen.active > *:nth-child(3) { animation-delay: .14s; }
.screen.active > *:nth-child(4) { animation-delay: .20s; }
.screen.active > *:nth-child(5) { animation-delay: .26s; }
.screen.active > *:nth-child(6) { animation-delay: .32s; }
.screen.active > *:nth-child(7) { animation-delay: .38s; }
.screen.active > *:nth-child(8) { animation-delay: .44s; }

@keyframes child-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@-webkit-keyframes jello-horizontal {
  0% { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); }
  30% { -webkit-transform: scale3d(1.25, .75, 1); transform: scale3d(1.25, .75, 1); }
  40% { -webkit-transform: scale3d(.75, 1.25, 1); transform: scale3d(.75, 1.25, 1); }
  50% { -webkit-transform: scale3d(1.15, .85, 1); transform: scale3d(1.15, .85, 1); }
  65% { -webkit-transform: scale3d(.95, 1.05, 1); transform: scale3d(.95, 1.05, 1); }
  75% { -webkit-transform: scale3d(1.05, .95, 1); transform: scale3d(1.05, .95, 1); }
  100% { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); }
}
@keyframes jello-horizontal {
  0% { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); }
  30% { -webkit-transform: scale3d(1.25, .75, 1); transform: scale3d(1.25, .75, 1); }
  40% { -webkit-transform: scale3d(.75, 1.25, 1); transform: scale3d(.75, 1.25, 1); }
  50% { -webkit-transform: scale3d(1.15, .85, 1); transform: scale3d(1.15, .85, 1); }
  65% { -webkit-transform: scale3d(.95, 1.05, 1); transform: scale3d(.95, 1.05, 1); }
  75% { -webkit-transform: scale3d(1.05, .95, 1); transform: scale3d(1.05, .95, 1); }
  100% { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); }
}

.attention-jello {
  transform-origin: center;
  will-change: transform;
}
.screen.active .attention-jello,
.topbar-icon.attention-jello {
  -webkit-animation: jello-horizontal .9s both;
  animation: jello-horizontal .9s both;
}

h1, h2 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 12px;
  text-wrap: balance;
}

.hero-sub {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  text-wrap: balance;
}

.hero-from-city {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: -6px 0 12px;
  text-wrap: balance;
}
.hero-from-city:empty { display: none; }

/* Inviter banner — shown on screenLanding when utm_source is present */
.inviter-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}
.inviter-banner[hidden] { display: none; }
.inviter-banner img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.inviter-banner .inviter-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inviter-banner .inviter-text {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.3;
}
.inviter-banner .inviter-text strong {
  color: var(--ink);
  font-weight: 700;
}

@keyframes skeleton-shimmer {
  from { background-position: 0 0; }
  to   { background-position: -200% 0; }
}

body.is-loading .skeleton-text:empty {
  display: block;
  height: 1em;
  width: 60%;
  margin: 8px auto;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f0f3f8 50%, #e5e7eb 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s linear infinite;
}
body.is-loading .skeleton-text:empty.skeleton-hero   { height: 1.5em; width: 80%; margin: 12px auto; }
body.is-loading .skeleton-text:empty.skeleton-narrow { width: 40%; height: .9em; }

body.is-loading #landingBtn { visibility: hidden; }

h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}

.caption {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 16px;
}
.caption-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.caption-stack span { display: block; }

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  margin-bottom: 4px;
  box-shadow: var(--shadow-soft);
}
input::placeholder { color: var(--ink-soft); opacity: .75; }
input:hover { border-color: #c9d4ea; }
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 108, 247, .15);
}
input.error,
input:focus.error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }

input + input { margin-top: 10px; }

.identifier-field {
  width: 100%;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-soft);
  margin-bottom: 4px;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.identifier-field:hover { border-color: #c9d4ea; }
.identifier-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 108, 247, .15);
}
.identifier-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 0 14px;
  border-right: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.identifier-field[data-mode="email"] .identifier-prefix { display: none; }
.identifier-field input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  background: transparent;
  min-width: 0;
}
.identifier-field input:hover,
.identifier-field input:focus {
  border-color: transparent;
  box-shadow: none;
}
.identifier-mode-switch {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.35;
}

.password-field {
  position: relative;
}
.password-field input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  transition: background .15s, color .15s;
}
.password-toggle:hover { background: var(--surface-soft); color: var(--ink); }
.password-toggle .eye-off { display: none; }
.password-toggle.is-showing .eye-on  { display: none; }
.password-toggle.is-showing .eye-off { display: block; }

button.primary,
button.secondary,
button.ghost {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .005em;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  cursor: pointer;
  margin-top: 14px;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s, color .18s;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 1px rgba(30,108,247,.3), 0 6px 18px rgba(30,108,247,.28);
}
button.primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { background: #b6c8ee; box-shadow: none; cursor: not-allowed; transform: none; }

button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}
button.secondary:hover { background: var(--surface-soft); border-color: #c9d4ea; }

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
button.ghost:hover { background: var(--surface); color: var(--ink); }

.error-msg {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin: 6px 0 2px;
  text-align: left;
}

.link-muted {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
}
.link-muted:hover { color: var(--accent); }
.link-muted.is-hidden { display: none; }

.teaser {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 6px 6px 0;
  overflow: hidden;
  margin-bottom: 22px;
}

.teaser-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 348px;
  overflow: hidden;
  position: relative;
}

.teaser-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  transition: transform .55s cubic-bezier(.2,.9,.3,1), opacity .35s;
  will-change: transform, opacity;
}
.teaser-row:not(:last-child) { border-bottom: 1px solid var(--line-soft); border-radius: 10px 10px 0 0; }

.teaser-row.is-stalker {
  background: linear-gradient(180deg, rgba(239, 68, 68, .07), rgba(239, 68, 68, .03));
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .42);
  border-bottom-color: rgba(239, 68, 68, .22);
}
.teaser-row.is-entering {
  animation: teaser-enter .55s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes teaser-enter {
  from { opacity: 0; transform: translateY(-14px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.teaser-row.is-leaving {
  animation: teaser-leave .35s ease forwards;
}
@keyframes teaser-leave {
  to { opacity: 0; transform: translateY(8px); }
}

.teaser-avatar {
  position: relative;
  width: 42px; height: 42px;
  flex-shrink: 0;
}
.teaser-avatar-photo {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-soft);
}
.teaser-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(4.05px) saturate(.85);
  transform: scale(1.15);
}
.teaser-avatar-photo img.v {
  filter: none;
  transform: none;
}

.teaser-status-dot {
  position: absolute;
  right: 0; bottom: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--offline);
}
.teaser-status-dot.online {
  background: var(--online);
  animation: dot-pulse 2s ease-out infinite;
}
@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.teaser-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.teaser-name-bar {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #d8e0ee 0%, #e9eef8 60%, #d8e0ee 100%);
  background-size: 200% 100%;
  filter: blur(2.4px);
  animation: name-shimmer 6s linear infinite;
}
.teaser-name-bar.on {
  height: auto;
  background: none;
  filter: none;
  animation: none;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.teaser-name-bar.w-50 { width: 38%; }
.teaser-name-bar.w-65 { width: 48%; }
.teaser-name-bar.w-80 { width: 58%; }
.teaser-name-bar.w-40 { width: 30%; }

@keyframes name-shimmer {
  from { background-position: 0 0; }
  to   { background-position: -200% 0; }
}

.teaser-time {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.teaser-stalker {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #b91c1c;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

.teaser-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--surface) 80%);
  pointer-events: none;
}

.teaser-lock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(246, 248, 252, .5), var(--surface-soft));
}
.teaser-lock svg { color: var(--accent); }

.account-search-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.account-search-photo {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.account-search-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}

.users-tracking-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 39px;
  font-size: 13px;
  color: var(--ink-soft);
}
.users-tracking-icon {
  width: 96px;
  height: 36px;
  flex-shrink: 0;
}
.users-tracking-text { line-height: 1.3; }

.method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 4px;
}

.method-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color .18s, background .18s, box-shadow .18s;
  user-select: none;
  box-shadow: var(--shadow-soft);
}
.method-option:hover { border-color: #c9d4ea; }
.method-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(30, 108, 247, .12);
}
.method-option .radio {
  width: 20px; height: 20px;
  border: 2px solid #b6c2d8;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.method-option.selected .radio { border-color: var(--accent); }
.method-option.selected .radio::after {
  content: '';
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
}
.method-option .icon { font-size: 18px; }

.account-pic,
.account-pic-fallback {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.account-pic-fallback {
  background: var(--surface-soft);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.status-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
  box-shadow: var(--shadow-soft);
}
.status-icon[data-tone="lock"]   { background: var(--accent-soft); color: var(--accent); }
.status-icon[data-tone="search"] { background: var(--surface-soft); color: var(--ink-mid); }
.status-icon[data-tone="warn"]   { background: #fff1d6; color: #b76d00; }

.captcha-img {
  max-width: 100%;
  border-radius: 10px;
  margin-bottom: 12px;
  background: var(--surface-soft);
}

.account-header {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.account-header img,
.account-header-fallback {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.account-header-fallback {
  background: var(--surface-soft);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.account-header-name { color: var(--ink); }

.success-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.success-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .18);
  flex-shrink: 0;
}

.visitor-feed {
  margin: 18px 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.visitor-feed::-webkit-scrollbar { width: 8px; }
.visitor-feed::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.visitor-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .18s;
}
.visitor-row:last-child { border-bottom: none; }
.visitor-row:hover { background: var(--surface-soft); }

.visitor-avatar-wrap {
  position: relative;
  width: 48px; height: 48px;
  flex-shrink: 0;
}
.visitor-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
}
.visitor-status-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--offline);
}
.visitor-status-dot.online {
  background: var(--online);
  animation: dot-pulse 2s ease-out infinite;
}

.visitor-meta { min-width: 0; }
.visitor-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visitor-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 3px;
}
.visitor-sub .dot-sep { margin: 0 6px; opacity: .6; }

.visitor-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .15s, transform .15s;
  white-space: nowrap;
  margin: 0;
}
.visitor-cta:hover { background: #d8e6ff; transform: translateY(-1px); }
.visitor-cta:active { transform: translateY(0); }

.back-bar {
  display: flex;
  align-items: center;
  margin: -8px -8px 14px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  margin: 0;
  transition: background .15s, transform .15s;
}
.back-btn:hover { background: var(--surface-soft); transform: translateX(-2px); }
.back-btn svg { color: var(--accent); }

.visit-history-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.visit-history-head .visit-avatar-wrap {
  position: relative;
  width: 56px; height: 56px;
  flex-shrink: 0;
}
.visit-history-head .visit-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
}
.visit-history-head .visit-status-dot {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--offline);
}
.visit-history-head .visit-status-dot.online {
  background: var(--online);
  animation: dot-pulse 2s ease-out infinite;
}
.visit-history-head .visit-account-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.visit-history-head .visit-account-summary {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.visit-history {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.visit-history::-webkit-scrollbar { width: 8px; }
.visit-history::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.visit-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.visit-row:last-child { border-bottom: none; }
.visit-row .visit-marker {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .65;
}
.visit-row .visit-date {
  color: var(--ink);
  font-weight: 500;
}
.visit-row .visit-time {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

button.share-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #7858ff 100%);
  border: none;
  box-shadow: 0 1px 1px rgba(30,108,247,.3), 0 8px 22px rgba(120, 88, 255, .35);
}
button.share-cta:hover {
  background: linear-gradient(135deg, var(--accent-deep) 0%, #6243e5 100%);
}
button.share-cta svg { flex-shrink: 0; }

.visitor-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .005em;
}
.visitor-feed-head .count-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
}

/* ---------- Referral raffle (screen4) ---------- */

.raffle-block {
  margin-top: 22px;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.raffle-block[hidden] { display: none; }

.raffle-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.raffle-progress {
  height: 8px;
  margin: 16px 0 8px;
  background: var(--line-soft);
}
.raffle-progress .progress-fill {
  background: linear-gradient(90deg, var(--accent) 0%, #7858ff 100%);
}

.raffle-progress-label {
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--ink-mid);
}

.raffle-invites {
  margin: 14px 0 16px;
  max-height: 260px;
}
.raffle-invites .visitor-feed-head { padding: 10px 14px; }

.raffle-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.raffle-invite-row:first-child { border-top: none; }
.raffle-invite-row .where { color: var(--ink); font-weight: 600; }
.raffle-invite-row .when {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.raffle-invite-empty {
  padding: 18px 14px;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}

.raffle-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.raffle-share-row > button { flex: 1 1 200px; }

.raffle-entry-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.raffle-entry-form[hidden] { display: none; }
.raffle-entry-form h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.raffle-entry-form .caption { margin: 0; }
.raffle-entry-form input { margin: 0; }

.raffle-entered-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(34, 197, 94, .10);
  border: 1px solid rgba(34, 197, 94, .35);
  border-radius: var(--radius-card);
  color: var(--ink);
  font-weight: 600;
}
.raffle-entered-msg[hidden] { display: none; }

@media (max-width: 540px) {
  .page { padding: 20px 14px 36px; }
  .stage { padding-top: 12px; }
  .hero-title { font-size: 26px; }
  .account-search-head { gap: 14px; }
  .account-search-photo { width: 56px; height: 56px; }
  .account-search-title { font-size: 19px; }
  .visitor-row { grid-template-columns: 44px 1fr auto; padding: 12px 14px; gap: 12px; }
  .visitor-avatar-wrap, .visitor-avatar { width: 44px; height: 44px; }
  .raffle-block { padding: 16px; }
  .raffle-share-row > button { flex: 1 1 100%; }
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 14px auto;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, .12);
  border-top-color: var(--brand, #1877f2);
  animation: spinner-rotate 0.85s linear infinite;
}
@keyframes spinner-rotate { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
