/* ============================================================================
   base.css — reset, themed backdrop, page chrome, identity hero (compact).
   data-theme = card palette · data-bg = readable text on page bg · data-frame.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  /* iOS clips horizontal overflow only when it's on <html> too, not just <body>;
     overscroll-behavior-x stops the sideways rubber-band drag either way. */
  overflow-x: hidden; overscroll-behavior-x: none; }
body {
  margin: 0; min-height: 100vh; width: 100%; max-width: 100%;
  background: var(--profile-bg);
  color: var(--profile-fg);
  font-family: var(--profile-font);
  font-size: var(--profile-fs-body);
  line-height: var(--profile-lh-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; overscroll-behavior-x: none;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--profile-accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--profile-accent); color: var(--profile-accent-text); }

/* themed backdrop (switches with data-theme); custom bg layer (#xprf-bg-custom)
   is injected by apply.js above this at z-index -1 when a profile sets one. */
.xprf-bg-layer { position: fixed; inset: 0; z-index: -2; background: var(--profile-page-bg); }
.xprf-bg-image { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; filter: blur(var(--profile-bg-blur)); }

/* Ambient cursor spotlight — a soft accent glow that follows the pointer so the
   backdrop reads as depth, not a flat fill. Sits on the themed backdrop only
   (z-index -2), behind a custom wallpaper (-1) and all content. Off by default;
   revealed only on a fine pointer, and skipped entirely when the profile sets
   its own wallpaper (data-custom-bg="1"). Light themes get a fainter glow so it
   never smudges a near-white page. JS (boot.js) feeds --mx/--my; without it the
   glow just rests centred. */
.xprf-bg-layer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity var(--profile-dur-slow, .5s) var(--profile-ease, ease);
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 26%),
              color-mix(in srgb, var(--profile-accent) var(--spot-a, 11%), transparent) 0%,
              transparent 62%);
}
:root[data-bg="light"] .xprf-bg-layer::after { --spot-a: 6%; }
@media (hover: hover) and (pointer: fine) {
  :root[data-custom-bg="0"] .xprf-bg-layer::after { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .xprf-bg-layer::after { transition: none; } }

:where(a, button, [tabindex], input, textarea, select):focus-visible {
  outline: var(--profile-focus-width) solid var(--profile-accent);
  outline-offset: var(--profile-focus-offset); border-radius: 8px;
}

/* --- page scaffold ------------------------------------------------------ */
.xprf-page { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 100%; min-width: 0; padding: 0 var(--profile-page-pad) var(--profile-space-12); }
.xprf-column { width: 100%; max-width: var(--profile-page-maxw); min-width: 0; margin-top: var(--profile-space-10); }

/* --- top bar ------------------------------------------------------------ */
/* detached utility layer pinned to the page's top-right corner — a single light
   frame wrapping the toggle + Connect, with a right margin off the scrollbar. */
.xprf-topbar {
  position: absolute; top: var(--profile-space-3); right: var(--profile-space-4); left: auto; transform: none; z-index: 10;
  width: auto; max-width: none;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; padding: 4px; min-height: 0;
  background: color-mix(in srgb, var(--profile-surface) 62%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius-pill);
  box-shadow: var(--profile-shadow-card);
}
/* faded brand so the profile owner is the focus, not the platform (audit §1) */
.xprf-brand {
  display: inline-flex; align-items: center; gap: var(--profile-space-2);
  color: var(--profile-on-bg-muted); font-size: var(--profile-fs-sm);
  font-weight: var(--profile-fw-semibold); letter-spacing: -0.01em; opacity: 0.4;
  transition: opacity var(--profile-dur-base) var(--profile-ease), color var(--profile-dur-fast) var(--profile-ease);
}
.xprf-brand:hover { text-decoration: none; color: var(--profile-on-bg); opacity: 0.85; }
.xprf-brand img { height: 20px; width: auto; }
/* very narrow phones: keep topbar from overflowing (audit §2) */
@media (max-width: 360px) {
  .xprf-topbar { gap: var(--profile-space-2); }
  .xprf-brand span { display: none; }
}
/* Mobile PUBLIC view: hide the wallet Connect in the floating topbar so it
   never crowds/overlaps the Share button. Owners connect from the dashboard;
   the donate block still triggers connect on demand. The editor keeps Connect. */
@media (max-width: 600px) {
  body:not(.xprf-editing) #profile-connect-mount { display: none; }
  /* tighter identity stat-chips so Portfolio · NFTs · Tokens read as one set */
  .xprf-stats { gap: 6px; }
  .xprf-stat { height: 30px; padding: 0 11px; gap: 6px; }
  .xprf-stat__ic { width: 14px; height: 14px; }
}
/* dark/light toggle — sliding pill switch (sun=light/left, moon=dark/right) */
/* flat icon-only toggle (sun/moon) — no border/fill, subtle disc on hover */
.xprf-theme-toggle {
  flex: none; padding: 0; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%;
  background: transparent; border: 0; opacity: 0.75;
  color: var(--profile-fg); cursor: pointer;
  transition: background var(--profile-dur-fast) var(--profile-ease), opacity var(--profile-dur-fast) var(--profile-ease);
}
.xprf-theme-toggle:hover { background: var(--profile-surface-hover); opacity: 1; }
.xprf-theme-toggle svg { width: 17px; height: 17px; }

#profile-connect-mount { display: inline-flex; min-height: var(--profile-touch-min); align-items: center; }
/* keep the Connect button light & quiet: no fill, hairline border */
/* Connect sits inside the topbar frame — keep it transparent (frame is the box) */
#profile-connect-mount > button,
#profile-connect-mount .xwk-legacy-fallback,
.xprf-connect-ghost {
  background: transparent; border: 1px solid transparent;
  color: var(--profile-fg); box-shadow: none;
  border-radius: var(--profile-radius-pill);
  min-height: 32px; padding: 0 11px; font-weight: var(--profile-fw-semibold);
  font-size: 12px; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--profile-dur-fast) var(--profile-ease), background var(--profile-dur-fast) var(--profile-ease);
}
#profile-connect-mount > button:hover,
#profile-connect-mount .xwk-legacy-fallback:hover,
.xprf-connect-ghost:hover {
  border-color: color-mix(in srgb, var(--profile-accent) 55%, var(--profile-border));
  background: color-mix(in srgb, var(--profile-accent) 8%, transparent);
}

/* ---- Wallet Kit theming -------------------------------------------------
   The kit bakes hard-coded .xwk-* colours at create() and exposes no runtime
   theme setter, so we map its surfaces to our THEME-AWARE tokens. Because the
   tokens flip with [data-theme], the Connect button + wallet modal follow
   light/dark instantly — no re-mount needed. ------------------------------ */
/* Connect / account button — blends into our topbar frame */
#profile-connect-mount .xwk-button-root button,
#profile-connect-mount .xwk-account-button,
#profile-connect-mount .xwk-connect-button {
  background: transparent !important; border-color: transparent !important;
  color: var(--profile-fg) !important; box-shadow: none !important;
}
#profile-connect-mount .xwk-button-label,
#profile-connect-mount .xwk-button-root button span { color: var(--profile-fg) !important; }
#profile-connect-mount .xwk-button-root button:hover {
  background: color-mix(in srgb, var(--profile-accent) 12%, transparent) !important;
}
/* light theme: soften the Connect label + icon (full --profile-fg reads too heavy) */
:root[data-theme="light"] #profile-connect-mount .xwk-button-root button,
:root[data-theme="light"] #profile-connect-mount .xwk-button-label,
:root[data-theme="light"] #profile-connect-mount .xwk-button-root button span,
:root[data-theme="light"] #profile-connect-mount .xwk-button-root button svg {
  color: var(--profile-muted) !important;
}
:root[data-theme="light"] #profile-connect-mount .xwk-button-root button svg [fill]:not([fill="none"]) { fill: var(--profile-muted) !important; }
:root[data-theme="light"] #profile-connect-mount .xwk-button-root button svg [stroke]:not([stroke="none"]) { stroke: var(--profile-muted) !important; }
/* public topbar: cap the connected button (name + balance can be long) so it
   truncates with an ellipsis instead of stretching the floating topbar */
body:not(.xprf-editing) #profile-connect-mount .xwk-button-label {
  display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
/* wallet-select modal: use the kit's OWN built-in dark/light theme — no custom
   CSS overrides (they masked the native theme + added borders the kit doesn't).
   Theme is driven purely by ui.mode passed to create() in kit-init.js. */

/* --- identity hero (compact) -------------------------------------------- */
/* flex column so the name row and the id-pill ALWAYS stack — they're both
   inline-flex, so a short name + no bio would otherwise let them share a row. */
.xprf-identity { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
/* no cover -> keep the share button clear of the very top */
.xprf-identity:not(:has(.xprf-cover)) .xprf-share-btn--cover { top: 0; }
.xprf-cover {
  position: relative; width: 100%; aspect-ratio: 16 / 6;
  border-radius: var(--profile-block-radius); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--profile-accent) 52%, var(--profile-bg)) 0%, color-mix(in srgb, var(--profile-accent-2) 42%, var(--profile-bg)) 100%);
  box-shadow: var(--profile-shadow-card);
}
.xprf-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 42%, color-mix(in srgb, var(--profile-bg) 55%, transparent) 100%); }
.xprf-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Readability veil — a soft theme-toned halo behind the identity text, shown
   ONLY when the profile sets a custom wallpaper (data-custom-bg="1"). It lifts
   the name / bio / chips off a busy background in both light and dark: the tint
   follows --profile-bg, which flips with the theme, so it darkens under a dark
   page and lightens under a light one. The cover and avatar keep their own
   stacking layer above it and stay crisp. The default backdrop gets no veil —
   text there sits on a solid page and needs none. */
.xprf-identity > * { position: relative; z-index: 1; }
:root[data-custom-bg="1"] .xprf-identity::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  inset: 24% -6% -6% -6%;
  background: radial-gradient(72% 78% at 50% 42%,
    color-mix(in srgb, var(--profile-bg) 58%, transparent) 0%, transparent 72%);
}

.xprf-avatar-wrap { margin-top: -46px; display: flex; justify-content: center; position: relative; z-index: 1; }
/* cover=none -> avatar sits at top with breathing room (no overlap) */
.xprf-identity:not(:has(.xprf-cover)) .xprf-avatar-wrap { margin-top: var(--profile-space-8); }

/* clean flat 4px ring matching the page base — "cut into" the cover, no busy
   accent-ring + glow stack (audit 1.3) */
.xprf-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  background: var(--profile-surface); border: 4px solid var(--profile-bg);
  box-shadow: var(--profile-shadow-card);
}
/* avatar size = large (helpful when the cover is hidden) */
:root[data-avatar-size="large"] .xprf-avatar { width: 124px; height: 124px; border-width: 5px; }
:root[data-avatar-size="large"] .xprf-avatar-wrap { margin-top: -62px; }
/* large avatar WITHOUT a cover: the -62px pull would clip the avatar against the
   page top — keep positive breathing room instead (higher specificity so it wins
   over the rule above, which has equal specificity to the no-cover rule). */
:root[data-avatar-size="large"] .xprf-identity:not(:has(.xprf-cover)) .xprf-avatar-wrap { margin-top: var(--profile-space-8); }

.xprf-name-row { margin-top: var(--profile-space-4); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.xprf-display-name {
  font-family: var(--profile-font-heading); font-size: var(--profile-fs-display);
  font-weight: var(--profile-fw-black); line-height: var(--profile-lh-tight);
  letter-spacing: var(--profile-track-tight); text-wrap: balance;
  color: var(--profile-on-bg); text-shadow: var(--profile-on-bg-shadow);
}
/* icon-only verified seal (X-style): just the tick, no pill / no label.
   Sits inline next to the display name, vertically centred. */
.xprf-verified { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.xprf-verified svg { width: 21px; height: 21px; flex: none; color: var(--profile-accent);
  filter: drop-shadow(0 0 4px var(--profile-accent-glow)); }
/* gold 'Organization' tier — same seal, distinct gold fill */
.xprf-verified--org svg { color: #f4b731; filter: drop-shadow(0 0 4px color-mix(in srgb, #f4b731 55%, transparent)); }

/* page-level loading skeleton — mirrors the profile layout so content fades in
   instead of blank → snap. Shimmer sweep; respects reduced-motion. */
.xprf-pageskel { display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%; max-width: var(--profile-page-maxw); margin: 0 auto; padding: 18px var(--profile-page-pad) 40px; }
.xprf-sk { position: relative; overflow: hidden; background: var(--profile-surface);
  border: 1px solid var(--profile-border); border-radius: 16px; }
.xprf-sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--profile-fg) 8%, transparent), transparent);
  animation: xprf-sksweep 1.25s infinite; }
@keyframes xprf-sksweep { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .xprf-sk::after { animation: none; } }
.xprf-pageskel__cover  { width: 100%; aspect-ratio: 16 / 6; border-radius: 20px; }
.xprf-pageskel__avatar { width: 96px; height: 96px; border-radius: 50%; margin-top: -58px; }
.xprf-pageskel__name   { width: 210px; height: 26px; border-radius: 9px; }
.xprf-pageskel__pill   { width: 190px; height: 34px; border-radius: 999px; }
.xprf-pageskel__block  { width: 100%; height: 116px; border-radius: 18px; margin-top: 6px; }
.xprf-bio-wrap { margin-top: var(--profile-space-2); max-width: 46ch; text-align: center; }
.xprf-bio {
  margin: 0 auto; color: var(--profile-on-bg-muted); font-size: var(--profile-fs-sm);
  text-wrap: pretty; white-space: pre-line; text-shadow: var(--profile-on-bg-shadow);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.xprf-bio.is-expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
.xprf-bio-toggle {
  margin-top: 6px; display: inline-block; background: none; border: 0; padding: 2px 4px;
  color: var(--profile-on-bg); font-size: var(--profile-fs-sm); font-weight: var(--profile-fw-semibold);
  cursor: pointer; text-decoration: underline; opacity: 0.9;
}
.xprf-bio-toggle:hover { opacity: 1; }

/* identity stat-chips ($ portfolio · NFTs · tokens) — aggregated from blocks */
.xprf-stats { margin-top: var(--profile-space-3); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--profile-space-2); }
.xprf-stats:empty { display: none; }
.xprf-stat {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--profile-radius-pill); background: var(--profile-surface);
  border: 1px solid var(--profile-border); box-shadow: var(--profile-shadow-card);
  font-size: var(--profile-fs-sm); white-space: nowrap; flex: none;
}
.xprf-stat__v, .xprf-stat__l { white-space: nowrap; }
.xprf-stat__ic { width: 15px; height: 15px; flex: none; color: var(--profile-accent-ink); }
.xprf-stat__v { font-weight: var(--profile-fw-bold); color: var(--profile-fg); font-variant-numeric: tabular-nums; }
.xprf-stat__l { color: var(--profile-muted); font-weight: var(--profile-fw-medium); }
/* loading skeleton chip — fixed size so the stats bar holds its space (no CLS) */
.xprf-stat.is-loading { min-width: 96px; justify-content: center; }
.xprf-stat__sk { width: 60px; height: 12px; border-radius: 6px; }

/* primary address pill (it's a surface, so uses surface palette) */
.xprf-id-pill {
  margin-top: var(--profile-space-4); display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--profile-touch-min); padding: 0 var(--profile-space-4) 0 var(--profile-space-3);
  border-radius: var(--profile-radius-pill); background: var(--profile-surface);
  border: 1px solid var(--profile-border); box-shadow: var(--profile-shadow-card);
  color: var(--profile-fg); font-size: var(--profile-fs-sm); font-weight: var(--profile-fw-semibold);
  transition: border-color var(--profile-dur-base) var(--profile-ease), transform var(--profile-dur-fast) var(--profile-ease), box-shadow var(--profile-dur-base) var(--profile-ease);
}
.xprf-id-pill:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--profile-accent) 60%, var(--profile-border)); box-shadow: var(--profile-shadow-card), 0 0 22px -6px var(--profile-accent-glow); }
.xprf-id-pill .xprf-id-pill__addr { color: var(--profile-muted); font-family: var(--profile-font-mono); font-size: var(--profile-fs-xs); letter-spacing: -0.02em; }
.xprf-id-pill .xprf-copy-ico { width: 15px; height: 15px; color: var(--profile-muted); transition: transform var(--profile-dur-fast) var(--profile-ease), color var(--profile-dur-fast) var(--profile-ease); }
.xprf-id-pill:hover .xprf-copy-ico { transform: scale(1.12); color: var(--profile-fg); }

/* identity pill row: holds the id-pill + optional "get xrpname" CTA */
.xprf-id-row { margin-top: var(--profile-space-4); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.xprf-id-row .xprf-id-pill { margin-top: 0; }
.xprf-getname {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; height: 34px;
  border-radius: var(--profile-radius-pill); background: var(--profile-accent-tint); color: var(--profile-accent-ink);
  border: 1px solid color-mix(in srgb, var(--profile-accent) 26%, transparent);
  font-size: var(--profile-fs-xs); font-weight: var(--profile-fw-bold); text-decoration: none; white-space: nowrap;
  transition: border-color var(--profile-dur-base) var(--profile-ease), transform var(--profile-dur-fast) var(--profile-ease);
}
.xprf-getname:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--profile-accent) 55%, transparent); text-decoration: none; }
.xprf-getname__i { width: 14px; height: 14px; color: var(--profile-accent); flex: none; }
/* "on-chain since" — quiet, compact metadata chip (not a CTA). Short text only. */
.xprf-agechip {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; height: 28px;
  border-radius: var(--profile-radius-pill); background: var(--profile-surface-2);
  border: 1px solid var(--profile-hairline); color: var(--profile-muted);
  font-size: var(--profile-fs-xs); font-weight: var(--profile-fw-semibold);
  white-space: nowrap; flex: none;
}
.xprf-agechip__i { width: 13px; height: 13px; flex: none; color: var(--profile-accent);
  filter: drop-shadow(0 0 4px var(--profile-accent-glow)); }
.xprf-agechip__v { letter-spacing: .01em; }

/* --- blocks stack ------------------------------------------------------- */
.xprf-blocks { margin-top: var(--profile-space-6); display: flex; flex-direction: column; gap: var(--profile-block-gap); }

/* CONTAINED frame: one surface card wrapping all blocks, hairline dividers */
:root[data-frame="contained"] .xprf-blocks {
  background: var(--profile-surface); border: 1px solid var(--profile-border);
  border-radius: calc(var(--profile-block-radius) + 6px);
  padding: var(--profile-space-2) var(--profile-space-4);
  box-shadow: var(--profile-shadow-card); gap: 0;
}
:root[data-frame="contained"] .xprf-blocks > .xprf-block {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  padding: var(--profile-space-5) 0;                 /* more air around each divider */
}
:root[data-frame="contained"] .xprf-blocks > .xprf-block::before { display: none; }
:root[data-frame="contained"] .xprf-blocks > .xprf-block + .xprf-block { border-top: 1px solid var(--profile-border); }
/* collapsed blocks: lift the floating "Show all" clear of the divider so it
   never sits on the hairline between blocks */
:root[data-frame="contained"] .xprf-blocks > .xprf-block.is-collapsed { padding-bottom: 46px; }
:root[data-frame="contained"] .xprf-blocks > .xprf-block.is-collapsed .xprf-more { bottom: 22px; }
:root[data-frame="contained"] .xprf-blocks > .xprf-block:hover { transform: none; box-shadow: none; border-color: transparent; border-top-color: var(--profile-border); }
:root[data-frame="contained"] .xprf-blocks > .xprf-block:hover + .xprf-block { border-top-color: var(--profile-border); }

/* --- footer ------------------------------------------------------------- */
.xprf-footer { margin-top: var(--profile-space-8); text-align: center; color: var(--profile-on-bg-muted); font-size: var(--profile-fs-xs); }
.xprf-footer a { color: var(--profile-on-bg-muted); }
.xprf-footer a:hover { color: var(--profile-on-bg); }

/* --- owner edit pill (floating) ----------------------------------------- */
.xprf-edit-pill {
  position: fixed; right: var(--profile-space-5); bottom: var(--profile-space-5); z-index: 40;
  display: inline-flex; align-items: center; gap: var(--profile-space-2);
  min-height: var(--profile-touch-min); padding: 0 var(--profile-space-5);
  border-radius: var(--profile-radius-pill); background: var(--profile-accent); color: var(--profile-accent-text);
  font-weight: var(--profile-fw-bold); font-size: var(--profile-fs-sm);
  box-shadow: var(--profile-shadow-pop), var(--profile-glow);
  transition: transform var(--profile-dur-fast) var(--profile-ease);
}
.xprf-edit-pill:hover { text-decoration: none; transform: translateY(-2px); }
.xprf-edit-pill svg { width: 17px; height: 17px; }

/* --- share button + sheet (page-level) ---------------------------------- */
.xprf-share-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: transparent; border: 1px solid var(--profile-border); color: var(--profile-on-bg); transition: border-color var(--profile-dur-fast) var(--profile-ease), background var(--profile-dur-fast) var(--profile-ease); }
.xprf-share-btn:hover { border-color: color-mix(in srgb, var(--profile-accent) 55%, var(--profile-border)); background: color-mix(in srgb, var(--profile-accent) 8%, transparent); }
.xprf-share-btn--cover {
  position: absolute; top: 10px; right: 10px; left: auto; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(8, 9, 16, 0.40); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);   /* stays legible on any cover (audit 1.2) */
  transition: background var(--profile-dur-fast) var(--profile-ease), border-color var(--profile-dur-fast) var(--profile-ease);
}
.xprf-share-btn--cover:hover { background: rgba(8, 9, 16, 0.64); border-color: rgba(255, 255, 255, 0.36); }
/* MOBILE ONLY (moved here by apply.js positionToggle): the theme toggle sits on
   the cover just left of the Share button, styled to match it as a pair. On
   desktop the toggle stays in the topbar and this class is not applied. */
.xprf-theme-toggle--oncover {
  position: absolute; top: 10px; right: 52px; left: auto; z-index: 3;   /* share right(10)+width(36)+gap(6) */
  width: 36px; height: 36px; opacity: 1;
  background: rgba(8, 9, 16, 0.40); border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.xprf-theme-toggle--oncover:hover { background: rgba(8, 9, 16, 0.64); border-color: rgba(255, 255, 255, 0.36); }
.xprf-identity:not(:has(.xprf-cover)) .xprf-theme-toggle--oncover { top: 0; }
/* topbar collapses to nothing on mobile once the toggle has moved to the cover */
.xprf-topbar.is-empty { display: none; }
.xprf-share { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; background: rgba(5,6,12,.66); animation: xprf-overlay-in var(--profile-dur-base) var(--profile-ease) both; }
@media (min-width: 560px) { .xprf-share { place-items: center; padding: var(--profile-space-5); } }
@keyframes xprf-sheet-up { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
.xprf-share__panel { width: 100%; max-width: 540px; background: var(--profile-surface); border: 1px solid var(--profile-border); border-radius: 22px 22px 0 0; box-shadow: var(--profile-shadow-pop); padding: var(--profile-space-5); animation: xprf-sheet-up var(--profile-dur-base) var(--profile-ease) both; }
@media (min-width: 560px) { .xprf-share__panel { border-radius: 22px; animation: xprf-panel-in var(--profile-dur-base) var(--profile-ease) both; } }
@media (prefers-reduced-motion: reduce) { .xprf-share, .xprf-share__panel { animation: none; } }
.xprf-share__head { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: var(--profile-space-4); }
.xprf-share__head h3 { font-size: 15px; font-weight: var(--profile-fw-black); }
.xprf-share__x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--profile-surface-2); border: 1px solid var(--profile-border); color: var(--profile-muted); }
/* Deep glass hero — a fixed dark base (not theme-mixed) so the white name/handle
   always read, in both light and dark profiles, with a soft accent halo behind
   the avatar for depth. */
.xprf-share__card {
  position: relative; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
  background:
    radial-gradient(130% 92% at 50% -12%, color-mix(in srgb, var(--profile-accent) 46%, transparent) 0%, transparent 68%),
    linear-gradient(162deg, #121a30 0%, #0a0e1c 100%);
  padding: 26px 16px 22px; text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
}
.xprf-share__av { width: 72px; height: 72px; margin: 0 auto; position: relative; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.16), 0 10px 26px -10px rgba(0,0,0,.55); }
.xprf-share__av img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.xprf-share__mono { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #13233f; color: #7ad4f7; font: 900 30px/1 var(--profile-font); }
.xprf-share__vrf { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; color: var(--profile-accent); }
.xprf-share__vrf svg { width: 22px; height: 22px; }
.xprf-share__vrf.is-org { color: #f4b731; filter: drop-shadow(0 0 4px rgba(244, 183, 49, .5)); }
.xprf-share__name { margin-top: 11px; font-size: 17px; font-weight: var(--profile-fw-black); color: #fff; letter-spacing: -.02em; }
.xprf-share__handle { margin-top: 2px; font-size: 12px; color: rgba(255,255,255,.85); font-family: var(--profile-font-mono); }
/* QR reveals with a smooth slide-down (animating max-height) so the social
   buttons below glide instead of jumping (audit: layout jank). */
@keyframes xprf-qr-reveal { from { opacity: 0; max-height: 0; margin-top: 0; } to { opacity: 1; max-height: 210px; margin-top: var(--profile-space-4); } }
.xprf-share__qr {
  width: 188px; height: 188px; max-height: 210px; margin: var(--profile-space-4) auto 0;
  border-radius: 14px; overflow: hidden; background: #fff; line-height: 0;
  border: 1px solid var(--profile-border); box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.3);
  animation: xprf-qr-reveal var(--profile-dur-base) var(--profile-ease) both;
}
.xprf-share__qr svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .xprf-share__qr { animation: none; } }
/* Share targets — one cohesive tonal row (kills the rainbow of brand circles).
   Each tile rests as glass; on hover/focus it fills with its brand colour
   (--brand, fed by share.js) and lifts. QR falls back to the profile accent. */
.xprf-share__targets { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 10px; margin-top: var(--profile-space-5); }
.xprf-share__tg { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; width: 56px; cursor: pointer; }
.xprf-share__tg-ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--profile-surface-2); border: 1px solid var(--profile-border);
  color: var(--profile-fg);
  transition: transform var(--profile-dur-fast) var(--profile-ease),
              background var(--profile-dur-fast) var(--profile-ease),
              border-color var(--profile-dur-fast) var(--profile-ease),
              color var(--profile-dur-fast) var(--profile-ease),
              box-shadow var(--profile-dur-fast) var(--profile-ease);
}
.xprf-share__tg-ic.is-quiet { --brand: var(--profile-accent); }
.xprf-share__tg:hover .xprf-share__tg-ic,
.xprf-share__tg-ic:focus-visible {
  background: var(--brand, var(--profile-accent)); border-color: transparent; color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 22px -10px color-mix(in srgb, var(--brand, var(--profile-accent)) 70%, transparent);
}
.xprf-share__tg-ic svg { width: 22px; height: 22px; }
.xprf-share__tg span { font-size: 11px; color: var(--profile-muted); font-weight: var(--profile-fw-semibold); transition: color var(--profile-dur-fast) var(--profile-ease); }
.xprf-share__tg:hover span { color: var(--profile-fg); }
.xprf-share__url { margin-top: var(--profile-space-4); display: flex; align-items: center; gap: 8px; border: 1px solid var(--profile-border); border-radius: 12px; background: var(--profile-surface-2); padding: 5px 5px 5px 12px; }
.xprf-share__url input { flex: 1; border: 0; background: transparent; color: var(--profile-fg); font: 600 12px var(--profile-font-mono); min-width: 0; outline: none; }
.xprf-share__url button { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--profile-accent); color: var(--profile-accent-text); font-weight: var(--profile-fw-black); font-size: 13px; }

.xprf-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.xprf-toast { position: fixed; left: 50%; bottom: var(--profile-space-6); transform: translateX(-50%); z-index: 60; padding: var(--profile-space-3) var(--profile-space-5); border-radius: var(--profile-radius-pill); background: var(--profile-surface); border: 1px solid var(--profile-border); color: var(--profile-fg); font-size: var(--profile-fs-sm); font-weight: var(--profile-fw-medium); box-shadow: var(--profile-shadow-pop); }

/* --- orchestrated page-load motion (disabled under reduced-motion) ------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes xprf-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes xprf-pop  { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: none; } }
  .xprf-identity .xprf-cover       { animation: xprf-rise var(--profile-dur-slow) var(--profile-ease) both; }
  .xprf-identity .xprf-avatar-wrap { animation: xprf-pop  var(--profile-dur-slow) var(--profile-ease) 80ms both; }
  .xprf-identity .xprf-name-row, .xprf-identity .xprf-bio, .xprf-identity .xprf-id-row { animation: xprf-rise var(--profile-dur-slow) var(--profile-ease) 140ms both; }
  .xprf-blocks > .xprf-block { animation: xprf-rise var(--profile-dur-slow) var(--profile-ease) both; }
  .xprf-blocks > .xprf-block:nth-child(1){animation-delay:160ms}
  .xprf-blocks > .xprf-block:nth-child(2){animation-delay:210ms}
  .xprf-blocks > .xprf-block:nth-child(3){animation-delay:260ms}
  .xprf-blocks > .xprf-block:nth-child(4){animation-delay:310ms}
  .xprf-blocks > .xprf-block:nth-child(5){animation-delay:360ms}
  .xprf-blocks > .xprf-block:nth-child(n+6){animation-delay:410ms}
}

/* disabled-page "not found" screen */
.xprf-notfound { max-width: 420px; margin: 96px auto 40px; padding: 0 20px; text-align: center; }
.xprf-notfound__code { font-family: var(--profile-font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: var(--profile-muted); }
.xprf-notfound__title { margin: 10px 0 8px; font-size: 26px; font-weight: var(--profile-fw-black); letter-spacing: -0.02em; color: var(--profile-on-bg); }
.xprf-notfound__msg { margin: 0; font-size: 15px; line-height: 1.55; color: var(--profile-on-bg-muted); }
.xprf-notfound__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 16px; }
.xprf-nf-btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; border: 1px solid var(--profile-border, rgba(255,255,255,.14)); color: var(--profile-on-bg); background: transparent; transition: transform .12s ease, background .15s ease, border-color .15s ease; }
.xprf-nf-btn:hover { transform: translateY(-1px); border-color: var(--profile-on-bg-muted); text-decoration: none; }
.xprf-nf-btn, .xprf-nf-btn:hover, .xprf-nf-btn:focus { text-decoration: none; }
.xprf-nf-btn--primary { border-color: transparent; color: #0a0c12; background: linear-gradient(135deg, #5b8cff, #2f6fe0); box-shadow: 0 6px 20px rgba(47,111,224,.35); }
.xprf-nf-btn--primary:hover { border-color: transparent; filter: brightness(1.05); box-shadow: 0 8px 26px rgba(47,111,224,.45); }
.xprf-notfound__sub { margin: 0; font-size: 13px; line-height: 1.5; color: var(--profile-muted); }

/* "Updated N ago · M edits" — subtle footer under the profile (from _meta). */
.xprf-updated-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 18px auto 4px; color: var(--profile-muted);
  font-size: var(--profile-fs-xs); opacity: .85;
}
.xprf-updated-foot__i { width: 13px; height: 13px; flex: none; opacity: .8; }
