/* ================================================================
   THE THRESHOLD — Magna Historia auth suite (Liquid Glass, iOS 26)
   - Cool slate-teal glass frame
   - Warm gold brand accents (Magna bolt + primary CTA)
   - Mouse-tracked specular highlight
   - Refraction-grade backdrop blur + saturation
   ================================================================ */

:root {
  /* glass body */
  --th-glass-bg-1: rgba(28, 60, 67, 0.42);
  --th-glass-bg-2: rgba(12, 26, 29, 0.62);
  --th-glass-border: rgba(155, 179, 190, 0.20);
  --th-glass-highlight-top: rgba(255, 255, 255, 0.22);
  --th-glass-highlight-bot: rgba(0, 0, 0, 0.30);

  /* text */
  --th-ink: #e4e6ed;
  --th-ink-muted: #9BB3BE;
  --th-ink-faint: #698E98;
  --th-ink-dim: #526268;

  /* warm gold (Magna brand bolt) */
  --th-gold: #FFD866;
  --th-gold-soft: #FFE9A6;
  --th-gold-deep: #C06810;
  --th-gold-bg: rgba(255, 216, 102, 0.10);
  --th-gold-bg-hover: rgba(255, 216, 102, 0.16);
  --th-gold-border: rgba(255, 216, 102, 0.42);
  --th-gold-glow: rgba(255, 216, 102, 0.30);

  /* signal-cyan (subtle, brand secondary) */
  --th-cyan: #22d3ee;
  --th-cyan-soft: rgba(34, 211, 238, 0.18);

  /* destructive */
  --th-coral: #f43f5e;
  --th-coral-bg: rgba(244, 63, 94, 0.10);
  --th-coral-border: rgba(244, 63, 94, 0.40);

  /* radii */
  --th-r-modal: 32px;
  --th-r-pill: 16px;
  --th-r-card: 18px;

  /* easing */
  --th-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --th-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Backdrop ─────────────────────────────────────────────────── */
.threshold-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(8, 9, 12, 0.32);
  opacity: 0;
  transition: opacity 0.28s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.threshold-backdrop.shown { opacity: 1; }
.threshold-backdrop.closing { opacity: 0; transition-duration: 0.24s; }

/* ── Modal panel ──────────────────────────────────────────────── */
.threshold-backdrop .threshold-modal {
  position: relative !important;
  width: clamp(320px, 60vw, 480px) !important;
  max-width: 60vw !important;
  margin: 0 !important;
  border-radius: var(--th-r-modal) !important;
  background:
    linear-gradient(135deg,
      rgba(28, 60, 67, 0.30) 0%,
      rgba(12, 26, 29, 0.45) 100%);
  backdrop-filter: blur(36px) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(36px) saturate(180%) brightness(1.08);
  border: 1px solid var(--th-glass-border);
  /* Liquid Glass body: outer halo, top inner highlight, bottom inner shadow,
     subtle gold ambient glow */
  box-shadow:
    inset 0 1px 0 var(--th-glass-highlight-top),
    inset 0 -1px 0 var(--th-glass-highlight-bot),
    0 30px 80px -10px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(255, 216, 102, 0.05),
    0 0 0 1px rgba(34, 211, 238, 0.03);
  overflow: hidden;
  transform: translateY(40px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.48s var(--th-spring),
    opacity 0.36s var(--th-ease);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  isolation: isolate;
}

.threshold-backdrop.shown .threshold-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.threshold-backdrop.closing .threshold-modal {
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition-duration: 0.32s;
  transition-timing-function: ease-in;
}

/* Mouse-tracked specular highlight (stronger so it actually reads) */
.threshold-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    480px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.04) 28%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: plus-lighter;
  transition: background 0.12s linear;
}

/* Static top-edge specular */
.threshold-modal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.32) 50%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
}

.threshold-modal-inner {
  position: relative;
  z-index: 3;
  padding: 32px 32px 28px;
}

/* ── Close button ─────────────────────────────────────────────── */
.threshold-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--th-ink-faint);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: -apple-system, sans-serif;
}

.threshold-close:hover {
  color: var(--th-ink);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Brand mark (gold bolt) ───────────────────────────────────── */
.threshold-bolt-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  height: 36px;
  overflow: visible;
}

/* Sonar ping — expanding horizontal beams from bolt center.
   Uses two pseudo-elements as left/right beams that travel outward
   while fading. Each ::before / ::after is a single beam frame; the
   .ping1/.ping2 layered elements give a second concurrent ping
   offset 50% through the cycle for a continuous transmission. */

.threshold-bolt-wrap .ping {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 1px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

.threshold-bolt-wrap .ping::before,
.threshold-bolt-wrap .ping::after {
  content: '';
  position: absolute;
  top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 216, 102, 0.85) 50%,
    transparent 100%);
  filter: blur(0.4px);
}

.threshold-bolt-wrap .ping::before {
  right: 50%;
  transform-origin: right center;
}

.threshold-bolt-wrap .ping::after {
  left: 50%;
  transform-origin: left center;
}

.threshold-backdrop.shown .threshold-bolt-wrap .ping {
  animation: th-sonar 4.5s ease-out 1.2s infinite;
}

.threshold-backdrop.shown .threshold-bolt-wrap .ping.ping2 {
  animation-delay: 3.45s; /* offset half a cycle for continuous ping */
}

@keyframes th-sonar {
  0% {
    opacity: 0;
    width: 36px;
  }
  10% {
    opacity: 0.95;
    width: 60px;
  }
  60% {
    opacity: 0.55;
    width: 280px;
  }
  100% {
    opacity: 0;
    width: 480px;
  }
}

/* Standing inner-line that keeps the bolt visually anchored even
   between pings — like the resting state of the wire. */
.threshold-bolt-wrap::before,
.threshold-bolt-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 216, 102, 0.22) 60%,
    transparent 100%);
  opacity: 0.5;
}

.threshold-bolt-wrap::before {
  right: calc(50% + 22px);
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 216, 102, 0.22) 100%);
}

.threshold-bolt-wrap::after {
  left: calc(50% + 22px);
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    rgba(255, 216, 102, 0.22) 0%,
    transparent 100%);
}

.threshold-bolt {
  display: block;
  width: 36px;
  height: 36px;
  color: var(--th-gold);
  filter: drop-shadow(0 0 12px rgba(255, 216, 102, 0.45));
  opacity: 0;
  transition: opacity 0.4s var(--th-ease) 0.15s;
  position: relative;
  z-index: 2;
}

.threshold-backdrop.shown .threshold-bolt {
  animation: th-bolt-breathe 4.5s ease-in-out 1.2s infinite;
}

@keyframes th-bolt-breathe {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(255, 216, 102, 0.45));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(255, 216, 102, 0.75)) drop-shadow(0 0 4px rgba(255, 216, 102, 0.5));
    transform: scale(1.04);
  }
}

.threshold-backdrop.shown .threshold-bolt { opacity: 1; }

/* ── Wordmark ─────────────────────────────────────────────────── */
.threshold-wordmark {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.42em;
  color: var(--th-ink);
  text-transform: uppercase;
  margin: 0 0 4px;
  text-indent: 0.42em; /* offset the trailing letterspacing */
  opacity: 0;
  transition: opacity 0.4s var(--th-ease) 0.2s;
}

.threshold-backdrop.shown .threshold-wordmark { opacity: 1; }

/* ── Heading + sub (sign-out + upgrade variants) ──────────────── */
.threshold-heading {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--th-ink);
  margin: 24px 0 6px;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity 0.4s var(--th-ease) 0.25s;
}

.threshold-sub {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  color: var(--th-ink-faint);
  line-height: 1.45;
  margin: 0 12px 24px;
  opacity: 0;
  transition: opacity 0.4s var(--th-ease) 0.3s;
}

.threshold-backdrop.shown .threshold-heading,
.threshold-backdrop.shown .threshold-sub { opacity: 1; }

/* ── Body region ──────────────────────────────────────────────── */
.threshold-body {
  margin-top: 22px;
  opacity: 0;
  transition: opacity 0.4s var(--th-ease) 0.3s;
}

.threshold-backdrop.shown .threshold-body { opacity: 1; }

/* ── Email input (Liquid Glass pill) ──────────────────────────── */
.threshold-input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--th-ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--th-glass-border);
  border-radius: var(--th-r-pill);
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  letter-spacing: 0.01em;
}

.threshold-input::placeholder { color: var(--th-ink-faint); }

.threshold-input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--th-gold-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(255, 216, 102, 0.10),
    0 0 16px rgba(255, 216, 102, 0.10);
}

.threshold-input.pulse {
  animation: th-input-pulse 0.4s ease-out;
}

@keyframes th-input-pulse {
  0% {
    border-color: var(--th-gold-border);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 0 3px rgba(255, 216, 102, 0.10),
      0 0 16px rgba(255, 216, 102, 0.10);
  }
  35% {
    border-color: rgba(255, 216, 102, 0.85);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 0 0 4px rgba(255, 216, 102, 0.22),
      0 0 28px rgba(255, 216, 102, 0.40);
  }
  100% {
    border-color: var(--th-gold-border);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 0 3px rgba(255, 216, 102, 0.10),
      0 0 16px rgba(255, 216, 102, 0.10);
  }
}

/* Wordmark letter stagger on open */
.threshold-wordmark span {
  display: inline-block;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.4s ease, transform 0.4s var(--th-ease);
}

.threshold-backdrop.shown .threshold-wordmark span {
  opacity: 1;
  transform: translateY(0);
}

/* ── Primary button (gold glass) ─────────────────────────────── */
.threshold-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 12px;
  padding: 0 24px;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--th-gold);
  background: linear-gradient(180deg,
    var(--th-gold-bg) 0%,
    rgba(255, 216, 102, 0.05) 100%);
  border: 1px solid var(--th-gold-border);
  border-radius: var(--th-r-pill);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease, transform 0.1s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 24px rgba(255, 216, 102, 0.10);
  overflow: hidden;
  text-indent: 0.32em;
}

.threshold-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255, 255, 255, 0.10) 50%,
    transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s var(--th-ease);
  pointer-events: none;
}

.threshold-btn:hover {
  background: linear-gradient(180deg,
    var(--th-gold-bg-hover) 0%,
    rgba(255, 216, 102, 0.08) 100%);
  border-color: rgba(255, 216, 102, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 0 32px rgba(255, 216, 102, 0.18);
  color: var(--th-gold-soft);
}

.threshold-btn:hover::before { transform: translateX(100%); }
.threshold-btn:active { transform: scale(0.99); }

.threshold-btn .arrow { font-size: 1rem; transition: transform 0.2s ease; }
.threshold-btn:hover .arrow { transform: translateX(3px); }

.threshold-btn.loading .label,
.threshold-btn.loading .arrow { visibility: hidden; }

.threshold-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 216, 102, 0.2);
  border-top-color: var(--th-gold);
  border-radius: 50%;
  animation: th-spin 0.7s linear infinite;
  position: absolute;
}

.threshold-btn.loading .spinner { display: block; }

@keyframes th-spin { to { transform: rotate(360deg); } }

.threshold-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ── Destructive button (coral, sign-out primary) ────────────── */
.threshold-btn.danger {
  color: var(--th-coral);
  background: linear-gradient(180deg, var(--th-coral-bg) 0%, rgba(244, 63, 94, 0.05) 100%);
  border-color: var(--th-coral-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 24px rgba(244, 63, 94, 0.10);
}

.threshold-btn.danger:hover {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.16) 0%, rgba(244, 63, 94, 0.08) 100%);
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 32px rgba(244, 63, 94, 0.18);
}

/* ── Ghost button (Cancel etc.) ───────────────────────────────── */
.threshold-btn.ghost {
  color: var(--th-ink-muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--th-glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.threshold-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--th-ink);
  border-color: rgba(155, 179, 190, 0.34);
}

/* ── Divider ──────────────────────────────────────────────────── */
.threshold-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 14px;
  color: var(--th-ink-faint);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.threshold-divider::before,
.threshold-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(155, 179, 190, 0.22),
    transparent);
}

/* ── Social row (2-up grid) ───────────────────────────────────── */
.threshold-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.threshold-social-btn {
  height: 46px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--th-glass-border);
  border-radius: var(--th-r-pill);
  color: var(--th-ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.threshold-social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(155, 179, 190, 0.35);
  color: var(--th-ink);
}

.threshold-social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Message slot ─────────────────────────────────────────────── */
.threshold-message {
  margin-top: 14px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  min-height: 22px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.threshold-message.error { color: var(--th-coral); }
.threshold-message.success { color: var(--th-gold); }
.threshold-message-detail {
  display: block;
  font-size: 0.75rem;
  color: var(--th-ink-faint);
  margin-top: 4px;
  letter-spacing: 0;
}

/* ── Stacked button row (sign-out) ────────────────────────────── */
.threshold-stack { display: flex; flex-direction: column; gap: 8px; }
.threshold-stack .threshold-btn { margin-top: 0; }

/* ── Tier cards (upgrade) ─────────────────────────────────────── */
.threshold-tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.threshold-tier {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--th-glass-border);
  border-radius: var(--th-r-card);
  cursor: pointer;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  transition: all 0.25s ease, transform 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.threshold-tier:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 216, 102, 0.45);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 8px 24px -8px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(255, 216, 102, 0.10);
}

.threshold-tier.featured {
  border-color: rgba(255, 216, 102, 0.40);
  background: linear-gradient(135deg,
    rgba(255, 216, 102, 0.07),
    rgba(255, 216, 102, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 0 32px rgba(255, 216, 102, 0.12);
}

.threshold-tier-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.threshold-tier-row { display: flex; align-items: baseline; gap: 10px; }

.threshold-tier-name {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.26em;
  color: var(--th-ink);
  text-transform: uppercase;
}

.threshold-tier-price {
  font-size: 0.78rem;
  color: var(--th-ink-muted);
  font-weight: 500;
}

.threshold-tier-feat {
  font-size: 0.78rem;
  color: var(--th-ink-faint);
  line-height: 1.4;
}

.threshold-tier-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 216, 102, 0.08);
  border: 1px solid rgba(255, 216, 102, 0.25);
  color: var(--th-gold);
  font-family: -apple-system, sans-serif;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.threshold-tier:hover .threshold-tier-cta {
  background: rgba(255, 216, 102, 0.18);
  border-color: rgba(255, 216, 102, 0.55);
  transform: translateX(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 16px rgba(255, 216, 102, 0.25);
}

.threshold-tier-badge {
  position: absolute;
  top: -8px;
  left: 16px;
  padding: 3px 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
  color: #1C3C43;
  background: linear-gradient(180deg, var(--th-gold) 0%, #f0a030 100%);
  border-radius: 999px;
  box-shadow:
    0 4px 12px rgba(255, 216, 102, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 2;
}

.threshold-allplans {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  color: var(--th-ink-faint);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.threshold-allplans:hover { color: var(--th-ink-muted); }

/* ── Toast ────────────────────────────────────────────────────── */
.threshold-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--th-glass-bg-1), var(--th-glass-bg-2));
  border: 1px solid var(--th-glass-border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 36px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(255, 216, 102, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  color: var(--th-ink);
  z-index: 9100;
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.4s var(--th-spring);
  cursor: pointer;
  letter-spacing: 0.01em;
}

.threshold-toast.shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.threshold-toast.warn { border-color: rgba(244, 63, 94, 0.30); }
.threshold-toast.success { border-color: rgba(255, 216, 102, 0.30); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .threshold-backdrop .threshold-modal {
    width: clamp(280px, 92vw, 480px) !important;
    max-width: 92vw !important;
  }
  .threshold-modal-inner { padding: 26px 22px 22px; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .threshold-backdrop,
  .threshold-modal,
  .threshold-bolt,
  .threshold-wordmark,
  .threshold-heading,
  .threshold-sub,
  .threshold-body {
    transition: opacity 0.15s linear !important;
    transform: none !important;
  }
  .threshold-modal::before { display: none; }
  .threshold-btn::before { display: none; }
}
