/* =====================================================
   THE SHADED TREE — Global Stylesheet  v3
   ===================================================== */

/* ── Resets & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
}

/* ── Video Stage ────────────────────────────────────── */
#video-stage {
  position: fixed; inset: 0; z-index: 0;
  /* dvh = dynamic viewport height — fills usable area accounting for browser chrome */
  height: 100dvh;
}

#bg-video {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  object-position: 50% 50%;
}
/* Mobile portrait: enforce full 16:9 letterbox (black bars above & below)
   so the entire tree exhibit scene is always visible without any cropping.
   Desktop keeps its full-cover/crop behaviour unchanged. */
@media (max-width: 767px) and (orientation: portrait) {
  #video-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
  }
  #bg-video {
    width: 100%;
    height: auto;          /* natural 16:9 height — bars fill the rest */
    max-height: 100dvh;    /* never taller than the viewport */
    object-fit: contain;
    object-position: 50% 50%;
  }
}

/* ── Click Zones ────────────────────────────────────── */
#click-layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

.click-zone {
  position: absolute;
  pointer-events: all;
  cursor: pointer;
  background: transparent;
  border: none; outline: none;
}
.click-zone:hover, .click-zone:active { background: transparent; }
/* No clip-path — full div area is clickable so the entire LCD screen registers taps */

/* ── Debug Overlay ──────────────────────────────────── */
#debug-overlay {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  background: rgba(0,0,0,0.7); color: #0f0;
  font-family: monospace; font-size: 13px;
  padding: 8px 14px; border-radius: 6px;
  border: 1px solid rgba(0,255,0,0.3);
  pointer-events: none; display: none; line-height: 1.6;
}
#debug-overlay.visible { display: block; }

/* ═══════════════════════════════════════════════════════
   FLOATING AUTH BUTTON (top-left)
═══════════════════════════════════════════════════════ */
#auth-float {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 15;
}

/* Sign Up text button — base (desktop) */
.btn-signup-float {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 24px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-signup-float:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.45);
  transform: translateY(-1px);
}

.btn-login-float {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  color: rgba(255,255,255,0.85);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
}
.btn-login-float:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.55);
  color: #fff;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  #auth-float .btn-login-float {
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 40px;
    border-color: rgba(255,255,255,0.4);
  }
  #auth-float .btn-login-float:hover {
    transform: translateY(-2px);
  }
}

/* Desktop-only: Sign Up gets the same animated gradient as mobile — gradient text
   flowing through the letters, gradient border ring via mask-composite.
   Scoped to #auth-float so the mobile #mob-auth-slot is completely untouched. */
@media (min-width: 768px) {
  #auth-float .btn-signup-float {
    /* Black interior, no glass */
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none !important;
    position: relative;
    /* Gradient flows through the "Sign Up" letter shapes */
    background: linear-gradient(
      90deg,
      #8a4820 0%, #c8782a 15%, #ffd700 32%, #ffaa00 48%,
      #d4a843 64%, #e8c86a 80%, #8a4820 100%
    ) !important;
    background-size: 250% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: text-gradient-flow 20s linear infinite !important;
    /* Match Log In button sizing */
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 12px 28px;
    border-radius: 40px;
  }
  /* Gradient border ring — identical mask-composite trick as mobile */
  #auth-float .btn-signup-float::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 40px;
    padding: 1.5px;
    background: linear-gradient(
      90deg,
      #8a4820 0%, #c8782a 15%, #ffd700 32%, #ffaa00 48%,
      #d4a843 64%, #e8c86a 80%, #8a4820 100%
    );
    background-size: 250% 100%;
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: text-gradient-flow 20s linear infinite;
    pointer-events: none;
  }
  #auth-float .btn-signup-float:hover {
    transform: translateY(-2px);
  }
}

/* Logged-in avatar circle */
.btn-user-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
  background: linear-gradient(135deg, #c8782a, #8a4820);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-user-avatar:hover {
  border-color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.btn-user-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
#user-avatar-initials {
  font-size: 1.3rem; font-weight: 700; color: #fff;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   DRAWER BACKDROP
═══════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-backdrop.active { opacity: 1; pointer-events: all; }

/* ═══════════════════════════════════════════════════════
   DRAWER PANEL
═══════════════════════════════════════════════════════ */
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; z-index: 40;
  background: linear-gradient(160deg, rgba(8,18,28,0.72) 0%, rgba(4,12,22,0.82) 100%);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: -16px 0 70px rgba(0,0,0,0.45);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.32, 0, 0.15, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
}
@media (max-width: 767px) { .drawer { width: 100%; } }
@media (min-width: 768px) { .drawer { width: 50%; min-width: 380px; max-width: 680px; } }
.drawer.open { transform: translateX(0); visibility: visible; }

/* ── Drawer Inner ───────────────────────────────────── */
.drawer-inner {
  padding: 36px 32px 60px;
  min-height: 100%;
  display: flex; flex-direction: column; gap: 0;
}
@media (max-width: 767px) { .drawer-inner { padding: 28px 20px 48px; } }

.drawer-close {
  align-self: flex-end; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 50%;
  color: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 18px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s; flex-shrink: 0;
  margin-bottom: 4px;
}
.drawer-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

.drawer-title {
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1.2;
  margin-bottom: 6px;
}
.drawer-title::after {
  content: ''; display: block; width: 52px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #c8782a, #8a4820);
  margin-top: 10px; margin-bottom: 24px;
}

/* Sign-up drawer intro block — autumn warm treatment */
.signup-intro {
  margin: -12px 0 22px;
  padding: 16px 18px 18px;
  background: linear-gradient(135deg,
    rgba(184,80,66,0.45) 0%,
    rgba(200,120,42,0.40) 45%,
    rgba(232,156,40,0.32) 100%);
  border: 1px solid rgba(232,136,58,0.5);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.signup-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(255,200,80,0.18) 0%, transparent 65%);
  pointer-events: none;
}
.signup-intro-free {
  font-size: 1rem;
  font-weight: 700;
  color: #ffd166;
  margin: 0 0 5px;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  position: relative;
}
.signup-intro-access {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  margin: 0 0 10px;
  letter-spacing: 0.3px;
  position: relative;
}
.signup-perks {
  margin: 0;
  padding-left: 1.1rem;
  list-style: none;
  position: relative;
}
.signup-perks li {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.75;
  padding-left: 0.2rem;
}
.signup-perks li::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd166;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.drawer-placeholder {
  font-size: 1rem; color: rgba(255,255,255,0.4); font-style: italic;
}

/* ── Red-line (Safe Cosmetics) section ─────────────────── */
.red-line-section { margin-top: 28px; }
.red-line-divider {
  border: none; border-top: 2px solid #c0392b;
  margin: 0 0 18px;
}
.red-line-copy {
  font-size: 0.93rem; line-height: 1.75;
  color: rgba(255,255,255,0.82);
  margin: 0 0 20px;
}
.btn-red-list {
  display: block; width: 100%;
  background: #c0392b;
  color: #fff; text-decoration: none; text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 16px 24px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(192,57,43,0.45);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn-red-list:hover {
  background: #a93226;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(192,57,43,0.6);
}

/* ═══════════════════════════════════════════════════════
   SHOP DRAWER
═══════════════════════════════════════════════════════ */
.shop-drawer-inner { padding: 28px 20px 60px; }
.shop-main-title   { margin-bottom: 14px; }

/* ── Category chip bar ── */
.shop-cats {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.shop-cat {
  border: none; cursor: pointer;
  font-family: 'Raleway', system-ui, sans-serif;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.shop-cat:hover { background: rgba(255,255,255,0.15); color: #fff; transform: translateY(-1px); }
.shop-cat.active {
  background: linear-gradient(90deg,#8a4820,#ffd700,#d4a843);
  color: #000; font-weight: 700;
}

/* ── Panel show/hide ── */
.shop-panel { display: none; }
.shop-panel.active { display: block; }
.shop-panel-intro {
  font-size: 0.9rem; color: rgba(255,255,255,0.65);
  margin-bottom: 18px; line-height: 1.6;
}
.shop-loading {
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
  text-align: center;
  padding: 32px 0;
  grid-column: 1 / -1;
}

/* ── Category hero banner ── */
.shop-hero {
  position: relative; border-radius: 14px; overflow: hidden;
  margin-bottom: 22px; height: 160px;
}
.shop-hero-img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; opacity: 0.55;
}
.shop-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--hero-from,#222) 0%, var(--hero-to,#555) 100%);
  opacity: 0.65; z-index: 1;
}
.shop-hero-text {
  position: absolute; bottom: 16px; left: 18px; z-index: 2;
}
.shop-hero-label {
  display: block;
  font-family: 'Raleway', sans-serif; font-size: 0.7rem;
  font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.75); margin-bottom: 4px;
}
.shop-hero-text h3 {
  margin: 0; font-size: 1.5rem; font-weight: 700;
  color: #fff; line-height: 1.1; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Product grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.product-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); }
.product-img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
}
.product-info { padding: 10px 12px 12px; }
.product-name  { font-size: 0.78rem; font-weight: 600; color: #fff; margin: 0 0 3px; line-height: 1.3; }
.product-brand { font-size: 0.68rem; color: rgba(255,255,255,0.45); margin: 0 0 8px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price  { font-size: 0.9rem; font-weight: 700; color: #ffd700; }
.btn-buy {
  border: none; cursor: pointer; border-radius: 999px;
  padding: 5px 14px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg,#8a4820,#ffd700,#d4a843);
  color: #000;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-buy:hover { opacity: 0.85; transform: scale(1.04); }

/* ── Brand grid ── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.brand-card {
  border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.brand-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.brand-swatch {
  width: 100%; aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: rgba(255,255,255,0.9);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.brand-body { padding: 8px 8px 10px; }
.brand-name {
  font-size: 0.68rem; font-weight: 700; color: #fff;
  margin: 0 0 3px; line-height: 1.2; text-align: center;
}
.brand-desc {
  font-size: 0.6rem; color: rgba(255,255,255,0.45);
  margin: 0; line-height: 1.4; text-align: center;
}

/* ═══════════════════════════════════════════════════════
   SIGN-UP FORM
═══════════════════════════════════════════════════════ */

/* Avatar upload */
.avatar-upload-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 28px;
}
.avatar-upload-circle {
  width: 100px; height: 100px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  background: rgba(255,255,255,0.06);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.avatar-upload-circle:hover {
  border-color: #c8782a; background: rgba(200,120,42,0.1);
}
.avatar-upload-circle img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; display: none;
}
#avatar-preview-icon {
  font-size: 1.8rem; color: rgba(255,255,255,0.4);
  font-weight: 300; line-height: 1;
}
.avatar-hint { font-size: 0.78rem; color: rgba(255,255,255,0.4); }

/* Form fields */
.form-fields { display: flex; flex-direction: column; gap: 16px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-group label, .label-block {
  font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.55); letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field-note { font-size: 0.75rem; color: rgba(255,255,255,0.35); font-weight: 400; text-transform: none; }

.field-group input[type="text"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="tel"] {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
.field-group input:focus {
  border-color: #c8782a;
  background: rgba(200,120,42,0.08);
}
.field-group input::placeholder { color: rgba(255,255,255,0.25); }

/* Objectives checkboxes */
.objectives-list { display: flex; flex-direction: column; gap: 12px; }

.objective-option {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
}
.objective-option input[type="checkbox"] { display: none; }

.objective-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.objective-option input:checked ~ .objective-check {
  border-color: #c8782a;
  background: rgba(200,120,42,0.2);
}
.objective-option input:checked ~ .objective-check::after {
  content: '✓'; font-size: 13px; color: #c8782a; font-weight: 700;
}
.objective-label { font-size: 0.95rem; color: rgba(255,255,255,0.85); }
.objective-option:hover .objective-check { border-color: rgba(200,120,42,0.6); }

/* Error message */
.form-error {
  font-size: 0.85rem; color: #ff6b6b; min-height: 1.2em;
  margin: 12px 0 4px;
}

/* ═══════════════════════════════════════════════════════
   GOLDEN GLOW REGISTER BUTTON
   — rotating conic border trace + pulsing glow + shimmer
═══════════════════════════════════════════════════════ */
.register-btn-wrap {
  position: relative;
  border-radius: 14px;
  padding: 2px;
  overflow: hidden;
  margin-top: 24px;
}
/* Rotating border light trace */
.register-btn-wrap::before {
  content: '';
  position: absolute;
  width: 200%; height: 400%;
  top: -150%; left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    #ffd700 50deg,
    #ffb300 80deg,
    #ff8c00 110deg,
    transparent 160deg
  );
  animation: border-spin 2.2s linear infinite;
}
@keyframes border-spin { to { transform: rotate(360deg); } }

.btn-register {
  position: relative; z-index: 1;
  width: 100%;
  background: linear-gradient(90deg, #8b6008, #c8900a, #ffd700, #e8a820, #c8900a, #8b6008);
  background-size: 300% 100%;
  border: none; border-radius: 12px;
  color: #1a0e00;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem; font-weight: 800;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 16px 24px;
  cursor: pointer;
  animation: shimmer-gold 3s linear infinite, glow-pulse 2s ease-in-out infinite;
  transition: opacity 0.2s;
}
.btn-register:disabled { opacity: 0.6; cursor: not-allowed; }

@keyframes shimmer-gold {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(255,215,0,0.7),
      0 0 20px rgba(255,165,0,0.45),
      0 0 40px rgba(255,140,0,0.2);
  }
  50% {
    box-shadow:
      0 0 18px rgba(255,215,0,1),
      0 0 40px rgba(255,165,0,0.7),
      0 0 80px rgba(255,140,0,0.4);
  }
}

/* ═══════════════════════════════════════════════════════
   MEMBERSHIP DRAWER — LOGIN VIEW
═══════════════════════════════════════════════════════ */
.mem-login-header { text-align: center; margin-bottom: 28px; }
.mem-login-tree   { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.mem-login-sub    { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 6px; }
#mem-login-view .drawer-title::after { margin-left: auto; margin-right: auto; }

.btn-primary {
  width: 100%; margin-top: 8px;
  background: linear-gradient(135deg, #c8782a, #8a4820);
  border: none; border-radius: 10px;
  color: #fff; font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 14px 24px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(200,120,42,0.35);
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  opacity: 0.92; transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(200,120,42,0.5);
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.login-signup-link {
  text-align: center; margin-top: 20px;
  font-size: 0.88rem; color: rgba(255,255,255,0.45);
}
.link-btn {
  background: none; border: none;
  color: #c8782a; cursor: pointer; font-weight: 600;
  font-size: inherit; padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
}
.link-btn:hover { color: #d4954a; }

/* ═══════════════════════════════════════════════════════
   MEMBERSHIP DRAWER — PROFILE VIEW
═══════════════════════════════════════════════════════ */
/* Membership welcome panel */
.mem-welcome-panel {
  margin-bottom: 28px;
  text-align: center;
}
.mem-welcome-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.3;
}
.mem-welcome-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.55;
  margin: 0 0 14px;
}
.mem-welcome-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 16px;
  display: block;
  flex-shrink: 0;
}
.mem-upgrade-cta {
  display: inline-block;
  font-size: 0.95rem;
  padding: 0.75rem 1.8rem;
}

.profile-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center; margin-bottom: 28px;
}
.profile-avatar-circle {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid rgba(200,120,42,0.7);
  overflow: hidden;
  background: linear-gradient(135deg, #c8782a, #8a4820);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(200,120,42,0.25);
  flex-shrink: 0;
}
.profile-avatar-circle img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
#profile-avatar-initials {
  font-size: 2.2rem; font-weight: 700; color: #fff;
}
.profile-name  { font-size: 1.35rem; font-weight: 700; color: #fff; }
.profile-since { font-size: 0.78rem; color: rgba(255,255,255,0.4); letter-spacing: 0.04em; }

.btn-logout {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 8px 18px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  margin-top: 2px;
}
.btn-logout:hover {
  background: rgba(255,80,80,0.15);
  border-color: rgba(255,80,80,0.4);
  color: #ff8080;
}

/* Stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.profile-stat-card {
  border-radius: 14px;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.profile-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0.08;
}
.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  line-height: 1.3;
}

/* Loyalty — gold */
.stat-loyalty {
  background: rgba(255, 200, 0, 0.1);
  border: 1px solid rgba(255, 200, 0, 0.25);
}
.stat-loyalty .stat-value { color: #ffd700; }
.stat-loyalty .stat-label { color: rgba(255, 215, 0, 0.8); }

/* Books — purple */
.stat-books {
  background: rgba(180, 40, 255, 0.1);
  border: 1px solid rgba(180, 40, 255, 0.25);
}
.stat-books .stat-value { color: #d966ff; }
.stat-books .stat-label { color: rgba(217, 102, 255, 0.8); }

/* Products — teal */
.stat-products {
  background: rgba(200,120,42,0.1);
  border: 1px solid rgba(200,120,42,0.25);
}
.stat-products .stat-value { color: #c8782a; }
.stat-products .stat-label { color: rgba(200,120,42,0.8); }

/* Community — coral */
.stat-community {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
}
.stat-community .stat-value { color: #ff8c8c; }
.stat-community .stat-label { color: rgba(255, 140, 140, 0.8); }

/* Profile sections */
.profile-section { margin-bottom: 24px; }
.profile-section-title {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.profile-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9rem; color: rgba(255,255,255,0.8);
  padding: 6px 0;
}
.profile-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.profile-optional:empty::before { content: '—'; color: rgba(255,255,255,0.25); }

.profile-objectives { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-objective-tag {
  background: rgba(200,120,42,0.15);
  border: 1px solid rgba(200,120,42,0.3);
  border-radius: 20px;
  color: #c8782a; font-size: 0.82rem; font-weight: 600;
  padding: 5px 14px;
}
/* ═══════════════════════════════════════════════════════
   MEMBERSHIP LEVEL — profile drawer section
═══════════════════════════════════════════════════════ */
.membership-level-section {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 24px;
}
.membership-level-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; color: rgba(255,255,255,0.4); margin: 0;
}
.membership-tier-row {
  display: flex; gap: 6px; width: 100%;
}
.membership-tier-pill {
  flex: 1; position: relative; z-index: 0; overflow: hidden;
  border-radius: 8px; padding: 8px 4px;
  font-family: 'Outfit', sans-serif; font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  cursor: default; text-align: center;
  transition: color 0.2s;
}
.membership-tier-pill.active {
  color: #fff; border-color: transparent;
  background: rgba(10,14,8,0.92);
  isolation: isolate;
}
.membership-tier-pill.active::before {
  content: ''; position: absolute;
  width: 200%; height: 200%; top: -50%; left: -50%;
  background: conic-gradient(
    #C4552A 0%, #D4974A 14%, #C99A2E 28%, #C8B06A 42%,
    #7A8C5A 56%, #B07070 70%, #8B4444 84%, #C4552A 100%
  );
  animation: rotate-membership-tracer 3s linear infinite;
  z-index: -2;
}
.membership-tier-pill.active::after {
  content: ''; position: absolute;
  inset: 2px; border-radius: 6px;
  background: rgba(10,14,8,0.92);
  z-index: -1;
}
@keyframes rotate-membership-tracer {
  to { transform: rotate(360deg); }
}
.btn-upgrade {
  background: linear-gradient(135deg, #C4552A 0%, #D4974A 100%);
  border: none; border-radius: 20px;
  color: #fff; font-family: 'Outfit', sans-serif;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 26px; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(196,85,42,0.35);
}
.btn-upgrade:hover { opacity: 0.85; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   UPGRADE MEMBERSHIP DRAWER
═══════════════════════════════════════════════════════ */
.upgrade-drawer-inner { padding-bottom: 60px; }
.upgrade-drawer-sub {
  font-size: 0.9rem; color: rgba(255,255,255,0.45); margin: -8px 0 20px; line-height: 1.5;
}
.upgrade-tier-card {
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  padding: 20px 20px 16px; margin-bottom: 14px;
  transition: border-color 0.2s;
}
.upgrade-tier-card.utc-current {
  border-width: 2px;
}
/* Tier accent colours */
.tier-rooted   { border-color: rgba(200,180,130,0.25); }
.tier-sprouted { border-color: rgba(122,140,90,0.3); }
.tier-blossoming { border-color: rgba(196,85,42,0.35); }
.tier-canopy   { border-color: rgba(107,117,69,0.35); }
.tier-rooted.utc-current   { border-color: rgba(200,180,130,0.7); }
.tier-sprouted.utc-current { border-color: rgba(160,192,100,0.7); }
.tier-blossoming.utc-current { border-color: rgba(232,120,80,0.7); }
.tier-canopy.utc-current   { border-color: rgba(154,173,96,0.7); }

.utc-header {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px;
}
.utc-icon { font-size: 1.8rem; flex-shrink: 0; margin-top: 2px; }
.utc-title-block { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.utc-name {
  font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: #fff; margin: 0;
}
.tier-rooted   .utc-name { color: #e0cfa0; }
.tier-sprouted .utc-name { color: #b0d478; }
.tier-blossoming .utc-name { color: #e8886a; }
.tier-canopy   .utc-name { color: #a8c462; }
.utc-price {
  font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 800; color: #fff;
}
.utc-period { font-size: 0.72rem; font-weight: 400; color: rgba(255,255,255,0.45); }
.utc-audience {
  font-size: 0.8rem; color: rgba(255,255,255,0.5); font-style: italic;
  line-height: 1.4; max-width: 140px; text-align: right; flex-shrink: 0;
}
.utc-bullets {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 14px;
}
.utc-bullets li {
  font-size: 0.85rem; color: rgba(255,255,255,0.75); line-height: 1.45;
  padding-left: 18px; position: relative;
}
.utc-bullets li::before {
  content: '•'; position: absolute; left: 0;
  color: rgba(255,255,255,0.3); font-size: 0.9rem;
}
.tier-sprouted   .utc-bullets li::before { color: #8ab050; }
.tier-blossoming .utc-bullets li::before { color: #c46040; }
.tier-canopy     .utc-bullets li::before { color: #7a9840; }

.utc-action { display: flex; align-items: center; }
.btn-select-plan {
  border: none; border-radius: 10px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 22px; color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-select-plan:hover { opacity: 0.82; transform: translateY(-1px); }
.btn-select-plan.plan-sprouted   { background: linear-gradient(135deg,#5a7830,#8ab050); }
.btn-select-plan.plan-blossoming { background: linear-gradient(135deg,#C4552A,#D4974A); }
.btn-select-plan.plan-canopy     { background: linear-gradient(135deg,#4a5c20,#7a9840); }
.utc-current-badge {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5); padding: 8px 0;
}

/* ═══════════════════════════════════════════════════════
   ABOUT THE SHADED TREE DRAWER — full-height portrait layout
═══════════════════════════════════════════════════════ */

/* Override drawer-inner for this specific drawer:
   remove padding so the image can bleed to the edges */
.about-drawer-inner {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Close button sits at top-right */
.about-close {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 5;
}
.about-drawer { position: fixed; } /* ensure absolute close button works */

/* Two-column layout: text left, portrait right */
.about-layout {
  display: flex;
  flex: 1;
  height: 100%;
  min-height: 0;
}

/* Left text column */
.about-text {
  flex: 1;
  min-width: 0;
  padding: 56px 28px 48px 32px; /* top pad gives breathing room under close btn */
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.about-text .drawer-title { margin-bottom: 20px; }

.about-text p {
  font-size: 0.95rem;
  line-height: 1.78;
  color: rgba(255,255,255,0.82);
  margin-bottom: 16px;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong { color: #fff; font-weight: 700; }

.about-mission-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold, #d19a3c);
  margin: 28px 0 8px;
}

/* Right: founder portrait — fills full drawer height */
.founder-photo {
  width: 44%;
  flex-shrink: 0;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* keep face visible */
  display: block;
}

/* Mobile: stack portrait above text */
@media (max-width: 520px) {
  .about-layout { flex-direction: column; }
  .founder-photo {
    width: 100%;
    height: 52vw;
    max-height: 280px;
    object-position: top center;
  }
  .about-text { padding: 24px 20px 40px; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE LETTERBOX BARS
   Visible only in portrait on screens ≤ 767px.
   Hidden on desktop — zero layout impact there.
═══════════════════════════════════════════════════════ */

/* ── Leaf-particle flutter — 8 evenly-distributed glowing orbs ────────
   Mirror the video palette: deep violet, gold, teal, magenta, indigo,
   amber, cyan, purple. All 8 move independently every step, so the
   whole surface stays active — like light through falling leaves.      */
@keyframes tst-particles {
  0%   { background-position: 10% 15%, 90%  8%, 48%  5%, 22% 52%, 78% 42%, 38% 88%, 62% 92%, 55% 48%; }
  12%  { background-position: 22% 38%, 72% 28%, 18% 32%, 58% 18%, 42% 68%, 82% 12%, 10% 62%, 70% 72%; }
  25%  { background-position: 48% 65%, 18% 55%, 80% 18%, 10% 82%, 65% 22%, 55% 45%, 32% 28%, 88% 38%; }
  37%  { background-position: 68% 85%, 42% 78%, 28% 48%, 82% 35%, 12% 58%, 25% 68%, 78% 18%, 38% 22%; }
  50%  { background-position: 85% 42%, 12% 88%, 92% 62%, 35% 12%, 55% 88%, 72% 30%, 48% 78%, 18% 62%; }
  62%  { background-position: 72% 12%, 62% 18%, 55% 82%, 65% 68%, 28% 35%, 48% 88%, 88% 52%, 42% 85%; }
  75%  { background-position: 38% 55%, 85% 42%, 12% 72%, 48% 88%, 88% 12%, 18% 52%, 62% 38%, 72% 28%; }
  87%  { background-position: 18% 82%, 30% 62%, 72% 28%, 15% 38%, 62% 75%, 88% 68%, 25% 92%, 58% 15%; }
  100% { background-position: 10% 15%, 90%  8%, 48%  5%, 22% 52%, 78% 42%, 38% 88%, 62% 92%, 55% 48%; }
}

/* 8 small leaf-sized radial blobs — evenly spread palette */
.mob-aura {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at center, rgba(123,  0,200,0.90) 0%, transparent 60%),  /* violet   */
    radial-gradient(circle at center, rgba(255,200,  0,0.85) 0%, transparent 60%),  /* gold     */
    radial-gradient(circle at center, rgba(  0,200,175,0.85) 0%, transparent 60%),  /* teal     */
    radial-gradient(circle at center, rgba(200,  0,110,0.80) 0%, transparent 60%),  /* magenta  */
    radial-gradient(circle at center, rgba( 80,  0,220,0.80) 0%, transparent 60%),  /* indigo   */
    radial-gradient(circle at center, rgba(255,140,  0,0.80) 0%, transparent 60%),  /* amber    */
    radial-gradient(circle at center, rgba(  0,180,210,0.75) 0%, transparent 60%),  /* cyan     */
    radial-gradient(circle at center, rgba(160, 40,255,0.75) 0%, transparent 60%);  /* purple   */
  /* All blobs roughly leaf-sized: 28-36% of the container */
  background-size: 34% 34%, 28% 28%, 30% 30%, 32% 32%, 26% 26%, 30% 30%, 28% 28%, 36% 36%;
  background-repeat: no-repeat;
  animation: tst-particles 20s ease-in-out infinite;
  opacity: 0.42;   /* vivid enough to feel active; borders still the hero */
  pointer-events: none;
  border-radius: inherit;
}

/* ── Bar containers ─────────────────────────────────── */
#mobile-top-bar,
#mobile-bottom-bar {
  display: none;           /* off by default (desktop) */
  position: relative;
  overflow: hidden;
  background: #000;
  width: 100%;
  z-index: 5;
}

/* ── Top bar layout ─────────────────────────────────── */
#mob-header-row {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

/* Logo SVG — gradient is painted directly on the SVG shapes via fill="url(#mob-logo-grad)".
   JS animates the gradient's x1/x2 attributes in sync with the CSS text-gradient-flow.
   No overlay needed here — just size and position the SVG element.             */
#mob-logo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
#mob-logo svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* Auth slot — mirrors the floating auth-float positioning */
#mob-auth-slot {
  flex-shrink: 0;
  position: relative; z-index: 1;
}

/* ── Wide Buttons (Shop + 3 bottom) ─────────────────── */
.mob-wide-btn {
  position: relative; z-index: 1;
  width: 100%;
  background: rgba(0, 0, 0, 0.88);
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.mob-wide-btn:active { background: rgba(0, 0, 0, 0.65); }

/* Gradient border ring — exact same mask-composite technique as Sign Up */
.mob-wide-btn::before {
  content: '';
  position: absolute; inset: 0;
  padding: 1.5px;
  background: linear-gradient(
    90deg,
    #8a4820 0%, #c8782a 15%, #ffd700 32%, #ffaa00 48%,
    #d4a843 64%, #e8c86a 80%, #8a4820 100%
  );
  background-size: 250% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: text-gradient-flow 20s linear infinite;
  pointer-events: none;
}
.mob-wide-btn::after { display: none; }


/* Button text: the palette gradient flows through the inside of the letter shapes */
.mob-btn-text {
  position: relative; z-index: 1;
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Raleway', 'Inter', system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* Clip the animated gradient to the text silhouette */
  background: linear-gradient(
    90deg,
    #8a4820 0%,
    #c8782a 15%,
    #ffd700 32%,
    #ffaa00 48%,
    #d4a843 64%,
    #e8c86a 80%,
    #8a4820 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: text-gradient-flow 20s linear infinite;
}
@keyframes text-gradient-flow {
  0%   { background-position: 100% 0; }
  100% { background-position:   0% 0; }
}

/* ── Mobile portrait — show bars as fixed overlays in the letterbox zones ── */
@media (max-width: 767px) and (orientation: portrait) {

  /*
   * The video renders at 100vw × 56.25vw (16:9 at full width).
   * The remaining vertical space = 100dvh - 56.25vw, split equally top & bottom.
   * We position both bars as fixed elements in those exact letterbox zones
   * so they never overlap the video content.
   */

  /* ── TOP BAR ── */
  #mobile-top-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc((100dvh - 56.25vw) / 2);
    background: #000;
    z-index: 6;
    overflow: hidden;
  }

  #mob-header-row {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
  }

  /* Shop button anchored to the bottom of the top bar */
  #mob-btn-shop {
    flex-shrink: 0;
    height: 44px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }


  /* ── BOTTOM BAR ── */
  #mobile-bottom-bar {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc((100dvh - 56.25vw) / 2);
    z-index: 6;
    overflow: hidden;
  }

  /* Three buttons share the bottom bar height equally */
  .mob-wide-btn {
    flex: 1;
  }
  .mob-wide-btn .mob-btn-text {
    font-size: clamp(1.05rem, 5vw, 1.5rem);
    font-family: 'Raleway', system-ui, sans-serif;
    font-weight: 300;
    letter-spacing: 0.14em;
    padding: 0 12px;
    line-height: 1.2;
  }

  /* Hide the original floating auth button — the slot in the top bar takes over */
  #auth-float { display: none; }

  /* Sign Up button: gradient text + gradient border, black interior */
  #mob-auth-slot .btn-signup-float,
  #mob-auth-slot #mob-btn-signup {
    /* Black interior */
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 7px 14px;
    border: none !important;
    position: relative;
    /* Gradient through the "Sign Up" text letters */
    background: linear-gradient(
      90deg,
      #8a4820 0%, #c8782a 15%, #ffd700 32%, #ffaa00 48%,
      #d4a843 64%, #e8c86a 80%, #8a4820 100%
    ) !important;
    background-size: 250% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: text-gradient-flow 20s linear infinite !important;
  }
  /* Log In button in mobile slot — simple outline */
  #mob-auth-slot .btn-login-float,
  #mob-auth-slot #mob-btn-login-nav {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    background: transparent;
  }

  /* Gradient border ring via mask-composite trick — works with border-radius */
  #mob-auth-slot .btn-signup-float::after,
  #mob-auth-slot #mob-btn-signup::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 999px;  /* match the pill shape */
    padding: 1.5px;
    background: linear-gradient(
      90deg,
      #8a4820 0%, #c8782a 15%, #ffd700 32%, #ffaa00 48%,
      #d4a843 64%, #e8c86a 80%, #8a4820 100%
    );
    background-size: 250% 100%;
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: text-gradient-flow 20s linear infinite;
    pointer-events: none;
    display: block !important;
  }
}

/* ═══════════════════════════════════════════════════════
   ANCESTRAL KNOWLEDGE DRAWER — BOOK CLUB
═══════════════════════════════════════════════════════ */
.book-drawer-inner { padding: 28px 20px 60px; }

.book-club-header { margin-bottom: 24px; text-align: left; }
.book-club-intro { font-size: 1.45rem; font-weight: 700; color: #fff; margin-bottom: 6px; line-height: 1.3; }
.book-club-subtext { font-size: 0.95rem; color: #fff; margin-bottom: 14px; line-height: 1.4; }
.book-club-desc { font-size: 0.9rem; color: rgba(255,255,255,0.7); line-height: 1.5; }
.earn-pts { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.5); font-weight: 800; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.book-card {
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  background: rgba(255,255,255,0.09);
  border-color: rgba(200,120,42,0.5);
}

.book-img-wrap {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.book-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.book-card:hover .book-img {
  transform: scale(1.05);
}

.book-details {
  padding: 12px;
  display: flex; flex-direction: column;
  flex-grow: 1; justify-content: space-between;
}
.book-title {
  color: #fff; font-size: 0.85rem; font-weight: 700;
  margin: 0 0 6px 0; line-height: 1.3;
}
.book-points {
  color: rgba(255,255,255,0.6); font-size: 0.75rem;
  margin: 0; font-weight: 500;
}
.book-points .pts {
  color: #ffd700; font-weight: 800; font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   BOOK REPORT BUTTON & MODAL
═══════════════════════════════════════════════════════ */
.book-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}
.btn-book-report, .btn-book-discuss {
  flex: 1;
  padding: 16px 8px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
  text-align: center;
  line-height: 1.2;
}

@keyframes swirlAnim {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-book-report {
  background: linear-gradient(120deg, #c8782a, #8a4820, #8a4820, #c8782a);
  background-size: 300% 300%;
  animation: swirlAnim 6s ease infinite;
  border: 1px solid rgba(200,120,42,0.6);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.btn-book-report:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(200,120,42,0.4);
}

.btn-book-discuss {
  background: linear-gradient(120deg, #8a4820, #5c2e10, #c8782a, #8a4820);
  background-size: 300% 300%;
  animation: swirlAnim 7s ease infinite;
  animation-delay: -3s;
  border: 1px solid rgba(138,72,32,0.6);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.btn-book-discuss:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(138,72,32,0.4);
}

.modal-box {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: linear-gradient(160deg, rgba(8,18,28,0.95) 0%, rgba(4,12,22,0.98) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(200,120,42,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(200,120,42,0.1);
  padding: 40px 32px;
  border-radius: 16px;
  width: 90%; max-width: 400px;
  text-align: center;
  opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.32, 0, 0.15, 1), opacity 0.35s ease;
}
.drawer-backdrop.active .modal-box {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.modal-box h2 {
  font-size: 1.6rem; color: #fff; margin-bottom: 12px;
}
.modal-box p {
  font-size: 0.95rem; color: rgba(255,255,255,0.7); line-height: 1.5; margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════
   POINTS INFOGRAPHIC
═══════════════════════════════════════════════════════ */
.points-infographic {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}
.points-infographic h3 {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 12px;
}
.points-infographic .tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.points-infographic .tier:last-child {
  border-bottom: none;
}
.points-infographic .tier-pts {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  color: #c8782a;
  font-size: 1rem;
  width: 130px;
  flex-shrink: 0;
}
.points-infographic .tier-reward {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: right;
  line-height: 1.4;
}
.points-infographic .special .tier-pts {
  color: #8a4820;
}
.points-infographic .special-gold {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,170,0,0.1));
  border-radius: 8px;
  margin-top: 12px;
  border: 1px solid rgba(255,215,0,0.3);
  box-shadow: 0 4px 15px rgba(255,215,0,0.1);
}
.points-infographic .special-gold .tier-pts {
  color: #ffd700;
}
.points-infographic .special-gold .tier-reward {
  color: #ffd700;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   COMMUNITY SCREEN
═══════════════════════════════════════════════════════ */
.comm-screen {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  height: 100%; height: 100dvh;
  background: #160e08;
  z-index: 30;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.comm-screen.open { transform: translateX(0); }

/* Top bar */
.comm-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(80,40,10,0.25);
  border-bottom: 1px solid rgba(160,90,30,0.2);
  flex-shrink: 0;
}
.comm-topbar-title {
  flex: 1; font-size: 1.1rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comm-topbar-actions { display: flex; align-items: center; gap: 8px; }
.comm-back-btn, .comm-close-btn, .comm-msg-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); font-size: 1.1rem;
  padding: 6px 8px; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  display: flex; align-items: center; position: relative;
}
.comm-back-btn:hover, .comm-close-btn:hover, .comm-msg-btn:hover {
  background: rgba(255,255,255,0.08); color: #fff;
}
.msg-unread-badge {
  position: absolute; top: 2px; right: 2px;
  background: #ff4d4d; color: #fff;
  font-size: 0.62rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Body layout */
.comm-body {
  flex: 1; display: flex; overflow: hidden;
}
.comm-sidebar {
  width: 150px; flex-shrink: 0;
  border-right: 1px solid rgba(160,90,30,0.2);
  overflow-y: auto; padding: 8px 0 16px;
  display: block;
  background: rgba(20,10,4,0.4);
}
@media (min-width: 900px) {
  .comm-sidebar { width: 210px; }
}
/* Mobile sidebar — tighter text */
@media (max-width: 899px) {
  .comm-sidebar-heading { font-size: 0.58rem; padding: 8px 10px 10px; }
  .mem-tier-header { font-size: 0.58rem; padding: 10px 10px 3px; }
  .mem-nav-item { font-size: 0.76rem; padding: 7px 8px 7px 10px; gap: 6px; }
  .comm-cat-icon { width: 16px; font-size: 0.85rem; }
}
.comm-sidebar-heading {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(200,160,80,0.5);
  padding: 10px 16px 12px;
}
.comm-cat-nav { list-style: none; }

/* ── Tier section headers in sidebar ── */
.mem-tier-header {
  display: flex; align-items: center; gap: 7px; list-style: none;
  padding: 12px 16px 4px;
  font-size: 0.63rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tier-color, rgba(255,255,255,0.35));
  margin-top: 4px;
}
.mem-tier-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tier-color, rgba(255,255,255,0.35));
  flex-shrink: 0;
}

/* ── Nav items ── */
.mem-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px 8px 18px; list-style: none;
  font-size: 0.83rem; color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none; border-right: 3px solid transparent;
  background: none; width: 100%; text-align: left;
}
.mem-nav-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.9); }
.mem-nav-item.active {
  color: var(--tier-color, #c8a050); font-weight: 600;
  background: rgba(255,255,255,0.05);
  border-right-color: var(--tier-color, #c8a050);
}
.mem-nav-item.locked { opacity: 0.38; cursor: not-allowed; }
.mem-lock-icon { font-size: 0.65rem; margin-left: auto; opacity: 0.7; }
.comm-cat-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }
.comm-cat-name { flex: 1; }

/* ── Membership home view ── */
.mem-home-grid { padding: 16px; }
.mem-home-section {
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.mem-home-section.locked { opacity: 0.45; }
.mem-home-section-title {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 0;
  padding: 9px 14px;
  color: var(--tier-color, rgba(255,255,255,0.4));
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; gap: 6px;
}
.mem-home-items { display: flex; flex-direction: column; }
.mem-home-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 0.85rem; color: rgba(255,255,255,0.7);
  background: none; border: none;
  border-top: 1px solid rgba(255,255,255,0.04);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background 0.15s, color 0.15s; width: 100%;
}
.mem-home-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.mem-home-item-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
/* Always hide the redundant mobile grid — sidebar handles navigation */
.mem-home-grid { display: none; }
/* Welcome panel fills the main pane when nothing is selected */
.mem-desktop-welcome {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start;
  height: 100%; text-align: center;
  padding: 20px 24px 32px;
  overflow-y: auto;
}

/* ── Placeholder / coming soon view ── */
.comm-placeholder-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 12px;
  padding: 40px 24px; text-align: center;
}
.comm-placeholder-icon { font-size: 3.5rem; opacity: 0.7; }
.comm-placeholder-title {
  font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 800;
  color: #fff; margin: 0;
}
.comm-placeholder-desc {
  font-size: 0.88rem; color: rgba(255,255,255,0.4); line-height: 1.6; max-width: 280px; margin: 0;
}

/* Main panel */
.comm-main {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.comm-view { flex: 1; padding: 16px; }

/* Category grid (mobile) */
.comm-cat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (min-width: 900px) {
  .comm-cat-grid { grid-template-columns: repeat(4, 1fr); }
}
.comm-cat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px; padding: 18px 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  font-family: inherit;
}
.comm-cat-card:hover {
  background: rgba(200,160,80,0.1);
  border-color: rgba(200,160,80,0.35);
  transform: translateY(-2px);
}
.comm-cat-card-icon { font-size: 1.8rem; }
.comm-cat-card-label { font-size: 0.88rem; font-weight: 700; color: #fff; }
.comm-cat-card-desc  { font-size: 0.72rem; color: rgba(255,255,255,0.45); line-height: 1.4; }

/* Feed header */
.comm-feed-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.comm-feed-desc { font-size: 0.85rem; color: rgba(255,255,255,0.5); flex: 1; }
.btn-new-post {
  background: linear-gradient(135deg, #8a4820, #c8782a);
  color: #fff;
  border: none; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700;
  padding: 7px 16px; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-new-post:hover { opacity: 0.85; transform: translateY(-1px); }

/* Post cards */
.comm-post-list { display: flex; flex-direction: column; gap: 8px; }
.comm-post-card {
  display: flex; gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.comm-post-card:hover {
  border-color: rgba(200,130,60,0.3);
  background: rgba(255,255,255,0.06);
}
.comm-post-votes {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 32px; padding-top: 2px;
}
.comm-vote-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 0.9rem; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.comm-vote-btn:hover { color: #ff6b35; background: rgba(255,107,53,0.1); }
.comm-vote-count { font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,0.55); }
.comm-post-body { flex: 1; min-width: 0; }
.comm-post-title {
  font-size: 0.95rem; font-weight: 600; color: #fff;
  margin-bottom: 4px; cursor: pointer; background: none; border: none;
  padding: 0; text-align: left; font-family: inherit; line-height: 1.4;
}
.comm-post-title:hover { color: #c8a050; }
.comm-post-excerpt { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-bottom: 6px; line-height: 1.45; }
.comm-post-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.comm-author-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.6); font-size: 0.78rem;
  padding: 2px; border-radius: 4px; font-family: inherit;
  transition: color 0.15s;
}
.comm-author-btn:hover { color: #c8a050; }
.comm-meta-sep { color: rgba(255,255,255,0.25); font-size: 0.75rem; }
.comm-post-time { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.comm-comment-count { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

.comm-avatar {
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: linear-gradient(135deg, #8a4820, #c87828);
  display: inline-flex; align-items: center; justify-content: center;
}
.comm-avatar-init { color: #fff; font-weight: 700; }

/* Load more */
.btn-load-more {
  display: block; width: calc(100% - 32px); margin: 12px 16px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6); border-radius: 8px;
  padding: 10px; cursor: pointer; font-size: 0.85rem; font-family: inherit;
  transition: background 0.2s;
}
.btn-load-more:hover { background: rgba(255,255,255,0.1); }

/* Post detail */
.comm-full-post { display: flex; gap: 10px; }
.comm-full-title {
  font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 10px; line-height: 1.4;
}
.comm-full-body {
  font-size: 0.9rem; color: rgba(255,255,255,0.8); line-height: 1.6; margin-bottom: 8px;
}
.comm-comments-heading {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); margin: 16px 16px 10px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.comm-comments-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.comm-comment {
  display: flex; gap: 10px; align-items: flex-start;
}
.comm-comment-content { flex: 1; }
.comm-comment-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.comm-author-name {
  font-size: 0.8rem; font-weight: 600;
}
.comm-comment-body {
  font-size: 0.88rem; color: rgba(255,255,255,0.8); line-height: 1.5;
}
.comm-comment-form {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
  margin-top: auto;
}
.comm-comment-form textarea {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #fff; font-size: 0.88rem; font-family: inherit;
  padding: 10px 12px; resize: none; outline: none;
  transition: border-color 0.2s;
}
.comm-comment-form textarea:focus { border-color: rgba(200,130,60,0.5); }
.btn-comment-submit {
  background: linear-gradient(135deg, #8a4820, #c8782a); color: #fff; border: none; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; padding: 0 16px; cursor: pointer;
  transition: opacity 0.2s; white-space: nowrap; align-self: flex-end; height: 38px;
}
.btn-comment-submit:hover { opacity: 0.85; }

/* New post form */
.comm-new-post-form { max-width: 680px; }
.comm-form-heading {
  font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 16px;
}
.comm-input {
  width: 100%; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  color: #fff; font-size: 0.9rem; font-family: inherit;
  padding: 11px 14px; margin-bottom: 10px; outline: none; display: block;
  transition: border-color 0.2s;
}
.comm-input:focus { border-color: rgba(200,130,60,0.5); }
.comm-textarea { resize: vertical; min-height: 120px; }
.comm-form-error { color: #ff8080; font-size: 0.83rem; margin-bottom: 8px; }
.comm-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.btn-ghost {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7); border-radius: 8px; padding: 8px 18px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.comm-submit-btn { padding: 8px 24px !important; }

.comm-loading { color: rgba(255,255,255,0.4); font-size: 0.88rem; padding: 12px 0; }
.comm-empty   { color: rgba(255,255,255,0.4); font-size: 0.88rem; padding: 20px 0; text-align: center; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════
   MESSAGES PANEL
═══════════════════════════════════════════════════════ */
.msg-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 340px; max-width: 100vw;
  height: 520px; max-height: 90dvh;
  background: #161616;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px 14px 0 0;
  z-index: 40;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
.msg-panel.open { transform: translateY(0); }

.msg-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.msg-panel-title { flex: 1; font-size: 0.95rem; font-weight: 700; color: #fff; }
.msg-back-btn, .msg-close-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.6); font-size: 1rem; padding: 4px 8px;
  border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.msg-back-btn:hover, .msg-close-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.msg-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.msg-inbox { flex: 1; overflow-y: auto; padding: 8px 0; }
.msg-thread-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: none; border: none; padding: 10px 14px;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background 0.15s;
}
.msg-thread-item:hover { background: rgba(255,255,255,0.05); }
.msg-thread-info { flex: 1; min-width: 0; }
.msg-thread-name { display: block; font-size: 0.88rem; font-weight: 600; color: #fff; }
.msg-thread-preview {
  display: block; font-size: 0.78rem; color: rgba(255,255,255,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-unread-dot {
  background: #c8782a; color: #000; font-size: 0.68rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.msg-convo { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.msg-thread {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.msg-bubble {
  max-width: 80%; padding: 9px 13px; border-radius: 16px;
  font-size: 0.88rem; line-height: 1.45; word-break: break-word;
}
.msg-mine   { background: #c8782a; color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-theirs { background: rgba(255,255,255,0.1); color: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-compose {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.msg-input-field {
  flex: 1; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; color: #fff; font-size: 0.88rem; font-family: inherit;
  padding: 8px 14px; outline: none; transition: border-color 0.2s;
}
.msg-input-field:focus { border-color: rgba(200,120,42,0.5); }
.msg-send-btn {
  background: #c8782a; color: #000; border: none; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700; padding: 0 16px; cursor: pointer;
  transition: background 0.2s; white-space: nowrap;
}
.msg-send-btn:hover { background: #a86020; }

/* ═══════════════════════════════════════════════════════
   USER CARD POPUP
═══════════════════════════════════════════════════════ */
.user-card-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.user-card-popup.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.user-card-inner {
  background: #1e1e1e; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; padding: 28px 24px 22px;
  min-width: 240px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  position: relative;
}
.user-card-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.5); font-size: 1rem; padding: 4px;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.user-card-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.user-card-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, #c8782a, #8a4820);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px solid rgba(200,120,42,0.4);
}
.user-card-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#ucard-avatar-initials { font-size: 1.8rem; font-weight: 700; color: #fff; }
.user-card-name  { font-size: 1.05rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.user-card-status { font-size: 0.8rem; color: #c8782a; min-height: 18px; margin-bottom: 14px; }
.user-card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ucard-btn {
  border-radius: 20px; padding: 7px 18px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ucard-btn:disabled { opacity: 0.45; cursor: default; }

/* ═══════════════════════════════════════════════════════
   DIRECTORY MAP SCREEN
═══════════════════════════════════════════════════════ */
.dir-screen {
  position: fixed;
  top: 0; right: 0;
  width: 420px; max-width: 100vw;
  height: 100%; height: 100dvh;
  background: #111;
  z-index: 30;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.dir-screen.open { transform: translateX(0); }

@media (min-width: 900px) {
  .dir-screen { width: 100%; max-width: 100%; }
}

.dir-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.dir-topbar-title {
  flex: 1; font-size: 1.1rem; font-weight: 700; color: #fff;
}
.dir-topbar-actions { display: flex; align-items: center; gap: 8px; }
.dir-add-btn {
  background: #c8782a; color: #000; border: none; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700; padding: 6px 16px; cursor: pointer;
  transition: background 0.2s;
}
.dir-add-btn:hover { background: #a86020; }
.dir-close-btn {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.7); font-size: 1.1rem;
  padding: 6px 8px; border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.dir-close-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* Add-listing panel */
.dir-add-panel {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 16px 18px;
  flex-shrink: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.dir-add-heading { font-size: 0.95rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.dir-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .dir-form-row { grid-template-columns: 1fr; } }
.dir-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.dir-form-group label { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.5); letter-spacing: 0.05em; }
.dir-input {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: #fff; font-size: 0.88rem; font-family: inherit;
  padding: 9px 12px; outline: none; transition: border-color 0.2s;
}
.dir-input:focus { border-color: rgba(200,120,42,0.5); }
.dir-form-error { color: #ff8080; font-size: 0.82rem; margin-bottom: 6px; }
.dir-form-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Map */
.dir-map-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.dir-map {
  flex: 1;
  min-height: 0;
}

.dir-mission-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900; /* above Leaflet tiles (z-index ~400) but below drawers */
  max-width: 680px;
  width: calc(100% - 48px);
  background: rgba(30, 16, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(243, 235, 220, 0.92);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.6;
  text-align: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none; /* lets clicks pass through to the map */
}

@media (max-width: 600px) {
  .dir-mission-banner {
    font-size: 0.74rem;
    padding: 8px 14px;
    top: 8px;
  }
}

/* Override Leaflet popup font to match site */
.leaflet-popup-content { font-family: 'Inter', system-ui, sans-serif; }

/* ── Footer page-content drawers ─────────────────────────── */
.page-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}
.page-drawer-head .drawer-title { margin-bottom: 0; }

.page-edit-btn {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  margin-top: 4px;
}
.page-edit-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

.page-para {
  font-size: 0.93rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  margin: 0 0 14px;
}
.page-list {
  padding-left: 1.25rem;
  margin: 0 0 14px;
}
.page-list li {
  font-size: 0.93rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
}
.page-link {
  color: #c8782a;
  text-decoration: underline;
  word-break: break-all;
}
.page-link:hover { color: #7fe0d8; }
.page-loading {
  color: rgba(255,255,255,0.35);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
}

.research-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.research-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-light, #f5f1e7);
  line-height: 1.45;
  margin: 0 0 10px;
}
.research-overview {
  font-size: 0.87rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  margin: 0 0 12px;
}
.research-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #c8782a;
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid rgba(200,120,42,0.4);
  border-radius: 6px;
  transition: background 0.15s;
}
.research-link:hover { background: rgba(200,120,42,0.1); }

.page-textarea {
  width: 100%;
  min-height: 220px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  padding: 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.page-textarea:focus { border-color: rgba(200,120,42,0.5); }
.page-edit-hint {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.3);
  line-height: 1.45;
  margin: 6px 0 0;
}
.page-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Directory listing detail drawer */
.dir-listing-address {
  font-size: 0.88rem; color: rgba(255,255,255,0.5);
  margin: 6px 0 16px; line-height: 1.5;
}
.dir-listing-desc {
  font-size: 0.92rem; color: rgba(255,255,255,0.8);
  line-height: 1.65; margin-bottom: 18px;
}
.dir-listing-link {
  display: inline-block;
  background: rgba(200,120,42,0.12);
  border: 1px solid rgba(200,120,42,0.35);
  color: #c8782a; text-decoration: none;
  border-radius: 24px; padding: 9px 22px;
  font-size: 0.88rem; font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.dir-listing-link:hover { background: rgba(200,120,42,0.22); transform: translateY(-1px); }
