:root {
  --primary: #ffcc00;
  --primary-dark: #e0b400;
  --bg: #121212;
  --card: #1e1e1a;
  --text: #f5f5f0;
  --muted: #a8a89c;
  --border: #33331f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', 'Noto Sans Thai', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Auth pages */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card {
  background: var(--card);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.brand {
  color: var(--primary);
  font-size: 2rem;
  margin: 0;
  letter-spacing: 1px;
  font-weight: 700;
}
.tagline { color: var(--muted); margin: 0.25rem 0 1.5rem; font-size: 0.9rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.75rem; }
.auth-card input, .auth-card select {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f0f0d;
  color: var(--text);
  font-size: 1rem;
}
.auth-card button, .chat-form button, #share-location-btn {
  background: var(--primary);
  color: #1a1a12;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-card button:hover, .chat-form button:hover, #share-location-btn:hover { background: var(--primary-dark); }
.switch { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }
.switch a { color: var(--primary); text-decoration: none; font-weight: 600; }
.error { color: #ff6b6b; font-size: 0.9rem; }
.success { color: var(--primary); font-size: 0.9rem; background: rgba(255,204,0,0.08); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; }
.switch-form { margin-top: 0.5rem; }

/* Nav */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand-small { color: var(--primary); font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.nav-links { display: flex; gap: 1.25rem; align-items: center; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.logout-form button {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem;
}

.page { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* Nearby */
.nearby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1rem; }
.nearby-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  text-align: center;
  padding-bottom: 0.75rem;
}
.nearby-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.nearby-card .name { font-weight: 600; margin: 0.5rem 0 0.15rem; color: var(--text); }
.nearby-card .distance { color: var(--primary); font-size: 0.85rem; }
.nearby-card button {
  margin-top: 0.5rem;
  background: var(--primary);
  color: #1a1a12; border: none; padding: 0.4rem 0.9rem; border-radius: 8px; cursor: pointer; font-weight: 600;
}

/* Inbox */
.conversation-list { list-style: none; padding: 0; margin: 1rem 0; }
.conversation-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-radius: 10px; text-decoration: none; color: var(--text);
}
.conversation-item:hover { background: var(--card); }
.avatar-sm { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 1rem; border: 2px solid var(--primary); }
.conv-name { font-weight: 600; }
.conv-last { color: var(--muted); font-size: 0.85rem; }

/* Chat */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - 64px - 3rem); }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem 0; }
.message { max-width: 70%; padding: 0.6rem 0.9rem; border-radius: 14px; font-size: 0.95rem; }
.message.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--border); color: var(--text); }
.message.mine { align-self: flex-end; background: var(--primary); color: #1a1a12; font-weight: 500; }
.chat-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.chat-form input { flex: 1; padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 1rem; }

/* Profile form */
form label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }
form input, form select, form textarea {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 1rem;
}

/* Radar */
.radar-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 1.5rem; }
.radar-box {
  position: relative;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1a12 0%, #0d0d0a 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.radar-ring { position: absolute; border: 1px solid rgba(255,204,0,0.25); border-radius: 50%; }
.ring-1 { width: 33%; height: 33%; top: 33.5%; left: 33.5%; }
.ring-2 { width: 66%; height: 66%; top: 17%; left: 17%; }
.ring-3 { width: 100%; height: 100%; top: 0; left: 0; }
.radar-sweep {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: conic-gradient(from 0deg, rgba(255,204,0,0.35), transparent 40%);
  animation: sweep 4s linear infinite;
  border-radius: 50%;
}
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.radar-me {
  position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  background: var(--primary); border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 6px rgba(255,204,0,0.2);
  z-index: 3;
}
.radar-dot {
  position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%);
  border-radius: 50%; cursor: pointer; z-index: 2;
  border: 2px solid var(--primary);
}
.radar-dot.live { border-color: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.radar-dot img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.radar-legend { display: flex; gap: 1.5rem; margin-top: 10px; }
.ring-label { font-size: 11px; color: var(--muted); }

.radar-popup {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 1.25rem; text-align: center; z-index: 20;
  border-radius: 16px 16px 0 0;
}
.radar-popup.hidden { display: none; }
.radar-popup img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 6px; }
.popup-name { font-weight: 600; }
.popup-distance { color: var(--primary); font-size: 0.85rem; margin-bottom: 8px; }
.radar-popup button[type="submit"] {
  background: var(--primary); color: #1a1a12; border: none; padding: 0.5rem 1.25rem;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}

.blurred { filter: blur(6px); }
.live-badge {
  background: #4ade80; color: #0d2b16; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 6px; margin-right: 4px; vertical-align: middle;
}

/* Moments / Feed */
.post-form { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.post-form textarea { width: 100%; background: #0f0f0d; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; font-size: 0.9rem; }
.post-form-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.post-form-row button, .settings-card form button {
  background: var(--primary); color: #1a1a12; border: none; padding: 0.5rem 1rem;
  border-radius: 8px; font-weight: 600; cursor: pointer;
}
.moments-list { display: flex; flex-direction: column; gap: 1rem; }
.moment-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.moment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.moment-caption { font-size: 0.9rem; margin: 0.4rem 0; }
.moment-image { width: 100%; border-radius: 8px; margin: 0.4rem 0; }
.like-btn { background: none; border: none; color: var(--muted); font-size: 0.95rem; cursor: pointer; padding: 0; }
.like-btn.liked { color: var(--primary); }

/* Settings */
.settings-form { display: flex; flex-direction: column; gap: 8px; margin: 1rem 0; }
.settings-subhead { margin: 1.5rem 0 0.25rem; font-size: 1rem; }
.radio-row { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.9rem; cursor: pointer; }
.radio-row small { display: block; color: var(--muted); font-size: 0.75rem; }
.settings-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-top: 1.25rem; }
.settings-card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.approved-row { display: flex; align-items: center; gap: 10px; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.approved-row:last-child { border-bottom: none; }
.approved-row .conv-name { flex: 1; }
.countdown { font-size: 0.75rem; }

/* Link buttons + chat header extras */
.link-btn { background: none; border: none; color: var(--primary); font-size: 0.85rem; cursor: pointer; padding: 0; }
.link-btn.danger { color: #ff6b6b; }
.chat-header { display: flex; justify-content: space-between; align-items: center; }
.chat-menu { display: flex; gap: 12px; }
.report-box { display: none; margin: 0.5rem 0; }
.report-box.open { display: block; }
.report-box textarea { width: 100%; background: #0f0f0d; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; font-size: 0.85rem; }
.report-box button { margin-top: 6px; background: var(--primary); color: #1a1a12; border: none; padding: 0.4rem 1rem; border-radius: 8px; font-weight: 600; cursor: pointer; }
.blocked-hint { color: #ff6b6b; }

/* Live-share status card */
.live-status p { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.live-status.is-online .status-dot { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.6); }
.live-status.is-offline .status-dot { background: #888; }

/* Admin panel */
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.admin-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.admin-stat-card.warn { border-color: #ff6b6b; }
.admin-stat-num { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.admin-stat-label { color: var(--muted); font-size: 0.85rem; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.admin-table td img.avatar-sm { vertical-align: middle; margin-right: 6px; }
.admin-actions { display: flex; gap: 12px; }
.active-tab { color: var(--primary) !important; font-weight: 600; }

/* ==========================================================================
   BTALK Redesign — Dark Glossy Black + Bright Yellow
   Scoped entirely under body.bt-app / .bt-* classes so the original theme
   (auth pages, admin panel) is completely untouched.
   ========================================================================== */

body.bt-app {
  --bt-canvas: oklch(11% 0.012 95);
  --bt-bg: oklch(13% 0.014 95);
  --bt-surface: oklch(19% 0.018 95);
  --bt-input-bg: oklch(20% 0.02 95);
  --bt-photo-1: oklch(24% 0.02 95);
  --bt-photo-2: oklch(28% 0.02 95);

  --bt-border: oklch(30% 0.025 95);
  --bt-divider: oklch(26% 0.02 95);
  --bt-radio-border: oklch(42% 0.02 95);
  --bt-dish-border: oklch(34% 0.02 95);
  --bt-ring-border: oklch(85% 0.2 95 / 0.3);

  --bt-text: oklch(95% 0.012 95);
  --bt-muted: oklch(66% 0.02 95);
  --bt-chevron: oklch(58% 0.02 95);
  --bt-tab-inactive: oklch(60% 0.02 95);

  --bt-yellow: oklch(85% 0.2 95);
  --bt-on-yellow: oklch(15% 0.03 90);
  --bt-tab-active-bg: oklch(30% 0.09 95);

  --bt-green: oklch(76% 0.19 145);
  --bt-green-chip: oklch(74% 0.17 150);
  --bt-green-pulse: oklch(80% 0.19 145);
  --bt-red: oklch(70% 0.21 25);
  --bt-red-heart: oklch(72% 0.21 20);

  --bt-r-sm: 10px;
  --bt-r-md: 15px;
  --bt-r-sheet: 20px;
  --bt-r-pill: 100px;

  --bt-shadow-card: 0 1px 3px oklch(0% 0 0 / 0.35);
  --bt-shadow-sheet: 0 -8px 24px oklch(0% 0 0 / 0.5);
  --bt-shadow-knob: 0 1px 2px oklch(0% 0 0 / 0.45);

  background: var(--bt-canvas);
  color: var(--bt-text);
  font-family: 'Noto Sans Thai', -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
}

body.bt-app a { color: inherit; }

/* Screen shell */
.bt-screen {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bt-bg);
  padding: 70px 20px 96px;
  overflow-x: hidden;
}
.bt-screen--sheet { padding: 0 0 32px; }

.bt-glow { position: absolute; pointer-events: none; border-radius: 50%; z-index: 0; }
.bt-glow--yellow {
  width: 200px; height: 200px; top: -30px; right: -50px;
  background: radial-gradient(circle, oklch(85% 0.2 95 / 0.45), transparent 70%);
}
.bt-glow--green {
  width: 140px; height: 140px; top: -10px; left: -40px;
  background: radial-gradient(circle, oklch(78% 0.18 145 / 0.3), transparent 70%);
}

.bt-header-block { position: relative; z-index: 1; margin-bottom: 20px; }
.bt-h1 { font-size: 30px; font-weight: 800; color: var(--bt-text); margin: 0 0 4px; }
.bt-subtitle { font-size: 14px; color: var(--bt-muted); margin: 0 0 16px; line-height: 1.5; }

.bt-pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bt-yellow); color: var(--bt-on-yellow);
  border: none; padding: 11px 18px; border-radius: var(--bt-r-pill);
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.bt-pill-btn:hover { filter: brightness(1.05); }
.bt-pill-btn:disabled { opacity: .6; cursor: not-allowed; filter: none; }
.bt-status-text { font-size: 13px; color: var(--bt-muted); margin: 10px 0 0; }

.bt-toast {
  position: absolute; top: 8px; left: 50%; z-index: 5;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bt-surface); border: 1px solid var(--bt-border); border-left: 4px solid var(--bt-yellow);
  color: var(--bt-text); font-size: 13px; font-weight: 600; text-align: center;
  padding: 11px 18px; border-radius: var(--bt-r-sm); box-shadow: 0 10px 28px rgba(0,0,0,.4);
  max-width: calc(100% - 40px); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.bt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.bt-toast.error { border-left-color: var(--bt-red); }

/* Back-header pattern: Chat / Settings / Safety */
.bt-backheader {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  background: var(--bt-surface); border-bottom: 1px solid var(--bt-border);
  padding: 66px 20px 16px;
}
.bt-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0; color: var(--bt-text);
  text-decoration: none; font-size: 20px; line-height: 1;
  background: none; border: none; cursor: pointer; padding: 0; font-family: inherit;
}
.bt-backheader-title { font-size: 16px; font-weight: 700; color: var(--bt-text); flex: 1; }
.bt-backheader-body { padding: 20px; max-width: 480px; margin: 0 auto; }

/* Bottom tab bar */
.bt-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  max-width: 480px; margin: 0 auto;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 16, 10, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--bt-border);
}
.bt-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--bt-tab-inactive);
  padding: 6px 14px; border-radius: 14px; position: relative;
  font-size: 11px; font-weight: 600; transition: color .15s, background-color .15s;
}
.bt-tab.active { color: var(--bt-yellow); background: var(--bt-tab-active-bg); }
.bt-tab-icon { display: inline-block; width: 22px; height: 22px; position: relative; }
.bt-tab-icon > span:not(.bt-tab-badge) { display: block; width: 100%; height: 100%; position: relative; }
.bt-tab-badge {
  position: absolute; top: -4px; right: -6px; width: 9px; height: 9px; z-index: 1;
  border-radius: 50%; background: var(--bt-red); border: 1.5px solid var(--bt-canvas);
}

.bt-icon-radar { width: 100%; height: 100%; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.bt-icon-radar::after {
  content: ''; position: absolute; width: 6px; height: 6px; background: currentColor;
  border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.bt-icon-nearby { width: 100%; height: 100%; position: relative; }
.bt-icon-nearby::before, .bt-icon-nearby::after {
  content: ''; position: absolute; width: 11px; height: 11px; border: 2px solid currentColor;
  border-radius: 50%; top: 4px;
}
.bt-icon-nearby::before { left: -1px; }
.bt-icon-nearby::after { left: 8px; }
.bt-icon-feed { width: 100%; height: 100%; border: 2px solid currentColor; border-radius: 5px; position: relative; }
.bt-icon-feed::before, .bt-icon-feed::after {
  content: ''; position: absolute; left: 4px; height: 2px; background: currentColor; border-radius: 1px;
}
.bt-icon-feed::before { top: 7px; right: 4px; }
.bt-icon-feed::after { top: 12px; width: 55%; }
.bt-icon-chat { width: 100%; height: 82%; border: 2px solid currentColor; border-radius: 7px 7px 7px 2px; }
.bt-icon-profile { width: 100%; height: 100%; position: relative; }
.bt-icon-profile::before {
  content: ''; position: absolute; width: 9px; height: 9px; border: 2px solid currentColor;
  border-radius: 50%; top: 0; left: 50%; transform: translateX(-50%);
}
.bt-icon-profile::after {
  content: ''; position: absolute; width: 17px; height: 9px; border: 2px solid currentColor; border-bottom: none;
  border-radius: 9px 9px 0 0; bottom: 0; left: 50%; transform: translateX(-50%);
}

/* Radar screen */
.bt-radar-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin-top: 28px; }
.bt-radar-dish {
  position: relative; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, oklch(22% 0.02 90) 0%, oklch(9% 0.014 95) 100%);
  border: 1px solid var(--bt-dish-border); overflow: hidden;
}
.bt-radar-ring { position: absolute; border: 1px solid var(--bt-ring-border); border-radius: 50%; }
.bt-radar-ring.r1 { width: 33%; height: 33%; top: 33.5%; left: 33.5%; }
.bt-radar-ring.r2 { width: 66%; height: 66%; top: 17%; left: 17%; }
.bt-radar-ring.r3 { width: 100%; height: 100%; top: 0; left: 0; }
.bt-radar-sweep {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(from 0deg, oklch(85% 0.2 95 / 0.45), transparent 40%);
  animation: bt-sweep 4s linear infinite;
}
.bt-radar-me {
  position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; z-index: 3;
  background: var(--bt-yellow); border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 7px oklch(85% 0.2 95 / 0.4);
}
.bt-radar-dot {
  position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%);
  border-radius: 50%; cursor: pointer; z-index: 2; border: 2px solid var(--bt-yellow);
  opacity: 0; animation: bt-pop-in .35s ease forwards;
}
.bt-radar-dot.live { border-color: var(--bt-green); animation: bt-pop-in .35s ease forwards, bt-pulse 2s infinite; }
.bt-radar-dot img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.bt-radar-online-dot {
  position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bt-green, #3ecf6e); border: 2px solid var(--bt-bg); z-index: 3;
}
.bt-radar-legend { display: flex; gap: 24px; margin-top: 10px; position: relative; z-index: 1; }
.bt-ring-label { font-size: 11px; color: var(--bt-muted); }

.bt-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: 480px; margin: 0 auto;
  background: var(--bt-surface); border-top: 1px solid var(--bt-border);
  border-radius: var(--bt-r-sheet) var(--bt-r-sheet) 0 0;
  box-shadow: var(--bt-shadow-sheet);
  padding: 20px; text-align: center;
}
.bt-sheet.hidden { display: none; }
.bt-sheet img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.bt-sheet-name { font-weight: 700; font-size: 15px; }
.bt-sheet-online { font-size: 12px; font-weight: 700; color: var(--bt-muted); margin-top: 2px; }
.bt-sheet-online.online { color: var(--bt-green, #3ecf6e); }
.bt-sheet-distance { color: var(--bt-yellow); font-size: 13px; margin: 2px 0 14px; }
.bt-sheet-actions { display: flex; gap: 10px; justify-content: center; }
.bt-sheet-btn {
  border: none; border-radius: var(--bt-r-pill); padding: 10px 22px; font-weight: 700;
  font-size: 14px; cursor: pointer; font-family: inherit;
}
.bt-sheet-btn.neutral { background: var(--bt-input-bg); color: var(--bt-text); }
.bt-sheet-btn.yellow { background: var(--bt-yellow); color: var(--bt-on-yellow); }

/* Nearby grid */
.bt-nearby-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.bt-nearby-card {
  background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md);
  overflow: hidden; box-shadow: var(--bt-shadow-card);
  opacity: 0; animation: bt-pop-in .35s ease forwards;
}
.bt-nearby-photo { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; }
.bt-nearby-photo img { width: 100%; height: 100%; object-fit: cover; }
.bt-nearby-body { padding: 10px 12px 12px; }
.bt-nearby-name { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.bt-chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 0; }
.bt-chip.live { color: var(--bt-green-chip); }
.bt-chip.normal { color: var(--bt-yellow); }
.bt-nearby-card form { margin-top: 8px; }
.bt-nearby-card .bt-pill-btn { width: 100%; justify-content: center; padding: 8px 14px; font-size: 13px; }
.bt-live-pill {
  position: absolute; top: 8px; right: 8px; background: var(--bt-green); color: #fff;
  font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: var(--bt-r-pill); letter-spacing: .03em;
}
.bt-online-dot {
  position: absolute; bottom: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bt-green, #3ecf6e); border: 2px solid var(--bt-bg);
}

/* Feed / Moments */
.bt-composer {
  position: relative; z-index: 1; background: var(--bt-surface); border: 1px solid var(--bt-border);
  border-radius: var(--bt-r-md); padding: 14px; margin-top: 20px;
}
.bt-composer textarea {
  width: 100%; background: transparent; border: none; color: var(--bt-text);
  font-family: inherit; font-size: 14px; resize: none; padding: 0; min-height: 40px;
}
.bt-composer textarea:focus { outline: none; }
.bt-composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.bt-attach-btn {
  width: 40px; height: 40px; border-radius: var(--bt-r-sm); border: 1px dashed var(--bt-border);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--bt-muted);
  flex-shrink: 0; position: relative; font-size: 16px;
}
.bt-attach-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bt-attach-name { font-size: 12px; color: var(--bt-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bt-feed-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.bt-feed-card {
  background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md);
  padding: 14px; opacity: 0; animation: bt-pop-in .35s ease forwards;
}
.bt-feed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bt-feed-name { font-weight: 700; font-size: 14px; }
.bt-feed-time { font-size: 12px; color: var(--bt-muted); }
.bt-feed-caption { font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.bt-feed-photo {
  width: 100%; aspect-ratio: 16 / 10; border-radius: var(--bt-r-sm); object-fit: cover; margin-bottom: 10px; display: block;
}
.bt-like-btn { background: none; border: none; display: inline-flex; align-items: center; gap: 6px; color: var(--bt-muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.bt-heart { font-size: 19px; display: inline-block; transition: transform .2s cubic-bezier(.34,1.6,.64,1), color .2s; }
.bt-like-btn.liked { color: var(--bt-red-heart); }
.bt-like-btn.liked .bt-heart { transform: scale(1.25) rotate(-8deg); }

/* Avatars — colorful per-person identity ring */
.bt-avatar { display: inline-block; border-radius: 50%; flex-shrink: 0; }
.bt-avatar img { display: block; border-radius: 50%; object-fit: cover; width: 100%; height: 100%; }
.bt-avatar-ring {
  box-shadow: 0 0 0 2px var(--bt-bg), 0 0 0 3.5px oklch(80% 0.14 var(--hue, 95));
}
.bt-avatar { position: relative; }
.bt-avatar-status {
  position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bt-muted); border: 2px solid var(--bt-bg);
}
.bt-avatar-status.online { background: var(--bt-green, #3ecf6e); }

/* Inbox */
.bt-inbox-list { position: relative; z-index: 1; margin-top: 16px; }
.bt-inbox-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--bt-divider); text-decoration: none; color: var(--bt-text);
  opacity: 0; animation: bt-pop-in .35s ease forwards;
}
.bt-inbox-row:last-child { border-bottom: none; }
.bt-inbox-avatar { width: 52px; height: 52px; }
.bt-inbox-main { flex: 1; min-width: 0; }
.bt-inbox-name { font-weight: 700; font-size: 15px; }
.bt-inbox-preview { color: var(--bt-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.bt-inbox-time { font-size: 11px; color: var(--bt-muted); }
.bt-inbox-unread {
  background: var(--bt-yellow); color: var(--bt-on-yellow); font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: var(--bt-r-pill); display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.bt-inbox-row.unread .bt-inbox-name { color: var(--bt-yellow); }
.bt-inbox-row.unread .bt-inbox-preview { color: var(--bt-text); font-weight: 600; }

/* Chat */
.bt-backheader .bt-inbox-avatar { width: 36px; height: 36px; }
.bt-chat-header-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.bt-chat-typing { font-size: 11px; color: var(--bt-green); line-height: 1.2; }
.bt-chat-report { margin-left: auto; color: var(--bt-red); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; text-decoration: none; font-family: inherit; }
.bt-report-box { display: none; padding: 12px 20px; background: var(--bt-surface); border-bottom: 1px solid var(--bt-border); }
.bt-report-box.open { display: block; }
.bt-report-box textarea { width: 100%; background: var(--bt-input-bg); color: var(--bt-text); border: 1px solid var(--bt-border); border-radius: var(--bt-r-sm); padding: 8px 10px; font-size: 13px; font-family: inherit; }
.bt-report-box button { margin-top: 8px; background: var(--bt-yellow); color: var(--bt-on-yellow); border: none; padding: 7px 16px; border-radius: var(--bt-r-pill); font-weight: 700; cursor: pointer; }
.bt-blocked-hint { color: var(--bt-red); padding: 10px 20px; font-size: 13px; }

.bt-messages { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; padding-bottom: 90px; }
.bt-bubble {
  max-width: 72%; padding: 10px 14px; font-size: 14px; line-height: 1.4;
  animation: bt-msg-in .25s ease;
}
.bt-bubble.mine { align-self: flex-end; background: var(--bt-yellow); color: var(--bt-on-yellow); font-weight: 500; border-radius: 16px 16px 4px 16px; }
.bt-bubble.theirs { align-self: flex-start; background: var(--bt-surface); border: 1px solid var(--bt-border); color: var(--bt-text); border-radius: 16px 16px 16px 4px; }
.bt-tick { display: inline-block; margin-left: 6px; font-size: 11px; letter-spacing: -2px; opacity: .55; }
.bt-tick.read { opacity: 1; color: var(--bt-blue, #3a8bff); }

/* Chat image/video attachments */
.bt-bubble.has-media { background: transparent; border: none; padding: 4px; max-width: 220px; }
.bt-msg-media { display: block; width: 100%; max-height: 280px; border-radius: 14px; object-fit: cover; cursor: zoom-in; background: #000; }
video.bt-msg-media { cursor: default; max-height: 300px; object-fit: contain; }
.bt-bubble.has-media .bt-tick { display: block; text-align: right; margin: 2px 4px 0 0; }

.bt-typing-bubble { align-self: flex-start; background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: 16px 16px 16px 4px; padding: 12px 14px; display: inline-flex; gap: 4px; }
.bt-typing-bubble span { width: 6px; height: 6px; border-radius: 50%; background: var(--bt-muted); animation: bt-dot-bounce 1.2s infinite; }
.bt-typing-bubble span:nth-child(2) { animation-delay: .15s; }
.bt-typing-bubble span:nth-child(3) { animation-delay: .3s; }

.bt-chat-input-row {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bt-bg); border-top: 1px solid var(--bt-border);
}
.bt-chat-input-row input {
  flex: 1; background: var(--bt-input-bg); border: 1px solid var(--bt-border); color: var(--bt-text);
  border-radius: var(--bt-r-pill); padding: 12px 18px; font-size: 14px; font-family: inherit;
}
.bt-chat-input-row input:focus { outline: none; border-color: var(--bt-radio-border); }
.bt-send-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--bt-yellow); color: var(--bt-on-yellow);
  border: none; flex-shrink: 0; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.bt-send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Profile */
.bt-profile-center { position: relative; z-index: 1; text-align: center; margin-top: 24px; }
.bt-profile-avatar {
  width: 94px; height: 94px; border-radius: 50%; margin: 0 auto 14px;
  box-shadow: 0 0 0 4px var(--bt-bg), 0 0 0 7px var(--bt-yellow);
}
.bt-profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.bt-profile-name { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.bt-profile-bio { font-size: 13px; color: var(--bt-muted); margin: 0; }

.bt-nav-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.bt-nav-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md);
  padding: 15px 16px; text-decoration: none; color: var(--bt-text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.bt-nav-row .chev { color: var(--bt-chevron); font-size: 16px; }
.bt-nav-row.danger { color: var(--bt-red); }
.bt-nav-row.danger .chev { display: none; }
.bt-nav-row form { margin: 0; }
.bt-nav-row button { background: none; border: none; color: var(--bt-red); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; text-align: left; width: 100%; }

/* Settings */
.bt-settings-form { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.bt-radio-row {
  display: flex; align-items: flex-start; gap: 12px; background: var(--bt-surface);
  border: 1px solid var(--bt-radio-border); border-radius: var(--bt-r-md); padding: 14px 16px; cursor: pointer;
}
.bt-radio-row:has(input:checked) { border-color: var(--bt-yellow); }
.bt-radio-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-radio-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bt-radio-border);
  flex-shrink: 0; margin-top: 1px; position: relative;
}
.bt-radio-row:has(input:checked) .bt-radio-dot { border-color: var(--bt-yellow); }
.bt-radio-row:has(input:checked) .bt-radio-dot::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--bt-yellow);
}
.bt-radio-label { font-size: 14px; font-weight: 700; }
.bt-radio-hint { display: block; font-size: 12px; font-weight: 400; color: var(--bt-muted); margin-top: 2px; }

.bt-settings-subhead { position: relative; z-index: 1; font-size: 15px; font-weight: 700; margin: 24px 0 4px; }
.bt-card { position: relative; z-index: 1; background: var(--bt-surface); border: 1px solid var(--bt-border); border-radius: var(--bt-r-md); padding: 16px; margin-top: 16px; }
.bt-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.bt-card .bt-subtitle { margin-bottom: 0; }

.bt-approved-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bt-divider); }
.bt-approved-row:last-of-type { border-bottom: none; }
.bt-approved-name { flex: 1; font-size: 14px; font-weight: 600; }
.bt-approved-countdown { font-size: 11px; color: var(--bt-muted); }
.bt-link-danger { background: none; border: none; color: var(--bt-red); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.bt-link-yellow { background: none; border: none; color: var(--bt-yellow); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; text-decoration: none; }
.bt-add-viewer { display: flex; gap: 8px; margin-top: 12px; }
.bt-add-viewer select { flex: 1; background: var(--bt-input-bg); border: 1px solid var(--bt-border); color: var(--bt-text); border-radius: var(--bt-r-sm); padding: 8px 10px; font-family: inherit; font-size: 13px; }
.bt-add-viewer button { background: var(--bt-yellow); color: var(--bt-on-yellow); border: none; border-radius: var(--bt-r-pill); padding: 8px 16px; font-weight: 700; cursor: pointer; font-size: 13px; }

.bt-live-status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bt-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.bt-live-status.is-online .bt-status-dot { background: var(--bt-green); box-shadow: 0 0 6px oklch(76% 0.19 145 / 0.6); }
.bt-live-status.is-offline .bt-status-dot { background: var(--bt-muted); }

/* Safety */
.bt-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.bt-toggle-label { font-size: 13px; font-weight: 600; }
.bt-toggle { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.bt-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bt-toggle-track { position: absolute; inset: 0; background: var(--bt-radio-border); border-radius: var(--bt-r-pill); transition: background .2s; }
.bt-toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--bt-shadow-knob); }
.bt-toggle input:checked ~ .bt-toggle-track { background: var(--bt-yellow); }
.bt-toggle input:checked ~ .bt-toggle-track .bt-toggle-knob { transform: translateX(20px); }

.bt-danger-pill {
  display: inline-block; background: var(--bt-red); color: #fff; border: none; border-radius: var(--bt-r-pill);
  padding: 11px 20px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; margin-top: 4px;
}
.bt-blocked-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bt-divider); }
.bt-blocked-row:last-of-type { border-bottom: none; }
.bt-blocked-name { flex: 1; font-size: 14px; font-weight: 600; }

.bt-empty-hint { position: relative; z-index: 1; color: var(--bt-muted); font-size: 13px; text-align: center; margin-top: 40px; }

/* Plain form fields inside the new theme (Profile edit form, etc.) */
.bt-app .bt-form { position: relative; z-index: 1; margin-top: 24px; text-align: left; }
.bt-app .bt-form label { display: block; margin: 14px 0 6px; font-size: 12px; color: var(--bt-muted); font-weight: 600; }
.bt-app .bt-form input,
.bt-app .bt-form select,
.bt-app .bt-form textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--bt-r-sm);
  border: 1px solid var(--bt-border); background: var(--bt-input-bg); color: var(--bt-text);
  font-size: 14px; font-family: inherit;
}
.bt-app .bt-form input:focus,
.bt-app .bt-form select:focus,
.bt-app .bt-form textarea:focus { outline: none; border-color: var(--bt-radio-border); }
.bt-app .bt-form button[type="submit"] { margin-top: 16px; width: 100%; justify-content: center; }
.bt-app .bt-error { color: var(--bt-red); font-size: 13px; position: relative; z-index: 1; }
.bt-app .bt-success { color: var(--bt-yellow); font-size: 13px; background: oklch(85% 0.2 95 / 0.08); border: 1px solid var(--bt-border); border-radius: var(--bt-r-sm); padding: 10px 12px; position: relative; z-index: 1; }

/* Motion */
@keyframes bt-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(80% 0.19 145 / 0.5); }
  50% { box-shadow: 0 0 0 6px oklch(80% 0.19 145 / 0); }
}
@keyframes bt-pop-in {
  from { opacity: 0; transform: scale(.85) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes bt-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bt-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 380px) {
  .bt-screen { padding-left: 16px; padding-right: 16px; }
  .bt-radar-dish { width: 250px; height: 250px; }
}

/* Feed: comments + photo lightbox */
.bt-comment-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bt-divider); }
.bt-comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.bt-comment-row { display: flex; align-items: flex-start; gap: 8px; }
.bt-comment-avatar { width: 26px; height: 26px; flex-shrink: 0; }
.bt-comment-body { background: var(--bt-input-bg); border-radius: var(--bt-r-sm); padding: 6px 10px; font-size: 13px; line-height: 1.4; }
.bt-comment-name { font-weight: 700; margin-right: 6px; }
.bt-comment-text { color: var(--bt-text); }
.bt-comment-form { display: flex; gap: 8px; }
.bt-comment-form input {
  flex: 1; background: var(--bt-input-bg); border: 1px solid var(--bt-border); color: var(--bt-text);
  border-radius: var(--bt-r-pill); padding: 8px 14px; font-size: 13px; font-family: inherit;
}
.bt-comment-form input:focus { outline: none; border-color: var(--bt-radio-border); }
.bt-comment-send {
  background: var(--bt-yellow); color: var(--bt-on-yellow); border: none; border-radius: var(--bt-r-pill);
  padding: 8px 16px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.bt-comment-send:disabled { opacity: .6; cursor: not-allowed; }

.bt-feed-photo { cursor: zoom-in; }
.bt-lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  cursor: zoom-out;
}
.bt-lightbox.hidden { display: none; }
.bt-lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--bt-r-md); }
