/* Shared drawer extras: Settings, Feedback, About, Share App */
.me-divider { height: 1px; background: var(--border); margin: 10px 4px; }
.me-nav-item { cursor: pointer; }
.me-nav-item svg { width: 18px; height: 18px; }

.me-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 10, 40, .5);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.me-backdrop.open { opacity: 1; pointer-events: auto; }
@media (min-width: 640px) {
  .me-backdrop { align-items: center; }
}

.me-sheet {
  width: min(400px, 100%);
  max-height: 84vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px 22px;
  transform: translateY(24px);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -12px 48px rgba(15, 10, 40, .22);
}
@media (min-width: 640px) {
  .me-sheet { border-radius: 22px; transform: translateY(12px); }
}
.me-backdrop.open .me-sheet { transform: translateY(0); }

.me-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.me-title { font-weight: 800; font-size: 16px; color: var(--heading); }
.me-close {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 999px;
  color: var(--muted); background: var(--tile);
}
.me-close svg { width: 15px; height: 15px; }

.me-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  margin: 14px 0 8px;
}

/* Theme segmented control */
.me-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--tile); border-radius: 14px; padding: 5px;
}
.me-seg button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  transition: background .18s ease, color .18s ease;
}
.me-seg button.active { background: var(--surface); color: #7c3aed; box-shadow: 0 2px 8px rgba(15,10,40,.08); }
html.dark .me-seg button.active { color: #c4b5fd; }
.me-seg svg { width: 15px; height: 15px; }

/* Settings rows */
.me-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--tile); margin-bottom: 8px;
}
.me-row-text { min-width: 0; }
.me-row-title { font-size: 13.5px; font-weight: 700; color: var(--heading); }
.me-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.me-btn {
  flex: none; padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface); color: #dc2626;
  border: 1px solid var(--border);
}
.me-btn:hover { background: #fee2e2; }
html.dark .me-btn:hover { background: #3f1d1d; }
.me-version { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }

/* Feedback form */
.me-textarea {
  width: 100%; min-height: 110px; resize: vertical;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--tile);
  color: var(--text); font: inherit; font-size: 14px;
}
.me-textarea:focus { outline: 2px solid #a78bfa; outline-offset: 1px; }
.me-send {
  width: 100%; margin-top: 12px; padding: 13px;
  border-radius: 14px; font-size: 14px; font-weight: 800;
  background: linear-gradient(120deg, #7c3aed, #4f46e5); color: #fff;
}
.me-send:disabled { opacity: .55; }
.me-link-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--tile); text-decoration: none;
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.me-link-row svg { width: 15px; height: 15px; color: var(--muted); }

/* About */
.me-about-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 4px; }
.me-logo {
  width: 64px; height: 64px; border-radius: 20px;
  background: conic-gradient(from 210deg, #f43f5e, #f59e0b, #10b981, #3b82f6, #8b5cf6, #f43f5e);
  box-shadow: 0 8px 24px rgba(124, 58, 237, .3);
}
.me-about-name { font-size: 18px; font-weight: 800; color: var(--heading); }
.me-about-tag { font-size: 13px; color: var(--muted); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.me-stat {
  text-align: center; padding: 12px 6px;
  background: var(--tile); border-radius: 14px;
}
.me-stat b { display: block; font-size: 16px; color: var(--heading); }
.me-stat span { font-size: 11px; color: var(--muted); }
.me-links { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.me-links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 14px; background: var(--tile);
  font-size: 13.5px; font-weight: 700; color: var(--text); text-decoration: none;
}
.me-links a:hover { background: var(--border); }
.me-links svg { width: 15px; height: 15px; color: var(--muted); }

/* ---------- Kinetic fullscreen menu (GSAP) ---------- */
.drawer {
  width: 100%; max-width: none;
  /* Solid fallback background: if GSAP is slow/absent the class-based open
     still shows an opaque panel instead of a transparent overlay. */
  background: var(--surface); box-shadow: none; padding: 0;
  transform: translateX(120%);
  transition: transform .55s cubic-bezier(.65, .05, 0, 1);
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.kinetic-bg { position: absolute; inset: 0; overflow: hidden; }
.backdrop-layer { position: absolute; inset: 0; background: var(--surface); }
.backdrop-layer.first { background: #ede9fe; }
.backdrop-layer.second { background: #f5f3ff; }
html.dark .backdrop-layer.first { background: #2a2140; }
html.dark .backdrop-layer.second { background: #221b36; }
.ambient-background-shapes { position: absolute; inset: 0; pointer-events: none; }
.ambient-background-shapes .bg-shape { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.ambient-background-shapes .bg-shape.active { opacity: 1; }
.drawer-head, .drawer-nav { position: relative; z-index: 2; }
.drawer-head { margin: 14px 18px 0; border-bottom: 1px solid var(--border); }
.drawer-nav { padding: 20px 22px; gap: 4px; }
.drawer-nav a {
  font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  padding: 10px 14px; border-radius: 16px; color: var(--heading);
}
.drawer-nav a:hover { background: transparent; }
.drawer-nav a.active { background: transparent; color: #7c3aed; }
html.dark .drawer-nav a.active { color: #c4b5fd; }
.drawer-nav svg { width: 24px; height: 24px; }
.drawer-nav a.me-nav-item { font-size: 19px; padding: 9px 14px; }
.drawer-nav a.me-nav-item svg { width: 18px; height: 18px; }
.drawer-nav .me-divider { margin: 12px 4px 8px; }

/* Compact profile row pinned under Share App */
.me-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; margin: 6px 0 2px;
}
.me-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff; font-size: 14px; font-weight: 800;
}
.me-avatar svg { width: 16px; height: 16px; }
.me-avatar-guest { background: var(--tile); color: var(--muted); }
.me-profile-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me-profile-meta b { font-size: 13px; font-weight: 800; color: var(--heading); }
.me-profile-meta small { font-size: 10.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-logout {
  flex: none; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #dc2626; background: rgba(220, 38, 38, .08);
  border: none; cursor: pointer;
}
.me-logout svg { width: 15px; height: 15px; }
.me-auth-btns { display: flex; gap: 5px; flex: none; }
.drawer-nav a.me-auth-btn,
.me-auth-btn {
  display: inline-block; text-align: center; padding: 6px 10px;
  font-size: 11px; font-weight: 700; text-decoration: none;
  letter-spacing: 0; border-radius: 9px; line-height: 1.2;
}
.drawer-nav a.me-auth-login, .me-auth-login { color: #7c3aed; background: rgba(124, 58, 237, .1); }
.drawer-nav a.me-auth-signup, .me-auth-signup { color: #fff; background: linear-gradient(135deg, #7c3aed, #ec4899); }

/* Log out confirmation dialog */
.me-confirm { text-align: center; }
.me-confirm-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 6px auto 0; border-radius: 50%;
  background: rgba(220, 38, 38, .1); color: #dc2626;
}
.me-confirm-icon svg { width: 26px; height: 26px; }
.me-confirm-title { display: block; margin-top: 12px; font-size: 19px; font-weight: 800; color: var(--heading); }
.me-confirm-text { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--muted); }
.me-confirm-btns { display: flex; gap: 10px; margin-top: 18px; }
.me-confirm-btns button {
  flex: 1; padding: 12px 0; font-size: 14px; font-weight: 700;
  font-family: inherit; border-radius: 14px; cursor: pointer;
}
.me-confirm-cancel { color: var(--heading); background: var(--tile); border: 1px solid var(--border); }
.me-confirm-ok { color: #fff; background: linear-gradient(135deg, #dc2626, #f43f5e); border: 1px solid transparent; }

/* ColorNest wordmark: "Color" in white, "Nest" in a rainbow gradient */
.cn-grad {
  background: linear-gradient(90deg, #ec4899, #f97316, #eab308, #22c55e, #06b6d4, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Toast fallback */
#me-toast {
  position: fixed; left: 50%; bottom: 88px; z-index: 120;
  transform: translateX(-50%) translateY(8px);
  background: #1e1b2e; color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 24px rgba(15, 10, 40, .3);
}
#me-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
