/* ─────────────────────────────────────────────────────────────
   ShukaHub redesign — Black, Orange, Gold (2026-06-04 v2)
   Brand-accurate dark theme with editorial typography.
   Pure visual layer, loaded after style.css.
   Disable: remove the <link> in index.html.
   ───────────────────────────────────────────────────────────── */

/* ═══ PALETTE & TOKENS ═════════════════════════════════════════ */
:root {
  --accent:           #E07A00;   /* brand orange (primary) */
  --accent2:          #f0891a;   /* lifted orange (gradient stop) */
  --accent-deep:      #c46a00;   /* dark orange (active) */
  --accent-glow:      rgba(224, 122, 0, 0.4);
  --gold:             #E07A00;   /* same as accent — no yellow detour */
  --gold-soft:        #f0891a;
  --gold-deep:        #c46a00;
  --gold-glint:       #f4a23a;   /* one subtle warm highlight tone */

  --bg1:              #050505;
  --bg2:              #000000;
  --panel:            #0e0e10;
  --panel2:           #16161a;

  --ink-deep:         #000000;
  --ink-mid:          #0a0a0c;

  --text:             #ffffff;
  --muted:            #9a9a9d;
  --muted-warm:       #b8a888;
  --line:             #1a1a1f;
  --hairline:         rgba(224, 122, 0, 0.10);
  --hairline-strong:  rgba(224, 122, 0, 0.22);

  --bubble-me-text:   #1a1100;
  --mention:          #1F85FF;   /* negative of #E07A00 orange */

  --shadow-sm:        0 4px 12px -4px rgba(0, 0, 0, 0.6);
  --shadow:           0 12px 32px -12px rgba(0, 0, 0, 0.75);
  --shadow-lg:        0 28px 70px -20px rgba(0, 0, 0, 0.9);
  --gold-glow-sm:     0 0 0 1px rgba(224, 122, 0, 0.18), 0 4px 14px -4px rgba(224, 122, 0, 0.35);
  --gold-glow:        0 0 0 1px rgba(224, 122, 0, 0.25), 0 10px 28px -8px rgba(224, 122, 0, 0.45);
  --inner-hi:         inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --font-display:     'Fraunces', 'Source Serif Pro', Georgia, serif;
  --font-body:        'Sora', system-ui, -apple-system, sans-serif;
  --font-mono:        'JetBrains Mono', ui-monospace, monospace;

  --ease-out:         cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:      cubic-bezier(0.65, 0, 0.35, 1);
}

/* ═══ GLOBAL TYPOGRAPHY ════════════════════════════════════════ */
*, *::before, *::after { font-family: var(--font-body); }
input, textarea, button, select { font-family: var(--font-body); }

/* ═══ BODY + BACKDROP ══════════════════════════════════════════ */
body {
  background:
    radial-gradient(ellipse 70vw 60vh at 15% -5%, rgba(224, 122, 0, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60vw 55vh at 100% 105%, rgba(224, 122, 0, 0.05) 0%, transparent 55%),
    linear-gradient(180deg, #050505 0%, #000000 100%);
  background-attachment: fixed;
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.005em;
}

body:not(.logged-in)::before {
  background:
    radial-gradient(ellipse 60vw 50vh at 20% 15%, rgba(224, 122, 0, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 50vw 45vh at 85% 90%, rgba(224, 122, 0, 0.09) 0%, transparent 55%);
  animation: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform: none;
}

/* Subtle grain — kept at low opacity, no blend mode so it doesn't dim overlays */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
}

/* ═══ AUTH SCREEN ══════════════════════════════════════════════ */
.auth-page {
  background:
    radial-gradient(ellipse 70vw 80vh at 80% 50%, rgba(224, 122, 0, 0.10) 0%, transparent 55%),
    #000000;
}

.auth-left {
  background:
    radial-gradient(ellipse at center, rgba(224, 122, 0, 0.16) 0%, transparent 65%),
    linear-gradient(160deg, #0c0c0e 0%, #000000 100%);
  border-right: 1px solid var(--hairline);
}

.auth-left::before,
.auth-left::after { display: none; }

.auth-brand-logo {
  filter: drop-shadow(0 4px 18px rgba(224, 122, 0, 0.32));
}

.auth-right {
  background: linear-gradient(180deg, #050505 0%, #000000 100%);
}

.auth-form-wrap { max-width: 380px; }

.auth-heading h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: 44px;
  font-variation-settings: 'opsz' 120;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-heading p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}

.auth-tabs {
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  border-radius: 0;
  padding: 0;
  gap: 0;
  margin-bottom: 24px;
}

.auth-tab {
  background: transparent !important;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  font-style: italic;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}

.auth-tab:hover { color: var(--gold); }

.auth-tab-active,
.auth-tab.auth-tab-active {
  color: var(--gold) !important;
  border-bottom-color: var(--accent) !important;
  background: transparent !important;
}

.auth-field { margin-bottom: 18px; }

.auth-field label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 8px;
  display: block;
}

input[type="text"], input[type="password"], input[type="email"], textarea,
.auth-field input {
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 10px !important;
  padding: 13px 16px !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-family: var(--font-body) !important;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

input::placeholder, textarea::placeholder {
  color: rgba(154, 154, 157, 0.6);
  font-style: italic;
  font-family: var(--font-display);
}

input:focus, textarea:focus,
.auth-field input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(224, 122, 0, 0.12) !important;
}

.auth-btn {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--accent) 100%);
  color: #1a1100;
  border: none;
  border-radius: 10px;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  box-shadow:
    0 10px 26px -6px rgba(224, 122, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 34px -8px rgba(224, 122, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.auth-btn:active { transform: translateY(0); }

.auth-forgot-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  margin-top: 14px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease-out);
}

.auth-forgot-btn:hover { color: var(--gold); }

.auth-remember {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.auth-msg {
  font-size: 13px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  min-height: 18px;
  margin-bottom: 6px;
}

.auth-left-footer a {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.auth-github-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  color: #ffffff;
}

.auth-github-btn:hover {
  background: rgba(224, 122, 0, 0.08);
  color: var(--gold);
  border-color: var(--accent);
}

/* ═══ TOPBAR ═══════════════════════════════════════════════════ */
.topbar {
  background: #000000;
  border-bottom: 1px solid var(--hairline);
  height: 64px;
  padding: 0 22px;
  z-index: 1500;
}

.logo-img {
  height: 44px;
  filter: drop-shadow(0 2px 10px rgba(224, 122, 0, 0.3));
}

.logo span {
  background: none;
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  padding: 0;
  letter-spacing: -0.01em;
}

.profileIcon {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 122, 0, 0.12), var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}

.profileIcon:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 5px rgba(224, 122, 0, 0.2), var(--shadow);
}

.gear-btn, #userSearchBtn { color: var(--accent); }
#userSearchBtn svg { color: var(--gold); }

.hamburger-btn {
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.hamburger-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(224, 122, 0, 0.06);
}

/* ═══ SIDEBAR ══════════════════════════════════════════════════ */
.sidebar {
  background: #000000;
  border-right: 1px solid var(--hairline);
  position: relative;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--accent-glow) 40%, var(--accent-glow) 60%, transparent 100%);
  opacity: 0.3;
  pointer-events: none;
}

.sidebar-header h3,
.sidebar h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.sidebar-divider {
  background: var(--hairline);
  height: 1px;
  margin: 14px 16px;
}

.sidebar-dots-btn,
.sidebar-tools-btn {
  color: var(--muted);
  background: transparent;
  border: none;
}

.sidebar-dots-btn:hover,
.sidebar-tools-btn:hover {
  color: var(--gold);
  background: rgba(224, 122, 0, 0.06);
}

.sidebar-btn {
  background: rgba(224, 122, 0, 0.08);
  border: 1px solid rgba(224, 122, 0, 0.28);
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 8px;
  padding: 8px 18px;
  display: block;
  width: fit-content;
  margin: 6px auto 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.sidebar-btn:hover {
  background: rgba(224, 122, 0, 0.16);
  border-color: var(--accent);
  color: var(--gold-soft);
}

/* Friend / group rows — gold bar on hover */
#friendsList > div,
#groupsList > div,
.friend-row,
.group-row {
  position: relative;
  padding: 10px 16px 10px 20px;
  border-radius: 0;
  transition: background 0.2s var(--ease-out);
  cursor: pointer;
}

#friendsList > div::before,
#groupsList > div::before,
.friend-row::before,
.group-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--gold) 0%, var(--accent) 100%);
  transform: translateY(-50%);
  transition: height 0.25s var(--ease-out);
  border-radius: 0 2px 2px 0;
}

#friendsList > div:hover,
#groupsList > div:hover,
.friend-row:hover,
.group-row:hover {
  background: rgba(224, 122, 0, 0.04);
}

#friendsList > div:hover::before,
#groupsList > div:hover::before,
.friend-row:hover::before,
.group-row:hover::before {
  height: 60%;
}

.friend-name {
  color: #ffffff;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.unread-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.friend-row img,
.group-icon {
  border: 1.5px solid var(--hairline);
  box-shadow: var(--shadow-sm);
}

/* ═══ CHAT CONTAINER + HEADER ══════════════════════════════════ */
.chatContainer { background-color: var(--ink-deep); }

.chatContainer::before {
  background:
    radial-gradient(ellipse 60vw 50vh at 50% 100%, rgba(224, 122, 0, 0.04) 0%, transparent 50%),
    rgba(0, 0, 0, 0.82);
}

/* Floating chat header — frameless, messages scroll behind it */
.chat-header {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 10px 18px !important;
  min-height: 0 !important;
  z-index: 9;
  pointer-events: none;
}

.chat-header > * { pointer-events: auto; }

#chatHeaderText {
  font-size: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.chatBox { padding-top: 52px !important; }

/* Extra darkening at top of chat — helps the floating title stay readable */
.chatContainer::before {
  background:
    radial-gradient(ellipse 60vw 50vh at 50% 100%, rgba(224, 122, 0, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.82) 90px, rgba(0, 0, 0, 0.82) 100%) !important;
}

/* Search button moved into friend's profile modal */
#chatSearchBtn { display: none !important; }

/* Hide hamburger on normal Android (valera keeps it). Swipe from left edge still opens drawer. */
body.capacitor-android:not(.valera-variant) .hamburger-btn { display: none !important; }

#chatHeaderText {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  font-variation-settings: 'opsz' 60;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.2s var(--ease-out);
}

.icon-btn:hover {
  color: var(--gold);
  border-color: var(--accent);
  background: rgba(224, 122, 0, 0.08);
}

.chat-placeholder {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--muted);
  letter-spacing: 0.01em;
  text-align: center;
  padding: 60px 20px;
}

/* ═══ MESSAGE BUBBLES — signature ═══════════════════════════════
   Your messages: gold-to-orange gradient with deep ink text.
   Other messages: pure black with subtle gold-tinted hairline.
   ───────────────────────────────────────────────────────────── */
.message {
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  padding: 11px 15px;
  border-radius: 14px;
  max-width: 70%;
  position: relative;
  font-weight: 400;
}

.message.me {
  background: var(--accent);
  color: var(--bubble-me-text);
  border: 1px solid var(--accent-deep);
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 22px -8px rgba(224, 122, 0, 0.4);
}

.message.other {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm), var(--inner-hi);
}

.message.me .msg-text-content,
.message.me .reply-chip,
.message.me a {
  color: var(--bubble-me-text);
}

.message.me .reply-chip {
  background: rgba(26, 17, 0, 0.10);
  border-left-color: rgba(26, 17, 0, 0.40);
  color: rgba(26, 17, 0, 0.75);
}

.message.me .msg-edited {
  color: rgba(26, 17, 0, 0.5);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  margin-left: 6px;
}

.message.other .msg-edited {
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  margin-left: 6px;
}

.sender-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 12px;
  color: var(--gold);
  padding-left: 42px;
  letter-spacing: 0.02em;
}

.chat-avatar {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.reply-chip {
  font-family: var(--font-body);
  background: rgba(224, 122, 0, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--muted);
  font-size: 11.5px;
  padding: 4px 8px;
  margin-bottom: 6px;
}

.message-row-wrapper { animation: msgIn 0.35s var(--ease-out) backwards; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ CHAT INPUT ═══════════════════════════════════════════════ */
/* Floating chat input — messages scroll *under* it, stay visible through */
.chatContainer { position: relative; }

.chatBox {
  padding-bottom: 84px !important;
}

.chat-footer {
  position: absolute !important;
  bottom: 0;
  left: 0;
  right: 0;
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 8px 16px 14px;
  z-index: 10;
  pointer-events: none;  /* let clicks pass through the empty footer area */
}

.chat-footer > * { pointer-events: auto; }  /* but the pill + buttons stay clickable */

.message-row {
  background: rgba(18, 18, 22, 0.22) !important;
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  border: none !important;
  outline: none !important;
  border-radius: 26px;
  padding: 6px 6px 6px 18px;
  box-shadow:
    0 14px 30px -14px rgba(0, 0, 0, 0.55) !important;
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.message-row:focus-within {
  background: rgba(18, 18, 22, 0.32) !important;
  transform: translateY(-2px);
  border: none !important;
  outline: none !important;
  box-shadow:
    0 18px 40px -14px rgba(0, 0, 0, 0.7) !important;
}

/* Fade-out gradient above the floating input — visually separates without hiding */
.chatContainer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
  z-index: 8;
}

.message-row #messageInput,
.message-row input,
.message-row textarea {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 14.5px;
  padding: 8px 4px !important;
  font-family: var(--font-body) !important;
}

.message-row #messageInput::placeholder,
.message-row input::placeholder {
  color: rgba(154, 154, 157, 0.55);
  font-style: italic;
  font-family: var(--font-display);
}

.send-btn {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--accent) 100%) !important;
  color: #1a1100 !important;
  border: none !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow:
    0 6px 16px -4px rgba(224, 122, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow:
    0 10px 24px -4px rgba(224, 122, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.message-row .img-pick-btn,
.message-row button[type="button"]:not(.send-btn) {
  color: var(--muted);
  background: transparent;
  border: none;
  transition: color 0.2s var(--ease-out);
}

.message-row .img-pick-btn:hover { color: var(--gold); }

/* ═══ OVERLAYS — ensure modals and settings fully cover chat ═══ */
.modal-overlay {
  background: rgba(0, 0, 0, 0.88) !important;
  backdrop-filter: blur(14px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  z-index: 5000 !important;
}

.settings-overlay {
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(12px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  z-index: 9000 !important;
}

.modal-box {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%) !important;
  border: 1px solid var(--hairline-strong);
  border-radius: 18px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(224, 122, 0, 0.08),
    var(--inner-hi);
  padding: 28px;
  position: relative;
}

.modal-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-glow) 50%, transparent 100%);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}

.lightbox-close {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.lightbox-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.profile-modal-name,
#groupModalName {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  font-variation-settings: 'opsz' 80;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.profile-modal-bio,
#groupModalDesc {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ═══ SETTINGS MENU (must clearly sit above chat) ══════════════ */
.profileMenu {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%) !important;
  border: 1px solid var(--hairline-strong) !important;
  border-radius: 16px;
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(224, 122, 0, 0.10),
    var(--inner-hi);
  z-index: 9500 !important;
  position: absolute;
}

.menu-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  color: var(--gold);
  letter-spacing: -0.01em;
}

.menu-label {
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.settings-tab {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 6px;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.settings-tab.active {
  color: var(--gold);
  border-bottom-color: var(--accent);
  background: transparent;
}

.settings-tabs {
  border-bottom: 1px solid var(--hairline);
  gap: 6px;
}

.settings-section-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-bottom: 8px;
}

.settings-profile-header {
  background: rgba(224, 122, 0, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s var(--ease-out);
}

.settings-profile-header:hover {
  background: rgba(224, 122, 0, 0.07);
  border-color: rgba(224, 122, 0, 0.4);
}

.settings-profile-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: #ffffff;
}

.settings-profile-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Toggles */
.toggle-on,
[class*="toggle"][class*="-on"] {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--accent) 100%) !important;
  color: #1a1100 !important;
  border-color: var(--accent) !important;
}

/* Search dropdown menus (search users, profile menu) — also sit above chat */
.search-menu,
#userSearchMenu,
#toolsMenu {
  z-index: 9500 !important;
}

/* ═══ GROUP LEAVE BUTTON ═══════════════════════════════════════ */
.group-modal-icon {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(224, 122, 0, 0.12);
}

.group-leave-btn {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ═══ PINNED MSG BANNER ════════════════════════════════════════ */
.pinned-msg-banner {
  background: linear-gradient(90deg, rgba(224, 122, 0, 0.10) 0%, rgba(224, 122, 0, 0.04) 100%);
  border-bottom: 1px solid rgba(224, 122, 0, 0.25);
  color: var(--gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* ═══ WALLPAPER PICKER ═════════════════════════════════════════ */
.wallpaper-picker {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%) !important;
  border: 1px solid var(--hairline-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 9400 !important;
}

.wallpaper-picker-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--gold);
}

.wallpaper-swatch {
  border-radius: 8px;
  border: 2px solid var(--hairline);
}

.wallpaper-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 122, 0, 0.2);
}

.wallpaper-remove-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
}

.wallpaper-remove-btn:hover {
  background: rgba(224, 122, 0, 0.06);
  color: var(--gold);
}

/* ═══ REACTIONS ════════════════════════════════════════════════ */
.reaction-picker {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%);
  border: 1px solid var(--hairline-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 4px 6px;
}

.reaction-picker-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.reaction-picker-btn:hover {
  background: rgba(224, 122, 0, 0.14);
  transform: scale(1.18);
}

/* ═══ FILE CHIPS ═══════════════════════════════════════════════ */
.file-chip {
  background: rgba(224, 122, 0, 0.06);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}

.message.me .file-chip {
  background: rgba(26, 17, 0, 0.12);
  border-color: rgba(26, 17, 0, 0.25);
}

.file-chip-icon { color: var(--accent); }
.message.me .file-chip-icon { color: #1a1100; }

.file-chip-name {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.file-chip-dl {
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}

.message.me .file-chip-dl { color: #1a1100; }
.file-chip-dl:hover { transform: translateY(2px); }

/* ═══ SEARCH RESULTS ═══════════════════════════════════════════ */
.search-result-name {
  font-weight: 500;
  color: #ffffff;
  font-size: 14px;
}

.search-result-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.search-add-btn {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--accent) 100%);
  border: none;
  color: #1a1100;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}

.search-add-btn:hover { transform: translateY(-1px); }

/* ═══ CHAT SEARCH BAR ══════════════════════════════════════════ */
.chat-search-bar {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 18px;
}

.chat-search-bar input {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid var(--hairline) !important;
  color: #ffffff !important;
  font-size: 13px !important;
}

.chat-search-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* ═══ MESSAGE STATUS / TIMESTAMP ═══════════════════════════════ */
.msg-status,
.message-time,
.msg-time {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* ═══ SCROLLBARS ═══════════════════════════════════════════════ */
.chatBox::-webkit-scrollbar { width: 6px; }
.chatBox::-webkit-scrollbar-track { background: transparent; }
.chatBox::-webkit-scrollbar-thumb {
  background: rgba(224, 122, 0, 0.14);
  border-radius: 3px;
}
.chatBox::-webkit-scrollbar-thumb:hover { background: rgba(224, 122, 0, 0.4); }

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(224, 122, 0, 0.10);
  border-radius: 3px;
}

/* ═══ MENTIONS ═════════════════════════════════════════════════ */
.mention,
.msg-text-content a {
  color: var(--mention);
  text-decoration: none;
  border-bottom: 1px dotted var(--mention);
}

.message.me .mention {
  color: #0F4FAA;
  border-bottom-color: rgba(15, 79, 170, 0.5);
}

.message.me a {
  color: #4a2f00;
  border-bottom-color: rgba(74, 47, 0, 0.5);
}

/* ═══ NOTIFICATIONS ════════════════════════════════════════════ */
.in-app-notification,
[class*="notification"][class*="toast"] {
  background: linear-gradient(180deg, #0e0e10 0%, #050505 100%);
  border: 1px solid rgba(224, 122, 0, 0.35);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-family: var(--font-body);
}

/* ═══ PAGE LOAD ANIMATIONS ═════════════════════════════════════ */
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-heading {
  animation: pageReveal 0.7s var(--ease-out) backwards;
  animation-delay: 0.05s;
}

.auth-field:nth-of-type(1) { animation: pageReveal 0.6s var(--ease-out) backwards; animation-delay: 0.15s; }
.auth-field:nth-of-type(2) { animation: pageReveal 0.6s var(--ease-out) backwards; animation-delay: 0.22s; }
.auth-remember, .auth-msg  { animation: pageReveal 0.6s var(--ease-out) backwards; animation-delay: 0.30s; }
.auth-btn                  { animation: pageReveal 0.6s var(--ease-out) backwards; animation-delay: 0.35s; }
.auth-forgot-btn           { animation: pageReveal 0.6s var(--ease-out) backwards; animation-delay: 0.42s; }

/* ═══ LIGHT MODE (lightly tuned) ═══════════════════════════════ */
body.light-mode {
  --bg1: #faf6ed;
  --bg2: #f0e9d8;
  --panel: #ffffff;
  --panel2: #fbf6ea;
  --text: #0a0a0c;
  --muted: #6a5d4b;
  --line: #e8dcc4;
  --hairline: rgba(0, 0, 0, 0.08);
  background:
    radial-gradient(ellipse 80vw 60vh at 10% -10%, rgba(224, 122, 0, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #faf6ed 0%, #f0e9d8 100%);
}

body.light-mode .chatContainer { background-color: #faf6ed; }
body.light-mode .chatContainer::before { background: rgba(255, 252, 245, 0.55); }
body.light-mode .sidebar { background: #ffffff; border-right: 1px solid var(--hairline); }
body.light-mode .topbar { background: #ffffff; border-bottom: 1px solid var(--hairline); }
body.light-mode .modal-box { background: #ffffff !important; }
body.light-mode .profileMenu { background: #ffffff !important; }
body.light-mode .message.other {
  background: #ffffff;
  color: #0a0a0c;
  border: 1px solid var(--hairline);
}

/* ═══ MOBILE TUNING ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .auth-heading h1 { font-size: 34px; }
  #chatHeaderText { font-size: 17px; }
  .message { max-width: 82%; font-size: 14px; }
}
