/* ============================================================
   LUNA Card — "Luna Glass" theme
   neo-apple glassmorphism + cyan blue (2TheMoon identity)
   ============================================================ */

/* The hidden attribute always wins over component display rules (.field,
   .btn…); without this the Sign in form showed the sign-up Name field. */
[hidden] {
  display: none !important;
}

:root {
  --bg-0: #04060e;
  --bg-1: #070d1d;
  --ink: #eef4ff;
  --ink-dim: #9fb0d0;
  --ink-faint: #66779a;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --blue: #3b82f6;
  --deep: #0ea5e9;
  --glass-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.03)
  );
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --radius: 24px;
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Inter, "Segoe UI", Arial, sans-serif;
}

/* ============================================================
   App shell themes — "Luna Light" (default) & "Dark Moon"
   Set on <html data-app-theme="light|dark-moon">.
   :root carries the Dark Moon tokens; the light block overrides
   them, and the dark-moon block adds moonlight accents (subtle
   cyan glow + hairlines, echoing the 2TheMoon logo).
   Card themes (themes/*.css) are untouched.
   ============================================================ */
[data-app-theme="light"] {
  --bg-0: #eef3fa;
  --bg-1: #ffffff;
  --ink: #0e1a2e;
  --ink-dim: #4a5d7a;
  --ink-faint: #8a9bb8;
  --cyan: #0ea5e9;
  --cyan-soft: #0284c7;
  --blue: #2563eb;
  --deep: #0284c7;
  --glass-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85),
    rgba(255, 255, 255, 0.55)
  );
  --glass-border: rgba(14, 26, 46, 0.1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color-scheme: light;
}
/* Dark Moon moonlight accents (on top of the :root dark tokens) */
[data-app-theme="dark-moon"] body {
  background:
    radial-gradient(
      120% 55% at 50% -8%,
      rgba(34, 211, 238, 0.12),
      transparent 62%
    ),
    var(--bg-0);
}
[data-app-theme="dark-moon"] .topbar {
  border-bottom: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow: 0 1px 14px rgba(34, 211, 238, 0.1);
}
/* Dark Moon radiant cyan text — strong layered glow, stands out on the dark bg */
[data-app-theme="dark-moon"] .brand__word {
  color: var(--cyan-soft);
  text-shadow:
    0 0 6px rgba(103, 232, 249, 0.95),
    0 0 16px rgba(34, 211, 238, 0.85),
    0 0 38px rgba(34, 211, 238, 0.5),
    0 0 90px rgba(34, 211, 238, 0.3);
}
[data-app-theme="dark-moon"] .eyebrow,
[data-app-theme="dark-moon"] .hero__title {
  text-shadow:
    0 0 8px rgba(103, 232, 249, 0.9),
    0 0 24px rgba(103, 232, 249, 0.5),
    0 0 56px rgba(34, 211, 238, 0.3);
}
[data-app-theme="dark-moon"] .menu-item__icon,
[data-app-theme="dark-moon"] .status-pill--published,
[data-app-theme="dark-moon"] .theme-pick__check,
[data-app-theme="dark-moon"] .share-box code {
  text-shadow:
    0 0 8px rgba(103, 232, 249, 0.9),
    0 0 22px rgba(103, 232, 249, 0.45),
    0 0 48px rgba(34, 211, 238, 0.25);
}
/* Headings keep ink color, gain a strong moonlight radiance */
[data-app-theme="dark-moon"] .menu-head h1,
[data-app-theme="dark-moon"] .studio-head h1,
[data-app-theme="dark-moon"] .auth-card h1,
[data-app-theme="dark-moon"] .card h3,
[data-app-theme="dark-moon"] .modal__card h2,
[data-app-theme="dark-moon"] .hero__name {
  text-shadow:
    0 0 14px rgba(34, 211, 238, 0.45),
    0 0 42px rgba(34, 211, 238, 0.22),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
/* Hardcoded dark surfaces → light */
[data-app-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(14, 26, 46, 0.08);
}
[data-app-theme="light"] .cta-row {
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid rgba(14, 26, 46, 0.1);
}
[data-app-theme="light"] .theme-pick__swatch {
  background:
    radial-gradient(
      circle at 70% 25%,
      rgba(2, 132, 199, 0.45),
      transparent 55%
    ),
    linear-gradient(135deg, #ffffff, #d9e8f7);
  border: 1px solid rgba(2, 132, 199, 0.45);
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.22);
}
[data-app-theme="light"] .back-fab {
  color: #0e1a2e;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(14, 26, 46, 0.12);
}
[data-app-theme="light"] .theme-cell__price {
  background: linear-gradient(135deg, #fbd7e6, #f6aecb);
  color: #0e1a2e;
  box-shadow: 0 4px 12px rgba(232, 126, 161, 0.3);
}
[data-app-theme="light"] .soc-ic--fb {
  background: #e2ecfa;
  color: #0e1a2e;
}
/* Form fields & inset surfaces → light (dark text stays readable) */
[data-app-theme="light"] .field input,
[data-app-theme="light"] .field textarea,
[data-app-theme="light"] .field select,
[data-app-theme="light"] .rg-row input,
[data-app-theme="light"] .rg-row select {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(14, 26, 46, 0.16);
}
[data-app-theme="light"] .field input::placeholder,
[data-app-theme="light"] .field textarea::placeholder,
[data-app-theme="light"] .rg-row input::placeholder {
  color: #8a9bb8;
}
[data-app-theme="light"] .share-box {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(14, 26, 46, 0.1);
}
[data-app-theme="light"] .inbox-save {
  background: rgba(14, 165, 233, 0.08);
}
[data-app-theme="light"] .inbox-item,
[data-app-theme="light"] .theme-cell {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(14, 26, 46, 0.1);
}
[data-app-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow:
    0 12px 40px rgba(14, 26, 46, 0.18),
    0 0 20px rgba(34, 211, 238, 0.12);
}
[data-app-theme="light"] .tune-tabs button,
[data-app-theme="light"] .tune-row button {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(14, 26, 46, 0.14);
}
[data-app-theme="light"] .tune-tabs button.on {
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  border-color: transparent;
}
/* App Theme toggle switch (Menu) */
.menu-item__switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  flex: none;
  position: relative;
  background: rgba(127, 140, 160, 0.35);
  border: 1px solid var(--glass-border);
  transition: background 0.2s ease;
}
.menu-item__switch .menu-item__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.menu-item__switch.on {
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}
.menu-item__switch.on .menu-item__knob {
  transform: translateX(20px);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.ambient__glow--cyan {
  width: 60vmax;
  height: 60vmax;
  left: -20vmax;
  top: -22vmax;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.16),
    transparent 65%
  );
}
.ambient__glow--blue {
  width: 70vmax;
  height: 70vmax;
  right: -25vmax;
  bottom: -30vmax;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.14),
    transparent 65%
  );
}
.ambient__moon {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  left: 50%;
  top: -24vmax;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(103, 232, 249, 0.1),
    transparent 60%
  );
}
.ambient__stars {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(
      1.5px 1.5px at 34% 68%,
      rgba(165, 243, 252, 0.6),
      transparent
    ),
    radial-gradient(1px 1px at 58% 44%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 88% 62%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(
      1.5px 1.5px at 22% 82%,
      rgba(165, 243, 252, 0.45),
      transparent
    ),
    radial-gradient(1px 1px at 68% 86%, rgba(255, 255, 255, 0.4), transparent);
}

/* ---------- Layout ---------- */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
}
/* Theme card headers start below the status bar in the app too. */
.t-topbar {
  margin-top: var(--safe-top);
}
.shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 20px 120px;
}

/* The Luna Glass ambient glow belongs to that theme only —
   editorial themes bring their own backgrounds. */
body[data-theme]:not([data-theme=""]):not([data-theme="luna-glass"]) .ambient {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -20px;
  /* In the iPhone app the page runs under the status bar: keep the
     buttons below the clock so they stay easy to tap. */
  padding: calc(14px + var(--safe-top)) 24px 14px;
  background: rgba(3, 10, 18, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(148, 197, 255, 0.08);
}

/* Floating sticky back button — editorial theme profiles.
   Fixed to the viewport so it stays visible while scrolling. */
.back-fab {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 14px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px 3px 0;
  color: #fff;
  background: rgba(10, 18, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.back-fab:active {
  transform: scale(0.94);
}
/* The fixed back button sits over the editorial topbar: make room for it. */
.t-shell.has-back .t-brand {
  margin-left: 50px;
}
/* Studio gallery rows: thumbnail + picker instead of a URL field */
.rg-row .rg-thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--bg-1);
}
.rg-row .rg-pick {
  cursor: pointer;
  white-space: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.55),
    0 0 4px rgba(34, 211, 238, 0.8);
}
.brand__word {
  font-weight: 700;
  letter-spacing: 0.42em;
  font-size: 15px;
  padding-left: 2px;
}

/* Brand lockup: "LUNA Digital Card" — shared by all theme profiles.
   The sub inherits each theme's brand font; only size/spacing normalize. */
.t-brand__sub,
.brand__sub {
  font-size: 0.58em;
  letter-spacing: 0.3em;
  font-weight: 400;
  opacity: 0.68;
  margin-left: 1.1em;
  white-space: nowrap;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  color: var(--ink);
  font-size: 17px;
  box-shadow: var(--glass-highlight);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--glass-highlight),
    0 8px 24px rgba(34, 211, 238, 0.18);
}

/* ---------- Glass primitives ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    var(--glass-highlight),
    0 24px 60px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan-soft);
  margin-bottom: 10px;
}
.muted {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.55;
}
.fineprint {
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Hero (public card) ---------- */
.hero {
  text-align: center;
  padding: 34px 24px 30px;
  margin-top: 6px;
  position: relative;
}
.hero__ring {
  width: 168px;
  height: 168px;
  margin: 0 auto 22px;
  border-radius: 50%;
  padding: 5px;
  background: conic-gradient(
    from 200deg,
    var(--cyan),
    var(--blue),
    #0e7490,
    var(--cyan)
  );
  box-shadow:
    0 0 54px rgba(34, 211, 238, 0.5),
    0 0 14px rgba(34, 211, 238, 0.55);
}
.hero__ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-1);
}
.hero__name {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.hero__title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cyan-soft);
}
.hero__company {
  margin-top: 6px;
  color: var(--ink-dim);
  font-size: 14.5px;
}
.hero__bio {
  margin: 16px auto 0;
  max-width: 34ch;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}

.preview-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #04222b;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
  padding: 16px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
  text-decoration: none;
  color: var(--ink);
}
.btn:active {
  transform: scale(0.98);
}
.btn--block {
  width: 100%;
}
.btn--primary {
  background: linear-gradient(
    135deg,
    var(--cyan-soft),
    var(--cyan) 55%,
    var(--deep)
  );
  color: #032630;
  box-shadow:
    0 10px 34px rgba(34, 211, 238, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--primary:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 40px rgba(34, 211, 238, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--glass-highlight);
}
.btn--glass:hover {
  box-shadow:
    var(--glass-highlight),
    0 10px 30px rgba(34, 211, 238, 0.16);
}
.btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--ink-dim);
}
.btn--danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.btn--sm {
  padding: 10px 16px;
  font-size: 14px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sticky bottom CTA bar — always reachable */
.cta-row {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(4, 6, 14, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.cta-row .btn {
  padding: 15px 10px;
  font-size: 15px;
}
/* Edit Profile: Preview · Save Draft · Publish */
.publish-bar {
  grid-template-columns: 1fr 1fr 1.2fr;
}
.publish-bar .btn {
  padding: 14px 6px;
  font-size: 14.5px;
}
/* ---------- First-run tutorial ---------- */
.tour-spot {
  position: fixed;
  z-index: 90;
  border-radius: 18px;
  box-shadow:
    0 0 0 2px var(--cyan),
    0 0 24px rgba(34, 211, 238, 0.45),
    0 0 0 200vmax rgba(2, 6, 18, 0.62);
  pointer-events: none;
  transition:
    top 0.2s ease,
    left 0.2s ease,
    width 0.2s ease,
    height 0.2s ease;
}
.tour-spot--none {
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  box-shadow: 0 0 0 200vmax rgba(2, 6, 18, 0.62);
}
.tour-tip {
  position: fixed;
  z-index: 91;
  padding: 18px 18px 14px;
  border-radius: 20px;
  animation: tour-in 0.25s ease;
}
@keyframes tour-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.tour-tip h3 {
  margin: 8px 0 6px;
}
.tour-tip p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 14.5px;
  line-height: 1.45;
}
.tour-tip__dots {
  display: flex;
  gap: 6px;
}
.tour-tip__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.tour-tip__dots span.on {
  width: 18px;
  border-radius: 3px;
  background: var(--cyan);
}
.tour-tip__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
/* Keep toasts above the bar */
body:has(.publish-bar) .toast {
  bottom: calc(92px + env(safe-area-inset-bottom));
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--glass-highlight);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.16s ease;
}
.quick:hover {
  transform: translateY(-2px);
}
.quick__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle at 30% 25%,
    rgba(103, 232, 249, 0.28),
    rgba(34, 211, 238, 0.08)
  );
  border: 1px solid rgba(103, 232, 249, 0.35);
  box-shadow:
    0 0 18px rgba(34, 211, 238, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-size: 19px;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 22px;
}
.social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
/* Liquid-glass icon: translucent lens, specular top edge, soft inner shade. */
.social__glass {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(
      120% 90% at 30% 10%,
      rgba(255, 255, 255, 0.22),
      transparent 55%
    ),
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.04)
    );
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -6px 12px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s cubic-bezier(0.32, 0.72, 0.35, 1),
    box-shadow 0.2s ease;
}
.social__glass::before {
  content: "";
  position: absolute;
  inset: 2px 8px auto;
  height: 45%;
  border-radius: 50% / 60% 60% 40% 40%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}
.social__glass svg {
  position: relative;
  width: 26px;
  height: 26px;
}
.social__ink {
  fill: #fff;
}
.social:hover .social__glass {
  transform: translateY(-2px) scale(1.04);
}
.social:active .social__glass {
  transform: scale(0.94);
}
.social:hover {
  color: var(--cyan-soft);
}
[data-app-theme="light"] .social__glass {
  background:
    radial-gradient(
      120% 90% at 30% 10%,
      rgba(255, 255, 255, 0.95),
      transparent 60%
    ),
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.75),
      rgba(230, 240, 252, 0.45)
    );
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -6px 12px rgba(14, 26, 46, 0.08),
    0 10px 24px rgba(14, 26, 46, 0.14),
    0 0 0 0.5px rgba(14, 26, 46, 0.08);
}
[data-app-theme="light"] .social__ink {
  fill: #111;
}

.powered {
  text-align: center;
  margin-top: 34px;
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.08em;
}
.powered strong {
  color: var(--ink-dim);
  font-weight: 600;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
}
#share-modal {
  z-index: 70;
}
.modal[hidden] {
  display: none;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.7);
  backdrop-filter: blur(6px);
}
.modal__card {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 12px 12px;
  padding: 28px 24px;
  animation: sheet-up 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
  max-height: 88dvh;
  overflow-y: auto;
}
@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.modal__card h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.field {
  display: block;
  margin-top: 16px;
}
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.field > span em {
  font-style: normal;
  color: var(--ink-faint);
  font-weight: 400;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: rgba(4, 8, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 13px 15px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.field textarea {
  min-height: 84px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
/* Off-screen field that only form bots fill (Exchange Contact). */
.field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-error {
  color: #fca5a5;
  font-size: 13.5px;
  margin-top: 12px;
}
#exchange-form .btn {
  margin-top: 20px;
}
#exchange-form .fineprint {
  margin-top: 12px;
  text-align: center;
}
.success-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 6px auto 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #032630;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.5);
}
#exchange-success {
  text-align: center;
}
#exchange-success .btn {
  margin-top: 18px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(10, 18, 34, 0.9);
  border: 1px solid rgba(103, 232, 249, 0.35);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--ink);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  z-index: 80;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(34, 211, 238, 0.15);
  animation: toast-in 0.25s ease;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast[hidden] {
  display: none;
}
@keyframes toast-in {
  from {
    transform: translate(-50%, 12px);
    opacity: 0;
  }
}

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

/* ---------- Studio ---------- */
.studio-head {
  padding: 8px 4px 18px;
}
.studio-head h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.status-pill--draft {
  color: #fcd34d;
  background: rgba(252, 211, 77, 0.1);
  border: 1px solid rgba(252, 211, 77, 0.35);
}
.status-pill--published {
  color: var(--cyan-soft);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.card {
  padding: 22px;
  margin-bottom: 16px;
}
.card h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
.card > .muted {
  font-size: 13.5px;
  margin-bottom: 6px;
}

.theme-pick {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(103, 232, 249, 0.4);
  background: rgba(34, 211, 238, 0.07);
  cursor: pointer;
}
.theme-pick__swatch {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex: none;
  background:
    radial-gradient(
      circle at 70% 25%,
      rgba(103, 232, 249, 0.9),
      transparent 55%
    ),
    linear-gradient(135deg, #0b1530, #04060e);
  border: 1px solid rgba(103, 232, 249, 0.5);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.theme-pick strong {
  display: block;
  font-size: 15px;
}
.theme-pick span {
  font-size: 13px;
  color: var(--ink-dim);
}
.theme-pick__check {
  margin-left: auto;
  color: var(--cyan);
  font-size: 20px;
}
.theme-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-faint);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.btn-row .btn {
  flex: 1;
  min-width: 130px;
}

.share-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(4, 8, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.share-box code {
  font-size: 12.5px;
  color: var(--cyan-soft);
  word-break: break-all;
  flex: 1;
}
#share-native {
  display: block;
  width: 100%;
  margin-top: 12px;
}
.qr-wrap {
  text-align: center;
  margin-top: 16px;
}
.qr-wrap img {
  width: 180px;
  height: 180px;
  border-radius: 18px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.25);
}

.inbox-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inbox-count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}
.inbox-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.inbox-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  /* minmax(0, …): a long name or reminder is cut with "…", it never widens the row past the screen. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.inbox-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}
.inbox-body {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}
.inbox-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.inbox-line strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-when {
  margin-left: auto;
  flex: none;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.inbox-link {
  font-size: 13px;
  color: var(--cyan-soft);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-save {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 52px;
  padding: 8px 6px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan-soft);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.inbox-save span {
  font-size: 11px;
  font-weight: 600;
}
.inbox-save:disabled {
  opacity: 0.5;
}
.inbox-empty {
  text-align: center;
  padding: 26px 10px;
  color: var(--ink-faint);
  font-size: 14px;
}
.inbox-empty span {
  display: block;
  font-size: 28px;
  color: var(--cyan-soft);
  margin-bottom: 6px;
}
.inbox-empty p {
  margin: 0;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}
.avatar-row img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}

.studio-nav {
  position: sticky;
  bottom: 0;
  padding: 12px 0 0;
}
.empty-note {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin-top: 8px;
}

@media (min-width: 520px) {
  .modal {
    place-items: center;
  }
  .modal__card {
    margin: 0;
  }
}

/* ---------- Theme picker grid (Studio) ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.theme-cell {
  appearance: none;
  cursor: pointer;
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  text-align: left;
  color: var(--ink);
  position: relative;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
.theme-cell:hover {
  transform: translateY(-2px);
}
.theme-cell--active {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px var(--cyan),
    0 0 18px rgba(34, 211, 238, 0.25);
}
.theme-cell__thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--bg-1);
}
.theme-cell__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.theme-cell__name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.3;
}
.theme-cell__meta {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.theme-cell__perk {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--cyan);
  margin-top: 2px;
}
.theme-perk {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.45;
}
.theme-perk strong {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
}
[data-app-theme="light"] .theme-cell__perk,
[data-app-theme="light"] .theme-perk strong {
  color: #0369a1;
}
[data-app-theme="light"] .theme-perk {
  border-color: rgba(2, 132, 199, 0.3);
  background: rgba(2, 132, 199, 0.07);
}
.theme-cell__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #032630;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}
.theme-cell__price {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: linear-gradient(135deg, #f4a7c3, #e87ea1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(232, 126, 161, 0.45);
}

/* ---------- Rosé Glass Studio controls ---------- */
.rg-sub {
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: 700;
}
.rg-sub:first-of-type {
  margin-top: 14px;
}
.rg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.rg-row input,
.rg-row select {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: rgba(4, 8, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
.rg-row input:focus,
.rg-row select:focus {
  border-color: var(--cyan);
}
.rg-row .icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
}
.rg-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 14.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.rg-toggle:last-child {
  border-bottom: 0;
}
.rg-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #e87ea1;
  cursor: pointer;
}

/* ---------- Login ---------- */
.auth-shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-card {
  padding: 32px 26px;
  text-align: center;
}
.auth-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 18px;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
}
.auth-card h1 {
  font-size: 26px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.auth-card form {
  text-align: left;
  margin-top: 8px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--ink-faint);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.auth-social {
  font-size: 15px;
}

.soc-ic {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
}
.soc-ic--fb {
  background: #1877f2;
  color: #fff;
  font-family: var(--font);
}
.soc-ic--google {
  background: #fff;
  color: #4285f4;
  font-family: var(--font);
}
/* Apple's guidelines: the Apple logo, white on black or black on white. */
.soc-ic--apple {
  background: #fff;
  color: #000;
}

/* ---------- App/company promo (Luna Glass public card) ---------- */
.promo-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 18px;
  border: 1px solid rgba(103, 232, 249, 0.3);
  background:
    radial-gradient(
      circle at 85% 20%,
      rgba(103, 232, 249, 0.14),
      transparent 60%
    ),
    var(--glass-bg);
}
.promo-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}
.promo-card div {
  flex: 1;
}
.promo-card strong {
  display: block;
  font-size: 15.5px;
  margin-bottom: 4px;
}
.promo-card p {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.45;
}
.auth-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-powered img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- Menu ---------- */
.menu-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 4px 20px;
}
.menu-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
  border: 2px solid rgba(103, 232, 249, 0.5);
}
.menu-head h1 {
  font-size: 24px;
  letter-spacing: -0.01em;
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-item {
  appearance: none;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  transition: transform 0.15s ease;
}
.menu-item:active {
  transform: scale(0.99);
}
.menu-item__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--cyan-soft);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.3);
}
.menu-item__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-item__text strong {
  font-size: 16px;
  font-weight: 600;
}
.menu-item__text span {
  font-size: 13px;
  color: var(--ink-dim);
}
.menu-item__chev {
  font-size: 24px;
  color: var(--ink-faint);
}

/* ---------- Physical card ---------- */
.nfc-card {
  border-radius: 22px;
  padding: 26px;
  margin: 6px 0 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 80% 15%,
      rgba(103, 232, 249, 0.25),
      transparent 55%
    ),
    linear-gradient(135deg, #101a30, #060a16);
  border: 1px solid rgba(103, 232, 249, 0.35);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(34, 211, 238, 0.15);
  display: flex;
  align-items: center;
  gap: 18px;
}
.nfc-card img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.5);
}
.nfc-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.nfc-sub {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--cyan-soft);
  margin-top: 6px;
}
.nfc-chip {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #d9c193, #a98c5f);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* ---------- Apple Wallet ---------- */
.pass-preview {
  padding: 24px;
  margin: 6px 0 18px;
}
.pass-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.pass-top img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.pass-top div {
  display: flex;
  flex-direction: column;
}
.pass-top strong {
  font-size: 16px;
}
.pass-top span {
  font-size: 12.5px;
  color: var(--ink-dim);
}
.pass-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.pass-sub {
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--cyan-soft);
  margin-top: 6px;
}

/* ---------- Preview tuner ---------- */
.tune-fab,
.share-fab {
  position: fixed;
  right: 16px;
  bottom: 108px;
  z-index: 55;
  appearance: none;
  border: 1px solid rgba(103, 232, 249, 0.45);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: #032630;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.4);
}
.tune-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 104px;
  z-index: 60;
  width: min(440px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 20px;
}
.tune-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tune-tabs button {
  flex: 1;
  appearance: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 9px 4px;
}
.tune-tabs button.on {
  color: #032630;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  border-color: transparent;
}
.tune-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tune-row button {
  appearance: none;
  cursor: pointer;
  font-family: var(--font);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
}
.tune-row #tune-size {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.tune-row .tune-done {
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  color: #032630;
  border: 0;
}
.tune-row .tune-reset {
  color: var(--ink-dim);
}
.tune-hint {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}
body.tuning [data-tune] {
  outline: 2px dashed rgba(34, 211, 238, 0.8);
  outline-offset: 4px;
  cursor: move;
  border-radius: 6px;
  -webkit-user-select: none;
  user-select: none;
}

/* Customize panel: alignment group (wraps on narrow phones) */
.tune-row {
  flex-wrap: wrap;
}
.tune-align {
  display: inline-flex;
  gap: 4px;
}
.tune-row .tune-align button.on {
  color: #032630;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
  border-color: transparent;
}

/* Tuner drag: no theme transitions/animations fighting the live transform, no iOS text callout */
body.tuning [data-tune],
body.tuning [data-tune-panel] {
  transition: none !important;
  animation: none !important;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
body.tuning .dragging {
  will-change: transform;
  outline-color: var(--cyan);
}
/* While customizing, the fixed action bars would cover text near the bottom of the screen */
body.tuning .cta-row,
body.tuning .t-actions {
  display: none !important;
}

/* Customize > Photo: drag/pinch the photo; the zoom slider sits in the panel */
.tune-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 160px;
}
.tune-zoom[hidden],
.tune-row [hidden] {
  display: none !important;
}
.tune-zoom input[type="range"] {
  flex: 1;
  min-width: 90px;
  accent-color: var(--cyan);
}
body.tuning-photo img[data-photo] {
  outline: 2px dashed rgba(34, 211, 238, 0.8);
  outline-offset: -2px;
  cursor: grab;
  -webkit-user-drag: none;
  user-select: none;
}
body.tuning-photo .dragging img[data-photo] {
  cursor: grabbing;
}

/* Long-form text pages (privacy policy) */
.prose h3 {
  margin: 18px 0 6px;
  font-size: 15px;
}
.prose h3:first-child {
  margin-top: 0;
}
.prose p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.prose a,
.powered a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Draft preview of long-form themes: example content for empty sections. */
.is-sample {
  position: relative;
  opacity: 0.6;
  outline: 1.5px dashed currentColor;
  outline-offset: 4px;
}
.sample-tag {
  position: absolute;
  top: -10px;
  right: 14px;
  z-index: 2;
  padding: 2px 10px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font:
    700 0.62rem/1.6 -apple-system,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rg-gallery__ph {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1.5px dashed currentColor;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  opacity: 0.7;
}
.sample-note {
  margin: 22px 20px 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px dashed #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: center;
}

/* VIP invitations list (owner only) */
.vip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid rgba(127, 127, 127, 0.18);
}
.vip-row:first-child {
  border-top: 0;
}
.vip-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.vip-row__main .muted {
  font-size: 13px;
}
.vip-row__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.legal-note {
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
}
.legal-note a {
  color: inherit;
  text-decoration: underline;
}

/* Show/hide password eye (addPasswordEyes in app.js) */
.pw-wrap {
  position: relative;
}
.field .pw-wrap input {
  padding-right: 50px;
}
.pw-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
}
.pw-eye:hover,
.pw-eye:focus-visible {
  color: var(--ink);
}
.pw-eye:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

/* ---------- Leads (light CRM) ---------- */
.leads-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.leads-search {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(4, 8, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 11px 16px;
  outline: none;
}
.leads-search:focus {
  border-color: var(--cyan);
}
.leads-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.leads-filters::-webkit-scrollbar {
  display: none;
}
.lead-chip {
  flex: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--ink-dim);
  cursor: pointer;
}
.lead-chip b {
  font-weight: 700;
  color: var(--ink-faint);
  margin-left: 2px;
}
.lead-chip.on {
  color: #04121a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}
.lead-chip.on b {
  color: #04121a;
}
.lead-status {
  flex-wrap: wrap;
  overflow: visible;
}
.lead-chip--hot.on {
  background: linear-gradient(135deg, #fdba74, #f97316);
}
.lead-chip--following.on {
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
}
.lead-chip--won.on {
  background: linear-gradient(135deg, #86efac, #22c55e);
}
.lead-chip--lost.on {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
}
.lead-row {
  cursor: pointer;
}
.lead-pill {
  flex: none;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--cyan-soft);
  background: rgba(34, 211, 238, 0.12);
}
.lead-pill--hot {
  color: #f97316;
  background: rgba(249, 115, 22, 0.14);
}
.lead-pill--following {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.14);
}
.lead-pill--won {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.14);
}
.lead-pill--lost {
  color: var(--ink-faint);
  background: rgba(148, 163, 184, 0.14);
}
.lead-sub {
  font-size: 12.5px;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.late {
  color: #f87171 !important;
  font-weight: 600;
}
.lead-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}
.lead-tags i {
  font-style: normal;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  color: var(--ink-dim);
  border: 1px solid var(--glass-border);
}
.lead-tags--edit {
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.lead-tags--edit i {
  font-size: 13px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lead-tags--edit i button {
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.lead-tags--edit form {
  flex: 1;
  min-width: 160px;
}
.lead-tags--edit input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 1px dashed var(--glass-border);
  border-radius: 999px;
  padding: 7px 12px;
  outline: none;
}
.leads-due h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lead-due {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--glass-border);
  padding: 12px 0;
  margin-top: 6px;
  cursor: pointer;
}
.lead-due span {
  grid-column: 1;
  font-size: 13px;
  color: var(--ink-dim);
}
.lead-due time {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 12.5px;
  color: var(--cyan-soft);
}
.lead-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 4px 16px;
}
.lead-head h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.lead-head .muted {
  font-size: 13.5px;
  word-break: break-word;
}
.lead-head__avatar {
  width: 58px;
  height: 58px;
  font-size: 19px;
}
.lead-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.lead-act {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 4px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-highlight);
  cursor: pointer;
}
.lead-act span {
  font-size: 20px;
  line-height: 1;
  color: var(--cyan-soft);
}
.lead-act:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.lead-tasks,
.lead-history {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.lead-tasks li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}
.lead-tasks li div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.lead-tasks time {
  font-size: 12.5px;
  color: var(--cyan-soft);
}
.lead-check {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: none;
  cursor: pointer;
}
.lead-check:hover {
  background: rgba(34, 211, 238, 0.2);
}
.lead-x {
  flex: none;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.lead-hint {
  font-size: 12.5px;
  margin-top: 10px;
}
.lead-history li {
  position: relative;
  padding: 12px 28px 12px 0;
  border-top: 1px solid var(--glass-border);
}
.lead-history time {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.lead-history p {
  margin: 3px 0 0;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.lead-history .lead-event {
  color: var(--ink-dim);
  font-size: 13.5px;
}
.lead-history .lead-x {
  position: absolute;
  top: 8px;
  right: 0;
}
[data-app-theme="light"] .leads-search,
[data-app-theme="light"] .lead-tags--edit input {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(14, 26, 46, 0.16);
}
[data-app-theme="light"] .lead-pill--hot {
  color: #c2410c;
}
[data-app-theme="light"] .lead-pill--following {
  color: #6d28d9;
}
[data-app-theme="light"] .lead-pill--won {
  color: #15803d;
}
[data-app-theme="light"] .late {
  color: #dc2626 !important;
}

/* ---------- Leads: card insights, event mode, templates, 2TheMoon SaaS ---------- */
.ins-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ins-range {
  display: flex;
  gap: 6px;
}
.ins-range .lead-chip {
  padding: 6px 11px;
  font-size: 12px;
}
.ins-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.ins-tile {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.ins-tile b {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ins-tile > span {
  font-size: 13px;
  color: var(--ink-dim);
}
.ins-delta {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.ins-delta.up {
  color: #22c55e;
}
.ins-delta.down {
  color: #f97316;
}
.ins-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
  margin: 16px 0 6px;
}
.ins-bars i {
  flex: 1;
  min-width: 1px;
  border-radius: 3px 3px 0 0;
  background: var(--cyan);
  opacity: 0.85;
}
.ins-bars i.zero {
  background: var(--glass-border);
  opacity: 1;
}
.ins-small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-dim);
}
.ins-small b {
  color: var(--ink);
}
.ins-empty {
  margin-top: 10px;
  font-size: 13px;
}
.ins-sub {
  margin: 18px 0 4px;
  font-size: 14px;
}
.ins-sources {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ins-sources button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--glass-border);
  padding: 10px 0;
  cursor: pointer;
}
.ins-sources span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ins-sources em {
  font-style: normal;
  font-size: 12px;
  color: #22c55e;
}
.lead-event,
.lead-event-on {
  padding: 14px 16px;
}
.lead-event__open,
.lead-event-on {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lead-event__open {
  width: 100%;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.lead-event__open div,
.lead-event-on div {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.lead-event__open div span,
.lead-event-on div span {
  font-size: 12.5px;
  color: var(--ink-dim);
}
.lead-event__open i {
  font-style: normal;
  font-size: 20px;
  color: var(--ink-faint);
}
.lead-event #event-form {
  margin-top: 14px;
}
.lead-event-on {
  border-color: var(--cyan);
}
.tpl-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.tpl-item {
  display: grid;
  gap: 4px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
}
.tpl-item span {
  font-size: 12.5px;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.tpl-edit,
.saas-line {
  display: block;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--cyan-soft);
  text-decoration: none;
}
.saas-line {
  color: var(--ink-dim);
}
.tpl-help code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.saas-card h3 {
  margin: 4px 0 8px;
}
.saas-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-dim);
  display: grid;
  gap: 4px;
}
#tpl-modal .modal__card {
  background: var(--bg-1);
}

/* Date and time pickers: iOS gives them their own minimum width and height,
   so without this the "When" box grows past its card and over its neighbours. */
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 50px;
  line-height: 1.3;
}
.field input::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.3em;
}
#leads-event {
  margin-top: 14px;
}
.ins-bars[hidden] {
  display: none;
}

/* Leads: Leads / Exchange / Insights / Tools tabs */
.leads-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}
.leads-tab {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
}
.leads-tab.on {
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan-soft), var(--cyan));
}
@media (max-width: 380px) {
  .leads-tab {
    font-size: 13px;
    padding: 10px 2px;
  }
}
/* Leads › Tools › Import: what was found in the file, before it is sent. */
.import-preview {
  display: grid;
  gap: 6px;
  margin: 4px 0 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  font-size: 14px;
  color: var(--ink-dim);
}
.import-preview strong {
  font-size: 16px;
  color: var(--ink);
}
.import-preview ul {
  margin: 2px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}
.import-preview li b {
  color: var(--ink);
}
.contact-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.import-preview ul.contact-list {
  max-height: 46vh;
  overflow-y: auto;
  gap: 0;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
.contact-list li + li {
  border-top: 1px solid var(--glass-border);
}
.contact-list li.muted {
  padding: 10px 12px;
}
.contact-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
}
.contact-list label span {
  display: grid;
  min-width: 0;
}
.contact-list label i {
  font-style: normal;
  font-size: 13px;
}
.contact-list label.is-lead {
  opacity: 0.55;
  cursor: default;
}
.contact-list input,
.contact-all input {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--cyan);
}
.import-done {
  margin: 4px 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
/* Leads › Exchange: the switch for the form on the card. */
.exchange-state {
  width: 100%;
  margin: 0 0 14px;
  text-align: left;
}
.exchange-state:disabled {
  opacity: 0.6;
}
.inbox-count:empty {
  display: none;
}
[data-pane="insights"] #leads-event {
  margin-top: 0;
}

/* ============================================================
   App navigation + screen-size layouts
   body.has-nav = a signed-in app screen (set by renderNav in app.js).
   Phones (< 768px): tab bar at the bottom, like a native app.
   Tablets and computers (>= 768px): sidebar on the left and the page
   uses the whole screen. Public cards never get .has-nav.
   ============================================================ */
:root {
  --nav-w: 0px;
  --tab-h: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
.appnav {
  position: fixed;
  z-index: 65;
  font-family: var(--font);
  background: rgba(6, 12, 26, 0.82);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}
[data-app-theme="light"] .appnav {
  background: rgba(255, 255, 255, 0.86);
}
.appnav__item {
  color: var(--ink-dim);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.appnav__item.is-on {
  color: var(--cyan-soft);
}
[data-app-theme="dark-moon"] .appnav__item.is-on .appnav__icon {
  text-shadow:
    0 0 8px rgba(103, 232, 249, 0.9),
    0 0 22px rgba(103, 232, 249, 0.45);
}
.side-preview {
  display: none;
}
/* The live preview frame shows the card only. */
.embedded #card-back,
.embedded #go-studio,
.embedded .tune-fab,
.embedded .share-fab,
.embedded .toast {
  display: none !important;
}
.embedded body {
  scrollbar-width: none;
}
.embedded body::-webkit-scrollbar {
  display: none;
}

/* ---------- Phones: tab bar ---------- */
@media (max-width: 767.98px) {
  body.has-nav {
    --tab-h: calc(58px + var(--safe-bottom));
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
  }
  body.has-nav.typing {
    --tab-h: 0px;
  }
  body.has-nav.typing .appnav {
    display: none;
  }
  .appnav {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 6px var(--safe-bottom);
    border-top: 1px solid var(--glass-border);
  }
  .appnav__brand,
  .appnav__me,
  .appnav__out,
  .appnav__label,
  .appnav__item:not(.appnav__item--tab) {
    display: none;
  }
  .appnav__items {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: 58px;
  }
  .appnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }
  .appnav__icon {
    font-size: 21px;
    line-height: 1;
    display: grid;
    place-items: center;
    width: 46px;
    height: 28px;
    border-radius: 14px;
    transition: background 0.15s ease;
  }
  .appnav__item.is-on .appnav__icon {
    background: rgba(34, 211, 238, 0.16);
  }
  .appnav__item:active .appnav__icon {
    transform: scale(0.92);
  }
  body.has-nav .shell {
    padding-bottom: calc(96px + var(--tab-h));
  }
  /* Edit Profile's Preview / Save / Publish bar sits on top of the tabs. */
  body.has-nav .cta-row {
    bottom: var(--tab-h);
    padding-bottom: 12px;
  }
  body.has-nav.typing .cta-row {
    padding-bottom: calc(12px + var(--safe-bottom));
  }
  body.has-nav .toast {
    bottom: calc(28px + var(--tab-h));
  }
  body.has-nav[data-page="studio-edit"] .toast {
    bottom: calc(100px + var(--tab-h));
  }
}

/* ---------- Tablets and computers: sidebar + full-width pages ---------- */
@media (min-width: 768px) {
  body.has-nav {
    --nav-w: 232px;
  }
  .appnav {
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--nav-w);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: calc(22px + var(--safe-top)) 14px calc(18px + var(--safe-bottom));
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
  }
  .appnav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 14px;
  }
  .appnav__brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.45);
  }
  .appnav__brand .brand__word {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.42em;
    color: var(--ink);
  }
  .appnav__me {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    margin-bottom: 10px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    min-width: 0;
  }
  .appnav__me img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    border: 1.5px solid rgba(103, 232, 249, 0.5);
  }
  .appnav__me div {
    min-width: 0;
    display: grid;
  }
  .appnav__me strong,
  .appnav__me span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .appnav__me strong {
    font-size: 14px;
    color: var(--ink);
  }
  .appnav__me span {
    font-size: 11.5px;
    color: var(--ink-faint);
  }
  .appnav__items {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .appnav__short {
    display: none;
  }
  .appnav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 14px;
    font-size: 14.5px;
    font-weight: 600;
    transition:
      background 0.15s ease,
      color 0.15s ease;
  }
  .appnav__item:hover {
    background: rgba(34, 211, 238, 0.08);
    color: var(--ink);
  }
  .appnav__item.is-on {
    background: rgba(34, 211, 238, 0.14);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.28);
  }
  .appnav__icon {
    width: 26px;
    text-align: center;
    font-size: 18px;
    flex: none;
  }
  .appnav__out {
    appearance: none;
    margin-top: auto;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--ink-dim);
    font: 600 14px var(--font);
    cursor: pointer;
  }
  .appnav__out:hover {
    color: var(--ink);
    background: rgba(34, 211, 238, 0.08);
  }

  /* Page area: everything right of the sidebar. Sections sit two across. */
  body.has-nav .shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 32px 96px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
  }
  body.has-nav #app {
    margin-left: var(--nav-w);
  }
  body.has-nav .shell > * {
    grid-column: 1 / -1;
    min-width: 0;
  }
  body.has-nav .shell > .card {
    grid-column: auto;
  }
  /* A lone last section takes the full row instead of leaving a hole. */
  body.has-nav .shell > .card:only-of-type {
    grid-column: 1 / -1;
  }
  body.has-nav .topbar {
    position: static;
    margin: 0;
    padding: calc(20px + var(--safe-top)) 0 6px;
    background: none;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body.has-nav .topbar .brand,
  body.has-nav .topbar > span:empty {
    display: none;
  }
  body.has-nav[data-page="menu"] .topbar {
    padding-top: calc(28px + var(--safe-top));
  }
  body.has-nav .studio-head h1,
  body.has-nav .menu-head h1 {
    font-size: 34px;
  }
  body.has-nav .powered {
    margin-top: 28px;
  }
  body.has-nav .toast {
    left: calc(50% + var(--nav-w) / 2);
  }

  /* Home: the menu as tiles */
  body.has-nav .menu-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
  }
  body.has-nav .menu-item {
    padding: 20px 18px;
    height: 100%;
  }
  body.has-nav #logout {
    display: none; /* Log out is in the sidebar */
  }

  /* Leads: the people list flows in columns */
  body.has-nav #leads-list .inbox-list {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  }
  body.has-nav .leads-tools {
    max-width: 720px;
  }
  body.has-nav .lead-actions {
    max-width: 560px;
  }

  /* Themes: more designs per row */
  body.has-nav #card-themes {
    grid-column: 1 / -1;
  }
  body.has-nav .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 16px;
  }

  /* Wallet pass preview keeps a card-like width */
  body.has-nav .pass-preview {
    max-width: 460px;
  }

  /* Bottom action bar spans the page area */
  body.has-nav .cta-row {
    left: var(--nav-w);
    right: 0;
    width: auto;
    max-width: none;
    transform: none;
    grid-template-columns: repeat(3, minmax(0, 190px));
    justify-content: center;
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Edit Profile: one form column (the live preview joins it from 1000px) */
  body.has-nav[data-page="studio-edit"] .shell > .card {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1000px) {
  body.has-nav .shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.has-nav[data-page="studio-edit"] .shell {
    grid-template-columns: minmax(0, 1fr) 372px;
    column-gap: 32px;
  }
  body.has-nav[data-page="studio-edit"] .shell > .studio-head,
  body.has-nav[data-page="studio-edit"] .shell > .card,
  body.has-nav[data-page="studio-edit"] .shell > .powered {
    grid-column: 1;
  }
  body.has-nav[data-page="studio-edit"] .side-preview {
    display: block;
    grid-column: 2;
    grid-row: 2 / span 40;
    position: sticky;
    top: 20px;
    align-self: start;
  }
  .side-preview__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 10px 6px;
  }
  .side-preview__phone {
    height: min(720px, calc(100dvh - 240px));
    border-radius: 40px;
    padding: 9px;
    background: #0b0f1a;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      0 30px 70px rgba(4, 10, 24, 0.35),
      0 0 0 1px rgba(0, 0, 0, 0.4);
  }
  .side-preview__phone iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 32px;
    background: var(--bg-0);
    display: block;
  }
  .side-preview__note {
    font-size: 12.5px;
    text-align: center;
    margin-top: 12px;
  }
}
