/* =============================================
   YID PLUS — style.css  (Light Mode)  v202609161100
   ============================================= */

/* ---------- RESET & TOKENS ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Brand accent — emerald-teal, single accent used sparingly */
  --gold:    #1F6F5C;
  --gold-l:  #2B8A73;
  --gold-d:  #14503F;

  /* Backgrounds — warm off-white, not stark #fff */
  --bg:      #FAFAF8;
  --bg2:     #F1F0ED;
  --bg3:     #EAE8E3;
  --bg4:     #DDDAD3;
  --surface: #FFFFFF;
  --surface-2: #F1F0ED;

  /* Borders — thin, low-contrast */
  --border:  rgba(20, 21, 26, 0.08);
  --border2: rgba(20, 21, 26, 0.16);
  --line:    rgba(20, 21, 26, 0.08);

  /* Text */
  --text:    #14151A;
  --muted:   #6E7280;
  --muted2:  #9497A3;

  /* Status colors */
  --red:     #D32F2F;
  --green:   #2E7D32;
  --blue:    #1F6F5C;
  --accent:  #1F6F5C;
  --accent-l:#2B8A73;
  --accent-d:#14503F;

  /* Radius scale — consistent squircle system */
  --r-sm:    12px;
  --r-md:    16px;
  --r-lg:    20px;

  /* Elevation scale — soft, layered shadows (Telegram/Google-style depth) */
  --shadow-xs: 0 1px 2px rgba(20,21,26,.05);
  --shadow-sm: 0 2px 8px rgba(20,21,26,.07);
  --shadow-md: 0 4px 16px rgba(20,21,26,.10);
  --shadow-lg: 0 10px 32px rgba(20,21,26,.16);

  /* Standard easing for interactive motion */
  --ease-standard: cubic-bezier(.2,.8,.2,1);
  --ease-spring:   cubic-bezier(.34,1.56,.64,1);

  /* Instagram-style gradient accent, used sparingly (story rings, live badges) */
  --gradient-story: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);

  /* Material 3 tonal elevation — accent-tinted surfaces for depth */
  --m3-surface-1: rgba(31,111,92,.04);
  --m3-surface-2: rgba(31,111,92,.07);
  --m3-surface-3: rgba(31,111,92,.10);
}
html.dark-mode {
  --shadow-xs: 0 1px 2px rgba(0,0,0,.24);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 4px 18px rgba(0,0,0,.38);
  --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
}

/* ── DARK MODE (toggled via class="dark-mode" on <html>) ── */
html.dark-mode {
  --bg:      #121314;
  --bg2:     #1B1C1E;
  --bg3:     #232427;
  --bg4:     #2C2D31;
  --surface: #1B1C1E;
  --surface-2: #232427;
  --border:  rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.16);
  --line:    rgba(255, 255, 255, 0.08);
  --text:    #EDEDEC;
  --muted:   #9A9DA6;
  --muted2:  #6B6E78;
}
html.dark-mode {
  --m3-surface-1: rgba(46,158,130,.06);
  --m3-surface-2: rgba(46,158,130,.10);
  --m3-surface-3: rgba(46,158,130,.14);
}
html.dark-mode .read-ticks  { color: #3EBFA1; }
html.dark-mode .tg-chat-bg  { background-color: #121314; background-image: none; }
html.dark-mode .scroll-area { scrollbar-color: rgba(255,255,255,.12) transparent; }
html.dark-mode .scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Heebo', 'Rubik', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  animation: yp-fadein .2s ease both;
}

::selection { background: rgba(31,111,92,.18); color: inherit; }

/* Display face — headings, brand mark, big numbers. Used sparingly. */
.font-display, .topbar-logo, .settings-section-title {
  font-family: 'Rubik', 'Heebo', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Utility face — timestamps, counters, numeric data */
.font-mono {
  font-family: 'IBM Plex Mono', monospace;
}
@keyframes yp-fadein { from { opacity: 0; } to { opacity: 1; } }

/* Night mode OFF in light theme */
body.night {
  --bg:   #FFFFFF;
  --bg2:  #F5F5F5;
  --bg3:  #EBEBEB;
  --text: #000000;
}

/* ---------- SCREEN SYSTEM ---------- */
.screen {
  position: fixed;
  inset: 0;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  display: none;
}
.screen.active {
  display: flex;
  animation: yp-screen-in .2s ease both;
}
@keyframes yp-screen-in { from { opacity: .35; } to { opacity: 1; } }
.screen.prev {
  display: none;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.scroll-area::-webkit-scrollbar       { width: 4px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ---------- TOPBAR ---------- */
.topbar {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  padding: .85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: none;
  position: relative;
  z-index: 20;
}
.topbar-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar-icons { display: flex; gap: .5rem; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: background .18s var(--ease-standard), transform .12s var(--ease-standard);
  position: relative;
  color: var(--text);
}
.icon-btn:hover  { background: var(--bg4); }
.icon-btn:active { transform: scale(.88); }

.badge {
  position: absolute; top: -2px; inset-inline-end: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--red);
  font-size: .55rem; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #fff;
}

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: .7rem 0 max(.7rem, env(safe-area-inset-bottom));
  flex-shrink: 0;
  box-shadow: 0 -1px 0 rgba(0,0,0,.02);
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: .2rem;
  cursor: pointer;
  padding: .25rem .5rem;
  flex: 1;
  border: none; background: none;
  font-family: inherit;
  transition: transform .15s var(--ease-standard);
}
.nav-item:hover  { color: var(--text); }
.nav-item:hover .nav-icon { background: var(--bg3); }
.nav-item:active { transform: scale(.9); }
.nav-item { color: var(--muted); }
.nav-item.active { color: var(--accent); }
.nav-icon  {
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 30px; border-radius: 16px;
  transition: background .25s var(--ease-spring), transform .25s var(--ease-spring);
}
.nav-label { font-size: .66rem; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav-item.active .nav-label  { color: var(--accent); font-weight: 700; }
.nav-item.active .nav-icon   { background: rgba(31,111,92,.12); transform: scale(1.06); }
/* Material Symbols used as bottom-nav icons: size to match the old 22px SVGs,
   inherit the nav item's colour, and fill in on the active tab. */
.nav-icon .material-symbols-rounded { font-size: 24px; line-height: 1; color: inherit; }
.nav-item.active .nav-icon .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; color: var(--accent); }

/* ══════════ Install-as-app banner (PWA) ══════════ */
.pwa-install-banner {
  position: fixed; left: 0; right: 0; margin: 0 auto;
  width: calc(100% - 24px); max-width: 460px;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  z-index: 400; display: flex; align-items: center; gap: .7rem;
  background: var(--bg2, #fff); color: var(--text, #12201C);
  border: 1px solid var(--border, #E6ECEA); border-radius: 16px;
  padding: .7rem .8rem; box-shadow: 0 10px 34px rgba(0,0,0,.20);
  transform: translateY(160%); opacity: 0; pointer-events: none;
  transition: transform .38s cubic-bezier(.22,1,.36,1), opacity .38s;
}
.pwa-install-banner.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.pwa-ib-icon { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; }
.pwa-ib-body { flex: 1; min-width: 0; }
.pwa-ib-title { font-size: .9rem; font-weight: 800; }
.pwa-ib-sub { font-size: .72rem; color: var(--muted, #7A8A85); margin-top: .12rem; line-height: 1.35; }
.pwa-ib-cta {
  flex-shrink: 0; background: var(--accent, #1F6F5C); color: #fff; border: none;
  border-radius: 10px; padding: .52rem .95rem; font-weight: 700; font-size: .82rem;
  cursor: pointer; font-family: inherit;
}
.pwa-ib-close {
  flex-shrink: 0; background: none; border: none; color: var(--muted, #7A8A85);
  cursor: pointer; font-size: 1.15rem; line-height: 1; padding: .2rem .3rem;
  display: flex; align-items: center;
}

/* ══════════ Accessibility polish ══════════ */
/* A visible focus ring for keyboard users only (mouse clicks never show it),
   so the app is navigable by keyboard without adding an outline for everyone. */
:focus-visible {
  outline: 2px solid var(--accent, #1F6F5C);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Respect the OS "reduce motion" setting — ease off animations/transitions for
   users who get motion sick or simply prefer calm. Durations are kept tiny
   rather than zero so any transitionend-driven logic still fires. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- FORM FIELDS ---------- */
.field {
  width: 100%;
  padding: .95rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border .2s, box-shadow .2s;
  margin-bottom: .85rem;
  display: block;
}
.field:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,111,92,.14);
}
.field::placeholder { color: var(--muted2); }

/* ---------- PRIMARY BUTTON ---------- */
.btn-primary {
  width: 100%;
  padding: .9rem;
  background: linear-gradient(135deg, var(--accent-l), var(--accent));
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px;
  transition: transform .12s, box-shadow .2s, opacity .2s;
  box-shadow: 0 2px 10px rgba(31,111,92,.28);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(31,111,92,.36); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- LOADING DOTS ---------- */
.loading-dots { display: none; gap: 4px; align-items: center; }
.loading-dots span {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: ldot .9s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ldot {
  0%,80%,100% { transform: scale(.6); opacity: .5; }
  40%          { transform: scale(1);  opacity: 1;  }
}

/* ---------- TOGGLE SWITCH ---------- */
.toggle-sw {
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  position: relative;
  cursor: pointer;
  transition: background .25s;
  flex-shrink: 0;
}
.toggle-sw.on { background: var(--accent); border-color: var(--accent); }
.toggle-sw::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px; inset-inline-start: 2px;
  transition: all .22s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-sw.on::after { inset-inline-start: 20px; background: #fff; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 550;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-standard);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  width: 100%; max-width: 500px;
  transform: translateY(100%);
  transition: transform .3s var(--ease-standard);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-title { font-size: .95rem; font-weight: 700; margin-bottom: 1.25rem; text-align: center; color: var(--text); }
.modal-cancel {
  width: 100%; padding: .65rem;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer; font-family: inherit;
  margin-top: .5rem;
}
.modal-cancel:hover { background: var(--bg3); }

/* ---------- SECTION HEADER ---------- */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem .85rem .6rem;
}
.section-hdr h2 { font-size: .88rem; letter-spacing: .04em; color: var(--text); }
.see-all { font-size: .73rem; color: var(--blue); cursor: pointer; border: none; background: none; font-family: inherit; font-weight: 600; }

/* ---------- H-SCROLL ---------- */
.h-scroll { display: flex; gap: .75rem; overflow-x: auto; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }

/* ---------- TOAST (see end-of-file colored variants) ---------- */

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes floatUp { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes hburst  { 0% { opacity:1; transform: translate(-50%,-50%) scale(.5); } 40% { opacity:1; transform: translate(-50%,-50%) scale(1.4); } 100% { opacity:0; transform: translate(-50%,-60%) scale(1.6); } }
@keyframes pbanim  { 0%,100% { height: 4px; } 50% { height: 14px; } }
@keyframes tdot    { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes barRun  { from { width: 0; } to { width: 100%; } }
@keyframes lpulse  { 0%,100% { opacity:1; transform: scale(1); } 50% { opacity:.5; transform: scale(.8); } }

/* ---------- SPLASH / LOADING OVERLAY ---------- */
@keyframes splashLogoIn { 0% { opacity:0; transform: scale(.7); } 100% { opacity:1; transform: scale(1); } }
@keyframes splashWordIn { 0% { opacity:0; transform: translateY(10px); } 100% { opacity:1; transform: translateY(0); } }
@keyframes splashDot    { 0%,80%,100% { transform: translateY(0); opacity:.4; } 40% { transform: translateY(-6px); opacity:1; } }
.splash-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: .9rem;
}
.splash-overlay.show { display: flex; }
.splash-mark { animation: splashLogoIn .5s cubic-bezier(.2,.9,.3,1.3) both; }
.splash-logo { height: 92px; width: auto; object-fit: contain; }
.splash-logo-text { display: none; font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.splash-word { display: none; }
.splash-dots { display: flex; gap: 6px; margin-top: .3rem; animation: splashWordIn .5s ease .25s both; }
.splash-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: splashDot 1.1s ease-in-out infinite; }
.splash-dots span:nth-child(2) { animation-delay: .15s; }
.splash-dots span:nth-child(3) { animation-delay: .3s; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- FEED STATES ---------- */
.feed-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 1rem; gap: .75rem;
  color: var(--muted); text-align: center;
}
.feed-retry {
  padding: .5rem 1.25rem;
  background: var(--text); color: var(--bg);
  border: none; border-radius: 8px;
  font-size: .8rem; cursor: pointer;
  font-family: inherit; margin-top: .25rem;
}

/* =============================================
   AUTH SCREEN
   ============================================= */
#screen-auth { justify-content: center; align-items: center; padding: 1.5rem; overflow-y: auto; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.25rem 2rem;
  width: 100%; max-width: 400px;
  animation: fadeIn .7s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.auth-tabs { display: flex; background: var(--bg3); border-radius: 10px; padding: 3px; margin-bottom: 1.75rem; }
.auth-tab  {
  flex: 1; padding: .5rem; text-align: center; font-size: .82rem;
  border-radius: 8px; cursor: pointer; color: var(--muted);
  border: none; background: transparent; font-family: inherit; transition: all .25s;
}
.auth-tab.active { background: var(--surface); color: var(--text); border: 1px solid var(--border); font-weight: 700; }

.auth-msg { padding: .65rem 1rem; border-radius: 8px; font-size: .82rem; margin-bottom: 1rem; display: none; align-items: center; gap: .5rem; }
.auth-msg.err { background: rgba(211,47,47,.08); border: 1px solid var(--red);   color: var(--red);   display: flex; }
.auth-msg.ok  { background: rgba(46,125,50,.08); border: 1px solid var(--green); color: var(--green); display: flex; }

.auth-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: .65rem; padding: .7rem; background: #fff; border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer; font-family: inherit; font-size: .88rem;
  font-weight: 600; color: var(--text); margin-bottom: 1rem;
  transition: background .15s, box-shadow .15s;
}
.auth-google-btn:hover { background: var(--bg2); box-shadow: var(--shadow-sm); }
.auth-google-btn:active { transform: scale(.98); }
html.dark-mode .auth-google-btn { background: var(--bg3); color: var(--text); }

.auth-divider {
  display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-divider-text { font-size: .75rem; color: var(--muted); }

.auth-logo-wrap {
  margin: auto; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem 1.5rem;
}
.auth-logo-img {
  height: 64px; width: auto; object-fit: contain;
  border-radius: 16px; margin-bottom: .75rem;
}
.auth-logo-fallback {
  display: none; font-size: 2.2rem; font-weight: 800;
  letter-spacing: -.02em; color: var(--text); margin-bottom: .75rem;
}
.auth-logo-fallback span { color: var(--blue); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* =============================================
   HOME SCREEN
   ============================================= */
.status-item { display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: pointer; flex-shrink: 0; width: 62px; transition: transform .15s var(--ease-spring); }
.status-item:active { transform: scale(.94); }
.status-ring { width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--green,#25D366); padding: 2px; position: relative; }
.status-ring.viewed { border-color: var(--muted); opacity: .7; }
.status-ring.mine   { border-color: var(--blue); }
.status-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg3); border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; overflow: hidden;
}
.status-plus {
  position: absolute; bottom: -1px; inset-inline-end: -1px;
  width: 20px; height: 20px;
  background: var(--blue); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.status-name { font-size: .62rem; color: var(--muted); max-width: 62px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ads */
.ad-frame { width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); position: relative; cursor: pointer; background: var(--bg3); }
.ad-slide  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; padding: 1.5rem; opacity: 0; transition: opacity .6s ease; }
.ad-slide.active { opacity: 1; }
.ad-badge  { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 20px; background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
#ad-prog   { position: absolute; bottom: 0; inset-inline-start: 0; height: 2px; background: var(--text); }
.ad-dot    { width: 6px; height: 6px; border-radius: 50%; background: var(--muted2); transition: all .3s; }
.ad-dot.active { background: var(--text); width: 16px; border-radius: 3px; }

/* Short previews */
.short-prev {
  flex-shrink: 0; width: 110px; height: 185px;
  border-radius: 12px; background: var(--bg3);
  border: 1px solid var(--border); overflow: hidden; position: relative; cursor: pointer;
  transition: transform .15s var(--ease-spring);
}
.short-prev:active { transform: scale(.95); }

/* Channel previews */
.ch-prev-card {
  flex-shrink: 0; width: 130px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: .9rem .75rem; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s, transform .15s var(--ease-spring);
}
.ch-prev-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.ch-prev-card:active { transform: scale(.96); }

.follow-pill {
  margin-top: .5rem; width: 100%; padding: .3rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: .7rem;
  cursor: pointer; font-family: inherit; transition: all .2s;
}
.follow-pill.following { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Feed posts */
.feed-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 1rem; overflow: hidden; box-shadow: none; transition: box-shadow .2s, border-color .2s; }
.feed-post:hover { border-color: var(--border2); box-shadow: var(--shadow-xs); }
.post-media { background: var(--bg3); line-height: 0; }
.post-emoji-big { padding: 2rem 1rem; text-align: center; font-size: 4rem; background: var(--bg2); }
.post-caption { padding: .35rem .85rem .7rem; font-size: .9rem; color: var(--text); line-height: 1.5; unicode-bidi: plaintext; word-break: break-word; }
.post-caption-big { font-size: 1.15rem; font-weight: 500; padding: .5rem .85rem 1rem; }
.post-thumb { height: 160px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 4rem; cursor: pointer; position: relative; }
.post-play  { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.post-action { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); cursor: pointer; border: none; background: none; font-family: inherit; transition: color .2s; }
.post-action:hover { color: var(--text); }
.post-action.liked { color: var(--red); }

/* Status viewer */
.sv-overlay { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.85); display: none; flex-direction: column; }
.sv-overlay.open { display: flex; }
.sv-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding: 1rem 1rem 0; }
.sv-bars   { display: flex; gap: 3px; margin-bottom: .75rem; }
.sv-bar    { flex: 1; height: 2.5px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.sv-bar-fill { height: 100%; background: #fff; width: 0; }
.sv-bar-fill.done    { width: 100%; }
.sv-bar-fill.running { animation: barRun 5s linear forwards; }
.sv-ctrl   { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); border: none; color: #fff; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sv-slide  { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; padding: 5rem 1.5rem; text-align: center; transition: opacity .15s; }

/* =============================================
   SHORTS SCREEN
   ============================================= */
#screen-shorts { background: #111; }
.swipe-cont { height: 100vh; height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.swipe-cont::-webkit-scrollbar { display: none; }
.short-slide { height: 100vh; height: 100dvh; width: 100%; position: relative; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; flex-shrink: 0; }
.slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.slide-bg    { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8rem; filter: blur(30px); opacity: .3; transform: scale(1.2); pointer-events: none; }
.slide-center { font-size: 6rem; z-index: 1; animation: floatUp 3s ease-in-out infinite; pointer-events: none; }
.slide-grad  { position: absolute; bottom: 0; left: 0; right: 0; height: 38%; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.25) 55%, transparent); pointer-events: none; z-index: 2; }
.slide-info  { position: absolute; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 0; inset-inline-end: 80px; padding: 0 1rem; z-index: 3; }
.slide-actions { position: absolute; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); inset-inline-end: .75rem; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.s-action    { display: flex; flex-direction: column; align-items: center; gap: .2rem; cursor: pointer; }
.s-icon      { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(6px); border: .5px solid rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.s-action.liked .s-icon { background: rgba(211,47,47,.3); border-color: #ef5350; }
.s-count     { font-size: .68rem; color: rgba(255,255,255,.95); text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.short-cmt-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: #E53935; color: #fff; font-size: .6rem; font-weight: 700; line-height: 18px; text-align: center; border: 1.5px solid rgba(0,0,0,.25); box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* Auto-hiding scrub bar — sits at the very bottom of the slide, fades in
   while the video is playing/being scrubbed, fades out after a few
   seconds of inactivity (YouTube Shorts style). */
.scrub-wrap   { position: absolute; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); height: 18px; z-index: 45; display: flex; align-items: center; padding: 0 12px; opacity: 1; transition: opacity .25s; touch-action: none; }
.scrub-wrap.show { opacity: 1; }
.scrub-track  { position: relative; flex: 1; height: 5px; border-radius: 3px; background: rgba(0,0,0,.4); box-shadow: 0 0 0 .5px rgba(255,255,255,.25), 0 1px 3px rgba(0,0,0,.4); cursor: pointer; }
.scrub-fill   { position: absolute; top: 0; left: 0; height: 100%; border-radius: 3px; background: #fff; width: 0%; }
.scrub-handle { position: absolute; top: 50%; width: 15px; height: 15px; border-radius: 50%; background: #fff; transform: translate(-50%,-50%); left: 0%; border: 2px solid rgba(0,0,0,.35); box-shadow: 0 1px 5px rgba(0,0,0,.5); }

/* Brief center play/pause flash — shows for an instant then fades, never
   stays on screen (YouTube Shorts style), replacing the old persistent ⏸. */
.center-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.7); width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; color: #fff; }
.center-flash.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }

.view-count   { display: flex; align-items: center; gap: .3rem; font-size: .68rem; color: rgba(255,255,255,.85); margin-top: .15rem; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.heart-burst { position: absolute; font-size: 4rem; pointer-events: none; z-index: 10; animation: hburst .8s ease forwards; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.cmt-drawer  { position: fixed; bottom: 0; left: 0; right: 0; z-index: 80; height: 65vh; background: var(--bg); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .35s cubic-bezier(.32,.72,0,1); display: flex; flex-direction: column; box-shadow: 0 -4px 32px rgba(0,0,0,.6); }
.cmt-drawer.open { transform: translateY(0); }
.drawer-handle { width: 36px; height: 3px; background: var(--border); border-radius: 2px; margin: .75rem auto 0; }.cmt-input-el { flex: 1; padding: .55rem 1rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: .85rem; font-family: inherit; outline: none; }


/* =============================================
   CHAT SCREENS
   ============================================= */
.chat-search-wrap { padding: .6rem 1rem; background: var(--bg2); flex-shrink: 0; position: relative; }
.chat-search-input { width: 100%; padding: .55rem 1rem .55rem 2.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: .85rem; font-family: inherit; outline: none; }
.chat-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,92,.12); }

.chat-tabs-row { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.ctab { flex: 1; padding: .65rem; text-align: center; font-size: .78rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.ctab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 700; }

.online-dot  { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2.5px solid var(--surface); }
.unread-badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--blue); color: #fff; font-size: .66rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(31,111,92,.35); }

/* Chat room */
.room-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: .6rem 1rem; display: flex; align-items: center; gap: .6rem; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.join-banner-room { background: rgba(255,235,59,.12); border-top: 1px solid rgba(255,224,130,.5); padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.join-group-btn   { padding: .4rem 1rem; background: var(--text); border: none; border-radius: 8px; color: var(--bg); font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit; }

.reply-bar { background: var(--surface); border-top: 1px solid var(--border); padding: .4rem .75rem; display: flex; align-items: center; gap: .55rem; flex-shrink: 0; cursor: pointer; }
.reply-bar-icon { color: var(--accent, #1F6F5C); flex-shrink: 0; }
.reply-bar-body { flex: 1; min-width: 0; border-inline-start: 2px solid var(--accent, #1F6F5C); padding-inline-start: .55rem; display: flex; flex-direction: column; overflow: hidden; }
.reply-bar-body strong { color: var(--accent, #1F6F5C); font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.reply-bar-body #reply-snip { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.reply-bar button { background: none; border: none; color: var(--muted); cursor: pointer; padding: .3rem; flex-shrink: 0; display: flex; align-items: center; }

.chat-msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .75rem; background: var(--bg2); scrollbar-width: thin; }
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px; }

.msg-wrap    { display: flex; margin-bottom: .4rem; align-items: flex-end; gap: .4rem; animation: msgIn .22s var(--ease-standard) both; }
.msg-wrap.me { flex-direction: row-reverse; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.msg-mini-av { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700; color: #fff; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.18); background-size: cover; background-position: center; }

.bubble      { max-width: 80%; padding: .5rem .8rem; border-radius: 18px; font-size: 1rem; line-height: 1.4; word-break: keep-all; overflow-wrap: break-word; white-space: pre-wrap; word-spacing: normal; position: relative; touch-action: pan-y; transition: transform .12s var(--ease-standard); }
/* Floating heart when you double-tap a message to react. */
.tap-heart { position: fixed; transform: translate(-50%, -50%); font-size: 2rem; pointer-events: none; z-index: 100090; animation: tapHeartPop .75s ease-out forwards; will-change: transform, opacity; }
@keyframes tapHeartPop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 50% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -150%) scale(.9); } }
.swipe-reply-icon { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.swipe-reply-icon.sri-me   { inset-inline-end: -40px; }
.swipe-reply-icon.sri-them { inset-inline-end: -40px; }
.bubble.me   { background: #E7FBD5; color: #12241d; border-end-end-radius: 5px; box-shadow: 0 1px 1.5px rgba(0,0,0,.08); }
.bubble.them { background: var(--surface); color: var(--text); border: none; border-end-start-radius: 5px; box-shadow: 0 1px 1.5px rgba(0,0,0,.1); }
.bubble.sticker { background: transparent !important; border: none !important; box-shadow: none !important; font-size: 3.5rem; padding: .25rem !important; }
.bubble.bubble-emoji { background: transparent !important; box-shadow: none !important; padding: .1rem .2rem !important; font-size: 2.6rem; line-height: 1.15; }
.bubble.bubble-emoji .bubble-meta { justify-content: flex-end; }
.bubble.bubble-emoji.them .bubble-time { color: var(--muted); }
html.dark-mode .bubble.them { background: var(--bg3); color: var(--text); }
html.dark-mode .bubble.me   { background: #17694F; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.bubble-nick { font-size: .78rem; margin-bottom: .12rem; font-weight: 700; line-height: 1.2; }
.reply-quote { background: rgba(255,255,255,.16); border-inline-start: 3px solid currentColor; border-radius: 6px; padding: .3rem .55rem; margin-bottom: .4rem; font-size: .74rem; opacity: .9; cursor: pointer; }
.bubble.them .reply-quote { background: rgba(31,111,92,.07); border-inline-start-color: var(--blue); color: var(--muted); }
.bubble.me .reply-quote { background: rgba(31,111,92,.10); color: #3f7a58; }
html.dark-mode .bubble.me .reply-quote { background: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
.reply-quote strong { display: block; font-size: .7rem; }
.bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; margin-top: .25rem; white-space: nowrap; flex-wrap: nowrap; }
.bubble-time { font-size: .62rem; opacity: .75; white-space: nowrap; }
.bubble.them .bubble-time { color: var(--muted2); opacity: 1; }
.bubble.me .bubble-time { color: #4c8a63; opacity: 1; }
html.dark-mode .bubble.me .bubble-time { color: rgba(255,255,255,.7); }
.edited-tag { font-size: .6rem; opacity: .7; font-style: italic; margin-inline-end: .25rem; }
.read-ticks  { font-size: .68rem; opacity: .9; }

.voice-msg   { display: flex; align-items: center; gap: .6rem; width: 250px; min-width: 0; max-width: 100%; padding: .25rem .1rem; box-sizing: border-box; }
.bubble.me .play-voice { background: #1F6F5C; color: #fff; }
.play-voice  { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.95); border: none; cursor: pointer; color: #14503F; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .12s; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.bubble.them .play-voice { background: #1F6F5C; color: #fff; }
.play-voice:active { transform: scale(.9); }
.voice-body  { display: flex; flex-direction: column; flex: 1; gap: .2rem; min-width: 0; }
.voice-bars  { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; flex: 1; min-width: 0; overflow: hidden; }
.voice-meta  { display: flex; align-items: center; justify-content: space-between; }
.voice-dur   { font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bubble.me   .voice-dur { color: #3f7a58; }
html.dark-mode .bubble.me .voice-dur { color: rgba(255,255,255,.85); }
.bubble.them .voice-dur { color: var(--muted); }
.voice-speed-btn { font-size: .62rem; background: rgba(31,111,92,.14); border: none; border-radius: 8px; padding: .12rem .4rem; cursor: pointer; flex-shrink: 0; font-weight: 800; color: #1F6F5C; font-family: inherit; }
.bubble.them .voice-speed-btn { color: var(--gold); background: rgba(31,111,92,.1); }

.typing-bar  { display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem; flex-shrink: 0; background: var(--bg2); }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: #999; animation: tdot 1.2s infinite; display: inline-block; margin: 0 1px; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

.emoji-cat-btn { background:none;border:none;font-size:1.2rem;padding:.4rem .55rem;cursor:pointer;opacity:.5;border-bottom:2px solid transparent;flex-shrink:0;transition:opacity .15s; }
.emoji-cat-btn.active { opacity:1;border-bottom-color:var(--blue); }

/* ── Modern Input Bar (WhatsApp/Telegram style) ── */
.chat-input-bar { position: relative; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-top: 1px solid var(--border); padding: .5rem .75rem max(.5rem, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.chat-input-bar.locked { opacity: .4; pointer-events: none; }
.chat-input-pill { flex: 1; display: flex; align-items: center; background: var(--bg3); border-radius: 22px; padding: .5rem .55rem .5rem .85rem; gap: .25rem; transition: box-shadow .2s var(--ease-standard), border-color .2s var(--ease-standard); border: 1.5px solid transparent; min-height: 44px; }
html.dark-mode .chat-input-pill { background: #232427; border-color: #2C2D31; }
.chat-input-pill:focus-within { border-color: rgba(31,111,92,.3); box-shadow: 0 0 0 3px rgba(31,111,92,.08); }
.chat-send-btn { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #1F6F5C, #2B8A73); border: none; color: #fff; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform .15s; box-shadow: 0 2px 10px rgba(31,111,92,.35); }
.chat-send-btn:active { transform: scale(.88); }
.chat-input-pill .chat-input { flex: 1; min-width: 0; width: 100%; background: transparent; border: none; padding: .5rem .2rem; margin: 0; outline: none; box-shadow: none; -webkit-appearance: none; appearance: none; color: var(--text); font-size: 1rem; font-family: inherit; resize: none; max-height: 160px; line-height: 1.5; word-break: normal; overflow-wrap: break-word; white-space: pre-wrap; unicode-bidi: plaintext; }
.chat-input-pill .chat-input:focus { border: none; outline: none; box-shadow: none; }
.chat-input-pill .chat-input::placeholder { color: var(--muted); font-size: .95rem; }
.chat-attach-circle { width: 36px; height: 36px; border-radius: 50%; background: transparent; border: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: color .15s; }
.chat-attach-circle:active { color: #1F6F5C; }
.chat-emoji-circle { width: 34px; height: 34px; border-radius: 50%; background: transparent; border: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: color .15s; }
.chat-emoji-circle:active { color: #1F6F5C; }

/* ── Voice Rec Button ── */
.voice-rec-btn { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #1F6F5C, #2B8A73); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform .15s, background .2s; box-shadow: 0 2px 10px rgba(31,111,92,.35); -webkit-user-select: none; user-select: none; touch-action: none; }
.voice-rec-btn.rec { background: linear-gradient(135deg, #E11D48, #BE123C); box-shadow: 0 2px 12px rgba(225,29,72,.4); animation: recPulse .9s ease-in-out infinite; }
.voice-rec-btn.held { transform: scale(1.35); background: linear-gradient(135deg, #E11D48, #BE123C); box-shadow: 0 4px 22px rgba(225,29,72,.55); }
.voice-rec-btn:active { transform: scale(.88); }
@keyframes recPulse { 0%,100% { box-shadow: 0 2px 12px rgba(225,29,72,.4); } 50% { box-shadow: 0 2px 20px rgba(225,29,72,.7); } }

/* ── Hold-to-record overlay (sits over the input bar while holding) ── */
.rec-overlay { position: absolute; inset: 0; background: var(--surface); display: none; align-items: center; z-index: 5; overflow: hidden; }
.rec-overlay.show { display: flex; }
.rec-overlay-inner { display: flex; align-items: center; width: 100%; padding: 0 .75rem; gap: .5rem; }
.rec-trash-zone { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: rgba(225,29,72,.08); display: flex; align-items: center; justify-content: center; transition: transform .2s, background .2s; }
.rec-trash-zone.active { background: #E11D48; transform: scale(1.25); }
.rec-trash-zone.active .rec-trash-icon svg { stroke: #fff; }
.rec-trash-icon { color: #E11D48; display: flex; }
.rec-center { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.rec-slide-hint { display: flex; align-items: center; gap: .25rem; font-size: .72rem; color: var(--muted); flex-shrink: 0; white-space: nowrap; animation: recSlideHint 1.5s ease-in-out infinite; }
@keyframes recSlideHint { 0%,100% { opacity: 1; transform: translateX(0); } 50% { opacity: .5; transform: translateX(-6px); } }
.rec-lock-pill { position: absolute; bottom: 100%; inset-inline-end: .75rem; width: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; display: none; flex-direction: column; align-items: center; padding: .5rem .25rem .35rem; gap: .25rem; box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.18)); z-index: 6; margin-bottom: 6px; }
.rec-lock-pill.show { display: flex; }
.rec-lock-icon { color: var(--muted); display: flex; transition: transform .15s, color .15s; }
.rec-lock-pill.near .rec-lock-icon { color: var(--accent, #1F6F5C); transform: scale(1.15); }
.rec-lock-chevron { color: var(--muted); animation: lockBounce 1s ease-in-out infinite; display: flex; }
@keyframes lockBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* ── Recording Bar (locked / hands-free mode) ── */
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #E11D48; animation: recPulse .9s infinite; flex-shrink: 0; }
.rec-waveform { flex: 1; display: flex; align-items: center; gap: 2px; height: 32px; overflow: hidden; }
.rec-waveform-bar { width: 3px; border-radius: 2px; background: var(--accent, #1F6F5C); min-height: 4px; transition: height .07s ease; flex-shrink: 0; }
.rec-time { font-size: .82rem; font-weight: 700; color: #E11D48; font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 36px; }
.rec-locked-bar { display: none; align-items: center; gap: .65rem; padding: .5rem .75rem max(.5rem, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }
.rec-locked-bar.show { display: flex; }
.rec-locked-delete { width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(225,29,72,.1); color: #E11D48; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.rec-locked-center { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.rec-locked-send { width: 44px; height: 44px; border-radius: 50%; border: none; background: linear-gradient(135deg, #1F6F5C, #2B8A73); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; box-shadow: 0 2px 10px rgba(31,111,92,.35); }

/* ── Voice Note Bubble (in messages) ── */
.voice-bubble { display: flex; align-items: center; gap: .65rem; min-width: 200px; max-width: 260px; padding: .1rem 0; }
.vn-play-btn { width: 38px; height: 38px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform .15s; }
.bubble.me .vn-play-btn { background: #1F6F5C; color: #fff; }
.bubble.them .vn-play-btn { background: rgba(31,111,92,.12); color: #1F6F5C; }
.vn-play-btn:active { transform: scale(.9); }
.vn-waveform { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vbar { width: 3px; border-radius: 2px; background: rgba(31,111,92,.3); min-height: 3px; transition: background .12s; flex-shrink: 0; }
.vbar.played { background: #1F6F5C; }
.bubble.them .vbar { background: rgba(31,111,92,.25); }
.bubble.them .vbar.played { background: #1F6F5C; }
.vn-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; flex-shrink: 0; }
.vn-dur { font-size: .68rem; font-variant-numeric: tabular-nums; }
.bubble.me .vn-dur { color: #3f7a58; }
html.dark-mode .bubble.me .vn-dur { color: rgba(255,255,255,.75); }
.bubble.them .vn-dur { color: var(--muted); }
.vn-speed-btn { font-size: .6rem; font-weight: 800; border: 1px solid; border-radius: 4px; padding: .05rem .25rem; cursor: pointer; background: transparent; font-family: inherit; }

.attach-wrap    { position: relative; flex-shrink: 0; }
.attach-sheet   { position: fixed; bottom: 74px; inset-inline: .6rem; background: var(--surface); border: none; border-radius: 20px; padding: 1.2rem 1rem; display: none; grid-template-columns: repeat(4,1fr); gap: 1rem .5rem; z-index: 500; box-shadow: 0 10px 34px rgba(0,0,0,.24); }
.attach-sheet.open { display: grid; animation: attachUp .22s cubic-bezier(.22,.9,.3,1); }
@keyframes attachUp { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.attach-opt     { display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; }
.attach-icon    { width: 52px; height: 52px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; transition: transform .12s, filter .15s; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.attach-opt:hover .attach-icon { transform: scale(1.06); filter: brightness(1.06); }
.attach-opt:active .attach-icon { transform: scale(.92); }
.attach-lbl     { font-size: .68rem; color: var(--muted); font-weight: 600; }
/* WhatsApp-style colourful attachment icons */
.att-gallery .attach-icon { background: linear-gradient(135deg,#A855F7,#7C3AED); }
.att-camera  .attach-icon { background: linear-gradient(135deg,#FB7185,#E11D48); }
.att-video   .attach-icon { background: linear-gradient(135deg,#F472B6,#DB2777); }
.att-audio   .attach-icon { background: linear-gradient(135deg,#FB923C,#EA580C); }
.att-file    .attach-icon { background: linear-gradient(135deg,#60A5FA,#2563EB); }
.att-poll    .attach-icon { background: linear-gradient(135deg,#FBBF24,#F59E0B); }
.att-sched   .attach-icon { background: linear-gradient(135deg,#2DD4BF,#0D9488); }

.ctx-menu  { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .4rem 0; min-width: 160px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: scale(.92); transform-origin: top; transition: opacity .15s var(--ease-standard), transform .15s var(--ease-standard); }
.ctx-menu.open { opacity: 1; pointer-events: auto; transform: scale(1); }
.ctx-item  { padding: .6rem 1rem; font-size: .82rem; cursor: pointer; display: flex; align-items: center; gap: .6rem; color: var(--text); }
.ctx-item:hover { background: var(--bg3); }
.ctx-item.danger { color: var(--red); }

/* =============================================
   MUSIC SCREEN
   ============================================= */
.music-tabs-row { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.mtab { flex: 1; padding: .65rem .3rem; text-align: center; font-size: .72rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.mtab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 700; }

.track-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface); transition: background .15s; }
.track-item:hover { background: var(--bg2); }
.track-thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; border: 1px solid var(--border); position: relative; overflow: hidden; }
.track-thumb-bg    { position: absolute; inset: 0; opacity: .15; display: flex; align-items: center; justify-content: center; font-size: 4rem; filter: blur(6px); }
.track-thumb-emoji { position: relative; z-index: 1; }
.pbar { width: 3px; background: var(--text); border-radius: 2px; animation: pbanim .8s ease-in-out infinite; }
.pbar:nth-child(2) { animation-delay: .2s; }
.pbar:nth-child(3) { animation-delay: .4s; }

.mini-player { position: fixed; bottom: 56px; left: 0; right: 0; z-index: 70; background: var(--surface); border-top: 1px solid var(--border); display: none; align-items: center; gap: .75rem; padding: .6rem 1rem; cursor: pointer; box-shadow: 0 -2px 12px rgba(0,0,0,.08); }
.mini-player.show { display: flex; }
#mini-prog { position: absolute; top: 0; inset-inline-start: 0; height: 2px; background: var(--accent); }
.mini-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; border: 1px solid var(--border); }
.mini-play  { width: 32px; height: 32px; border-radius: 50%; background: var(--text); border: none; font-size: .95rem; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--bg); }

.artwork { width: 100%; aspect-ratio: 1; border-radius: 20px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 7rem; border: 1px solid var(--border); position: relative; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.artwork-bg    { position: absolute; inset: 0; opacity: .12; display: flex; align-items: center; justify-content: center; font-size: 20rem; filter: blur(30px); }
.artwork-emoji { position: relative; z-index: 1; }
.artwork.playing .artwork-emoji { animation: pulse 2s ease-in-out infinite; }

.prog-bar  { width: 100%; height: 4px; background: var(--bg4); border-radius: 2px; cursor: pointer; position: relative; margin-bottom: .4rem; }
.prog-fill { height: 100%; background: var(--text); border-radius: 2px; width: 0; pointer-events: none; }
.prog-dot  { position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--text); left: 0; margin-left: -6px; pointer-events: none; }
.play-big  { width: 60px; height: 60px; border-radius: 50%; background: var(--text); border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--bg); box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.ctrl-btn  { width: 42px; height: 42px; border-radius: 50%; background: transparent; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); transition: color .2s; }
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn.on { color: var(--text); }
.mode-btn  { flex: 1; padding: .45rem; text-align: center; font-size: .76rem; border-radius: 8px; cursor: pointer; color: var(--muted); border: none; background: transparent; font-family: inherit; transition: all .22s; }
.mode-btn.active { background: var(--text); color: var(--bg); border: none; }

/* =============================================
   SETTINGS SCREEN
   ============================================= */
.settings-av { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; border: 2px solid var(--text); position: relative; }
.avatar-edit-btn { position: absolute; bottom: 0; inset-inline-end: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .75rem; color: #fff; border: 2px solid var(--surface); cursor: pointer; }
.settings-sec  { font-size: .65rem; letter-spacing: .01em; color: var(--muted); padding: 1rem 1rem .4rem; }
.settings-row  { display: flex; align-items: center; justify-content: space-between; padding: 1.05rem 1.1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.settings-row:last-child { border: none; }
.settings-row:hover { background: var(--bg2); }
.settings-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.logout-row { margin: .75rem .75rem 1rem; padding: .85rem; background: rgba(211,47,47,.06); border: 1px solid rgba(211,47,47,.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer; color: var(--red); font-weight: 600; transition: background .15s, transform .15s var(--ease-spring); }
.logout-row:hover { background: rgba(211,47,47,.12); }
.logout-row:active { transform: scale(.97); }

/* =============================================
   CHANNEL SCREEN
   ============================================= */
.channel-cover { width: 100%; height: 72px; position: relative; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, #1F6F5C 0%, #14503F 100%); border-bottom: 1px solid var(--border); }
.channel-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(31,111,92,.06), transparent 55%); }
.channel-topbar-over { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: .6rem .75rem; pointer-events: none; }
.channel-topbar-over > * { pointer-events: all; }
.ch-cover-over { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: linear-gradient(to bottom, rgba(0,0,0,.4), transparent); }
.ch-cover-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); z-index: 1; }
.ch-avatar-big { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); border: 3px solid transparent; background-image: linear-gradient(var(--surface), var(--surface)), var(--gradient-story); background-origin: border-box; background-clip: padding-box, border-box; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 800; color: var(--gold); background-size: cover, auto; background-position: center, center; box-shadow: var(--shadow-md); overflow: hidden; transition: transform .2s var(--ease-spring); }
.ch-avatar-big:active { transform: scale(.96); }
.ch-stats-row { display: flex; padding: .5rem 1rem 1rem; gap: 0; }
.ch-stats-row > div { flex: 1; border-radius: 10px; transition: background .15s var(--ease-standard); padding: .2rem 0; }
.ch-stats-row > div:hover { background: var(--bg2); }
.ch-stat-val { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.ch-stat-lbl { font-size: .66rem; color: var(--muted); letter-spacing: .01em; margin-top: .1rem; }
.ch-follow-btn { flex: 1; padding: .7rem; border-radius: 24px; font-size: .88rem; font-weight: 700; cursor: pointer; font-family: inherit; border: none; background: linear-gradient(135deg, var(--accent-l), var(--gold)); color: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease-spring), filter .2s var(--ease-standard), box-shadow .2s var(--ease-standard); }
.ch-follow-btn:active { transform: scale(.96); }
.ch-follow-btn:hover { filter: brightness(1.06); box-shadow: var(--shadow-md); }
.ch-follow-btn.following { background: var(--bg3); color: var(--text); border: 1.5px solid var(--border); box-shadow: none; }
.ch-icon-btn { width: 46px; height: 46px; border-radius: 14px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; color: var(--text); transition: transform .15s var(--ease-spring), background .2s var(--ease-standard); }
.ch-icon-btn:active { transform: scale(.9); }
.ch-icon-btn:hover { background: var(--bg4); }
.ch-icon-btn.on { background: var(--gold); color: #fff; border-color: transparent; }
.chtab { flex: 1; padding: .8rem .5rem; text-align: center; font-size: .8rem; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: color .2s var(--ease-standard), border-color .2s var(--ease-standard); }
.chtab.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }
.ch-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 2px; }
.ch-grid-item { transition: transform .15s var(--ease-spring), filter .15s var(--ease-standard); position: relative; }
.ch-grid-item:active { transform: scale(.96); filter: brightness(.92); }
.grid-short { aspect-ratio: 9/16; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 2rem; cursor: pointer; position: relative; overflow: hidden; }

/* =============================================
   ADMIN GATE + PANEL — Design D
   ============================================= */
#admin-gate { min-height: 100vh; background: var(--bg2); display: none; align-items: center; justify-content: center; padding: 1.5rem; position: fixed; inset: 0; z-index: 300; }
#admin-gate.open { display: flex; }
html.dark-mode #admin-gate { background: #121314; }
.gate-card { width: 100%; max-width: 360px; background: var(--surface); border: none; border-radius: 20px; padding: 2rem 1.75rem; animation: fadeIn .5s var(--ease-standard); box-shadow: var(--shadow-lg); }
html.dark-mode .gate-card { background: #1B1C1E; }
.pin-wrap  { display: flex; gap: .6rem; justify-content: center; margin-bottom: 1.25rem; }
.pin-digit { width: 52px; height: 60px; background: var(--bg2); border: 1.5px solid var(--border2); border-radius: 12px; text-align: center; font-size: 1.5rem; font-family: inherit; color: var(--text); outline: none; transition: border .2s var(--ease-standard), box-shadow .2s var(--ease-standard), transform .12s var(--ease-spring); }
html.dark-mode .pin-digit { background: #232427; border-color: #2C2D31; }
.pin-digit:focus { border-color: #1F6F5C; box-shadow: 0 0 0 3px rgba(31,111,92,.12); transform: scale(1.04); }
.gate-msg  { padding: .6rem .9rem; border-radius: 10px; font-size: .8rem; margin-bottom: .9rem; display: none; align-items: center; gap: .5rem; }
.gate-msg.err { background: rgba(211,47,47,.08); border: 1px solid var(--red);   color: var(--red);   display: flex; }
.gate-msg.ok  { background: rgba(46,125,50,.08); border: 1px solid var(--green); color: var(--green); display: flex; }

/* ── Admin D Topbar ── */
.admin-topbar { background: linear-gradient(135deg, #1F6F5C 0%, #2B8A73 100%); border-bottom: none; padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; box-shadow: var(--shadow-md); position: relative; z-index: 20; }
.admin-topbar .topbar-logo { color: #fff; -webkit-text-fill-color: #fff; font-weight: 800; letter-spacing: .08em; }
.admin-role-badge { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); border-radius: 20px; padding: .15rem .65rem; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; font-weight: 700; }
.admin-logout-btn { padding: .3rem .75rem; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; color: #fff; font-size: .75rem; cursor: pointer; font-family: inherit; transition: background .18s var(--ease-standard), transform .12s var(--ease-spring); }
.admin-logout-btn:hover { background: rgba(255,255,255,.25); }
.admin-logout-btn:active { transform: scale(.94); }

/* ── Admin Nav ── */
.admin-nav-row { display: flex; overflow-x: auto; border-bottom: 1.5px solid var(--bg3); background: var(--surface); scrollbar-width: none; flex-shrink: 0; padding: 0 .25rem; }
html.dark-mode .admin-nav-row { background: #1B1C1E; border-bottom-color: #2C2D31; }
.admin-nav-row::-webkit-scrollbar { display: none; }
.anav { display: flex; align-items: center; gap: .35rem; padding: .75rem .9rem; font-size: .73rem; white-space: nowrap; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: color .2s var(--ease-standard), border-color .2s var(--ease-standard), background .2s var(--ease-standard); font-weight: 500; }
.anav:hover { background: rgba(31,111,92,.06); }
.anav svg { flex-shrink: 0; }
.anav.active { color: #1F6F5C; border-bottom-color: #1F6F5C; font-weight: 700; }
html.dark-mode .anav { color: #8B949E; }
html.dark-mode .anav.active { color: #3EBFA1; border-bottom-color: #3EBFA1; }
.anav-back { color: #1F6F5C; font-weight: 700; gap: .25rem; padding-inline-start: .7rem; padding-inline-end: .9rem; border-inline-end: 1px solid var(--border); }
html.dark-mode .anav-back { color: #3EBFA1; }

/* ── Grouped admin dashboard ── */
.admin-home { padding: 1rem .9rem 2rem; max-width: 640px; margin: 0 auto; }
.admin-home-hdr { font-size: .72rem; letter-spacing: .01em; color: var(--muted); font-weight: 800; margin: .25rem .25rem 1rem; }
.admin-cat-list { display: flex; flex-direction: column; gap: .7rem; }
.admin-cat-card { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem 1.1rem; background: var(--surface); border: none; border-radius: 16px; cursor: pointer; font-family: inherit; text-align: start; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease-spring), box-shadow .2s var(--ease-standard); animation: chatItemIn .28s var(--ease-standard) both; }
.admin-cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.admin-cat-card:active { transform: scale(.985); }
html.dark-mode .admin-cat-card { background: #1B1C1E; }
.acc-ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .15s var(--ease-spring); }
.admin-cat-card:hover .acc-ic { transform: scale(1.06); }
.acc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.acc-title { font-size: .98rem; font-weight: 700; color: var(--text); }
.acc-desc { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-meta { font-size: .72rem; font-weight: 700; color: var(--muted2); background: var(--bg3); border-radius: 999px; min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; padding: 0 .4rem; flex-shrink: 0; }
.acc-chev { color: var(--muted2); flex-shrink: 0; transition: transform .15s var(--ease-spring); }
.admin-cat-card:hover .acc-chev { transform: translateX(2px); }

/* ── Admin Cards ── */
.admin-card { background: var(--surface); border: none; border-radius: 16px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
html.dark-mode .admin-card { background: #1B1C1E; }
.admin-card-title { font-size: .7rem; letter-spacing: .01em; color: #1F6F5C; font-weight: 800; margin-bottom: 1rem; display: flex; align-items: center; gap: .4rem; }
html.dark-mode .admin-card-title { color: #3EBFA1; }

/* ── Stats ── */
.stat-card { background: linear-gradient(135deg, #F7F6F3 0%, #EFEEEA 100%); border: 1px solid var(--border2); border-radius: 14px; padding: 1rem; text-align: center; box-shadow: var(--shadow-xs); transition: box-shadow .2s var(--ease-standard), transform .15s var(--ease-spring); }
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
html.dark-mode .stat-card { background: linear-gradient(135deg, #232427 0%, #202823 100%); border-color: #2C2D31; }
.stat-num  { font-size: 1.7rem; font-weight: 800; color: #1F6F5C; }
html.dark-mode .stat-num { color: #3EBFA1; }
.stat-lbl  { font-size: .63rem; color: var(--muted); margin-top: .2rem; letter-spacing: .01em; font-weight: 600; }
.live-dot  { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; animation: lpulse 1.2s infinite; display: inline-block; flex-shrink: 0; }
.act-btn   { padding: .32rem .65rem; border-radius: 8px; font-size: .67rem; cursor: pointer; border: 1px solid; font-family: inherit; transition: transform .12s var(--ease-spring), filter .18s var(--ease-standard); font-weight: 600; }
.act-btn:active { transform: scale(.92); }
.act-btn:hover { filter: brightness(.97); }
.act-verify  { background: #F0FFF4; border-color: #BBF7D0; color: #16A34A; }
.act-block   { background: #FFF1F2; border-color: #FECDD3; color: #E11D48; }
.act-promote { background: #E3F3EE; border-color: #BFE0D5; color: #14503F; }
.bc-textarea { width: 100%; padding: .75rem; background: #F1F0ED; border: 1.5px solid var(--border2); border-radius: 12px; color: var(--text); font-family: inherit; font-size: .88rem; resize: none; outline: none; margin-bottom: .75rem; }
html.dark-mode .bc-textarea { background: #232427; border-color: #2C2D31; }
.bc-textarea:focus { border-color: #1F6F5C; }
.bc-send-btn { width: 100%; padding: .75rem; background: linear-gradient(135deg, #1F6F5C, #2B8A73); color: #fff; font-size: .85rem; font-weight: 700; letter-spacing: .08em; border: none; border-radius: 12px; cursor: pointer; font-family: inherit; box-shadow: 0 2px 8px rgba(31,111,92,.3); }
.admin-search { width: 100%; padding: .55rem .85rem .55rem 2.2rem; background: #F1F0ED; border: 1.5px solid var(--border2); border-radius: 10px; color: var(--text); font-size: .82rem; font-family: inherit; outline: none; margin-bottom: .75rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23637087' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: .65rem center; }
html.dark-mode .admin-search { background-color: #232427; border-color: #2C2D31; }
.admin-search { transition: border-color .2s var(--ease-standard), box-shadow .2s var(--ease-standard); }
.admin-search:focus { border-color: #1F6F5C; box-shadow: 0 0 0 3px rgba(31,111,92,.1); }

.status-bg-sw { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; transition: transform .15s; }
.status-bg-sw.active { border-color: var(--accent); transform: scale(1.1); }

/* =============================================
   THEME PICKER — user-customizable colors
   ============================================= */
.theme-picker-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 0 .75rem 1rem; padding: 1.25rem; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.theme-picker-title { font-size: .72rem; letter-spacing: .01em; color: var(--text); font-weight: 700; margin-bottom: 1rem; }
.theme-swatch-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.theme-swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform .15s, border-color .15s; flex-shrink: 0; }
.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.active { border-color: var(--accent); transform: scale(1.12); }
.theme-custom-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.theme-custom-row label { font-size: .8rem; color: var(--muted); flex: 1; }
.theme-custom-row input[type="color"] { width: 44px; height: 32px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; background: none; padding: 2px; }
.theme-reset-btn { margin-top: .85rem; width: 100%; padding: .55rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .8rem; cursor: pointer; font-family: inherit; }

/* =============================================
   MUSIC — Albums, MVs, Queue, Mode Toggle
   ============================================= */
.mode-toggle { display: flex; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin: 0 1.25rem 1.25rem; }
.album-card { flex-shrink: 0; width: 128px; cursor: pointer; transition: transform .18s; }
.album-card:active { transform: scale(.95); }
.album-cover { width: 128px; height: 128px; border-radius: 12px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; border: 1px solid var(--border); position: relative; overflow: hidden; margin-bottom: .4rem; }
.album-cover-bg { position: absolute; inset: 0; opacity: .15; display: flex; align-items: center; justify-content: center; font-size: 8rem; filter: blur(10px); }
.album-cover-emoji { position: relative; z-index: 1; }
.trending-star { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--blue); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: .7rem; z-index: 2; }
.album-name { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-artist { font-size: .66rem; color: var(--muted); }
.album-tracks { font-size: .62rem; color: var(--muted2); margin-top: .1rem; }
.album-back, .player-back { font-size: 1.3rem; color: var(--blue); cursor: pointer; }
.album-topbar, .player-topbar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.album-hero { padding: 1.25rem 1.25rem .75rem; display: flex; gap: 1rem; align-items: flex-end; }
.album-hero-art { width: 108px; height: 108px; border-radius: 14px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; border: 1px solid var(--border); flex-shrink: 0; }
.album-hero-label { font-size: .58rem; letter-spacing: .01em; color: var(--muted); margin-bottom: .25rem; }
.album-hero-name { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.album-hero-artist { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.album-hero-year { font-size: .68rem; color: var(--muted2); margin-top: .1rem; }
.album-play-row { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; }
.album-play-btn { padding: .5rem 1.5rem; background: var(--text); border: none; border-radius: 20px; color: var(--bg); font-size: .83rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.album-shuffle-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; }

.mv-row { display: flex; gap: .75rem; overflow-x: auto; padding: 0 1rem .75rem; scrollbar-width: none; }
.mv-row::-webkit-scrollbar { display: none; }
.mv-card { flex-shrink: 0; width: 188px; cursor: pointer; transition: transform .18s; }
.mv-card:active { transform: scale(.96); }
.mv-thumb { width: 188px; height: 106px; border-radius: 10px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 3rem; border: 1px solid var(--border); position: relative; margin-bottom: .4rem; overflow: hidden; }
.mv-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); }
.mv-play-icon { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.mv-name { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-artist { font-size: .66rem; color: var(--muted); }

.queue-section { padding: 0 1rem 1rem; }
.queue-hdr { font-size: .72rem; letter-spacing: .01em; color: var(--muted); margin-bottom: .6rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.queue-item { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.queue-num { font-size: .7rem; color: var(--muted2); width: 16px; text-align: center; flex-shrink: 0; }
.queue-thumb { width: 34px; height: 34px; border-radius: 6px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-name { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-artist { font-size: .63rem; color: var(--muted); }
.trending-badge { display: inline-flex; align-items: center; gap: .3rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: .15rem .55rem; font-size: .62rem; color: var(--muted); margin-inline-start: .4rem; vertical-align: middle; }
.track-heart { font-size: 1rem; cursor: pointer; transition: transform .15s; padding: .25rem; flex-shrink: 0; }
.track-heart:active { transform: scale(1.3); }
.track-more { font-size: .9rem; cursor: pointer; color: var(--muted); padding: .25rem; flex-shrink: 0; }
.track-artist { font-size: .68rem; color: var(--muted); margin-top: .1rem; }
.track-dur { font-size: .68rem; color: var(--muted2); flex-shrink: 0; }
.track-name { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-name.playing { color: var(--blue); font-weight: 700; }
.playing-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 6px; background: rgba(0,0,0,.5); z-index: 2; }
.heart-big { font-size: 1.5rem; cursor: pointer; transition: transform .18s; }
.heart-big:active { transform: scale(1.3); }
.share-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .82rem; cursor: pointer; }
.video-player { margin: 0 1rem 1.25rem; border-radius: 14px; background: #111; aspect-ratio: 16/9; display: none; align-items: center; justify-content: center; font-size: 5rem; border: 1px solid var(--border); position: relative; overflow: hidden; cursor: pointer; color: #fff; }
.video-player.show { display: flex; }
.vp-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); }
.vp-play-btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* =============================================
   SHORTS — full-screen player overlay (always dark)
   ============================================= */
.shorts-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: linear-gradient(to bottom, rgba(0,0,0,.45), transparent); pointer-events: none; }
.shorts-topbar .topbar-logo { color: #fff; -webkit-text-fill-color: #8FD9C4; }
.shorts-topbar-title { font-size: .95rem; letter-spacing: .01em; color: rgba(255,255,255,.9); }
.shorts-upload-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(31,111,92,.2); border: 1.5px solid var(--blue); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer; pointer-events: auto; color: #fff; }
.short-channel { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .5rem; cursor: pointer; }
.short-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.12); border: 1.5px solid var(--blue); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.short-nick { font-size: .9rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.short-caption { font-size: .85rem; line-height: 1.5; color: rgba(255,255,255,.95); margin-bottom: .5rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.short-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.short-tag { font-size: .7rem; color: var(--blue); }
.action-avatar-wrap { position: relative; cursor: pointer; }
.action-avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.1); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; overflow: hidden; }
.action-avatar-plus { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 1.5px solid #000; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; color: #fff; }
.upload-modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.85); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease-standard); }
.upload-modal.open { opacity: 1; pointer-events: auto; }
.upload-sheet { background: var(--surface); border-radius: 20px 20px 0 0; border: 1px solid var(--border); padding: 1.5rem 1.5rem max(1.5rem, env(safe-area-inset-bottom)); width: 100%; max-width: 500px; transform: translateY(100%); transition: transform .3s var(--ease-standard); }
.upload-modal.open .upload-sheet { transform: translateY(0); }
.upload-title { font-size: 1rem; text-align: center; margin-bottom: 1.25rem; color: var(--blue); }
.upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.upload-opt { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem .75rem; text-align: center; cursor: pointer; transition: all .2s, transform .15s var(--ease-spring); }
.upload-opt:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, var(--bg2)); }
.upload-opt:active { transform: scale(.95); }
.upload-opt-icon { font-size: 2rem; margin-bottom: .4rem; }
.upload-opt-label { font-size: .78rem; color: var(--muted); }
.upload-cancel { width: 100%; padding: .75rem; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: .85rem; cursor: pointer; font-family: inherit; }
.comments-list { flex: 1; overflow-y: auto; padding: .5rem 1rem; scrollbar-width: none; }
.comments-list::-webkit-scrollbar { display: none; }
.comment { display: flex; gap: .6rem; margin-bottom: 1rem; }
.c-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.06); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.c-body { flex: 1; }
.c-nick { font-size: .78rem; color: var(--blue); margin-bottom: .15rem; }
.c-text { font-size: .83rem; color: var(--text); line-height: 1.4; }
.c-meta { display: flex; align-items: center; gap: .75rem; margin-top: .25rem; }
.c-time { font-size: .65rem; color: var(--muted); }
.c-like { font-size: .65rem; color: rgba(255,255,255,.4); cursor: pointer; }
.c-reply-btn { font-size: .65rem; color: rgba(255,255,255,.4); cursor: pointer; border: none; background: none; font-family: inherit; }
.comment-input-row { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.comment-input { flex: 1; padding: .55rem .85rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 22px; color: var(--text); font-size: .85rem; font-family: inherit; outline: none; }
.comment-input::placeholder { color: var(--muted); }
.cmt-send-el { width: 36px; height: 36px; border-radius: 50%; background: #1F6F5C; border: none; color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* =============================================
   ADMIN extras — analytics chart, role badges, etc.
   ============================================= */
.live-bar { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.live-text { font-size: .78rem; color: var(--green); }
.chart-wrap { height: 80px; display: flex; align-items: flex-end; gap: 3px; margin-bottom: .5rem; }
.bar-day { flex: 1; border-radius: 3px 3px 0 0; background: var(--bg4); min-height: 4px; cursor: pointer; transition: background .2s; }
.bar-day:hover, .bar-day.today { background: var(--text); }
.chart-labels { display: flex; justify-content: space-between; font-size: .58rem; color: var(--muted2); }
.stat-trend { font-size: .65rem; margin-top: .2rem; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.role-badge { font-size: .6rem; padding: .1rem .4rem; border-radius: 6px; font-family: sans-serif; }
.role-owner { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.role-admin { background: #E3F3EE; color: var(--blue); border: 1px solid #BFE0D5; }
.role-user { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; border: 1px solid var(--border); position: relative; }
.user-info { flex: 1; min-width: 0; }
.user-nick { font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.user-email { font-size: .67rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-actions { display: flex; gap: .35rem; flex-shrink: 0; flex-wrap: wrap; }
.online-ring { position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid var(--green); }

/* video moderation row */
.video-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.vid-thumb { width: 64px; height: 40px; border-radius: 6px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; border: 1px solid var(--border); }
.vid-info { flex: 1; min-width: 0; }
.vid-title { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-meta { font-size: .65rem; color: var(--muted); margin-top: .1rem; }
.del-btn { padding: .3rem .65rem; background: #FFF0F0; border: 1px solid #FFCDD2; border-radius: 6px; color: var(--red); font-size: .7rem; cursor: pointer; font-family: inherit; flex-shrink: 0; }

/* chat watch (admin) */
.chat-room-row { display: flex; align-items: center; gap: .65rem; padding: .65rem 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.chat-room-row:hover { background: var(--bg2); }
.cr-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; border: 1px solid var(--border); }
.cr-info { flex: 1; }
.cr-name { font-size: .82rem; font-weight: 700; }
.cr-preview { font-size: .68rem; color: var(--muted); }
.cr-view-btn { padding: .3rem .65rem; background: #E3F3EE; border: 1px solid #BFE0D5; border-radius: 6px; color: var(--blue); font-size: .68rem; cursor: pointer; font-family: inherit; }

/* music admin */
.music-admin-row { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.ma-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; border: 1px solid var(--border); }
.ma-info { flex: 1; min-width: 0; }
.ma-name { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-artist { font-size: .65rem; color: var(--muted); }
.ma-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.ma-btn { padding: .25rem .55rem; border-radius: 6px; font-size: .65rem; cursor: pointer; border: 1px solid; font-family: inherit; transition: all .18s; }
.ma-trend { background: var(--bg3); border-color: var(--border); color: var(--blue); }
.ma-trend.on { background: var(--bg3); color: var(--text); }
.ma-del { background: #FFF0F0; border-color: #FFCDD2; color: var(--red); }

/* feedback inbox */
.fb-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: .85rem; margin-bottom: .75rem; }
.fb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.fb-nick { font-size: .8rem; font-weight: 700; color: var(--blue); }
.fb-time { font-size: .63rem; color: var(--muted); }
.fb-type { font-size: .62rem; padding: .1rem .45rem; border-radius: 6px; font-family: sans-serif; }
.fb-bug { background: #FFF0F0; color: var(--red); border: 1px solid #FFCDD2; }
.fb-suggest { background: #E3F3EE; color: var(--blue); border: 1px solid #BFE0D5; }
.fb-text { font-size: .8rem; color: var(--muted); line-height: 1.5; margin-bottom: .4rem; }
.fb-device { font-size: .63rem; color: var(--muted2); }
.fb-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.fb-resolve { padding: .3rem .7rem; background: #F0FFF4; border: 1px solid var(--green); border-radius: 6px; color: var(--green); font-size: .68rem; cursor: pointer; font-family: inherit; }
.fb-delete { padding: .3rem .7rem; background: #FFF0F0; border: 1px solid #FFCDD2; border-radius: 6px; color: var(--red); font-size: .68rem; cursor: pointer; font-family: inherit; }

/* generic */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border: none; }
.setting-lbl { font-size: .82rem; }
.setting-sub { font-size: .67rem; color: var(--muted); margin-top: .15rem; }
.setting-input { padding: .45rem .75rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .82rem; font-family: inherit; outline: none; min-width: 0; flex: 1; margin-inline-start: .75rem; }
.save-pill { padding: .35rem .85rem; background: var(--text); border: none; border-radius: 8px; color: var(--bg); font-size: .72rem; font-weight: 700; cursor: pointer; font-family: inherit; margin-inline-start: .5rem; white-space: nowrap; transition: transform .12s var(--ease-spring), filter .18s var(--ease-standard); }
.save-pill:active { transform: scale(.94); }
.save-pill:hover { filter: brightness(1.15); }

/* =============================================
   CHAT ROOM extras (missing pieces)
   ============================================= */
.chatroom-topbar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); padding: .5rem .75rem; display: flex; align-items: center; gap: .5rem; flex-shrink: 0; box-shadow: var(--shadow-xs); position: relative; z-index: 20; }
.chatroom-topbar .icon-btn { background: none; border: none; color: var(--blue); }
.chatroom-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #1F6F5C, #2B8A73); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; color: #fff; font-weight: 700; overflow: hidden; background-size: cover; background-position: center; cursor: pointer; }
.chatroom-avatar.group { border-radius: 12px; }
.sys-msg { text-align: center; margin: .6rem 0; }
.sys-msg span { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); border-radius: 12px; padding: .3rem .85rem; font-size: .68rem; color: var(--muted); }
.member-row-admin { display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem; border-bottom: 1px solid var(--border); }
.member-photo { width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; flex-shrink: 0; overflow: hidden; background-size: cover; background-position: center; }
.chat-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .85rem .75rem; scrollbar-width: none; background:
  radial-gradient(circle at 15% 20%, rgba(91,141,239,.05) 0%, transparent 35%),
  radial-gradient(circle at 85% 75%, rgba(124,77,255,.05) 0%, transparent 35%),
  var(--bg2); }
html.dark-mode .chat-messages { background:
  radial-gradient(circle at 15% 20%, rgba(91,141,239,.06) 0%, transparent 35%),
  radial-gradient(circle at 85% 75%, rgba(124,77,255,.06) 0%, transparent 35%),
  var(--bg2); }
.chat-messages.tg-chat-bg { /* class combo applied in HTML */ }
/* Anchors short conversations to the bottom (near the input) instead of
   the top, WITHOUT making the scrollable element itself a flex
   container — an earlier attempt did that directly on .chat-messages
   and broke touch-scrolling on some Android WebViews. This wrapper sits
   INSIDE the plain-block scroll container and only affects layout when
   there's room to spare; once there are enough messages to overflow,
   it behaves exactly like a normal block. */
.chat-msgs-inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.chat-messages::-webkit-scrollbar { display: none; }
.bubble.them .vbar { background: rgba(31,111,92,.3); }
.bubble.them .vbar.played { background: var(--gold); }
.chat-send-btn:active { transform: scale(.88); }

/* =============================================
   MUSIC PLAYER extras (missing pieces)
   ============================================= */
.artwork-wrap { padding: 0 1.75rem; margin-bottom: 1.25rem; }
.artwork { width: 100%; aspect-ratio: 1; border-radius: 20px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 7rem; border: 1px solid var(--border); position: relative; overflow: hidden; transition: all .4s; }
.artwork-bg { position: absolute; inset: 0; opacity: .15; display: flex; align-items: center; justify-content: center; font-size: 20rem; filter: blur(30px); }
.artwork-emoji { position: relative; z-index: 1; }
.artwork.playing .artwork-emoji { animation: artPulse 2s ease-in-out infinite; }
@keyframes artPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.player-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; margin-bottom: 1rem; }
.ctrl-btn.on { color: var(--blue); }
.play-big-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--text); border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--bg); transition: all .18s; }
.play-big-btn:active { transform: scale(.93); }
.mini-prog { position: absolute; top: 0; left: 0; height: 2px; background: var(--blue); border-radius: 0; }
.mini-ctrl-btn { font-size: 1.1rem; cursor: pointer; border: none; background: none; color: var(--text); }
.mini-play-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg); border: none; font-size: .95rem; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* =============================================
   ADMIN page extras (missing pieces)
   ============================================= */
.owner-badge { background: rgba(0,0,0,.06); border: 1px solid var(--border2); border-radius: 20px; padding: .15rem .6rem; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.logout-btn { padding: .35rem .75rem; background: rgba(211,47,47,.06); border: 1px solid rgba(211,47,47,.2); border-radius: 8px; color: var(--red); font-size: .75rem; cursor: pointer; font-family: inherit; }
.admin-content { flex: 1; overflow-y: auto; padding: 1rem; scrollbar-width: none; padding-bottom: 5rem; }
.admin-content::-webkit-scrollbar { display: none; }
.admin-panel { animation: fadeIn .3s ease; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.dots { display: none; gap: 4px; align-items: center; }
.dots span { width: 6px; height: 6px; background: #fff; border-radius: 50%; animation: ldot .9s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); transition: all .3s; }
.step-dot.active { background: var(--blue); transform: scale(1.2); }
.step-dot.done { background: var(--green); }
.field-lbl { font-size: .68rem; letter-spacing: .01em; color: var(--muted); margin-bottom: .35rem; display: block; }
.table-search { width: 100%; padding: .55rem .85rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .82rem; font-family: inherit; outline: none; margin-bottom: .75rem; }

/* =============================================
   ADMIN GATE — full-screen overlay (toggled via .open)
   ============================================= */
#admin-gate { display: none; position: fixed; inset: 0; z-index: 300; }
#admin-gate.open { display: flex; }

/* =============================================
   FIX: .short-prev-card was missing — without position:relative
   its absolutely-positioned children (play icon, gradient overlay)
   escaped to cover the entire viewport (the "black overlay" bug).
   ============================================= */
.short-prev-card { flex-shrink: 0; width: 110px; height: 185px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--border); overflow: hidden; position: relative; cursor: pointer; }

/* =============================================
   Misc missing classes (cosmetic completeness)
   ============================================= */
.feed-state-text { font-size: .9rem; color: var(--text); }
.feed-state-sub { font-size: .75rem; color: var(--muted); }
.ad-title { font-size: 1.1rem; font-weight: 700; }
.ad-sub { font-size: .78rem; color: var(--muted); }
.ch-preview-card { flex-shrink: 0; width: 130px; background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: .9rem .75rem; text-align: center; cursor: pointer; }
.track-info { flex: 1; min-width: 0; }

/* =============================================
   TELEGRAM-STYLE additions: new-arrow, report modal,
   group photo upload, profile photo upload, members modal
   ============================================= */
.new-arrow { position: absolute; bottom: 90px; inset-inline-end: 16px; z-index: 30; background: var(--blue); color: #fff; border: none; border-radius: 20px; padding: .5rem 1rem; font-size: .8rem; display: flex; align-items: center; gap: .4rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.new-arrow .new-count { background: rgba(255,255,255,.25); border-radius: 10px; padding: 0 .4rem; font-size: .68rem; }
.typing-indicator-row { display: flex; align-items: center; gap: .5rem; padding: .3rem .9rem; background: var(--surface); flex-shrink: 0; border-top: .5px solid var(--border); }
.typing-av { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .62rem; font-weight: 800; }

/* Gentle entrance for messages that arrive while the chat is open. */
.msg-in { animation: msgIn .22s cubic-bezier(.22,.9,.3,1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* Cross-fade when navigating the media gallery. */
#mv-body { transition: opacity .15s ease; }
.report-reason-opt { display: flex; align-items: center; gap: .6rem; padding: .65rem 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: .85rem; }
.report-reason-opt input { width: 18px; height: 18px; accent-color: var(--blue); }
.avatar-upload-circle { width: 90px; height: 90px; border-radius: 50%; background: var(--bg3); border: 2px dashed var(--border2); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1rem; cursor: pointer; overflow: hidden; background-size: cover; background-position: center; position: relative; }
.avatar-upload-circle .avatar-upload-hint { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: .6rem; padding: .25rem 0; text-align: center; }

/* =============================================
   TELEGRAM WEB — exact visual match
   ============================================= */
.tg-search-pill { flex: 1; display: flex; align-items: center; gap: .55rem; background: var(--bg3); border-radius: 22px; padding: .5rem 1rem; cursor: text; transition: box-shadow .18s; }
.tg-search-pill:hover { box-shadow: 0 0 0 1.5px var(--border) inset; }
.tg-search-pill input { flex: 1; border: none; background: none; outline: none; font-size: .88rem; font-family: inherit; color: var(--text); }
.tg-search-pill input::placeholder { color: var(--muted); }

.tg-tabs-row {
  display: flex; gap: .3rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
  padding: .5rem .65rem;
}
.tg-tabs-row::-webkit-scrollbar { display: none; }
.tg-tab {
  padding: .42rem 1rem;
  font-size: .8rem;
  color: var(--muted);
  border: none;
  background: var(--bg3);
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  font-weight: 600;
  transition: background .2s var(--ease-standard), color .2s var(--ease-standard), transform .15s var(--ease-spring), box-shadow .2s var(--ease-standard);
}
.tg-tab:active { transform: scale(.96); }
.tg-tab.active { color: #fff; background: var(--blue); box-shadow: 0 2px 8px rgba(31,111,92,.35); transform: scale(1.02); }

/* Chat list rows — soft elevated cards instead of flat dividers */
.chat-item-wrap { position: relative; overflow: hidden; animation: chatItemIn .28s var(--ease-standard) both; }
@keyframes chatItemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-item-wrap + .chat-item-wrap { border-top: 1px solid var(--border); }
.chat-item { display: flex; align-items: center; gap: .9rem; padding: .95rem 1.1rem; cursor: pointer; background: var(--surface); transition: background .15s var(--ease-standard); position: relative; z-index: 2; touch-action: pan-y; }
.chat-item:hover  { background: var(--bg2); }
.chat-item:active { background: var(--bg3); }
.chat-item.unread { background: color-mix(in srgb, var(--blue) 5%, var(--surface)); }
.chat-item.unread::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.chat-item.swiped { transform: translateX(-84px); transition: transform .2s var(--ease-spring); }
.chat-item-delete { position: absolute; top: 0; inset-inline-end: 0; bottom: 0; width: 84px; background: var(--red); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-size: 1.1rem; cursor: pointer; z-index: 1; transition: background .15s; }
.chat-item-delete:active { background: #C62828; }
.chat-item-delete::after { content: 'Delete'; font-size: .6rem; font-weight: 600; letter-spacing: .03em; }

.chat-av { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #1F6F5C, #2B8A73); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800; flex-shrink: 0; position: relative; overflow: hidden; background-size: cover; background-position: center; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(20,80,63,.18); transition: transform .15s var(--ease-spring); }
.chat-item:active .chat-av { transform: scale(.94); }
.chat-av.group { border-radius: 16px; }

/* Hamburger side menu */
.hamburger-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.4); display: none; }
.hamburger-overlay.open { display: block; }
.hamburger-panel { position: fixed; top: 0; inset-inline-start: 0; bottom: 0; width: 80%; max-width: 320px; background: var(--surface); box-shadow: 4px 0 24px rgba(0,0,0,.15); transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; }
[dir="ltr"] .hamburger-panel { transform: translateX(-100%); }
.hamburger-overlay.open .hamburger-panel { transform: translateX(0); }
.hamburger-profile-hdr { background: linear-gradient(135deg, #1F6F5C 0%, #2B8A73 100%); color: #fff; padding: 1.5rem 1.25rem; }
.hamburger-avatar { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.2); border: 2px solid rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; margin-bottom: .75rem; overflow: hidden; background-size: cover; background-position: center; }
.hamburger-item { display: flex; align-items: center; gap: .95rem; padding: 1.05rem 1.25rem; font-size: .92rem; color: var(--text); cursor: pointer; transition: background .15s; }
.hamburger-item:hover { background: var(--bg2); }
.hamburger-item .hi-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: #1F6F5C; flex-shrink: 0; }

/* User Info / Group Info page (Telegram-style) */
.userinfo-hero { background: var(--surface); padding: 2rem 1.5rem 1.25rem; text-align: center; border-bottom: 1px solid var(--border); }
.userinfo-avatar-big { width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 700; margin: 0 auto .75rem; overflow: hidden; background-size: cover; background-position: center; }
.userinfo-name { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-top: .5rem; }
.userinfo-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.userinfo-action-row { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem 0; }
.uinfo-action-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .6rem .25rem; cursor: pointer; transition: background .15s; border-radius: 10px; margin: 0 .25rem; }
.uinfo-action-btn:active { background: var(--bg3); }
.uinfo-action-icon { width: 44px; height: 44px; border-radius: 50%; background: #F1F0ED; display: flex; align-items: center; justify-content: center; color: #1F6F5C; }
html.dark-mode .uinfo-action-icon { background: #232427; }
.uinfo-action-lbl { font-size: .72rem; color: var(--muted); font-weight: 500; }
.userinfo-media-tabs { display: flex; background: var(--surface); border-bottom: 1.5px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.userinfo-media-tabs::-webkit-scrollbar { display: none; }
.userinfo-mtab { flex-shrink: 0; padding: .75rem 1.1rem; font-size: .8rem; color: var(--muted); border: none; background: none; cursor: pointer; font-family: inherit; border-bottom: 2.5px solid transparent; font-weight: 500; transition: all .2s; }
.userinfo-mtab.active { color: #1F6F5C; border-bottom-color: #1F6F5C; font-weight: 700; }

/* Chat room — dotted/patterned background like Telegram */
.tg-chat-bg {
  background-color: var(--bg2);
  background-image: none;
}

/* =============================================
   POLLS — creation modal + chat message rendering
   ============================================= */
.poll-option-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.poll-option-row input { flex: 1; padding: .55rem .75rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .85rem; font-family: inherit; outline: none; }
.poll-option-remove { width: 28px; height: 28px; border-radius: 50%; background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; flex-shrink: 0; }
.poll-add-option-btn { width: 100%; padding: .55rem; background: none; border: 1px dashed var(--border2); border-radius: 8px; color: var(--blue); font-size: .82rem; cursor: pointer; font-family: inherit; margin-bottom: 1rem; }
.poll-setting-row { display: flex; align-items: center; justify-content: space-between; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.poll-setting-row:last-child { border-bottom: none; }
.poll-setting-label { font-size: .85rem; }
.poll-setting-sub { font-size: .68rem; color: var(--muted); margin-top: .1rem; }
.poll-correct-toggle { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border2); background: var(--bg3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .7rem; flex-shrink: 0; }
.poll-correct-toggle.on { background: var(--green); border-color: var(--green); color: #fff; }

/* poll message bubble */
.poll-bubble { min-width: 220px; max-width: 280px; }
.poll-question { font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.poll-description { font-size: .76rem; color: var(--muted); margin-bottom: .5rem; }
.poll-meta-line { font-size: .68rem; color: var(--muted); margin-bottom: .65rem; display: flex; align-items: center; gap: .4rem; }
.poll-opt { position: relative; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--border); margin-bottom: .5rem; cursor: pointer; overflow: hidden; background: var(--bg3); }
.poll-opt:last-child { margin-bottom: 0; }
.poll-opt-fill { position: absolute; inset: 0; background: rgba(31,111,92,.12); width: 0%; transition: width .4s ease; z-index: 0; }
.poll-opt.voted .poll-opt-fill { background: rgba(31,111,92,.22); }
.poll-opt.correct .poll-opt-fill { background: rgba(46,125,50,.2); }
.poll-opt.incorrect-selected .poll-opt-fill { background: rgba(211,47,47,.16); }
.poll-opt-row { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.poll-opt-text { font-size: .82rem; flex: 1; }
.poll-opt-pct { font-size: .78rem; font-weight: 700; color: var(--blue); flex-shrink: 0; }
.poll-opt-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.poll-opt.voted .poll-opt-check { background: var(--blue); border-color: var(--blue); }
.poll-voters-line { font-size: .66rem; color: var(--muted); margin-top: .25rem; position: relative; z-index: 1; }
.poll-footer-row { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; font-size: .68rem; color: var(--muted); }
.poll-close-btn { color: var(--red); cursor: pointer; background: none; border: none; font-size: .68rem; font-family: inherit; }
.poll-add-suggest-btn { width: 100%; padding: .45rem; background: none; border: 1px dashed var(--border2); border-radius: 8px; color: var(--blue); font-size: .76rem; cursor: pointer; font-family: inherit; margin-top: .4rem; }
.poll-icon-btn { width: 34px; height: 34px; border-radius: 50%; background: transparent; border: none; color: var(--muted); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* =============================================
   STATUS VIEWER — full-featured WhatsApp-style
   ============================================= */
.sv-emoji-btn { font-size: 1.5rem; cursor: pointer; padding: .15rem .2rem; transition: transform .12s; display: inline-flex; align-items: center; justify-content: center; }
.sv-emoji-btn:active { transform: scale(1.35); }
.sv-menu-item { padding: .7rem 1.1rem; font-size: .85rem; color: #fff; cursor: pointer; white-space: nowrap; }
.sv-menu-item:hover { background: rgba(255,255,255,.08); }
.sv-privacy-opt { display: flex; align-items: flex-start; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sv-privacy-opt input { margin-top: .25rem; flex-shrink: 0; }
.sv-bar { flex: 1; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.sv-bar-fill { height: 100%; background: #fff; width: 0%; }
.sv-bar-fill.done { width: 100%; }

/* =============================================
   MESSAGE REACTIONS
   ============================================= */
.quick-react-bar { position: fixed; z-index: 250; background: var(--surface); border-radius: 30px; padding: .45rem .6rem; display: flex; gap: .35rem; box-shadow: 0 10px 32px rgba(0,0,0,.22); border: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.qr-emoji { font-size: 1.35rem; cursor: pointer; padding: .1rem .2rem; transition: transform .12s; }
.qr-emoji:active { transform: scale(1.3); }
.reaction-row { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.reaction-pill { font-size: .72rem; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); border: none; border-radius: 13px; padding: .18rem .55rem; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; transition: transform .1s; }
.reaction-pill:active { transform: scale(.92); }
.reaction-pill.mine { background: linear-gradient(135deg, rgba(91,141,239,.18), rgba(124,77,255,.18)); box-shadow: 0 0 0 1.5px var(--blue) inset; }

/* Nav badges */
.nav-badge {
  position: absolute;
  top: 2px; inset-inline-end: 2px;
  min-width: 16px; height: 16px;
  background: #E53935;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
  z-index: 10;
  line-height: 1;
}

.sticker-gif { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; cursor: pointer; transition: transform .12s; }
.sticker-gif:active { transform: scale(.92); }
.sticker-wrap { position: relative; display: inline-flex; }
.sticker-del { position: absolute; top: -5px; inset-inline-end: -5px; width: 18px; height: 18px; background: #E53935; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .6rem; font-weight: 900; cursor: pointer; border: 1.5px solid var(--bg); z-index: 5; }

.date-sep { text-align: center; margin: .85rem 0 .5rem; display: flex; align-items: center; gap: .6rem; }
.date-sep::before, .date-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.date-sep span { font-size: .68rem; color: var(--muted); font-weight: 600; padding: .2rem .7rem; background: var(--bg3); border-radius: 12px; white-space: nowrap; }

/* Chat avatars — Telegram-style rounded square for groups, circle for DMs */
.chat-av-round  { border-radius: 50% !important; }
.chat-av-square { border-radius: 14px !important; }

/* Floating action buttons — WhatsApp/Telegram-style press & hover feedback */
.fab-btn { transition: transform .15s var(--ease-spring), box-shadow .2s var(--ease-standard); }
.fab-btn:hover  { box-shadow: var(--shadow-lg); }
.fab-btn:active { transform: scale(.9); }

/* Jump-to-bottom arrow — animates in/out instead of popping */
.new-arrow-btn {
  position: absolute; bottom: 76px; inset-inline-end: 12px; z-index: 50; cursor: pointer;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(0,0,0,.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(8px) scale(.85);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.new-arrow-btn.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.new-arrow-btn:active { transform: scale(.92); }

/* ── Chat Settings ── */
.cs-font-btn { flex:1; padding:.45rem; background:var(--bg3); border:1.5px solid var(--border); border-radius:8px; color:var(--muted); font-size:.78rem; cursor:pointer; font-family:inherit; transition:all .18s; }
.cs-font-btn.active { background:#1F6F5C; border-color:#1F6F5C; color:#fff; font-weight:700; }

/* ── New Group/Channel photo preview ── */
.group-photo-circle { width:72px; height:72px; border-radius:50%; object-fit:cover; }

/* ══════════════════════════════════
   CHANNEL POSTS (Telegram style)
══════════════════════════════════ */
.ch-post { padding: .75rem 0; border-bottom: 1px solid var(--border); position: relative; transition: background .15s; }
.ch-post.msg-selected { background: rgba(31,111,92,.08); }
.ch-post img, .ch-post video { display: block; width: 100%; border-radius: 0; max-height: 400px; object-fit: cover; }
.ch-meta { display: flex; align-items: center; gap: .4rem; justify-content: flex-end; padding: .35rem .75rem .1rem; }
.ch-views { display: flex; align-items: center; gap: .25rem; font-size: .7rem; color: var(--muted); }
.ch-time { font-size: .7rem; color: var(--muted); }
.ch-share-btn { background: rgba(31,111,92,.1); border: none; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #1F6F5C; flex-shrink: 0; transition: background .15s; margin-inline-start: .2rem; }
.ch-share-btn:active { background: rgba(31,111,92,.2); }
.ch-reactions { padding: .1rem .75rem .4rem; }

/* Channel text content */
.ch-post .ch-text { padding: .5rem .75rem; font-size: .95rem; line-height: 1.55; unicode-bidi: plaintext; word-break: break-word; }

/* ══════════════════════════════════
   MEDIA ALBUM GRID (Telegram style)
══════════════════════════════════ */
.media-album { display: grid; gap: 2px; width: 100%; }
.media-album.cols-2 { grid-template-columns: 1fr 1fr; }
.media-album.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.media-album-item { position: relative; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 1; }
.media-album-item img, .media-album-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-album-dur { position: absolute; bottom: 4px; left: 5px; font-size: .68rem; color: #fff; font-weight: 700; background: rgba(0,0,0,.45); border-radius: 4px; padding: .05rem .3rem; }
.media-album-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* ══════════════════════════════════
   MULTI-SELECT (Telegram style)
══════════════════════════════════ */
.msg-selected { background: rgba(31,111,92,.08) !important; }
.msg-selected::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #1F6F5C; }
.msg-wrap { position: relative; }

#select-action-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 500; background: var(--surface); border-top: 1px solid var(--border); padding: .65rem 1rem max(.65rem,env(safe-area-inset-bottom)); align-items: center; gap: .75rem; box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
.sel-bar-count { flex: 1; font-size: .88rem; font-weight: 600; color: var(--text); }
.sel-bar-btn { background: none; border: none; cursor: pointer; color: #1F6F5C; padding: .4rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .15s; }
.sel-bar-btn:hover { background: var(--bg3); }
.sel-bar-btn.danger { color: #E11D48; }

/* ══════════════════════════════════
   VIDEO BUBBLE — no frame, clean
══════════════════════════════════ */
.video-bubble-wrap { border-radius: 14px; overflow: hidden; cursor: pointer; background: #000; position: relative; max-width: 260px; display: block; }
.video-bubble-wrap video { width: 100%; display: block; aspect-ratio: 4 / 5; max-height: 240px; object-fit: cover; border-radius: 14px; background: #000; }
.video-bubble-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-bubble-play-btn { width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }

/* Media bubble — no padding, no border radius conflict */
.bubble.bubble-media { padding: 0 !important; overflow: hidden; background: transparent !important; box-shadow: none !important; border: none !important; }
.bubble.bubble-media .video-bubble-wrap { max-width: 100%; border-radius: 18px; }
.bubble.bubble-media img { display: block; max-width: 260px; border-radius: 18px; cursor: pointer; }
.bubble.bubble-media .bubble-meta { padding: .25rem .65rem .4rem; background: transparent; }

/* ══════════════════════════════════
   NEW SETTINGS UI
══════════════════════════════════ */
.settings-card { background: var(--surface); border-radius: 16px; margin: 0 .75rem .85rem; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.06); border: 1px solid var(--border); }
html.dark-mode .settings-card { box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.settings-section-title { font-size: .65rem; letter-spacing: .01em; color: var(--muted); font-weight: 700; padding: .75rem 1rem .35rem; }
.settings-item-row { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: .5px solid var(--border); cursor: default; transition: background .12s; }
.settings-item-row:last-child { border-bottom: none; }
.settings-item-row[onclick] { cursor: pointer; }
.settings-item-row[onclick]:hover  { background: var(--bg2); }
.settings-item-row[onclick]:active { background: var(--bg3); }
.settings-item-label { font-size: .88rem; color: var(--text); }
.settings-item-control { flex-shrink: 0; margin-inline-start: .5rem; }
.settings-edit-btn { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: .28rem .75rem; font-size: .75rem; cursor: pointer; color: var(--blue); font-family: inherit; font-weight: 600; transition: background .15s; }
.settings-edit-btn:active { background: var(--bg4); }
.settings-select { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .5rem; font-size: .75rem; color: var(--text); font-family: inherit; outline: none; }
.settings-danger-section { margin: 0 .75rem 1.5rem; }
.settings-danger-btn { width: 100%; padding: .75rem; background: #FFF1F2; border: 1px solid #FECDD3; border-radius: 12px; color: #E11D48; font-size: .88rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .15s; }
.settings-danger-btn:active { background: #FFE4E6; }
html.dark-mode .settings-danger-btn { background: rgba(225,29,72,.12); border-color: rgba(225,29,72,.25); color: #FB7185; }
html.dark-mode .settings-danger-btn:active { background: rgba(225,29,72,.2); }

/* ── Profile header (clean, no green) ── */
.settings-profile-hdr { display: flex; flex-direction: column; align-items: center; padding: 1.75rem 1rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.settings-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); border: 2.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 2rem; overflow: hidden; position: relative; cursor: pointer; }
.avatar-edit-btn { position: absolute; bottom: 0; inset-inline-end: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); cursor: pointer; }

/* ── Scroll fix — no jump ── */
/* Note: main .screen rules are defined above in SCREEN SYSTEM section */
.scroll-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scroll-behavior: auto; }

/* ── Performance: smooth transitions ── */
* { -webkit-tap-highlight-color: transparent; }
/* `loading` is an HTML attribute, not a CSS property — removed invalid rule */

/* ══════════════════════════════════
   LAZY LOADING / PERFORMANCE
══════════════════════════════════ */
/* Fade in images when they load */
img[loading="lazy"] { opacity: 0; transition: opacity .3s ease; }
img[loading="lazy"].loaded, img[loading="lazy"]:not([src=""]) { opacity: 1; }
img { opacity: 1; }

/* ══════════════════════════════════
   CONTENT FILTER — BLURRED WORDS
══════════════════════════════════ */
.blurred-word {
  filter: blur(6px);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  border-radius: 3px;
  display: inline-block;
  background: rgba(220, 38, 38, .08);
}

.chart-bar { flex: 1; border-radius: 3px 3px 0 0; background: rgba(31,111,92,.25); min-height: 4px; cursor: pointer; transition: background .2s; }
.chart-bar.today { background: #1F6F5C; }
.chart-bar:hover { background: #2B8A73; }

/* ══ POLL BUBBLE — Telegram style ══ */
.poll-bubble { min-width: 230px; max-width: 290px; padding: .15rem 0; }
.poll-question { font-size: .92rem; font-weight: 700; margin-bottom: .15rem; line-height: 1.35; }
.poll-description { font-size: .75rem; color: var(--muted); margin-bottom: .45rem; }
.poll-meta-line { font-size: .68rem; color: var(--muted); margin-bottom: .55rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.poll-opt {
  position: relative; padding: .52rem .75rem; border-radius: 10px;
  border: 1.5px solid var(--border); margin-bottom: .4rem;
  cursor: pointer; overflow: hidden; background: var(--bg3);
  transition: border-color .15s;
}
.poll-opt:hover { border-color: var(--blue); }
.poll-opt.voted { border-color: var(--blue); }
.poll-opt.correct { border-color: #22c55e; background: rgba(34,197,94,.08); }
.poll-opt.incorrect-selected { border-color: #ef4444; background: rgba(239,68,68,.08); }
.poll-opt-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: rgba(31,111,92,.12); border-radius: 10px;
  transition: width .5s ease; pointer-events: none;
}
.poll-opt-row { position: relative; display: flex; align-items: center; gap: .4rem; }
.poll-opt-text { flex: 1; font-size: .85rem; font-weight: 500; }
.poll-opt-pct { font-size: .78rem; font-weight: 700; color: var(--blue); }
.poll-opt-check { font-size: .78rem; font-weight: 700; width: 16px; text-align: center; }
.poll-voters-line { font-size: .65rem; color: var(--muted); margin-top: .2rem; }
.poll-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; font-size: .68rem; color: var(--muted); }

/* ══ STICKER FIX ══ */
.sticker-gif { width: 100px; height: 100px; object-fit: contain; border-radius: 8px; cursor: pointer; transition: transform .15s; }
.sticker-gif:hover { transform: scale(1.08); }

/* ══════════════════════════════════
   STATUS RING — chat list avatars
   (WhatsApp-style: shows when contact has an active status)
══════════════════════════════════ */
.chat-av.has-status-ring {
  box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 5px var(--blue);
  cursor: pointer;
}

/* ══ CHAT PAGE SCREEN SYSTEM ══ */
.chat-page {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--bg) !important;
  overflow: hidden !important;
}
.chat-page.hidden {
  display: none !important;
   }

/* ── Guided Support Chat (floating) ── */
#support-fab { position: fixed; bottom: 78px; inset-inline-end: 16px; width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: #fff; border: none; box-shadow: 0 4px 16px rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 6000; transition: transform .15s; }
#support-fab:active { transform: scale(.92); }
#guided-support { position: fixed; bottom: 0; right: 0; left: 0; margin: 0 auto; max-width: 440px; height: 80vh; max-height: 640px; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 30px rgba(0,0,0,.25); z-index: 7000; display: flex; flex-direction: column; overflow: hidden; animation: gsUp .22s ease; }
@keyframes gsUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.gs-header { background: linear-gradient(135deg, var(--gold), var(--gold-l)); color: #fff; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.gs-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.gs-body { flex: 1; overflow-y: auto; padding: 1rem .85rem; display: flex; flex-direction: column; gap: .5rem; background: var(--bg2); }
.gs-bubble { max-width: 82%; padding: .6rem .85rem; border-radius: 16px; font-size: .87rem; line-height: 1.45; unicode-bidi: plaintext; word-break: break-word; }
.gs-bot { align-self: flex-start; background: var(--surface); color: var(--text); border-end-start-radius: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.gs-user { align-self: flex-end; background: var(--gold); color: #fff; border-end-end-radius: 5px; }
.gs-options { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; margin-top: .25rem; }
.gs-opt { background: var(--surface); border: 1.5px solid var(--gold); color: var(--gold); padding: .55rem .9rem; border-radius: 18px; font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit; text-align: start; max-width: 88%; transition: background .15s; }
.gs-opt:active { background: var(--bg3); }
.gs-composer { display: flex; gap: .5rem; align-items: center; margin-top: .4rem; padding: .3rem 0; }

/* =============================================
   HOME REDESIGN — hero, composer, quick tiles
   ============================================= */

/* ── HERO GREETING CARD ── */
.home-hero {
  position: relative;
  margin: .75rem .85rem .25rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, #14503F 0%, #1F6F5C 62%, #2B8A73 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(20, 80, 63, .22);
}
.hh-glow {
  position: absolute; top: -60px; right: -40px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%);
  pointer-events: none;
}
.hh-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.hh-txt { min-width: 0; }
.hh-greet {
  font-family: 'Suez One', 'Heebo', serif;
  font-size: 1.45rem; line-height: 1.25;
  letter-spacing: .01em;
  text-shadow: 0 1px 3px rgba(0,0,0,.14);
  unicode-bidi: plaintext;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hh-date {
  margin-top: .3rem;
  font-size: .76rem; font-weight: 500;
  color: rgba(255,255,255,.82);
  unicode-bidi: plaintext;
}
.hh-badge {
  flex-shrink: 0;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(232,184,75,.18);
  border: 1px solid rgba(232,184,75,.55);
  color: #F3D27E;
  font-size: .74rem; font-weight: 700;
  white-space: nowrap;
  animation: fadeIn .6s ease both;
}

/* ── COMPOSER CARD ── */
.composer-card {
  margin: .65rem .85rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .85rem .9rem .75rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.cc-top { display: flex; align-items: flex-start; gap: .65rem; }
.cc-av {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-l));
  color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  background-size: cover; background-position: center;
}
.cc-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none; resize: none;
  font-family: inherit; font-size: .92rem; color: var(--text);
  padding: .5rem 0 .25rem; line-height: 1.45;
  max-height: 120px;
}
.cc-input::placeholder { color: var(--muted2); }
.cc-actions {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .55rem; padding-top: .6rem;
  border-top: 1px solid var(--border);
}
.cc-chip {
  padding: .42rem .75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit; font-size: .74rem; font-weight: 600;
  color: var(--text); cursor: pointer;
  transition: background .15s;
}
.cc-chip:hover  { background: var(--bg4); border-color: var(--border2); }
.cc-chip:active { background: var(--bg4); }
.cc-post {
  margin-inline-start: auto;
  padding: .48rem 1.1rem;
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  border: none; border-radius: 999px;
  font-family: inherit; font-size: .78rem; font-weight: 700;
  color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(20,80,63,.25);
  transition: transform .12s;
}
.cc-post:active { transform: scale(.96); }

/* ── QUICK TILES ── */
.qt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .55rem;
  margin: .75rem .85rem 0;
}
.qt-tile {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .75rem .25rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer; font-family: inherit;
  transition: transform .12s, box-shadow .12s;
}
.qt-tile:hover  { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.qt-tile:active { transform: scale(.95); box-shadow: none; }
.qt-ic {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.qt-ic-shorts  { background: linear-gradient(135deg, #E2574C, #F08A4B); }
.qt-ic-music   { background: linear-gradient(135deg, #7C5CD6, #A78BFA); }
.qt-ic-chat    { background: linear-gradient(135deg, #14503F, #2B8A73); }
.qt-ic-explore { background: linear-gradient(135deg, #2563AC, #4A9BE0); }
.qt-lbl { font-size: .68rem; font-weight: 700; color: var(--text); }

/* ── SHORT / CHANNEL PREVIEW CARDS ── */
.sp-card {
  flex-shrink: 0; width: 106px; cursor: pointer;
  transition: transform .15s var(--ease-standard);
}
.sp-card:hover { transform: translateY(-2px); }
.sp-card:active { transform: scale(.96); }
.sp-thumb {
  width: 106px; height: 168px; border-radius: 14px;
  background: #101112; overflow: hidden; position: relative;
  border: 1px solid var(--border);
}
.chp-card {
  flex-shrink: 0; width: 128px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .85rem .6rem .75rem;
  text-align: center; cursor: pointer;
  transition: transform .12s;
}
.chp-card:hover  { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.chp-card:active { transform: scale(.96); box-shadow: none; }

/* ── EMPTY FEED CTA ── */
.feed-empty-cta {
  padding: .55rem 1.35rem;
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  border: none; border-radius: 999px;
  color: #fff; font-size: .82rem; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 3px 10px rgba(20,80,63,.25);
}

/* God-mode chat filter buttons */
.cw-fbtn { padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg3); color: var(--muted); font-size: .76rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.cw-fbtn.on { background: #1F6F5C; color: #fff; border-color: #1F6F5C; }

/* ── Music / audio-file card (Telegram-style) ── */
.music-card { display: flex; align-items: center; gap: .65rem; min-width: 230px; max-width: 290px; padding: .15rem .05rem; }
.music-play { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.28); border: none; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .12s; }
.bubble.them .music-play { background: var(--gold, #1F6F5C); color: #fff; }
.music-play:active { transform: scale(.9); }
.music-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: .28rem; }
.music-title { font-size: .86rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-prog { height: 4px; border-radius: 3px; background: rgba(255,255,255,.28); cursor: pointer; overflow: hidden; }
.bubble.them .music-prog { background: rgba(31,111,92,.18); }
.music-prog-fill { height: 100%; width: 0%; border-radius: 3px; background: #fff; transition: width .1s linear; }
.bubble.them .music-prog-fill { background: #1F6F5C; }
.music-sub { display: flex; align-items: center; justify-content: space-between; font-size: .68rem; font-variant-numeric: tabular-nums; opacity: .8; }
.music-badge { font-weight: 700; opacity: .85; }

/* ── Poll readability on the green "me" bubble (was low-contrast/unreadable) ── */
.bubble.me .poll-question,
.bubble.me .poll-description { color: #12241d !important; }
html.dark-mode .bubble.me .poll-question,
html.dark-mode .bubble.me .poll-description { color: #fff !important; }
.bubble.me .poll-meta-line,
.bubble.me .poll-voters-line,
.bubble.me .poll-footer-row { color: #4c8a63 !important; }
html.dark-mode .bubble.me .poll-meta-line,
html.dark-mode .bubble.me .poll-voters-line,
html.dark-mode .bubble.me .poll-footer-row { color: rgba(255,255,255,.82) !important; }
.bubble.me .poll-opt {
  background: rgba(255,255,255,.96) !important;
  border-color: rgba(255,255,255,.35) !important;
}
.bubble.me .poll-opt-text { color: #1a1a1a !important; }
.bubble.me .poll-opt-pct { color: #1F6F5C !important; }
.bubble.me .poll-opt-fill { background: rgba(31,111,92,.20) !important; }
.bubble.me .poll-opt.voted { border-color: #fff !important; }
.bubble.me .poll-opt-check { border-color: #9ab8ae !important; }
.bubble.me .poll-opt.voted .poll-opt-check { background: #1F6F5C !important; border-color: #1F6F5C !important; }
.bubble.me .poll-close-btn { color: #c0392b !important; }
html.dark-mode .bubble.me .poll-close-btn { color: #ffd0d0 !important; }
.bubble.me .poll-add-suggest-btn { color: #1F6F5C !important; border-color: rgba(31,111,92,.4) !important; }
html.dark-mode .bubble.me .poll-add-suggest-btn { color: #fff !important; border-color: rgba(255,255,255,.4) !important; }
/* A touch more polish for both sides */
.poll-opt { transition: border-color .15s, background .15s; }

/* ───────────────────────────────────────────────────────────────────────────
   Desktop & large screens
   ───────────────────────────────────────────────────────────────────────────
   The app was built phone-first: every screen is `position:fixed; inset:0`, so
   on a monitor a chat list stretched across two thousand pixels and a message
   bubble floated alone in an ocean of white. There were no media queries at all.

   Rather than rewrite the layout, these rules reshape it at the edges:
   the messenger becomes two columns the way every desktop messenger is, and
   everything else is held to a readable column instead of being stretched.
   Below 1000px nothing here applies, so the phone layout is untouched.
   ─────────────────────────────────────────────────────────────────────────── */

@media (min-width: 1000px) {
  /* The surround the app now sits on. */
  body { background: var(--bg2, #0e1621); }

  /* ── Messenger: list on the left, conversation on the right ── */
  #screen-chats {
    right: auto !important;
    width: 400px !important;
    border-inline-end: 1px solid var(--line);
  }
  /* On a phone the list hides when a chat opens. On a monitor there's room for
     both, and hiding it is the thing that makes a desktop app feel wrong. */
  #screen-chats.hidden { display: flex !important; }

  #screen-chatroom { left: 400px !important; }
  /* The conversation pane stays put with nothing in it rather than collapsing. */
  #screen-chatroom.hidden { display: flex !important; }
  #screen-chatroom.hidden > * { display: none !important; }
  #screen-chatroom.hidden::after {
    content: 'Select a chat to start messaging';
    margin: auto;
    color: var(--muted);
    font-size: .9rem;
  }

  /* Bubbles shouldn't run the width of a monitor — that's unreadable. */
  #screen-chatroom .bubble { max-width: min(70%, 560px); }
  .chat-messages { padding-inline: 8%; }

  /* ── Everything else: a centred column, not a stretched one ── */
  .screen {
    left: 50% !important;
    right: auto !important;
    width: 100%;
    max-width: 520px;
    transform: translateX(-50%);
    border-inline-start: 1px solid var(--line);
    border-inline-end: 1px solid var(--line);
  }

  /* Sheets and overlays are full-screen by design; keep them that way. */
  #media-viewer, #sv-overlay, #global-search-modal,
  #tg-info, #follow-list, #adm-user-list, #post-composer {
    left: 0 !important; right: 0 !important;
    max-width: none; transform: none;
  }

  /* A pointer gets hover feedback; a finger never did. */
  .chat-item:hover { background: var(--bg3); }
  .tg-tab:hover { opacity: .85; }
}

/* Very wide: let the conversation breathe without the bubbles drifting apart. */
@media (min-width: 1500px) {
  #screen-chats { width: 440px !important; }
  #screen-chatroom { left: 440px !important; }
  .chat-messages { padding-inline: 14%; }
}

/* ── Touch devices: disable hover lift so it doesn't "stick" after tapping ── */
@media (hover: none) {
  .qt-tile:hover,
  .chp-card:hover,
  .sp-card:hover,
  .feed-post:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .nav-item:hover { color: var(--muted); }
  .nav-item:hover .nav-icon { background: transparent; }
  .cc-chip:hover { background: var(--bg3); border-color: var(--border); }
  .settings-item-row[onclick]:hover { background: transparent; }
}

/* Tablets: too wide for a phone layout, too narrow to split in two. Hold the
   content to a column so it doesn't stretch, and leave the flow alone. */
@media (min-width: 700px) and (max-width: 999px) {
  body { background: var(--bg2, #0e1621); }
  .screen, .chat-page {
    left: 50% !important;
    right: auto !important;
    width: 100%;
    max-width: 560px;
    transform: translateX(-50%);
    border-inline-start: 1px solid var(--line);
    border-inline-end: 1px solid var(--line);
  }
  #media-viewer, #sv-overlay, #global-search-modal,
  #tg-info, #follow-list, #adm-user-list, #post-composer {
    left: 0 !important; right: 0 !important;
    max-width: none; transform: none;
  }
}

/* Small phones (< 360px, e.g. iPhone SE 1st gen, Galaxy A-series):
   tighten padding so nothing gets clipped or squished. */
@media (max-width: 359px) {
  .topbar        { padding: .7rem .75rem; }
  .section-hdr   { padding: 1rem .65rem .5rem; }
  .feed-post     { border-radius: 12px; }
  .post-caption  { padding: .3rem .65rem .6rem; font-size: .84rem; }
  .modal-sheet   { padding: 1.25rem 1rem max(1.25rem, env(safe-area-inset-bottom)); }
  .nav-icon      { width: 48px; }
  .nav-label     { font-size: .6rem; }
  .ch-prev-card  { width: 110px; padding: .75rem .5rem; }
  .short-prev    { width: 95px; height: 160px; }
  .qt-tile       { min-width: 150px; padding: .7rem .65rem; }
}

/* Respect users who prefer less motion — near-instant everything. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Telegram-style grouped Group/Channel info screen
   ============================================================ */
#screen-chatinfo { background: var(--bg2); }
html.dark-mode #screen-chatinfo { background: var(--bg); }
#screen-chatinfo .scroll-area { padding-bottom: 90px !important; }

/* Hero: big gradient avatar on the gray background, centered */
#screen-chatinfo .userinfo-hero {
  background: transparent; border-bottom: none; padding: 1.75rem 1.5rem 1.25rem;
}
#screen-chatinfo .userinfo-avatar-big {
  width: 112px; height: 112px; font-size: 2.9rem; margin: 0 auto 1rem;
  background: linear-gradient(135deg, #2E9E82, #1F6F5C);
  box-shadow: 0 6px 20px rgba(31,111,92,.28); color: #fff;
}
#screen-chatinfo .userinfo-name { font-size: 1.42rem; font-weight: 800; }
#screen-chatinfo .userinfo-sub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }

/* Everything below becomes white rounded cards floating on gray */
#screen-chatinfo .userinfo-action-row {
  background: var(--surface); border: none; border-radius: 16px;
  margin: .5rem .85rem; padding: .7rem .3rem; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#screen-chatinfo .uinfo-action-icon { background: #EAF3F0; }
html.dark-mode #screen-chatinfo .uinfo-action-icon { background: #1C2A26; }

/* Tabs: a white card with a rounded active "pill" */
#screen-chatinfo .userinfo-media-tabs {
  background: var(--surface); border: none; border-radius: 16px;
  margin: .5rem .85rem; padding: .35rem; gap: .2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#screen-chatinfo .userinfo-mtab {
  border: none; border-radius: 11px; padding: .55rem .95rem;
  font-weight: 600; color: var(--muted); white-space: nowrap; background: transparent;
}
#screen-chatinfo .userinfo-mtab.active {
  background: #E4F1EC; color: #1F6F5C;
}
html.dark-mode #screen-chatinfo .userinfo-mtab.active { background: #1C2A26; color: #4FD1AC; }

/* Members section as a white card */
#screen-chatinfo #info-members-section {
  background: var(--surface); border-radius: 16px; margin: .5rem .85rem;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#screen-chatinfo #info-members-section > div:first-child {
  padding: .9rem 1.1rem .5rem !important; font-weight: 700;
}
#screen-chatinfo #members-list > div:last-child { border-bottom: none !important; }

/* The media/files/etc. content area also becomes a card */
#screen-chatinfo #info-media-content,
#screen-chatinfo .userinfo-media-content {
  background: var(--surface); border-radius: 16px; margin: .5rem .85rem;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.04); min-height: 60px;
}

/* Floating add-member button (Telegram-style) */
#info-fab-add {
  position: absolute; inset-inline-end: 18px; bottom: 24px; width: 56px; height: 56px;
  border-radius: 50%; background: linear-gradient(135deg,#2E9E82,#1F6F5C);
  box-shadow: 0 6px 18px rgba(31,111,92,.4); display: none;
  align-items: center; justify-content: center; cursor: pointer; z-index: 20;
}

/* Telegram-style light-green "me" bubble — adaptive tick/waveform colors */
.read-ticks { color: #4c9e70; display: inline-flex; align-items: center; }
.bubble.me .read-ticks { color: #4c9e70; }
html.dark-mode .bubble.me .read-ticks { color: rgba(255,255,255,.85); }
html.dark-mode .bubble.me .vbar { background: rgba(255,255,255,.4); }
html.dark-mode .bubble.me .vbar.played { background: #fff; }
html.dark-mode .bubble.me .play-voice { background: rgba(255,255,255,.95); color: #14503F; }
html.dark-mode .bubble.me .voice-speed-btn { background: rgba(255,255,255,.22); color: #fff; }
html.dark-mode .bubble.me .voice-dur { color: rgba(255,255,255,.85); }

/* Telegram-style message grouping: spacer keeps bubbles aligned when a grouped
   message has no avatar, and grouped (non-last) messages sit tighter together. */
.msg-mini-av-spacer { width: 28px; flex-shrink: 0; }
.msg-wrap.grp-tight { margin-bottom: 2px; }

/* ══════════ Instagram-style channel/feed posts ══════════ */
.ig-post { background: var(--surface); border-bottom: 1px solid var(--border); margin: 0 0 0; padding: 0 0 .5rem; }
.ig-post-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem; }
.ig-post-user { display: flex; align-items: center; gap: .55rem; cursor: pointer; min-width: 0; }
.ig-post-av { width: 34px; height: 34px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; background-color: var(--bg3); }
.ig-post-av-init { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #2E9E82, #1F6F5C); }
.ig-post-names { display: flex; align-items: center; gap: .3rem; min-width: 0; }
.ig-post-name { font-weight: 700; font-size: .9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.ig-post-menu { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.ig-post-media { width: 100%; background: #000; line-height: 0; }
.ig-post-media img, .ig-post-media video { width: 100%; max-height: 82vh; object-fit: contain; display: block; }
.ig-post-emoji { line-height: 1; font-size: 4.5rem; text-align: center; padding: 2.2rem 1rem; background: var(--bg2); }
.ig-post-actions { display: flex; align-items: center; gap: 1rem; padding: .6rem .8rem .1rem; color: var(--text); }
.ig-act { background: none; border: none; color: inherit; cursor: pointer; padding: 0; display: flex; align-items: center; transition: transform .1s; }
.ig-act:active { transform: scale(.85); }
.ig-act.liked { color: #ed4956; }
.ig-views { margin-inline-start: auto; display: flex; align-items: center; font-size: .82rem; color: var(--muted); }
.ig-post-likes { font-weight: 700; font-size: .88rem; padding: .15rem .85rem 0; color: var(--text); }
.ig-post-caption { font-size: .9rem; line-height: 1.4; padding: .2rem .85rem 0; color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; unicode-bidi: plaintext; }
.ig-post-caption b { font-weight: 700; cursor: pointer; margin-inline-end: .3rem; }
.ig-post-comments { font-size: .86rem; color: var(--muted); padding: .3rem .85rem 0; cursor: pointer; }
.ig-post-time { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: .35rem .85rem 0; }

/* ══════════ Modern settings polish ══════════ */
/* Google Material Symbols (Rounded) base class — variable font, so weight/fill/
   grade/optical-size are set via font-variation-settings. direction:ltr keeps
   the ligature names resolving correctly inside the RTL app. */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}
.settings-icon-badge { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #35B090, #1F6F5C); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .95rem; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.settings-icon-badge svg { width: 17px; height: 17px; stroke: #fff; }
.settings-icon-badge .material-symbols-rounded { font-size: 18px; color: #fff; font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.settings-item-row { padding: .7rem .9rem; gap: .6rem; }
.settings-item-label { font-weight: 500; }
.settings-section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; padding: 1rem 1rem .4rem; }
.settings-profile-hdr { background: linear-gradient(160deg, rgba(31,111,92,.10), var(--surface) 60%); }
html.dark-mode .settings-profile-hdr { background: linear-gradient(160deg, rgba(46,158,130,.16), var(--surface) 60%); }
.settings-avatar { border: 3px solid #fff; box-shadow: 0 3px 12px rgba(0,0,0,.12); }
html.dark-mode .settings-avatar { border-color: var(--surface); }

/* ══════════ Voice/Video calls ══════════ */
#call-overlay { position: fixed; inset: 0; z-index: 100080; background: radial-gradient(120% 100% at 50% 0%, #14313a 0%, #0b141a 70%); display: flex; align-items: center; justify-content: center; }
#call-top-bar { position: absolute; top: max(1rem, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; z-index: 4; pointer-events: none; }
.call-top-name { color: #fff; font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
#call-top-status { color: rgba(255,255,255,.8); font-size: .8rem; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
#call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0b141a; }
#call-remote-fallback { position: relative; z-index: 1; text-align: center; color: #fff; }
#call-local-video { position: absolute; top: max(4.5rem, calc(env(safe-area-inset-top) + 3.5rem)); inset-inline-end: 1rem; width: 108px; height: 156px; object-fit: cover; border-radius: 16px; border: 2px solid rgba(255,255,255,.4); background: #1a2730; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.5); cursor: grab; touch-action: none; transform: scaleX(-1); }
.call-av-big { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 1rem; background: linear-gradient(135deg, #35B090, #1F6F5C); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 800; color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.call-peer-name { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: .3rem; }
#call-status { color: #cbd5e1; font-size: .9rem; }
.call-controls { position: absolute; bottom: max(2rem, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; padding: 0 1rem; z-index: 6; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); transition: transform .1s, background .15s; }
.call-btn:active { transform: scale(.9); }
.call-btn-off { background: #fff; color: #0b141a; }
.call-btn-end { background: #ef4444; }
.call-btn-accept { background: #22c55e; }
#call-incoming { position: fixed; inset: 0; z-index: 100090; background: rgba(11,20,26,.97); display: flex; align-items: center; justify-content: center; }
.call-inc-card { text-align: center; padding: 2rem; }
.cr-call-btn { display: none; }
.cr-call-btn.show { display: flex; }

/* Group call grid */
#gcall-overlay { position: fixed; inset: 0; z-index: 100080; background: #0b141a; display: flex; flex-direction: column; }
#gcall-grid { flex: 1; display: grid; gap: 4px; padding: 4px; padding-top: max(4px, env(safe-area-inset-top)); align-content: center; }
.gtile { position: relative; background: #1a2730; border-radius: 12px; overflow: hidden; min-height: 0; aspect-ratio: 3/4; }
.gtile video { width: 100%; height: 100%; object-fit: cover; }
.gtile-name { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.5); color: #fff; font-size: .72rem; padding: .1rem .45rem; border-radius: 6px; }

/* God Mode feed filters */
.gm-filter { background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .74rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; cursor: pointer; font-family: inherit; }
.gm-filter.active { background: #1F6F5C; color: #fff; border-color: #1F6F5C; }

/* In-chat call log (missed / ended) */
.sys-msg.call-log { cursor: pointer; }
.sys-msg.call-log span { background: rgba(31,111,92,.12); color: #1F6F5C; font-weight: 600; }
.sys-msg.call-log.missed span { background: rgba(225,29,72,.12); color: #E11D48; }
html.dark-mode .sys-msg.call-log span { background: rgba(53,176,144,.2); color: #6fe0c0; }
html.dark-mode .sys-msg.call-log.missed span { background: rgba(255,120,140,.18); color: #ff9db0; }



/* ══════════ X / Twitter-style channel feed ══════════ */
.x-feed { display: flex; flex-direction: column; }
.x-post { display: flex; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.x-post:active { background: var(--bg3); }
.x-post-av { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; background-size: cover; background-position: center; background-color: var(--bg3); }
.x-post-av-init { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #35B090, #1F6F5C); }
.x-post-body { flex: 1; min-width: 0; }
.x-post-head { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; font-size: .9rem; }
.x-post-name { font-weight: 700; color: var(--text); }
.x-post-handle, .x-post-time, .x-post-dot { color: var(--muted); font-weight: 400; }
.x-post-text { margin: .15rem 0 .1rem; color: var(--text); font-size: .95rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; }
.x-post-media { margin: .55rem 0 .2rem; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.x-post-media img, .x-post-media video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.x-post-actions { display: flex; align-items: center; justify-content: space-between; max-width: 340px; margin-top: .5rem; }
.x-act { display: flex; align-items: center; gap: .3rem; background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: .2rem; border-radius: 8px; transition: color .12s; }
.x-act span { font-size: .78rem; }
.x-act:active { transform: scale(.9); }
.x-act-like.liked { color: #f91880; }
.x-act-rt:active { color: #00ba7c; }
.x-views { pointer-events: none; }

/* =============================================
   SYSTEM DARK MODE — auto-detect via OS setting
   When no .dark-mode class is set, follow the OS preference.
   ============================================= */
@media (prefers-color-scheme: dark) {
  html:not(.light-mode) {
    --bg:      #121314;
    --bg2:     #1B1C1E;
    --bg3:     #232427;
    --bg4:     #2C2D31;
    --surface: #1B1C1E;
    --surface-2: #232427;
    --border:  rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.16);
    --line:    rgba(255, 255, 255, 0.08);
    --text:    #EDEDEC;
    --muted:   #9A9DA6;
    --muted2:  #6B6E78;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.24);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
    --shadow-md: 0 4px 18px rgba(0,0,0,.38);
    --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
  }
}

/* =============================================
   SKELETON / SHIMMER LOADING
   Placeholder animations shown while content loads
   ============================================= */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
/* skeleton/shimmer styles moved to end-of-file Modern UI Upgrade section */
.skeleton-chat-item {
  display: flex; align-items: center; gap: .9rem;
  padding: .95rem 1.1rem;
}
.skeleton-chat-item .skeleton-circle { width: 54px; height: 54px; flex-shrink: 0; }
.skeleton-chat-item .skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.skeleton-chat-item .skeleton-line-1 { height: 14px; width: 55%; }
.skeleton-chat-item .skeleton-line-2 { height: 11px; width: 80%; }
.skeleton-shorts-strip,
.skeleton-channels-strip {
  display: flex; gap: .65rem;
}

/* =============================================
   MODAL / OVERLAY BACKDROP BLUR
   ============================================= */
.upload-modal,
.hamburger-overlay,
#global-search-modal,
#media-viewer {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* =============================================
   COLORED TOAST VARIANTS
   ============================================= */
#app-toast {
  position: fixed;
  bottom: 5.5rem; left: 50%;
  transform: translateX(-50%) translateY(12px) scale(.95);
  z-index: 99999;
  opacity: 0;
  transition: opacity .3s var(--ease-standard), transform .3s var(--ease-standard);
  pointer-events: none;
  padding: .65rem 1.25rem;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(20,21,26,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  text-align: center;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app-toast.show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}
#app-toast.toast-success {
  background: rgba(46,125,50,.92);
}
#app-toast.toast-error {
  background: rgba(211,47,47,.92);
}
#app-toast.toast-info {
  background: rgba(31,111,92,.92);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.95); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* =============================================
   SMOOTH SCREEN TRANSITIONS
   ============================================= */
.screen {
  transition: opacity .18s var(--ease-standard);
}
.screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* =============================================
   PULL TO REFRESH
   ============================================= */
.ptr-indicator {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%) translateY(-50px);
  z-index: 30; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease-standard), opacity .3s;
  opacity: 0; pointer-events: none;
}
.ptr-indicator.pulling { opacity: 1; }
.ptr-indicator.refreshing { opacity: 1; transform: translateX(-50%) translateY(16px); }
.ptr-indicator svg { width: 22px; height: 22px; color: var(--gold); transition: transform .2s; }
.ptr-indicator.refreshing svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* =============================================
   DOUBLE-TAP HEART ANIMATION
   ============================================= */
@keyframes heart-burst {
  0%   { transform: translate(-50%,-50%) scale(0); opacity: 1; }
  40%  { transform: translate(-50%,-50%) scale(1.2); opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(.95); opacity: .9; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}
.dbl-tap-heart {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0);
  font-size: 80px; pointer-events: none; z-index: 20;
  animation: heart-burst .8s var(--ease-spring) forwards;
  filter: drop-shadow(0 4px 12px rgba(237,73,86,.5));
}

/* =============================================
   IMAGE LAZY LOAD + BLUR PLACEHOLDER
   ============================================= */
.img-blur-wrap {
  position: relative; overflow: hidden; background: var(--bg3);
}
.img-blur-wrap img {
  transition: filter .4s ease, opacity .4s ease;
}
.img-blur-wrap img.loading {
  filter: blur(20px); opacity: .6;
  transform: scale(1.05);
}
.img-blur-wrap img.loaded {
  filter: blur(0); opacity: 1;
  transform: scale(1);
}

/* =============================================
   ENHANCED SCREEN TRANSITIONS
   ============================================= */
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-up-fade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.active.anim-right { animation: slide-in-right .25s var(--ease-standard) both; }
.screen.active.anim-left  { animation: slide-in-left .25s var(--ease-standard) both; }
.screen.active.anim-up    { animation: slide-up-fade .22s var(--ease-standard) both; }

/* =============================================
   ENHANCED TOAST NOTIFICATION
   ============================================= */
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.9); }
}
#app-toast.toast-in {
  animation: toast-slide-in .35s var(--ease-spring) forwards;
}
#app-toast.toast-out {
  animation: toast-slide-out .25s ease forwards;
}

/* =============================================
   ENHANCED SKELETON PULSE VARIANT
   ============================================= */
@keyframes skeleton-pulse {
  0%, 100% { opacity: .6; }
  50%      { opacity: .3; }
}
.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  background: var(--bg3);
  border-radius: 8px;
}

/* =============================================
   ONLINE STATUS DOT (enhanced)
   ============================================= */
.online-dot-pulse {
  position: absolute; bottom: 1px; inset-inline-end: 1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #2E7D32; border: 2.5px solid var(--surface);
  z-index: 5;
}
@keyframes online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,50,.5); }
  50%      { box-shadow: 0 0 0 4px rgba(46,125,50,0); }
}
.online-dot-pulse.pulse { animation: online-pulse 2s ease infinite; }

/* =============================================
   PROFILE SCREEN POLISH — cover photo + stats
   ============================================= */
.profile-cover {
  width: 100%; height: 140px;
  background: linear-gradient(135deg, #14503F 0%, #1F6F5C 50%, #2B8A73 100%);
  position: relative; overflow: hidden;
}
.profile-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-cover-glow {
  position: absolute; bottom: -40px; right: -20px;
  width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
  pointer-events: none;
}
.profile-avatar-wrap {
  display: flex; justify-content: center; margin-top: -40px;
  position: relative; z-index: 5;
}
.profile-avatar-big {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg3); border: 4px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--muted);
  overflow: hidden; box-shadow: var(--shadow-md);
  background-size: cover; background-position: center;
}
.profile-stats-row {
  display: flex; justify-content: center; gap: 1.75rem;
  padding: .85rem 0 .5rem;
}
.profile-stat {
  text-align: center; cursor: pointer;
}
.profile-stat-val {
  font-size: 1.15rem; font-weight: 800; color: var(--text);
}
.profile-stat-lbl {
  font-size: .68rem; color: var(--muted); margin-top: .1rem;
}
.profile-bio {
  font-size: .85rem; color: var(--muted); text-align: center;
  padding: .25rem 1.5rem .75rem; line-height: 1.5;
  unicode-bidi: plaintext;
}
.profile-actions-row {
  display: flex; gap: .5rem; justify-content: center; padding: 0 1rem .85rem;
}
.profile-action-btn {
  padding: .5rem 1.25rem; border-radius: 20px;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .15s;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--text);
}
.profile-action-btn.primary {
  background: var(--gold); color: #fff;
  border-color: var(--gold);
}
.profile-action-btn:active { transform: scale(.96); }

/* =============================================
   LIKE BUTTON BOUNCE ANIMATION
   ============================================= */
@keyframes like-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.3); }
  60%  { transform: scale(.9); }
  100% { transform: scale(1); }
}
.ig-act.liked svg {
  animation: like-bounce .4s var(--ease-spring);
}

/* =============================================
   SWIPE HINT (subtle indicator for tab navigation)
   ============================================= */
.swipe-hint {
  position: fixed; top: 50%; z-index: 50; pointer-events: none;
  width: 4px; height: 60px; border-radius: 2px;
  background: var(--border2); opacity: 0;
  transition: opacity .2s;
}
.swipe-hint.left  { left: 2px; transform: translateY(-50%); }
.swipe-hint.right { right: 2px; transform: translateY(-50%); }
.swipe-hint.show  { opacity: .5; }

/* =============================================================
   MATERIAL DESIGN 3 — COMPREHENSIVE UPGRADE
   12 features: ripple, floating labels, nav pill, surface tint,
   snackbar, bottom sheet drag, filter chips, segmented button,
   collapsing topbar, card refresh, page transitions, icon btns
   ============================================================= */

/* ── 1. RIPPLE EFFECT (Google-style touch feedback) ── */
.ripple-host {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  z-index: 0;
}
.ripple-wave.expanding {
  animation: m3-ripple-in .5s cubic-bezier(.2,.8,.2,1) forwards;
}
.ripple-wave.fading {
  animation: m3-ripple-out .35s ease forwards;
}
@keyframes m3-ripple-in {
  0%   { transform: scale(0); opacity: .14; }
  100% { transform: scale(2.5); opacity: .06; }
}
@keyframes m3-ripple-out {
  from { opacity: .06; }
  to   { opacity: 0; }
}

/* ── 2. FLOATING LABELS (Material 3 text fields) ── */
.m3-field-wrap {
  position: relative;
  margin-bottom: .85rem;
}
.m3-field-wrap .field {
  margin-bottom: 0;
  padding-top: 1.4rem;
  padding-bottom: .5rem;
}
.m3-field-label {
  position: absolute;
  top: 50%;
  left: 1.05rem;
  transform: translateY(-50%);
  font-size: .9rem;
  color: var(--muted2);
  pointer-events: none;
  transition: all .2s var(--ease-standard);
  transform-origin: left center;
  background: transparent;
  line-height: 1;
}
.m3-field-wrap .field:focus ~ .m3-field-label,
.m3-field-wrap .field.has-value ~ .m3-field-label {
  top: .6rem;
  transform: translateY(0) scale(.78);
  color: var(--accent);
  font-weight: 600;
}
.m3-field-wrap .field::placeholder { opacity: 0; transition: opacity .15s; }
.m3-field-wrap .field:focus::placeholder { opacity: .5; }

/* ── 3. NAV INDICATOR PILL (animated, Material 3) ── */
.bottom-nav { position: relative; }
.m3-nav-pill {
  position: absolute;
  top: .55rem;
  height: 30px;
  width: 56px;
  border-radius: 16px;
  background: rgba(31,111,92,.12);
  transition: left .3s var(--ease-spring);
  z-index: 0;
  pointer-events: none;
}
html.dark-mode .m3-nav-pill {
  background: rgba(63,191,161,.15);
}

/* ── 4. SURFACE TINT UTILITY CLASSES ── */
.m3-tint-1 { background-color: var(--surface); background-image: linear-gradient(var(--m3-surface-1), var(--m3-surface-1)); }
.m3-tint-2 { background-color: var(--surface); background-image: linear-gradient(var(--m3-surface-2), var(--m3-surface-2)); }
.m3-tint-3 { background-color: var(--surface); background-image: linear-gradient(var(--m3-surface-3), var(--m3-surface-3)); }

/* ── 5. SNACKBAR (Material 3 — replaces toast with action) ── */
.m3-snackbar {
  position: fixed;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 260px;
  max-width: min(92vw, 480px);
  padding: .75rem .75rem .75rem 1.1rem;
  border-radius: 14px;
  background: #323232;
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform .4s var(--ease-spring), opacity .3s;
  opacity: 0;
  pointer-events: none;
}
html.dark-mode .m3-snackbar {
  background: #E0E0E0;
  color: #1B1C1E;
}
.m3-snackbar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.m3-snackbar-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.m3-snackbar-action {
  background: none;
  border: none;
  color: #9ECAFF;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
  padding: .35rem .65rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.m3-snackbar-action:hover { background: rgba(255,255,255,.1); }
html.dark-mode .m3-snackbar-action { color: #1F6F5C; }
html.dark-mode .m3-snackbar-action:hover { background: rgba(0,0,0,.06); }
.m3-snackbar-close {
  background: none;
  border: none;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  padding: .2rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.m3-snackbar-close:hover { opacity: .9; }

/* ── 6. BOTTOM SHEET DRAG GESTURE ── */
.m3-drag-handle {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border2);
  margin: 0 auto 1rem;
  cursor: grab;
  flex-shrink: 0;
}
.modal-sheet.m3-dragging {
  transition: none !important;
}

/* ── 7. FILTER CHIPS (Material 3) ── */
.m3-chip-row {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: .5rem .85rem;
  flex-shrink: 0;
}
.m3-chip-row::-webkit-scrollbar { display: none; }
.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .42rem .9rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid var(--border2);
  background: transparent;
  color: var(--text);
  transition: all .2s var(--ease-standard);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.m3-chip:active { transform: scale(.95); }
.m3-chip.selected {
  background: rgba(31,111,92,.14);
  border-color: var(--accent);
  color: var(--accent);
}
html.dark-mode .m3-chip.selected {
  background: rgba(63,191,161,.18);
  color: #4FD1AC;
  border-color: #4FD1AC;
}
.m3-chip .m3-chip-check {
  display: inline-flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  transition: width .2s var(--ease-standard);
}
.m3-chip.selected .m3-chip-check {
  width: 18px;
}

/* ── 8. SEGMENTED BUTTON (Material 3) ── */
.m3-segmented {
  display: flex;
  border: 1.5px solid var(--border2);
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
}
.m3-seg-btn {
  flex: 1;
  padding: .5rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text);
  transition: all .22s var(--ease-standard);
  position: relative;
  overflow: hidden;
  z-index: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.m3-seg-btn + .m3-seg-btn {
  border-inline-start: 1.5px solid var(--border2);
}
.m3-seg-btn.active {
  background: rgba(31,111,92,.14);
  color: var(--accent);
}
html.dark-mode .m3-seg-btn.active {
  background: rgba(63,191,161,.18);
  color: #4FD1AC;
}
.m3-seg-check {
  display: none;
  width: 16px;
  height: 16px;
}
.m3-seg-btn.active .m3-seg-check {
  display: inline-flex;
}

/* ── 9. COLLAPSING TOP APP BAR (Material 3 medium) ── */
.topbar.m3-collapsible {
  flex-direction: column;
  align-items: stretch;
  padding: .85rem 1.1rem .6rem;
  transition: padding .3s var(--ease-standard);
}
.topbar.m3-collapsible .topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m3-topbar-title-large {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-top: .45rem;
  opacity: 1;
  max-height: 44px;
  transition: opacity .22s var(--ease-standard), max-height .28s var(--ease-standard), margin .28s var(--ease-standard);
  overflow: hidden;
  color: var(--text);
}
.topbar.m3-collapsible.shrunk {
  padding-bottom: .85rem;
}
.topbar.m3-collapsible.shrunk .m3-topbar-title-large {
  opacity: 0;
  max-height: 0;
  margin-top: 0;
}

/* ── 10. CARD SYSTEM REFRESH (tonal elevation) ── */
.feed-post {
  border: none;
  border-radius: 20px;
  box-shadow: none;
  background-image: linear-gradient(var(--m3-surface-1), var(--m3-surface-1));
}
.feed-post:hover {
  border-color: transparent;
  box-shadow: none;
  background-image: linear-gradient(var(--m3-surface-2), var(--m3-surface-2));
}
.ch-prev-card {
  border: none;
  box-shadow: none;
  background-image: linear-gradient(var(--m3-surface-1), var(--m3-surface-1));
}
.ch-prev-card:hover { box-shadow: none; }
.qt-tile {
  border: none;
  background-image: linear-gradient(var(--m3-surface-1), var(--m3-surface-1));
}
.composer-card {
  border: none;
  background-image: linear-gradient(var(--m3-surface-1), var(--m3-surface-1));
}
.ig-post {
  border-bottom-color: var(--border);
}
.ig-post::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: .85rem;
  right: .85rem;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}
.ig-post:last-child::after { display: none; }

/* ── 11. PAGE TRANSITIONS (Material motion: fade through) ── */
@keyframes m3-fade-through-in {
  0%   { opacity: 0; transform: scale(.94); }
  40%  { opacity: 0; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes m3-container-in {
  0%   { opacity: 0; transform: translateY(8px) scale(.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.screen.active.m3-enter {
  animation: m3-container-in .3s var(--ease-standard) both;
}
.screen.active.m3-fade-enter {
  animation: m3-fade-through-in .35s var(--ease-standard) both;
}

/* ── 12. ICON BUTTON REDESIGN (Material 3 standard) ── */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s var(--ease-standard), transform .12s var(--ease-standard);
  position: relative;
  color: var(--text);
  overflow: hidden;
  font-size: .9rem;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }
.icon-btn:active { transform: scale(.88); }
html.dark-mode .icon-btn:hover { background: rgba(255,255,255,.08); }

/* ---------- VIEW TRANSITION (cross-document, Chrome 111+) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: vt-fade-out .15s ease-out both;
}
::view-transition-new(root) {
  animation: vt-fade-in .2s ease-in both;
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } }

/* =============================================
   MODERN UI UPGRADE — 10 Features
   ============================================= */

/* ---------- 1. STAGGERED LIST ANIMATIONS ---------- */
.stagger-item {
  opacity: 0;
  transform: translateY(18px);
  animation: staggerIn .35s var(--ease-standard) both;
}
@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 2. GLASSMORPHISM OVERLAYS ---------- */
.modal-overlay {
  background: rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}
html.dark-mode .modal-overlay {
  background: rgba(0,0,0,.4);
}
.modal-sheet {
  background: rgba(var(--surface-rgb, 255,255,255), .88);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
}
html.dark-mode .modal-sheet {
  background: rgba(30,32,34, .85);
}

/* ---------- 3. SWIPE ACTIONS ON CHAT LIST ---------- */
.chat-item-swipe-wrap {
  position: relative;
  overflow: hidden;
}
.chat-swipe-actions {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.chat-swipe-actions.left  { left: 0; }
.chat-swipe-actions.right { right: 0; }
.chat-item-swipe-wrap.swiping .chat-swipe-actions { opacity: 1; pointer-events: auto; }
.chat-swipe-action {
  width: 72px; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .2rem;
  font-size: .65rem; font-weight: 600;
  color: #fff; border: none; cursor: pointer;
  font-family: inherit;
}
.chat-swipe-action.delete { background: #E53935; }
.chat-swipe-action.pin    { background: #FB8C00; }
.chat-swipe-action.mute   { background: #7B1FA2; }
.chat-swipe-action .material-symbols-rounded { font-size: 1.2rem; }

/* ---------- 4. ANIMATED COUNTERS ---------- */
.anim-counter {
  display: inline-block;
  transition: transform .3s var(--ease-spring);
}
.anim-counter.counting {
  animation: counterPop .4s var(--ease-spring);
}
@keyframes counterPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ---------- 5. MODERN EMPTY STATES ---------- */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  animation: emptyFadeIn .5s var(--ease-standard) both;
}
.empty-state-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--muted);
}
.empty-state-icon .material-symbols-rounded { font-size: 2.2rem; }
.empty-state-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text); margin-bottom: .4rem;
}
.empty-state-desc {
  font-size: .82rem; color: var(--muted);
  line-height: 1.5; max-width: 260px;
  margin-bottom: 1.25rem;
}
.empty-state-btn {
  padding: .55rem 1.5rem;
  background: var(--gold); color: #fff;
  border: none; border-radius: 24px;
  font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: transform .12s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(31,111,92,.25);
}
.empty-state-btn:active { transform: scale(.95); }
@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 6. SCROLL-DRIVEN HEADER MORPH ---------- */
.topbar.m3-collapsible {
  transition: background .25s, box-shadow .25s, padding .25s;
}
.topbar.m3-collapsible .topbar-row {
  transition: padding .25s var(--ease-standard);
}
.m3-topbar-title-large {
  transition: font-size .25s var(--ease-standard),
              opacity .25s var(--ease-standard),
              max-height .3s var(--ease-standard),
              padding .25s var(--ease-standard),
              transform .25s var(--ease-standard);
  transform-origin: left center;
}
.topbar.m3-collapsible.shrunk .m3-topbar-title-large {
  font-size: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-8px) scale(.9);
}
.topbar.m3-collapsible.shrunk {
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(var(--surface-rgb, 255,255,255), .82);
}
html.dark-mode .topbar.m3-collapsible.shrunk {
  background: rgba(30,32,34, .8);
}

/* ---------- 7. FAB SPEED DIAL ---------- */
.fab-speed-dial {
  position: absolute;
  bottom: 94px; inset-inline-end: 18px;
  z-index: 51;
}
.fab-main {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold); color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 52;
  transition: transform .25s var(--ease-spring), box-shadow .2s;
}
.fab-main:active { transform: scale(.9); }
.fab-main svg {
  transition: transform .3s var(--ease-spring);
}
.fab-speed-dial.open .fab-main svg {
  transform: rotate(45deg);
}
.fab-dial-options {
  position: absolute;
  bottom: 68px; inset-inline-end: 4px;
  display: flex; flex-direction: column-reverse;
  gap: .6rem;
  pointer-events: none;
}
.fab-dial-item {
  display: flex; align-items: center; gap: .55rem;
  flex-direction: row-reverse;
  opacity: 0;
  transform: translateY(16px) scale(.7);
  transition: all .2s var(--ease-spring);
  pointer-events: none;
}
.fab-speed-dial.open .fab-dial-item {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-speed-dial.open .fab-dial-item:nth-child(1) { transition-delay: 0s; }
.fab-speed-dial.open .fab-dial-item:nth-child(2) { transition-delay: .05s; }
.fab-speed-dial.open .fab-dial-item:nth-child(3) { transition-delay: .1s; }
.fab-dial-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gold);
  transition: transform .12s;
}
.fab-dial-btn:active { transform: scale(.88); }
.fab-dial-label {
  font-size: .72rem; font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .3rem .65rem;
  border-radius: 8px;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  white-space: nowrap;
}
.fab-dial-overlay {
  position: fixed; inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.15);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.fab-speed-dial.open ~ .fab-dial-overlay,
.fab-speed-dial.open .fab-dial-overlay {
  opacity: 1; pointer-events: auto;
}

/* ---------- 8. CHAT BUBBLE TAILS ---------- */
.bubble.me::after {
  content: '';
  position: absolute;
  bottom: 0; right: -6px;
  width: 12px; height: 12px;
  background: #E7FBD5;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  border-bottom-right-radius: 3px;
}
html.dark-mode .bubble.me::after {
  background: #17694F;
}
.bubble.them::after {
  content: '';
  position: absolute;
  bottom: 0; left: -6px;
  width: 12px; height: 12px;
  background: var(--surface);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
  border-bottom-left-radius: 3px;
}
html.dark-mode .bubble.them::after {
  background: var(--bg3);
}
.bubble.sticker::after,
.bubble.bubble-emoji::after { display: none !important; }

/* ---------- 9. HAPTIC-STYLE PRESS FEEDBACK ---------- */
.press-feedback {
  transition: transform .12s var(--ease-spring);
  -webkit-user-select: none;
  user-select: none;
}
.press-feedback:active {
  transform: scale(.95);
}
.qt-tile:active {
  transform: scale(.92);
  transition: transform .1s var(--ease-spring);
}
.nav-item:active {
  transform: scale(.88);
  transition: transform .08s var(--ease-spring);
}
.cc-chip:active, .cc-post:active {
  transform: scale(.93);
  transition: transform .1s var(--ease-spring);
}
.see-all:active {
  transform: scale(.92);
  transition: transform .08s var(--ease-spring);
}
.settings-item:active {
  transform: scale(.98);
  transition: transform .1s var(--ease-spring);
}
.ch-prev-card:active {
  transform: scale(.96);
  transition: transform .12s var(--ease-spring);
}

/* ---------- 10. SHIMMER LOADING UPGRADE ---------- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--bg3) 0%,
    var(--bg3) 20%,
    var(--bg4) 35%,
    var(--bg4) 40%,
    var(--bg3) 55%,
    var(--bg3) 100%);
  background-size: 900px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 10px;
}
.skeleton-circle {
  background: linear-gradient(90deg,
    var(--bg3) 0%, var(--bg3) 20%, var(--bg4) 35%, var(--bg4) 40%, var(--bg3) 55%, var(--bg3) 100%);
  background-size: 900px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 50%;
}
.skeleton-text {
  height: .85em;
  background: linear-gradient(90deg,
    var(--bg3) 0%, var(--bg3) 20%, var(--bg4) 35%, var(--bg4) 40%, var(--bg3) 55%, var(--bg3) 100%);
  background-size: 900px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 6px;
  margin-bottom: .4em;
}
.skeleton-card {
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  padding: 1.15rem;
  margin-bottom: .75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Surface RGB token for glassmorphism */
:root { --surface-rgb: 255,255,255; }
html.dark-mode { --surface-rgb: 30,32,34; }

/* =============================================
   MODERN UI UPGRADE ROUND 2 — 8 Features
   ============================================= */

/* ---------- 1. NOTIFICATION BADGE BOUNCE ---------- */
.nav-badge {
  transition: transform .2s var(--ease-spring);
}
.nav-badge.bounce {
  animation: badgeBounce .5s var(--ease-spring);
}
@keyframes badgeBounce {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.5); }
  50%  { transform: scale(.8); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.nav-badge.pop-in {
  animation: badgePopIn .35s var(--ease-spring) both;
}
@keyframes badgePopIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- 2. PROFILE PARALLAX COVER ---------- */
.profile-cover {
  transform: translateZ(0);
  will-change: transform;
  transition: transform .1s linear;
}
.profile-avatar-wrap {
  transition: transform .2s var(--ease-standard);
  will-change: transform;
}
.profile-avatar-big {
  transition: transform .2s var(--ease-standard), width .2s, height .2s;
}
.profile-cover-blur {
  position: absolute; inset: 0;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  transition: backdrop-filter .15s, -webkit-backdrop-filter .15s;
  pointer-events: none;
}

/* ---------- 3. TYPING INDICATOR UPGRADE — iMessage wave ---------- */
.typing-dots-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: .15rem 0;
}
.typing-dots-wave span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: typingWave 1.4s ease-in-out infinite;
}
.typing-dots-wave span:nth-child(2) { animation-delay: .2s; }
.typing-dots-wave span:nth-child(3) { animation-delay: .4s; }
@keyframes typingWave {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- 4. IMAGE ZOOM GESTURE ---------- */
.img-zoom-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center;
  transition: background .25s;
  cursor: zoom-out;
}
.img-zoom-overlay.active { background: rgba(0,0,0,.92); }
.img-zoom-overlay img {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(.5);
  opacity: 0;
  transition: transform .3s var(--ease-spring), opacity .2s;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.img-zoom-overlay.active img {
  transform: scale(1);
  opacity: 1;
}

/* ---------- 5. PULL-TO-REFRESH UPGRADE — Material spinner ---------- */
.ptr-indicator {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  border: none;
}
.ptr-indicator svg {
  color: var(--gold);
}
.ptr-indicator.refreshing svg {
  animation: ptr-spin .7s cubic-bezier(.4,0,.2,1) infinite;
}
.ptr-indicator.pulling {
  transition: transform .15s, opacity .15s;
}

/* ---------- 6. SETTINGS CARDS SECTIONS ---------- */
.settings-card {
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.04);
  border-radius: 18px;
  overflow: hidden;
}
html.dark-mode .settings-card {
  box-shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.04);
}
.settings-section-title {
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 1rem 1rem .4rem;
}
.settings-item-row {
  padding: .85rem 1.1rem;
  gap: .75rem;
  transition: background .12s, transform .1s var(--ease-spring);
}
.settings-item-row[onclick]:active {
  transform: scale(.98);
}
.settings-item-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .9rem;
}

/* ---------- 7. MESSAGE SEND ANIMATION ---------- */
@keyframes msgSend {
  0%   { opacity: 0; transform: translateY(24px) scale(.92); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-wrap.sending {
  animation: msgSend .35s var(--ease-spring) both;
}

/* ---------- 8. TAB SWITCH ANIMATION ---------- */
@keyframes tabContentIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-content-enter {
  animation: tabContentIn .22s var(--ease-standard) both;
}


