/* ==========================================================================
   Schmoozle Badge Maker Stylesheet
   Device-only, temporary badge & profile creation UI.
   Midnight family themes:
     - Dark: Midnight Night (Deep Navy #0A0E1C & Ambient Drifting Lights)
     - Light: Midnight Day (Cool Bluish Paper #F5F7FB & Sky Wash, NEVER cream)
   ========================================================================== */

/* All theme color tokens and ambient lighting are centrally managed in /styles.css */

/* --------------------------------------------------------------------------
   Layout & Container
   -------------------------------------------------------------------------- */
.create-body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Mode-dependent visibility */
.is-view-mode .create-edit-only {
  display: none !important;
}

.is-edit-mode .create-view-only {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Floating Introduction Dialog / Explainer
   -------------------------------------------------------------------------- */
.create-intro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 15, 0.76);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  animation: introBackdropIn 0.25s var(--transition-fast) both;
}

[data-theme="light"] .create-intro-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.create-intro-backdrop[hidden] {
  display: none !important;
}

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

.create-intro-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 32px 28px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: introCardScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.create-intro-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.create-intro-brand-icon {
  width: 52px;
  height: 52px;
}

.create-intro-wordmark {
  font-family: ui-serif, "New York", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}

.create-intro-badge {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent-primary);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-subtle);
  border-radius: var(--radius-full);
  margin: 0 auto 24px;
}

.create-intro-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.create-intro-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 1.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.create-intro-lead {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.create-intro-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.create-intro-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.create-check-icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.create-intro-item strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary);
}

.create-intro-item p {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--color-text-tertiary);
}

.create-intro-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.btn-intro-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-accent-primary);
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--color-accent-subtle);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.btn-intro-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}

.create-intro-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.create-intro-checkbox-label:hover {
  color: var(--color-text-primary);
}

.create-intro-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent-primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Topbar Header & Theme Toggle
   -------------------------------------------------------------------------- */
.create-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 28px) 14px;
  border-bottom: 1px solid var(--color-border-hairline);
  gap: 10px;
}

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

.badge-maker-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent-primary);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-subtle);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-maker-indicator-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.create-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Theme Switcher Button (Night vs Day) */
.theme-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-switch-pill:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
  border-color: var(--color-border-strong);
}

.theme-switch-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.topbar-toggle-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-accent-primary);
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.topbar-toggle-mode-btn:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.topbar-toggle-mode-btn:active {
  transform: translateY(0);
}

.topbar-toggle-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Avatar Upload Interactive Frame: Perfect Concentric Alignment
   -------------------------------------------------------------------------- */
.avatar-frame {
  margin: 0 auto;
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-sizing: border-box;
  /* Own compositing layer: iOS Safari otherwise skips repainting a new photo inside the flip card until scroll */
  transform: translateZ(0);
}

@media (min-width: 480px) {
  .avatar-frame {
    width: 124px;
    height: 124px;
  }
}

.create-avatar-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.create-avatar-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 10;
}

/* Empty state: flush edge-to-edge inside avatar-frame, perfectly centered */
.create-avatar-empty-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-bg-subtle);
  border-radius: inherit;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.create-avatar-wrap:hover .create-avatar-empty-state {
  color: var(--color-accent-primary);
  background: var(--color-bg-hover);
}

.create-avatar-hover-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(10, 14, 28, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: inherit;
  color: #ffffff;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  z-index: 5;
}

.create-avatar-wrap:hover .create-avatar-hover-overlay,
.create-avatar-wrap:focus-within .create-avatar-hover-overlay {
  opacity: 1;
}

.create-avatar-icon {
  width: 24px;
  height: 24px;
}

.create-avatar-label {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.create-avatar-remove-btn {
  display: block;
  /* Pull up into the profile row's 16px gap so it sits 8px under the avatar */
  margin: -8px auto 0;
  padding: 4px 14px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.create-avatar-remove-btn:hover {
  color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

/* --------------------------------------------------------------------------
   Centered Hero Presentation & Inputs
   -------------------------------------------------------------------------- */
.vcard-hero {
  padding: 32px clamp(20px, 5vw, 36px) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero-profile-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  width: 100%;
}

.hero-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.create-hero-inputs {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  gap: 0;
}

.hero-identity > .create-view-only {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  width: 100%;
}

.create-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font: inherit;
  text-align: center;
  padding: 6px 12px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.create-input:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-hairline);
}

.create-input:focus-visible {
  outline: none;
  background: var(--color-bg-subtle);
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 2px var(--color-border-hairline);
}

.create-name-input {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5.5vw, 2.7rem);
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 6px 14px 1px;
}

.create-name-input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.6;
}

.create-role-input {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  font-weight: 600;
  line-height: normal;
  color: var(--color-text-primary);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 7px 12px 2px;
}

.create-role-input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.6;
}

.create-location-pill-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 5px 14px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.create-location-pill-wrap .location-icon {
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.create-location-pill-wrap:focus-within,
.create-location-pill-wrap:has(.create-location-input:not(:placeholder-shown)) {
  border-color: var(--color-border-strong);
  color: var(--color-text-secondary);
}

.create-location-pill-wrap:focus-within .location-icon,
.create-location-pill-wrap:has(.create-location-input:not(:placeholder-shown)) .location-icon {
  opacity: 1;
}

.create-location-input {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-raleway);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  width: 175px;
}

.create-location-input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.6;
  font-weight: 400;
}

.create-location-input:focus-visible {
  outline: none;
  background: transparent;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Clear Button for Inputs on Hover / Focus
   -------------------------------------------------------------------------- */
.create-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.create-hero-inputs .create-input-wrap:nth-child(2) {
  max-width: 440px;
  margin: -2px auto 0;
}

.create-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-bg-hover);
  color: var(--color-text-tertiary);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.85);
  transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.create-input-wrap .create-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) scale(0.85);
}

.create-bio-wrap {
  position: relative;
}

.create-bio-wrap .create-clear-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  transform: scale(0.85);
}

.create-location-pill-wrap .create-clear-btn {
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-right: -2px;
}

.create-clear-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.create-location-pill-wrap .create-clear-btn svg {
  width: 10px;
  height: 10px;
}

.create-clear-btn:hover {
  background: var(--color-border-strong);
  color: var(--color-text-primary);
}

/* Visibility: only shown when input has text AND (hovered or focused) */
.create-input-wrap:hover:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-input-wrap:focus-within:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-input-wrap.has-value:hover .create-clear-btn,
.create-input-wrap.has-value:focus-within .create-clear-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.create-field-card:hover:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-field-card:focus-within:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-field-card.has-value:hover .create-clear-btn,
.create-field-card.has-value:focus-within .create-clear-btn,
.create-location-pill-wrap:hover:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-location-pill-wrap:focus-within:has(input:not(:placeholder-shown)) .create-clear-btn,
.create-location-pill-wrap.has-value:hover .create-clear-btn,
.create-location-pill-wrap.has-value:focus-within .create-clear-btn,
.create-bio-wrap:hover:has(textarea:not(:placeholder-shown)) .create-clear-btn,
.create-bio-wrap:focus-within:has(textarea:not(:placeholder-shown)) .create-clear-btn,
.create-bio-wrap.has-value:hover .create-clear-btn,
.create-bio-wrap.has-value:focus-within .create-clear-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Generous Bio Editor (Heavier font weight 500, 18px size)
   -------------------------------------------------------------------------- */
.create-bio-wrap {
  width: 100%;
  max-width: 480px;
  margin: 18px auto 0;
}

.create-bio-input {
  width: 100%;
  min-height: 135px;
  font-family: "Lato", var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-primary);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  resize: vertical;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.create-bio-input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.7;
  font-weight: 400;
}

.create-bio-input:hover {
  border-color: var(--color-border-strong);
}

.create-bio-input:focus-visible {
  outline: none;
  background: var(--color-bg-surface);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

/* --------------------------------------------------------------------------
   Structured Form Sections: Proper Horizontal Padding
   -------------------------------------------------------------------------- */
.create-section {
  padding: 30px clamp(20px, 5vw, 36px) 0;
  margin-top: 10px;
  border-top: 1px solid var(--color-border-hairline);
  width: 100%;
}

.create-section-header {
  margin-bottom: 14px;
  text-align: center;
}

.create-section-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
}

.create-section-note {
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

/* Contact Details Fields Grid */
.create-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

@media (min-width: 520px) {
  .create-section-header {
    text-align: left;
  }

  .create-fields-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phones get roomier fields with 18px text (16px or more also stops iOS zooming in on focus) */
.create-field-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.create-field-card:focus-within {
  background: var(--color-bg-surface);
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

.create-field-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast);
}

.create-field-card:focus-within .create-field-icon {
  color: var(--color-accent-primary);
}

.create-field-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--color-text-primary);
}

.create-field-input:focus-visible {
  outline: none;
}

.create-field-input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.7;
}

@media (min-width: 520px) {
  .create-field-card {
    gap: 10px;
    padding: 10px 14px;
  }

  .create-field-icon {
    width: 17px;
    height: 17px;
  }

  .create-field-input {
    font-size: 13.5px;
  }
}

/* --------------------------------------------------------------------------
   Done / View Actions with Generous Padding
   -------------------------------------------------------------------------- */
.create-actions-bottom {
  padding: 24px clamp(20px, 5vw, 36px) 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.btn-view-badge-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-accent-primary);
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--color-accent-subtle);
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-view-badge-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--color-accent-subtle);
}

.btn-view-badge-primary:active {
  transform: translateY(0);
}

/* Device Notice Pill */
.device-badge-notice {
  margin: 24px clamp(20px, 5vw, 36px) 0;
  padding: 14px 18px;
  background: var(--color-bg-subtle);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.device-badge-notice-text {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Discussion Topics Section (Edit Mode 2x2 Grid & Badge View Chips)
   -------------------------------------------------------------------------- */
.create-topics-edit-section {
  width: 100%;
  max-width: 480px;
  margin: 22px auto 0;
  text-align: left;
}

.create-topics-edit-section .create-section-header {
  text-align: center;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Ellipsis Menu: App Version
   -------------------------------------------------------------------------- */
/* Plain text under its own divider, dimmer than the items and not tappable */
.topbar-menu-version {
  padding: 6px 12px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  user-select: none;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Scannable Badge Face: Vertically Centered in the Window
   -------------------------------------------------------------------------- */
/* Phones: the face fills the screen, so the content takes the space below the topbar and centers in it */
.vcard-container.is-flipped .badge-hero {
  flex: 1;
  justify-content: center;
}

/* Wider screens: the face is a floating card, so the card itself centers in the window */
@media (min-width: 680px) {
  .vcard-container.is-flipped {
    align-self: center;
  }
}

/* --------------------------------------------------------------------------
   Scannable Badge Face: Sized to Be Read from Further Away, as on the App's Badge
   -------------------------------------------------------------------------- */
.badge-hero {
  padding-left: 20px;
  padding-right: 20px;
}

.badge-hero .badge-qr-box {
  width: 232px;
  height: 232px;
  padding: 14px;
}

.badge-hero .badge-name-heading {
  font-size: 2.4rem;
}

.badge-hero .badge-role-title {
  font-size: 26px;
  line-height: 1.3;
}

/* No extra margin, so the hero's gap spaces both dividers evenly around the location */
.badge-hero .badge-divider {
  margin: 0 auto;
}

/* Regular weight instead of light, so the thin strokes hold up at a distance */
.badge-hero .badge-bio {
  font-weight: 400;
  font-size: 24px;
  line-height: 1.35;
}

.badge-hero .location-pill.badge-location {
  color: var(--color-text-secondary);
}

.badge-hero .badge-location .location-icon {
  width: 15px;
  height: 15px;
}

.badge-hero .badge-topics-section {
  margin-top: 24px;
}

.badge-hero .badge-topics-kicker {
  margin-bottom: 16px;
  font-size: 15px;
}

.badge-hero .badge-topics-list {
  gap: 12px 11px;
}

.badge-hero .badge-topic-chip {
  padding: calc(7px + 0.09em) 16px calc(7px - 0.09em);
  font-size: 19px;
}

@media (min-width: 480px) {
  .badge-hero {
    padding-left: 32px;
    padding-right: 32px;
  }

  .badge-hero .badge-qr-box {
    width: 248px;
    height: 248px;
    padding: 15px;
  }

  .badge-hero .badge-name-heading {
    font-size: 2.75rem;
  }

  .badge-hero .badge-role-title {
    font-size: 28px;
  }

  .badge-hero .badge-topic-chip {
    font-size: 20px;
  }
}

/* --------------------------------------------------------------------------
   Profile Face: Dividers Spaced Evenly around the Location
   -------------------------------------------------------------------------- */
.hero-identity .location-pill {
  margin-top: 14px;
}

.vcard-hero > .hero-divider {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   3D Flip Rotation between Edit Mode and Profile Preview
   -------------------------------------------------------------------------- */
.vcard-container.is-mode-flipping-forward .vcard-flipper {
  animation: vcardModeFlipForward 0.65s linear forwards;
}

.vcard-container.is-mode-flipping-backward .vcard-flipper {
  animation: vcardModeFlipBackward 0.65s linear forwards;
}

@keyframes vcardModeFlipForward {
  0% {
    transform: rotateY(0deg);
    animation-timing-function: cubic-bezier(0.45, 0.03, 0.85, 0.55);
  }
  50% {
    transform: rotateY(-90deg);
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  50.01% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

@keyframes vcardModeFlipBackward {
  0% {
    transform: rotateY(0deg);
    animation-timing-function: cubic-bezier(0.45, 0.03, 0.85, 0.55);
  }
  50% {
    transform: rotateY(90deg);
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  50.01% {
    transform: rotateY(-90deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

/* --------------------------------------------------------------------------
   Footer Brand Emphasis
   -------------------------------------------------------------------------- */
.profile-footer-brand {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Pull to Refresh (Home Screen app only, which has no browser reload control)
   -------------------------------------------------------------------------- */
.is-standalone-app,
.is-standalone-app body {
  overscroll-behavior-y: none;
}

.pull-refresh {
  --pull-distance: 0px;
  --pull-progress: 0;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  z-index: 130;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-floating);
  color: var(--color-text-secondary);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(var(--pull-distance) - 56px));
}

.pull-refresh.is-pulling {
  opacity: 1;
}

.pull-refresh.is-settling {
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.pull-refresh-icon {
  width: 18px;
  height: 18px;
  transform: rotate(calc(var(--pull-progress) * 270deg));
}

.pull-refresh.is-ready {
  color: var(--color-accent-primary);
}

.pull-refresh.is-refreshing .pull-refresh-icon {
  animation: pullRefreshSpin 0.8s linear infinite;
}

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