/* =====================================================================
   linkbio — design system v2 (UI redesign round 2, 2026-10-27)

   Built BY THE BOOK from the local UI/UX vault, not improvised:
   - Skill local-uiux-ui-ux-pro-max, search tool (scripts/search.py):
     * --design-system "link-in-bio creator tool SaaS social links"
       and "social media creator profile page mobile-first" both resolve:
       Style "Vibrant & Block-based"; palette Primary #2563EB, Secondary
       #7C3AED, Accent #EC4899 on clean surfaces; effects = block layout
       with 48px+ gaps, animated patterns, bold hover (color shift),
       large type (32px+), 200-300ms; anti-patterns: muted colors,
       low energy.
     * --domain product "link in bio creator social links" -> exact hit
       "Link-in-Bio Page Builder": primary style "Vibrant & Block-based
       + Bento Box Grid", secondary Minimalism/Swiss + Glassmorphism,
       landing "Conversion-Optimized + Social Proof", dashboard style
       "Analytics (click tracking)", palette focus "Brand-customizable
       + accent link color + clean white canvas".
     * --domain typography "friendly modern creator social" -> the
       design-system aggregate's own pairing (Russo One + Chakra Petch)
       is a gaming/esports match, rejected on the skill's fit-check;
       domain result #1 "Modern Professional" applied instead:
       Poppins headings + Open Sans body.
     * --domain chart "click analytics time series dashboard" ->
       trend over time = Line/Area chart, 20% fill, hover, table
       fallback, never hue alone.
     * --domain ux (animation / drag / loading) -> shared motion
       tokens; duration follows purpose; ease-out on entry, ease-in on
       exit, linear for spinners; prefers-reduced-motion is mandatory;
       max 1-2 signature animated elements per view; drag needs a
       single-pointer + keyboard alternative; skeleton loading states
       with reserved space (no layout shift).
   - Token architecture + type/spacing scales: skill
     local-uiux-design-system (three layers primitive -> semantic ->
     component; 4px spacing base; type scale xs 12px -> 5xl 48px).
   - Effects adapted from MagicUI (MIT, repos/magicui), rewritten in
     pure CSS/JS: AnimatedGradientText, AnimatedShinyText, SparklesText,
     BorderBeam, ShineBorder, AnimatedGridPattern, BlurFade entrance,
     NumberTicker, MagicCard spotlight, BentoGrid layout, Marquee.
     NO GSAP, NO Animate.css (licences not OSS-clean).
   - Theme mechanism + brand icons/colors: littlelink (MIT), as before;
     brands.css is untouched.
   ===================================================================== */

/* ---------- Layer 1: primitives ---------- */
:root {
  --font-display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* type scale (design-system skill, primitive-tokens.md) */
  --fs-xs: .75rem;   --fs-sm: .875rem;  --fs-base: 1rem;    --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;  --fs-2xl: 1.5rem;  --fs-3xl: 1.875rem; --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;
  --lh-tight: 1.15; --lh-snug: 1.35; --lh-normal: 1.55;
  --tracking-tight: -.025em; --tracking-wide: .05em;

  --blue-600: #2563eb;  --blue-400: #60a5fa;
  --violet-600: #7c3aed; --violet-400: #a78bfa;
  --pink-500: #ec4899;
  --slate-950: #0f172a; --slate-700: #334155; --slate-500: #475569;
  --slate-200: #e2e8f0; --slate-100: #f1f5fd;
  --ink-950: #0a0f1e;   --ink-800: #111a2e; --ink-700: #182444;
  --red-600: #dc2626;   --green-600: #16a34a; --amber-400: #fbbf24;

  /* spacing: 4px base scale */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 28px; --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-14: 56px; --space-16: 64px;
  --space-20: 80px;

  /* block-based radii: decisive, geometric — not pills everywhere */
  --radius-s: 10px; --radius-m: 14px; --radius-l: 18px; --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-s: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 6px -2px rgba(15, 23, 42, .08);
  --shadow-m: 0 10px 26px -10px rgba(15, 23, 42, .20);
  --shadow-l: 0 26px 52px -18px rgba(15, 23, 42, .30);

  /* motion system (ux domain: shared tokens, duration follows purpose,
     decelerate on entry, accelerate on exit, linear only for spinners) */
  --motion-instant: 100ms;
  --motion-fast: 160ms;
  --motion-base: 240ms;
  --motion-slow: 400ms;
  --motion-entrance: 560ms;
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --ease-exit: cubic-bezier(.55, 0, .75, 0);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.35, .4, 1);
}

/* Accent themes — the "brand-customizable + accent link color" axis.
   --accent paints surfaces/borders/glows; --accent-text is a darkened
   sibling used wherever the accent colors actual text (4.5:1 rule). */
:root, [data-color="brand"]  { --accent: #2563eb; --accent-2: #7c3aed; --accent-3: #ec4899; --accent-text: #1d4ed8; }
[data-color="sky"]    { --accent: #0284c7; --accent-2: #38bdf8; --accent-3: #7c3aed; --accent-text: #0369a1; }
[data-color="rose"]   { --accent: #e11d48; --accent-2: #fb7185; --accent-3: #f59e0b; --accent-text: #be123c; }
[data-color="forest"] { --accent: #16a34a; --accent-2: #4ade80; --accent-3: #0ea5e9; --accent-text: #15803d; }
[data-color="grape"]  { --accent: #7c3aed; --accent-2: #a78bfa; --accent-3: #ec4899; --accent-text: #6d28d9; }
[data-color="sunset"] { --accent: #ea580c; --accent-2: #fb923c; --accent-3: #e11d48; --accent-text: #c2410c; }

/* ---------- Layer 2: semantic tokens ---------- */
/* Light = the skill's "clean white canvas": white blocks, crisp borders,
   color lives in accents and blocks — not in a colored fog. */
html.theme-light, .scope-light {
  --bg: #ffffff;
  --bg-tint: #f4f7fe;
  --surface: #ffffff;
  --surface-2: #f1f5fd;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #d9e2f4;
  --border-strong: #b9c8ea;
  --input-bg: #ffffff;
  --ring: var(--accent);
  --grid-line: rgba(37, 99, 235, .055);
  --glow-opacity: .5;
  --header-bg: rgba(255, 255, 255, .88);
  --spot: rgba(37, 99, 235, .07);
  color-scheme: light;
}
/* Dark = designed ink blocks (deep blue-black), not inverted light. */
html.theme-dark, .scope-dark {
  --bg: #0a0f1e;
  --bg-tint: #0d1526;
  --surface: #111a2e;
  --surface-2: #0d1526;
  --surface-raised: #182444;
  --text: #f1f5f9;
  --muted: #9fb0c9;
  --border: rgba(148, 184, 255, .16);
  --border-strong: rgba(148, 184, 255, .32);
  --input-bg: rgba(148, 184, 255, .05);
  --ring: var(--accent-2);
  --grid-line: rgba(148, 184, 255, .06);
  --glow-opacity: .8;
  --header-bg: rgba(10, 15, 30, .85);
  --spot: rgba(148, 184, 255, .09);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  html.theme-auto {
    --bg: #ffffff; --bg-tint: #f4f7fe;
    --surface: #ffffff; --surface-2: #f1f5fd; --surface-raised: #ffffff;
    --text: #0f172a; --muted: #475569;
    --border: #d9e2f4; --border-strong: #b9c8ea; --input-bg: #ffffff;
    --ring: var(--accent); --grid-line: rgba(37, 99, 235, .055);
    --glow-opacity: .5; --header-bg: rgba(255, 255, 255, .88);
    --spot: rgba(37, 99, 235, .07);
    color-scheme: light;
  }
}
@media (prefers-color-scheme: dark) {
  html.theme-auto {
    --bg: #0a0f1e; --bg-tint: #0d1526;
    --surface: #111a2e; --surface-2: #0d1526; --surface-raised: #182444;
    --text: #f1f5f9; --muted: #9fb0c9;
    --border: rgba(148, 184, 255, .16); --border-strong: rgba(148, 184, 255, .32);
    --input-bg: rgba(148, 184, 255, .05); --ring: var(--accent-2);
    --grid-line: rgba(148, 184, 255, .06);
    --glow-opacity: .8; --header-bg: rgba(10, 15, 30, .85);
    --spot: rgba(148, 184, 255, .09);
    color-scheme: dark;
  }
}

/* ---------- Layer 3: component tokens ---------- */
:root {
  --btn-primary-bg: linear-gradient(120deg, var(--accent), var(--accent-2));
  --btn-primary-text: #ffffff;
  --link-bg: var(--surface);
  --link-border: var(--border);
  --card-bg: var(--surface);
  --card-border: var(--border);
  --glow: 0 14px 34px -12px var(--accent);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-base); line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; position: relative; overflow-x: hidden;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: var(--tracking-tight); }
a { color: var(--accent-text); }
img { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* Backdrop: MagicUI AnimatedGridPattern (CSS form) — a fine grid that
   drifts exactly one cell, radially masked so the canvas stays clean —
   over a soft static accent glow. Signature motion #1 on content pages. */
body.profile-page::before, body.site-page::before, body.auth-page::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, #000 30%, transparent 78%);
  animation: grid-pan 26s linear infinite;
}
@keyframes grid-pan { to { background-position: 44px 44px, 44px 44px; } }
body.profile-page::after, body.site-page::after, body.auth-page::after {
  content: ""; position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(620px 300px at 50% -60px, var(--accent) 0%, transparent 70%);
  opacity: calc(var(--glow-opacity) * .16);
}

/* Entrance: MagicUI BlurFade rhythm — blur + rise, staggered via --d. */
.reveal { opacity: 0; animation: blur-fade var(--motion-entrance) var(--ease-enter) forwards; animation-delay: calc(var(--d, 0) * 60ms); }
@keyframes blur-fade {
  from { opacity: 0; filter: blur(6px); transform: translateY(14px); }
  to   { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* MagicUI AnimatedGradientText — gradient that keeps travelling. */
.grad-anim {
  background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent-2), var(--accent));
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-pan 7s linear infinite;
}
@keyframes grad-pan { to { background-position: 250% center; } }
.grad-text { background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* MagicUI AnimatedShinyText — a light sweep across quiet text. */
.shiny-text {
  background: linear-gradient(110deg, var(--accent-text) 42%, color-mix(in srgb, var(--accent-2) 55%, #ffffff) 50%, var(--accent-text) 58%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine-pan 3.6s linear infinite;
}
@keyframes shine-pan { to { background-position: -220% center; } }

/* MagicUI SparklesText — tiny stars twinkling around a focal element. */
.sparkle { position: absolute; z-index: 3; pointer-events: none; color: var(--amber-400); animation: twinkle 2.6s ease-in-out infinite; }
.sparkle svg { display: block; width: 100%; height: 100%; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(35deg); }
}

/* MagicUI BorderBeam — light travelling the border (two counter-beams). */
@property --beam-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.beam {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 1.6px; pointer-events: none;
  background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 250deg, rgba(255, 255, 255, .95) 302deg, transparent 345deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: beam-spin 3.6s linear infinite;
}
.beam.b2 {
  padding: 1.2px; animation-duration: 5.8s; animation-direction: reverse;
  background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 285deg, color-mix(in srgb, var(--accent-2) 65%, #ffffff) 322deg, transparent 352deg);
}
@keyframes beam-spin { to { --beam-angle: 360deg; } }

/* Shimmer sweep (MagicUI ShimmerButton) — kept for primary CTAs. */
.shimmer-host { position: relative; overflow: hidden; isolation: isolate; }
.shimmer-host::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .35) 50%, transparent 68%);
  transform: translateX(-130%); animation: shimmer-sweep 3.8s var(--ease-enter) infinite;
}
@keyframes shimmer-sweep {
  0%, 55% { transform: translateX(-130%); }
  92%, 100% { transform: translateX(130%); }
}

/* Tap ripple ink (micro-interaction feedback on press). */
.ink {
  position: absolute; z-index: 1; border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  transform: translate(-50%, -50%) scale(0);
  animation: ink-spread 550ms var(--ease-enter) forwards;
}
.pinned .ink { background: rgba(255, 255, 255, .35); }
@keyframes ink-spread { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* Skeleton loading (ux: reserve space, busy status, no layout shift). */
.skl { border-radius: var(--radius-s); background: linear-gradient(100deg, var(--surface-2) 40%, var(--border) 50%, var(--surface-2) 60%); background-size: 200% 100%; animation: skl-wave 1.3s linear infinite; }
@keyframes skl-wave { to { background-position: -200% 0; } }
.skl-row { height: 66px; margin-top: 10px; }
.skl-line { height: 14px; margin-top: 10px; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 12px 24px; border-radius: var(--radius-m);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: transform var(--motion-fast) var(--ease-enter), box-shadow var(--motion-base) var(--ease-enter),
              border-color var(--motion-fast), background var(--motion-fast), opacity var(--motion-fast);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: var(--accent); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: var(--motion-instant); }
.btn.primary {
  background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: transparent;
  box-shadow: 0 12px 28px -10px var(--accent);
}
.btn.primary:hover { box-shadow: 0 18px 36px -10px var(--accent); border-color: transparent; }
.btn.primary::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .38) 50%, transparent 68%);
  transform: translateX(-130%); animation: shimmer-sweep 3.8s var(--ease-enter) infinite;
}
.btn.danger-ghost { color: var(--red-600); }
.btn.danger-ghost:hover { border-color: var(--red-600); background: rgba(220, 38, 38, .06); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: .9rem; border-radius: var(--radius-s); }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; }

/* Logo lockup */
.logo { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: var(--tracking-tight); }
.logo .accent { background: var(--btn-primary-bg); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--btn-primary-bg); color: #fff; box-shadow: 0 8px 18px -6px var(--accent);
}
.logo-mark svg { width: 20px; height: 20px; }

/* ---------- public profile page (the storefront — mobile first) ---------- */
.page { max-width: 540px; margin: 0 auto; padding: max(48px, env(safe-area-inset-top)) 20px 44px; text-align: center; }
.profile-head { display: flex; flex-direction: column; align-items: center; }
.avatar-wrap {
  position: relative; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: 0 16px 36px -12px var(--accent);
}
.avatar-wrap::after { /* one-shot welcome ring (not an infinite pulse) */
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent-2); opacity: 0;
  animation: ring-once 1.6s var(--ease-enter) .25s 1 both;
}
@keyframes ring-once {
  0% { transform: scale(.92); opacity: .55; }
  100% { transform: scale(1.22); opacity: 0; }
}
.avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid var(--bg); background: var(--surface); }
.display-name { font-size: var(--fs-3xl); font-weight: 700; margin: 20px 0 2px; line-height: var(--lh-tight); }
.username { font-weight: 600; margin: 0 0 4px; font-size: var(--fs-base); }
.bio { margin: 10px auto 2px; max-width: 44ch; white-space: pre-wrap; color: var(--muted); font-size: var(--fs-base); overflow-wrap: anywhere; }

.socials { display: flex; justify-content: center; gap: 10px; margin: 22px 0 4px; flex-wrap: wrap; }
.social-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border);
  box-shadow: var(--shadow-s);
  transition: transform var(--motion-fast) var(--ease-spring), box-shadow var(--motion-base) var(--ease-enter), border-color var(--motion-fast);
}
.social-btn:hover { transform: translateY(-3px) scale(1.06); border-color: var(--brand); box-shadow: 0 12px 26px -8px var(--brand); }
.social-btn:active { transform: scale(.94); transition-duration: var(--motion-instant); }
.social-btn img { width: 24px; height: 24px; }

.links { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.link-btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center;
  min-height: 60px; padding: 16px 48px;
  border-radius: var(--radius-l); text-decoration: none;
  background: var(--link-bg); color: var(--text);
  border: 1.5px solid var(--link-border);
  box-shadow: var(--shadow-s);
  font-family: var(--font-display); font-weight: 600; font-size: 1.03rem;
  transition: transform var(--motion-fast) var(--ease-enter), box-shadow var(--motion-base) var(--ease-enter), border-color var(--motion-fast);
  overflow-wrap: anywhere;
}
.link-btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--glow), var(--shadow-m); }
.link-btn:active { transform: scale(.985); transition-duration: var(--motion-instant); }
.link-title { position: relative; z-index: 2; }
.link-arrow {
  position: absolute; right: 18px; top: 50%; z-index: 2;
  transform: translate(5px, -50%); opacity: 0; font-weight: 700;
  transition: opacity var(--motion-fast), transform var(--motion-fast) var(--ease-enter);
}
.link-btn:hover .link-arrow { opacity: .85; transform: translate(0, -50%); }
@media (hover: none) { .link-arrow { opacity: .45; transform: translate(0, -50%); } }

/* Pinned link: the page's signature block — gradient fill, twin
   BorderBeams and SparklesText stars. Signature motion #2 on the page. */
.link-btn.pinned {
  background: var(--btn-primary-bg); color: #fff; border-color: transparent;
  box-shadow: 0 20px 40px -14px var(--accent);
  min-height: 64px;
}
.link-btn.pinned:hover { border-color: transparent; box-shadow: 0 24px 46px -14px var(--accent); }
.link-btn.pinned .sparkle.s1 { width: 15px; height: 15px; top: 7px; left: 12%; }
.link-btn.pinned .sparkle.s2 { width: 11px; height: 11px; bottom: 8px; left: 26%; animation-delay: .7s; }
.link-btn.pinned .sparkle.s3 { width: 13px; height: 13px; top: 9px; right: 14%; animation-delay: 1.3s; }
.link-btn.pinned .sparkle.s4 { width: 10px; height: 10px; bottom: 7px; right: 27%; animation-delay: 1.9s; }
.pin-badge {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); color: #ffd166; font-size: .85rem;
}
.page-footer { margin-top: 44px; color: var(--muted); font-size: var(--fs-sm); }
.page-footer a { color: var(--muted); font-weight: 700; text-decoration: none; }
.page-footer a:hover { color: var(--accent-text); }

/* ---------- landing ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--header-bg); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.site-nav-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-nav .nav-actions { display: flex; gap: 10px; align-items: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 80px; position: relative; }
.hero { text-align: center; padding: 76px 0 8px; max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted); box-shadow: var(--shadow-s);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 4.3rem); font-weight: 800; line-height: 1.04; margin: 24px 0 18px; letter-spacing: -.03em; }
.hero p { color: var(--muted); font-size: clamp(1.03rem, 2.6vw, 1.22rem); margin: 0 auto 32px; max-width: 55ch; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .sub-note { margin-top: 18px; font-size: var(--fs-sm); color: var(--muted); }

/* network marquee (social proof strip) */
.marquee {
  margin: 54px auto 0; max-width: 880px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 52px; width: max-content; padding: 6px 0; animation: marquee-move 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-move { to { transform: translateX(-50%); } }
.marquee .mq-item { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; color: var(--muted); white-space: nowrap; }
.marquee .mq-item img { width: 21px; height: 21px; }

/* CSS phone mock of a profile page */
.phone-stage { position: relative; max-width: 320px; margin: 56px auto 0; }
.phone {
  position: relative; border-radius: 42px; padding: 16px 16px 24px;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-l), 0 0 0 8px color-mix(in srgb, var(--text) 4%, transparent);
  text-align: center; overflow: hidden;
}
.phone::before { content: ""; display: block; width: 96px; height: 22px; margin: 0 auto 16px; border-radius: var(--radius-pill); background: var(--bg-tint); border: 1px solid var(--border); position: relative; z-index: 2; }
.phone .p-avatar { position: relative; z-index: 2; width: 66px; height: 66px; margin: 0 auto; border-radius: 50%; background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.phone .p-name { position: relative; z-index: 2; font-family: var(--font-display); font-weight: 700; margin: 12px 0 0; font-size: 1.05rem; }
.phone .p-user { position: relative; z-index: 2; color: var(--accent-text); font-size: .86rem; font-weight: 600; margin: 0 0 14px; }
.phone .p-socials { position: relative; z-index: 2; display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.phone .p-socials span { width: 31px; height: 31px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.phone .p-socials img { width: 16px; height: 16px; }
.phone .p-link { position: relative; z-index: 2; display: block; padding: 12px; margin-top: 10px; border-radius: var(--radius-m); border: 1.5px solid var(--border); background: var(--surface); font-family: var(--font-display); font-weight: 600; font-size: .93rem; color: var(--text); text-decoration: none; overflow: hidden; }
.phone .p-link.hot { background: var(--btn-primary-bg); color: #fff; border-color: transparent; }
.float-chip {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-pill); font-size: .83rem; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow-m);
  animation: floaty 5.5s ease-in-out infinite;
}
.float-chip.views { top: 54px; left: -66px; }
.float-chip.qr { bottom: 66px; right: -58px; animation-delay: -2.6s; }
.float-chip svg { width: 15px; height: 15px; flex: none; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (max-width: 560px) { .float-chip.views { left: -8px; } .float-chip.qr { right: -8px; } }

/* Bento feature grid (the product match's primary layout) + MagicCard
   pointer spotlight on each tile. */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 76px; }
.bento .feature { grid-column: span 2; }
.bento .feature.wide { grid-column: span 4; }
@media (max-width: 820px) { .bento .feature, .bento .feature.wide { grid-column: span 4; } }
@media (min-width: 821px) and (max-width: 1080px) { .bento .feature.wide { grid-column: span 4; } }
.feature {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-xl);
  padding: 26px; box-shadow: var(--shadow-s);
  transition: transform var(--motion-base) var(--ease-enter), box-shadow var(--motion-base) var(--ease-enter), border-color var(--motion-base);
}
.feature::before { /* MagicCard spotlight, fed by --mx/--my from JS */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 65%);
  transition: opacity var(--motion-base);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); border-color: var(--accent); }
.feature:hover::before { opacity: 1; }
.feature .f-ico {
  position: relative; width: 46px; height: 46px; border-radius: 13px; margin-bottom: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent), color-mix(in srgb, var(--accent-2) 15%, transparent));
  color: var(--accent-text); border: 1px solid var(--border);
}
.feature .f-ico svg { width: 23px; height: 23px; }
.feature h3 { position: relative; margin: 0 0 6px; font-size: 1.08rem; }
.feature p { position: relative; margin: 0; color: var(--muted); font-size: .94rem; }
.feature .mini-chart { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 54px; margin-top: 16px; }
.feature .mini-chart i { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); opacity: .85; }
.feature .mini-socials { position: relative; display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.feature .mini-socials span { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; background: var(--bg-tint); }
.feature .mini-socials img { width: 17px; height: 17px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 24px; }
.step { padding: 24px; border-radius: var(--radius-xl); border: 1.5px solid var(--border); background: var(--surface); box-shadow: var(--shadow-s); }
.step .n { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; background: var(--btn-primary-bg); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { margin: 8px 0 4px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }
.section-title { text-align: center; font-size: clamp(1.6rem, 4.2vw, 2.1rem); font-weight: 800; margin: 80px 0 8px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto; max-width: 52ch; }
.cta-band {
  margin-top: 80px; text-align: center; padding: 48px 24px; border-radius: var(--radius-xl);
  background: var(--btn-primary-bg); color: #fff; box-shadow: 0 30px 56px -20px var(--accent);
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%);
  transform: translateX(-130%); animation: shimmer-sweep 4.4s var(--ease-enter) infinite;
}
.cta-band h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 4.2vw, 2.2rem); position: relative; z-index: 1; }
.cta-band p { margin: 0 auto 24px; opacity: .94; max-width: 46ch; position: relative; z-index: 1; }
.cta-band .btn { background: #fff; color: var(--accent-text); border-color: transparent; position: relative; z-index: 1; }
.cta-band .btn::after { display: none; }
.site-footer { margin-top: 60px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.form-note { color: var(--muted); font-size: .9rem; margin-top: 16px; text-align: center; }

/* ---------- auth ---------- */
.auth-page { display: flex; flex-direction: column; }
.auth-shell { flex: 1; width: 100%; max-width: 460px; margin: 0 auto; padding: 36px 20px 60px; display: flex; flex-direction: column; }
.auth-brand { display: flex; justify-content: center; margin: 20px 0 28px; }
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-xl);
  padding: 32px 30px; box-shadow: var(--shadow-l);
}
.card::before { /* ShineBorder cue: a lit top edge in the brand gradient */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}
.card h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; }
.card .card-sub { color: var(--muted); margin: 0 0 8px; font-size: .95rem; }
label { display: block; font-weight: 600; margin: 17px 0 6px; font-size: .92rem; font-family: var(--font-display); }
.field-hint { color: var(--muted); font-size: .82rem; font-weight: 400; margin-top: 3px; font-family: var(--font-body); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-s);
  border: 1.5px solid var(--border-strong); background: var(--input-bg); color: var(--text);
  font: inherit; transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 24%, transparent); }
textarea { resize: vertical; min-height: 76px; }
.form-error {
  display: none; margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-s);
  background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .4);
  color: var(--red-600); font-size: .92rem; font-weight: 500;
}
.form-error.show { display: block; }
.form-success {
  display: none; margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-s);
  background: rgba(22, 163, 74, .09); border: 1px solid rgba(22, 163, 74, .45);
  color: var(--green-600); font-size: .92rem; font-weight: 500;
}
.form-success.show { display: block; }
.card form .btn[type="submit"] { margin-top: 22px; width: 100%; }

/* ---------- admin ---------- */
body.admin-page { background: linear-gradient(180deg, var(--bg-tint) 0, var(--bg) 360px); }
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.appbar-in { max-width: 1200px; margin: 0 auto; padding: 11px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.appbar .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.appbar .who .uname { font-weight: 700; font-family: var(--font-display); overflow-wrap: anywhere; }
.appbar .actions { display: flex; gap: 9px; align-items: center; }
.admin-shell { max-width: 1200px; margin: 0 auto; padding: 28px 20px 76px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 22px; align-items: start; }
.admin-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.admin-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-xl);
  padding: 26px; box-shadow: var(--shadow-s);
}
.panel > h2 { margin: 0 0 4px; font-size: 1.14rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.panel > h2 .p-ico { width: 31px; height: 31px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent), color-mix(in srgb, var(--accent-2) 15%, transparent)); color: var(--accent-text); flex: none; }
.panel > h2 .p-ico svg { width: 17px; height: 17px; }
.panel .panel-sub { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.panel .form-error, .panel .form-success { margin-top: 12px; }
.saved-pill { display: none; margin-left: 10px; padding: 5px 12px; border-radius: var(--radius-pill); background: rgba(22, 163, 74, .12); color: var(--green-600); font-size: .85rem; font-weight: 700; vertical-align: middle; }
.saved-pill.show { display: inline-block; animation: blur-fade var(--motion-base) var(--ease-enter); }
.char-count { float: right; font-weight: 400; color: var(--muted); font-size: .8rem; font-family: var(--font-body); }

/* ---------- live preview (Linktree-style phone preview) ---------- */
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pv-head .pv-title { font-family: var(--font-display); font-weight: 700; font-size: .98rem; display: inline-flex; align-items: center; gap: 8px; }
.pv-head .pv-title .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 4px rgba(22, 163, 74, .16); }
.pv-modes { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 3px; }
.pv-modes button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 .78rem var(--font-display); padding: 5px 11px; border-radius: var(--radius-pill);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.pv-modes button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s); }
.pv {
  border-radius: 40px; padding: 10px;
  background: var(--ink-950); box-shadow: var(--shadow-l);
  max-width: 330px; margin: 0 auto;
}
.pv-screen {
  position: relative; overflow: hidden; border-radius: 31px;
  background: var(--bg); color: var(--text);
  padding: 30px 18px 24px; min-height: 500px; text-align: center;
}
.pv-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 95% 55% at 50% 0%, #000 25%, transparent 75%);
          mask-image: radial-gradient(ellipse 95% 55% at 50% 0%, #000 25%, transparent 75%);
}
.pv-notch { width: 84px; height: 19px; border-radius: var(--radius-pill); background: var(--ink-950); margin: 0 auto 18px; position: relative; z-index: 2; }
.pv .pv-notch { background: rgba(127, 140, 170, .35); }
.pv-avatar-wrap {
  position: relative; z-index: 2; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
}
.pv-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 2.5px solid var(--bg); background: var(--surface); }
.pv-avatar-letter { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; border: 2.5px solid var(--bg); }
.pv-name { position: relative; z-index: 2; font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; margin: 13px 0 1px; line-height: var(--lh-tight); overflow-wrap: anywhere; }
.pv-user { position: relative; z-index: 2; font-weight: 600; font-size: .86rem; margin: 0; }
.pv-bio { position: relative; z-index: 2; color: var(--muted); font-size: .86rem; margin: 8px auto 0; max-width: 34ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.pv-socials { position: relative; z-index: 2; display: flex; justify-content: center; gap: 8px; margin: 16px 0 2px; flex-wrap: wrap; }
.pv-social { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-s); }
.pv-social img { width: 19px; height: 19px; }
.pv-links { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pv-link {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 11px 34px; border-radius: var(--radius-m);
  background: var(--surface); border: 1.5px solid var(--border);
  font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--text);
  box-shadow: var(--shadow-s); overflow-wrap: anywhere;
}
.pv-link.pinned { background: var(--btn-primary-bg); color: #fff; border-color: transparent; }
.pv-link .pin-badge { width: 22px; height: 22px; left: 11px; font-size: .72rem; }
.pv-link .sparkle.s1 { width: 11px; height: 11px; top: 5px; left: 16%; }
.pv-link .sparkle.s2 { width: 9px; height: 9px; bottom: 5px; right: 18%; animation-delay: 1.1s; }
.pv-empty { position: relative; z-index: 2; color: var(--muted); font-size: .85rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-m); padding: 16px 10px; margin-top: 18px; }
.pv-foot { position: relative; z-index: 2; margin-top: 22px; color: var(--muted); font-size: .72rem; }
.pv-note { text-align: center; color: var(--muted); font-size: .82rem; margin: 12px 0 0; }

/* Your-page / QR side card */
.page-card { text-align: center; }
.page-card .qr-frame {
  position: relative; background: #fff; border-radius: var(--radius-l); padding: 14px;
  display: inline-block; box-shadow: var(--shadow-s); border: 1.5px solid var(--border); overflow: hidden;
}
.page-card .qr-frame::before { /* ShineBorder sweep on the QR frame */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 255deg, var(--accent-2) 305deg, transparent 345deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: beam-spin 4.6s linear infinite;
}
.page-card .qr-frame img { display: block; width: 172px; height: 172px; }
.page-url { display: block; margin: 15px 0 4px; font-weight: 700; font-family: var(--font-display); overflow-wrap: anywhere; }
.qr-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Link list */
.link-item {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  padding: 12px; margin-top: 10px;
  border: 1.5px solid var(--border); border-radius: var(--radius-m); background: var(--bg-tint);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), opacity var(--motion-fast), transform var(--motion-fast) var(--ease-enter);
}
.link-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-s); }
.link-item.dragging { opacity: .92; transform: rotate(1.1deg) scale(1.012); box-shadow: var(--shadow-l); border-color: var(--accent); z-index: 5; }
.link-item.drop-before { box-shadow: 0 -3px 0 0 var(--accent), var(--shadow-s); border-color: var(--accent); }
.link-item.drop-after { box-shadow: 0 3px 0 0 var(--accent), var(--shadow-s); border-color: var(--accent); }
.link-item.is-hidden { opacity: .55; }
.drag-handle {
  flex: none; width: 40px; height: 40px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid transparent; border-radius: 9px; background: transparent; color: var(--muted);
  cursor: grab; touch-action: none;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast) var(--ease-spring);
}
.drag-handle:hover { background: var(--surface); border-color: var(--border); color: var(--text); transform: scale(1.08); }
.drag-handle:active { cursor: grabbing; transform: scale(.96); }
.link-item .grow { flex: 1; min-width: 170px; padding-top: 2px; }
.link-item .lt { font-weight: 600; font-family: var(--font-display); overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-item .lt .net-ico { width: 19px; height: 19px; border-radius: 5px; }
.link-item .lu { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.badge.pinned { background: var(--btn-primary-bg); color: #fff; }
.badge.hidden-b { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.badge.social { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-text); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.icon-btn {
  min-width: 40px; height: 40px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 9px; cursor: pointer; font-size: .83rem; font-weight: 600; font-family: var(--font-display);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-instant) var(--ease-exit);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.icon-btn:active { transform: scale(.93); }
.icon-btn.active { background: var(--btn-primary-bg); color: #fff; border-color: transparent; }
.icon-btn.danger:hover { background: rgba(220, 38, 38, .08); border-color: var(--red-600); color: var(--red-600); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }
.edit-form { flex-basis: 100%; border-top: 1.5px dashed var(--border-strong); margin-top: 10px; padding-top: 4px; animation: blur-fade var(--motion-base) var(--ease-enter); }
.edit-form .grid2 { gap: 0 12px; }
.edit-actions { display: flex; gap: 9px; margin-top: 14px; }
.edit-actions .btn { min-height: 42px; }
.empty-state { text-align: center; color: var(--muted); padding: 26px 10px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-m); margin-top: 12px; font-size: .93rem; }

/* ---------- stats ---------- */
.stats-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.range-switch { display: inline-flex; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 13px; padding: 3px; flex: none; }
.range-switch button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 .87rem var(--font-display); padding: 8px 15px; border-radius: 10px; min-height: 38px;
  transition: background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast);
}
.range-switch button:hover { color: var(--text); }
.range-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0 6px; }
.stat-card {
  position: relative; overflow: hidden;
  border: 1.5px solid var(--border); border-radius: var(--radius-l); padding: 17px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface));
}
.stat-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 65%);
  transition: opacity var(--motion-base);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .k { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-card .v { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1.15; margin-top: 3px; overflow-wrap: anywhere; }
.stat-card .v.small-v { font-size: 1.05rem; padding-top: 7px; font-weight: 700; }
.stat-card .sub { position: relative; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.chart-box { position: relative; margin-top: 16px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-svg .area { fill: url(#chartFill); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-svg .hit { fill: transparent; cursor: pointer; }
.chart-svg .axis-label { font: 500 10.5px var(--font-body); fill: var(--muted); }
.chart-tip {
  position: absolute; z-index: 6; pointer-events: none; white-space: nowrap;
  background: var(--text); color: var(--bg); font: 600 .8rem var(--font-display);
  padding: 6px 11px; border-radius: 9px; box-shadow: var(--shadow-m);
  transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity var(--motion-fast);
}
.chart-tip.show { opacity: 1; }
.chart-empty { color: var(--muted); font-size: .92rem; padding: 18px 0 6px; }
table.stats { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.stats th, table.stats td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
table.stats th { font-family: var(--font-display); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.stats td.num, table.stats th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.stats tbody tr { transition: background var(--motion-fast); }
table.stats tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.small { color: var(--muted); font-size: .88rem; }
h3.sub-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- reduced motion (mandatory per ux domain) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; filter: none; }
  html { scroll-behavior: auto; }
}
